Congruence

2020 James B. Wilson

Colorado State University

 

Algebra is the study of equations, e.g. 

\[x^2+1=0\]

Abstract algebra is when we see every symbol in an equation as a variable, including +, and =.

Theme

Last time we saw how to replace operations.

This time we replace "="!

Suppose you want to try and solve

\[x^{94}+x^{43}+1=0\]

Using only integers.

Motive

Option: ask if such an \(x\) is even or odd.

I.e: ask

\[x^{94}+x^{43}+1\equiv 0\pmod{2}.\]

Trial and Error:

\[0^{94}+0^{43}+1=1\not\equiv 0\pmod{2}\]

\[1^{94}+1^{43}+1=1\not\equiv 0\pmod{2}\]

Since there is no solution mod 2, \(x\) is neither even nor odd.

There is no integer solution.

Congruence:  preserve algebra after replacing "=".

Consider \(4x+2=6\) in \(\mathbb{R}\).

Solve for \(x\):

\[\begin{aligned}4x+2 & =6\\ (4x+2)-2 & =6-2\\ 4x & =4\\ \frac{1}{4}(4x) & = \frac{1}{4}4\\ x & = 1. \end{aligned}.\]

Consider \(4x+2=6\) in \(\mathbb{R}\).

 

Take \(a\equiv b\Leftrightarrow a,b\geq 0\)

Solve for \(x\) in \(4x\equiv 2\):

\[\begin{aligned}4x+2 & \equiv 6\\ (4x+2)-2 & \equiv 6-2? \end{aligned}.\]

No.  There is no reason to believe you can add -2 to both sides of \(a\equiv b\).  

E.g.

\[3\equiv 1\not\Rightarrow 3-2\equiv 1-2\]

Lesson

If you replace "=" in algebra then you need the new equality to preserve all operations.

 

Given a binary operator \(*\) on \(A\), an equivalence relation \(\equiv\) on \(A\),  is a \(*\)-congruence if

\[\begin{array}{c} x_1\equiv y_1\\ x_2\equiv y_2\\ \hline x_1*x_2\equiv y_1*y_2\end{array}\]

Binary Congruence

Symbols change, idea is the same:

\[\begin{array}{c} x_1\cong y_1\\ x_2\cong y_2\\ \hline x_1+x_2\cong y_1+y_2\end{array}\qquad\begin{array}{c} x_1 \sim y_1\\ x_2 \sim y_2 \\ \hline [x_1,x_2]\sim [y_1,y_2]\end{array}\]

We will have more to say on equivalence relations later.

Congruence on unary operators \(\texttt{++}\) look like this:

\[\frac{x_1\equiv y_1}{\texttt{++}x_1\equiv \texttt{++}y_1}\]

Nullary, Unary Congruence

Congruence on nullary (i.e. constants), e.g. \(0:A^0\to A\), \(1:A^0\to A\); is true automatically by the reflexive law of equivalence, even so it can be stated

\[\vdash 0\equiv 0\qquad \vdash 1\equiv 1\]

Technical point, \(A^0=\{\bot\}\) is a set with one element, technically \(0(\bot):A\) so we should write \(0(\bot)\equiv 0(\bot)\); but we often just abuse notation and state \(0:=0(\bot)\). Likewise \(1:=1(\bot)\).

Given an operator \([x_1,\ldots,x_n]\) on \(A\), an equivalence relation \(\equiv\) on \(A\),  is a congruence if

\[\begin{array}{c} x_1\equiv y_1\\ \ldots \\ x_n\equiv y_n\\ \hline [x_1,\ldots,x_n]\equiv [y_1,\ldots,y_n]\end{array}\]

 

For \(\sigma\)-algebraic structure a congruence preserves every \([\ldots]\in \sigma\).

General Congruence

Examples of Congruence

Ex.

\[a\equiv b\pmod{n}\Longleftrightarrow (\exists q)(nq=a-b)\]

Claim: \[a\equiv b, x\equiv y \Rightarrow (a+x)\equiv (b+y)\]

Proof. There is are \(q,q'\) where \(a-b=nq\) and \(x-y=nq'\).

So \((a-b)+(x-y)=nq+nq'\).

Hence, \((a+x)-(b+y)=n(q+q')\) proving that

\((a+x)\equiv (b+y)\).  \(\Box\)

Ex.

\[a\equiv b\pmod{n}\Longleftrightarrow (\exists q)(nq=a-b)\]

Claim: \[a\equiv b, x\equiv y \Rightarrow (ax)\equiv (by)\]

Proof. Assignment. \(\Box\)

Claim: \[a\equiv b \Rightarrow (-a)\equiv (-b)\]

Proof. Assignment. \(\Box\)

Ex.

In \(\mathbb{Q}[x]\), let \(a(x)\equiv b(x)\pmod{x^2+5}\) if, and only if, \((\exists p(x))((x^2+5)p(x)=a(x)-b(x))\)

Claim: \[a_1(x)\equiv b_1(x), a_2(x)\equiv b_2(x) \Rightarrow (a_1(x)+a_2(x))\equiv (b_1(x)+b_2(x))\]

Proof. \[\begin{aligned}(a_1(x)-b_1(x))+(a_2(x)-b_2(x)) & =(x^2+5)q(x)+(x^2+5)q'(x)\\ (a_1(x)+a_2(x))-(b_1(x)+b_2(x)) & = (x^2+5)(q(x)+q'(x))\end{aligned}\]

 \(\Box\)

What is required of "="?

Leibniz Law

\(x=y\) if, and only if, no property can tell them apart.

I.e. for any sentence \(P(z)\), with a variable \(z\)

 \(P(x)\) is true if, and only if, \(P(y)\) is true.

 

So x=y means:

\[(\forall P)(P(x)\Leftrightarrow P(y))\]

When substituting for = this is the law we must maintain.

Leibniz's Law

The Good News

Leibniz's Law lets us...

Substitute:  \(f:A\to B\), \(a,a':A\) then \[a=_A a'\Rightarrow f(a)=_B f(a')\]

Proof. Use

\[P:z\mapsto (f(a)=_B f(z)).\]

So \(f(a)=_B f(a)\) is \(P(a)\), which happens if, and only if, \(P(a')\) which is \(f(a)=_B f(a')\).      \(\Box\)

Leibniz's Law lets us...

Rewrite: If \(a(bc)=(ab)c\) and \(ab=ba\) then

\[abab= a^2 b^2.\]

Proof. Use

\[P:z\mapsto (abab=azb).\]

So \[\begin{aligned} (abab=abab) & \equiv P(ba)\\ & \Leftrightarrow P(ab)\\ & \equiv (abab=aabb)\end{aligned}\]

 \(\Box\)

Consequences of Leibniz's Law

Proposition (Reflexive): \(x=x\)

Proof: \(P\Rightarrow P\) is an axiom of logic, so \(P(x)\Rightarrow P(x)\) and \(P(x)\Leftarrow P(x)\).  So \[(\forall P)(P(x)\Leftrightarrow P(x)).\]

\(\Box\)

Further Consequences of Leibniz's Law

Proposition (Symmetric): \(x=y\Rightarrow y=x\)

Proof: 

\[(P(x)\Leftrightarrow P(y)) \Rightarrow (P(y)\Leftrightarrow P(x))\]

Hence \(x=y\Rightarrow y=x\).

\(\Box\)

Proposition (Transitive): \((x=y)\wedge (y=z)\Rightarrow x=z\)

Proof: 

\[(P(x)\Leftrightarrow P(y)) \wedge (P(y)\Leftrightarrow P(z))\Rightarrow (P(x)\Leftrightarrow P(z))\]

\(\Box\)

Identity Type

For \(x,y:A\), \(x=y\) is the type of evidence for x to equal y.  

  • Formation: \[\begin{array}{rl}A & :type\\ x,y & :A\\ \hline x=_A y & : type\end{array}\]
  • Introduction \(\vdash refl_x:x=_A x\)
  • Elimination (a form of induction) \[\begin{array}{rl} f& :A\to B\\ x,y & :A\\ e & : x=_A y\\ \hline cong(e) & :f(x)=_B f(y)\end{array}\]
  • Computation rule explains how to lift proof of equals by examining how we apply a function by substitution.

Technically elimination should be higher-order e.g. cong for \(P:A\to type\).

Leibniz's Law

The Bad News

Leibniz Law

\(x=y\) if, and only if, \((\forall P)(P(x)\Leftrightarrow P(y))\).

\[\frac{a}{b}=\frac{c}{d}\Longleftrightarrow a\cdot d=b\cdot c.\]

Try

\[P(a/b):= (a=1)\]

Now \(P(1/2)\) holds, but \(P(4/8)\) fails, yet nothing seems wrong about 1/2=4/8.

Leibniz Law

\(x=y\) if, and only if, \((\forall P)(P(x)\Leftrightarrow P(y))\).

\(2\equiv 8 \pmod{6}\), 

\(P(z):= z<5\)

\(P(2)\) is true but \(P(8)\) is false.

So \(2\neq 8\).

 

Sometimes maybe we don't really want every property.

Equivalence

Strategies to uphold Leibniz up to a point.

Weakening "="

Given a binary relation \(\equiv\) on \(A\) there three commonly considered properties:

  • Reflexive: \(x\equiv x\)
  • Symmetric: \(x\equiv y\Rightarrow y\equiv x\)
  • Transitive: \((x\equiv y)\wedge (y\equiv z)\Rightarrow (x\equiv z)\)

If \(\equiv\) has all three we call i an equivalence relation.

 

Congruence

  • All congruences are equivalence relations.
  • Leibniz's law implies equivalence relations.
  • Equivlance relations do not imply Leibniz law on \(A\),
  • But we can use equivalence to make a new type \(A/_{\equiv}\) ("A mod \(\equiv\)") on which we do get a Leibniz law.