Relations 2

We first import propositional logic and first-order logic.  import (CLASSICAL Interface:Classical_propositional_calculus ) import (FIRSTORDER Interface:First-order_logic_with_quantifiability (CLASSICAL) ) 

We also import Interface:Relations 1, which covers set theory up until this point.  import (START Interface:Relations_1 (CLASSICAL FIRSTORDER) ) 

As usual, capital letters starting from  are set expressions (that is, terms or "classes") and lowercase letters starting with   are set variables.  var (object A B C D A0 A1 B0 B1 α β Z) var (variable a b c x y z w a′ b′ x′ y′ z′) var (formula φ ψ antecedent) 

Membership in a cartesian product in terms of first and second elements
Another similar relationship between being a member of a cartesian product and being an ordered pair whose elements are members of the classes making up the cartesian product is. Metamath has several biconditional versions of this, but we start with this one (the missing piece to biconditionalize it is something saying that . We'll split it up into a series of lemmas.

 thm (FirstSecondCartesianProduct-A-b ((a b A) (a b B) (a b C))  (((A = (orderedPair (value b) (value c))) ∧    (((value b) ∈ B) ∧ ((value c) ∈ C))) → ((1st A) = (value b))) ( (A = (orderedPair (value b) (value c))) (((value b) ∈ B) ∧ ((value c) ∈ C)) ConjunctionRightElimination

A (orderedPair (value b) (value c)) FirstBuilder applySyllogism

(value b) (value c) First introduceRightConjunctToConsequent

(1st A) (1st (orderedPair (value b) (value c))) (value b) EqualityTransitivity applySyllogism ))

thm (FirstSecondCartesianProduct-A-B ((a b A) (a b B) (a b C))  (((A = (orderedPair (value b) (value c))) ∧    (((value b) ∈ B) ∧ ((value c) ∈ C))) → ((1st A) ∈ B)) ( (A = (orderedPair (value b) (value c))) (((value b) ∈ B) ∧ ((value c) ∈ C)) ConjunctionLeftElimination eliminateRightConjunctInConsequent

A b c B C FirstSecondCartesianProduct-A-b

(1st A) (value b) B MembershipBuilderRR applySyllogism

eliminateBiconditionalForwardInConsequent applyModusPonensInConsequent ))  We've now proved, which is half of what we are trying to prove. The proof of the other half is very similar.  thm (FirstSecondCartesianProduct-A-c ((a b A) (a b B) (a b C))  (((A = (orderedPair (value b) (value c))) ∧    (((value b) ∈ B) ∧ ((value c) ∈ C))) → ((2nd A) = (value c))) ( (A = (orderedPair (value b) (value c))) (((value b) ∈ B) ∧ ((value c) ∈ C)) ConjunctionRightElimination

A (orderedPair (value b) (value c)) SecondBuilder applySyllogism

(value b) (value c) Second introduceRightConjunctToConsequent

(2nd A) (2nd (orderedPair (value b) (value c))) (value c) EqualityTransitivity applySyllogism ))

thm (FirstSecondCartesianProduct-A-C ((a b A) (a b B) (a b C))  (((A = (orderedPair (value b) (value c))) ∧    (((value b) ∈ B) ∧ ((value c) ∈ C))) → ((2nd A) ∈ C)) ( (A = (orderedPair (value b) (value c))) (((value b) ∈ B) ∧ ((value c) ∈ C)) ConjunctionLeftElimination eliminateLeftConjunctInConsequent

A b c B C FirstSecondCartesianProduct-A-c

(2nd A) (value c) C MembershipBuilderRR applySyllogism

eliminateBiconditionalForwardInConsequent applyModusPonensInConsequent ))

thm (FirstSecondCartesianProduct ( (b c A) (b c B) (b c C))  ((A ∈ (B × C)) → (((1st A) ∈ B) ∧ ((2nd A) ∈ C))) ( A B C b c MembershipCartesianProduct eliminateBiconditionalReverse

A b c B C FirstSecondCartesianProduct-A-B A b c B C FirstSecondCartesianProduct-A-C composeConjunction

c addThereExists b addThereExists

applySyllogism

removeThereExistsInConsequent removeThereExistsInConsequent )) 

To be added
Either here or in other set theory files: induction, recursion, ordinal successors. some kinds of unions, intersection, set difference, and so on.

Export
We are ready to export to Interface:Set theory.  export (RESULT Interface:Set_theory (CLASSICAL FIRSTORDER) ) 