Free Algebra I

2020 James B. Wilson

Colorado State University

 

Module Objectives

  • Capture induction as an algebraic property.
  • Begin exploring homomorphisms on free algebras

Minimum you need for a [0]-algebra?

Answer:

\(A=\{a\}\)

Operator \(a:A^0\to A\), i.e. a constant nullary operator.

Done.

 

You could have a bigger set, but if you want only the algebra, then one constant is all you will visit.

Boring!

Minimum you need for a [1]-algebra?

Answer:

Fix a type \(A\), and an operator

\[\#:A\to A\]

... could be silly if \(A\) were empty, so lets assume also a nullary (constant) operator \(\epsilon:A^0\to A\).

Still boring? Notation might give us an idea

\(\epsilon\),

\(a^1=a:=\#\epsilon\),

\(a^2=aa:=\#(a)\),

\(a^3=aaa=\#(aa),\ldots\)

This will for all the following terms in \(A\)

\[\epsilon, \#\epsilon, \#(\#\epsilon),\#(\#(\#(\epsilon))),\ldots\]

Natural numbers \(\mathbb{N}\)

\[\vdash \mathbb{N}:type\quad (F_{\mathbb{N}})\]

\[\vdash 0:\mathbb{N}\quad(I_{\mathbb{N}}0)\qquad \frac{n:\mathbb{N}}{S(n):\mathbb{N}}(I_{\mathbb{N}}S)\]

Also summarized compactly in what is called "Backus-Naur Form (BNF) Grammar":

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

 

(Elimination etc. will come later.)

\(\mathbb{N}\) as a [1,0]-algebra.

Evidently \(n\mapsto S(n)\) can be typed as \(\mathbb{N}\to \mathbb{N}\) by intro rule \((I_{\mathbb{N}}S)\).

\[\frac{n:\mathbb{N}}{S(n):\mathbb{N}}(I_{\mathbb{N}}S)\]

Name that function \(\texttt{++}\), i.e. \(\texttt{++}n:=S(n)\) of type \(\mathbb{N}\to \mathbb{N}\).

*Authors, including me, often reuse S to mean both introduction, and the subsequent function, but these are technically two different things.
  • \(\langle \mathbb{N},\texttt{++}\rangle\) is a [1]-algebra.
  • \(\langle \mathbb{N},\texttt{++},0\rangle\) is a [1,0]-algebra.

This is counting (or "tally") algebra.

So far...

  • [0]-algebras are boring algebraically.
  • [1]-algebras are silly -- could be the vaccum.
  • [1,0]-algebras leads to \(\mathbb{N}\)... now we get going!
  • This only considered the introduction rules of \(\mathbb{N}\).
  • Do elimination rules of \(\mathbb{N}\) teach us some algebra?

Homomorphism

Given a type \(A\) and an \(n\)-operator \(A^n\to A\), written

\[\langle a_1,\ldots,a_n\rangle\]

and a type \(B\) with an \(n\)-operator \(B^n\to B\), written

\[[a_1,\ldots,a_n]\]

Then a function \(f:A\to B\) is a homomorphism if 

\[f(\langle a_1,\ldots,a_n\rangle)=[f(a_1),\ldots,f(a_n)].\]

Example

  • \(A=\mathbb{N}\) with \(\langle m_1,m_2\rangle=m_1+m_2\),
  • \(B=\mathbb{R}^+\) with \(\langle x,y\rangle=x\cdot y\),
  • \(f:\mathbb{N}\to \mathbb{R}^+\) where \(f(m)=e^{2\pi m}\).

\[f(m+n)=e^{2\pi(m+n)}=e^{2\pi m}e^{2\pi n}=f(m)\cdot f(n).\]

Elimination rule of \(\mathbb{N}\)

(Induction)

\[\begin{array}{l} n\in \mathbb{N}\\ P(0)\\ (\forall k)(P(k)\Rightarrow P(S(k)))\\ \hline P(n)\end{array}\]

Logical Induction (Aristotle)

\[\begin{array}{l} n\in \mathbb{N}\\ base\in P(0)\\ (\forall k\in \mathbb{N})(ind_k:P(k)\to P(S(k)))\\ \hline f(n)\in P(n)\end{array}\]

Enhance with sets (Peano)

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

Enhance with types (Martin-Lof)

\[\begin{array}{rl} n &: \mathbb{N}\\ P& :\mathbb{N}\to type\\ \epsilon & : P(0)\\ i &: \prod_{k:\mathbb{N}}(P(k)\to P(S(k)))\\ \hline \hat{\epsilon}(n) & : P(n)\end{array}\]

You end up with \(\hat{\epsilon}:\mathbb{N}\to Q\)

\[\hat{\epsilon}(0)=\epsilon\qquad \hat{\epsilon}(\texttt{++}n)=\hat{\epsilon}(n)^{\texttt{++}}\]

That is, we have a homomorphism.

Elimination rule (induction)

Trace path of base case,

\[\epsilon:P(0),\qquad a=i_0(\epsilon):P(1),\qquad a^2=i_1(a):P(2),\ldots \]

Set \(Q=\{\epsilon, a,a^2,\ldots\}\), and define

\[\texttt{++}:Q\to Q\qquad x^{\texttt{++}}:=\left\{\begin{array}{cc} a & x=\epsilon\\ a^{k+1} & x=a^k\end{array}\right.\]

The algebraic meaning of induction on \(\mathbb{N}\)

For every [1,0]-algebra \(Q\) and each function \[\epsilon:\{0\}\to Q\] there is a unique homomorphism \[\hat{\epsilon}:\mathbb{N}\to B\] with 

\[\hat{\epsilon}(0)=\epsilon(0).\]

A \(\sigma\)-algebraic structure that "uniquely covers" all other \(\sigma\)-algebraic structures following a chosen base case is called free.

A \(\sigma\)-algebraic structure that "uniquely covers" all other \(\sigma\)-algebraic structures following a chosen base case is called free.

 

\(\mathbb{N}\) is our first example of a free algebra, specifically a free [1,0]-algebra.

 

What happens next is we 

  1. Increase the size of the base case (strong induction)
  2. Increase operations (Noetherian induction)