Skip to content

@enumeratio/adeles ​

Adèles and idèles over Q\mathbb{Q} for compute-engine — a port of Mathé Hertogh's Sage adeles package. Three value heads (ProfiniteNumber, Adele, Idele) carry a number known only modulo something, and existing heads (arithmetic, Equal, Numerator, Fibonacci, LucasL) learn to take them rather than growing new ones.

Usage ​

ts
import { declareAdeles } from "@enumeratio/adeles";

declareAdeles(ce);
ProfiniteNumber(3, 12) + ProfiniteNumber(5, 8)   // ProfiniteNumber(0, 4)
Equal(ProfiniteNumber(6, 20), ProfiniteNumber(6, 40))   // True
Numerator(ProfiniteNumber(Rational(2, 3), 5))   // ProfiniteNumber(2, 15)

./src exports the raw TypeScript entry for a workspace consumer; profinite and idele are re-exported as namespaces over the plain-value arithmetic (Profinite, IdeleFinite) that the heads box and unbox. determinant, inverse and profiniteDecomposition (from matrix.ts) implement strong approximation for GLn(Q^)GL_n(\hat{\mathbb{Q}}) and back ProfiniteDecomposition.

Heads ​

Values. ProfiniteNumber is the coset x+mZ^x + m\hat{\mathbb{Z}}; modulus 0 is exact. ProfiniteNumber(list) glues a list of AdicNumeral values back together by CRT. Adele pairs a real with a profinite number; Idele is a unit of the adèle ring, principal everywhere except a named finite set of primes.

Matrices. ProfiniteDecomposition factors m∈GLn(Q^)m ∈ GL_n(\hat{\mathbb{Q}}) as b⋅ab \cdot a with b∈GLn(Z^)b ∈ GL_n(\hat{\mathbb{Z}}) and a∈GLn+(Q)a ∈ GL_n^+(\mathbb{Q}) upper triangular.

Visualization. ProfinitePlot draws a profinite function Z^→Z^\hat{\mathbb{Z}} → \hat{\mathbb{Z}} as an ArrayPlot, residue classes laid out by factorial digits.

See also ​

See Adèles and idèles for the worked walkthrough — cosets, equality as "the sets meet", one prime at a time, and profinite Fibonacci.

Builds on @enumeratio/number-theory (Hermite normal form, for the matrix decomposition), @enumeratio/numerals (AdicNumeral, the p-adic values a profinite number's list form glues together), and @enumeratio/residues (CRT, modular inverse).

Pages ​