Real numbers as a subset of complex numbers

The real numbers can be seen as those complex numbers which have imaginary part zero. In our context, that means we can prove Interface:Real numbers from complex numbers. Starting from Interface:Complex numbers, this is fairly simple because it already has many theorems for the reals, so here we just need to restate a few variations, or in some cases prove that an operation applied to real numbers yields reals.

We import the interfaces we build on, which are logic, set theory, and the complex numbers.  import (PROPOSITIONAL Interface:Classical_propositional_calculus ) import (FIRSTORDER Interface:First-order_logic_with_quantifiability (PROPOSITIONAL) ) import (SETS Interface:Set_theory (PROPOSITIONAL FIRSTORDER) )

import (START Interface:Complex_numbers (PROPOSITIONAL FIRSTORDER SETS) )

var (object a b c) 

A real number is a complex number
Here's a convenience theorem which is an easy consequence of.  thm (RealComplexMembership  ((a ∈ (ℝ)) → (a ∈ (ℂ))) ( RealComplex (ℝ) (ℂ) a SubsetMembership applyModusPonens )) 

Addition
For commutativity and associativity, we have them for the complex numbers, and we just need to restate them for reals (via the fact that a real is complex).  thm (RealAdditionCommutativity  (((a ∈ (ℝ)) ∧ (b ∈ (ℝ))) → ((a + b) = (b + a))) ( a RealComplexMembership b RealComplexMembership conjoin

a b AdditionCommutativity applySyllogism ))

thm (RealAdditionAssociativity  ((((a ∈ (ℝ)) ∧ (b ∈ (ℝ))) ∧ (c ∈ (ℝ))) → (((a + b) + c) = (a + (b + c)))) ( a RealComplexMembership b RealComplexMembership conjoin c RealComplexMembership conjoin

a b c AdditionAssociativity applySyllogism )) 

Multiplication
Similarly, a number of our multiplication theorems just need to be stated for reals, based directly on complex number versions.  thm (RealMultiplicationCommutativity  (((a ∈ (ℝ)) ∧ (b ∈ (ℝ))) → ((a · b) = (b · a))) ( a RealComplexMembership b RealComplexMembership conjoin

a b MultiplicationCommutativity applySyllogism ))

thm (RealMultiplicationAssociativity  ((((a ∈ (ℝ)) ∧ (b ∈ (ℝ))) ∧ (c ∈ (ℝ))) → (((a · b) · c) = (a · (b · c)))) ( a RealComplexMembership b RealComplexMembership conjoin c RealComplexMembership conjoin

a b c MultiplicationAssociativity applySyllogism )) 

Distributivity
 thm (RealDistributivity  ((((a ∈ (ℝ)) ∧ (b ∈ (ℝ))) ∧ (c ∈ (ℝ))) → ((a · (b + c)) = ((a · b) + (a · c)))) ( a RealComplexMembership b RealComplexMembership conjoin c RealComplexMembership conjoin

a b c Distributivity applySyllogism )) 

Identities
 thm (RealMultiplicativeIdentity  ((a ∈ (ℝ)) → ((a · (1)) = a)) ( a RealComplexMembership a MultiplicativeIdentity applySyllogism ))

thm (RealAdditiveIdentity  ((a ∈ (ℝ)) → ((a + (0)) = a)) ( a RealComplexMembership a AdditiveIdentity applySyllogism )) 

Subtraction
We start with another theorem where we merely restate something in terms of reals.  thm (RealSubtraction  (((a ∈ (ℝ)) ∧ (b ∈ (ℝ))) → ((a − b) = (a + (- b)))) ( a RealComplexMembership b RealComplexMembership conjoin

a b Subtraction applySyllogism )) 

Closure
Now we need to prove something nontrivial. Namely, that subtracting two real numbers yields a real number (not just a complex number). Fortunately,  enables us to prove this in terms of closure of addition and additive inverse.  thm (RealSubtractionClosedLemma  (((a ∈ (ℝ)) ∧ (b ∈ (ℝ))) → ((a + (- b)) ∈ (ℝ))) ( b RealAdditiveInverseClosed (a ∈ (ℝ)) conjoinLL

a (- b) RealAdditionClosure applySyllogism ))

thm (RealSubtractionClosed  (((a ∈ (ℝ)) ∧ (b ∈ (ℝ))) → ((a − b) ∈ (ℝ))) ( a b RealSubtractionClosedLemma

a b RealSubtraction  Our substitution is.  (a − b) (a + (- b)) (ℝ) MembershipBuilderRR applySyllogism

eliminateBiconditionalForwardInConsequent

applyModusPonensInConsequent )) </jh>

Subtracting a real number from itself
Here are another few theorems where we just need to restate them for reals, already having the corresponding theorem for complex numbers.  thm (RealSubtractionItself  ((a ∈ (ℝ)) → ((a − a) = (0))) ( a RealComplexMembership a SubtractionItself applySyllogism ))

thm (RealZeroDifferenceEquality  (((a ∈ (ℝ)) ∧ (b ∈ (ℝ))) → (((a − b) = (0)) ↔ (a = b))) ( a RealComplexMembership b RealComplexMembership conjoin

a b ZeroDifferenceEquality applySyllogism )) </jh>

More properties of negation
Here are another few theorems where we just need to restate them for reals, already having the corresponding theorem for complex numbers.  thm (RealMultiplicationNegativeNegative  (((a ∈ (ℝ)) ∧ (b ∈ (ℝ))) → (((- a) · (- b)) = (a · b))) ( a RealComplexMembership b RealComplexMembership conjoin

a b MultiplicationNegativeNegative applySyllogism ))

thm (RealNegativeSubtraction  (((a ∈ (ℝ)) ∧ (b ∈ (ℝ))) → ((- (a − b)) = (b − a))) ( a RealComplexMembership b RealComplexMembership conjoin

a b NegativeSubtraction applySyllogism )) </jh>

Reciprocal and division
Division can be defined as multiplication with a reciprocal for all complex numbers, so we just need to restate it for reals.  thm (RealDivision  ((((a ∈ (ℝ)) ∧ (b ∈ (ℝ))) ∧ (b ≠ (0))) → ((a / b) = (a · ((1) / b)))) ( a RealComplexMembership b RealComplexMembership conjoin

(b ≠ (0)) conjoinRR

a b Division applySyllogism )) </jh>

The ability of the reciprocal to serve as a multiplicative inverse is similar.  thm (RealReciprocal  (((a ∈ (ℝ)) ∧ (a ≠ (0))) → ((a · ((1) / a)) = (1))) ( a RealComplexMembership (a ≠ (0)) conjoinRR

a Reciprocal applySyllogism )) </jh>

Dividing a real by a real
We next want to show that dividing one real number by another real number produces a real number.  thm (RealDivisionClosedLemma  ((((a ∈ (ℝ)) ∧ (b ∈ (ℝ))) ∧ (b ≠ (0))) → ((a · ((1) / b)) ∈ (ℝ))) ( (((a ∈ (ℝ)) ∧ (b ∈ (ℝ))) ∧ (b ≠ (0))) ImplicationReflexivity associateConjunctionRightInConsequent

b RealReciprocalClosed (a ∈ (ℝ)) conjoinLL applySyllogism

a ((1) / b) RealMultiplicationClosure applySyllogism ))

thm (RealDivisionClosed  ((((a ∈ (ℝ)) ∧ (b ∈ (ℝ))) ∧ (b ≠ (0))) → ((a / b) ∈ (ℝ))) ( a b RealDivisionClosedLemma

a b RealDivision </jh> Our substitution is.  (a / b) (a · ((1) / b)) (ℝ) MembershipBuilderRR applySyllogism

eliminateBiconditionalForwardInConsequent

applyModusPonensInConsequent )) </jh>

Square root
A number of theorems about square roots were provided by Interface:Complex numbers, but here we show that. Since this holds for complex numbers, we can just treat nonnegative real numbers as a special case.  thm (RealSquareRoot  (((a ∈ (ℝ)) ∧ (a ≥ (0))) → (((√ a) · (√ a)) = a)) ( (a ∈ (ℝ)) (a ≥ (0)) ConjunctionRightElimination

a RealComplexMembership applySyllogism

a SquareRoot applySyllogism )) </jh>

Export
 export (COMPLEX Interface:Real_numbers (PROPOSITIONAL FIRSTORDER SETS) ) </jh>