La equipotencia es una relación simétrica
Dos conjuntos A y B son equipotentes (y se denota por A ≃ B) si existe una aplicación biyectiva entre ellos. La equipotencia se puede definir en Lean por
1 2 3 4 |
def es_equipotente (A B : Type*) := ∃ g : A → B, bijective g infix ` ⋍ `: 50 := es_equipotente |
Demostrar que la relación de equipotencia es simétrica.
Para ello, completar la siguiente teoría de Lean:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
import tactic open function def es_equipotente (A B : Type*) := ∃ g : A → B, bijective g infix ` ⋍ `: 50 := es_equipotente variables {X Y : Type*} variable {f : X → Y} variable {g : Y → X} example : symmetric (⋍) := 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 |
import tactic open function def es_equipotente (A B : Type*) := ∃ g : A → B, bijective g infix ` ⋍ `: 50 := es_equipotente variables {X Y : Type*} variable {f : X → Y} variable {g : Y → X} def inversa (f : X → Y) (g : Y → X) := (∀ x, (g ∘ f) x = x) ∧ (∀ y, (f ∘ g) y = y) def tiene_inversa (f : X → Y) := ∃ g, inversa g f lemma aux1 (hf : bijective f) : tiene_inversa f := begin cases (bijective_iff_has_inverse.mp hf) with g hg, by tidy, end lemma aux2 (hf : bijective f) (hg : inversa g f) : bijective g := bijective_iff_has_inverse.mpr (by use [f, hg]) -- 1ª demostración example : symmetric (⋍) := begin unfold symmetric, intros x y hxy, unfold es_equipotente at *, cases hxy with f hf, have h1 : tiene_inversa f := aux1 hf, cases h1 with g hg, use g, exact aux2 hf hg, end -- 2ª demostración example : symmetric (⋍) := begin intros x y hxy, cases hxy with f hf, cases (aux1 hf) with g hg, use [g, aux2 hf hg], end -- 3ª demostración example : symmetric (⋍) := begin rintros x y ⟨f, hf⟩, cases (aux1 hf) with g hg, use [g, aux2 hf hg], end |
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="lean"> 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 |
theory La_equipotencia_es_una_relacion_simetrica imports Main "HOL-Library.Equipollence" begin (* 1ª demostración *) lemma "symp (≈)" proof (rule sympI) fix x y :: "'a set" assume "x ≈ y" then obtain f where "bij_betw f x y" using eqpoll_def by blast then have "bij_betw (the_inv_into x f) y x" by (rule bij_betw_the_inv_into) then have "∃g. bij_betw g y x" by auto then show "y ≈ x" by (simp only: eqpoll_def) qed (* 2ª demostración *) lemma "symp (≈)" unfolding eqpoll_def symp_def using bij_betw_the_inv_into by auto (* 3ª demostración *) lemma "symp (≈)" by (simp add: eqpoll_sym sympI) 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]