Complex numbers as pairs of reals

A complex number can be broken into two real numbers: a real part and an imaginary part. Here we construct the complex numbers from the reals in this way.

We import Interface:Classical propositional calculus, Interface:First-order logic with quantifiability, and Interface:Set theory. We also import Interface:Real number axioms and define some variables:  import (PROPOSITIONAL Interface:Classical_propositional_calculus ) import (FIRSTORDER Interface:First-order_logic_with_quantifiability (PROPOSITIONAL) ) import (SETS Interface:Set_theory (PROPOSITIONAL FIRSTORDER) )

import (REALS Interface:Real_number_axioms (PROPOSITIONAL FIRSTORDER SETS) ) 

Complex numbers
We start by defining the set of complex numbers,, as. Everything we will be exporting to Interface:Complex number axioms is prefixed with  We need to make this distinction to avoid naming conflicts. In particular,  is the set of real numbers we started with, but   is a subset of , containing those numbers with imaginary part zero.  def ((complex.ℂ) ((ℝ) × (ℝ))) 

We will refer to a complex number with real part  and imaginary part   as , although we haven't developed concepts of addition, multiplication, or the imaginary unit   to really justify that notation yet.

We will typically use  and   to refer to complex numbers.  var (object z w) 

Addition
Adding  to   yields.

 def ((complex.+ z w) (orderedPair ((1st z) + (1st w)) ((2nd z) + (2nd w)))) 

Multiplication
Multiplying  by   yields.

Export
 
 * 1) export (COMPLEX Interface:Complex_number_axioms (PROPOSITIONAL FIRSTORDER SETS) complex.)