Thursday, August 7, 2025

Homology and cohomology

What is homology and also cohomology?

Homology and cohomology are two foundational concepts in algebraic topology, a field of mathematics that studies topological spaces using algebraic tools. Here's a clear breakdown of what each one means and how they differ:


Homology

Homology is a way to measure the "holes" in a topological space.

Intuition:

  • Imagine different-dimensional "holes":

    • 0-dimensional: components (islands).
    • 1-dimensional: loops or holes (like the hole in a donut).
    • 2-dimensional: voids (like the hollow inside a sphere).

Idea:

Homology assigns a sequence of abelian groups (or vector spaces) $H_0, H_1, H_2, \dots$ to a topological space:

  • $H_0$: captures connected components.
  • $H_1$: captures loops (1D holes).
  • $H_2$: captures voids (2D holes).
  • And so on.

Example:

  • A circle $S^1$:

    • $H_0(S^1) \cong \mathbb{Z}$ (1 connected component)
    • $H_1(S^1) \cong \mathbb{Z}$ (1 loop)
    • $H_n(S^1) = 0$ for $n \geq 2$

Cohomology

Cohomology is a theory closely related to homology but works in a dual way.

Intuition:

Cohomology still detects "holes," but it also gives a way to "probe" the space using functions, and can encode richer algebraic structure.

Key Differences from Homology:

  • Cohomology groups are written as $H^0, H^1, H^2, \dots$ (note the superscript).
  • Cohomology has a ring structure via the cup product, allowing interaction between cohomology classes.

Purpose:

  • Offers more structure than homology (e.g., operations between cohomology classes).
  • Useful in differential geometry, physics, and algebraic geometry.

Comparison Table

Feature Homology Cohomology
Notation $H_n(X)$ $H^n(X)$
Measures n-dimensional holes n-dimensional "cocycles"
Algebra Abelian group Abelian group + ring structure
Tools Chains, cycles, boundaries Cochains, cocycles, coboundaries
Duality Direct computation Dual of homology (in some sense)

Why Two Theories?

  • They are closely related but highlight different aspects.
  • Cohomology often allows for more refined analysis.
  • Many deep theorems (like Poincaré duality) relate the two.

Let me know if you’d like an example computed, or a more visual explanation.

Euclidean algorithm halts with all-and-only commensurable inputs

show: the euclidean algorithm halts if, and only if, it is given commensurable quantities

Let $a,b>0$ be two magnitudes (or lengths). “Commensurable” means there is a third magnitude $d>0$ and positive integers $m,n$ with

$$ a = m d,\quad b = n d, $$

i.e., $a$ and $b$ are integer multiples of a common measure $d$. The Euclidean algorithm (in the modern form using division with remainder, or equivalently the subtractive form) produces a sequence of remainders

$$ r_0 := a,\quad r_1 := b,\quad r_{i+1} := r_{i-1}\bmod r_i, $$

and halts exactly when some $r_k$ divides $r_{k-1}$ giving $r_{k+1}=0$; the last nonzero remainder is then a common measure.

We prove the equivalence:

(⇒) If the Euclidean algorithm halts on $a,b$, then $a$ and $b$ are commensurable. Suppose it halts in finitely many steps with last nonzero remainder $r_k$, so that $r_{k-1} = q_{k} r_k$ and the next remainder is zero. By the division relations backwards,

$$ r_k\mid r_{k-1},\quad r_k\mid r_{k-2},\ \dots,\ r_k\mid r_1=b,\quad\text{and }r_k\mid r_0=a. $$

Thus $a = M r_k,\ b = N r_k$ with integers $M,N$; so $r_k$ is a common measure and $a,b$ are commensurable.

(⇐) If $a$ and $b$ are commensurable, say $a = m d,\ b = n d$ with $m,n\in\mathbb{Z}_{>0}$, then the Euclidean algorithm on $a,b$ reduces to the usual integer Euclidean algorithm on $m,n$ with unit $d$: each division step

$$ r_{i-1} = q_i r_i + r_{i+1} $$

when scaled by $d^{-1}$ becomes an integer division among the corresponding integers. Since the Euclidean algorithm on positive integers $m,n$ terminates in finitely many steps (the remainders form a strictly decreasing sequence of nonnegative integers), the algorithm on $a,b$ also terminates—yielding as last nonzero remainder $(\gcd(m,n))d$, a common measure.

Therefore the Euclidean algorithm halts on $a,b$ if and only if $a$ and $b$ are commensurable. ∎

Viterbi semiring intro

Explain the Viterbi semiring

The Viterbi semiring is the algebraic structure underlying the Viterbi algorithm’s “max-product” computations — it formalizes how you score and select the single best path (most probable sequence) in models like Hidden Markov Models (HMMs) or weighted finite-state automata.

Core idea

A semiring is a set $S$ equipped with two binary operations:

  • $\oplus$ (an “addition”-like operation, here used to choose between alternatives),
  • $\otimes$ (a “multiplication”-like operation, here used to accumulate scores along a path),

along with identity elements $\mathbf{0}$ for $\oplus$ and $\mathbf{1}$ for $\otimes$, such that:

  • $\oplus$ is associative and commutative, with identity $\mathbf{0}$,
  • $\otimes$ is associative, with identity $\mathbf{1}$,
  • $\otimes$ distributes over $\oplus$: $a \otimes (b \oplus c) = (a \otimes b) \oplus (a \otimes c)$,
  • $\mathbf{0}$ is absorbing for $\otimes$: $\mathbf{0} \otimes a = \mathbf{0}$.

The Viterbi semiring for probabilities is typically:

  • Domain: $[0,1]$ (or, for numerical stability, log-space: $\mathbb{R} \cup \{-\infty\}$),
  • $\oplus = \max$ (choose the most probable alternative),
  • $\otimes = \times$ (multiply probabilities along a path),
  • Identities: $\mathbf{0} = 0$ (since $\max(x,0) = x$ for $x \in [0,1]$), $\mathbf{1} = 1$.

In log-space, this becomes the max-plus semiring:

  • Domain: $\mathbb{R} \cup \{-\infty\}$,
  • $\oplus = \max$,
  • $\otimes = +$,
  • Identities: $\mathbf{0} = -\infty$, $\mathbf{1} = 0$.

Switching to log-space turns products into sums (safer numerically) and keeps the “best path” selection as a max.

Connection to the Viterbi algorithm

The Viterbi algorithm performs dynamic programming over this semiring: at each time step $t$, for each state $j$, it computes

$$ \delta_t(j) = \bigoplus_{i} \left[ \delta_{t-1}(i) \otimes a_{i,j} \right] \otimes b_j(o_t) $$

which, in the usual (probability) notation, is

$$ \delta_t(j) = \max_i \left( \delta_{t-1}(i) \cdot a_{i,j} \right) \cdot b_j(o_t), $$

where:

  • $\delta_t(j)$ is the max probability of any path ending in state $j$ after observing $o_1, \dots, o_t$,
  • $a_{i,j}$ is the transition probability from state $i$ to $j$,
  • $b_j(o_t)$ is the emission probability of observation $o_t$ from state $j$.

In log-space:

$$ \log \delta_t(j) = \max_i \left( \log \delta_{t-1}(i) + \log a_{i,j} \right) + \log b_j(o_t). $$

Backpointers record which predecessor $i$ achieved the $\max$, so the single best full path can be reconstructed.

Small concrete example

HMM with two states $A, B$:

  • Initial probs: $\pi_A = 0.6,\ \pi_B = 0.4$

  • Transitions: $A \to A = 0.7,\ A \to B=0.3;\ B\to A=0.4,\ B\to B=0.6$

  • Emissions for observation sequence $[x, y]$:

    • From $A$: $P(x)=0.5,\ P(y)=0.5$
    • From $B$: $P(x)=0.1,\ P(y)=0.9$

Step 1 (observe $x$):

$$ \delta_1(A)=0.6 \times 0.5=0.3,\quad \delta_1(B)=0.4 \times 0.1=0.04. $$

Step 2 (observe $y$):

$$ \delta_2(A)=\max(0.3 \times 0.7,\ 0.04 \times 0.4) \times 0.5 = \max(0.21,\ 0.016)\times 0.5 = 0.105,\\ \delta_2(B)=\max(0.3 \times 0.3,\ 0.04 \times 0.6) \times 0.9 = \max(0.09,\ 0.024)\times 0.9 = 0.081. $$

Final best state is $A$ with probability $0.105$; backpointers give path $A \to A$.

Contrast: sum-product semiring

The sum-product semiring (used for computing total probability or marginals) has:

  • $\oplus = +$,
  • $\otimes = \times$,
  • Identities: $\mathbf{0} = 0,\ \mathbf{1}=1$.

There, you sum over paths instead of taking the max, so you’re aggregating total mass rather than picking one best path. In log-space that requires log-sum-exp for $\oplus$, which is more expensive than $\max$.

Why thinking in semirings helps

Many dynamic programming algorithms (Viterbi, shortest path, parsing, belief propagation variants) can be seen as instances of the generalized semiring framework: replace $\oplus$ and $\otimes$ to get different behaviors (e.g., highest weight path vs. total weight, counting paths, etc.). The Viterbi semiring specializes this to “best path under multiplicative scoring.”

Properties summary

  • Associativity / commutativity: $\max$ is commutative/associative; multiplication (or addition in log-space) is associative.
  • Distributivity: $a \otimes \max(b,c) = \max(a \otimes b,\ a \otimes c)$ holds.
  • No additive inverse: It’s a semiring, not a ring — there is no operation to “undo” a $\max$.
  • Used for decoding: In speech recognition, bioinformatics, NLP (e.g., Viterbi taggers, parse scoring), etc.

If you want, I can also show how the Viterbi semiring fits into a generic semiring-based code template or how to generalize it to other semirings. Would you like that?

Linear equation systems have 0 ∨ 1 ∨ ∞ solutions

Show that a system of linear equations either has no solution, or exactly one solution, or infinitely many solutions.

Let $A\in\mathbb{R}^{m\times n}$, $b\in\mathbb{R}^m$, and consider the linear system

$$ Ax=b. $$

Let $S=\{x\in\mathbb{R}^n:Ax=b\}$ be its solution set. There are three possibilities:


1. No solution. The system is inconsistent (e.g., row-reduction of the augmented matrix $[A\mid b]$ produces a row $[0\ \cdots\ 0\mid c]$ with $c\neq 0$). Then $S=\varnothing$.


2. At least one solution. Suppose $x_0$ is a solution: $Ax_0=b$. Define the homogeneous solution space

$$ H=\{h\in\mathbb{R}^n:Ah=0\} $$

(which is a subspace of $\mathbb{R}^n$). Then for any $h\in H$, $A(x_0+h)=Ax_0+Ah=b+0=b$, so $x_0+H\subseteq S$. Conversely, if $x\in S$, then $A(x-x_0)=Ax-Ax_0=b-b=0$, so $x-x_0\in H$ and $x=x_0+h$ for some $h\in H$. Hence

$$ S = x_0 + H, $$

i.e., the solution set is an affine subspace parallel to the homogeneous solution space.

Now:

  • If $H=\{0\}$, then $S=\{x_0\}$: exactly one solution.
  • If $H$ contains a nonzero vector $h\ne 0$, then for each real scalar $t$, $x_0+th\in S$. If $t_1\ne t_2$, then $(x_0+t_1h)-(x_0+t_2h)=(t_1-t_2)h\ne 0$, so these are all distinct. Thus there are infinitely many solutions.

Conclusion: Over $\mathbb{R}$ (or any infinite field), a linear system has either no solution, exactly one solution, or infinitely many solutions—no other cardinalities occur.

Example:

  • $x+y=1,\ x+y=2$ is inconsistent ⇒ no solution.
  • $x+y=1,\ x-y=0$ has a unique solution $x=y=\tfrac12$.
  • $x+y=2,\ 2x+2y=4$ is consistent but dependent: $S=\{(t,2-t):t\in\mathbb{R}\}$ ⇒ infinitely many solutions.

(Note: over a finite field, the “infinitely many” case becomes “more than one” but still finite; the trichotomy above assumes the underlying field is infinite, as in $\mathbb{R}$.)

Quasigroups

Explain quasigroups

A quasigroup is an algebraic structure $(Q, *)$ consisting of a set $Q$ with a binary operation $*$ such that for every $a,b\in Q$ the equations

  • $a * x = b$, and
  • $y * a = b$

have unique solutions $x,y\in Q$. In other words, “division” is always possible and yields a single result on both sides. This is equivalent to saying that the Cayley (multiplication) table of a finite quasigroup is a Latin square: each element appears exactly once in each row and each column.

You can define two division operations:

  • Left division: $a\backslash b$ is the unique $x$ with $a * x = b$.
  • Right division: $b / a$ is the unique $y$ with $y * a = b$.

These satisfy identities like

$$ a * (a\backslash b) = b,\quad (b / a) * a = b,\quad a\backslash(a * b) = b,\quad (b * a)/a = b. $$

Basic properties:

  • Cancellation: From uniqueness of solutions, left and right cancellation hold: if $a * b = a * c$, then $b=c$; similarly $b * a = c * a$ implies $b=c$.
  • Not necessarily associative: The operation need not satisfy $(a * b) * c = a * (b * c)$.
  • No need for identity: A quasigroup may or may not have an identity element.

A loop is a quasigroup that does have a two-sided identity element $e$ such that $e * a = a = a * e$ for all $a$. So every group is a loop (and hence a quasigroup) with associativity; but loops in general need not be associative.

Examples:

  1. Group example (associative loop): $(\mathbb{Z},+)$ with addition is a quasigroup (in fact a group) because for any $a,b$ the equations $a + x = b$ and $y + a = b$ have unique solutions $x = b - a$, $y = b - a$. Identity $0$ exists and associativity holds.

  2. Non-associative quasigroup (no identity): Take $Q = \mathbb{Z}_3 = \{0,1,2\}$ and define $a * b = a - b \pmod 3$. Then for any $a,b$, $a * x = b$ has unique solution $x = a - b$, and similarly on the left. There is no single element acting as a two-sided identity for all $a$, and the operation is not associative in general. So $(\mathbb{Z}_3, a * b = a - b)$ is a quasigroup but not a loop or group.

  3. Latin square example: Let $Q=\{1,2,3\}$ with operation given by the Latin square

$$ \begin{array}{c|ccc} * & 1 & 2 & 3\\\hline 1 & 2 & 3 & 1\\ 2 & 3 & 1 & 2\\ 3 & 1 & 2 & 3 \end{array} $$

This defines a quasigroup structure (every element appears once per row/column). It’s nontrivial to check associativity; this particular one is not necessarily associative, so it’s a non-associative quasigroup.

Special notions:

  • Isotopy: Two quasigroups $(Q,*)$ and $(Q,\circ)$ are isotopic if there exist bijections $\alpha,\beta,\gamma: Q\to Q$ such that for all $x,y$,

    $$ \alpha(x)\circ \beta(y)=\gamma(x * y). $$

    Isotopy generalizes isomorphism; many properties (like being a Latin square) are preserved under isotopy.

  • Parastrophes: From a quasigroup one can derive up to six related quasigroups by permuting arguments and solving for different variables—these are the parastrophes (e.g., exchanging the roles of left/right division).

  • Moufang and Bol loops: These are loops (quasigroups with identity) that satisfy extra identities weaker than full associativity, giving them group-like behavior in certain contexts.

Key theorem: If a quasigroup is associative, then it has a two-sided identity and inverses, so it is a group. Thus “associative quasigroup” $\iff$ group.

Applications: Quasigroups and their finite versions (Latin squares) appear in design theory (e.g., experimental design), error-correcting codes, cryptography (e.g., quasigroup string transformations / stream ciphers), and combinatorial constructions.

If you’d like, I can show more concrete examples (e.g., construct all quasigroups of small order), explore loops like Moufang loops, or prove the associative-quasigroup-is-group fact. Would you prefer a particular direction?

Is this different from having inverses?

Yes. The quasigroup/division property is weaker and more general than “having inverses” in the usual group sense.

  • In a quasigroup you can always solve $a * x = b$ and $y * a = b$ uniquely for $x,y$; this gives you left- and right-“division” operators, but there need not be any distinguished identity element. So you don’t get a global inverse of an element because “inverse” is only defined relative to an identity.

  • In a loop (a quasigroup with a two-sided identity $e$) you can define for each element $a$:

    • A left inverse $a^{L}$ such that $a^{L} * a = e$,
    • A right inverse $a^{R}$ such that $a * a^{R} = e$. These exist uniquely, but in a general loop $a^{L}$ and $a^{R}$ might be different. If they coincide and behave well (e.g., $(a^{-1})^{-1}=a$, $(a b)^{-1}=b^{-1}a^{-1}$), the loop is said to have the inverse property (many Moufang loops do).
  • In a group (an associative loop) there is an identity and each element has a two-sided inverse $a^{-1}$ with $a^{-1} * a = a * a^{-1} = e$; associativity makes these inverses behave in the familiar algebraic way.

So: quasigroup division gives you the ability to “undo” $a *$ or $* a$ in isolation, but without an identity you can’t talk about the inverse of $a$ itself. Having a (two-sided) inverse is a stronger structure that requires at least a loop, and in full generality (as in groups) also associativity.

Examples of theory development according to Halmos

Paul Halmos said:

It has often happened that a theory designed originally as a tool for the study of a physical problem came subsequently to have purely mathematical interest. When that happens, the theory is usually generalized way beyond the point needed for applications, the generalizations make contact with other theories (frequently in completely unexpected directions), and the subject becomes established as a new part of pure mathematics. The part of pure mathematics so created does not (and need not) pretend to solve the physical problem from which it arises; it must stand or fall on its own merits.

Give examples of this.

Below are some well-loved cases where a tool built for a concrete physical problem was abstracted, stretched, and woven so deeply into mainstream mathematics that it now flourishes with little—or no—regard for the original application.


1. Calculus ⇒ Real & Complex Analysis, Measure Theory

Physics seed. Newton and Leibniz invented the differential and integral calculus to describe planetary motion and falling bodies. Mathematical flowering. Over the next three centuries questions about rigor, convergence, and “what is a function?” spawned ε-δ analysis, measure theory, Lebesgue integration, and modern functional analysis. Today vast stretches of real and complex analysis have no direct tie to mechanics, yet the language of limits, continuity, and integration they introduced underpins almost every branch of pure mathematics.


2. Fourier’s Heat Equation ⇒ Harmonic Analysis & Representation Theory

Physics seed. In 1807 Fourier decomposed temperature distributions into sine waves to solve the heat equation. Mathematical flowering. Generalizing those trigonometric series to arbitrary groups, spaces, and operators led to harmonic analysis, abstract Plancherel theorems, and deep links to group representation theory and number theory (e.g., modular forms, automorphic representations). The toolbox now serves problems that have nothing to do with heat flow.


3. Hilbert Space & Operators ⇒ Modern Functional Analysis and Operator Algebras

Physics seed. Integral-equation formulations of diffraction and quantum mechanics in the early 1900s forced mathematicians (notably Hilbert) to treat infinite-dimensional inner-product spaces systematically. Mathematical flowering. Banach’s and von Neumann’s generalizations (Banach spaces, C*- and von Neumann algebras, spectral theory) turned functional analysis into its own kingdom, fundamental to fields ranging from PDE to ergodic theory and pure operator algebra classification, far removed from Schrödinger’s equation.


4. Dirac Delta ⇒ Distribution Theory

Physics seed. Dirac introduced the “δ-function’’ to describe point charges and quantum measurements—an object that made physical sense but defied classical function definitions. Mathematical flowering. Schwartz formalized distributions (generalized functions) in the 1940s, creating a robust framework for linear PDEs, microlocal analysis, and the modern theory of Sobolev spaces. Many distribution-theoretic developments concern abstract regularity and propagation of singularities, with no physical context required.


5. Hamiltonian Mechanics ⇒ Symplectic Geometry & Topology

Physics seed. Hamilton packaged classical mechanics in the 1830s using conjugate position–momentum coordinates. Mathematical flowering. Treating the 2n-dimensional phase space abstractly gave rise to symplectic manifolds. Gromov’s 1985 pseudoholomorphic-curve theory, Floer homology, and mirror symmetry connected symplectic geometry to topology, algebraic geometry, and category theory—fields where “mass” and “momentum” never appear.


6. Kelvin’s Vortex Atoms ⇒ Knot Theory & Low-Dimensional Topology

Physics seed. Lord Kelvin (1867) imagined atoms as knotted vortices in the ether, motivating Tait to tabulate knots. Mathematical flowering. Though the ether died, the knot tables survived. Reidemeister moves, Alexander, Jones, and HOMFLY-PT polynomials, plus 3-manifold invariants such as Chern–Simons–Witten theory now occupy a central place in topology, representation theory, and even quantum computing.


7. Yang–Mills Gauge Fields ⇒ 4-Manifold Topology & Geometric Analysis

Physics seed. 1950s non-abelian gauge theory described the strong and weak nuclear forces. Mathematical flowering. Donaldson (1983) used the Yang–Mills moduli space to produce exotic smooth structures on ℝ⁴; Seiberg–Witten theory refined these techniques. The resulting revolution in differential topology and low-dimensional geometry persists regardless of particle physics.


8. Random Matrix Theory (Wigner’s Nuclear Physics) ⇒ Number Theory & Combinatorics

Physics seed. Wigner modeled heavy-nucleus energy levels with random symmetric matrices in the 1950s. Mathematical flowering. The statistics of eigenvalues (level spacing, Tracy–Widom laws) were abstracted and now illuminate the zeros of the Riemann zeta function, growth of Young diagrams, and universality questions in combinatorics—no neutron spectra in sight.


9. Statistical Mechanics ⇒ Ergodic Theory & Dynamical Systems

Physics seed. Boltzmann and Gibbs created ensembles to explain gas thermodynamics. Mathematical flowering. Abstract notions of measure-preserving transformations, entropy, and mixing evolved into ergodic theory. Today, rigidity theorems for group actions or homogeneous flows live squarely in pure mathematics, even when the systems studied have no atoms at all.


10. Quantum Integrable Models ⇒ Quantum Groups & Knot Invariants

Physics seed. Exactly solvable 1-D quantum spin chains used R-matrices satisfying the Yang–Baxter equation. Mathematical flowering. Drinfeld and Jimbo abstracted that combinatorial property into “quantum groups,” which now influence category theory, low-dimensional topology, and representation theory—the physical spins have faded from view.


Halmos’s cycle—applied tool → wild generalization → unexpected bridges → autonomous theory—recurs throughout mathematics. The stories above show how questions born in the laboratory or observatory can end up enriching the pure landscape in ways their inventors could never have predicted.

Wednesday, August 6, 2025

Prime-order group powers: vector spaces

powers of groups of prime order are vector spaces

Yes, that's correct — groups of prime order have an important connection to vector spaces, under the right interpretation.

Key Idea:

If $G$ is a group of prime order $p$, then:

  • $G$ is a cyclic group (since all groups of prime order are cyclic),
  • Every element $g \in G$ satisfies $g^p = e$, the identity element,
  • If $G$ is also abelian and we consider it as a module over $\mathbb{F}_p$, then it becomes a vector space over $\mathbb{F}_p$.

Explanation:

Let’s formalize it:

1. Group of Prime Order:

Let $G$ be a group with order $p$, a prime number.

  • Then $G$ is cyclic: $G \cong \mathbb{Z}/p\mathbb{Z}$,
  • It is abelian, because all cyclic groups are abelian.

2. Powers and Vector Space Structure:

If you now look at a finite abelian group $G$ where every element has order dividing a prime $p$, i.e., for all $g \in G$, $g^p = e$, then:

  • $G$ is a $\mathbb{F}_p$-vector space.

Why?

Because we can define scalar multiplication by elements of $\mathbb{F}_p$ as:

$$ a \cdot g = g^a $$

This satisfies the vector space axioms because exponentiation respects the group operation.

Thus:

Any abelian group $G$ where every element has order $p$ (a prime) can be regarded as a vector space over $\mathbb{F}_p$.

This includes:

  • Any group of order $p$,
  • More generally, any abelian $p$-group of exponent $p$.

Examples:

  • $\mathbb{Z}/p\mathbb{Z} \cong \mathbb{F}_p$: 1-dimensional vector space over $\mathbb{F}_p$,
  • $(\mathbb{Z}/p\mathbb{Z})^n \cong \mathbb{F}_p^n$: n-dimensional vector space over $\mathbb{F}_p$.

Conclusion:

So yes — the powers (i.e., elements raised to integers) in abelian groups of prime order, or more generally abelian $p$-groups of exponent $p$, behave like elements of a vector space over the finite field $\mathbb{F}_p$.