Everyday Algebras

2020 James B. Wilson

Colorado State University

 

Natural Numbers

\(\mathbb{N}= 0 \mid S(n:\mathbb{N}) \)

Eliminiation (induction) \[\begin{array}{rl} n & :\mathbb{N}\\ P & :\mathbb{N}\to type\\ base & P(0)\\ IH & :\prod_{k:\mathbb{N}} P(k)\to P(S(k))\\ \hline I(n) & :P(n) \end{array}\]

Formation \(\vdash\mathbb{N}:type\)

Introduction \(\vdash 0:\mathbb{N}\qquad \frac{n:\mathbb{N}}{S(n):\mathbb{N}}\)

\[\begin{array}{rl} S(m)&:\mathbb{N}\\ e & :P(0)\\ P & :\mathbb{N}\to type\\ IH & :\prod_{k:\mathbb{N}} P(k)\to P(S(k))\\ \hline refl&:I(S(m))=_{P(S(m))} IH(m) \end{array}\]

Computation (recursion) \[\begin{array}{rl} e & :P(0)\\ P & :\mathbb{N}\to type\\ IH & :\prod_{k:\mathbb{N}} P(k)\to P(S(k))\\ \hline refl&:I(0)=_{P(0)} e \end{array}\]

class Nat 

case class Zero extends Nat
case class Succ(n:Nat) extends Nat

def elim(
  n:Nat, 
  P:Nat -> Type,
  base:P(0), 
  indHyp:(k:Nat)->P(k)->P(Succ(k))
) : P(n) = 
  n match {
    case 0 => base
    case Succ(k) => indHyp(k, e) where e = elim(k, P, base, indHyp)
  }
  

Translation into Pseudo-code

class = formation
case class = introduction
elim = elimination
body of elim = computation rule

Derived Operations

\[m+n=\left\{\begin{array}{cc} m & n=0\\ S(m+k) & n=S(k)\end{array}\right.\]

\[m\cdot n=\left\{\begin{array}{cc} 0 & n=0\\ (m\cdot k)+m & n=S(k)\end{array}\right.\]

\[m^n=\left\{\begin{array}{cc} 1 & n=0\\ (m^k)\cdot m & n=S(k)\end{array}\right.\]

Notation: \(1:=S(0), 2:=S(1),\ldots,9:=S(8), 10:=S(9)\)

Digits \(a_n\cdots a_0:=\sum_{i=0}^n a_i\cdot 10^i,\qquad a_i\in\{0,\ldots,9\}\)

Derived Operations in Pseudo-code

def + ( m:Nat, n:Nat ) : Nat = 
  n match {
    case 0 => m
    case Succ(k) => Succ(m+k)
  }
  
def * ( m:Nat, n:Nat ) : Nat = 
  n match {
    case 0 => 0
    case Succ(k) => (m*k)+m
  }
  
def ^ ( m:Nat, n:Nat ) : Nat = 
  n match {
    case 0 => Succ(0)
    case Succ(k) => (m^k)*m
  }

Laws

  • \(a+(b+c)=(a+b)+c\)
  • \(a\cdot(b\cdot c)=(a\cdot b)\cdot c\)
  • \(a+b=b+a\)
  • \(a\cdot b=b\cdot a\)
  • \(a+0=a=0+a\)
  • \(a\cdot 1=a=1\cdot a\)
  • \(a\cdot(b+c)=a\cdot b+a\cdot c\)
  • \((a+b)\cdot c=a\cdot c+b\cdot c\)
  • \(a^{b+c}=a^b\cdot a^c\)
  • \(a^{b\cdot c}=(a^b)^c\)
  • \(a\cdot 0=0=0\cdot a\)
  • \(a^0=1\)...

\(\mathbb{N}\) Quotients as \([0,S]\)-algebra

Under \(0,S\) congruences are "truncation"  by \(n\).

E.g.

\[\begin{array}{c|cccc}   & S \\ \hline 0 & 1 \\ 1 & 2 \\ 2 & 3 \\ 3 & 1 \end{array}\]

 

\(\mathbb{N}\) Quotients as \([0,+]\)-algebra

Truncation again, but interpreted on pairs

E.g.

\[\begin{array}{c|cccc} + & 0 & 1 & 2 & 3 \\ \hline 0 & 0 & 1 & 2 & 3\\ 1 & 1 & 2 & 3 & 1\\ 2 & 2 & 3 & 1 & 2 \\ 3 & 3 & 1 & 2 & 3 \end{array}\]

 

\(\mathbb{N}\) summary

  • Free \([0,1]\)-algebra, i.e. to use it is to use induction.
  • Other operations (+, times, powers) are all backed up by successor.
  • Must prove all laws by induction.
  • Quotients are "lollypops", cycles with a handle, some call these "floops"

Lists

\(List[A]= nil \mid cons(a:A,as:List[A]) \)

Elimination (induction) \[\begin{array}{rl} as & :List[A]\\ P & :List[A]\to type\\ base & :P(nil)\\ IH & :\prod_{b:A}\prod_{bs:List[A]} P(bs)\to P(cons(b,bs))\\ \hline I(as) & :P(as) \end{array}\]

Formation \(A:type \vdash List[A]:type\)

Introduction \[\vdash nil:List\qquad \frac{a:A\quad as:List[A]}{cons(a,as):List[A]}\]

\[\begin{array}{rl} S(m)&:\mathbb{N}\\ e & :P(0)\\ P & :\mathbb{N}\to type\\ IH & :\prod_{k:\mathbb{N}} P(k)\to P(S(k))\\ \hline refl&:I(S(m))=_{P(S(m))} IH(m) \end{array}\]

Computation (recursion) \[\begin{array}{rl} e & :P(0)\\ P & :\mathbb{N}\to type\\ IH & :\prod_{k:\mathbb{N}} P(k)\to P(S(k))\\ \hline refl&:I(0)=_{P(0)} e \end{array}\]

List in pseudo-code

class List[A:type]

case class nil extends List[A]
case class cons(a:A, as:List[A]) extends List[A]

def elim(
  as:List[A], 
  P:List[A] -> Type,
  base:P(nil), 
  indHyp:(a:A)->(as:List[A])->P(as)->P(cons(a,as))
) : P(n) = 
  as match {
    case nil => base
    case cons(a,as) => indHyp(a, as, e) where e = elim(as, P, base, indHyp)
  }

Integers \(\mathbb{Z}\)

(nothing special)

\(\mathbb{Z}\) as hand-made.

\(\mathbb{Z}=(\mathbb{N}\sqcup \mathbb{N})/(\iota_L(0)=\iota_R(0))\)

S0

0

S0

SS0

0

SSS0

SS0

SSS0

Compact: repeat \(\mathbb{N}\) add a sign.

Lacks any algebra.

  • ...
  • 2 is the solution to \(x+0=2,x+1=3,x+2=4,\ldots\)
  • 1 is the solution to \(x+0=1,x+1=2,x+2=3,\ldots\)
  • 0 is the solution to \(x+0=0,x+1=1,x+2=2,\ldots\)
  • -1 is conceptual solution to \(x+1=0, x+2=1, x+3=2,\ldots\)
  • -2 is conceptual solution to \(x+2=0, x+3=1, x+4=2,\ldots\)
  • ...
  • ...
  • \(2:\mathbb{Z}\) could be \(\{(0,2),(1,3),(2,4),\ldots\}\)
  • \(1:\mathbb{Z}\) could be \(\{(0,1), (1,2), (2,3),\ldots\}\)
  • \(0:\mathbb{Z}\) could be \(\{(0,0), (1,1), (2,2),\ldots\}\)
  • \(-1:\mathbb{Z}\) could be \(\{(1,0), (2,1), (3,2),\ldots\}\)
  • \(-2:\mathbb{Z}\) could be \(\{(2,0), (3,1), (4,2),\ldots\}\)
  • ...

0

1=S0

2=SS0

3=SSS0

-1=-S0

-2=-SS0

-3=-SSS0

0

1

2

3

-1

-2

-3

4

4+(-2)=2

Make \(\mathbb{Z}\) as quotient of \(\mathbb{N}\times \mathbb{N}\) as a power, product, sum successor, 0, 1 algebra!

 

And of course it gets also negatives and substraction.

\(\mathbb{Z}\) Quotients as \([+,-,0]\)-algebra

Truncation of \(\mathbb{Z}\) but the requirement of negatives forces further constraints.

E.g.

\[\begin{array}{c|cccc} + & 0 & 1 & 2 & 3 \\ \hline 0 & 0 & 1 & 2 & 3\\ 1 & 1 & 2 & 3 & 0\\ 2 & 2 & 3 & 0 & 1 \\ 3 & 3 & 0 & 1 & 2 \end{array}\]

 

Why? \(x+(-x)=0\) so 0 in every row, \(S(x)=x+1\), so by induction you get back to 0 from x

Consequence: quotients of \(\mathbb{Z}\) are number theory

\(\mathbb{Z}/6\) has a quotient to \(\mathbb{Z}/2\) and \(\mathbb{Z}/3\) but not \(\mathbb{Z}/5\)....

 

... a cycle within a cycle must be a faction, skip-counting.

 

...same was true in truncations of \(\mathbb{N}\) but only after you get past the stick of the lollypop.

 

...smallest nontrivial quotients \(\mathbb{Z}/p\) with \(p\) prime

\(\mathbb{Z}\) summary

  • Negatives \(a-b\) are the collection of all equations of the form \(x+c=d\) for which \(a-b\) would be a solution.  Convention had taught us to write "-b", i.e. \(0-b\) instead of \(a-b\) for these cosets.
  • This is a quotient of \(\mathbb{N}\) so inherit all the operations and laws.
  • Quotients are cyclic groups \(\mathbb{Z}/n\).
  • Simple quotients are \(\mathbb{Z}/p\) with \(p\) prime.

Rationals \(\mathbb{Q}\)

(special case)

  • ...
  • 2 is the solution to \(1x=2,2x=4,3x=6,\ldots\)
  • 1 is the solution to \(1x=1,2x=2,3x=3,\ldots\)
  • 0 is the solution to \(1x=0,2x=0,3x=0,\ldots\)
  • 1/2 is conceptual solution to \(2x=1, 4x=2, 6x=3,\ldots\)
  • 2/3 is conceptual solution to \(3x=2, 6x=4, 9x=6,\ldots\)
  • ...

0

1/7

1/5

1/6

1/4

1/3

0

2/5

3/7

2/7

1

2

-1

-1/7

-2/7

-3/7

\(\mathbb{Q}\) as hand-made.

\(\mathbb{Q}=(\mathbb{Z}\times \mathbb{N}^+)/_{\sim}\)

\((a,b)\sim (c,d)\leftrightarrow a+d=b+c\) 

What Algebra? \(\mathbb{N}^+\) has only \(\cdot, +, 1\)

 

At best we get an algebra on those, 0, negative, etc. will need to be rebuilt!

1/3

1

\(a/b+c/d=(a+b)/(c+d)?\)  NO!

Points are not collinear with origin!

(Not in one equivalence class.)

1/3

0

2

\(a/b+a/b=(a+a)/b?\) Yes!...why?

1/3+1/3=2/3

1/3

1

\(\frac{a}{b}+\frac{c}{d}=\frac{ad+bc}{bd}\)

Of course...

it keeps the 

interior angles 

fixed, so 

collinear!

4/3

From here...

  • Use addition to multiply by integers...\[m\cdot \frac{a}{b}=\overbrace{\frac{a}{b}+\cdots+\frac{a}{b}}^m=\frac{ma}{b}\]
  • Use what learned to clear denominators...\[\frac{a}{b}\cdot b=\frac{ab}{b}=\frac{a}{1}=a\]
  • Rebalance our fractions to get move fraction denominators over...\[\frac{a}{b}\cdot\frac{1}{d}=\frac{ad}{bd}\frac{1}{d}=\frac{a}{bd}\frac{d}{d}=\frac{a}{bd}\cdot 1=\frac{a}{bd}\]
  • General multiplication of fractions...\[\frac{a}{b}\cdot\frac{c}{d}=\frac{ac}{bd}\]

\(\mathbb{Q}\) Quotients as \([\cdot,+,-,0]\)-algebra

The only congruences on \(\mathbb{Q}\) as a \([\cdot,+,-,0]\)-algebra are "trivial"

  1. \(\frac{a}{b}=\frac{c}{d}\leftrightarrow ad=bc\)
  2. \(\frac{a}{b}=\frac{c}{d}\leftrightarrow \{\bot\}\)

Proof. Pick a congruence \(\equiv\) and suppose there are \(x\neq y\) with \(x\equiv y\) (not option 1).  So \(z:=x-y\neq 0\) yet \(z\equiv 0\) and \(z^{-1}\equiv z^{-1}\) so \[1=z^{-1}z\equiv z^{-1}0=0\]

Hence in fact for any \(w\), \(w\equiv w\) and \(1\equiv 0\) implies \(w\equiv 0\) (option 2).

\(\mathbb{Q}\) summary

  • Factions \(a/b\) are the collection of all equations of the form \(cx=d\) for which \(a/b\) would be a solution.
  • Not an obvious quotient so all operations and laws must be redone and reproved.
  • Has only no proper nontrivial quotients, i.e. it is "simple".

New numbers \(\mathbb{Q}[\sqrt[3]{5}]\)?

(nothing special)

\(\mathbb{Q}[\sqrt{5}]=\mathbb{Q}[x]\) modulo \(x^3=5\).

A bit too fast?

Negatives numbers are just the equations that would be solved if it existed....

E.g. -2 = (x+2=0, x+3=1, x+4=2,...)

Fractions are just the equations that would be solved if it existed....

E.g. 1/3 = (3x=1, 6x=2, 9x=3,...)

Roots are just the coset of polynomials that would solved if it existed....

E.g. \(\sqrt[3]{5} = \{x^3=5, 7x^3=35, x^5-5x^2=0,...\}\)

Roots are just the coset of polynomials that would solved if it existed....

E.g. \(\sqrt[3]{5} = \{x^3=5, 7x^3=35, x^5-5x^2=0,...\}\)

 

 

These are... \(\{(x^3-5)a(x)\mid a(x)\in \mathbb{Q}[x]\}\)

To make a number system with \(\sqrt[3]{5}\) we just need to make cosets where one of them is the set of equations which would be solved is that solution existed!

Have an equation without a solution?

Home Made Solutions:

  • collecting all the polynomials with the same solution.
  • if the collection is a coset in a quotient algebraic structure, then you just invented a new number system with a solutoin.

\(\mathbb{R}\)?

(...hmmm... special? ...is it even algebra?)

What is missing?

  • Repeating the idea of \(\mathbb{Q}[\sqrt{5}]\) can create any root of any polynomial.
  • However \(\mathbb{R}\) has numbers that are not roots of polynomials \(e,\pi\). 
  • To algebra, transcendental numbers are the same as variables.  I.e. \(\mathbb{Q}[\pi]\cong \mathbb{Q}[x]\) it doesn't even notice it could divide by \(\pi\).

\(\mathbb{Q}\) together with all roots of all polynomials in \(\mathbb{Q}\)?

(nothing special, but large)

Obvious (but important) Observation.

  The number \(x\) is a root of the polynomial \(a(x)\) in \(\mathbb{Q}[x]\) modulo \(a(x)=0\).

 

We write \(\mathbb{Q}[\alpha]=\mathbb{Q}[x]/(a(x))\) and think of \(\alpha\) as a root, but really \(\alpha\) is just the coset containg \(x\).

\[K_1=\mathbb{Q}[\alpha]=\mathbb{Q}[x]/(a(x))\]

 

So....

\[K_2=\mathbb{Q}[\alpha,\beta]=\mathbb{Q}[\alpha]/(b(x))\]

...and so on... but there is a catch...

 

\[\mathbb{Q}[x]/(x^2-1)\]

we already had 1, -1 in this, so now we have 2 copies!  It will turn out to be 2 copies of \(\mathbb{Q}\).

key definition

A polynomial is irreducible over \(K[x]\) if it does not factor.

Algebraically Closed fields exists

  • A bit technical: but keep attaching roots of irreducible polynomials until there none.
  • This may not seem like induction but it is, it is even countable (over \(\mathbb{Q}\)).
  • Everyone agrees with Gauss: it is more beautiful to build \(\mathbb{R}\) with calculus, then \(\mathbb{C}\) and use the Intermediate Value Theorem to prove all polynomials have roots in \(\mathbb{C}\).

Fundamental Theorem of Algebra (Gauss)

In \(\mathbb{C}[x]\), \[x^n+a_{n-1}x^{n-1}\cdots+a_0x^0=(x-\alpha_1)\cdots (x-\alpha_n).\]

No, you don't need calculus to get an algebraically closed field, but it really is the stuff of dreams to make a number system for algebra, analysis, geometry, and more.

\(\mathbb{R},\mathbb{C}\) Summary

  • algebra doesn't need real or complex numbers, just the algebraic numbers, i.e. roots of polynomials.
  • even so, the rest of the world needs real numbers so algebraist should get off their high-horses and just the numbers that are transcendental.

Everyday Algebras

By James Wilson

Everyday Algebras

  • 435