Imagen de la intersección
Demostrar que
1 |
f[s ∩ t] ⊆ f[s] ∩ f[t] |
Para ello, completar la siguiente teoría de Lean:
1 2 3 4 5 6 7 8 9 10 11 |
import data.set.basic import tactic open set variables {α : Type*} {β : Type*} variable f : α → β variables s t : set α example : f '' (s ∩ t) ⊆ f '' s ∩ f '' t := sorry |
[expand title=»Soluciones con Lean»]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
import data.set.basic import tactic open set variables {α : Type*} {β : Type*} variable f : α → β variables s t : set α -- 1ª demostración -- =============== example : f '' (s ∩ t) ⊆ f '' s ∩ f '' t := begin intros y hy, cases hy with x hx, cases hx with xst fxy, split, { use x, split, { exact xst.1, }, { exact fxy, }}, { use x, split, { exact xst.2, }, { exact fxy, }}, end -- 2ª demostración -- =============== example : f '' (s ∩ t) ⊆ f '' s ∩ f '' t := begin intros y hy, rcases hy with ⟨x, ⟨xs, xt⟩, fxy⟩, split, { use x, exact ⟨xs, fxy⟩, }, { use x, exact ⟨xt, fxy⟩, }, end -- 3ª demostración -- =============== example : f '' (s ∩ t) ⊆ f '' s ∩ f '' t := begin rintros y ⟨x, ⟨xs, xt⟩, fxy⟩, split, { use [x, xs, fxy], }, { use [x, xt, fxy], }, end -- 4ª demostración -- =============== example : f '' (s ∩ t) ⊆ f '' s ∩ f '' t := image_inter_subset f s t -- 5ª demostración -- =============== example : f '' (s ∩ t) ⊆ f '' s ∩ f '' t := by intro ; finish |
Se puede interactuar con la prueba anterior en esta sesión con Lean,
[/expand]
[expand title=»Soluciones con Isabelle/HOL»]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
theory Imagen_de_la_interseccion imports Main begin section ‹1ª demostración› lemma "f ` (s ∩ t) ⊆ f ` s ∩ f ` t" proof (rule subsetI) fix y assume "y ∈ f ` (s ∩ t)" then have "y ∈ f ` s" proof (rule imageE) fix x assume "y = f x" assume "x ∈ s ∩ t" have "x ∈ s" using ‹x ∈ s ∩ t› by (rule IntD1) then have "f x ∈ f ` s" by (rule imageI) with ‹y = f x› show "y ∈ f ` s" by (rule ssubst) qed moreover note ‹y ∈ f ` (s ∩ t)› then have "y ∈ f ` t" proof (rule imageE) fix x assume "y = f x" assume "x ∈ s ∩ t" have "x ∈ t" using ‹x ∈ s ∩ t› by (rule IntD2) then have "f x ∈ f ` t" by (rule imageI) with ‹y = f x› show "y ∈ f ` t" by (rule ssubst) qed ultimately show "y ∈ f ` s ∩ f ` t" by (rule IntI) qed section ‹2ª demostración› lemma "f ` (s ∩ t) ⊆ f ` s ∩ f ` t" proof fix y assume "y ∈ f ` (s ∩ t)" then have "y ∈ f ` s" proof fix x assume "y = f x" assume "x ∈ s ∩ t" have "x ∈ s" using ‹x ∈ s ∩ t› by simp then have "f x ∈ f ` s" by simp with ‹y = f x› show "y ∈ f ` s" by simp qed moreover note ‹y ∈ f ` (s ∩ t)› then have "y ∈ f ` t" proof fix x assume "y = f x" assume "x ∈ s ∩ t" have "x ∈ t" using ‹x ∈ s ∩ t› by simp then have "f x ∈ f ` t" by simp with ‹y = f x› show "y ∈ f ` t" by simp qed ultimately show "y ∈ f ` s ∩ f ` t" by simp qed section ‹3ª demostración› lemma "f ` (s ∩ t) ⊆ f ` s ∩ f ` t" proof fix y assume "y ∈ f ` (s ∩ t)" then obtain x where hx : "y = f x ∧ x ∈ s ∩ t" by auto then have "y = f x" by simp have "x ∈ s" using hx by simp have "x ∈ t" using hx by simp have "y ∈ f ` s" using ‹y = f x› ‹x ∈ s› by simp moreover have "y ∈ f ` t" using ‹y = f x› ‹x ∈ t› by simp ultimately show "y ∈ f ` s ∩ f ` t" by simp qed section ‹4ª demostración› lemma "f ` (s ∩ t) ⊆ f ` s ∩ f ` t" by (simp only: image_Int_subset) section ‹5ª demostración› lemma "f ` (s ∩ t) ⊆ f ` s ∩ f ` t" by auto end |
[expand title=»Nuevas soluciones»]
- En los comentarios se pueden escribir nuevas soluciones.
- El código se debe escribir entre una línea con <pre lang="lean"> (o <pre lang="isar">) y otra con </pre>
[/expand]