Imagen inversa de la unión general
Demostrar que
1 |
f⁻¹[⋃ i, B i] = ⋃ i, f⁻¹[B i] |
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*} {I : Type*} variable f : α → β variables B : I → set β example : f ⁻¹' (⋃ i, B i) = ⋃ i, f ⁻¹' (B i) := 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 |
import data.set.basic import tactic open set variables {α : Type*} {β : Type*} {I : Type*} variable f : α → β variables B : I → set β -- 1ª demostración -- =============== example : f ⁻¹' (⋃ i, B i) = ⋃ i, f ⁻¹' (B i) := begin ext x, split, { intro hx, rw mem_preimage at hx, rw mem_Union at hx, cases hx with i fxBi, rw mem_Union, use i, apply mem_preimage.mpr, exact fxBi, }, { intro hx, rw mem_preimage, rw mem_Union, rw mem_Union at hx, cases hx with i xBi, use i, rw mem_preimage at xBi, exact xBi, }, end -- 2ª demostración -- =============== example : f ⁻¹' (⋃ i, B i) = ⋃ i, f ⁻¹' (B i) := preimage_Union -- 3ª demostración -- =============== example : f ⁻¹' (⋃ i, B i) = ⋃ i, f ⁻¹' (B i) := by simp |
Se puede interactuar con la prueba anterior en esta sesión con Lean,
En los comentarios se pueden escribir otras soluciones, escribiendo el código entre una línea con <pre lang="isar"> y otra con </pre>
[/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 |
theory Imagen_inversa_de_la_union_general imports Main begin (* 1ª demostración *) lemma "f -` (⋃ i ∈ I. B i) = (⋃ i ∈ I. f -` B i)" proof (rule equalityI) show "f -` (⋃ i ∈ I. B i) ⊆ (⋃ i ∈ I. f -` B i)" proof (rule subsetI) fix x assume "x ∈ f -` (⋃ i ∈ I. B i)" then have "f x ∈ (⋃ i ∈ I. B i)" by (rule vimageD) then show "x ∈ (⋃ i ∈ I. f -` B i)" proof (rule UN_E) fix i assume "i ∈ I" assume "f x ∈ B i" then have "x ∈ f -` B i" by (rule vimageI2) with ‹i ∈ I› show "x ∈ (⋃ i ∈ I. f -` B i)" by (rule UN_I) qed qed next show "(⋃ i ∈ I. f -` B i) ⊆ f -` (⋃ i ∈ I. B i)" proof (rule subsetI) fix x assume "x ∈ (⋃ i ∈ I. f -` B i)" then show "x ∈ f -` (⋃ i ∈ I. B i)" proof (rule UN_E) fix i assume "i ∈ I" assume "x ∈ f -` B i" then have "f x ∈ B i" by (rule vimageD) with ‹i ∈ I› have "f x ∈ (⋃ i ∈ I. B i)" by (rule UN_I) then show "x ∈ f -` (⋃ i ∈ I. B i)" by (rule vimageI2) qed qed qed (* 2ª demostración *) lemma "f -` (⋃ i ∈ I. B i) = (⋃ i ∈ I. f -` B i)" proof show "f -` (⋃ i ∈ I. B i) ⊆ (⋃ i ∈ I. f -` B i)" proof fix x assume "x ∈ f -` (⋃ i ∈ I. B i)" then have "f x ∈ (⋃ i ∈ I. B i)" by simp then show "x ∈ (⋃ i ∈ I. f -` B i)" proof fix i assume "i ∈ I" assume "f x ∈ B i" then have "x ∈ f -` B i" by simp with ‹i ∈ I› show "x ∈ (⋃ i ∈ I. f -` B i)" by (rule UN_I) qed qed next show "(⋃ i ∈ I. f -` B i) ⊆ f -` (⋃ i ∈ I. B i)" proof fix x assume "x ∈ (⋃ i ∈ I. f -` B i)" then show "x ∈ f -` (⋃ i ∈ I. B i)" proof fix i assume "i ∈ I" assume "x ∈ f -` B i" then have "f x ∈ B i" by simp with ‹i ∈ I› have "f x ∈ (⋃ i ∈ I. B i)" by (rule UN_I) then show "x ∈ f -` (⋃ i ∈ I. B i)" by simp qed qed qed (* 3ª demostración *) lemma "f -` (⋃ i ∈ I. B i) = (⋃ i ∈ I. f -` B i)" by (simp only: vimage_UN) (* 4ª demostración *) lemma "f -` (⋃ i ∈ I. B i) = (⋃ i ∈ I. f -` B i)" by auto end |
En los comentarios se pueden escribir otras soluciones, escribiendo el código entre una línea con <pre lang="isar"> y otra con </pre>
[/expand]