Tarski's geometry axioms in terms of real numbers

Tarki's geometry axioms provide a set of axioms for Euclidian geometry which are based only on the concepts of congruence and betweenness: they make no reference to numbers. Here we show how to derive those axioms from real numbers.

We import Interface:Classical propositional calculus, Interface:First-order logic with quantifiability, Interface:Set theory, and Interface:Complex number axioms.

 import (CLASSICAL Interface:Classical_propositional_calculus ) import (QUANTIFY_OVER_SETS Interface:First-order_logic_with_quantifiability (CLASSICAL) set.) import (SETS Interface:Set_theory (CLASSICAL QUANTIFY_OVER_SETS) ) import (COMPLEX Interface:Complex_numbers (CLASSICAL QUANTIFY_OVER_SETS SETS) ) 

We also import an interface, Interface:Restricting all quantifiers, which provides the mapping between quantifiers which range over sets and quantifiers which range over points. The reason for this to be a separate interface rather than just a set of definitions and theorems in this file is that when it comes time to export to Interface:Tarski's geometry axioms, we'll need an interface to pass as a parameter.  def ((universe) ((ℝ) × (ℝ))) export (UNIVERSE Interface:Universe (CLASSICAL QUANTIFY_OVER_SETS SETS) )

import (QUANTIFY_OVER_POINTS Interface:Restricting_all_quantifiers (CLASSICAL QUANTIFY_OVER_SETS SETS UNIVERSE) ) 

The interface Interface:Restricting all quantifiers defines a kind for restricted terms called, which corresponds to a point.  kindbind (object point) 

Now we define some variables.

 var (variable x y z w) var (object X Y Z W) var (set.variable a b c) var (set.object A B C D) var (formula φ) 

Congruence
We define congruence using the usual Pythagorean theorem based definition for Cartesian two-dimensional space. The Tarski and Givant paper has a diagram. The definition is interesting if  is an ordered pair , where   and   are real numbers, and likewise for  ,  , and.  def ((set.≡ A B C D) ( ((((1st A) − (1st B)) · ((1st A) − (1st B))) +   (((2nd A) − (2nd B)) · ((2nd A) − (2nd B)))) set.= ((((1st C) − (1st D)) · ((1st C) − (1st D))) +   (((2nd C) − (2nd D)) · ((2nd C) − (2nd D)))) ))

def ((≡ X Y Z W) (set.≡ (asSet X) (asSet Y) (asSet Z) (asSet W))) 

The coordinates of points are real
Given two points (as sets), the first and second coordinates are complex (in fact, they are real, but it will sometimes be convenient to say that they are complex without the extra step of saying that any real number is a complex number).  thm (set.TwoPointsRealParts   (((A ∈ ((ℝ) × (ℝ))) ∧ (B ∈ ((ℝ) × (ℝ)))) → ((((1st A) ∈ (ℝ)) ∧ ((2nd A) ∈ (ℝ))) ∧     (((1st B) ∈ (ℝ)) ∧ ((2nd B) ∈ (ℝ))))) ( A (ℝ) (ℝ) FirstSecondCartesianProduct B (ℝ) (ℝ) FirstSecondCartesianProduct conjoin ))

thm (RealComplexMembership  ((A ∈ (ℝ)) → (A ∈ (ℂ))) ( RealComplex (ℝ) (ℂ) A SubsetMembership applyModusPonens ))

thm (set.TwoPointsComplexParts   (((A ∈ ((ℝ) × (ℝ))) ∧ (B ∈ ((ℝ) × (ℝ)))) → ((((1st A) ∈ (ℂ)) ∧ ((2nd A) ∈ (ℂ))) ∧     (((1st B) ∈ (ℂ)) ∧ ((2nd B) ∈ (ℂ))))) ( A B set.TwoPointsRealParts

(1st A) RealComplexMembership (2nd A) RealComplexMembership conjoin

(1st B) RealComplexMembership (2nd B) RealComplexMembership conjoin

conjoin

applySyllogism )) 

Distance from A to B is the distance from B to A
Here we will prove. Restating this in terms of sets, we need to prove.

 thm (SquareBuilder  ((A set.= B) → ((A · A) set.= (B · B))) ( (A set.= B) ConjunctionIdempotence eliminateBiconditionalReverse

A B A B MultiplicationBuilder applySyllogism ))

thm (set.CongruenceABBA-1   (((((1st A) ∈ (ℂ)) ∧ ((2nd A) ∈ (ℂ))) ∧    (((1st B) ∈ (ℂ)) ∧ ((2nd B) ∈ (ℂ)))) → (A B set.≡ B A) ) (  The left hand side of the definition of congruence expands to, which we first transform to   part.  (((1st A) ∈ (ℂ)) ∧ ((2nd A) ∈ (ℂ))) (((1st B) ∈ (ℂ)) ∧ ((2nd B) ∈ (ℂ))) ConjunctionLeftElimination eliminateRightConjunctInConsequent

(((1st A) ∈ (ℂ)) ∧ ((2nd A) ∈ (ℂ))) (((1st B) ∈ (ℂ)) ∧ ((2nd B) ∈ (ℂ))) ConjunctionRightElimination eliminateRightConjunctInConsequent

composeConjunction

(1st B) (1st A) NegativeSubtraction applySyllogism

set.swapEqualityInConsequent

((1st A) − (1st B)) (- ((1st B) − (1st A))) SquareBuilder applySyllogism  The  part is very similar.  (((1st A) ∈ (ℂ)) ∧ ((2nd A) ∈ (ℂ))) (((1st B) ∈ (ℂ)) ∧ ((2nd B) ∈ (ℂ))) ConjunctionLeftElimination eliminateLeftConjunctInConsequent

(((1st A) ∈ (ℂ)) ∧ ((2nd A) ∈ (ℂ))) (((1st B) ∈ (ℂ)) ∧ ((2nd B) ∈ (ℂ))) ConjunctionRightElimination eliminateLeftConjunctInConsequent

composeConjunction

(2nd B) (2nd A) NegativeSubtraction applySyllogism

set.swapEqualityInConsequent

((2nd A) − (2nd B)) (- ((2nd B) − (2nd A))) SquareBuilder applySyllogism

composeConjunction

(((1st A) − (1st B)) · ((1st A) − (1st B))) ((- ((1st B) − (1st A))) · (- ((1st B) − (1st A)))) (((2nd A) − (2nd B)) · ((2nd A) − (2nd B))) ((- ((2nd B) − (2nd A))) · (- ((2nd B) − (2nd A)))) AdditionBuilder applySyllogism </jh> We can now apply  to get , which is the right hand side of the definition of congruence.  (((1st A) ∈ (ℂ)) ∧ ((2nd A) ∈ (ℂ))) (((1st B) ∈ (ℂ)) ∧ ((2nd B) ∈ (ℂ))) ConjunctionLeftElimination eliminateRightConjunctInConsequent

(((1st A) ∈ (ℂ)) ∧ ((2nd A) ∈ (ℂ))) (((1st B) ∈ (ℂ)) ∧ ((2nd B) ∈ (ℂ))) ConjunctionRightElimination eliminateRightConjunctInConsequent

composeConjunction

(1st B) (1st A) SubtractionClosed applySyllogism

(((1st B) − (1st A)) ∈ (ℂ)) ConjunctionIdempotence eliminateBiconditionalReverse applySyllogism

((1st B) − (1st A)) ((1st B) − (1st A)) MultiplicationNegativeNegative applySyllogism

(((1st A) ∈ (ℂ)) ∧ ((2nd A) ∈ (ℂ))) (((1st B) ∈ (ℂ)) ∧ ((2nd B) ∈ (ℂ))) ConjunctionLeftElimination eliminateLeftConjunctInConsequent

(((1st A) ∈ (ℂ)) ∧ ((2nd A) ∈ (ℂ))) (((1st B) ∈ (ℂ)) ∧ ((2nd B) ∈ (ℂ))) ConjunctionRightElimination eliminateLeftConjunctInConsequent

composeConjunction

(2nd B) (2nd A) SubtractionClosed applySyllogism

(((2nd B) − (2nd A)) ∈ (ℂ)) ConjunctionIdempotence eliminateBiconditionalReverse applySyllogism

((2nd B) − (2nd A)) ((2nd B) − (2nd A)) MultiplicationNegativeNegative applySyllogism

composeConjunction

((- ((1st B) − (1st A))) · (- ((1st B) − (1st A)))) (((1st B) − (1st A)) · ((1st B) − (1st A))) ((- ((2nd B) − (2nd A))) · (- ((2nd B) − (2nd A)))) (((2nd B) − (2nd A)) · ((2nd B) − (2nd A))) AdditionBuilder applySyllogism

set.applyEqualityTransitivityInConsequent ))

thm (set.CongruenceABBA  (((A ∈ ((ℝ) × (ℝ))) ∧ (B ∈ ((ℝ) × (ℝ)))) → (A B set.≡ B A)) ( A B set.TwoPointsComplexParts A B set.CongruenceABBA-1 applySyllogism ))

thm (CongruenceABBA  (X Y ≡ Y X) ( X InUniverse Y InUniverse introduceConjunction

(asSet X) (asSet Y) set.CongruenceABBA applyModusPonens )) </jh>

Congruence identity
An empty line segment starts and ends at the same point. That is,  in the language of points or   in the language of sets.

Our notation is pretty verbose here, so in informal discussion we'll adopt the following simplifications. Instead of  we'll write   and instead of   we'll write. So  becomes.

The sketch of the proof is that we'll expand  into   and , which leads to.

We can start with, which we prove by means of a series of simpler lemmas.  thm (set.CongruenceIdentity-d   ((D ∈ (ℝ)) → ((D − D) set.= (0))) ( D RealComplexMembership D SubtractionItself applySyllogism ))


 * 1) thm (set.CongruenceIdentity-d-2
 * 2)  ((D ∈ (ℝ)) →
 * 3)    (((D − D) · (D − D)) = (0))) (

</jh>
 * 1) thm (set.CongruenceIdentity-c-0
 * 2)  ((((1st C) ∈ (ℝ)) ∧ ((2nd C) ∈ (ℝ))) →
 * 3)    (((((1st C) − (1st C)) · ((1st C) − (1st C))) + (((2nd C) − (2nd C)) · ((2nd C) − (2nd C)))) = (0))) (

Now we are ready to combine that result with the expansion of.  </jh> Expanding  gives us. 
 * 1) thm (set.CongruenceIdentity-2
 * 2)  ((((((1st A) ∈ (ℝ)) ∧ ((2nd A) ∈ (ℝ))) ∧
 * 3)    (((1st B) ∈ (ℝ)) ∧ ((2nd B) ∈ (ℝ)))) ∧
 * 4)    (((1st C) ∈ (ℝ)) ∧ ((2nd C) ∈ (ℝ)))) →
 * 5)    ((A B set.≡ C C) →
 * 6)      (((((1st A) − (1st B)) · ((1st A) − (1st B))) + (((2nd A) − (2nd B)) · ((2nd A) − (2nd B)))) = (0)))) (


 * 1) thm (set.CongruenceIdentity-5
 * 2)  ((((((1st A) ∈ (ℝ)) ∧ ((2nd A) ∈ (ℝ))) ∧
 * 3)    (((1st B) ∈ (ℝ)) ∧ ((2nd B) ∈ (ℝ)))) ∧
 * 4)    (((1st C) ∈ (ℝ)) ∧ ((2nd C) ∈ (ℝ)))) →
 * 5)    ((A B set.≡ C C) → (A set.= B))) (


 * 1) thm (set.CongruenceIdentity  ((((A ∈ ((ℝ) × (ℝ))) ∧ (B ∈ ((ℝ) × (ℝ)))) ∧ (C ∈ ((ℝ) × (ℝ)))) →
 * 2)  (A B set.≡ C C) → (A set.= B)) (

</jh>
 * 1) thm (CongruenceIdentity  ((X Y ≡ Z Z) → (X = Y)) (

Betweenness
Betweenness is a matter of asserting that the slopes of the line segments between pairs of points are equal, and that the signs of the differences between the coordinates of the points are correct. Again, the Tarski and Givant paper has a diagram and more explanation.  def ((set.between A B C) ((((((1st A) − (1st B)) · ((2nd B) − (2nd C))) set.= (((2nd A) − (2nd B)) · ((1st B) − (1st C)))) ∧  ((0) ≤ (((1st A) − (1st B)) · ((1st B) − (1st C))))) ∧ ((0) ≤ (((2nd A) − (2nd B)) · ((2nd B) − (2nd C))))) )

def ((between X Y Z) (set.between (asSet X) (asSet Y) (asSet Z))) </jh>

Now we export to Interface:Tarski's geometry axioms. (Or, rather, we will when we are ready).  </jh>
 * 1) export (TARSKI Interface:Tarski's_geometry_axioms (CLASSICAL QUANTIFY_OVER_POINTS) )