Each root below is derived from the links of the one-source chain (OneMove, FundAll, and the chains and points of the section on foundations as instances of parameters): a minimal definition and one core theorem, checked in Lean 4 core by hand. Further results of each field hang below as branches proved elsewhere.
Subsets are maps into the truth values \(\Omega \) (link 19); the decidable ones are maps into the two-valued point, and sums are FundAll’s running sum \(\Sigma \). A \(\sigma \)-algebra is a family of predicates containing everything and closed under complement and countable union (the power set is one). A measure is a weight per point, \(\mu (A)=\Sigma _{n<N} w(n)\,\mathbf {1}_A(n)\), finitely additive:
found/RootMeasure.lean
/-
T320. found/RootMeasure — measure and probability as a root of the chain.
From the chain: subsets are maps into the truth values (Omega, link 19);
the decidable ones are maps into the two-valued point (FundAll, Part D);
sums are FundAll's running sum `runsum` (the "do it n times" addition of
OneMove link 21-22), restated here for Nat. Nothing is imported.
* sigma-algebra: a family of predicates closed under complement and
countable union (stated on Prop-valued sets);
* measure: a weight per point, mu(A) = running sum of the weights on A
(on a finite horizon N), with finite additivity;
* integral: running sum of weight * value;
* monotone convergence: if f_k increases to g pointwise, the integrals
of f_k reach the integral of g;
* probability space: total weight T > 0, P(A) = mu(A) / T as the pair
(mu A, T); P(everything) = 1 and P(A) + P(not A) = 1.
The link to the entropy chain (Ent.v) is the probability vector: a
probability space here gives the weights the entropy chain reads.
CIC dependence: none.
-/
namespace Found.RootMeasure
/-- FundAll's running sum, for Nat. -/
def runsum (f : Nat → Nat) : Nat → Nat
| 0 => 0
| n + 1 => runsum f n + f n
theorem runsum_congr (f g : Nat → Nat) (h : forall n, f n = g n) :
forall N, runsum f N = runsum g N
| 0 => rfl
| N + 1 => by
show runsum f N + f N = runsum g N + g N
rw [runsum_congr f g h N, h N]
theorem runsum_add (f g : Nat → Nat) :
forall N, runsum (fun n => f n + g n) N = runsum f N + runsum g N
| 0 => rfl
| N + 1 => by
show runsum (fun n => f n + g n) N + (f N + g N) = (runsum f N + f N) + (runsum g N + g N)
rw [runsum_add f g N, Nat.add_assoc, Nat.add_assoc, Nat.add_left_comm (f N) (runsum g N) (g N)]
/-! ## Sigma-algebras (on the truth values) -/
/-- A sigma-algebra on `X`: a family of sets containing everything, closed under
complement and countable union. -/
structure SigmaAlg (X : Type) where
mem : (X → Prop) → Prop
univ : mem (fun _ => True)
compl : forall A, mem A → mem (fun x => A x → False)
union : forall A : Nat → X → Prop, (forall k, mem (A k)) → mem (fun x => Exists fun k => A k x)
/-- Every set: the largest sigma-algebra. -/
def powerSet (X : Type) : SigmaAlg X where
mem := fun _ => True
univ := True.intro
compl := fun _ _ => True.intro
union := fun _ _ => True.intro
/-! ## Measure and integral (decidable sets, finite horizon) -/
/-- A decidable set: a map into the two-valued point. -/
abbrev BSet := Nat → Bool
def ind (A : BSet) (n : Nat) : Nat :=
match A n with
| true => 1
| false => 0
/-- The measure with weights `w`, on the points below `N`. -/
def meas (w : Nat → Nat) (N : Nat) (A : BSet) : Nat :=
runsum (fun n => w n * ind A n) N
/-- The integral of `f` with weights `w`, on the points below `N`. -/
def integral (w f : Nat → Nat) (N : Nat) : Nat :=
runsum (fun n => w n * f n) N
def bunion (A B : BSet) : BSet := fun n => A n || B n
def binter (A B : BSet) : BSet := fun n => A n && B n
def bcompl (A : BSet) : BSet := fun n => !(A n)
def buniv : BSet := fun _ => true
def bempty : BSet := fun _ => false
theorem meas_empty (w : Nat → Nat) (N : Nat) : meas w N bempty = 0 := by
have h : forall n, w n * ind bempty n = 0 := fun n => Nat.mul_zero (w n)
show runsum (fun n => w n * ind bempty n) N = 0
rw [runsum_congr _ (fun _ => 0) h N]
induction N with
| zero => rfl
| succ k ih => show runsum (fun _ => 0) k + 0 = 0; rw [Nat.add_zero, ih]
/-- Pointwise: one point counted in union and intersection as in A and B. -/
theorem ind_union_inter (A B : BSet) (n : Nat) :
ind (bunion A B) n + ind (binter A B) n = ind A n + ind B n := by
unfold ind bunion binter
cases A n <;> cases B n <;> rfl
/-- Finite additivity: mu(A union B) + mu(A inter B) = mu(A) + mu(B). -/
theorem meas_union_inter (w : Nat → Nat) (N : Nat) (A B : BSet) :
meas w N (bunion A B) + meas w N (binter A B) = meas w N A + meas w N B := by
unfold meas
rw [← runsum_add, ← runsum_add]
apply runsum_congr
intro n
show w n * ind (bunion A B) n + w n * ind (binter A B) n = w n * ind A n + w n * ind B n
rw [← Nat.mul_add, ← Nat.mul_add, ind_union_inter]
/-- The measure of a set is the integral of its indicator. -/
theorem meas_integral (w : Nat → Nat) (N : Nat) (A : BSet) :
meas w N A = integral w (ind A) N := rfl
/-! ## Monotone convergence -/
/-- If `f k n` agrees with `g n` from some stage on, at every point, the integrals agree
from some stage on (finite horizon). -/
theorem integral_eventually (w g : Nat → Nat) (f : Nat → Nat → Nat)
(conv : forall n, Exists fun K => forall k, K <= k → f k n = g n) :
forall N, Exists fun K => forall k, K <= k → integral w (f k) N = integral w g N
| 0 => Exists.intro 0 (fun _ _ => rfl)
| N + 1 =>
match integral_eventually w g f conv N, conv N with
| Exists.intro K1 h1, Exists.intro K2 h2 =>
Exists.intro (K1 + K2) (fun k hk => by
show integral w (f k) N + w N * f k N = integral w g N + w N * g N
rw [h1 k (Nat.le_trans (Nat.le_add_right K1 K2) hk),
h2 k (Nat.le_trans (Nat.le_add_left K2 K1) hk)])
/-- Antisymmetry of the order, by hand (every case written out). -/
theorem le_antisymm' : forall (a b : Nat), a <= b → b <= a → a = b
| 0, 0, _, _ => rfl
| 0, b + 1, _, h => absurd h (Nat.not_succ_le_zero b)
| a + 1, 0, h, _ => absurd h (Nat.not_succ_le_zero a)
| a + 1, b + 1, h1, h2 =>
congrArg Nat.succ (le_antisymm' a b (Nat.le_of_succ_le_succ h1) (Nat.le_of_succ_le_succ h2))
/-- Monotone convergence: `f k` increases with `k`, stays below `g`, and reaches `g`
at every point; then the integrals of `f k` reach the integral of `g`. -/
theorem monotone_convergence (w g : Nat → Nat) (f : Nat → Nat → Nat)
(mono : forall k n, f k n <= f (k + 1) n)
(below : forall k n, f k n <= g n)
(reach : forall n, Exists fun k => f k n = g n) :
forall N, Exists fun K => forall k, K <= k → integral w (f k) N = integral w g N := by
apply integral_eventually
intro n
match reach n with
| Exists.intro k0 hk0 =>
refine Exists.intro k0 (fun k hk => ?_)
have up : f k0 n <= f k n := by
induction hk with
| refl => exact Nat.le_refl _
| step _ ih => exact Nat.le_trans ih (mono _ n)
have ge : g n <= f k n := Eq.subst (motive := fun x => x <= f k n) hk0 up
exact le_antisymm' (f k n) (g n) (below k n) ge
/-! ## Probability spaces -/
/-- A probability space on the points below `N`: weights with positive total. -/
structure ProbSpace where
w : Nat → Nat
N : Nat
pos : 0 < meas w N buniv
/-- P(A), as the pair (mu A, total). -/
def prob (P : ProbSpace) (A : BSet) : Nat × Nat := (meas P.w P.N A, meas P.w P.N buniv)
/-- P(everything) = 1: numerator equals denominator. -/
theorem prob_univ (P : ProbSpace) : (prob P buniv).1 = (prob P buniv).2 := rfl
theorem ind_compl (A : BSet) (n : Nat) : ind A n + ind (bcompl A) n = ind buniv n := by
unfold ind bcompl buniv
cases A n <;> rfl
/-- P(A) + P(not A) = 1. -/
theorem prob_compl (P : ProbSpace) (A : BSet) :
(prob P A).1 + (prob P (bcompl A)).1 = (prob P A).2 := by
show meas P.w P.N A + meas P.w P.N (bcompl A) = meas P.w P.N buniv
unfold meas
rw [← runsum_add]
apply runsum_congr
intro n
show P.w n * ind A n + P.w n * ind (bcompl A) n = P.w n * ind buniv n
rw [← Nat.mul_add, ind_compl]
/-- A fair coin on the points 0, 1. -/
def coin : ProbSpace := ProbSpace.mk (fun _ => 1) 2 (Nat.zero_lt_succ 1)
theorem coin_half : prob coin (fun n => n == 0) = (1, 2) := rfl
end Found.RootMeasure
#print axioms Found.RootMeasure.runsum_add
#print axioms Found.RootMeasure.meas_empty
#print axioms Found.RootMeasure.meas_union_inter
#print axioms Found.RootMeasure.meas_integral
#print axioms Found.RootMeasure.integral_eventually
#print axioms Found.RootMeasure.le_antisymm'
#print axioms Found.RootMeasure.monotone_convergence
#print axioms Found.RootMeasure.prob_univ
#print axioms Found.RootMeasure.prob_compl
#print axioms Found.RootMeasure.coin_half
#print axioms: 10 theorems, no axioms.
The records that population genetics reads (allele or type frequencies generation by generation, and phylogenetic data) are also read by other frames, each with its own core relation and its own ground. The table lists them; nothing is fitted or computed here.
|
Frame |
Core relation |
Reads the data as | Source |
|
|||
|
Wright–Fisher / Moran chain |
\(P(n\to m)=\binom {N}{m}p^m(1-p)^{N-m}\), \(p=n/N\) |
a finite population resampled each generation (a Markov chain on counts) | [1854] |
|
Replicator equation |
\(\dot x_i = x_i\,\bigl (f_i(x)-\bar f(x)\bigr )\) |
frequencies of strategies with payoffs; no inheritance | [1853] |
|
Price equation |
\(\bar w\,\Delta \bar z=\mathrm {Cov}(w,z)+\mathrm {E}(w\,\Delta z)\) |
an identity of parent–offspring bookkeeping, with no mechanism | [1851] |
|
Bayesian updating |
\(x_i'=x_i\,f_i/\bar f\), the same form as \(P(h\mid d)=P(h)\,P(d\mid h)/P(d)\) |
types as hypotheses, fitness as likelihood, each generation as one update | [1848] |
|
Shahshahani gradient flow |
\(\dot x=\nabla _{g}\bar f\) with \(g_{ij}(x)=\delta _{ij}/x_i\) |
Fisher’s fundamental theorem as gradient ascent in the information geometry of the simplex | [1852] |
|
Neutral theory |
fixation probability \(1/(2N)\), substitution rate \(k=\mu \) |
drift alone, no selection | [1850] |
|
Phylogenetic networks |
\(d(x,y)=\sum _{S\text { separates }x,y}\alpha _S\) (splits instead of a tree) |
conflicting signal and horizontal transfer, a web instead of a tree | [1849] |
|
Dissipation-driven adaptation |
\(\beta \langle \Delta Q\rangle _{I\to II}+\ln \frac {\pi (II\to I)}{\pi (I\to II)}+\Delta S_{\mathrm {int}}\ge 0\) |
self-replication as a thermodynamic process that dissipates energy | [1847] |
|
|||
|
|||
| |||
|
|||
| |||
All of these frames fit the same frequency records: each is a different reading of the same numbers. “Evolution” in the sense of population genetics is the choice of one of them.
The group is the one the chain already has; nothing about it is derived anew or assumed:
composition: maps in a row (OneMove links 9–12; comp_assoc by rfl);
identity: id (link 1), carried as the pair \(\Delta (\mathrm {id})\) (link 4, the diagonal);
associativity and the unit laws: rfl on composition;
inverse: a pair \((f,g)\) of maps flipped by the swap (links 1–8); the inverse laws \(g\circ f=\mathrm {id}\), \(f\circ g=\mathrm {id}\) are the pair’s two triangle equalities.
group_from_chain collects the four. From the integers (link 23), \(2\times 2\) integer matrices give the Lie algebra \(\mathfrak {sl}(2)\) with the commutator bracket,
found/RootBundle.lean
/-
T321. found/RootBundle -- the group of the chain, the Lie algebra sl(2) and the
exponential map, principal bundles, connections, curvature and the non-abelian
Bianchi identity, as a root of the chain.
The group is not derived anew; it is what the one-source chain (OneMove) already has:
* composition: maps in a row (links 9-12, comp_assoc by rfl);
* identity: id (link 1), carried as the pair diag id (link 4);
* inverse: a pair (f, g) of maps flipped by the swap sw (links 1-8);
* inverse laws: the two triangle equalities of the pair, g (f x) = x and f (g x) = x.
`group_from_chain` collects the four. Nothing is assumed beyond them.
Then: integers (link 23) -> 2x2 integer matrices -> the Lie algebra sl(2) with the
commutator bracket and the exponential of a nilpotent element; the principal bundle
(site, group element) with the group acting on the right; connections (a pair per
edge), gauge change and curvature (the Yang-Mills case: F' = k^-1 F k); and the
Bianchi identity, non-abelian: on a cube with arbitrary invertible transports on its
twelve edges, the six face holonomies carried to one corner multiply to the identity.
With the frame group it is the second Bianchi identity of general relativity; with
U(1) it is dF = 0.
Written with ASCII forms only (the paper's listing font).
CIC dependence: the unit laws hold by rfl through definitional eta (functions and
structures).
-/
import found.user.OneMove
namespace Found.RootBundle
open OneMove
/-! ## The group of the chain -/
variable {X : Type}
/-- The two triangle equalities of a pair of maps (f, g): g after f and f after g are id. -/
def Inv (p : Pair (X -> X) (X -> X)) : Prop :=
(forall x, p2 p (p1 p x) = x) /\ (forall x, p1 p (p2 p x) = x)
/-- Composition (first p, then q), on both members of the pairs. -/
def gcomp (p q : Pair (X -> X) (X -> X)) : Pair (X -> X) (X -> X) :=
Pair.mk (fun x => p1 q (p1 p x)) (fun x => p2 p (p2 q x))
/-- The group of the chain: associativity and the unit laws by rfl, the inverse laws from the
triangle equalities of the pair, and composition keeps the triangle equalities. -/
theorem group_from_chain (p q r : Pair (X -> X) (X -> X)) :
gcomp (gcomp p q) r = gcomp p (gcomp q r) /\
gcomp (diag idf) p = p /\ gcomp p (diag idf) = p /\
(Inv p -> (forall x, p1 (gcomp p (sw p)) x = x) /\ (forall x, p1 (gcomp (sw p) p) x = x)) /\
(Inv p -> Inv q -> Inv (gcomp p q)) :=
And.intro rfl (And.intro rfl (And.intro rfl (And.intro
(fun h => And.intro h.1 h.2)
(fun hp hq => And.intro
(fun x => Eq.trans (congrArg (p2 p) (hq.1 (p1 p x))) (hp.1 x))
(fun x => Eq.trans (congrArg (p1 q) (hp.2 (p2 q x))) (hq.2 x))))))
/-! ## Lie algebra sl(2) and the exponential map, on 2x2 integer matrices -/
structure M2 where
a : Int
b : Int
c : Int
d : Int
def mmul (x y : M2) : M2 :=
M2.mk (x.a * y.a + x.b * y.c) (x.a * y.b + x.b * y.d) (x.c * y.a + x.d * y.c) (x.c * y.b + x.d * y.d)
def msub (x y : M2) : M2 := M2.mk (x.a - y.a) (x.b - y.b) (x.c - y.c) (x.d - y.d)
def msmul (k : Int) (x : M2) : M2 := M2.mk (k * x.a) (k * x.b) (k * x.c) (k * x.d)
/-- The commutator bracket. -/
def br (x y : M2) : M2 := msub (mmul x y) (mmul y x)
def he : M2 := M2.mk 0 1 0 0
def hf : M2 := M2.mk 0 0 1 0
def hh : M2 := M2.mk 1 0 0 (-1)
theorem sl2_he : br hh he = msmul 2 he := rfl
theorem sl2_hf : br hh hf = msmul (-2) hf := rfl
theorem sl2_ef : br he hf = hh := rfl
/-- The exponential of the nilpotent `t e` (its square is zero): `1 + t e`. -/
def expE (t : Int) : M2 := M2.mk 1 t 0 1
theorem he_sq : mmul he he = M2.mk 0 0 0 0 := rfl
/-! Four facts of integer multiplication, by cases on the integer. -/
theorem i_mul_zero (s : Int) : s * 0 = 0 := by cases s <;> rfl
theorem i_zero_mul (t : Int) : 0 * t = 0 := by
cases t with
| ofNat m => exact congrArg Int.ofNat (Nat.zero_mul m)
| negSucc m => exact congrArg Int.negOfNat (Nat.zero_mul (Nat.succ m))
theorem i_one_mul (t : Int) : 1 * t = t := by
cases t with
| ofNat m => exact congrArg Int.ofNat (Nat.one_mul m)
| negSucc m => exact congrArg Int.negOfNat (Nat.one_mul (Nat.succ m))
theorem i_mul_one (s : Int) : s * 1 = s := by
cases s with
| ofNat n => exact congrArg Int.ofNat (Nat.mul_one n)
| negSucc n => exact congrArg Int.negOfNat (Nat.mul_one (Nat.succ n))
/-- One-parameter group law: exp(s e) exp(t e) = exp((t + s) e). -/
theorem expE_add (s t : Int) : mmul (expE s) (expE t) = expE (t + s) := by
show M2.mk (1 * 1 + s * 0) (1 * t + s * 1) (0 * 1 + 1 * 0) (0 * t + 1 * 1) = M2.mk 1 (t + s) 0 1
rw [i_mul_zero s, i_one_mul t, i_mul_one s, i_zero_mul t]
rfl
/-! ## Principal bundle and connection -/
/-- The right action on the principal bundle over the sites `S`: (site, group element). -/
def act {S : Type} (p : Pair S (Pair (X -> X) (X -> X))) (h : Pair (X -> X) (X -> X)) :
Pair S (Pair (X -> X) (X -> X)) := Pair.mk (p1 p) (gcomp (p2 p) h)
theorem act_fibre {S : Type} (p : Pair S (Pair (X -> X) (X -> X))) (h : Pair (X -> X) (X -> X)) :
p1 (act p h) = p1 p := rfl
/-- The action is free: if h moves no point of the fibre, h acts as the identity. -/
theorem act_free {S : Type} (p : Pair S (Pair (X -> X) (X -> X))) (h : Pair (X -> X) (X -> X))
(hp : Inv (p2 p)) (e : forall x, p1 (p2 (act p h)) x = p1 (p2 p) x) :
forall y, p1 h y = y := by
intro y
have t2 : p1 h (p1 (p2 p) (p2 (p2 p) y)) = p1 (p2 p) (p2 (p2 p) y) := e (p2 (p2 p) y)
have r : p1 (p2 p) (p2 (p2 p) y) = y := hp.2 y
rw [r] at t2
exact t2
/-- Gauge change by k at every site: first k(x)^-1, then U(x,y), then k(y). -/
def gauge {S : Type} (k : S -> Pair (X -> X) (X -> X)) (U : S -> S -> Pair (X -> X) (X -> X)) :
S -> S -> Pair (X -> X) (X -> X) :=
fun x y => gcomp (gcomp (sw (k x)) (U x y)) (k y)
/-- Curvature on the plaquette x1 x2 x3 x4: the holonomy around it. -/
def curv {S : Type} (U : S -> S -> Pair (X -> X) (X -> X)) (x1 x2 x3 x4 : S) : Pair (X -> X) (X -> X) :=
gcomp (gcomp (gcomp (U x1 x2) (U x2 x3)) (U x3 x4)) (U x4 x1)
/-- Curvature changes covariantly: F' = k(x1)^-1 F k(x1) (the Yang-Mills case). -/
theorem curv_gauge {S : Type} (k : S -> Pair (X -> X) (X -> X)) (hk : forall s, Inv (k s))
(U : S -> S -> Pair (X -> X) (X -> X)) (x1 x2 x3 x4 : S) (v : X) :
p1 (curv (gauge k U) x1 x2 x3 x4) v = p1 (gcomp (gcomp (sw (k x1)) (curv U x1 x2 x3 x4)) (k x1)) v := by
show p1 (k x1) (p1 (U x4 x1) (p2 (k x4) (p1 (k x4) (p1 (U x3 x4) (p2 (k x3) (p1 (k x3) (p1 (U x2 x3) (p2 (k x2) (p1 (k x2) (p1 (U x1 x2) (p2 (k x1) (v)))))))))))) = p1 (k x1) (p1 (U x4 x1) (p1 (U x3 x4) (p1 (U x2 x3) (p1 (U x1 x2) (p2 (k x1) v)))))
rw [(hk x2).1, (hk x3).1, (hk x4).1]
/-! ## The Bianchi identity (non-abelian) -/
/-- The cube 0..7 (0 = (0,0,0), 1 = (1,0,0), 2 = (0,1,0), 3 = (1,1,0), 4 = (0,0,1), ...) with
transports on its twelve edges: x-edges ua 0->1, ub 2->3, uc 4->5, ud 6->7; y-edges ue 0->2,
uf 1->3, ug 4->6, uh 5->7; z-edges ui 0->4, uj 1->5, uk 2->6, ul 3->7 (each a pair with its
triangle equalities; p1 walks the edge forwards, p2 backwards). Faces as loops: bottom 0-1-3-2,
front 0-1-5-4 at 0, right 1-3-7-5 at 1, back 3-2-6-7 at 3, left 2-0-4-6 at 2, top 4-5-7-6 at 4.
Bianchi: the bottom holonomy equals the product of the other five, each carried to the corner 0
along the paths p1 = 0-4-5-1, p3 = p1 1-5-7-3, p2 = p3 3-7-6-2, and 0-4 for the top:
bottom = front * p1 right p1^-1 * p3 back p3^-1 * p2 left p2^-1 * (0-4) top (0-4)^-1.
As one walk -- bottom^-1, then the right side -- it is the word
e b F A a j C I i c J f l H J j h L B k d L l D K E i g K k G I
(capital = edge walked backwards), and it acts as the identity on every point. -/
theorem bianchi (ua ub uc ud ue uf ug uh ui uj uk ul : Pair (X -> X) (X -> X))
(ha : Inv ua) (hb : Inv ub) (hc : Inv uc) (hd : Inv ud) (he : Inv ue) (hf : Inv uf) (hg : Inv ug) (hh : Inv uh) (hi : Inv ui) (hj : Inv uj) (hk : Inv uk) (hl : Inv ul) (x : X) :
p2 ui (p2 ug (p1 uk (p2 uk (p1 ug (p1 ui (p2 ue (p2 uk (p2 ud (p1 ul (p2 ul (p1 ud (p1 uk (p2 ub (p2 ul (p1 uh (p1 uj (p2 uj (p2 uh (p1 ul (p1 uf (p2 uj (p1 uc (p1 ui (p2 ui (p2 uc (p1 uj (p1 ua (p2 ua (p2 uf (p1 ub (p1 ue (x)))))))))))))))))))))))))))))))) = x := by
repeat (first | rw [ha.1] | rw [ha.2] | rw [hb.1] | rw [hb.2] | rw [hc.1] | rw [hc.2] | rw [hd.1] | rw [hd.2] | rw [he.1] | rw [he.2] | rw [hf.1] | rw [hf.2] | rw [hg.1] | rw [hg.2] | rw [hh.1] | rw [hh.2] | rw [hi.1] | rw [hi.2] | rw [hj.1] | rw [hj.2] | rw [hk.1] | rw [hk.2] | rw [hl.1] | rw [hl.2])
end Found.RootBundle
#print axioms Found.RootBundle.group_from_chain
#print axioms Found.RootBundle.sl2_he
#print axioms Found.RootBundle.sl2_hf
#print axioms Found.RootBundle.sl2_ef
#print axioms Found.RootBundle.he_sq
#print axioms Found.RootBundle.i_mul_zero
#print axioms Found.RootBundle.i_zero_mul
#print axioms Found.RootBundle.i_one_mul
#print axioms Found.RootBundle.i_mul_one
#print axioms Found.RootBundle.expE_add
#print axioms Found.RootBundle.act_fibre
#print axioms Found.RootBundle.act_free
#print axioms Found.RootBundle.curv_gauge
#print axioms Found.RootBundle.bianchi
#print axioms: 14 theorems, no axioms.
From the chain’s division algebras (OneMove link 26: complex numbers and quaternions on the core integers), a Dirac spinor in four Euclidean dimensions is a pair of quaternions \((\psi _L,\psi _R)\), and the Clifford generators are \(2\times 2\) quaternion matrices
found/RootSpinor.lean
/-
T322. found/RootSpinor -- spinors and chirality, as a root of the chain.
From the chain's division algebras (OneMove link 26: complex numbers and quaternions,
computed on the core integers): a Dirac spinor in four Euclidean dimensions is a pair of
quaternions (left, right); the Clifford generators are the 2x2 quaternion matrices
gamma_mu = [[0, s_mu], [sb_mu, 0]] with s = (1, i, j, k) and sb = (1, -i, -j, -k).
* Clifford algebra: gamma_mu^2 = 1 and gamma_mu gamma_nu = - gamma_nu gamma_mu (mu, nu
different), i.e. gamma_mu gamma_nu + gamma_nu gamma_mu = 2 delta_mu_nu;
* chirality: gamma_5 = gamma_1 gamma_2 gamma_3 gamma_4 = diag(-1, 1), gamma_5^2 = 1,
gamma_5 anticommutes with every gamma_mu; with pL = 1 - gamma_5 and pR = 1 + gamma_5
(twice the projectors, to stay in the integers): pL pR = 0, pL + pR = 2, pL^2 = 2 pL;
each gamma_mu carries left spinors to right ones (gamma_mu pL = pR gamma_mu);
* spin group: even products of gammas are block diagonal (Spin(4) = SU(2)_L x SU(2)_R,
left and right Weyl spinors transform separately); the rotation x -> q x q^-1 is the
same for q and -q, while the spinor q psi is not (the double cover).
All facts are closed computations (rfl). Written with ASCII forms only.
CIC dependence: none.
-/
import found.user.OneMove
namespace Found.RootSpinor
open OneMove
def hadd (x y : Hq) : Hq := Pair.mk (cadd (p1 x) (p1 y)) (cadd (p2 x) (p2 y))
def h0 : Hq := Pair.mk c0 c0
def h1 : Hq := Pair.mk c1 c0
def h2 : Hq := Pair.mk (Pair.mk 2 0) c0
def hconj (x : Hq) : Hq := Pair.mk (cconj (p1 x)) (cneg (p2 x))
/-- A 2x2 matrix of quaternions, acting on Dirac spinors (left, right). -/
structure QM where
a : Hq
b : Hq
c : Hq
d : Hq
def qmul (x y : QM) : QM :=
QM.mk (hadd (hmul x.a y.a) (hmul x.b y.c)) (hadd (hmul x.a y.b) (hmul x.b y.d))
(hadd (hmul x.c y.a) (hmul x.d y.c)) (hadd (hmul x.c y.b) (hmul x.d y.d))
def qadd (x y : QM) : QM := QM.mk (hadd x.a y.a) (hadd x.b y.b) (hadd x.c y.c) (hadd x.d y.d)
def qsub (x y : QM) : QM := QM.mk (hadd x.a (hneg y.a)) (hadd x.b (hneg y.b)) (hadd x.c (hneg y.c)) (hadd x.d (hneg y.d))
def qzero : QM := QM.mk h0 h0 h0 h0
def qone : QM := QM.mk h1 h0 h0 h1
def qtwo : QM := QM.mk h2 h0 h0 h2
def gam (s sb : Hq) : QM := QM.mk h0 s sb h0
def g1 : QM := gam h1 h1
def g2 : QM := gam hi (hneg hi)
def g3 : QM := gam hj (hneg hj)
def g4 : QM := gam hk (hneg hk)
/-! ## Clifford algebra -/
theorem sq1 : qmul g1 g1 = qone := rfl
theorem sq2 : qmul g2 g2 = qone := rfl
theorem sq3 : qmul g3 g3 = qone := rfl
theorem sq4 : qmul g4 g4 = qone := rfl
theorem anti12 : qadd (qmul g1 g2) (qmul g2 g1) = qzero := rfl
theorem anti13 : qadd (qmul g1 g3) (qmul g3 g1) = qzero := rfl
theorem anti14 : qadd (qmul g1 g4) (qmul g4 g1) = qzero := rfl
theorem anti23 : qadd (qmul g2 g3) (qmul g3 g2) = qzero := rfl
theorem anti24 : qadd (qmul g2 g4) (qmul g4 g2) = qzero := rfl
theorem anti34 : qadd (qmul g3 g4) (qmul g4 g3) = qzero := rfl
/-! ## Chirality -/
def g5 : QM := qmul (qmul (qmul g1 g2) g3) g4
theorem g5_val : g5 = QM.mk (hneg h1) h0 h0 h1 := rfl
theorem g5_sq : qmul g5 g5 = qone := rfl
theorem g5_anti1 : qadd (qmul g5 g1) (qmul g1 g5) = qzero := rfl
theorem g5_anti2 : qadd (qmul g5 g2) (qmul g2 g5) = qzero := rfl
theorem g5_anti3 : qadd (qmul g5 g3) (qmul g3 g5) = qzero := rfl
theorem g5_anti4 : qadd (qmul g5 g4) (qmul g4 g5) = qzero := rfl
def pL : QM := qsub qone g5
def pR : QM := qadd qone g5
theorem pL_pR : qmul pL pR = qzero := rfl
theorem pR_pL : qmul pR pL = qzero := rfl
theorem pL_add_pR : qadd pL pR = qtwo := rfl
theorem pL_sq : qmul pL pL = qadd pL pL := rfl
theorem pR_sq : qmul pR pR = qadd pR pR := rfl
theorem flip1 : qmul g1 pL = qmul pR g1 := rfl
theorem flip2 : qmul g2 pL = qmul pR g2 := rfl
theorem flip3 : qmul g3 pL = qmul pR g3 := rfl
theorem flip4 : qmul g4 pL = qmul pR g4 := rfl
/-! ## The spin group -/
/-- An even product is block diagonal: left and right spinors transform separately. -/
theorem g12_block : qmul g1 g2 = QM.mk (hneg hi) h0 h0 hi := rfl
/-- The rotation x -> q x conj(q) of the vectors (quaternions) is the same for q and -q. -/
theorem rot_double : hmul (hmul (hneg hi) hj) (hconj (hneg hi)) = hmul (hmul hi hj) (hconj hi) := rfl
/-- The spinor q psi is not: q = i and q = -i act differently on psi = 1. -/
theorem spin_sign : hmul hi h1 = hneg (hmul (hneg hi) h1) := rfl
end Found.RootSpinor
#print axioms Found.RootSpinor.anti12
#print axioms Found.RootSpinor.anti13
#print axioms Found.RootSpinor.anti14
#print axioms Found.RootSpinor.anti23
#print axioms Found.RootSpinor.anti24
#print axioms Found.RootSpinor.anti34
#print axioms Found.RootSpinor.sq1
#print axioms Found.RootSpinor.sq2
#print axioms Found.RootSpinor.sq3
#print axioms Found.RootSpinor.sq4
#print axioms Found.RootSpinor.g5_val
#print axioms Found.RootSpinor.g5_sq
#print axioms Found.RootSpinor.g5_anti1
#print axioms Found.RootSpinor.g5_anti2
#print axioms Found.RootSpinor.g5_anti3
#print axioms Found.RootSpinor.g5_anti4
#print axioms Found.RootSpinor.pL_pR
#print axioms Found.RootSpinor.pR_pL
#print axioms Found.RootSpinor.pL_add_pR
#print axioms Found.RootSpinor.pL_sq
#print axioms Found.RootSpinor.pR_sq
#print axioms Found.RootSpinor.flip1
#print axioms Found.RootSpinor.flip2
#print axioms Found.RootSpinor.flip3
#print axioms Found.RootSpinor.flip4
#print axioms Found.RootSpinor.g12_block
#print axioms Found.RootSpinor.rot_double
#print axioms Found.RootSpinor.spin_sign
#print axioms: 28 theorems, no axioms.
On the measure of the first root, the Euclidean lattice path integral has its frame: the field configurations on a finite lattice are the points, the weight of a configuration is the discrete \(e^{-S}\), the partition function is the measure of everything, and expectations are integrals divided by it,
found/RootQuant.lean
/-
T323. found/RootQuant -- quantization: the frame of the Euclidean lattice path integral,
on the measure of T320 (found/RootMeasure).
* configurations: the field on a finite lattice, numbered 0 .. M-1;
* weight: a positive number per configuration (the discrete exp(-S));
* partition function Z: the measure of all configurations; expectation <O>: the pair
(integral of O, Z), i.e. integral of O divided by Z;
* <1> = 1 and <O1 + O2> = <O1> + <O2> (from the running sum);
* an instance: Z2 lattice gauge theory on one plaquette (four links, 16
configurations; weight 2 if the plaquette product is +1, else 1): Z = 24, and a
gauge transformation at a site (flipping its two links) changes neither the weight
of any configuration nor Z.
The Yang-Mills ladder of the third window (continuum limit, mass gap) is not repeated
here; it is linked from the section text.
Written with ASCII forms only. CIC dependence: none.
-/
import found.RootMeasure
namespace Found.RootQuant
open Found.RootMeasure
/-- The partition function: the measure of all configurations 0 .. M-1. -/
def Z (w : Nat -> Nat) (M : Nat) : Nat := integral w (fun _ => 1) M
/-- The expectation of an observable, as (integral of O, Z). -/
def expect (w : Nat -> Nat) (M : Nat) (O : Nat -> Nat) : Nat × Nat := (integral w O M, Z w M)
/-- <1> = 1. -/
theorem expect_one (w : Nat -> Nat) (M : Nat) : (expect w M (fun _ => 1)).1 = (expect w M (fun _ => 1)).2 := rfl
/-- Linearity: <O1 + O2> = <O1> + <O2> (same denominator Z). -/
theorem expect_add (w : Nat -> Nat) (M : Nat) (O1 O2 : Nat -> Nat) :
(expect w M (fun c => O1 c + O2 c)).1 = (expect w M O1).1 + (expect w M O2).1 := by
show runsum (fun n => w n * (O1 n + O2 n)) M = runsum (fun n => w n * O1 n) M + runsum (fun n => w n * O2 n) M
rw [(runsum_add (fun n => w n * O1 n) (fun n => w n * O2 n) M).symm]
apply runsum_congr
intro n
exact Nat.mul_add (w n) (O1 n) (O2 n)
/-! ## Z2 gauge theory on one plaquette -/
/-- Link k (0..3) of configuration c: its k-th binary digit. -/
def link (c k : Nat) : Nat := (c / 2 ^ k) % 2
/-- The plaquette product, as a parity: 0 for +1, 1 for -1. -/
def plaq (c : Nat) : Nat := (link c 0 + link c 1 + link c 2 + link c 3) % 2
/-- Weight 2 for plaquette +1, weight 1 for -1. -/
def wZ2 (c : Nat) : Nat := 2 - plaq c
/-- All configurations below n pass the test p. -/
def allBelow (p : Nat -> Bool) : Nat -> Bool
| 0 => true
| n + 1 => p n && allBelow p n
/-- A gauge transformation at the site shared by links 0 and 3: flip both links. -/
def flip03 (c : Nat) : Nat :=
(1 - link c 0) + 2 * link c 1 + 4 * link c 2 + 8 * (1 - link c 3)
theorem Z_plaquette : Z wZ2 16 = 24 := rfl
/-- The gauge transformation keeps every configuration's weight. -/
theorem weight_gauge_invariant : allBelow (fun c => wZ2 (flip03 c) == wZ2 c) 16 = true := rfl
/-- ... and the partition function. -/
theorem Z_gauge_invariant : Z (fun c => wZ2 (flip03 c)) 16 = Z wZ2 16 := rfl
/-- <plaquette sign is +1> = 16 / 24 = 2/3. -/
theorem expect_plaq_plus : expect wZ2 16 (fun c => 1 - plaq c) = (16, 24) := rfl
end Found.RootQuant
#print axioms Found.RootQuant.expect_one
#print axioms Found.RootQuant.expect_add
#print axioms Found.RootQuant.Z_plaquette
#print axioms Found.RootQuant.weight_gauge_invariant
#print axioms Found.RootQuant.Z_gauge_invariant
#print axioms Found.RootQuant.expect_plaq_plus
#print axioms: 6 theorems, no axioms.
One generation, all fields left-handed (the right-handed ones enter as conjugates, as in the spinor root), hypercharges in units of \(1/6\), normalised by \(y_Q=1\): \(Q\,(3,2,y_Q)\), \(u^c\,(\bar 3,1,y_u)\), \(d^c\,(\bar 3,1,y_d)\), \(L\,(1,2,y_L)\), \(e^c\,(1,1,y_e)\). With the gauge group \(SU(3)\times SU(2)\times U(1)\) already in the chain, the anomalies that must vanish are
found/RootAnomaly.lean
/-
T324. found/RootAnomaly -- one generation's hypercharges are fixed by anomaly
cancellation (a finite algebraic computation, carried to the end).
One generation, all fields left-handed (T322: right-handed fields enter as conjugates),
with hypercharges in units of 1/6 and the normalisation y_Q = 1:
Q (3, 2) y_Q = 1 u^c (3bar, 1) y_u d^c (3bar, 1) y_d
L (1, 2) y_L e^c (1, 1) y_e
The anomalies that must vanish (gauge group SU(3) x SU(2) x U(1), already in the chain):
SU(3)^2 U(1): 2 y_Q + y_u + y_d = 0
SU(2)^2 U(1): 3 y_Q + y_L = 0
gravity^2 U(1): 6 y_Q + 3 y_u + 3 y_d + 2 y_L + y_e = 0
U(1)^3: 6 y_Q^3 + 3 y_u^3 + 3 y_d^3 + 2 y_L^3 + y_e^3 = 0
Theorem: over the integers these force y_L = -3, y_e = 6 and (y_u, y_d) = (-4, 2) or
(2, -4) -- the Standard Model, up to the names of u and d. Ring identities by the shared
library's normaliser (lib_int, no axioms); integers without zero divisors (int_noZD).
Written with ASCII forms only. CIC dependence: none.
-/
import lib.IntRing
namespace Found.RootAnomaly
open LibInt
/-- The Standard Model values satisfy the four conditions. -/
theorem sm_cancels :
2 * 1 + (-4) + 2 = (0 : Int) /\ 3 * 1 + (-3) = (0 : Int) /\
6 * 1 + 3 * (-4) + 3 * 2 + 2 * (-3) + 6 = (0 : Int) /\
6 * 1 + 3 * ((-4) * (-4) * (-4)) + 3 * (2 * 2 * 2) + 2 * ((-3) * (-3) * (-3)) + 6 * 6 * 6 = (0 : Int) :=
And.intro rfl (And.intro rfl (And.intro rfl rfl))
/-- Anomaly cancellation fixes the hypercharges of one generation. -/
theorem hypercharges (yu yd yL ye : Int)
(h3 : 2 * 1 + yu + yd = 0)
(h2 : 3 * 1 + yL = 0)
(hg : 6 * 1 + 3 * yu + 3 * yd + 2 * yL + ye = 0)
(hc : 6 * 1 + 3 * (yu * yu * yu) + 3 * (yd * yd * yd) + 2 * (yL * yL * yL) + ye * ye * ye = 0) :
yL = -3 /\ ye = 6 /\ ((yu = -4 /\ yd = 2) \/ (yu = 2 /\ yd = -4)) := by
have hL : yL = -3 := by
calc yL = (3 * 1 + yL) + -3 := by lib_int
_ = 0 + -3 := by rw [h2]
_ = -3 := by lib_int
have hd : yd = -2 + -yu := by
calc yd = (2 * 1 + yu + yd) + (-2 + -yu) := by lib_int
_ = 0 + (-2 + -yu) := by rw [h3]
_ = -2 + -yu := by lib_int
have he : ye = 6 := by
rw [hd, hL] at hg
calc ye = (6 * 1 + 3 * yu + 3 * (-2 + -yu) + 2 * -3 + ye) + 6 := by lib_int
_ = 0 + 6 := by rw [hg]
_ = 6 := by lib_int
rw [hd, hL, he] at hc
have key : (-18) * ((yu + 4) * (yu + -2)) = 0 := by
calc (-18) * ((yu + 4) * (yu + -2))
= 6 * 1 + 3 * (yu * yu * yu) + 3 * ((-2 + -yu) * (-2 + -yu) * (-2 + -yu))
+ 2 * (-3 * -3 * -3) + 6 * 6 * 6 := by lib_int
_ = 0 := hc
have hz : (yu + 4) * (yu + -2) = 0 := by
cases int_noZD (-18) ((yu + 4) * (yu + -2)) key with
| inl h => exact absurd h (fun e => Int.noConfusion e)
| inr h => exact h
refine And.intro hL (And.intro he ?_)
cases int_noZD (yu + 4) (yu + -2) hz with
| inl h =>
have h0 : yu + 4 = 0 := h
have hu : yu = -4 := by
calc yu = (yu + 4) + -4 := by lib_int
_ = 0 + -4 := by rw [h0]
_ = -4 := by lib_int
refine Or.inl (And.intro hu ?_)
rw [hd, hu]
rfl
| inr h =>
have h0 : yu + -2 = 0 := h
have hu : yu = 2 := by
calc yu = (yu + -2) + 2 := by lib_int
_ = 0 + 2 := by rw [h0]
_ = 2 := by lib_int
refine Or.inr (And.intro hu ?_)
rw [hd, hu]
rfl
end Found.RootAnomaly
#print axioms Found.RootAnomaly.sm_cancels
#print axioms Found.RootAnomaly.hypercharges
#print axioms: 2 theorems, no axioms.
For a group \(G\) broken to the subgroup \(H\) that fixes the vacuum, the gauge fields of the broken generators acquire mass and those of \(H\) stay massless: \(\dim G-\dim H\) massive fields. One case is computed: \(SU(2)\times U(1)\to U(1)\). The Higgs doublet is a pair of complex numbers (OneMove link 26, Gaussian integers) read as a real four-vector, with vacuum \(v=(0,1)\); the generators of \(\mathfrak {su}(2)\oplus \mathfrak {u}(1)\), doubled to stay in the integers, are \(i\sigma _1,i\sigma _2,i\sigma _3\) and \(i\) (hypercharge). They move \(v\) to \((0,1,0,0)\), \((1,0,0,0)\), \((0,0,0,-1)\), \((0,0,0,1)\), so the map from generator coefficients to the motion of \(v\) is
found/RootHiggs.lean
/-
T325. found/RootHiggs -- the Higgs mechanism, one case: SU(2) x U(1) -> U(1).
The Higgs doublet is a pair of complex numbers (z1, z2) (OneMove link 26, Gaussian
integers), read as the real four-vector (Re z1, Im z1, Re z2, Im z2). The vacuum is
v = (0, 1). The generators of su(2) + u(1), doubled to stay in the integers, are
i sigma_1, i sigma_2, i sigma_3 and i (hypercharge). A generator is unbroken when it
leaves v fixed (moves it by zero).
* the four generators move v to (0,1,0,0), (1,0,0,0), (0,0,0,-1), (0,0,0,1);
* the linear map c -> sum_a c_a T_a v is c -> (c2, c1, 0, c4 - c3);
* its kernel is exactly the line c1 = c2 = 0, c3 = c4: the charge Q = T3 + Y, one
unbroken generator (the photon, massless);
* so dim G - dim H = 4 - 1 = 3 generators are broken: three massive gauge fields
(W+, W-, Z), and the rank of the map is 3.
Written with ASCII forms only. CIC dependence: none.
-/
import found.user.OneMove
import lib.IntRing
namespace Found.RootHiggs
open OneMove LibInt
/-- A doublet: two complex numbers. -/
abbrev Dbl := Pair Cx Cx
def dmulc (k : Cx) (z : Dbl) : Dbl := Pair.mk (cmul k (p1 z)) (cmul k (p2 z))
def vac : Dbl := Pair.mk c0 c1
/-- i sigma_1, i sigma_2, i sigma_3, i * 1 acting on a doublet. -/
def gen1 (z : Dbl) : Dbl := dmulc ci (Pair.mk (p2 z) (p1 z))
def gen2 (z : Dbl) : Dbl := dmulc ci (Pair.mk (cmul (cneg ci) (p2 z)) (cmul ci (p1 z)))
def gen3 (z : Dbl) : Dbl := dmulc ci (Pair.mk (p1 z) (cneg (p2 z)))
def genY (z : Dbl) : Dbl := dmulc ci z
/-- The real four-vector of a doublet. -/
def real4 (z : Dbl) : Int × Int × Int × Int := (p1 (p1 z), p2 (p1 z), p1 (p2 z), p2 (p2 z))
theorem col1 : real4 (gen1 vac) = (0, 1, 0, 0) := rfl
theorem col2 : real4 (gen2 vac) = (1, 0, 0, 0) := rfl
theorem col3 : real4 (gen3 vac) = (0, 0, 0, -1) := rfl
theorem colY : real4 (genY vac) = (0, 0, 0, 1) := rfl
/-- The map from generator coefficients to the motion of the vacuum. -/
def L (c1 c2 c3 c4 : Int) : Int × Int × Int × Int :=
(c1 * 0 + c2 * 1 + c3 * 0 + c4 * 0, c1 * 1 + c2 * 0 + c3 * 0 + c4 * 0,
c1 * 0 + c2 * 0 + c3 * 0 + c4 * 0, c1 * 0 + c2 * 0 + c3 * -1 + c4 * 1)
/-- In closed form: (c2, c1, 0, c4 - c3). -/
theorem L_form (c1 c2 c3 c4 : Int) : L c1 c2 c3 c4 = (c2, c1, 0, c4 + -c3) := by
have a : c1 * 0 + c2 * 1 + c3 * 0 + c4 * 0 = c2 := by lib_int
have b : c1 * 1 + c2 * 0 + c3 * 0 + c4 * 0 = c1 := by lib_int
have c : c1 * 0 + c2 * 0 + c3 * 0 + c4 * 0 = 0 := by lib_int
have d : c1 * 0 + c2 * 0 + c3 * -1 + c4 * 1 = c4 + -c3 := by lib_int
show (c1 * 0 + c2 * 1 + c3 * 0 + c4 * 0, c1 * 1 + c2 * 0 + c3 * 0 + c4 * 0,
c1 * 0 + c2 * 0 + c3 * 0 + c4 * 0, c1 * 0 + c2 * 0 + c3 * -1 + c4 * 1) = _
rw [a, b, c, d]
/-- The unbroken generators: exactly the line c1 = c2 = 0, c3 = c4 (Q = T3 + Y). -/
theorem unbroken (c1 c2 c3 c4 : Int) :
L c1 c2 c3 c4 = (0, 0, 0, 0) -> c1 = 0 /\ c2 = 0 /\ c3 = c4 := by
intro h
rw [L_form] at h
have h2 : c2 = 0 := congrArg Prod.fst h
have h1 : c1 = 0 := congrArg (fun t => t.2.1) h
have h4 : c4 + -c3 = 0 := congrArg (fun t => t.2.2.2) h
refine And.intro h1 (And.intro h2 ?_)
calc c3 = c4 + -(c4 + -c3) := by lib_int
_ = c4 + -0 := by rw [h4]
_ = c4 := by lib_int
theorem charge_unbroken : L 0 0 1 1 = (0, 0, 0, 0) := rfl
/-- Three broken directions are independent: they move v to three different axes. -/
theorem broken_independent :
L 1 0 0 0 = (0, 1, 0, 0) /\ L 0 1 0 0 = (1, 0, 0, 0) /\ L 0 0 1 0 = (0, 0, 0, -1) :=
And.intro rfl (And.intro rfl rfl)
/-- The count: dim G - dim H = 4 - 1 = 3 massive gauge fields, 1 massless. -/
theorem count : 4 - 1 = 3 := rfl
end Found.RootHiggs
#print axioms Found.RootHiggs.col1
#print axioms Found.RootHiggs.col2
#print axioms Found.RootHiggs.col3
#print axioms Found.RootHiggs.colY
#print axioms Found.RootHiggs.L_form
#print axioms Found.RootHiggs.unbroken
#print axioms Found.RootHiggs.charge_unbroken
#print axioms Found.RootHiggs.broken_independent
#print axioms Found.RootHiggs.count
#print axioms: 9 theorems, no axioms.
The \(U(1)\) connection of the second root: on the integers, \(U(1)\) acts by shifts \(x\mapsto x+a\) (a pair of the chain with its two triangle equalities). \(dF=0\) is the \(U(1)\) case of the non-abelian Bianchi identity of the second root, in flux form \(F_{\mathrm {bottom}}=F_{\mathrm {front}}+F_{\mathrm {right}}+F_{\mathrm {back}}+F_{\mathrm {left}}+F_{\mathrm {top}}\) on a cube; \(d{\star }F=J\) defines the current as the divergence of the field, and summed over a region it is the flux through the ends, \(\sum _{x<N}J(x)=E(N)-E(0)\) (FundAll’s telescoping). Maxwell’s equations in the continuum, radiation and quantum electrodynamics are branches proved elsewhere.
found/RootEM.lean
/-
T326. found/RootEM -- electromagnetism, a branch of T321: the U(1) connection.
* U(1) on the integers: the shift x -> x + a with its inverse x -> x - a (a pair of the
chain with its two triangle equalities).
* dF = 0: the U(1) case of the non-abelian Bianchi identity of T321 (found/RootBundle),
and in flux form F_bottom = F_front + F_right + F_back + F_left + F_top on a cube.
* d*F = J: the current is the divergence of the field; summed over a region it is the
flux through its ends (Gauss), FundAll's telescoping sum.
Written with ASCII forms only. CIC dependence: none.
-/
import found.RootBundle
import lib.IntRing
namespace Found.RootEM
open OneMove LibInt Found.RootBundle
/-- U(1) acting on the integers by shifts: the pair (x -> x + a, x -> x - a). -/
def shift (a : Int) : Pair (Int -> Int) (Int -> Int) := Pair.mk (fun x => x + a) (fun x => x + -a)
theorem shift_inv (a : Int) : Inv (shift a) :=
And.intro (fun x => by show x + a + -a = x; lib_int) (fun x => by show x + -a + a = x; lib_int)
/-- dF = 0 as the U(1) case of the Bianchi identity of T321. -/
theorem dF_zero (a b c d e f g h i j k l x : Int) : p2 (shift i) (p2 (shift g) (p1 (shift k) (p2 (shift k) (p1 (shift g) (p1 (shift i) (p2 (shift e) (p2 (shift k) (p2 (shift d) (p1 (shift l) (p2 (shift l) (p1 (shift d) (p1 (shift k) (p2 (shift b) (p2 (shift l) (p1 (shift h) (p1 (shift j) (p2 (shift j) (p2 (shift h) (p1 (shift l) (p1 (shift f) (p2 (shift j) (p1 (shift c) (p1 (shift i) (p2 (shift i) -- (+140 chars; full line in the Zenodo source)
bianchi (shift a) (shift b) (shift c) (shift d) (shift e) (shift f) (shift g) (shift h) (shift i) (shift j) (shift k) (shift l) (shift_inv a) (shift_inv b) (shift_inv c) (shift_inv d) (shift_inv e) (shift_inv f) (shift_inv g) (shift_inv h) (shift_inv i) (shift_inv j) (shift_inv k) (shift_inv l) x
/-- The same in flux form: the bottom flux is the sum of the other five (outward orientation:
the total signed flux through the closed surface is zero). -/
theorem flux_form (a b c d e f g h i j k l : Int) :
a + f + -b + -e = (a + j + -c + -i) + (f + l + -h + -j) + (-b + k + d + -l) + (-e + i + g + -k) + (c + h + -d + -g) := by
lib_int
/-! ## d*F = J and Gauss -/
/-- Running sum on the integers (FundAll's Sigma). -/
def isum (f : Nat -> Int) : Nat -> Int
| 0 => 0
| n + 1 => isum f n + f n
/-- The current as the divergence of the field E along a line: J(x) = E(x+1) - E(x). -/
def current (E : Nat -> Int) (x : Nat) : Int := E (x + 1) + -E x
/-- Gauss: the charge in 0 .. N-1 is the flux through the ends. -/
theorem gauss (E : Nat -> Int) : forall N, isum (current E) N = E N + -E 0
| 0 => by show (0 : Int) = E 0 + -E 0; lib_int
| N + 1 => by
show isum (current E) N + (E (N + 1) + -E N) = E (N + 1) + -E 0
rw [gauss E N]
lib_int
end Found.RootEM
#print axioms Found.RootEM.shift_inv
#print axioms Found.RootEM.dF_zero
#print axioms Found.RootEM.flux_form
#print axioms Found.RootEM.gauss
#print axioms: 4 theorems, no axioms.
Wave functions on the integer lattice take values in the chain’s complex numbers; the translation \(T\psi (x)=\psi (x+1)\) generates the discrete translation group (the shifts of the electromagnetism branch). The tight-binding Hamiltonian \(H\psi (x)=\psi (x+1)+\psi (x-1)\) commutes with \(T\), and Bloch’s theorem holds: if \(T\psi =\lambda \psi \) then \(\psi (x+n)=\lambda ^n\psi (x)\), a plane wave times its value in one cell. Band theory, Brillouin zones in several dimensions and topological insulators are branches proved elsewhere.
found/RootBloch.lean
/-
T327. found/RootBloch -- condensed matter, a branch: the discrete translation group and
Bloch's theorem.
Wave functions on the integer lattice with values in the chain's complex numbers
(OneMove link 26, Gaussian integers). The translation T psi(x) = psi(x + 1) generates
the discrete translation group (the shifts of T326).
* the tight-binding Hamiltonian H psi(x) = psi(x + 1) + psi(x - 1) commutes with T;
* Bloch's theorem: if psi is an eigenfunction of T, T psi = lambda psi, then
psi(x + n) = lambda^n psi(x) for every n -- the wave function is a plane wave
lambda^x times its value in one cell.
Written with ASCII forms only. CIC dependence: none.
-/
import found.user.OneMove
import lib.IntRing
namespace Found.RootBloch
open OneMove LibInt
theorem pair_eq {A B : Type} {u v : Pair A B} (h1 : p1 u = p1 v) (h2 : p2 u = p2 v) : u = v := by
cases u
cases v
cases h1
cases h2
rfl
/-- Multiplication of the chain's complex numbers is associative. -/
theorem cmul_assoc (a b c : Cx) : cmul a (cmul b c) = cmul (cmul a b) c := by
apply pair_eq
· show p1 a * (p1 b * p1 c - p2 c * p2 b) - (p2 c * p1 b + p2 b * p1 c) * p2 a
= (p1 a * p1 b - p2 b * p2 a) * p1 c - p2 c * (p2 b * p1 a + p2 a * p1 b)
lib_int
· show (p2 c * p1 b + p2 b * p1 c) * p1 a + p2 a * (p1 b * p1 c - p2 c * p2 b)
= p2 c * (p1 a * p1 b - p2 b * p2 a) + (p2 b * p1 a + p2 a * p1 b) * p1 c
lib_int
/-- Translation by one cell. -/
def T (psi : Int -> Cx) : Int -> Cx := fun x => psi (x + 1)
/-- The tight-binding Hamiltonian. -/
def H (psi : Int -> Cx) : Int -> Cx := fun x => cadd (psi (x + 1)) (psi (x + -1))
/-- H commutes with the translations. -/
theorem H_T (psi : Int -> Cx) (x : Int) : T (H psi) x = H (T psi) x := by
show cadd (psi (x + 1 + 1)) (psi (x + 1 + -1)) = cadd (psi (x + 1 + 1)) (psi (x + -1 + 1))
have e : x + 1 + -1 = x + -1 + 1 := by lib_int
rw [e]
def cpow (l : Cx) : Nat -> Cx
| 0 => c1
| n + 1 => cmul l (cpow l n)
/-- Bloch's theorem: an eigenfunction of the translation is a plane wave. -/
theorem bloch (psi : Int -> Cx) (l : Cx) (eig : forall x, psi (x + 1) = cmul l (psi x)) (x : Int) :
forall n : Nat, psi (x + Int.ofNat n) = cmul (cpow l n) (psi x)
| 0 => by
show psi (x + 0) = cmul c1 (psi x)
have e : x + 0 = x := by lib_int
rw [e]
apply pair_eq
· show p1 (psi x) = 1 * p1 (psi x) - p2 (psi x) * 0
lib_int
· show p2 (psi x) = p2 (psi x) * 1 + 0 * p1 (psi x)
lib_int
| n + 1 => by
have e : x + Int.ofNat (n + 1) = (x + Int.ofNat n) + 1 := by
show x + (Int.ofNat n + 1) = x + Int.ofNat n + 1
lib_int
rw [e, eig, bloch psi l eig x n, cmul_assoc]
rfl
end Found.RootBloch
#print axioms Found.RootBloch.pair_eq
#print axioms Found.RootBloch.cmul_assoc
#print axioms Found.RootBloch.H_T
#print axioms Found.RootBloch.bloch
#print axioms: 4 theorems, no axioms.
Functions on the lattice are the function space of the first root, and the derivatives are the commuting difference operators of the second; the second difference \(u(x+1)-2u(x)+u(x-1)\) is the lattice \(\partial _x^2\) and vanishes on straight lines. A second-order operator \(a\,\partial _x^2+2b\,\partial _x\partial _y+c\,\partial _y^2\) is elliptic, parabolic or hyperbolic as \(b^2-ac\) is negative, zero or positive; under the change of variables \((x,y)\mapsto (px+qy,\,rx+sy)\),
found/RootPDE.lean
/-
T328. found/RootPDE -- partial differential equations, a branch: the classification of
second-order operators.
Functions on the lattice are the function space of T320; the derivatives are the
commuting difference operators of T321. A second-order operator in two variables,
a d_xx + 2 b d_xy + c d_yy, is elliptic, parabolic or hyperbolic as its discriminant
b^2 - a c is negative, zero or positive.
* under the linear change of variables (x, y) -> (p x + q y, r x + s y) the
coefficients become a', b', c' and the discriminant becomes
(p s - q r)^2 (b^2 - a c): the type does not depend on the coordinates;
* Laplace (1, 0, 1) is elliptic, heat (1, 0, 0) parabolic, wave (1, 0, -1) hyperbolic;
* the second difference u(x+1) - 2 u(x) + u(x-1) is the lattice d_xx.
Navier-Stokes is not repeated; it is linked from the section text.
Written with ASCII forms only. CIC dependence: none.
-/
import lib.IntRing
namespace Found.RootPDE
open LibInt
/-- The discriminant b^2 - a c of a d_xx + 2 b d_xy + c d_yy. -/
def disc (a b c : Int) : Int := b * b - a * c
/-- The coefficients after the change of variables (x, y) -> (p x + q y, r x + s y). -/
def a' (a b c p q : Int) : Int := a * p * p + 2 * b * p * q + c * q * q
def b' (a b c p q r s : Int) : Int := a * p * r + b * (p * s + q * r) + c * q * s
def c' (a b c r s : Int) : Int := a * r * r + 2 * b * r * s + c * s * s
/-- The discriminant changes by the square of the Jacobian determinant. -/
theorem disc_change (a b c p q r s : Int) :
disc (a' a b c p q) (b' a b c p q r s) (c' a b c r s) = (p * s - q * r) * (p * s - q * r) * disc a b c := by
unfold disc a' b' c'
lib_int
/-- The type: 0 elliptic, 1 parabolic, 2 hyperbolic, read from the sign of the discriminant. -/
def kind (a b c : Int) : Nat :=
match disc a b c with
| Int.ofNat 0 => 1
| Int.ofNat (_ + 1) => 2
| Int.negSucc _ => 0
theorem laplace_elliptic : kind 1 0 1 = 0 := rfl
theorem heat_parabolic : kind 1 0 0 = 1 := rfl
theorem wave_hyperbolic : kind 1 0 (-1) = 2 := rfl
/-- The lattice d_xx: the second difference. -/
def d2 (u : Int -> Int) (x : Int) : Int := u (x + 1) + -2 * u x + u (x + -1)
/-- It vanishes on straight lines, as d_xx does. -/
theorem d2_linear (m k x : Int) : d2 (fun t => m * t + k) x = 0 := by
show m * (x + 1) + k + -2 * (m * x + k) + (m * (x + -1) + k) = 0
lib_int
end Found.RootPDE
#print axioms Found.RootPDE.disc_change
#print axioms Found.RootPDE.laplace_elliptic
#print axioms Found.RootPDE.heat_parabolic
#print axioms Found.RootPDE.wave_hyperbolic
#print axioms Found.RootPDE.d2_linear
#print axioms: 5 theorems, no axioms.
From the chain’s \(\lambda \) link (37) and its translations, \(\mu \)-recursive programs, \(\lambda \)-terms, register machines and Turing machines compute the same functions (the Church–Turing line of the foundations section), and the halting problem is undecidable: no \(\mu \)-recursive program decides it, by the chain’s diagonal argument, restated here as a corollary. Relative to a machine model with step-bounded runs, \(L\in \mathrm {P}\) when one program decides it within \(c\,n^k+c\) steps, and \(L\in \mathrm {NP}\) when one program checks certificates of polynomial length within polynomial time. For SAT (formulas in conjunctive normal form), a certificate is an assignment, and its check reads every literal once: the cost of the check equals the size of the formula, so SAT has polynomial-time verification. The Cook–Levin theorem, that SAT is NP-complete [1844, 1845], is a proved theorem, not yet formalized here. A one-way function is defined as a function computable within a polynomial bound whose every polynomially bounded inverter succeeds on a negligible fraction of inputs; cryptography built on such functions, for instance on lattices and learning with errors [1846], is a branch proved elsewhere.
found/RootComp.lean
/-
T329. found/RootComp -- computation: computability, undecidability of halting,
P and NP, SAT, one-way functions.
From the chain: the lambda link (37) and its translations -- mu-recursive programs,
lambda terms, register and Turing machines are equivalent (the Church-Turing line,
T207: ChurchTuring2/3, TMSim, Minsky1-3, LamMu1-4). The halting problem is
undecidable: no mu-recursive program decides it (T96b, Found.K1.no_halting_realizer),
restated here.
* P and NP, relative to a machine model with fuel-bounded runs (any model of the
Church-Turing line);
* SAT: CNF formulas and their evaluation; the certificate check costs exactly the size
of the formula (linear time), so SAT has polynomial-time verification;
* one-way functions: the definition (easy to compute, hard to invert on average).
Cook-Levin (SAT is NP-complete; Cook 1971, Levin 1973) is a proved theorem, not yet
formalized here. Cryptography (lattices, LWE) is a branch, linked only.
Written with ASCII forms only. CIC dependence: none.
-/
import found.EffectiveK1
namespace Found.RootComp
/-- Halting is undecidable (the chain's diagonal argument, T96b). -/
theorem halting_undecidable : Not (Exists fun d : Found.CT3.MR => Found.K1.RealizesDec d Found.K1.Halts) :=
Found.K1.no_halting_realizer
/-! ## P and NP relative to a machine model -/
/-- A machine model: programs, and a run with a step budget (none = not finished). -/
structure Machine where
Prog : Type
run : Prog -> Nat -> List Bool -> Option Bool
/-- A polynomial bound c * n^k + c. -/
def pbound (c k n : Nat) : Nat := c * n ^ k + c
/-- L is in P: one program decides it within a polynomial number of steps. -/
def InP (M : Machine) (L : List Bool -> Bool) : Prop :=
Exists fun p : M.Prog => Exists fun c => Exists fun k =>
forall x, M.run p (pbound c k x.length) x = some (L x)
/-- L is in NP: one program checks certificates of polynomial length in polynomial time. -/
def InNP (M : Machine) (L : List Bool -> Bool) : Prop :=
Exists fun p : M.Prog => Exists fun c => Exists fun k =>
forall x, L x = true <->
Exists fun w : List Bool => w.length <= pbound c k x.length /\
M.run p (pbound c k (x.length + w.length)) (x ++ w) = some true
/-! ## SAT -/
/-- A literal: (polarity, variable); a clause: a list of literals; a CNF: a list of clauses. -/
abbrev Lit := Bool × Nat
abbrev Clause := List Lit
abbrev CNF := List Clause
def evalLit (a : Nat -> Bool) (l : Lit) : Bool :=
match l.1 with
| true => a l.2
| false => !(a l.2)
def evalClause (a : Nat -> Bool) : Clause -> Bool
| [] => false
| l :: c => evalLit a l || evalClause a c
def evalCNF (a : Nat -> Bool) : CNF -> Bool
| [] => true
| c :: f => evalClause a c && evalCNF a f
def Sat (f : CNF) : Prop := Exists fun a : Nat -> Bool => evalCNF a f = true
/-- The size of a formula: its number of literals. -/
def csize : Clause -> Nat
| [] => 0
| _ :: c => csize c + 1
def size : CNF -> Nat
| [] => 0
| c :: f => size f + csize c
/-- The cost of the check: one step per literal read (all literals are read). -/
def costClause : Clause -> Nat
| [] => 0
| _ :: c => costClause c + 1
def cost : CNF -> Nat
| [] => 0
| c :: f => cost f + costClause c
theorem costClause_eq : forall c : Clause, costClause c = csize c
| [] => rfl
| _ :: c => congrArg (fun t => t + 1) (costClause_eq c)
/-- The certificate check costs exactly the size of the formula: linear time. -/
theorem cost_eq_size : forall f : CNF, cost f = size f
| [] => rfl
| c :: f => by
show cost f + costClause c = size f + csize c
rw [cost_eq_size f, costClause_eq c]
/-- SAT has certificates: an assignment, checked by evaluation. -/
theorem sat_certificate (f : CNF) (a : Nat -> Bool) (h : evalCNF a f = true) : Sat f :=
Exists.intro a h
/-- An example: (x0 or not x1) and (x1) is satisfied by x0 = x1 = true. -/
theorem sat_example : evalCNF (fun _ => true) [[(true, 0), (false, 1)], [(true, 1)]] = true := rfl
/-! ## One-way functions -/
/-- A one-way function (definition): computable within a polynomial bound, and every
inverter within a polynomial bound succeeds on at most a fraction `eps n` of the inputs of
length n, where eps is smaller than every inverse polynomial from some length on. -/
structure OneWay (M : Machine) (f : List Bool -> List Bool) (succ : M.Prog -> Nat -> Nat × Nat) : Prop where
easy : Exists fun c => Exists fun k => forall x, (f x).length <= pbound c k x.length
hard : forall inv : M.Prog, forall c k : Nat, Exists fun n0 => forall n, n0 <= n ->
(succ inv n).1 * pbound c k n <= (succ inv n).2
end Found.RootComp
#print axioms Found.RootComp.halting_undecidable
#print axioms Found.RootComp.costClause_eq
#print axioms Found.RootComp.cost_eq_size
#print axioms Found.RootComp.sat_certificate
#print axioms Found.RootComp.sat_example
#print axioms: 5 theorems, no axioms.