Las familias de conjuntos definen relaciones simétricas
Cada familia de conjuntos \(P\) define una relación de forma que dos elementos están relacionados si algún conjunto de \(P\) contiene a ambos elementos. Se puede definir en Lean4 por
def relacion (P : set (set X)) (x y : X) := ∃ A ∈ P, x ∈ A ∧ y ∈ A
Demostrar con Lean4 que si \(P\) es una familia de subconjuntos de \(X\), entonces la relación definida por \(P\) es simétrica.
Para ello, completar la siguiente teoría de Lean4:
import Mathlib.Tactic variable {X : Type} variable (P : Set (Set X)) def relacion (P : Set (Set X)) (x y : X) := ∃ A ∈ P, x ∈ A ∧ y ∈ A -- 1ª demostración -- =============== example : Symmetric (relacion P) := by intros x y hxy -- x y : X -- hxy : relacion P x y -- ⊢ relacion P y x rcases hxy with ⟨A, h1⟩ -- A : Set X -- h1 : A ∈ P ∧ x ∈ A ∧ y ∈ A have h2 : A ∈ P ∧ y ∈ A ∧ x ∈ A := by tauto exact ⟨A, h2⟩ -- 2ª demostración -- =============== example : Symmetric (relacion P) := by unfold Symmetric -- ⊢ ∀ ⦃x y : X⦄, relacion P x y → relacion P y x intros x y hxy -- x y : X -- hxy : relacion P x y -- ⊢ relacion P y x unfold relacion at * -- hxy : ∃ A, A ∈ P ∧ x ∈ A ∧ y ∈ A -- ⊢ ∃ A, A ∈ P ∧ y ∈ A ∧ x ∈ A rcases hxy with ⟨A, hAP, ⟨hxA, hyA⟩⟩ -- A : Set X -- hAP : A ∈ P -- hxA : x ∈ A -- hyA : y ∈ A use A -- 3ª demostración -- =============== example : Symmetric (relacion P) := by intros x y hxy -- x y : X -- hxy : relacion P x y -- ⊢ relacion P y x rcases hxy with ⟨A, hAP, ⟨hxA, hyA⟩⟩ -- A : Set X -- hAP : A ∈ P -- hxA : x ∈ A -- hyA : y ∈ A use A -- 4ª demostración -- =============== example : Symmetric (relacion P) := by intros x y hxy -- x y : X -- hxy : relacion P x y -- ⊢ relacion P y x rcases hxy with ⟨A, hAP, ⟨hxA, hyA⟩⟩ -- A : Set X -- hAP : A ∈ P -- hxA : x ∈ A -- hyA : y ∈ A exact ⟨A, ⟨hAP, hyA, hxA⟩⟩