Physlib

Physlib.Mathematics.RatComplexNum

Rational complex numbers

19 declarations

theorem

x=yx = y if x1=y1x_1 = y_1 and x2=y2x_2 = y_2 for rational complex numbers

For any two rational complex numbers xx and yy, if their first components are equal (x1=y1x_1 = y_1) and their second components are equal (x2=y2x_2 = y_2), then the numbers themselves are equal (x=yx = y).

definition

`RatComplexNum` is equivalent to Q×Q\mathbb{Q} \times \mathbb{Q}

The definition establishes an equivalence (a bijection) between the type of rational complex numbers, `RatComplexNum`, and the Cartesian product of rational numbers Q×Q\mathbb{Q} \times \mathbb{Q}. A rational complex number xx is mapped to the pair of its components (x1,x2)(x_1, x_2), and conversely, a pair (q1,q2)Q×Q(q_1, q_2) \in \mathbb{Q} \times \mathbb{Q} is mapped to the corresponding rational complex number.

instance

Decidability of equality for rational complex numbers

Equality between any two rational complex numbers is decidable. This means that for any x,yRatComplexNumx, y \in \text{RatComplexNum}, there is a procedure to determine whether x=yx = y. This decidability is derived from the fact that rational complex numbers are equivalent to pairs of rational numbers Q×Q\mathbb{Q} \times \mathbb{Q}, and equality in Q\mathbb{Q} is decidable.

instance

Addition of rational complex numbers

The addition operation for rational complex numbers is defined component-wise. For any two rational complex numbers xx and yy, represented as pairs of rational numbers (x1,x2)(x_{1}, x_{2}) and (y1,y2)(y_{1}, y_{2}), their sum is given by x+y=(x1+y1,x2+y2)x + y = (x_{1} + y_{1}, x_{2} + y_{2}).

theorem

(x+y)fst=xfst+yfst(x + y)_{\text{fst}} = x_{\text{fst}} + y_{\text{fst}} for Rational Complex Numbers

For any two rational complex numbers xx and yy, the first component of their sum is equal to the sum of their individual first components, denoted as (x+y)fst=xfst+yfst(x + y)_{\text{fst}} = x_{\text{fst}} + y_{\text{fst}}.

theorem

(x+y)snd=xsnd+ysnd(x + y)_{\text{snd}} = x_{\text{snd}} + y_{\text{snd}} for Rational Complex Numbers

For any two rational complex numbers xx and yy, the second component of their sum is equal to the sum of their individual second components, denoted as (x+y)snd=xsnd+ysnd(x + y)_{\text{snd}} = x_{\text{snd}} + y_{\text{snd}}.

instance

RatComplexNum\text{RatComplexNum} forms an additive abelian group

The type of rational complex numbers, represented as pairs of rational numbers (x1,x2)(x_1, x_2) corresponding to the real and imaginary parts, forms an additive abelian group (AddCommGroup\text{AddCommGroup}). The zero element is defined as (0,0)(0, 0), addition is performed component-wise such that (x1,x2)+(y1,y2)=(x1+y1,x2+y2)(x_1, x_2) + (y_1, y_2) = (x_1 + y_1, x_2 + y_2), and the additive inverse is given by (x1,x2)=(x1,x2)-(x_1, x_2) = (-x_1, -x_2). Scalar multiplication by natural numbers nxn \cdot x and integers zxz \cdot x is also defined component-wise.

instance

Multiplication of rational complex numbers

For two rational complex numbers x=(x1,x2)x = (x_1, x_2) and y=(y1,y2)y = (y_1, y_2), their product xyx \cdot y is defined as the rational complex number (x1y1x2y2,x1y2+x2y1)(x_1 y_1 - x_2 y_2, x_1 y_2 + x_2 y_1). Here, the first component represents the real part and the second component represents the imaginary part.

theorem

(xy)fst=xfstyfstxsndysnd(x \cdot y)_{\text{fst}} = x_{\text{fst}} y_{\text{fst}} - x_{\text{snd}} y_{\text{snd}} for rational complex numbers

For any two rational complex numbers xx and yy, the real part of their product is given by (xy)fst=xfstyfstxsndysnd(x \cdot y)_{\text{fst}} = x_{\text{fst}} y_{\text{fst}} - x_{\text{snd}} y_{\text{snd}}, where fst\text{fst} and snd\text{snd} denote the real and imaginary components respectively.

theorem

(xy)snd=xfstysnd+xsndyfst(x \cdot y)_{\text{snd}} = x_{\text{fst}} y_{\text{snd}} + x_{\text{snd}} y_{\text{fst}} for rational complex numbers

For any two rational complex numbers xx and yy, the imaginary part of their product is given by (xy)snd=xfstysnd+xsndyfst(x \cdot y)_{\text{snd}} = x_{\text{fst}} y_{\text{snd}} + x_{\text{snd}} y_{\text{fst}}, where fst\text{fst} and snd\text{snd} denote the real and imaginary components respectively.

instance

RatComplexNum\text{RatComplexNum} forms a ring

The type of rational complex numbers RatComplexNum\text{RatComplexNum}, consisting of pairs of rational numbers (a,b)Q×Q(a, b) \in \mathbb{Q} \times \mathbb{Q} representing the real and imaginary parts, forms a ring. The addition is defined component-wise, and the multiplication of two elements x=(x1,x2)x = (x_1, x_2) and y=(y1,y2)y = (y_1, y_2) is given by xy=(x1y1x2y2,x1y2+x2y1)x \cdot y = (x_1 y_1 - x_2 y_2, x_1 y_2 + x_2 y_1). The multiplicative identity is defined as 1=(1,0)1 = (1, 0).

theorem

(1)fst=1(1)_{\text{fst}} = 1 for rational complex numbers

For the multiplicative identity 11 in the rational complex numbers RatComplexNum\text{RatComplexNum}, its real component (the first part of the pair) is equal to 11. That is, (1)fst=1(1)_{\text{fst}} = 1.

theorem

The imaginary part of 1RatComplexNum1 \in \text{RatComplexNum} is 00

In the ring of rational complex numbers RatComplexNum\text{RatComplexNum}, where an element is represented as a pair of rational numbers (a,b)Q×Q(a, b) \in \mathbb{Q} \times \mathbb{Q}, the imaginary part (the second component) of the multiplicative identity 11 is equal to 00.

theorem

The first component of 0RatComplexNum0 \in \text{RatComplexNum} is 00

The first component (representing the real part) of the zero element 00 in the ring of rational complex numbers RatComplexNum\text{RatComplexNum} is equal to 00.

theorem

The imaginary part of 0RatComplexNum0 \in \text{RatComplexNum} is 00

In the ring of rational complex numbers RatComplexNum\text{RatComplexNum}, the second component (representing the imaginary part) of the zero element 00 is equal to 00.

definition

Inclusion of RatComplexNum\text{RatComplexNum} into C\mathbb{C}

The map toComplexNum:RatComplexNumC\text{toComplexNum} : \text{RatComplexNum} \to \mathbb{C} is a ring homomorphism that embeds a rational complex number x=(a,b)x = (a, b) into the field of complex numbers C\mathbb{C} as a+bia + bi, where a,bQa, b \in \mathbb{Q} are the real and imaginary parts of xx respectively, and ii is the imaginary unit.

theorem

itoComplexNum(a)=toComplexNum(0,1a)i \cdot \text{toComplexNum}(a) = \text{toComplexNum}(\langle 0, 1 \rangle \cdot a)

Let RatComplexNum\text{RatComplexNum} be the ring of rational complex numbers, where an element (x1,x2)(x_1, x_2) represents the rational complex number x1+x2ix_1 + x_2 i. Let toComplexNum:RatComplexNumC\text{toComplexNum} : \text{RatComplexNum} \to \mathbb{C} be the ring homomorphism that embeds these numbers into the complex field C\mathbb{C}. For any aRatComplexNuma \in \text{RatComplexNum}, the product of the imaginary unit iCi \in \mathbb{C} and the embedding of aa is equal to the embedding of the product of the rational complex number 0,1\langle 0, 1 \rangle and aa. That is, itoComplexNum(a)=toComplexNum(0,1a)i \cdot \text{toComplexNum}(a) = \text{toComplexNum}(\langle 0, 1 \rangle \cdot a).

theorem

ntoComplexNum(a)=toComplexNum(na)n \cdot \text{toComplexNum}(a) = \text{toComplexNum}(n \cdot a) for nNn \in \mathbb{N}

For any natural number nNn \in \mathbb{N} and any rational complex number aRatComplexNuma \in \text{RatComplexNum}, it holds that ntoComplexNum(a)=toComplexNum(na)n \cdot \text{toComplexNum}(a) = \text{toComplexNum}(n \cdot a). Here, toComplexNum:RatComplexNumC\text{toComplexNum} : \text{RatComplexNum} \to \mathbb{C} is the ring homomorphism that embeds a rational complex number into the complex numbers C\mathbb{C} as x+yix + yi.

theorem

toComplexNum\text{toComplexNum} is injective

The map toComplexNum:RatComplexNumC\text{toComplexNum} : \text{RatComplexNum} \to \mathbb{C}, which embeds the rational complex numbers (numbers of the form a+bia + bi where a,bQa, b \in \mathbb{Q}) into the field of complex numbers C\mathbb{C}, is injective.