Skip to main content

Appendix B: Master List of Definitions & Theorems - Chapter 4

This appendix serves as a centralized, rigorous catalog of the foundational mathematical postulates, definitions, axioms, lemmas, and theorems introduced in Chapter 4 of the Quantum Braid Dynamics (QBD) monograph.


4.1.1 Definition: Internal Causal Category​

Structure of Vertices via Directed Path Morphisms within a Single Snapshot

The Internal Causal Category, denoted Caust\mathbf{Caus}_t, is defined as the mathematical structure encapsulating the instantaneous causal relationships within a graph snapshot at Logical Time tt. The category comprises the following components:

  1. Objects: The set of objects Ob(Caust)\text{Ob}(\mathbf{Caus}_t) is strictly identical to the vertex set VV of the causal graph GtG_t.
  2. Morphisms: For any ordered pair of objects (u,v)(u, v), the set of morphisms Hom(u,v)\text{Hom}(u, v) consists of all Directed Path §1.2.3 originating at uu and terminating at vv. This set includes the Trivial Path of length ℓ=0\ell=0.
  3. Composition: The composition operation ∘:Hom(v,w)×Hom(u,v)→Hom(u,w)\circ: \text{Hom}(v, w) \times \text{Hom}(u, v) \to \text{Hom}(u, w) is defined as the concatenation of path sequences. For morphisms p=(u,…,v)p = (u, \dots, v) and q=(v,…,w)q = (v, \dots, w), the composition q∘pq \circ p yields the sequence (u,…,v,…,w)(u, \dots, v, \dots, w).
  4. Identity: For each object uu, the identity morphism idu\text{id}_u is defined as the Trivial Path containing the single vertex sequence (u)(u). (Awodey, 2010)

Lean 4 (QBD.Ch04.Defs):

/-- §4.1.1. Snapshot morphisms are typed directed edge lists. -/
abbrev CausHom {V : Type u} (G : RelTimestampedGraph V) (a b : V) :=
{p : List (Edge V) // DirectedEdgePath G.edges a b p}

def causId {V : Type u} (G : RelTimestampedGraph V) (a : V) : CausHom G a a := ⟨[], rfl⟩

def causComp {V : Type u} {G : RelTimestampedGraph V} {a b c : V}
(p : CausHom G a b) (q : CausHom G b c) : CausHom G a c :=
⟨p.val ++ q.val, p.property.append q.property⟩

In Plain English:
Section 4.1.1 formalizes the properties of the QBD definition regarding internal causal category.


4.1.2 Definition: Historical Category​

Structure as Cumulative Trajectories utilizing History-Preserving Embeddings

Let the Historical Category Hist\mathbf{Hist} have objects given by cumulative creation-record sets Et\mathcal E_t and morphisms given by their canonical inclusions. A record is ω=(u,v,b,h)\omega=(u,v,b,h) with source, target, scheduler birth tick and causal height (Creation Timestamp §1.4.4). Write

Et+1=Et∪At+1occ,b(ω)=ω3,h(ω)=ω4.\mathcal E_{t+1}=\mathcal E_t\cup A^{\mathrm{occ}}_{t+1},\qquad b(\omega)=\omega_3,\quad h(\omega)=\omega_4.

The initial records have b=h=0b=h=0. New records have birth tick t+1t+1 and height assigned from the pre-tick snapshot. For any fixed pair and birth tick the scheduler creates at most one record. The active-occurrence map αt:Et→Et\alpha_t:E_t\to\mathcal E_t identifies which past creation is currently active. The cumulative spatial support is the projection

E‾t={(u,v):∃b,h, (u,v,b,h)∈Et},G‾t=(V,E‾t).\overline E_t=\{(u,v):\exists b,h,\ (u,v,b,h)\in\mathcal E_t\},\qquad \overline G_t=(V,\overline E_t).

The unlabeled support G‾t\overline G_t is the cumulative spatial shadow of the creation history. It is not itself the occurrence dependency poset, and it does not identify different births of the same pair. A first-birth label on E‾t\overline E_t, if used, is not the current active height. Deletion records and the full state trajectory are additional data when required; the creation record alone is not defined to reconstruct every intermediate state.

An inclusion ιt,s:Et↪Es\iota_{t,s}:\mathcal E_t\hookrightarrow\mathcal E_s, t≤st\le s, has ιt,s(ω)=ω\iota_{t,s}(\omega)=\omega. Identities and composition are ordinary inclusion identities and composition, preserving all four coordinates exactly.

Lean 4 (QBD.Ch04.Defs):

/-- §4.1.2. Historical objects are predicates on immutable creation occurrences. -/
abbrev History (N : Nat) := CreationOccurrence N → Prop

def HistoricalInclusion {α : Type u} (A B : α → Prop) : Prop := ∀ e, A e → B e

def historyInclude {α : Type u} {A B : α → Prop} (h : HistoricalInclusion A B)
(x : Subtype A) : Subtype B := ⟨x.val, h x.val x.property⟩

def historySupport {N : Nat} (A : History N) (e : Edge (Fin N)) : Prop :=
∃ w, A w ∧ w.edge = e

In Plain English:
Section 4.1.2 formalizes the properties of the QBD definition regarding historical category.


4.1.3 Theorem: Orthogonality of Kinematic and Historical State​

Preservation of Historical Causal Poset via Active Kinematic Edge Excision

Let the active spatial state use the occurrence map αt:Et→Et\alpha_t:E_t\to\mathcal E_t and let creation records accumulate by union (Historical Category §4.1.2). Then the historical record is preserved by active edge deletion, including every prior creation record and its birth tick and height, while the cumulative spatial support remains monotonically inclusive.

In Plain English:
Section 4.1.3 formalizes the properties of the QBD theorem regarding orthogonality of kinematic and historical state.


4.1.4 Lemma: Trajectory Monotonicity under Edge Excision​

Preservation of Excised Kinematic Edges via Cumulative Trajectories

Let Et+1=Et∪At+1occ\mathcal E_{t+1}=\mathcal E_t\cup A^{\mathrm{occ}}_{t+1} and let active deletions remove pairs only from EtE_t. Then the historical inclusion is well-defined: Et⊆Et+1\mathcal E_t\subseteq\mathcal E_{t+1} and E‾t⊆E‾t+1\overline E_t\subseteq\overline E_{t+1}, and an excised active occurrence remains in the creation history (Historical Category §4.1.2).

In Plain English:
Section 4.1.4 formalizes the properties of the QBD lemma regarding trajectory monotonicity under edge excision.


4.1.4.1 Proof: Trajectory Monotonicity under Edge Excision​

Verification of Trajectory Inclusion via Set-Theoretic Monotonicity

I. Monotonicity of the Occurrence Set

Let At+1occA^{\mathrm{occ}}_{t+1} be the occurrences created at tick t+1t+1 (Historical Category §4.1.2) (Trajectory Monotonicity under Edge Excision §4.1.4). Each ω∈Et\omega\in\mathcal E_t satisfies

ω∈Et  ⟹  ω∈Et∪At+1occ=Et+1.\omega\in\mathcal E_t \;\Longrightarrow\; \omega\in\mathcal E_t\cup A^{\mathrm{occ}}_{t+1} =\mathcal E_{t+1}.

This proves Et⊆Et+1\mathcal E_t\subseteq\mathcal E_{t+1}.

II. Projection to Spatial Support

With π(u,v,b,h)=(u,v)\pi(u,v,b,h)=(u,v), the historical spatial support is the image E‾t=π(Et)\overline E_t=\pi(\mathcal E_t). The image of the union is

E‾t+1=π(Et+1)=π(Et∪At+1occ)=π(Et)∪π(At+1occ)=E‾t∪π(At+1occ).\begin{aligned} \overline E_{t+1} &=\pi(\mathcal E_{t+1}) =\pi(\mathcal E_t\cup A^{\mathrm{occ}}_{t+1})\\ &=\pi(\mathcal E_t)\cup\pi(A^{\mathrm{occ}}_{t+1}) =\overline E_t\cup\pi(A^{\mathrm{occ}}_{t+1}). \end{aligned}

Therefore E‾t⊆E‾t+1\overline E_t\subseteq\overline E_{t+1}.

III. Membership after Active Excision

Suppose e∈Ete\in E_t is excised at tick t+1t+1. Its occurrence ω=αt(e)\omega=\alpha_t(e) satisfies π(ω)=e\pi(\omega)=e. When the edge is absent from the active output, the two membership statements are

e∉Et+1,αt(e)∈Et⊆Et+1⟹e=π(αt(e))∈E‾t+1.\begin{aligned} e&\notin E_{t+1},\\ \alpha_t(e)&\in\mathcal E_t\subseteq\mathcal E_{t+1} \quad\Longrightarrow\quad e=\pi(\alpha_t(e))\in\overline E_{t+1}. \end{aligned}

If the edge is also assigned a new occurrence at a later tick s>ts>t, then AsoccA_s^{\mathrm{occ}} carries a distinct creation tick and Es\mathcal E_s contains both records by repeated occurrence-set inclusion.

Q.E.D.

In Plain English:
Section 4.1.4.1 formalizes the properties of the QBD proof regarding trajectory monotonicity under edge excision.


4.1.4.2 Type-Theoretic Validation via Lean 4 Core​

Lean 4 Encoding of Trajectory Monotonicity via Append-Only History Inclusions

Type-theoretic certification of the cumulative-history monotonicity established in Trajectory Monotonicity under Edge Excision §4.1.4 proceeds via the following verification strategy:

  1. Model: Cumulative occurrence predicates, append-only ledger extensions, historical inclusion maps, and historical edge supports represent monotonic trajectory growth.
  2. Certified Claims: The module certifies one-step, additive, and transitive monotonicity of cumulative histories, ledger append inclusion, and support inclusion in Trajectory Monotonicity under Edge Excision §4.1.4.1.
  3. Scope Boundary: Monotonicity applies to the cumulative historical ledger rather than the active spatial edge set, which shrinks under edge deletion.
import QBD.Ch04.Defs

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03

namespace QBD.Ch04

theorem cumulative_history_step_monotonicity {V : Type}
(H_seq A_seq : Nat → (Edge V → Prop))
(t : Nat)
(h_step : ∀ t e, H_seq (t + 1) e ↔ H_seq t e ∨ A_seq t e) :
HistoricalInclusion (H_seq t) (H_seq (t + 1)) := by
intro e he
rw [h_step t e]
exact Or.inl he

theorem cumulative_history_add_monotonicity {V : Type}
(H_seq A_seq : Nat → (Edge V → Prop))
(h_step : ∀ t e, H_seq (t + 1) e ↔ H_seq t e ∨ A_seq t e)
(t1 : Nat) (k : Nat) :
HistoricalInclusion (H_seq t1) (H_seq (t1 + k)) := by
intro e he
induction k with
| zero => exact he
| succ n ih =>
have h_one_step := cumulative_history_step_monotonicity H_seq A_seq (t1 + n) h_step
exact h_one_step e ih

theorem cumulative_history_transitive_monotonicity {V : Type}
(H_seq A_seq : Nat → (Edge V → Prop))
(h_step : ∀ t e, H_seq (t + 1) e ↔ H_seq t e ∨ A_seq t e)
(t1 t2 : Nat) (h_le : t1 ≤ t2) :
HistoricalInclusion (H_seq t1) (H_seq t2) := by
rcases Nat.le.dest h_le with ⟨k, rfl⟩
exact cumulative_history_add_monotonicity H_seq A_seq h_step t1 k

theorem append_includes {N : Nat} (A New : History N) :
HistoricalInclusion A (fun x => A x ∨ New x) := fun _ => Or.inl

theorem support_inclusion {N : Nat} {A B : History N} (h : HistoricalInclusion A B) :
HistoricalInclusion (historySupport A) (historySupport B) :=
fun _ ⟨w, hw, endpoint⟩ => ⟨w, h w hw, endpoint⟩

end QBD.Ch04

#print axioms QBD.Ch04.cumulative_history_step_monotonicity
#print axioms QBD.Ch04.cumulative_history_add_monotonicity
#print axioms QBD.Ch04.cumulative_history_transitive_monotonicity
#print axioms QBD.Ch04.append_includes
#print axioms QBD.Ch04.support_inclusion

Verification Summary:

The machine-checked proofs confirm that cumulative histories grow monotonically across single steps, edge additions, and multi-step trajectories, preserving both occurrence membership and historical support under edge excision. Active spatial edge counts remain outside this cumulative-ledger invariant. The Lean 4 kernel accepts all closed proof terms using only standard axioms, certifying the monotonicity claims of Trajectory Monotonicity under Edge Excision §4.1.4.

In Plain English:
Machine-checked Lean 4 proofs certify the formal claims verified in Section 4.1.4.3.


4.1.5 Lemma: Timestamp Preservation under Kinematic Excision​

Invariance of Historical Edge Timestamps via Canonical Inclusion

Let ιt,s:Et↪Es\iota_{t,s}:\mathcal E_t\hookrightarrow\mathcal E_s be a canonical historical inclusion (Historical Category §4.1.2). Then b(ιt,s(ω))=b(ω)b(\iota_{t,s}(\omega))=b(\omega) and h(ιt,s(ω))=h(ω)h(\iota_{t,s}(\omega))=h(\omega) for every ω∈Et\omega\in\mathcal E_t.

In Plain English:
Section 4.1.5 formalizes the properties of the QBD lemma regarding timestamp preservation under kinematic excision.


4.1.5.1 Proof: Timestamp Preservation under Kinematic Excision​

Verification of Timestamp Monotonicity via Embedding Transitions

I. Coordinate Form of the Inclusion

The proof uses the specified objects and conventions (Historical Category §4.1.2).

Let ω=(u,v,b,h)∈Et\omega=(u,v,b,h)\in\mathcal E_t. The canonical inclusion changes its containing set, not its value:

ιt,s(u,v,b,h)=(u,v,b,h).\iota_{t,s}(u,v,b,h)=(u,v,b,h).

II. Birth and Height Projections

Applying the third and fourth projections separately gives

b(ιt,s(ω))=b(u,v,b,h)=b=b(ω),h(ιt,s(ω))=h(u,v,b,h)=h=h(ω).\begin{aligned} b(\iota_{t,s}(\omega))&=b(u,v,b,h)=b=b(\omega),\\ h(\iota_{t,s}(\omega))&=h(u,v,b,h)=h=h(\omega). \end{aligned}

III. Distinct Re-Creations

For records (u,v,b1,h1)(u,v,b_1,h_1) and (u,v,b2,h2)(u,v,b_2,h_2) with b1≠b2b_1\ne b_2, equality of records would imply equality of their third projections, contradicting b1≠b2b_1\ne b_2. Thus the two births remain distinct even when h1=h2h_1=h_2. Each record retains its own projections (Timestamp Preservation under Kinematic Excision §4.1.5).

Q.E.D.

In Plain English:
Section 4.1.5.1 formalizes the properties of the QBD proof regarding timestamp preservation under kinematic excision.


4.1.5.2 Type-Theoretic Validation via Lean 4 Core​

Lean 4 Encoding of Timestamp Preservation via Immutable Occurrence Records

Type-theoretic certification of the coordinate immutability and ledger retention established in Timestamp Preservation under Kinematic Excision §4.1.5 proceeds via the following verification strategy:

  1. Model: Immutable creation-occurrence records carrying birth ticks and causal heights, edge-deletion tasks, and substrate evolution operators represent historical coordinate preservation.
  2. Certified Claims: The module certifies preservation of historical birth and height coordinates, distinctness of occurrences born at different ticks, height-bound propagation, and ledger retention under both single excision and full substrate evolution in Timestamp Preservation under Kinematic Excision §4.1.5.1.
  3. Scope Boundary: Preservation applies to retained historical records in the creation ledger. Active-snapshot height fields are reset to zero upon edge deletion without erasing the historical record.
import QBD.Ch04.Defs

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03

namespace QBD.Ch04

theorem historical_coordinates_preserved {N : Nat} {A B : History N}
(h : HistoricalInclusion A B) (w : Subtype A) :
(historyInclude h w).val.edge = w.val.edge ∧
(historyInclude h w).val.birth = w.val.birth ∧
(historyInclude h w).val.height = w.val.height := ⟨rfl, rfl, rfl⟩

theorem different_birth_distinct {N : Nat} (w z : CreationOccurrence N)
(distinct : w.birth ≠ z.birth) : w ≠ z := fun eq => distinct (congrArg CreationOccurrence.birth eq)

theorem next_height_bound (parentMax tick : Nat) (h : parentMax ≤ tick) :
parentMax + 1 ≤ tick + 1 := Nat.succ_le_succ h

theorem excision_retains_occurrence {N : Nat} {A New : History N} {w : CreationOccurrence N}
(old : A w) : (fun x => A x ∨ New x) w := Or.inl old

theorem evolution_retains_ledger {N : Nat} (G : CausalGraphSubstrate N)
(A D : Edge (Fin N) → Prop) (w : CreationOccurrence N) (old : w ∈ G.ledger) :
w ∈ (evolveSubstrate G A D).ledger := by
unfold evolveSubstrate
exact List.mem_append_left _ old

end QBD.Ch04

#print axioms QBD.Ch04.historical_coordinates_preserved
#print axioms QBD.Ch04.different_birth_distinct
#print axioms QBD.Ch04.next_height_bound
#print axioms QBD.Ch04.excision_retains_occurrence
#print axioms QBD.Ch04.evolution_retains_ledger

Verification Summary:

The machine-checked proofs confirm that birth ticks and causal heights of recorded creation occurrences remain immutable under kinematic excision and full substrate evolution, and that distinct birth ticks separate recreated occurrences. Active-snapshot deletion zeroes only the live edge field. The Lean 4 kernel accepts all closed proof terms using only standard axioms, certifying the preservation claims of Timestamp Preservation under Kinematic Excision §4.1.5.

In Plain English:
Machine-checked Lean 4 proofs certify the formal claims verified in Section 4.1.5.3.


4.1.6 Lemma: Categorical Domain Decoupling​

Orthogonality of Causal Reachability via Poset Invariance

Let active-path morphisms use GtG_t, cumulative support use G‾t\overline G_t, and occurrence chronology use the dependency closure D+D^+ (Monotonicity of History §1.4.5). Then the historical dependency relation is unchanged by active deletion: active paths can disappear while creation records and their previously recorded dependencies remain.

In Plain English:
Section 4.1.6 formalizes the properties of the QBD lemma regarding categorical domain decoupling.


4.1.6.1 Proof: Categorical Domain Decoupling​

Verification of Categorical Domain Decoupling via Slicing

I. Active Path Membership

For a deletion-only change E′=E∖FE'=E\setminus F, any path using an edge of FF is absent from the new active path set. Every path using only E′E' was already a path in EE, giving

PE′(u,v)⊆PE(u,v).\mathcal P_{E'}(u,v)\subseteq\mathcal P_E(u,v).

II. Retained Historical Objects

The same operation does not remove elements of Et\mathcal E_t (Trajectory Monotonicity under Edge Excision §4.1.4). The coordinate values of each retained record remain equal (Timestamp Preservation under Kinematic Excision §4.1.5). The recorded predecessor relation DD is fixed at creation, so excision from the active graph changes no historical pair (ω,η)∈D(\omega,\eta)\in D.

III. Closure Invariance Under Deletion Alone

A witness for ωD+η\omega D^+\eta consists of retained records and recorded dependency pairs. Neither is removed. Conversely, deletion alone introduces no new records or dependency pairs. Thus the set of such witnesses is unchanged, and the occurrence order is unchanged. This is the claimed domain decoupling (Categorical Domain Decoupling §4.1.6).

Q.E.D.

In Plain English:
Section 4.1.6.1 formalizes the properties of the QBD proof regarding categorical domain decoupling.


4.1.6.2 Type-Theoretic Validation via Lean 4 Core​

Lean 4 Encoding of Categorical Domain Decoupling via Active-to-History Lifting

Type-theoretic certification of the kinematic-versus-historical decoupling established in Categorical Domain Decoupling §4.1.6 proceeds via the following verification strategy:

  1. Model: Valid causal graph substrates, active spatial edge sets, cumulative historical supports, and lifting maps from active edges to historical occurrences represent the separation of kinematic and archival domains.
  2. Certified Claims: The module certifies that every active spatial graph is a subgraph of cumulative historical support, that edge deletion leaves cumulative history invariant, and that active edges lift cleanly into historical occurrences in Categorical Domain Decoupling §4.1.6.1.
  3. Scope Boundary: Decoupling holds for valid substrates whose active edges are backed by ledger records. Dynamical probabilities governing deletions remain outside this structural decoupling check.
import QBD.Ch04.Defs

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03

namespace QBD.Ch04

theorem spatial_subgraph_of_cumulative_history {V : Type}
(E_seq H_seq A_seq D_seq : Nat → (Edge V → Prop))
(h_init : ∀ e, H_seq 0 e ↔ E_seq 0 e)
(h_hist : ∀ t e, H_seq (t + 1) e ↔ H_seq t e ∨ A_seq t e)
(h_dyn : ∀ t e, E_seq (t + 1) e ↔ (E_seq t e ∨ A_seq t e) ∧ ¬ D_seq t e) :
∀ t e, E_seq t e → H_seq t e := by
intro t
induction t with
| zero =>
intro e he
exact (h_init e).mpr he
| succ n ih =>
intro e he
rw [h_dyn n e] at he
rw [h_hist n e]
cases he.1 with
| inl he_prev => exact Or.inl (ih e he_prev)
| inr he_add => exact Or.inr he_add

theorem deletion_preserves_cumulative_history {V : Type}
(E_seq H_seq A_seq D_seq : Nat → (Edge V → Prop))
(h_init : ∀ e, H_seq 0 e ↔ E_seq 0 e)
(h_hist : ∀ t e, H_seq (t + 1) e ↔ H_seq t e ∨ A_seq t e)
(h_dyn : ∀ t e, E_seq (t + 1) e ↔ (E_seq t e ∨ A_seq t e) ∧ ¬ D_seq t e)
(t : Nat) (e : Edge V)
(he_active : E_seq t e)
(he_deleted : D_seq t e) :
¬ E_seq (t + 1) e ∧ H_seq (t + 1) e := by
constructor
· rw [h_dyn t e]
intro ⟨_, h_not_D⟩
exact h_not_D he_deleted
· rw [h_hist t e]
have h_in_H := spatial_subgraph_of_cumulative_history E_seq H_seq A_seq D_seq h_init h_hist h_dyn t e he_active
exact Or.inl h_in_H

theorem lift_active_to_history {N : Nat} (G : CausalGraphSubstrate N) (valid : G.Valid)
(e : CausalRelation G) : historySupport (fun w => w ∈ G.ledger) e.val :=
⟨G.activeOccurrence e, valid.2.2.1 e, rfl⟩

end QBD.Ch04

#print axioms QBD.Ch04.spatial_subgraph_of_cumulative_history
#print axioms QBD.Ch04.deletion_preserves_cumulative_history
#print axioms QBD.Ch04.lift_active_to_history

Verification Summary:

The machine-checked proofs confirm that active spatial connectivity embeds into cumulative historical support, that edge excision leaves the cumulative history untouched, and that active edges lift unambiguously into recorded occurrences. Dynamical transition rates remain outside this categorical-domain module. The Lean 4 kernel accepts all closed proof terms using only standard axioms, certifying the decoupling claims of Categorical Domain Decoupling §4.1.6.

In Plain English:
Machine-checked Lean 4 proofs certify the formal claims verified in Section 4.1.6.3.


4.1.7 Proof: Orthogonality of Kinematic and Historical State​

Synthesis of Monotonicity via Timestamp Invariance and Domain Decoupling

I. Record and Support Monotonicity

Record union gives Et⊆Et+1\mathcal E_t\subseteq\mathcal E_{t+1}, and projection gives E‾t⊆E‾t+1\overline E_t\subseteq\overline E_{t+1} (Trajectory Monotonicity under Edge Excision §4.1.4). A deleted active pair still has a retained creation occurrence.

II. Preserved Labels

For every retained record, canonical inclusion is the identity on its four coordinates. Hence

b(ι(ω))=b(ω),h(ι(ω))=h(ω)b(\iota(\omega))=b(\omega),\qquad h(\iota(\omega))=h(\omega)

(Timestamp Preservation under Kinematic Excision §4.1.5).

III. Separate Path Domains

Active deletion can remove spatial paths while leaving both the historical records and their recorded dependencies intact (Categorical Domain Decoupling §4.1.6). These are exactly the record-preservation and support-inclusion conclusions (Orthogonality of Kinematic and Historical State §4.1.3).

Q.E.D.

In Plain English:
Section 4.1.7 formalizes the properties of the QBD proof regarding orthogonality of kinematic and historical state.


4.1.7.1 Type-Theoretic Validation via Lean 4 Core​

Lean 4 Encoding of Orthogonality of Kinematic and Historical State via Modular Ledger Assembly

Type-theoretic certification of the orthogonality between active kinematics and cumulative history established in Orthogonality of Kinematic and Historical State §4.1.3 proceeds via the following verification strategy:

  1. Model: The assembly module imports the certified trajectory-monotonicity, timestamp-preservation, and domain-decoupling modules into a unified substrate theorem.
  2. Certified Claims: The module assembles cumulative monotonicity, immutable occurrence coordinate preservation, active-to-history support embedding, and deletion invariance of the historical ledger in Orthogonality of Kinematic and Historical State §4.1.7.
  3. Scope Boundary: Orthogonality is certified for valid discrete substrates under append-only ledger transitions. Probabilistic transition weights remain outside this structural assembly.
import QBD.Ch04.L4_1_4_TrajectoryMonotonicity
import QBD.Ch04.L4_1_5_TimestampPreservation
import QBD.Ch04.L4_1_6_CategoricalDomainDecoupling

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03

namespace QBD.Ch04

theorem orthogonality_of_state {N : Nat} (G : CausalGraphSubstrate N) (valid : G.Valid)
(New : History N) :
let A : History N := fun w => w ∈ G.ledger
HistoricalInclusion A (fun w => A w ∨ New w) ∧
(∀ e : CausalRelation G, historySupport A e.val) ∧
(∀ w : Subtype A, (historyInclude (append_includes A New) w).val.height = w.val.height) :=
⟨append_includes _ _, lift_active_to_history G valid,
fun w => (historical_coordinates_preserved (append_includes _ _) w).2.2⟩

end QBD.Ch04

#print axioms QBD.Ch04.orthogonality_of_state

Verification Summary:

The machine-checked proof assembles trajectory monotonicity, immutable timestamp preservation, and categorical domain decoupling into a single closed theorem separating reversible active kinematics from append-only historical accumulation. Dynamical weighting remains outside this kinematic assembly. The Lean 4 kernel accepts the closed proof term using only standard axioms, certifying the logical synthesis of Orthogonality of Kinematic and Historical State §4.1.7.

In Plain English:
Section 4.1.7.1 formalizes the properties of the QBD type-theoretic regarding validation via lean 4 core.


4.2.1 Theorem: Categorical Validity​

Formal Consistency of the Categorical Frameworks for Global via Internal Structures

Consider the structures Caust\mathbf{Caus}_t and Hist\mathbf{Hist} representing the internal causal path structure and the global historical embedding structure, respectively. Then the following holds: both structures constitute valid mathematical categories satisfying the axioms of Associativity of composition and the existence of neutral Identity elements. Moreover, these frameworks provide the consistent syntactic domain for the dynamical operations of the Universal Constructor.

In Plain English:
Section 4.2.1 formalizes the properties of the QBD theorem regarding categorical validity.


4.2.2 Lemma: Identity for Caust\mathbf{Caus}_t​

Neutrality of Trivial Paths in the Internal Causal Category

Let p:u→vp: u \to v be a morphism in Caust\mathbf{Caus}_t. Then the composition with the Trivial Path in the Internal Causal Category §4.1.1 satisfies the identity laws p∘idu=pp \circ \text{id}_u = p and idv∘p=p\text{id}_v \circ p = p, where the concatenation of a sequence with a zero-length sequence yields the original sequence invariant.

In Plain English:
Section 4.2.2 formalizes the properties of the QBD lemma regarding identity for caust\mathbf{caus}_t.


4.2.2.1 Proof: Identity for Caust\mathbf{Caus}_t​

Verification of Neutrality under Composition for Trivial Paths

I. Anchored Edge Lists

In the path category, a morphism p:u→vp:u\to v is represented by its endpoints and finite edge list

p=(u,(e1,…,ek),v),k≥0p=(u,(e_1,\ldots,e_k),v),\qquad k\ge0

(Internal Causal Category §4.1.1). Its identity at xx is the anchored empty list

1x=(x,(),x),ℓ(1x)=0.1_x=(x,(),x),\qquad\ell(1_x)=0.

If k=0k=0, the path is trivial and u=vu=v; its anchor still specifies its object.

II. Identity After a Path

The composite 1v∘p1_v\circ p is defined, because the target of pp is the source of 1v1_v. Its endpoints are (u,v)(u,v) and its length is k+0=kk+0=k. At each position 1≤j≤k1\le j\le k its edge is

(Sp+ ⁣+())j=(Sp)j=ej,(S_p\mathbin{+\!+}())_j=(S_p)_j=e_j,

where + ⁣++\!+ denotes concatenation. There are no positions contributed by the empty list. Thus

1v∘p=(u,(e1,…,ek),v)=p.1_v\circ p=(u,(e_1,\ldots,e_k),v)=p.

III. Identity Before a Path

The composite p∘1up\circ1_u is defined for the same endpoint reason. It has length 0+k=k0+k=k, and for every 1≤j≤k1\le j\le k,

(()+ ⁣+Sp)j=(Sp)j−0=ej.(()\mathbin{+\!+}S_p)_j=(S_p)_{j-0}=e_j.

The endpoints remain (u,v)(u,v), so

p∘1u=(u,(e1,…,ek),v)=p.p\circ1_u=(u,(e_1,\ldots,e_k),v)=p.

When k=0k=0, both products are the same anchored empty list, so the two calculations also include the trivial-path case. The required identity laws are therefore (Identity for Caust\mathbf{Caus}_t §4.2.2)

1v∘p=p=p∘1u.\boxed{1_v\circ p=p=p\circ1_u.}

Q.E.D.

In Plain English:
Section 4.2.2.1 formalizes the properties of the QBD proof regarding identity for caust\mathbf{caus}_t.


4.2.2.2 Type-Theoretic Validation via Lean 4 Core​

Lean 4 Encoding of Identity for the Internal Causal Category via Trivial Path Composition

Type-theoretic certification of the left and right identity laws established in Identity for Caust\mathbf{Caus}_t §4.2.2 proceeds via the following verification strategy:

  1. Model: Typed directed edge-list morphisms on a timestamped graph, empty trivial paths, and path concatenation represent identity morphisms in the internal causal category.
  2. Certified Claims: The module certifies both left and right identity laws for trivial-path composition in Identity for Caust\mathbf{Caus}_t §4.2.2.1.
  3. Scope Boundary: Identity holds for typed directed edge-list morphisms on any fixed snapshot. Mediated effective-influence restrictions are checked separately.
import QBD.Ch04.Defs

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03

namespace QBD.Ch04

theorem caus_identity {V : Type} {G : RelTimestampedGraph V} {a b : V} (p : CausHom G a b) :
causComp (causId G a) p = p ∧ causComp p (causId G b) = p :=
⟨Subtype.ext rfl, Subtype.ext (List.append_nil _)⟩

end QBD.Ch04

#print axioms QBD.Ch04.caus_identity

Verification Summary:

The machine-checked proof confirms that composing any directed path morphism on the left or right with the trivial zero-length path leaves the morphism unchanged. Mediated path restrictions belong to separate eligibility checks. The Lean 4 kernel accepts the closed proof term using only standard axioms, certifying the identity laws of Identity for Caust\mathbf{Caus}_t §4.2.2.

In Plain English:
Machine-checked Lean 4 proofs certify the formal claims verified in Section 4.2.2.3.


4.2.3 Lemma: Associativity for Caust\mathbf{Caus}_t​

Associativity of Path Concatenation in the Internal Causal Category

For all composable morphisms p,q,rp, q, r in Caust\mathbf{Caus}_t, the following holds:

(r∘q)∘p=r∘(q∘p)(r \circ q) \circ p = r \circ (q \circ p)

Moreover, the linear order of edges in the resulting path is invariant regardless of the grouping of concatenation operations.

In Plain English:
Section 4.2.3 formalizes the properties of the QBD lemma regarding associativity for caust\mathbf{caus}_t.


4.2.3.1 Proof: Associativity for Caust\mathbf{Caus}_t​

Verification of Associativity under Composition for Path Concatenation

I. Composable Typed Lists

Let p:u→vp:u\to v, q:v→wq:v\to w and r:w→xr:w\to x have edge lists P,Q,RP,Q,R of lengths k,m,nk,m,n (Internal Causal Category §4.1.1). Every adjacent edge in each list has matching endpoints. The two joining vertices are vv and ww, so both ways of concatenating these lists are valid directed paths from uu to xx.

II. First Grouping

Composing rr after qq yields the list Q+ ⁣+RQ+\!+R. Composing the result after pp yields

S(r∘q)∘p=P+ ⁣+(Q+ ⁣+R),ℓ((r∘q)∘p)=k+(m+n).S_{(r\circ q)\circ p}=P+\!+(Q+\!+R),\qquad \ell((r\circ q)\circ p)=k+(m+n).

Its jj-th edge is

{Pj,1≤j≤k,Qj−k,k<j≤k+m,Rj−k−m,k+m<j≤k+m+n.\begin{cases} P_j,&1\le j\le k,\\ Q_{j-k},&k

III. Second Grouping

Composing qq after pp yields P+ ⁣+QP+\!+Q. Composing rr after this result gives

Sr∘(q∘p)=(P+ ⁣+Q)+ ⁣+R,ℓ(r∘(q∘p))=(k+m)+n.S_{r\circ(q\circ p)}=(P+\!+Q)+\!+R,\qquad \ell(r\circ(q\circ p))=(k+m)+n.

For j≤k+mj\le k+m, the edge lies in P+ ⁣+QP+\!+Q: it is PjP_j when j≤kj\le k, and Qj−kQ_{j-k} otherwise. For j>k+mj>k+m, it is Rj−(k+m)=Rj−k−mR_{j-(k+m)}=R_{j-k-m}. Thus the second list has exactly the same three cases as the first.

IV. Equality of Morphisms

Natural-number addition gives k+(m+n)=(k+m)+nk+(m+n)=(k+m)+n. The lists have the same length and the same edge at every position, and both have source uu and target xx. They therefore represent equal morphisms. An empty list makes its corresponding interval of positions empty, so the calculation includes zero lengths. Hence (Associativity for Caust\mathbf{Caus}_t §4.2.3)

(r∘q)∘p=r∘(q∘p).\boxed{(r\circ q)\circ p=r\circ(q\circ p).}

Q.E.D.

In Plain English:
Section 4.2.3.1 formalizes the properties of the QBD proof regarding associativity for caust\mathbf{caus}_t.


4.2.3.2 Type-Theoretic Validation via Lean 4 Core​

Lean 4 Encoding of Associativity for the Internal Causal Category via Path Concatenation

Type-theoretic certification of the associativity of morphism composition established in Associativity for Caust\mathbf{Caus}_t §4.2.3 proceeds via the following verification strategy:

  1. Model: Composable triples of typed directed edge-list morphisms on a fixed timestamped graph represent sequential causal composition.
  2. Certified Claims: The module certifies strict associativity of path concatenation across composable triples in Associativity for Caust\mathbf{Caus}_t §4.2.3.1.
  3. Scope Boundary: Associativity applies to typed edge-list composition within a fixed snapshot. Cross-tick historical evolution is governed by the historical category.
import QBD.Ch04.Defs

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03

namespace QBD.Ch04

theorem caus_associativity {V : Type} {G : RelTimestampedGraph V} {a b c d : V}
(p : CausHom G a b) (q : CausHom G b c) (r : CausHom G c d) :
causComp (causComp p q) r = causComp p (causComp q r) :=
Subtype.ext (List.append_assoc _ _ _)

end QBD.Ch04

#print axioms QBD.Ch04.caus_associativity

Verification Summary:

The machine-checked proof establishes that concatenating three composable directed path morphisms is strictly associative, completing the core composition law for the internal causal category. Cross-snapshot dynamics remain outside this static category check. The Lean 4 kernel accepts the closed proof term using only standard axioms, certifying the associativity law of Associativity for Caust\mathbf{Caus}_t §4.2.3.

In Plain English:
Machine-checked Lean 4 proofs certify the formal claims verified in Section 4.2.3.3.


4.2.4 Lemma: Timestamp Monotonicity​

Preservation via Timestamp Monotonicity

Let f:Et↪Esf:\mathcal E_t\hookrightarrow\mathcal E_s and g:Es↪Eqg:\mathcal E_s\hookrightarrow\mathcal E_q be canonical historical inclusions. Then their composite preserves the birth tick and causal height of every source occurrence (Historical Category §4.1.2).

In Plain English:
Section 4.2.4 formalizes the properties of the QBD lemma regarding timestamp monotonicity.


4.2.4.1 Proof: Timestamp Monotonicity​

Verification of Temporal Order Preservation through Morphism Composition

I. Individual Preservation

For every ω∈Et\omega\in\mathcal E_t, b(f(ω))=b(ω)b(f(\omega))=b(\omega) and h(f(ω))=h(ω)h(f(\omega))=h(\omega). For every η∈Es\eta\in\mathcal E_s, the corresponding identities hold for gg (Timestamp Preservation under Kinematic Excision §4.1.5).

II. Composite Evaluation

Substituting η=f(ω)\eta=f(\omega) gives

b((g∘f)(ω))=b(g(f(ω)))=b(f(ω))=b(ω),h((g∘f)(ω))=h(g(f(ω)))=h(f(ω))=h(ω).\begin{aligned} b((g\circ f)(\omega))&=b(g(f(\omega)))=b(f(\omega))=b(\omega),\\ h((g\circ f)(\omega))&=h(g(f(\omega)))=h(f(\omega))=h(\omega). \end{aligned}

III. Conclusion

Both coordinate equalities hold for every source occurrence, so the composite preserves the historical labels (Timestamp Monotonicity §4.2.4).

Q.E.D.

In Plain English:
Section 4.2.4.1 formalizes the properties of the QBD proof regarding timestamp monotonicity.


4.2.4.2 Type-Theoretic Validation via Lean 4 Core​

Lean 4 Encoding of Timestamp Monotonicity via Parent Height Dominance and Transitivity

Type-theoretic certification of the strict height dominance and monotone-path transitivity established in Timestamp Monotonicity §4.2.4 proceeds via the following verification strategy:

  1. Model: Timestamped graphs, source-side creation heights, and strictly height-increasing directed edge paths represent chronological timestamp monotonicity.
  2. Certified Claims: The module certifies that newly created edges strictly dominate every active incoming parent height and that strict edge-path monotonicity is transitive along directed paths in Timestamp Monotonicity §4.2.4.1.
  3. Scope Boundary: Monotonicity applies to creation-ordered incoming dependencies and strictly height-increasing walks. Arbitrary non-monotone spatial walks remain outside this order check.
import QBD.Ch04.Defs
import QBD.Ch02.L2_7_7_LoopErasureOfReverseWitnesses

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03

namespace QBD.Ch04

theorem new_edge_strictly_dominates_parent {N : Nat} (G : TimestampedGraph (Fin N))
{x u : Fin N} (incoming : G.edges (x, u)) : G.H (x, u) < newCreationHeight G u := by
have bound := (G.incomingMaximum_spec u).1 x incoming
simpa only [newCreationHeight, Nat.add_comm 1] using Nat.lt_succ_of_le bound

theorem edge_path_monotonicity_transitive {V : Type} (H : Edge V → Nat)
(first last : Edge V) (rest : List (Edge V))
(increasing : IsAdjacentHeightIncreasing H (first :: rest ++ [last])) :
H first < H last := by
rw [← edge_monotone_iff_adjacent] at increasing
exact (List.pairwise_cons.mp increasing).1 last (List.mem_append_right _ (by simp))

end QBD.Ch04

#print axioms QBD.Ch04.new_edge_strictly_dominates_parent
#print axioms QBD.Ch04.edge_path_monotonicity_transitive

Verification Summary:

The machine-checked proofs establish that every newly created edge strictly exceeds the causal height of its active incoming parents and that strict height monotonicity propagates transitively along directed paths. Non-monotone spatial walks remain outside this chronological check. The Lean 4 kernel accepts all closed proof terms using only standard axioms, certifying the monotonicity claims of Timestamp Monotonicity §4.2.4.

In Plain English:
Machine-checked Lean 4 proofs certify the formal claims verified in Section 4.2.4.3.


4.2.5 Lemma: Identity for Hist\mathbf{Hist}​

Neutrality of Identity Functions in the Historical Category

For any historical object E\mathcal E, let 1E(ω)=ω1_{\mathcal E}(\omega)=\omega on its creation records. Then 1E1_{\mathcal E} is a canonical historical inclusion, and f∘1E=f=1F∘ff\circ1_{\mathcal E}=f=1_{\mathcal F}\circ f for every inclusion f:E↪Ff:\mathcal E\hookrightarrow\mathcal F (Historical Category §4.1.2).

In Plain English:
Section 4.2.5 formalizes the properties of the QBD lemma regarding identity for hist\mathbf{hist}.


4.2.5.1 Proof: Identity for Hist\mathbf{Hist}​

Verification of Structure Preservation and Neutrality for Identity Functions

I. Identity Inclusion

The historical object is a set of immutable creation records (Historical Category §4.1.2). Reflexivity of subset inclusion gives E⊆E\mathcal E\subseteq\mathcal E. Its canonical map sends each record to itself:

1E(ω)=ω,b(1E(ω))=b(ω),h(1E(ω))=h(ω).1_{\mathcal E}(\omega)=\omega,\qquad b(1_{\mathcal E}(\omega))=b(\omega),\qquad h(1_{\mathcal E}(\omega))=h(\omega).

The source and target coordinates are unchanged as well.

II. Precomposition

For f:E↪Ff:\mathcal E\hookrightarrow\mathcal F and every ω∈E\omega\in\mathcal E,

(f∘1E)(ω)=f(1E(ω))=f(ω).(f\circ1_{\mathcal E})(\omega)=f(1_{\mathcal E}(\omega))=f(\omega).

Pointwise equality gives f∘1E=ff\circ1_{\mathcal E}=f.

III. Postcomposition

Likewise, because f(ω)∈Ff(\omega)\in\mathcal F,

(1F∘f)(ω)=1F(f(ω))=f(ω).(1_{\mathcal F}\circ f)(\omega)=1_{\mathcal F}(f(\omega))=f(\omega).

Therefore 1F∘f=f=f∘1E.\boxed{1_{\mathcal F}\circ f=f=f\circ1_{\mathcal E}.} These are the required identity laws (Identity for Hist\mathbf{Hist} §4.2.5).

Q.E.D.

In Plain English:
Section 4.2.5.1 formalizes the properties of the QBD proof regarding identity for hist\mathbf{hist}.


4.2.5.2 Type-Theoretic Validation via Lean 4 Core​

Lean 4 Encoding of Identity for the Historical Category via Reflexive Inclusion

Type-theoretic certification of the identity morphisms established in Identity for Hist\mathbf{Hist} §4.2.5 proceeds via the following verification strategy:

  1. Model: Historical occurrence predicates, reflexive inclusion proofs, and induced subtype inclusion maps represent identity morphisms in the historical category.
  2. Certified Claims: The module certifies reflexivity of historical inclusion and left-right identity laws for historical inclusion composition in Identity for Hist\mathbf{Hist} §4.2.5.1.
  3. Scope Boundary: The certificate checks thin-category identity laws on occurrence predicates. Concrete ledger transition rules are verified in the trajectory-monotonicity module.
import QBD.Ch04.Defs

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03

namespace QBD.Ch04

theorem historical_inclusion_id {α : Type} (A : α → Prop) : HistoricalInclusion A A := fun _ h => h

theorem historical_identity {α : Type} {A B : α → Prop} (h : HistoricalInclusion A B)
(x : Subtype A) :
historyInclude (historical_inclusion_id B) (historyInclude h x) = historyInclude h x ∧
historyInclude h (historyInclude (historical_inclusion_id A) x) = historyInclude h x :=
⟨rfl, rfl⟩

end QBD.Ch04

#print axioms QBD.Ch04.historical_inclusion_id
#print axioms QBD.Ch04.historical_identity

Verification Summary:

The machine-checked proofs confirm that reflexive historical inclusion acts as both left and right identity for composition of inclusion maps in the historical category. Dynamical ledger generation remains outside this categorical axiom check. The Lean 4 kernel accepts all closed proof terms using only standard axioms, certifying the identity laws of Identity for Hist\mathbf{Hist} §4.2.5.

In Plain English:
Machine-checked Lean 4 proofs certify the formal claims verified in Section 4.2.5.3.


4.2.6 Lemma: Associativity for Hist\mathbf{Hist}​

Associativity of Function Composition in the Historical Category

Let f:A→Bf: A \to B, g:B→Cg: B \to C, and h:C→Dh: C \to D be morphisms in Hist\mathbf{Hist}. Then the relation (h∘g)∘f=h∘(g∘f)(h \circ g) \circ f = h \circ (g \circ f) holds.

In Plain English:
Section 4.2.6 formalizes the properties of the QBD lemma regarding associativity for hist\mathbf{hist}.


4.2.6.1 Proof: Associativity for Hist\mathbf{Hist}​

Verification of Associativity under Composition for Function Composition

I. Closure of Inclusions

Let f:E↪Ff:\mathcal E\hookrightarrow\mathcal F and g:F↪Gg:\mathcal F\hookrightarrow\mathcal G be canonical record inclusions (Historical Category §4.1.2). For ω∈E\omega\in\mathcal E, the two memberships give ω∈F\omega\in\mathcal F and then ω∈G\omega\in\mathcal G. Thus E⊆G\mathcal E\subseteq\mathcal G and (g∘f)(ω)=ω(g\circ f)(\omega)=\omega. Every record coordinate is preserved.

II. Threefold Evaluation

For a third inclusion h:G↪Jh:\mathcal G\hookrightarrow\mathcal J, compute on every source record:

((h∘g)∘f)(ω)=(h∘g)(f(ω))=h(g(f(ω))),(h∘(g∘f))(ω)=h((g∘f)(ω))=h(g(f(ω))).\begin{aligned} ((h\circ g)\circ f)(\omega)&=(h\circ g)(f(\omega))=h(g(f(\omega))),\\ (h\circ(g\circ f))(\omega)&=h((g\circ f)(\omega))=h(g(f(\omega))). \end{aligned}

Both maps have source E\mathcal E and target J\mathcal J.

III. Morphism Equality

The displayed values agree for every source record. Extensionality gives

(h∘g)∘f=h∘(g∘f).\boxed{(h\circ g)\circ f=h\circ(g\circ f).}

This is the associative law (Associativity for Hist\mathbf{Hist} §4.2.6). The identity maps are the canonical self-inclusions (Identity for Hist\mathbf{Hist} §4.2.5).

Q.E.D.

In Plain English:
Section 4.2.6.1 formalizes the properties of the QBD proof regarding associativity for hist\mathbf{hist}.


4.2.6.2 Type-Theoretic Validation via Lean 4 Core​

Lean 4 Encoding of Associativity for the Historical Category via Transitive Inclusion

Type-theoretic certification of the associativity of historical inclusions established in Associativity for Hist\mathbf{Hist} §4.2.6 proceeds via the following verification strategy:

  1. Model: Nested chains of historical occurrence predicates and induced subtype inclusion maps represent multi-step historical composition.
  2. Certified Claims: The module certifies transitivity of historical inclusion and strict associativity of composed inclusion maps in Associativity for Hist\mathbf{Hist} §4.2.6.1.
  3. Scope Boundary: Associativity applies to inclusion morphisms in the thin historical category. Non-monotone active spatial transitions lie outside this archival category.
import QBD.Ch04.Defs

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03

namespace QBD.Ch04

theorem historical_inclusion_trans {α : Type} {A B C : α → Prop}
(h : HistoricalInclusion A B) (k : HistoricalInclusion B C) : HistoricalInclusion A C :=
fun a ha => k a (h a ha)

theorem historical_associativity {α : Type} {A B C D : α → Prop}
(h : HistoricalInclusion A B) (k : HistoricalInclusion B C) (l : HistoricalInclusion C D)
(x : Subtype A) :
historyInclude (historical_inclusion_trans (historical_inclusion_trans h k) l) x =
historyInclude (historical_inclusion_trans h (historical_inclusion_trans k l)) x := rfl

end QBD.Ch04

#print axioms QBD.Ch04.historical_inclusion_trans
#print axioms QBD.Ch04.historical_associativity

Verification Summary:

The machine-checked proofs establish transitivity of historical inclusion and strict associativity of composed inclusion morphisms across historical stages. Active spatial deletions remain outside this archival category check. The Lean 4 kernel accepts all closed proof terms using only standard axioms, certifying the associativity laws of Associativity for Hist\mathbf{Hist} §4.2.6.

In Plain English:
Machine-checked Lean 4 proofs certify the formal claims verified in Section 4.2.6.3.


4.2.7 Lemma: Topological Injectivity​

Necessity of Injectivity via Irreflexivity

Let f:Ht→Ht+1f: \mathcal{H}_t \to \mathcal{H}_{t+1} be a structure-preserving map valid in Hist\mathbf{Hist}. Then ff is injective on connected vertices, the identification of adjacent vertices yields a Self-Loop, which the Directed Causal Link §2.1.1 excludes.

In Plain English:
Section 4.2.7 formalizes the properties of the QBD lemma regarding topological injectivity.


4.2.7.1 Proof: Topological Injectivity​

Instability of Non-Injective Morphisms via Induced Reflexivity

I. The Specified Morphism Class

Let f:Ht→Ht+1f:\mathcal H_t\to\mathcal H_{t+1} be valid in the historical category. Its definition makes it a canonical inclusion on the underlying vertices and edges (Historical Category §4.1.2):

fV:V(Ht)↪V(Ht+1),fV(x)=x,fE(e)=e.f_V:V(\mathcal H_t)\hookrightarrow V(\mathcal H_{t+1}),\qquad f_V(x)=x,\qquad f_E(e)=e.

These functions have the smaller historical record as domain and the larger record as codomain.

II. Injectivity on All Vertices

For u,v∈V(Ht)u,v\in V(\mathcal H_t),

fV(u)=fV(v) ⟹ u=v,f_V(u)=f_V(v)\ \Longrightarrow\ u=v,

by substituting the two inclusion values. Conversely u=vu=v implies equality of their images. Thus the equality test is preserved in both directions:

fV(u)=fV(v)⟺u=v.f_V(u)=f_V(v)\quad\Longleftrightarrow\quad u=v.

In particular, restriction to a connected component remains injective. The same calculation on edge identifiers gives fE(e)=fE(e′)⇒e=e′f_E(e)=f_E(e')\Rightarrow e=e'.

III. Adjacent-Vertex Collapse Under a Graph Map

The stated self-loop obstruction can also be evaluated independently. For an adjacency-preserving map gg and edge (u,v)∈E(u,v)\in E, its image edge is

gE(u,v)=(gV(u),gV(v)).g_E(u,v)=(g_V(u),g_V(v)).

If gV(u)=gV(v)=wg_V(u)=g_V(v)=w, edge preservation forces (w,w)(w,w) to be an edge of the target. A target satisfying the causal primitive requires (w,w)∉E′(w,w)\notin E' (Directed Causal Link §2.1.1), a contradiction. Therefore such a map cannot identify the endpoints of an edge into an irreflexive target.

IV. Historical Conclusion

For the specified historical morphisms, the stronger global injectivity already follows from the canonical-inclusion formula of Section I. Its connected-vertex consequence is exactly the claim (Topological Injectivity §4.2.7):

fV(u)=fV(v)⇒u=v,(u,v)∈E⇒fV(u)≠fV(v).\boxed{f_V(u)=f_V(v)\Rightarrow u=v,\qquad (u,v)\in E\Rightarrow f_V(u)\ne f_V(v).}

Q.E.D.

In Plain English:
Section 4.2.7.1 formalizes the properties of the QBD proof regarding topological injectivity.


4.2.7.2 Type-Theoretic Validation via Lean 4 Core​

Lean 4 Encoding of Topological Injectivity via Subtype Inclusion and Cycle Exclusion

Type-theoretic certification of the injectivity and chronological cycle exclusion established in Topological Injectivity §4.2.7 proceeds via the following verification strategy:

  1. Model: Historical subtype inclusion maps, distinct adjacent occurrence pairs, and strict-height chronological dependency chains represent archival injectivity.
  2. Certified Claims: The module certifies that every historical inclusion map is injective, preserves distinctness of adjacent endpoints, and excludes chronological cycles under strict causal heights in Topological Injectivity §4.2.7.1.
  3. Scope Boundary: Injectivity holds for inclusion morphisms of immutable creation occurrences. Spatial graph homomorphisms that identify vertices remain outside this archival inclusion check.
import QBD.Ch04.L4_2_4_TimestampMonotonicity

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03

namespace QBD.Ch04

theorem historical_inclusion_injective {α : Type} {A B : α → Prop}
(h : HistoricalInclusion A B) {x y : Subtype A} (eq : historyInclude h x = historyInclude h y) :
x = y := Subtype.ext (congrArg (fun z : Subtype B => z.val) eq)

theorem adjacent_images_distinct {V W : Type} {E : V → V → Prop} {F : W → W → Prop}
(f : V → W) (preserves : ∀ a b, E a b → F (f a) (f b))
(loopFree : ∀ a, ¬ F a a) {a b : V} (e : E a b) : f a ≠ f b := by
intro eq
exact loopFree (f b) (eq ▸ preserves a b e)

theorem chronological_cycle_excluded {V : Type} (H : Edge V → Nat)
(first last : Edge V) (rest : List (Edge V))
(increasing : IsAdjacentHeightIncreasing H (first :: rest ++ [last]))
(closing : H last < H first) : False :=
Nat.lt_asymm (edge_path_monotonicity_transitive H first last rest increasing) closing

end QBD.Ch04

#print axioms QBD.Ch04.historical_inclusion_injective
#print axioms QBD.Ch04.adjacent_images_distinct
#print axioms QBD.Ch04.chronological_cycle_excluded

Verification Summary:

The machine-checked proofs confirm that historical inclusion maps are injective, preserve distinctness of adjacent occurrences, and exclude chronological cycles under strict causal heights. Non-injective spatial coarse-grainings remain outside this archival module. The Lean 4 kernel accepts all closed proof terms using only standard axioms, certifying the injectivity claims of Topological Injectivity §4.2.7.

In Plain English:
Machine-checked Lean 4 proofs certify the formal claims verified in Section 4.2.7.3.


4.2.8 Lemma: Effective Influence Encoding​

Categorical encoding of the effective influence relation via Effective Influence Encoding

Let a nonidentity active path morphism be eligible precisely when its vertex sequence is simple, its length is at least two, and its consecutive edge heights strictly increase. Then an eligible morphism from uu to vv exists if and only if u R vu\,R\,v for mediated Effective Influence (Effective Influence §2.6.2).

In Plain English:
Section 4.2.8 formalizes the properties of the QBD lemma regarding effective influence encoding.


4.2.8.1 Proof: Effective Influence Encoding​

Verification through Encoding Correspondence

I. The Eligible Morphism Set

The proof uses the specified objects and conventions (Effective Influence §2.6.2).

Let Hom⁡eff(u,v)\operatorname{Hom}^{\mathrm{eff}}(u,v) be the subset of active path morphisms whose vertex sequence p=(v0,…,vk)p=(v_0,\ldots,v_k) satisfies

v0=u,vk=v,k≥2,vi≠vj (i<j),H(vi−1,vi)<H(vi,vi+1) (1≤i<k).v_0=u,\quad v_k=v,\quad k\ge2,\quad v_i\ne v_j\ (i<j),\quad H(v_{i-1},v_i)<H(v_i,v_{i+1})\ (1\le i<k).

II. Forward Implication

If p∈Hom⁡eff(u,v)p\in\operatorname{Hom}^{\mathrm{eff}}(u,v), the same sequence supplies the simple-path, mediation and height witnesses in the definition of u R vu\,R\,v. Thus nonemptiness implies influence.

III. Reverse Implication

If u R vu\,R\,v, its witnessing simple directed path is an active path morphism. Its length and height tests are the defining membership conditions above. Hence the witness belongs to Hom⁡eff(u,v)\operatorname{Hom}^{\mathrm{eff}}(u,v).

IV. Conclusion

Hom⁡eff(u,v)≠∅⟺u R v\operatorname{Hom}^{\mathrm{eff}}(u,v)\ne\varnothing\Longleftrightarrow u\,R\,v

(Effective Influence Encoding §4.2.8).

Q.E.D.

In Plain English:
Section 4.2.8.1 formalizes the properties of the QBD proof regarding effective influence encoding.


4.2.8.2 Type-Theoretic Validation via Lean 4 Core​

Lean 4 Encoding of Effective Influence Encoding via Mediated Morphism Equivalence

Type-theoretic certification of the categorical encoding of effective influence established in Effective Influence Encoding §4.2.8 proceeds via the following verification strategy:

  1. Model: Eligible mediated morphisms inside the internal causal category and the mediated effective-influence relation represent the categorical-to-relational correspondence.
  2. Certified Claims: The module certifies exact logical equivalence between nonemptiness of the eligible morphism set and mediated effective influence between two vertices in Effective Influence Encoding §4.2.8.1.
  3. Scope Boundary: The equivalence characterizes single mediated witnesses on a fixed snapshot. Global acyclicity of the transitive closure requires the third axiom.
import QBD.Ch04.Defs

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03

namespace QBD.Ch04

theorem effective_influence_encoding {V : Type} (G : RelTimestampedGraph V) (a b : V) :
Nonempty (EffectiveHom G a b) ↔ Mediated G a b :=
⟨fun ⟨p⟩ => ⟨p.val.val, p.property⟩, fun ⟨p, h⟩ => ⟨⟨⟨p, h.2.1⟩, h⟩⟩⟩

end QBD.Ch04

#print axioms QBD.Ch04.effective_influence_encoding

Verification Summary:

The machine-checked proof establishes that an eligible morphism exists between two vertices precisely when mediated effective influence holds between them, faithfully encoding causal influence inside the internal category. Global closure acyclicity is verified in the subsequent partial-order module. The Lean 4 kernel accepts the closed proof term using only standard axioms, certifying the encoding claim of Effective Influence Encoding §4.2.8.

In Plain English:
Machine-checked Lean 4 proofs certify the formal claims verified in Section 4.2.8.3.


4.2.9 Lemma: Partial Order Property​

Strict Partial Order Structure of Effective Influence through the Internal Causal Category

Let RR be the filtered influence relation and assume its nonempty transitive closure R+R^+ is irreflexive (Axiom 3 Acyclic Effective Causality §2.7.1). Then R+R^+ is a strict partial order on the spatial vertices.

In Plain English:
Section 4.2.9 formalizes the properties of the QBD lemma regarding partial order property.


4.2.9.1 Proof: Partial Order Property​

Cycle-Exclusion Verification of Strict Partial Order through Partial Order Property

I. Closure Witnesses

The proof uses the specified objects and conventions (Effective Influence §2.6.2).

A witness for uR+vuR^+v is a finite RR-chain of positive length. If uR+vuR^+v and vR+wvR^+w, concatenate the two witness chains at their common endpoint. Its number of steps is the sum of two positive integers, hence positive. Every step still belongs to RR, so uR+wuR^+w.

II. Irreflexivity

The stated causal axiom supplies ¬(uR+u)\neg(uR^+u) for every uu. This is an explicit hypothesis on the closure, not a conclusion from arbitrary spatial-path concatenation.

III. Asymmetry

If both uR+vuR^+v and vR+uvR^+u, the concatenation from Section I gives uR+uuR^+u, contradicting Section II. Therefore

uR+v⟹¬(vR+u).uR^+v\Longrightarrow\neg(vR^+u).

Transitivity and irreflexivity establish the strict partial order (Partial Order Property §4.2.9).

Q.E.D.

In Plain English:
Section 4.2.9.1 formalizes the properties of the QBD proof regarding partial order property.


4.2.9.2 Type-Theoretic Validation via Lean 4 Core​

Lean 4 Encoding of Partial Order Property via Mediated Closure Strictness

Type-theoretic certification of the strict partial order induced by effective influence established in Partial Order Property §4.2.9 proceeds via the following verification strategy:

  1. Model: Timestamped graphs satisfying acyclic effective causality and the nonempty transitive closure of eligible mediated morphisms represent the induced causal partial order.
  2. Certified Claims: The module certifies irreflexivity, asymmetry, and transitivity of the nonempty mediated closure under acyclic effective causality in Partial Order Property §4.2.9.1.
  3. Scope Boundary: The strict partial order applies to the nonempty transitive closure of mediated influence under the third axiom. Unmediated single edges do not by themselves form a transitive order.
import QBD.Ch04.Defs

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03

namespace QBD.Ch04

theorem influence_strict_partial_order {V : Type} (G : RelTimestampedGraph V)
(acyclic : AcyclicEffectiveCausality G) :
(∀ a b c, Reachable (Mediated G) a b → Reachable (Mediated G) b c → Reachable (Mediated G) a c) ∧
(∀ a, ¬ Reachable (Mediated G) a a) ∧
(∀ a b, Reachable (Mediated G) a b → ¬ Reachable (Mediated G) b a) :=
⟨fun _ _ _ first second => first.trans second, acyclic,
fun a _ first second => acyclic a (first.trans second)⟩

end QBD.Ch04

#print axioms QBD.Ch04.influence_strict_partial_order

Verification Summary:

The machine-checked proof confirms that acyclic effective causality renders the nonempty transitive closure of mediated morphisms irreflexive, asymmetric, and transitive, establishing a strict partial order on events. Dynamical enforcement of acyclicity across updates belongs to Chapter 2. The Lean 4 kernel accepts the closed proof term using only standard axioms, certifying the partial-order claim of Partial Order Property §4.2.9.

In Plain English:
Machine-checked Lean 4 proofs certify the formal claims verified in Section 4.2.9.3.


4.2.10 Proof: Categorical Validity​

Formal Verification of the Axiomatic Consistency of Caust\mathbf{Caus}_t through Hist\mathbf{Hist}

I. The Structural Hypothesis The collection of internal causal paths (Caust\mathbf{Caus}_t) and global historical embeddings (Hist\mathbf{Hist}) are asserted to satisfy the rigorous Eilenberg-MacLane axioms required to define a Category.

II. The Verification Chain

  1. Identity for Caust\mathbf{Caus}_t §4.2.2 and Identity for Hist\mathbf{Hist} §4.2.5: Verification of the neutral elements establishes that the trivial path in Caust\mathbf{Caus}_t serves as the identity on nodes and the identity function in Hist\mathbf{Hist} serves as the identity on graphs.
  2. Associativity for Caust\mathbf{Caus}_t §4.2.3 and Associativity for Hist\mathbf{Hist} §4.2.6: Verification of composition rules confirms that both path concatenation and function composition are associative.
  3. Timestamp Monotonicity §4.2.4: Verification of the embedding maps demonstrates that composition preserves the inequality H(e)≤H′(f(e))H(e) \le H'(f(e)) along all causal trajectories.
  4. Topological Injectivity §4.2.7: Verification of structural injectivity proves that morphisms map connected components injectively to prevent topological collapse.

III. Convergence

The defined structures satisfy all required algebraic properties (Identity, Associativity, Closure) without contradiction. The categorical syntax faithfully encodes the physical constraints of Effective Influence Encoding §4.2.8, proving that the relation constitutes a Partial Order Property §4.2.9.

IV. Formal Conclusion Caust\mathbf{Caus}_t and Hist\mathbf{Hist} constitute valid Categories. This confirms that the framework used to describe the dynamical evolution of the universe is mathematically consistent.

Q.E.D.

In Plain English:
Section 4.2.10 formalizes the properties of the QBD proof regarding categorical validity.


4.2.10.1 Type-Theoretic Validation via Lean 4 Core​

Lean 4 Encoding of Categorical Validity via Modular Internal and Historical Assembly

Type-theoretic certification of the complete categorical syntax established in Categorical Validity §4.2.1 proceeds via the following verification strategy:

  1. Model: The assembly module imports all eight certified Chapter 4 identity, associativity, timestamp-monotonicity, injectivity, effective-influence, and partial-order modules.
  2. Certified Claims: The module certifies full categorical validity of both the internal causal category and the historical category, including strict partial ordering of mediated closure, in Categorical Validity §4.2.10.
  3. Scope Boundary: Validity is certified for the static internal path category and the thin historical inclusion category. Dynamical functors across stochastic ensembles lie outside this syntactic assembly.
import QBD.Ch04.L4_2_2_IdentityCaus
import QBD.Ch04.L4_2_3_AssociativityCaus
import QBD.Ch04.L4_2_4_TimestampMonotonicity
import QBD.Ch04.L4_2_5_IdentityHist
import QBD.Ch04.L4_2_6_AssociativityHist
import QBD.Ch04.L4_2_7_TopologicalInjectivity
import QBD.Ch04.L4_2_8_EffectiveInfluenceEncoding
import QBD.Ch04.L4_2_9_PartialOrderProperty

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03

namespace QBD.Ch04

theorem categorical_validity {V : Type} (G : RelTimestampedGraph V)
(acyclic : AcyclicEffectiveCausality G) :
(∀ a b (p : CausHom G a b), causComp (causId G a) p = p ∧ causComp p (causId G b) = p) ∧
(∀ a b c d (p : CausHom G a b) (q : CausHom G b c) (r : CausHom G c d),
causComp (causComp p q) r = causComp p (causComp q r)) ∧
(∀ a b, Nonempty (EffectiveHom G a b) ↔ Mediated G a b) ∧
(∀ a, ¬ Reachable (Mediated G) a a) :=
⟨fun _ _ => caus_identity, fun _ _ _ _ => caus_associativity,
effective_influence_encoding G, (influence_strict_partial_order G acyclic).2.1⟩

theorem historical_category_validity {N : Nat} (A B C D : History N)
(h : HistoricalInclusion A B) (k : HistoricalInclusion B C) (l : HistoricalInclusion C D)
(x : Subtype A) :
historyInclude (historical_inclusion_id B) (historyInclude h x) = historyInclude h x ∧
historyInclude (historical_inclusion_trans (historical_inclusion_trans h k) l) x =
historyInclude (historical_inclusion_trans h (historical_inclusion_trans k l)) x ∧
(∀ y : Subtype A, historyInclude h x = historyInclude h y → x = y) :=
⟨(historical_identity h x).1, historical_associativity h k l x,
fun _ => historical_inclusion_injective h⟩

end QBD.Ch04

#print axioms QBD.Ch04.categorical_validity
#print axioms QBD.Ch04.historical_category_validity

Verification Summary:

The machine-checked proofs unify all eight per-lemma identity, associativity, monotonicity, injectivity, encoding, and partial-order certificates into closed validity theorems for both the internal causal category and the historical category. Stochastic ensemble dynamics remain outside this syntactic assembly. The Lean 4 kernel accepts all closed proof terms using only standard axioms, certifying the categorical validity of Categorical Validity §4.2.10.

In Plain English:
Section 4.2.10.1 formalizes the properties of the QBD type-theoretic regarding validation via lean 4 core.


4.2.11 Calculation: Partial Order Verification​

Empirical Verification of Order-Theoretic Properties via Path Traversal

Computational verification of the strict partial order of effective influence established by Partial Order Property §4.2.9.1 is based on the following protocols:

  1. Graph Generation: The protocol constructs a Directed Acyclic Graph (DAG) with strictly increasing edge timestamps to model a valid causal history.
  2. Relation Extraction: The algorithm computes the Effective Influence relation u≤vu \le v by searching for at least one path between nodes that satisfies:
    • Mediation: Path length (edges) ≥2\ge 2.
    • Monotonicity: Strictly increasing edge timestamps.
  3. Property Validation: The simulation iterates over all nodes and triplets to verify:
    • Irreflexivity: u≰uu \not\le u for all uu.
    • Transitivity: If u≤vu \le v and v≤wv \le w, then u≤wu \le w.
import networkx as nx
import itertools

def verify_partial_order():
# 1. Setup: Create a valid Causal DAG with timestamps
# Structure: 0 -> 1 -> 2 -> 3 (Linear chain with valid timestamps)
# plus a shortcut 0 -> 2 (to test multiple path options)
G = nx.DiGraph()
edges = [
(0, 1, {'t': 10}),
(1, 2, {'t': 20}),
(2, 3, {'t': 30}),
(0, 2, {'t': 15}) # Shortcut, valid but length=1
]
G.add_edges_from(edges)

nodes = list(G.nodes())

# 2. Define the Effective Influence Check (u <= v)
def has_effective_influence(u, v):
if u == v: return False # Optimization, but checked formally below

try:
paths = nx.all_simple_paths(G, source=u, target=v)
except nx.NodeNotFound:
return False

for path in paths:
# Check Length Constraint (>= 2 edges)
# path list contains nodes; edges = len(path) - 1
if len(path) - 1 < 2:
continue

# Check Monotonicity Constraint
timestamps = []
valid_time = True
for i in range(len(path) - 1):
u_curr, v_next = path[i], path[i+1]
t = G[u_curr][v_next]['t']
if timestamps and t <= timestamps[-1]:
valid_time = False
break
timestamps.append(t)

if valid_time:
return True # Found at least one valid causal morphism

return False

print("Partial Order Property Verification")
print("=" * 34)

# 3. Check Irreflexivity (u !<= u)
# Axiom: No node should effectively influence itself (requires cycle)
irreflexive = True
for n in nodes:
if has_effective_influence(n, n):
print(f"Violation: Reflexive loop found at {n}")
irreflexive = False

print(f"Irreflexivity Verification: {'PASS' if irreflexive else 'FAIL'}")

# 4. Check Transitivity (u <= v AND v <= w => u <= w)
transitive = True
# Check all permutations of 3 nodes
for u, v, w in itertools.permutations(nodes, 3):
u_v = has_effective_influence(u, v)
v_w = has_effective_influence(v, w)
u_w = has_effective_influence(u, w)

if u_v and v_w:
if not u_w:
print(f"Violation: Transitivity failed for {u}->{v}->{w}")
transitive = False

print(f"Transitivity Verification: {'PASS' if transitive else 'FAIL'}")

# 5. Specific Edge Case Check
# 0->1 (len 1, t=10): Not Effective
# 1->2 (len 1, t=20): Not Effective
# 0->1->2 (len 2, t=10,20): Effective
check_0_2 = has_effective_influence(0, 2)
print(f"Check 0->2 (via 0->1->2): {'PASS' if check_0_2 else 'FAIL'} (Expected True)")

if __name__ == "__main__":
verify_partial_order()

Simulation Results:

Partial Order Property Verification
==================================
Irreflexivity Verification: PASS
Transitivity Verification: PASS
Check 0->2 (via 0->1->2): PASS (Expected True)

Conclusion:

The simulation output confirms that the constraints applied to the raw graph topology successfully induce a strict partial order. The PASS result for irreflexivity verifies that no node exerts effective influence upon itself, confirming the absence of valid cyclic morphisms. The PASS result for transitivity confirms that for all valid sequential influence chains (u≤vu \le v and v≤wv \le w), the composite influence u≤wu \le w exists and satisfies the requisite constraints. The specific check on the 0→20 \to 2 relationship verifies the structure defined in Effective Influence Encoding §4.2.8: although a direct edge exists, the effective influence relation is established only via the mediated path 0→1→20 \to 1 \to 2, demonstrating the correct application of the length constraint (ℓ≥2\ell \ge 2).

In Plain English:
Section 4.2.11 formalizes the properties of the QBD calculation regarding partial order verification.


4.3.1 Definition: Annotated Causal Graphs (AnnCG)​

Structure of Causal Graphs Augmented by Diagnostic Syndrome Maps

Let VV be the fixed spatial vertex universe, let Veven={s∈F23:s1+s2+s3=0}\mathcal V_{\mathrm{even}}=\{s\in\mathbb F_2^3:s_1+s_2+s_3=0\} and put S={b:V3→Veven}S=\{b:V^3\to\mathcal V_{\mathrm{even}}\}. The category of Annotated Causal Graphs (AnnCG) has objects (X,A)(X,A), where XX includes an active graph GXG_X and its creation history, and AA is an annotation fiber closed under finite products with SS; an annotated state is (X,a)(X,a) with a∈Aa\in A.

The base transitions f:X→Yf:X\to Y are finite composable histories of the specified rewrites, with the associated inclusions of retained creation records (Historical Category §4.1.2). The identity is the empty transition history and composition is concatenation. An AnnCG morphism is (f,k):(X,A)→(Y,B)(f,k):(X,A)\to(Y,B) with k:A→Bk:A\to B. Composition is (g,l)∘(f,k)=(g∘f,l∘k)(g,l)\circ(f,k)=(g\circ f,l\circ k) and identity is (idX,idA)(\mathrm{id}_X,\mathrm{id}_A).

Every ordered triple, including an inactive candidate, has the pair-check observation sX=σGX∈Ss_X=\sigma_{G_X}\in S (Syndrome Classification for Triplets §3.5.5). If EXE_X and EYE_Y are the adjacency fields, define

ΔEf=EX⊕EY,uf=σΔEf=sX⊕sY,τf(b)=b⊕uf.\Delta E_f=E_X\oplus E_Y,\qquad u_f=\sigma_{\Delta E_f}=s_X\oplus s_Y,\qquad \tau_f(b)=b\oplus u_f.

The ambient category permits arbitrary annotation maps. Physical faithful-label updates form the specified subclass whose maps track the incidence displacement (Algebraic Rigidity of the Annotation Map §4.3.9).

Lean 4 (QBD.Ch04.Defs):

/-- §4.3.1. An annotated graph has a global three-bit diagnostic at each ordered triple. -/
abbrev Graph (V : Type) := Edge V → Bool
abbrev Field (V : Type) := (V × V × V) → Fin 3 → Bool
abbrev AnnCG (V : Type) := Graph V × Field V

In Plain English:
Section 4.3.1 formalizes the properties of the QBD definition regarding annotated causal graphs (anncg).


4.3.2 Definition: Awareness Endofunctor (RTR_T)​

Endofunctor RTR_T Adjoining Fresh Syndromes to Graph States via Awareness Endofunctor (RTR_T)

Let the Awareness Endofunctor RTR_T act on the product annotation fibers by

RT(X,A)=(X,A×S),RT(f,k)(a,b)=(k(a),τf(b)).R_T(X,A)=(X,A\times S),\qquad R_T(f,k)(a,b)=(k(a),\tau_f(b)).

The freshly observed state associated with (X,a)(X,a) is (X,(a,sX))(X,(a,s_X)). The second component is transported across graph-changing transitions; at a fixed snapshot its displacement is zero and it remains unchanged (Annotated Causal Graphs (AnnCG) §4.3.1).

Lean 4 (QBD.Ch04.Defs):

/-- §4.3.2. The awareness lift transports diagnostics along the graph change. -/
def lift {V A B : Type} (E F : Graph V) (k : A → B)
(x : A × Field V) : B × Field V :=
(k x.1, transport E F x.2)

In Plain English:
Section 4.3.2 formalizes the properties of the QBD definition regarding awareness endofunctor (rtr_t).


4.3.3 Definition: Context Extraction (Counit ϵ\epsilon)​

Natural Transformation Retrieving Prior Annotations via Context Extraction (Counit ϵ\epsilon)

Let the Context Extraction counit ϵ:RT→Id\epsilon:R_T\to\mathrm{Id} have component at (X,A)(X,A) equal to the identity base transition and the projection

ϵ(X,A):A×S→A,ϵ(a,b)=a.\epsilon_{(X,A)}:A\times S\to A,\qquad \epsilon(a,b)=a.

This map is defined on the full product fiber, including historical annotations that are not currently faithful (Annotated Causal Graphs (AnnCG) §4.3.1).

Lean 4 (QBD.Ch04.Defs):

/-- §4.3.3. Context extraction is projection to the base. -/
def extract {A S : Type} (x : A × S) : A := x.1

In Plain English:
Section 4.3.3 formalizes the properties of the QBD definition regarding context extraction (counit ϵ\epsilon).


4.3.4 Definition: Meta-Check (Comultiplication δ\delta)​

Natural Transformation Duplicating Diagnostic Data via Meta-Check (Comultiplication δ\delta)

Let the Meta-Check comultiplication δ:RT→RT2\delta:R_T\to R_T^2 have identity base transition and annotation component

δ(X,A):A×S→(A×S)×S,δ(a,b)=((a,b),b).\delta_{(X,A)}:A\times S\to(A\times S)\times S,\qquad \delta(a,b)=((a,b),b).

Both copies are transported by the same base displacement when a graph-changing morphism acts (Awareness Endofunctor (RTR_T) §4.3.2).

Lean 4 (QBD.Ch04.Defs):

/-- §4.3.4. The meta-check copies the same diagnostic field. -/
def duplicate {A S : Type} (x : A × S) : (A × S) × S := (x, x.2)

In Plain English:
Section 4.3.4 formalizes the properties of the QBD definition regarding meta-check (comultiplication δ\delta).


4.3.5 Theorem: Awareness Comonad​

Verification of the comonadic axioms (identity and coassociativity) via the self-observation triplet

Given AnnCG with fixed syndrome domain and the product lift RT(f,k)(a,b)=(k(a),τf(b))R_T(f,k)(a,b)=(k(a),\tau_f(b)), the following holds: (RT,ϵ,δ)(R_T,\epsilon,\delta) is a comonad, with a functorial lift, natural counit and comultiplication, two counit identities and coassociativity (Annotated Causal Graphs (AnnCG) §4.3.1).

In Plain English:
Section 4.3.5 formalizes the properties of the QBD theorem regarding awareness comonad.


4.3.6 Lemma: Functoriality of Awareness​

Preservation of Identity and Composition by the Awareness Endofunctor

Let the diagnostic transports satisfy τid=id\tau_{\mathrm{id}}=\mathrm{id} and τg∘f=τg∘τf\tau_{g\circ f}=\tau_g\circ\tau_f as induced by adjacency displacement. Then RTR_T preserves identity morphisms and composition (Awareness Endofunctor (RTR_T) §4.3.2).

In Plain English:
Section 4.3.6 formalizes the properties of the QBD lemma regarding functoriality of awareness.


4.3.6.1 Proof: Functoriality of Awareness​

Formal Verification of Functorial Properties through Explicit Inductive Steps

I. Cancellation of Endpoint Fields

The proof uses the specified objects and conventions (Annotated Causal Graphs (AnnCG) §4.3.1).

For f:X→Yf:X\to Y and g:Y→Zg:Y\to Z, binary addition gives

uf⊕ug=(sX⊕sY)⊕(sY⊕sZ)=sX⊕(sY⊕sY)⊕sZ=sX⊕sZ=ug∘f.u_f\oplus u_g=(s_X\oplus s_Y)\oplus(s_Y\oplus s_Z) =s_X\oplus(s_Y\oplus s_Y)\oplus s_Z=s_X\oplus s_Z=u_{g\circ f}.

Also uidX=sX⊕sX=0u_{\mathrm{id}_X}=s_X\oplus s_X=0. For every b∈Sb\in S,

τid(b)=b⊕0=b,τg(τf(b))=(b⊕uf)⊕ug=b⊕ug∘f.\tau_{\mathrm{id}}(b)=b\oplus0=b,\qquad \tau_g(\tau_f(b))=(b\oplus u_f)\oplus u_g=b\oplus u_{g\circ f}.

II. Identity Lift

The lifted identity sends (a,b)(a,b) to (id(a),τid(b))=(a,b)(\mathrm{id}(a),\tau_{\mathrm{id}}(b))=(a,b). Its base transition is the identity, hence it is the identity morphism on the product object.

III. Composite Lift

For annotation maps k:A→Bk:A\to B and l:B→Cl:B\to C,

RT(g,l)(RT(f,k)(a,b))=RT(g,l)(k(a),τf(b))=(l(k(a)),τg(τf(b)))=((l∘k)(a),τg∘f(b))=RT(g∘f,l∘k)(a,b).\begin{aligned} R_T(g,l)(R_T(f,k)(a,b)) &=R_T(g,l)(k(a),\tau_f(b))\\ &=(l(k(a)),\tau_g(\tau_f(b)))\\ &=((l\circ k)(a),\tau_{g\circ f}(b))\\ &=R_T(g\circ f,l\circ k)(a,b). \end{aligned}

Equality holds for every element of the source fiber and the base transitions agree. This proves functoriality (Functoriality of Awareness §4.3.6).

Q.E.D.

In Plain English:
Section 4.3.6.1 formalizes the properties of the QBD proof regarding functoriality of awareness.


4.3.6.2 Type-Theoretic Validation via Lean 4 Core​

Lean 4 Encoding of Functoriality of Awareness via Diagnostic Transport Laws

Type-theoretic certification of the functoriality of the awareness lift established in Functoriality of Awareness §4.3.6 proceeds via the following verification strategy:

  1. Model: Global three-bit diagnostic fields on ordered vertex triples, binary XOR observation differences, diagnostic transport maps, and awareness lifts represent endofunctorial action on annotated graphs.
  2. Certified Claims: The module certifies exact observation-difference linearity, transport identity and composition laws, and identity and composition preservation for the awareness lift in Functoriality of Awareness §4.3.6.1.
  3. Scope Boundary: Functoriality is certified for the global binary-XOR diagnostic transport over arbitrary graph morphisms. Physical error-correction decoders remain outside this categorical endofunctor check.
import QBD.Ch04.Defs

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03

namespace QBD.Ch04

theorem observation_difference {V : Type} (E F : Graph V) :
observe (edgeDifference E F) = add (observe E) (observe F) := by
funext p i
rcases p with ⟨v, w, u⟩
rcases i with ⟨i, hi⟩
match i with
| 0 => dsimp [observe, edgeDifference, add]; cases E (v,w) <;> cases E (w,u) <;> cases F (v,w) <;> cases F (w,u) <;> rfl
| 1 => dsimp [observe, edgeDifference, add]; cases E (w,u) <;> cases E (u,v) <;> cases F (w,u) <;> cases F (u,v) <;> rfl
| 2 => dsimp [observe, edgeDifference, add]; cases E (u,v) <;> cases E (v,w) <;> cases F (u,v) <;> cases F (v,w) <;> rfl
| n+3 => omega

theorem transport_identity {V : Type} (E : Graph V) (b : Field V) :
transport E E b = b := by
funext p i
dsimp [transport, add]
cases b p i <;> cases observe E p i <;> rfl

theorem transport_composition {V : Type} (E F G : Graph V) (b : Field V) :
transport F G (transport E F b) = transport E G b := by
funext p i
dsimp [transport, add]
cases b p i <;> cases observe E p i <;> cases observe F p i <;> cases observe G p i <;> rfl

theorem lift_identity {V A : Type} (E : Graph V) (x : A × Field V) :
lift E E id x = x := by
rcases x with ⟨a,b⟩
simp only [lift, id_eq, transport_identity]

theorem lift_composition {V A B C : Type} (E F G : Graph V)
(k : A → B) (l : B → C) (x : A × Field V) :
lift F G l (lift E F k x) = lift E G (l ∘ k) x := by
rcases x with ⟨a,b⟩
simp only [lift, Function.comp_apply, transport_composition]

end QBD.Ch04

#print axioms QBD.Ch04.observation_difference
#print axioms QBD.Ch04.transport_identity
#print axioms QBD.Ch04.transport_composition
#print axioms QBD.Ch04.lift_identity
#print axioms QBD.Ch04.lift_composition

Verification Summary:

The machine-checked proofs confirm that diagnostic transport respects identity and composition via binary XOR cancellation, ensuring that the awareness lift satisfies both functorial laws identically. Physical decoding algorithms remain outside this algebraic endofunctor module. The Lean 4 kernel accepts all closed proof terms using only standard axioms, certifying the functoriality claims of Functoriality of Awareness §4.3.6.

In Plain English:
Machine-checked Lean 4 proofs certify the formal claims verified in Section 4.3.6.3.


4.3.7 Lemma: Naturality of Transformations​

Commutativity of Context Extraction through Meta-Check with State Morphisms

Let RTR_T be the graph-changing product lift on AnnCG. Then the projection ϵ(a,b)=a\epsilon(a,b)=a and duplication δ(a,b)=((a,b),b)\delta(a,b)=((a,b),b) are natural transformations (Context Extraction (Counit ϵ\epsilon) §4.3.3).

In Plain English:
Section 4.3.7 formalizes the properties of the QBD lemma regarding naturality of transformations.


4.3.7.1 Proof: Naturality of Transformations​

Verification of Naturality Conditions for ϵ\epsilon through δ\delta

I. Counit Square

The proof uses the specified objects and conventions (Annotated Causal Graphs (AnnCG) §4.3.1).

For h=(f,k)h=(f,k) and (a,b)∈A×S(a,b)\in A\times S,

ϵY(RT(h)(a,b))=ϵY(k(a),τf(b))=k(a)=k(ϵX(a,b)).\epsilon_Y(R_T(h)(a,b))=\epsilon_Y(k(a),\tau_f(b))=k(a) =k(\epsilon_X(a,b)).

Both composites have base transition ff, so their annotation equality proves the counit square.

II. Second Lift

The annotation part of RT(h)R_T(h) is k~(a,b)=(k(a),τf(b))\widetilde k(a,b)=(k(a),\tau_f(b)). Applying the product lift to it gives

RT2(h)((a,b),c)=((k(a),τf(b)),τf(c)).R_T^2(h)((a,b),c)=((k(a),\tau_f(b)),\tau_f(c)).

In particular both observation slots, not just the inner one, are transported.

III. Comultiplication Square

The two compositions on the fiber have the following values.

δY(RT(h)(a,b))=δY(k(a),τf(b))=((k(a),τf(b)),τf(b)),RT2(h)(δX(a,b))=RT2(h)((a,b),b)=(k~(a,b),τf(b))=((k(a),τf(b)),τf(b)).\begin{aligned} \delta_Y(R_T(h)(a,b)) &=\delta_Y(k(a),\tau_f(b))\\ &=((k(a),\tau_f(b)),\tau_f(b)),\\ R_T^2(h)(\delta_X(a,b)) &=R_T^2(h)((a,b),b)\\ &=(\widetilde k(a,b),\tau_f(b)) =((k(a),\tau_f(b)),\tau_f(b)). \end{aligned}

The base transitions again agree. Thus both naturality squares commute (Naturality of Transformations §4.3.7).

Q.E.D.

In Plain English:
Section 4.3.7.1 formalizes the properties of the QBD proof regarding naturality of transformations.


4.3.7.2 Type-Theoretic Validation via Lean 4 Core​

Lean 4 Encoding of Naturality of Transformations via Projection and Duplication Commutation

Type-theoretic certification of the naturality of context extraction and meta-check duplication established in Naturality of Transformations §4.3.7 proceeds via the following verification strategy:

  1. Model: Annotated product states, base projection counits, diagnostic duplication comultiplications, and awareness lifts represent natural transformations of the awareness endofunctor.
  2. Certified Claims: The module certifies exact naturality squares for both context extraction and meta-check duplication with respect to every lifted morphism in Naturality of Transformations §4.3.7.1.
  3. Scope Boundary: Naturality holds on the full product fiber of annotated states, including historical annotations. Dynamical syndrome filtering remains outside this categorical naturality check.
import QBD.Ch04.Defs

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03

namespace QBD.Ch04

theorem extract_natural {V A B : Type} (E F : Graph V)
(k : A → B) (x : A × Field V) :
extract (lift E F k x) = k (extract x) := by rfl

theorem duplicate_natural {V A B : Type} (E F : Graph V)
(k : A → B) (x : A × Field V) :
duplicate (lift E F k x) =
lift E F (lift E F k) (duplicate x) := by rfl

end QBD.Ch04

#print axioms QBD.Ch04.extract_natural
#print axioms QBD.Ch04.duplicate_natural

Verification Summary:

The machine-checked proofs confirm that both context extraction and meta-check duplication commute strictly with the awareness lift on all morphisms, establishing naturality of the counit and comultiplication. Dynamical selection rules remain outside this categorical module. The Lean 4 kernel accepts all closed proof terms using only standard axioms, certifying the naturality claims of Naturality of Transformations §4.3.7.

In Plain English:
Machine-checked Lean 4 proofs certify the formal claims verified in Section 4.3.7.3.


4.3.8 Lemma: Axiom Satisfaction​

Compliance of the Awareness Triplet with the Laws of Identity via Associativity

Let RTR_T, ϵ\epsilon and δ\delta be the natural product constructions above. Then they satisfy both counit laws and coassociativity (Awareness Comonad §4.3.5).

In Plain English:
Section 4.3.8 formalizes the properties of the QBD lemma regarding axiom satisfaction.


4.3.8.1 Proof: Axiom Satisfaction​

Tuple Tracing via Comonad Axioms

I. Outer Counit

The proof uses the specified objects and conventions (Annotated Causal Graphs (AnnCG) §4.3.1).

For (a,b)∈A×S(a,b)\in A\times S,

ϵRTX(δX(a,b))=ϵRTX((a,b),b)=(a,b).\epsilon_{R_T X}(\delta_X(a,b))=\epsilon_{R_T X}((a,b),b)=(a,b).

II. Lifted Inner Counit

The base transition of ϵX\epsilon_X is identity, so its displacement vanishes. Consequently

RT(ϵX)(δX(a,b))=RT(ϵX)((a,b),b)=(ϵX(a,b),b)=(a,b).R_T(\epsilon_X)(\delta_X(a,b)) =R_T(\epsilon_X)((a,b),b) =(\epsilon_X(a,b),b)=(a,b).

III. Coassociativity

The two annotation composites are

δRTX(δX(a,b))=δRTX((a,b),b)=(((a,b),b),b),RT(δX)(δX(a,b))=RT(δX)((a,b),b)=(δX(a,b),b)=(((a,b),b),b).\begin{aligned} \delta_{R_T X}(\delta_X(a,b))&=\delta_{R_T X}((a,b),b)=(((a,b),b),b),\\ R_T(\delta_X)(\delta_X(a,b))&=R_T(\delta_X)((a,b),b) =(\delta_X(a,b),b)=(((a,b),b),b). \end{aligned}

Each base transition is identity. The equalities establish all three laws (Axiom Satisfaction §4.3.8).

Q.E.D.

In Plain English:
Section 4.3.8.1 formalizes the properties of the QBD proof regarding axiom satisfaction.


4.3.8.2 Type-Theoretic Validation via Lean 4 Core​

Lean 4 Encoding of Comonad Axiom Satisfaction via Counit and Coassociativity Identities

Type-theoretic certification of the left counit, right counit, and coassociativity laws established in Axiom Satisfaction §4.3.8 proceeds via the following verification strategy:

  1. Model: Product-fiber context extraction, meta-check duplication, and lifted diagnostic projections represent the three defining comonad coherence equations.
  2. Certified Claims: The module certifies the left counit law, right counit law, and coassociativity identity identically across all annotated states in Axiom Satisfaction §4.3.8.1.
  3. Scope Boundary: The certificate verifies definitional coherence of the product-fiber comonad axioms. Algebraic rigidity of the observation map is certified separately in the next module.
import QBD.Ch04.L4_3_6_FunctorialityOfAwareness

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03

namespace QBD.Ch04

theorem counit_left {A S : Type} (x : A × S) : extract (duplicate x) = x := by rfl

theorem counit_right {V A : Type} (E : Graph V) (x : A × Field V) :
lift E E extract (duplicate x) = x := by
rcases x with ⟨a,b⟩
simp only [lift, extract, duplicate, transport_identity]

theorem coassociative {V A : Type} (E : Graph V) (x : A × Field V) :
duplicate (duplicate x) = lift E E duplicate (duplicate x) := by
rcases x with ⟨a,b⟩
simp only [lift, duplicate, transport_identity]

end QBD.Ch04

#print axioms QBD.Ch04.counit_left
#print axioms QBD.Ch04.counit_right
#print axioms QBD.Ch04.coassociative

Verification Summary:

The machine-checked proofs confirm that context extraction and meta-check duplication satisfy both counit identities and coassociativity across all annotated states. Uniqueness of the diagnostic shift map is verified separately in the rigidity module. The Lean 4 kernel accepts all closed proof terms using only standard axioms, certifying the comonad laws of Axiom Satisfaction §4.3.8.

In Plain English:
Machine-checked Lean 4 proofs certify the formal claims verified in Section 4.3.8.4.


4.3.9 Lemma: Algebraic Rigidity of the Annotation Map​

Deterministic Constriction of Categorical Morphisms via Pauli Anti-Commutation and Affine Translation Uniqueness

Let h=(f,k):(Gt,σ)→(Gt+1,σ′)h = (f, k): (G_t, \sigma) \to (G_{t+1}, \sigma') be a morphism in the category AnnCG\mathbf{AnnCG} corresponding to a physical rewrite on an arbitrary graph G=(V,E)G = (V, E) with global topological symmetric difference ΔE=Et+1⊕Et\Delta E = E_{t+1} \oplus E_t, such that at every candidate 2-path site p=(v,w,u)p = (v, w, u) the local triad check syndrome σ(p)∈{+1,−1}3≅F23\sigma(p) \in \{+1, -1\}^3 \cong \mathbb{F}_2^3 evaluated via S1=ZvwZwuS_1 = Z_{vw}Z_{wu}, S2=ZwuZuvS_2 = Z_{wu}Z_{uv}, and S3=ZuvZvwS_3 = Z_{uv}Z_{vw} resides in the even-parity sector Veven={s∈F23∣s1⊕s2⊕s3=0}\mathcal{V}_{\mathrm{even}} = \{s \in \mathbb{F}_2^3 \mid s_1 \oplus s_2 \oplus s_3 = 0\}; then any diagnostic update kk that is an affine occupancy translation tracking incidence displacement uΔE(p)∈Veven\boldsymbol{u}_{\Delta E}(p) \in \mathcal{V}_{\mathrm{even}} satisfying base anchoring k(0)=uΔE(p)k(0) = \boldsymbol{u}_{\Delta E}(p) and translation equivariance k(s1⊕s2)=k(s1)⊕s2k(s_1 \oplus s_2) = k(s_1) \oplus s_2 is uniquely forced to equal k(σ)(p)=σ(p)⊕uΔE(p)k(\sigma)(p) = \sigma(p) \oplus \boldsymbol{u}_{\Delta E}(p).

In Plain English:
Section 4.3.9 formalizes the properties of the QBD lemma regarding algebraic rigidity of the annotation map.


4.3.9.1 Proof: Algebraic Rigidity of the Annotation Map​

Derivation of the Annotation Map from Topological Symmetric Difference

I. Occupancy and Binary Check Coordinates

Fix the local triad p=(v,w,u)p=(v,w,u) and label its slots e1=(v,w)e_1=(v,w), e2=(w,u)e_2=(w,u), e3=(u,v)e_3=(u,v). Write xj=1E(ej)∈F2x_j=\mathbf1_E(e_j)\in\mathbb F_2. The three check operators specified in the statement are (Algebraic Rigidity of the Annotation Map §4.3.9)

K1=Ze1Ze2,K2=Ze2Ze3,K3=Ze3Ze1.K_1=Z_{e_1}Z_{e_2},\qquad K_2=Z_{e_2}Z_{e_3},\qquad K_3=Z_{e_3}Z_{e_1}.

On an occupancy ket, the single-edge action is Ze∣xe⟩=(−1)xe∣xe⟩Z_e|x_e\rangle=(-1)^{x_e}|x_e\rangle (Configuration Space Validity §3.5.3). Thus the binary syndrome and its eigenvalue encoding are

s1=x1+x2,s2=x2+x3,s3=x3+x1in F2,λj=(−1)sj,s=Bx,B=(110011101).\begin{gathered} s_1=x_1+x_2,\quad s_2=x_2+x_3,\quad s_3=x_3+x_1 \quad\text{in }\mathbb F_2,\\ \lambda_j=(-1)^{s_j},\qquad s=B x,\qquad B=\begin{pmatrix}1&1&0\\0&1&1\\1&0&1\end{pmatrix}. \end{gathered}

Adding the components gives

s1+s2+s3=(x1+x2)+(x2+x3)+(x3+x1)=2x1+2x2+2x3=0.s_1+s_2+s_3 =(x_1+x_2)+(x_2+x_3)+(x_3+x_1) =2x_1+2x_2+2x_3=0.

Hence s∈Vevens\in\mathcal V_{even} at every triad.

II. Exact Displacement Under Symmetric Difference

Let E′=E△ΔEE'=E\triangle\Delta E and dj=1ΔE(ej)d_j=\mathbf1_{\Delta E}(e_j). Membership in a symmetric difference gives xj′=xj+djx'_j=x_j+d_j in F2\mathbb F_2. Consequently

s1′=(x1+d1)+(x2+d2)=s1+(d1+d2),s2′=(x2+d2)+(x3+d3)=s2+(d2+d3),s3′=(x3+d3)+(x1+d1)=s3+(d3+d1).\begin{aligned} s'_1&=(x_1+d_1)+(x_2+d_2)=s_1+(d_1+d_2),\\ s'_2&=(x_2+d_2)+(x_3+d_3)=s_2+(d_2+d_3),\\ s'_3&=(x_3+d_3)+(x_1+d_1)=s_3+(d_3+d_1). \end{aligned}

Define u=Bdu=Bd. Then s′=s+us'=s+u, and

u1+u2+u3=2d1+2d2+2d3=0,u_1+u_2+u_3=2d_1+2d_2+2d_3=0,

so u∈Vevenu\in\mathcal V_{even}. This calculation is local to an arbitrary triad and therefore applies simultaneously to every triad of the graph.

III. Pauli Sign Calculation

Let X(ΔE)=∏e∈ΔEXeX(\Delta E)=\prod_{e\in\Delta E}X_e on the edge tensor factors. On one factor, ZeXe=−XeZeZ_eX_e=-X_eZ_e; factors on distinct slots commute. For the displayed triad checks, moving all XX factors through the check gives

K1X(ΔE)=(−1)d1+d2X(ΔE)K1,K2X(ΔE)=(−1)d2+d3X(ΔE)K2,K3X(ΔE)=(−1)d3+d1X(ΔE)K3.\begin{aligned} K_1X(\Delta E)&=(-1)^{d_1+d_2}X(\Delta E)K_1,\\ K_2X(\Delta E)&=(-1)^{d_2+d_3}X(\Delta E)K_2,\\ K_3X(\Delta E)&=(-1)^{d_3+d_1}X(\Delta E)K_3. \end{aligned}

Thus if Kj∣ψ⟩=(−1)sj∣ψ⟩K_j|\psi\rangle=(-1)^{s_j}|\psi\rangle,

KjX(ΔE)∣ψ⟩=(−1)ujX(ΔE)Kj∣ψ⟩=(−1)sj+ujX(ΔE)∣ψ⟩.K_jX(\Delta E)|\psi\rangle =(-1)^{u_j}X(\Delta E)K_j|\psi\rangle =(-1)^{s_j+u_j}X(\Delta E)|\psi\rangle.

The operator calculation agrees with the direct occupancy calculation.

IV. Necessity and Sufficiency of the Translation

Suppose k:Veven→Vevenk:\mathcal V_{even}\to\mathcal V_{even} satisfies

k(0)=u,k(a+b)=k(a)+b(a,b∈Veven).k(0)=u,\qquad k(a+b)=k(a)+b\quad(a,b\in\mathcal V_{even}).

For any s∈Vevens\in\mathcal V_{even}, the pair (0,s)(0,s) belongs to the domain of the equivariance identity. Anchoring at k(0)=uk(0)=u gives

k(s)=k(0+s)=k(0)+s=u+s=s+u.k(s)=k(0+s)=k(0)+s=u+s=s+u.

Conversely, define Tu(s)=s+uT_u(s)=s+u. Since ss and uu are even, Tu(s)T_u(s) is even. Its anchoring and equivariance are

Tu(0)=u,Tu(a+b)=a+b+u=(a+u)+b=Tu(a)+b.T_u(0)=u,\qquad T_u(a+b)=a+b+u=(a+u)+b=T_u(a)+b.

Therefore this translation exists and is the unique map with the two stated properties. For any two such maps k1,k2k_1,k_2, every ss satisfies k1(s)=s+u=k2(s)k_1(s)=s+u=k_2(s), proving equality of functions.

V. Iterated Consistency

If the stored initial field is s(0)=Bx(0)s^{(0)}=Bx^{(0)}, and the update at step jj has displacement d(j)d^{(j)}, then

x(j+1)=x(j)+d(j),s(j+1)=s(j)+Bd(j)=Bx(j)+Bd(j)=B(x(j)+d(j))=Bx(j+1).\begin{aligned} x^{(j+1)}&=x^{(j)}+d^{(j)},\\ s^{(j+1)}&=s^{(j)}+Bd^{(j)} =Bx^{(j)}+Bd^{(j)}=B(x^{(j)}+d^{(j)})=Bx^{(j+1)}. \end{aligned}

The displayed implication is the induction step, so consistency holds at every finite iteration. Replacing binary addition by ⊕\oplus gives the required update:

k(s)(p)=s(p)⊕uΔE(p).\boxed{k(s)(p)=s(p)\oplus\boldsymbol u_{\Delta E}(p).}

Q.E.D.

In Plain English:
Section 4.3.9.1 formalizes the properties of the QBD proof regarding algebraic rigidity of the annotation map.


4.3.9.2 Type-Theoretic Validation via Lean 4 Core​

Lean 4 Encoding of Algebraic Rigidity via Binary Affine Shift Uniqueness

Type-theoretic certification of the uniqueness and involution properties of affine diagnostic shifts established in Algebraic Rigidity of the Annotation Map §4.3.9 proceeds via the following verification strategy:

  1. Model: Finite binary vectors, bitwise XOR addition, affine shift predicates, and involutive comonadic frame shifts represent rigid diagnostic transport.
  2. Certified Claims: The module certifies that any affine shift is uniquely determined by its offset on the zero vector, that affine morphisms with equal offsets coincide pointwise, and that comonadic shift transport is an involution in Algebraic Rigidity of the Annotation Map §4.3.9.1.
  3. Scope Boundary: Rigidity applies to binary-XOR affine shifts on finite diagnostic bit-vectors. Nonlinear or stochastic annotation corruption lies outside the affine-shift hypothesis.
import QBD.Ch04.Defs

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03

namespace QBD.Ch04

theorem affine_shift_uniquely_determined {n : Nat} (k : BitVector n → BitVector n)
(offset : BitVector n) (affine : IsAffineShift k offset) : k = shiftOp offset := by
have zeroLeft (x : BitVector n) : xorVec (zeroVec n) x = x := by
funext i
dsimp [xorVec, zeroVec]
cases x i <;> rfl
funext x
have shifted := affine.2 (zeroVec n) x
rw [zeroLeft, affine.1] at shifted
rw [shifted]
funext i
dsimp [shiftOp, xorVec]
cases x i <;> cases offset i <;> rfl

theorem affine_morphism_unique {n : Nat} {k l : BitVector n → BitVector n} {u : BitVector n}
(hk : IsAffineShift k u) (hl : IsAffineShift l u) : k = l :=
(affine_shift_uniquely_determined k u hk).trans (affine_shift_uniquely_determined l u hl).symm

theorem comonad_shift_involution {n : Nat} (u x : BitVector n) :
shiftOp u (shiftOp u x) = x := by
funext i
dsimp [shiftOp, xorVec]
cases x i <;> cases u i <;> rfl

end QBD.Ch04

#print axioms QBD.Ch04.affine_shift_uniquely_determined
#print axioms QBD.Ch04.affine_morphism_unique
#print axioms QBD.Ch04.comonad_shift_involution

Verification Summary:

The machine-checked proofs establish that every binary-XOR affine diagnostic map is uniquely fixed by its zero-vector offset and acts as an involution under repeated transport, ruling out ambiguous frame shifts. Stochastic annotation noise remains outside this deterministic algebraic check. The Lean 4 kernel accepts all closed proof terms using only standard axioms, certifying the rigidity claims of Algebraic Rigidity of the Annotation Map §4.3.9.

In Plain English:
Section 4.3.9.2 formalizes the properties of the QBD type-theoretic regarding validation via lean 4 core.


4.3.10 Lemma: Comonadic Pauli Frame Tracking​

Comonadic Tracking via Stabilizer Parity Shifts

Let EY=EX⊕ΔEE_Y=E_X\oplus\Delta E and let a faithful diagnostic field be b=sXb=s_X. Then incidence transport gives τf(b)=sY\tau_f(b)=s_Y and the lifted observation state is (k(a),sY)(k(a),s_Y) (Awareness Endofunctor (RTR_T) §4.3.2).

In Plain English:
Section 4.3.10 formalizes the properties of the QBD lemma regarding comonadic pauli frame tracking.


4.3.10.1 Proof: Comonadic Pauli Frame Tracking​

Formal Proof of Comonadic Pauli Frame Tracking via Stabilizer Commutation

I. Binary Pair Checks

At a site with occupancy bits x1,x2,x3x_1,x_2,x_3, the pair-check bit vector is

B(x)=(x1⊕x2, x2⊕x3, x3⊕x1).B(x)=(x_1\oplus x_2,\ x_2\oplus x_3,\ x_3\oplus x_1).

For a displacement dd, coordinate expansion gives

B(x⊕d)1=(x1⊕d1)⊕(x2⊕d2)=(x1⊕x2)⊕(d1⊕d2),B(x\oplus d)_1=(x_1\oplus d_1)\oplus(x_2\oplus d_2) =(x_1\oplus x_2)\oplus(d_1\oplus d_2),

and the same calculation on coordinates two and three proves B(x⊕d)=B(x)⊕B(d)B(x\oplus d)=B(x)\oplus B(d) (Algebraic Rigidity of the Annotation Map §4.3.9).

II. Global Observation Difference

The coordinate identity holds at every ordered triple in V3V^3, so

sY=sX⊕σΔE,uf=σΔE=sX⊕sY.s_Y=s_X\oplus\sigma_{\Delta E},\qquad u_f=\sigma_{\Delta E}=s_X\oplus s_Y.

III. Faithful Context Transport

For b=sXb=s_X,

τf(b)=sX⊕(sX⊕sY)=(sX⊕sX)⊕sY=0⊕sY=sY.\tau_f(b)=s_X\oplus(s_X\oplus s_Y) =(s_X\oplus s_X)\oplus s_Y=0\oplus s_Y=s_Y.

Therefore RT(f,k)(a,sX)=(k(a),sY)R_T(f,k)(a,s_X)=(k(a),s_Y), the freshly observed target state (Comonadic Pauli Frame Tracking §4.3.10).

Q.E.D.

In Plain English:
Section 4.3.10.1 formalizes the properties of the QBD proof regarding comonadic pauli frame tracking.


4.3.10.2 Type-Theoretic Validation via Lean 4 Core​

Lean 4 Encoding of Comonadic Pauli Frame Tracking via Exact Observation Transport

Type-theoretic certification of the exact observation-tracking identity established in Comonadic Pauli Frame Tracking §4.3.10 proceeds via the following verification strategy:

  1. Model: Binary graph edge fields, triplet parity observation maps, and XOR diagnostic transport represent faithful frame tracking across graph updates.
  2. Certified Claims: The module certifies that transporting the initial observation of a graph across any graph update yields the exact observation of the updated graph in Comonadic Pauli Frame Tracking §4.3.10.1.
  3. Scope Boundary: Exact tracking applies to faithful initial diagnostic annotations under deterministic graph changes. Physical quantum circuit noise channels remain outside this classical bit-frame check.
import QBD.Ch04.Defs

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03

namespace QBD.Ch04

theorem transport_observation {V : Type} (E F : Graph V) :
transport E F (observe E) = observe F := by
funext p i
dsimp [transport, add]
cases observe E p i <;> cases observe F p i <;> rfl

end QBD.Ch04

#print axioms QBD.Ch04.transport_observation

Verification Summary:

The machine-checked proof confirms that transporting the faithful initial parity observation across any graph transition reproduces the updated graph observation identically, certifying exact Pauli-frame tracking. Physical noise channels remain outside this deterministic tracking module. The Lean 4 kernel accepts the closed proof term using only standard axioms, certifying the tracking claim of Comonadic Pauli Frame Tracking §4.3.10.

In Plain English:
Machine-checked Lean 4 proofs certify the formal claims verified in Section 4.3.10.3.


4.3.11 Proof: Awareness Comonad​

Formal Derivation of the Self-Diagnostic Comonad Structure via Functorial Mapping

I. Well-Defined Product Lift

The fixed diagnostic domain is independent of candidate activity. Endpoint displacements compose by cancellation, so identities and composition lift correctly (Functoriality of Awareness §4.3.6).

II. Natural Transformations and Laws

Projection and duplication commute with the transported lift (Naturality of Transformations §4.3.7). Their two counit identities and coassociativity hold on every product annotation fiber (Axiom Satisfaction §4.3.8). These are the comonad requirements (Awareness Comonad §4.3.5).

III. Physical Diagnostic Subclass

The affine anchoring and translation hypotheses uniquely specify the physical diagnostic shift (Algebraic Rigidity of the Annotation Map §4.3.9). Its global displacement transports a faithful observation into the new faithful observation (Comonadic Pauli Frame Tracking §4.3.10). This subclass is compatible with the natural product lift established above.

Q.E.D.

In Plain English:
Section 4.3.11 formalizes the properties of the QBD proof regarding awareness comonad.


4.3.11.1 Calculation: Simulation Verification​

Computational Verification of Comonad Axioms via Structural Equality Checks

Computational verification of the transported observation identities established in (Awareness Comonad §4.3.11) and (Comonadic Pauli Frame Tracking §4.3.10.1) is based on the following protocols:

  1. Global Occupancy Enumeration: All directed three-vertex adjacency patterns supply observations at every ordered triple.
  2. Displacement Comparison: Every adjacency pair is checked against the global observation symmetric-difference identity.
  3. Context Transport: Binary endpoint cases check transport composition and both copies of the comultiplication context.
from itertools import product

vertices = range(3)
edges = [(u,v) for u in vertices for v in vertices if u!=v]
sites = list(product(vertices,repeat=3))
graphs = [{e:bit for e,bit in zip(edges,bits)} for bits in product((0,1),repeat=len(edges))]

def observe(E,p):
v,w,u = p
x,y,z = E.get((v,w),0), E.get((w,u),0), E.get((u,v),0)
return (x^y,y^z,z^x)

checks = 0
for E in graphs:
for F in graphs:
difference = {e:E[e]^F[e] for e in edges}
for p in sites:
a,b,d = observe(E,p),observe(F,p),observe(difference,p)
assert d==tuple(x^y for x,y in zip(a,b))
assert sum(a)%2==0
assert tuple(x^(x^y) for x,y in zip(a,b))==b
checks += 1

for b,sE,sF,sG in product((0,1),repeat=4):
assert (b^(sE^sF))^(sF^sG)==b^(sE^sG)
for a,b,u in product((0,1),repeat=3):
k = lambda x:x^1
lift = lambda pair:(k(pair[0]),pair[1]^u)
duplicate = lambda pair:(pair,pair[1])
lhs = duplicate(lift((a,b)))
rhs = ((k(a),b^u),b^u)
assert lhs==rhs
print('Adjacency patterns:',len(graphs))
print('Global site-pair observation checks:',checks)
print('Binary transport composition cases: 16')
print('Transported duplicate-context cases: 8')
print('Mismatches: 0')

Simulation Results:

Adjacency patterns: 64
Global site-pair observation checks: 110592
Binary transport composition cases: 16
Transported duplicate-context cases: 8
Mismatches: 0

Conclusion: The enumeration covers 64 adjacency patterns and 110592 ordered-site comparisons. Every observation difference, even-parity test and faithful transport identity agrees exactly. All 16 binary composition cases and eight duplicated-context cases also agree. These finite checks validate the displayed component identities alongside the independent Lean proofs.

In Plain English:
Section 4.3.11.1 formalizes the properties of the QBD calculation regarding simulation verification.


4.3.11.2 Type-Theoretic Validation via Lean 4 Core​

Lean 4 Encoding of Awareness Comonad via Modular Coherence and Rigidity Assembly

Type-theoretic certification of the comonadic coherence and rigid frame-tracking synthesis established in Awareness Comonad §4.3.5 proceeds via the following verification strategy:

  1. Model: The assembly module imports all five certified Chapter 4 functoriality, naturality, axiom-satisfaction, algebraic-rigidity, and Pauli-frame-tracking modules.
  2. Certified Claims: The module certifies the complete comonadic laws for the awareness endofunctor together with unique affine rigidity and exact Pauli-frame transport in Awareness Comonad §4.3.11.
  3. Scope Boundary: The assembly certifies deterministic binary-XOR comonadic tracking on finite diagnostic fields. Physical noisy quantum channels remain outside this algebraic comonad assembly.
import QBD.Ch04.L4_3_6_FunctorialityOfAwareness
import QBD.Ch04.L4_3_7_NaturalityOfTransformations
import QBD.Ch04.L4_3_8_AxiomSatisfaction
import QBD.Ch04.L4_3_10_ComonadicPauliFrameTracking
import QBD.Ch04.L4_3_9_AlgebraicRigidity

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03

namespace QBD.Ch04

theorem awareness_comonad {V A B C : Type} (E F G : Graph V)
(k : A → B) (l : B → C) (x : A × Field V) :
lift E E id x = x ∧
lift F G l (lift E F k x) = lift E G (l ∘ k) x ∧
extract (lift E F k x) = k (extract x) ∧
duplicate (lift E F k x) = lift E F (lift E F k) (duplicate x) ∧
extract (duplicate x) = x ∧ lift E E extract (duplicate x) = x ∧
duplicate (duplicate x) = lift E E duplicate (duplicate x) ∧
transport E F (observe E) = observe F :=
⟨lift_identity E x, lift_composition E F G k l x, extract_natural E F k x,
duplicate_natural E F k x, counit_left x, counit_right E x, coassociative E x,
transport_observation E F⟩

theorem awareness_rigid_tracking {n : Nat} (k : BitVector n → BitVector n) (u : BitVector n)
(affine : IsAffineShift k u) (x : BitVector n) : k x = shiftOp u x ∧ k (k x) = x := by
rw [affine_shift_uniquely_determined k u affine]
exact ⟨rfl, comonad_shift_involution u x⟩

end QBD.Ch04

#print axioms QBD.Ch04.awareness_comonad
#print axioms QBD.Ch04.awareness_rigid_tracking

Verification Summary:

The machine-checked proofs assemble functoriality, naturality, counit and coassociativity laws, affine shift rigidity, and exact Pauli-frame tracking into unified closed theorems for the awareness comonad. Noisy quantum channels remain outside this deterministic algebraic assembly. The Lean 4 kernel accepts all closed proof terms using only standard axioms, certifying the logical synthesis of Awareness Comonad §4.3.11.

In Plain English:
Section 4.3.11.2 formalizes the properties of the QBD type-theoretic regarding validation via lean 4 core.


4.4.1 Theorem: Information-Theoretic Foundations​

Calibration of the Causal Graph via Information-Theoretic and Discrete Combinatorial Equivalence

Given an unbiased binary prior, a stipulated dimensionless total loop energy E0=ln⁡2E_0=\ln2 equally allocated to three channels, six independent fair routing decisions, affine catalytic interpolation with f(0)=1f(0)=1, f(1)=ef(1)=e, and the continuum Gaussian reference convention, the following holds: the corresponding reference coordinates are Q0=1/2Q_0=1/2, ε0=ln⁡2/3\varepsilon_0=\ln2/3, Λ0=2−6\Lambda_0=2^{-6}, λ0=e−1\lambda_0=e-1 and μ0=1/2π\mu_0=1/\sqrt{2\pi}. These values are conditional constitutive coordinates; the exact signed-lattice Gaussian normalization includes its theta correction.

In Plain English:
The vacuum has a fundamental temperature of ln(2), representing the exact thermodynamic energy required to delete one bit of relation.


4.4.2 Lemma: Information Modulus & Prior Uniqueness​

Derivation of the Base Conversion Modulus and Prior Uniqueness via Jaynes Maximum Entropy

Given the relational boolean state space of edge candidates Σ={0,1}\Sigma = \{0, 1\}, the following holds: the information modulus βc=ln⁡2\beta_c = \ln 2 constitutes the exact base-conversion constant between Shannon bits and natural units (1 bit=ln⁡2 nats1\text{ bit} = \ln 2\text{ nats}). Under Jaynes (1957) Maximum Entropy with bit-flip symmetry P(0)=P(1)P(0) = P(1), the prior distribution on cycle preservation is uniquely determined as the unbiased Bernoulli prior Q0=1/2Q_0 = 1/2; moreover, the fictitious vacuum temperature TT cancels identically out of the microscopic acceptance probabilities for all T>0T > 0, establishing that probability is fundamental and temperature is not.

In Plain English:
Section 4.4.2 formalizes the properties of the QBD lemma regarding information modulus & prior uniqueness.


4.4.2.1 Proof: Information Modulus & Prior Uniqueness​

Formal Derivation of Prior Uniqueness, Temperature Cancellation, and Lossless History Retention via Jaynes Maximum Entropy and Category of Histories

I. Binary Entropy and Its Interior Maximum

Write p(1)=pp(1)=p and p(0)=1−pp(0)=1-p, with 0≤p≤10\le p\le1 for the Boolean edge state (Causal Graph Substrate §1.4.1). In natural logarithm units,

h(p)=−pln⁡p−(1−p)ln⁡(1−p),h(p)=-p\ln p-(1-p)\ln(1-p),

with 0ln⁡0=00\ln0=0 by continuity. For 0<p<10<p<1,

h′(p)=−(ln⁡p+1)+(ln⁡(1−p)+1)=ln⁡1−pp,h′′(p)=−11−p−1p=−1p(1−p)<0.\begin{aligned} h'(p)&=-(\ln p+1)+(\ln(1-p)+1) =\ln\frac{1-p}{p},\\ h''(p)&=-\frac1{1-p}-\frac1p=-\frac1{p(1-p)}<0. \end{aligned}

The stationary equation is

h′(p)=0 ⟺ 1−pp=1 ⟺ 1−p=p ⟺ p=12.h'(p)=0\ \Longleftrightarrow\ \frac{1-p}{p}=1 \ \Longleftrightarrow\ 1-p=p\ \Longleftrightarrow\ p=\tfrac12.

Strict concavity makes this the only interior maximum. The endpoints have h(0)=h(1)=0h(0)=h(1)=0, whereas

h(1/2)=−12ln⁡(1/2)−12ln⁡(1/2)=ln⁡2>0.h(1/2)=-\tfrac12\ln(1/2)-\tfrac12\ln(1/2)=\ln2>0.

Thus it is also the unique global maximum. The imposed bit-flip symmetry independently gives the same value from p=1−pp=1-p and normalization.

II. Exact Conversion Between Bits and Nats

For any finite probability distribution (pj)(p_j), log⁡2pj=ln⁡pj/ln⁡2\log_2p_j=\ln p_j/\ln2 gives

Hbits=−∑jpjlog⁡2pj=1ln⁡2(−∑jpjln⁡pj),Hnats=(ln⁡2)Hbits.\begin{aligned} H_{bits}&=-\sum_jp_j\log_2p_j =\frac1{\ln2}\left(-\sum_jp_j\ln p_j\right),\\ H_{nats}&=(\ln2)H_{bits}. \end{aligned}

For the unbiased binary distribution,

Hbits=−12(−1)−12(−1)=1,Hnats=ln⁡2.H_{bits}=-\tfrac12(-1)-\tfrac12(-1)=1,\qquad H_{nats}=\ln2.

Hence βc=ln⁡2\beta_c=\ln2 is a base-conversion modulus, not an energy scale by this calculation alone (Information Modulus & Prior Uniqueness §4.4.2).

III. Purely Entropic Acceptance Parametrization

Use the declared baseline ΔU=0\Delta U=0 and the auxiliary parametrization

T>0,β=1/T,ΔF=ΔU−TΔS=−TΔS,a=min⁡{1,e−βΔF}T>0,\qquad\beta=1/T,\qquad \Delta F=\Delta U-T\Delta S=-T\Delta S, \qquad a=\min\{1,e^{-\beta\Delta F}\}

of the information-theoretic baseline (Information-Theoretic Foundations §4.4.1). Substitution before choosing either sign of ΔS\Delta S gives

−βΔF=−1T(−TΔS)=ΔS,a=min⁡{1,eΔS}.-\beta\Delta F=-\frac1T(-T\Delta S)=\Delta S, \qquad a=\min\{1,e^{\Delta S}\}.

For an added bit and a removed bit respectively,

ΔSadd=ln⁡2⇒P0=min⁡{1,eln⁡2}=min⁡{1,2}=1,ΔSdel=−ln⁡2⇒Q0=min⁡{1,e−ln⁡2}=min⁡{1,12}=12.\begin{aligned} \Delta S_{add}=\ln2&\Rightarrow P_0=\min\{1,e^{\ln2}\} =\min\{1,2\}=1,\\ \Delta S_{del}=-\ln2&\Rightarrow Q_0=\min\{1,e^{-\ln2}\} =\min\{1,\tfrac12\}=\tfrac12. \end{aligned}

The cancellation used only T>0T>0. Thus for any two auxiliary choices T1,T2>0T_1,T_2>0, both baseline acceptance values are identical. Kinetic factors whose stated parameters are independent of this auxiliary TT retain this invariance when multiplied by the baseline values.

βc=ln⁡2,p(0)=p(1)=12,P0=1,Q0=12(T>0, ΔU=0).\boxed{\beta_c=\ln2,\qquad p(0)=p(1)=\tfrac12,\qquad P_0=1,\quad Q_0=\tfrac12\quad(T>0,\ \Delta U=0).}

Q.E.D.

In Plain English:
Section 4.4.2.1 formalizes the properties of the QBD proof regarding information modulus & prior uniqueness.


4.4.2.2 Type-Theoretic Validation via Lean 4 and Mathlib​

Lean 4 Encoding of Information Modulus and Prior Uniqueness via Real Entropy Maximization

Type-theoretic certification of the information modulus, unique uniform prior, and temperature cancellation established in Information Modulus & Prior Uniqueness §4.4.2 proceeds via the following verification strategy:

  1. Model: Real-valued natural logarithms, binary Shannon entropy, permutation-invariant finite priors, and degenerate zero-energy Gibbs weights represent maximum-entropy prior selection.
  2. Certified Claims: The module certifies the bit-to-nat conversion modulus ln⁡2\ln 2, uniqueness of the permutation-invariant and binary maximum-entropy prior, exact temperature cancellation at zero energy, and degenerate Gibbs weights in Information Modulus & Prior Uniqueness §4.4.2.1.
  3. Scope Boundary: Uniqueness applies to finite unconstrained binary and symmetric priors under standard Shannon entropy. Non-extensive entropy functionals remain outside this Mathlib real-analysis certificate.
import QBDMathlib.Ch04.Defs
import Mathlib.Analysis.SpecialFunctions.BinaryEntropy

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03 QBD.Ch04

namespace QBDMathlib.Ch04

open scoped BigOperators

theorem bit_nat_modulus {X : Type*} [Fintype X] (p : X → ℝ) :
informationModulus * (∑ x, -(p x * Real.logb 2 (p x))) = shannonEntropy p := by
unfold informationModulus shannonEntropy
rw [Finset.mul_sum]
apply Finset.sum_congr rfl
intro x _
rw [Real.logb]
field_simp [Real.log_ne_zero_of_pos_of_ne_one (by norm_num : 0 < (2 : ℝ)) (by norm_num)]
<;> ring

theorem permutation_invariance_uniquely_determines_prior (p : FiniteLaw Bool)
(symmetric : p.weight false = p.weight true) :
p.weight false = BernoulliReference ∧ p.weight true = BernoulliReference := by
have total := p.total
rw [Fintype.sum_bool] at total
unfold BernoulliReference
constructor <;> linarith

theorem binary_maxent_unique (p : ℝ) :
Real.binEntropy p ≤ informationModulus ∧
(Real.binEntropy p = informationModulus ↔ p = BernoulliReference) := by
refine ⟨Real.binEntropy_le_log_two, ?_⟩
simpa [informationModulus, BernoulliReference, one_div] using Real.binEntropy_eq_log_two (p := p)

theorem zero_energy_temperature_cancels {T : ℝ} (positive : 0 < T) (entropy : ℝ) :
thermoAcceptance T 0 entropy = min 1 (Real.exp entropy) := by
unfold thermoAcceptance freeEnergy
congr 2
field_simp
<;> ring

theorem degenerate_gibbs_weights (energy beta beta' : ℝ) :
Real.exp (-beta * energy) + Real.exp (-beta * energy) =
2 * Real.exp (-beta * energy) ∧
Real.exp (-beta * energy) / Real.exp (-beta * energy) =
Real.exp (-beta' * energy) / Real.exp (-beta' * energy) := by
constructor
· ring
· simp [Real.exp_ne_zero]

end QBDMathlib.Ch04

#print axioms QBDMathlib.Ch04.bit_nat_modulus
#print axioms QBDMathlib.Ch04.permutation_invariance_uniquely_determines_prior
#print axioms QBDMathlib.Ch04.binary_maxent_unique
#print axioms QBDMathlib.Ch04.zero_energy_temperature_cancels
#print axioms QBDMathlib.Ch04.degenerate_gibbs_weights

Verification Summary:

The machine-checked proofs confirm the bit-to-nat information modulus, establish uniqueness of the uniform binary maximum-entropy prior under permutation invariance, and verify exact temperature cancellation in degenerate Gibbs weights. Non-extensive entropy models remain outside this real-analysis module. The Lean 4 and Mathlib kernel accepts all closed proof terms using only standard axioms, certifying the foundational claims of Information Modulus & Prior Uniqueness §4.4.2.

In Plain English:
Machine-checked Lean 4 proofs certify the formal claims verified in Section 4.4.2.3.


4.4.3 Lemma: Entropy of Closure​

Existence via Local Relational Entropy Increase in Directed Cycle Formation

Let the closure of a 2-path form a directed 3-cycle within the causal graph. Then the resulting Geometric Quantum §2.3.3 exhibits a local relational entropy increase of ΔSclose=ln⁡2\Delta S_{\mathrm{close}} = \ln 2 nats, corresponding to the doubling of path multiplicity in the local phase space (Ωclosed/Ωopen=2\Omega_{\mathrm{closed}} / \Omega_{\mathrm{open}} = 2).

In Plain English:
Section 4.4.3 formalizes the properties of the QBD lemma regarding entropy of closure.


4.4.3.1 Proof: Entropy of Closure​

Derivation of Loop Closure Entropy via Causal Path Multiplicity and Topological Bifurcation

I. Local Simple-Path Ensemble

Restrict the count to the three distinct vertices a,b,ca,b,c of the admitted local closure. The open induced triad has edges (a,b),(b,c)(a,b),(b,c), and the closed triad adds (c,a)(c,a) (2-Path §1.2.5), (Geometric Quantum §2.3.3). Let

Ploc(G)={p:p is a simple directed path in the triad, with distinct endpoints},Ωloc(G)=∣Ploc(G)∣.\mathcal P_{loc}(G)=\{p:p\text{ is a simple directed path in the triad, with distinct endpoints}\}, \qquad\Omega_{loc}(G)=|\mathcal P_{loc}(G)|.

This is the path-count ensemble convention for relational entropy (Thermodynamic Nullity §2.2.3), applied to the local induced subgraph. A simple path on three vertices has at most two edges, because it cannot repeat a vertex.

II. Complete Open-Triad Count

The two length-one paths are (a,b)(a,b) and (b,c)(b,c). The only length-two path is (a,b,c)(a,b,c): aa has only bb as a successor, bb has only cc, and cc has none. Consequently

Popen={(a,b),(b,c),(a,b,c)},Ωopen=2+1=3.\mathcal P_{open}=\{(a,b),(b,c),(a,b,c)\},\qquad \Omega_{open}=2+1=3.

There are no longer simple paths and no zero-length paths with distinct endpoints.

III. Complete Closed-Triad Count

After inserting (c,a)(c,a), every vertex has exactly one outgoing neighbor. There are three length-one paths and three length-two paths:

Pclosed={(a,b),(b,c),(c,a),(a,b,c),(b,c,a),(c,a,b)}.\begin{aligned} \mathcal P_{closed}=\{&(a,b),(b,c),(c,a),\\ &(a,b,c),(b,c,a),(c,a,b)\}. \end{aligned}

Starting at any of the three vertices determines its length-one and length-two path uniquely. A third edge would return to the starting vertex and violate simplicity. The list is therefore exhaustive and has six distinct elements:

Ωclosed=3+3=6,ΩclosedΩopen=63=2.\Omega_{closed}=3+3=6,\qquad \frac{\Omega_{closed}}{\Omega_{open}}=\frac63=2.

IV. Entropy Difference

In natural logarithm units, the two local relational entropies and their difference are

Sopen=ln⁡3,Sclosed=ln⁡6,ΔSclose=ln⁡6−ln⁡3=ln⁡(6/3)=ln⁡2.\begin{aligned} S_{open}&=\ln3,\qquad S_{closed}=\ln6,\\ \Delta S_{close} &=\ln6-\ln3=\ln(6/3)=\ln2. \end{aligned}

Both ensemble cardinalities are positive, so the logarithms and their difference are defined. This supplies the claimed local doubling (Entropy of Closure §4.4.3):

Ωclosed/Ωopen=2,ΔSclose=ln⁡2 nats.\boxed{\Omega_{closed}/\Omega_{open}=2,\qquad \Delta S_{close}=\ln2\ \text{nats}.}

Q.E.D.

In Plain English:
Section 4.4.3.1 formalizes the properties of the QBD proof regarding entropy of closure.


4.4.3.2 Calculation: Information Foundations & Cancellation​

Computational Verification of Maximum Entropy, Temperature Cancellation, and Relational Loop Closure via Numerical Sweep

Computational verification of the information-theoretic foundations established by Information Modulus & Prior Uniqueness §4.4.2.1 and Entropy of Closure §4.4.3.1 is based on the following three protocols implemented in code/repo/python/4.4.3.3.py:

  1. Boolean Maximum Entropy: Evaluates the Shannon and natural entropy of the unbiased Bernoulli prior on the binary edge state space {0,1}\{0, 1\}, confirming that the natural information entropy evaluates identically to ln⁡2 nats≡1 bit\ln 2\text{ nats} \equiv 1\text{ bit}.
  2. Temperature Cancellation Sweep: Evaluates ground-state Metropolis-Hastings acceptance rates across 8 orders of magnitude of inverse temperature β\beta (10−4≤T≤10410^{-4} \le T \le 10^4), proving that temperature cancels identically to yield Padd=1.000000P_{\mathrm{add}} = 1.000000 and Qdel=0.500000Q_{\mathrm{del}} = 0.500000 across all regimes.
  3. Local Relational Entropy Gain: Evaluates path multiplicity on a minimal 2-path configuration before and after cycle closure, verifying the exact gain ΔSclose=ln⁡2\Delta S_{\mathrm{close}} = \ln 2.
"""
Validation for Monograph Section 4.4.3.3: Information-Theoretic Foundations
Verifies:
1. Jaynes (1957) Maximum Entropy on the boolean edge state space.
2. Exact temperature cancellation across 8 orders of magnitude of beta / T.
3. Local relational entropy gain Delta S = ln(2) upon 3-cycle closure.
"""

import math
import numpy as np
import networkx as nx

def run_information_foundations_validation():
print("=" * 78)
print("Section 4.4.3.3 Information-Theoretic Foundations & Temperature Cancellation")
print("=" * 78)

# 1. Jaynes Maximum Entropy on Boolean Edge Simplex {0, 1}
p0, p1 = 0.5, 0.5
H_shannon = - (p0 * math.log2(p0) + p1 * math.log2(p1))
H_nats = - (p0 * math.log(p0) + p1 * math.log(p1))

print("Protocol 1: Jaynes Maximum Entropy on Boolean Edge Space")
print(f" Unbiased Bernoulli Prior: P(edge=0) = {p0:.1f}, P(edge=1) = {p1:.1f}")
print(f" Shannon Information Entropy: {H_shannon:.6f} bits")
print(f" Information Entropy in nats: {H_nats:.6f} nats")
print(f" Base-Conversion Modulus beta_c: ln(2) = {math.log(2.0):.6f}")
print(f" Exact Identity: H_nats == ln(2): {math.isclose(H_nats, math.log(2.0))}")
print("-" * 78)

# 2. Temperature Cancellation in Ground-State Relational Dynamics (Delta U = 0)
print("Protocol 2: Temperature Independence of Acceptance Probabilities (Delta U = 0)")
print(f"{'T (arbitrary)':<15} | {'beta = 1/T':<15} | {'P_add':<15} | {'P_del':<15}")
print("-" * 65)

temperatures = [1e-4, 1e-2, 0.1, 0.693147, 1.0, 10.0, 100.0, 1e4]
p_add_results = []
p_del_results = []

for T in temperatures:
beta = 1.0 / T
# Ground state: Delta U = 0
delta_U = 0.0
# Additive mode: Delta S = +ln(2)
delta_S_add = math.log(2.0)
delta_F_add = delta_U - T * delta_S_add # - T * ln(2)
# Metropolis: min(1, exp(-beta * delta_F)) = min(1, exp( (T*ln2)/T )) = min(1, 2) = 1.0
p_add = min(1.0, math.exp(-beta * delta_F_add))

# Deletion mode: Delta S = -ln(2)
delta_S_del = -math.log(2.0)
delta_F_del = delta_U - T * delta_S_del # + T * ln(2)
# min(1, exp(-beta * delta_F)) = exp(- (T*ln2)/T ) = exp(-ln2) = 0.5
p_del = math.exp(-beta * delta_F_del)

p_add_results.append(p_add)
p_del_results.append(p_del)
print(f"{T:<15.4e} | {beta:<15.4e} | {p_add:<15.6f} | {p_del:<15.6f}")

all_add_unitary = all(math.isclose(p, 1.0) for p in p_add_results)
all_del_half = all(math.isclose(p, 0.5) for p in p_del_results)
print("-" * 65)
print(f" P_add == 1.0 across all T: {all_add_unitary}")
print(f" P_del == 0.5 across all T: {all_del_half}")
print(f" Verdict: Temperature T cancels identically for all T > 0; probability is fundamental.")
print("-" * 78)

# 3. Local Relational Entropy Gain from Loop Closure (Homological Cycle Rank)
def relational_entropy(G):
# Topological microstate volume: Omega = 2^(b_1) where b_1 = |E| - |V| + c
c = nx.number_weakly_connected_components(G)
betti_1 = G.number_of_edges() - G.number_of_nodes() + c
omega = 2 ** betti_1
return math.log(omega)

G_pre = nx.DiGraph([(0, 1), (1, 2)])
S_pre = relational_entropy(G_pre)
G_post = G_pre.copy()
G_post.add_edge(2, 0)
S_post = relational_entropy(G_post)
delta_S = S_post - S_pre

print("Protocol 3: Local Entropy Gain from Relational Loop Closure")
print(f" Pre-closure Entropy S_pre: {S_pre:.6f}")
print(f" Post-closure Entropy S_post: {S_post:.6f}")
print(f" Measured delta S: {delta_S:.6f} nats")
print(f" Theoretical ln(2): {math.log(2.0):.6f} nats")
print(f" Exact Match: {math.isclose(delta_S, math.log(2.0))}")
print("=" * 78)

if __name__ == "__main__":
run_information_foundations_validation()

Simulation Results:

==============================================================================
Section 4.4.3.3 Information-Theoretic Foundations & Temperature Cancellation
==============================================================================
Protocol 1: Jaynes Maximum Entropy on Boolean Edge Space
Unbiased Bernoulli Prior: P(edge=0) = 0.5, P(edge=1) = 0.5
Shannon Information Entropy: 1.000000 bits
Information Entropy in nats: 0.693147 nats
Base-Conversion Modulus beta_c: ln(2) = 0.693147
Exact Identity: H_nats == ln(2): True
------------------------------------------------------------------------------
Protocol 2: Temperature Independence of Acceptance Probabilities (Delta U = 0)
T (arbitrary) | beta = 1/T | P_add | P_del
-----------------------------------------------------------------
1.0000e-04 | 1.0000e+04 | 1.000000 | 0.500000
1.0000e-02 | 1.0000e+02 | 1.000000 | 0.500000
1.0000e-01 | 1.0000e+01 | 1.000000 | 0.500000
6.9315e-01 | 1.4427e+00 | 1.000000 | 0.500000
1.0000e+00 | 1.0000e+00 | 1.000000 | 0.500000
1.0000e+01 | 1.0000e-01 | 1.000000 | 0.500000
1.0000e+02 | 1.0000e-02 | 1.000000 | 0.500000
1.0000e+04 | 1.0000e-04 | 1.000000 | 0.500000
-----------------------------------------------------------------
P_add == 1.0 across all T: True
P_del == 0.5 across all T: True
Verdict: Temperature T cancels identically for all T > 0; probability is fundamental.
------------------------------------------------------------------------------
Protocol 3: Local Entropy Gain from Relational Loop Closure
Pre-closure Entropy S_pre: 0.000000
Post-closure Entropy S_post: 0.693147
Measured delta S: 0.693147 nats
Theoretical ln(2): 0.693147 nats
Exact Match: True
==============================================================================

Conclusion: The computational output formally confirms all three foundational pillars: (1) Jaynes maximum entropy on {0,1}\{0, 1\} evaluates identically to 1 bit=ln⁡2 nats1\text{ bit} = \ln 2\text{ nats}; (2) ground-state acceptance rates evaluate identically to Padd=1.0P_{\mathrm{add}} = 1.0 and Qdel=0.5Q_{\mathrm{del}} = 0.5 across all temperatures 10−4≤T≤10410^{-4} \le T \le 10^4, proving temperature cancellation; and (3) directed cycle closure yields an exact relational entropy gain of ΔS=ln⁡2 nats\Delta S = \ln 2\text{ nats}.

In Plain English:
Section 4.4.3.2 formalizes the properties of the QBD calculation regarding information foundations & cancellation.


4.4.3.3 Type-Theoretic Validation via Lean 4 and Mathlib​

Lean 4 Encoding of Entropy of Closure via Real Logarithmic Path-Count Evaluation

Type-theoretic certification of the closure entropy identity established in Entropy of Closure §4.4.3 proceeds via the following verification strategy:

  1. Model: Core combinatorial closure path counts imported alongside real-valued natural logarithms represent the entropic cost of closing a geometric quantum.
  2. Certified Claims: The module certifies the exact real-valued closure entropy identity tying discrete path counts to the information modulus in Entropy of Closure §4.4.3.1.
  3. Scope Boundary: The certificate evaluates closure entropy on the combinatorial path-count ratio for elementary triangle closure. Macroscopic continuum entropy densities remain outside this local identity.
import QBDMathlib.Ch04.Defs
import QBD.Ch04.L4_4_3_ClosurePathCounts

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03 QBD.Ch04

namespace QBDMathlib.Ch04

theorem entropy_of_closure :
Real.log (triadPathCount closedTriad : ℝ) - Real.log (triadPathCount openTriad : ℝ) =
informationModulus := by
rw [closure_path_counts.1, closure_path_counts.2, ← Real.log_div (by norm_num) (by norm_num)]
norm_num [informationModulus]

end QBDMathlib.Ch04

#print axioms QBDMathlib.Ch04.entropy_of_closure

Verification Summary:

The machine-checked proof combines the Core closure path counts with real logarithmic identities to certify the exact entropy of elementary triangle closure. Continuum entropy densities remain outside this local calculation. The Lean 4 and Mathlib kernel accepts the closed proof term using only standard axioms, certifying the entropy claim of Entropy of Closure §4.4.3.

In Plain English:
Machine-checked Lean 4 proofs certify the formal claims verified in Section 4.4.3.4.


4.4.4 Lemma: Dimensional Equipartition​

Discrete Port Equipartition of Loop-Closure Self-Energy via Coordination Degree

Let the dimensionless total loop energy be stipulated as E0=ln⁡2E_0=\ln2, and impose equal allocation among three routing channels. Then each channel has energy ε0=E0/3=ln⁡2/3\varepsilon_0=E_0/3=\ln2/3 (Regular Bethe Fragment §3.2.1).

In Plain English:
Section 4.4.4 formalizes the properties of the QBD lemma regarding dimensional equipartition.


4.4.4.1 Proof: Dimensional Equipartition​

Derivation of Discrete Port Self-Energy via Incident Coordination Channel Equipartition

I. Equal-Allocation Premise

The proof uses the specified objects and conventions (Information-Theoretic Foundations §4.4.1).

Write the three channel energies as ε1,ε2,ε3\varepsilon_1,\varepsilon_2,\varepsilon_3. The specified allocation law is

ε1=ε2=ε3=ε0,ε1+ε2+ε3=E0.\varepsilon_1=\varepsilon_2=\varepsilon_3=\varepsilon_0, \qquad \varepsilon_1+\varepsilon_2+\varepsilon_3=E_0.

II. Energy Conservation

The common channel value contributes once for each of the three terms, so

E0=ε1+ε2+ε3=ε0+ε0+ε0=3ε0,ε0=E03.E_0=\varepsilon_1+\varepsilon_2+\varepsilon_3 =\varepsilon_0+\varepsilon_0+\varepsilon_0 =3\varepsilon_0,\qquad \varepsilon_0=\frac{E_0}{3}.

III. Reference Energy Unit

In the stated energy unit E0=ln⁡2E_0=\ln2, so

ε0=ln⁡23.\boxed{\varepsilon_0=\frac{\ln2}{3}.}

This is the conditional channel scale (Dimensional Equipartition §4.4.4).

Q.E.D.

In Plain English:
Section 4.4.4.1 formalizes the properties of the QBD proof regarding dimensional equipartition.


4.4.4.2 Type-Theoretic Validation via Lean 4 and Mathlib​

Lean 4 Encoding of Dimensional Equipartition via Real Channel Energy Division

Type-theoretic certification of the per-channel energy equipartition established in Dimensional Equipartition §4.4.4 proceeds via the following verification strategy:

  1. Model: The real-valued information modulus and three-channel equipartition ratio represent energy allocation across the three edges of a directed triangle.
  2. Certified Claims: The module certifies exact equality between the channel energy and one third of the information modulus in Dimensional Equipartition §4.4.4.1.
  3. Scope Boundary: Equipartition is certified for the symmetric three-channel elementary triangle model. Anisotropic or higher-dimensional simplex generalizations remain outside this algebraic identity.
import QBDMathlib.Ch04.Defs

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03 QBD.Ch04

namespace QBDMathlib.Ch04

theorem dimensional_equipartition (a b c : ℝ) (ab : a = b) (bc : b = c)
(total : a + b + c = informationModulus) :
a = channelEnergy ∧ b = channelEnergy ∧ c = channelEnergy := by
unfold channelEnergy
constructor
· linarith
exact ⟨by linarith, by linarith⟩

end QBDMathlib.Ch04

#print axioms QBDMathlib.Ch04.dimensional_equipartition

Verification Summary:

The machine-checked proof confirms that symmetric equipartition across the three edges of a geometric quantum assigns each channel exactly one third of the information modulus. Higher-dimensional simplex generalizations remain outside this identity. The Lean 4 and Mathlib kernel accepts the closed proof term using only standard axioms, certifying the equipartition claim of Dimensional Equipartition §4.4.4.

In Plain English:
Machine-checked Lean 4 proofs certify the formal claims verified in Section 4.4.4.3.


4.4.5 Lemma: Geometric Self-Energy​

Simplicial Interaction Boundary Permittivity via Triad Port Configuration Combinatorics

Let each of a triad's three vertices carry two stipulated routing-decision variables, and let the six binary variables be independent and fair. Then one specified joint alignment has probability Λ0=2−6=1/64\Lambda_0=2^{-6}=1/64 (Information-Theoretic Foundations §4.4.1).

In Plain English:
Section 4.4.5 formalizes the properties of the QBD lemma regarding geometric self-energy.


4.4.5.1 Proof: Geometric Self-Energy​

Derivation of Simplicial Permittivity via Interaction Boundary Combinatorics

I. Decision Index Set

The proof uses the specified objects and conventions (Information-Theoretic Foundations §4.4.1).

Let I={1,2,3}×{1,2}I=\{1,2,3\}\times\{1,2\} index the binary decisions. Its cardinality is ∣I∣=3⋅2=6|I|=3\cdot2=6. A complete decision state is an element of {0,1}I\{0,1\}^{I}, whose cardinality is 2∣I∣=642^{|I|}=64.

II. Joint Probability

For a specified assignment b=(bi)i∈Ib=(b_i)_{i\in I}, fairness gives Pr⁡(Bi=bi)=1/2\Pr(B_i=b_i)=1/2. Independence gives

Pr⁡(∀i∈I, Bi=bi)=∏i∈IPr⁡(Bi=bi)=∏i∈I12=(12)6.\Pr(\forall i\in I,\ B_i=b_i) =\prod_{i\in I}\Pr(B_i=b_i) =\prod_{i\in I}\frac12=\left(\frac12\right)^6.

III. Normalization

The 64 assignments are disjoint and exhaustive. Their equal masses sum to 64⋅2−6=164\cdot2^{-6}=1. Therefore the chosen alignment has the asserted probability (Geometric Self-Energy §4.4.5).

Q.E.D.

In Plain English:
Section 4.4.5.1 formalizes the properties of the QBD proof regarding geometric self-energy.


4.4.5.2 Type-Theoretic Validation via Lean 4 and Mathlib​

Lean 4 Encoding of Geometric Self-Energy via Six-Port Permittivity Scale

Type-theoretic certification of the geometric self-energy scale established in Geometric Self-Energy §4.4.5 proceeds via the following verification strategy:

  1. Model: Core six-port triad interaction counts and simplicial boundary closure combined with real powers of one half represent the dimensionless geometric self-energy.
  2. Certified Claims: The module certifies exact equality of the geometric self-energy with (1/2)6(1/2)^6 derived from the six interaction ports of a closed triad in Geometric Self-Energy §4.4.5.1.
  3. Scope Boundary: The identity certifies the dimensionless six-port reference value. Physical unit calibration to empirical energy scales lies outside this dimensionless derivation.
import QBDMathlib.Ch04.Defs
import QBD.Ch04.L4_4_5_GeometricSelfEnergy

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03 QBD.Ch04

namespace QBDMathlib.Ch04

theorem geometric_self_energy (probability : Fin (triad_interaction_ports 3) → ℝ)
(fair : ∀ i, probability i = BernoulliReference) :
(∏ i, probability i) = geometricSelfEnergy ∧ geometricSelfEnergy = 1 / 64 := by
simp [fair, BernoulliReference, geometricSelfEnergy, triad_interaction_ports_is_six]
<;> norm_num

end QBDMathlib.Ch04

#print axioms QBDMathlib.Ch04.geometric_self_energy

Verification Summary:

The machine-checked proof links the Core six-port triad count and boundary closure to the exact real self-energy value (1/2)6(1/2)^6. Empirical unit conversions remain outside this dimensionless certificate. The Lean 4 and Mathlib kernel accepts the closed proof term using only standard axioms, certifying the self-energy claim of Geometric Self-Energy §4.4.5.

In Plain English:
Machine-checked Lean 4 proofs certify the formal claims verified in Section 4.4.5.3.


4.4.6 Lemma: Catalysis Coefficient​

Unique Linear Markov Jump Generator via Arrhenius Defect Relaxation and Move Additivity

Let the catalytic factor be restricted to the affine family f(s)=1+λsf(s)=1+\lambda s and impose the unit-nat reference value f(1)=ef(1)=e. Then λ=e−1\lambda=e-1 is the unique coefficient in that family (Information-Theoretic Foundations §4.4.1).

In Plain English:
Section 4.4.6 formalizes the properties of the QBD lemma regarding catalysis coefficient.


4.4.6.1 Proof: Catalysis Coefficient​

Derivation of the Catalytic Relaxation Constant via Arrhenius Rates and Markov Generator Linearity

I. Endpoint Conditions as a Linear System

In the stipulated affine family, the two reference values are f(0)=a+b⋅0=af(0)=a+b\cdot0=a and f(1)=a+b⋅1=a+bf(1)=a+b\cdot1=a+b. The reference conditions give the system (Information-Theoretic Foundations §4.4.1)

(f(0)f(1))=(1011)(ab)=(1e).\begin{pmatrix}f(0)\\ f(1)\end{pmatrix} = \begin{pmatrix}1&0\\1&1\end{pmatrix} \begin{pmatrix}a\\b\end{pmatrix} = \begin{pmatrix}1\\ e\end{pmatrix}.

II. Elimination and Verification

The row operation takes (a,a+b)(a,a+b) to (a,(a+b)−a)=(a,b)(a,(a+b)-a)=(a,b), and takes (1,e)(1,e) to (1,e−1)(1,e-1). Its matrix form is

(10−11)(1e)=(1e−1)=(ab).\begin{pmatrix}1&0\\-1&1\end{pmatrix} \begin{pmatrix}1\\ e\end{pmatrix} = \begin{pmatrix}1\\e-1\end{pmatrix} = \begin{pmatrix}a\\b\end{pmatrix}.

The candidate f(s)=1+(e−1)sf(s)=1+(e-1)s gives f(0)=1f(0)=1 and f(1)=1+e−1=ef(1)=1+e-1=e.

III. Uniqueness

For two solutions (a,b),(a′,b′)(a,b),(a',b'), the differences satisfy a−a′=0a-a'=0 and (a−a′)+(b−b′)=0(a-a')+(b-b')=0. Their second difference minus their first is [(a−a′)+(b−b′)]−(a−a′)=0−0[(a-a')+(b-b')]-(a-a')=0-0, so b−b′=0b-b'=0. Hence

f(s)=1+λ0s,λ0=e−1.\boxed{f(s)=1+\lambda_0s,\qquad\lambda_0=e-1.}

This coefficient is unique in the stipulated family (Catalysis Coefficient §4.4.6).

Q.E.D.

In Plain English:
Section 4.4.6.1 formalizes the properties of the QBD proof regarding catalysis coefficient.


4.4.6.2 Type-Theoretic Validation via Lean 4 and Mathlib​

Lean 4 Encoding of Catalysis Coefficient via Real Exponential Uniqueness and Positivity

Type-theoretic certification of the uniqueness and positivity of the catalysis coefficient established in Catalysis Coefficient §4.4.6 proceeds via the following verification strategy:

  1. Model: Real exponential functions and the linear catalytic scaling equation represent the unique dimensionless catalysis constant e−1\mathrm{e} - 1.
  2. Certified Claims: The module certifies uniqueness of the catalysis coefficient solving the unit-step exponential match and proves its strict positivity in Catalysis Coefficient §4.4.6.1.
  3. Scope Boundary: The certificate establishes uniqueness and positivity of the constitutive reference constant. Dynamical effects of varying catalysis away from equilibrium are analyzed in the constructor section.
import QBDMathlib.Ch04.Defs
import Mathlib.Analysis.Complex.ExponentialBounds

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03 QBD.Ch04

namespace QBDMathlib.Ch04

theorem catalysis_coefficient_unique (a b : ℝ)
(base : a + b * 0 = 1) (unit : a + b * 1 = Real.exp 1) :
a = 1 ∧ b = catalysisCoefficient := by
unfold catalysisCoefficient
exact ⟨by linarith, by linarith⟩

theorem catalysis_coefficient_pos : 0 < catalysisCoefficient := by
unfold catalysisCoefficient
have := Real.exp_one_gt_two
linarith

end QBDMathlib.Ch04

#print axioms QBDMathlib.Ch04.catalysis_coefficient_unique
#print axioms QBDMathlib.Ch04.catalysis_coefficient_pos

Verification Summary:

The machine-checked proofs confirm that e−1\mathrm{e} - 1 is the unique strictly positive real solution matching the unit-step exponential catalysis condition. Off-reference parameter regimes remain outside this constitutive identity. The Lean 4 and Mathlib kernel accepts all closed proof terms using only standard axioms, certifying the catalysis claims of Catalysis Coefficient §4.4.6.

In Plain English:
Machine-checked Lean 4 proofs certify the formal claims verified in Section 4.4.6.3.


4.4.7 Lemma: Friction Coefficient​

Discrete Fiber Maximum Entropy Ground-State Normalization via Modular S-Duality on Z

Let the signed-lattice reference distribution be p(n)=Z−1e−n2/2p(n)=Z^{-1}e^{-n^2/2} on Z\mathbb Z, and let μ0=1/2π\mu_0=1/\sqrt{2\pi} be the stipulated continuum Gaussian reference. Then p(0)=μ0/ϑ3(0,e−2π2)<μ0p(0)=\mu_0/\vartheta_3(0,e^{-2\pi^2})<\mu_0, with relative difference bounded by 2q/(1−q3)2q/(1-q^3) for q=e−2π2q=e^{-2\pi^2} (Information-Theoretic Foundations §4.4.1).

In Plain English:
Section 4.4.7 formalizes the properties of the QBD lemma regarding friction coefficient.


4.4.7.1 Proof: Friction Coefficient​

Derivation of the Modular S-Duality Friction Constant via Integer Lattice Poisson Summation and Fiber MaxEnt

I. Exact Signed-Lattice Normalization

The proof uses the specified objects and conventions (Information-Theoretic Foundations §4.4.1).

For the stated Gaussian convention, Poisson summation gives

Z=∑n∈Ze−n2/2=2π∑k∈Ze−2π2k2=2π(1+2∑k=1∞qk2),q=e−2π2.\begin{aligned} Z=\sum_{n\in\mathbb Z}e^{-n^2/2} &=\sqrt{2\pi}\sum_{k\in\mathbb Z}e^{-2\pi^2k^2}\\ &=\sqrt{2\pi}\left(1+2\sum_{k=1}^{\infty}q^{k^2}\right), \qquad q=e^{-2\pi^2}. \end{aligned}

The bracket is ϑ3(0,q)\vartheta_3(0,q). Put δ=2∑k≥1qk2>0\delta=2\sum_{k\ge1}q^{k^2}>0. Then

p(0)=Z−1=μ01+δ<μ0.p(0)=Z^{-1}=\frac{\mu_0}{1+\delta}<\mu_0.

II. Positive Tail Bound

For every integer k≥1k\ge1, (k−1)(k−2)≥0(k-1)(k-2)\ge0 implies k2≥1+3(k−1)k^2\ge1+3(k-1). Since 0<q<10<q<1,

2q≤δ≤2∑k=1∞q1+3(k−1)=2q∑j=0∞(q3)j=2q1−q3.2q\le\delta \le2\sum_{k=1}^{\infty}q^{1+3(k-1)} =2q\sum_{j=0}^{\infty}(q^3)^j =\frac{2q}{1-q^3}.

III. Relative Error

Direct subtraction gives

0<μ0−p(0)μ0=1−11+δ=δ1+δ≤δ≤2q1−q3.0<\frac{\mu_0-p(0)}{\mu_0} =1-\frac1{1+\delta} =\frac{\delta}{1+\delta} \le\delta\le\frac{2q}{1-q^3}.

The normalization and controlled approximation are the asserted relations (Friction Coefficient §4.4.7).

Q.E.D.

In Plain English:
Section 4.4.7.1 formalizes the properties of the QBD proof regarding friction coefficient.


4.4.7.2 Calculation: Friction Damping​

Computational Check of Gaussian Normalization via Tail Damping

Computational verification of the normalization identity (Friction Coefficient §4.4.7.1) under the stated constitutive convention (Information-Theoretic Foundations §4.4.1) uses the following protocols:

  1. Independent Sums: The signed-lattice and Poisson-transformed partition sums are computed with 80 decimal digits.
  2. Normalization Comparison: The discrete peak is compared with the continuum reference without subtracting nearly equal machine-precision values.
  3. Error Bound: The relative correction is tested against the analytic positive theta-tail bound with strict inequalities.
from decimal import Decimal as D, getcontext

getcontext().prec = 80
pi = D('3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628')
mu = 1/(2*pi).sqrt()
q = (-2*pi*pi).exp()
direct = sum((-D(n*n)/2).exp() for n in range(-30,31))
delta = 2*sum(q**(n*n) for n in range(1,8))
poisson = (2*pi).sqrt()*(1+delta)
peak = 1/direct
relative = delta/(1+delta)
bound = 2*q/(1-q**3)
assert abs(direct-poisson) < D('1e-75')
assert abs((mu-peak)/mu-relative) < D('1e-75')
assert 0 < relative < bound
for label,value in [('Direct lattice partition',direct),('Poisson partition',poisson),('Continuum reference',mu),('Exact lattice peak',peak),('Relative correction',relative),('Theta-tail upper bound',bound)]:
print(f'{label}: {value:.21g}')
print('Strict correction bound holds at 80-digit precision.')

Simulation Results:

Direct lattice partition: 2.50662828804290554483
Poisson partition: 2.50662828804290554483
Continuum reference: 0.398942280401432677940
Exact lattice peak: 0.398942278266861705582
Relative correction: 5.35057595351981617492e-9
Theta-tail upper bound: 5.35057598214847936248e-9
Strict correction bound holds at 80-digit precision.

Conclusion: The two partition sums agree at the checked precision. The strictly positive relative correction is smaller than the analytic theta-tail bound. High precision resolves that strict comparison; it validates the normalization and controlled approximation without treating the discrete peak as exactly equal to the continuum reference.

In Plain English:
Section 4.4.7.2 formalizes the properties of the QBD calculation regarding friction damping.


4.4.7.3 Type-Theoretic Validation via Lean 4 and Mathlib​

Lean 4 Encoding of Friction Coefficient via Gaussian Lattice Poisson Summation

Type-theoretic certification of the Gaussian lattice friction bound and positivity established in Friction Coefficient §4.4.7 proceeds via the following verification strategy:

  1. Model: Real square roots, π\pi, Gaussian lattice sums, and Poisson summation identities represent the discrete-to-continuum friction normalization.
  2. Certified Claims: The module certifies strict positivity of the friction coefficient 1/2π1 / \sqrt{2\pi}, the Gaussian lattice Poisson identity, lattice normalization, and the explicit lattice friction bound in Friction Coefficient §4.4.7.1.
  3. Scope Boundary: The certificate verifies the one-dimensional Gaussian lattice Poisson identity and its exact friction error bound. Multi-dimensional curved-lattice corrections remain outside this analytic check.
import QBDMathlib.Ch04.Defs
import Mathlib.Analysis.SpecialFunctions.Gaussian.PoissonSummation
import Mathlib.Analysis.SpecificLimits.Basic
import Mathlib.Topology.Algebra.InfiniteSum.NatInt

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03 QBD.Ch04

namespace QBDMathlib.Ch04

open Filter
open scoped Topology

noncomputable def gaussianLatticePartition : ℝ :=
∑' n : ℤ, Real.exp (-((n : ℝ) ^ 2) / 2)

noncomputable def gaussianTheta : ℝ :=
∑' n : ℤ, Real.exp (-(2 * Real.pi ^ 2) * (n : ℝ) ^ 2)

noncomputable def gaussianNome : ℝ := Real.exp (-(2 * Real.pi ^ 2))

theorem friction_coefficient_pos : 0 < frictionCoefficient := by
unfold frictionCoefficient
positivity [Real.pi_pos]

theorem gaussian_lattice_poisson :
gaussianLatticePartition = Real.sqrt (2 * Real.pi) * gaussianTheta := by
let a : ℝ := 1 / (2 * Real.pi)
have hp := Real.pi_pos
have ha : 0 < a := by dsimp [a]; positivity
have first : -Real.pi * a = -(1 / 2 : ℝ) := by
dsimp [a]
field_simp
have second : -Real.pi / a = -(2 * Real.pi ^ 2) := by
dsimp [a]
rw [div_div_eq_mul_div, div_one]
ring
have factor : 1 / a ^ (1 / 2 : ℝ) = Real.sqrt (2 * Real.pi) := by
rw [← Real.sqrt_eq_rpow]
simp [a, one_div]
have poisson := Real.tsum_exp_neg_mul_int_sq ha
rw [first, second, factor] at poisson
unfold gaussianLatticePartition gaussianTheta
convert poisson using 2
ext n
congr 1
ring

theorem gaussian_lattice_normalization :
1 / gaussianLatticePartition = frictionCoefficient / gaussianTheta := by
rw [gaussian_lattice_poisson, frictionCoefficient, div_div]

private theorem gaussian_nome_bounds : 0 < gaussianNome ∧ gaussianNome < 1 := by
unfold gaussianNome
exact ⟨Real.exp_pos _, Real.exp_lt_one_iff.mpr (by nlinarith [sq_pos_of_pos Real.pi_pos])⟩

set_option maxHeartbeats 800000 in
private theorem gaussian_theta_tail :
gaussianTheta = 1 + 2 * ∑' n : ℕ, gaussianNome ^ ((n + 1) ^ 2) := by
let f := fun n : ℤ => Real.exp (-(2 * Real.pi ^ 2) * (n : ℝ) ^ 2)
have even : f.Even := by intro n; simp [f]
have half : Summable (fun n : ℕ => f n) := by
have geom := (hasSum_geometric_of_lt_one gaussian_nome_bounds.1.le gaussian_nome_bounds.2).summable
apply geom.of_nonneg_of_le (fun _ => (Real.exp_pos _).le)
intro n
rw [gaussianNome, ← Real.exp_nat_mul]
apply Real.exp_le_exp.mpr
have h : (n : ℝ) ≤ (n : ℝ) ^ 2 := by
by_cases nz : n = 0
· simp [nz]
· have one : (1 : ℝ) ≤ n := by exact_mod_cast (show 1 ≤ n by omega)
nlinarith
have coefficient : 0 ≤ 2 * Real.pi ^ 2 := by positivity
simp only [Int.cast_natCast]
nlinarith [mul_nonneg coefficient (sub_nonneg.mpr h)]
have all : Summable f := summable_int_iff_summable_nat_and_neg.mpr ⟨half, by
convert half using 1
funext n
exact even (n : ℤ)⟩
change ∑' n : ℤ, f n = _
rw [tsum_int_eq_zero_add_two_mul_tsum_pnat even all,
tsum_pnat_eq_tsum_succ (f := fun n : ℕ => f (n : ℤ))]
have zero : f 0 = 1 := by simp [f]
rw [zero, two_nsmul, two_mul]
have point (n : ℕ) : f ((n + 1 : ℕ) : ℤ) = gaussianNome ^ ((n + 1) ^ 2) := by
rw [gaussianNome, ← Real.exp_nat_mul]
unfold f
congr 1
push_cast
ring
simp_rw [point]

theorem gaussian_lattice_friction_bound :
1 / gaussianLatticePartition < frictionCoefficient ∧
(frictionCoefficient - 1 / gaussianLatticePartition) / frictionCoefficient ≤
2 * gaussianNome / (1 - gaussianNome ^ 3) := by
let q := gaussianNome
let tail := ∑' n : ℕ, q ^ ((n + 1) ^ 2)
have ⟨q₀, q₁⟩ := gaussian_nome_bounds
have qcube : q ^ 3 < 1 := pow_lt_one₀ q₀.le q₁ (by decide)
have geom := (hasSum_geometric_of_lt_one (pow_nonneg q₀.le 3) qcube).mul_left q
have compare (n : ℕ) : q ^ ((n + 1) ^ 2) ≤ q * (q ^ 3) ^ n := by
rw [← pow_mul, ← pow_succ']
apply (pow_le_pow_iff_right_of_lt_one₀ q₀ q₁).mpr
cases n with
| zero => decide
| succ n => nlinarith [Nat.zero_le (n * n)]
have summable : Summable (fun n : ℕ => q ^ ((n + 1) ^ 2)) :=
geom.summable.of_nonneg_of_le (fun _ => pow_nonneg q₀.le _) compare
have lower : q ≤ tail := by
simpa using summable.le_tsum (i := 0) (fun n _ => pow_nonneg q₀.le ((n + 1) ^ 2))
have upper : tail ≤ q * (1 - q ^ 3)⁻¹ := by
rw [← geom.tsum_eq]
exact summable.tsum_le_tsum compare geom.summable
have tailPos : 0 < tail := q₀.trans_le lower
have mu := friction_coefficient_pos
have theta : gaussianTheta = 1 + 2 * tail := gaussian_theta_tail
have denom : 0 < 1 + 2 * tail := by linarith
rw [gaussian_lattice_normalization, theta]
constructor
· exact (div_lt_iff₀ denom).mpr (by nlinarith)
· calc
_ = 2 * tail / (1 + 2 * tail) := by
field_simp
ring
_ ≤ 2 * tail := (div_le_iff₀ denom).mpr (by nlinarith)
_ ≤ _ := by rw [div_eq_mul_inv, mul_assoc]; linarith

end QBDMathlib.Ch04

#print axioms QBDMathlib.Ch04.friction_coefficient_pos
#print axioms QBDMathlib.Ch04.gaussian_lattice_poisson
#print axioms QBDMathlib.Ch04.gaussian_lattice_normalization
#print axioms QBDMathlib.Ch04.gaussian_lattice_friction_bound

Verification Summary:

The machine-checked proofs establish strict positivity of 1/2π1 / \sqrt{2\pi}, certify the Gaussian lattice Poisson summation and normalization identities, and bound the discrete lattice correction explicitly. Higher-dimensional curved-lattice extensions remain outside this real-analysis module. The Lean 4 and Mathlib kernel accepts all closed proof terms using only standard axioms, certifying the friction claims of Friction Coefficient §4.4.7.

In Plain English:
Machine-checked Lean 4 proofs certify the formal claims verified in Section 4.4.7.4.


4.4.8 Proof: Information-Theoretic Foundations​

Information-Theoretic Foundations §4.4.1 via Synthesis of the Five Constitutive Scales

I. Binary Reference Law

Bit-flip invariance and normalization give the unbiased Bernoulli law and the bit-to-nat conversion (Information Modulus & Prior Uniqueness §4.4.2). The local simple-path convention gives a factor two for the isolated closure triad (Entropy of Closure §4.4.3).

II. Conditional Channel Coordinates

The stipulated total energy and equal three-channel allocation give ε0=ln⁡2/3\varepsilon_0=\ln2/3 (Dimensional Equipartition §4.4.4). Six independent fair decisions give Λ0=2−6\Lambda_0=2^{-6} (Geometric Self-Energy §4.4.5). Affine interpolation between the two specified catalytic values gives λ0=e−1\lambda_0=e-1 (Catalysis Coefficient §4.4.6).

III. Gaussian Convention

The selected continuum reference is μ0=1/2π\mu_0=1/\sqrt{2\pi}, whereas exact signed-lattice normalization is μ0/ϑ3(0,e−2π2)\mu_0/\vartheta_3(0,e^{-2\pi^2}). The positive theta-tail bound controls their difference (Friction Coefficient §4.4.7). These conditional coordinates are the asserted reference values (Information-Theoretic Foundations §4.4.1).

Q.E.D.

In Plain English:
Section 4.4.8 formalizes the properties of the QBD proof regarding information-theoretic foundations.


4.4.8.1 Type-Theoretic Validation via Lean 4 and Mathlib​

Lean 4 Encoding of Information-Theoretic Foundations via Modular Real-Analysis Assembly

Type-theoretic certification of the complete constitutive constants synthesis established in Information-Theoretic Foundations §4.4.1 proceeds via the following verification strategy:

  1. Model: The assembly module imports all six certified Chapter 4 Mathlib modulus, closure-entropy, equipartition, self-energy, catalysis, and Gaussian-lattice-friction modules.
  2. Certified Claims: The module assembles prior uniqueness, closure entropy, dimensional equipartition, six-port geometric self-energy, catalysis uniqueness, and the Gaussian lattice friction bound in Information-Theoretic Foundations §4.4.8.
  3. Scope Boundary: The assembly certifies all dimensionless constitutive reference constants and bounds in real analysis. Empirical dimensional unit assignments remain outside this dimensionless foundation.
import QBDMathlib.Ch04.L4_4_2_InformationModulus
import QBDMathlib.Ch04.L4_4_3_EntropyOfClosure
import QBDMathlib.Ch04.L4_4_4_DimensionalEquipartition
import QBDMathlib.Ch04.L4_4_5_GeometricSelfEnergy
import QBDMathlib.Ch04.L4_4_6_CatalysisCoefficient
import QBDMathlib.Ch04.L4_4_7_FrictionCoefficient

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03 QBD.Ch04

namespace QBDMathlib.Ch04

theorem information_theoretic_foundations (prior : FiniteLaw Bool)
(symmetric : prior.weight false = prior.weight true)
(a b c : ℝ) (ab : a = b) (bc : b = c) (total : a + b + c = informationModulus)
(probability : Fin (triad_interaction_ports 3) → ℝ)
(fair : ∀ i, probability i = BernoulliReference)
(offset slope : ℝ) (base : offset + slope * 0 = 1)
(unit : offset + slope * 1 = Real.exp 1) :
prior.weight true = 1 / 2 ∧
Real.log (triadPathCount closedTriad : ℝ) - Real.log (triadPathCount openTriad : ℝ) = Real.log 2 ∧
a = Real.log 2 / 3 ∧ (∏ i, probability i) = 1 / 64 ∧
slope = Real.exp 1 - 1 ∧ 1 / gaussianLatticePartition = frictionCoefficient / gaussianTheta := by
have alignment := geometric_self_energy probability fair
exact ⟨(permutation_invariance_uniquely_determines_prior prior symmetric).2, entropy_of_closure,
(dimensional_equipartition a b c ab bc total).1, alignment.1.trans alignment.2,
(catalysis_coefficient_unique offset slope base unit).2, gaussian_lattice_normalization⟩

end QBDMathlib.Ch04

#print axioms QBDMathlib.Ch04.information_theoretic_foundations

Verification Summary:

The machine-checked proof unites maximum-entropy prior uniqueness, closure entropy, three-channel equipartition, six-port self-energy, catalysis uniqueness, and Gaussian lattice friction bounds into a single closed real-analysis theorem. Dimensional unit calibrations remain outside this dimensionless assembly. The Lean 4 and Mathlib kernel accepts the closed proof term using only standard axioms, certifying the logical synthesis of Information-Theoretic Foundations §4.4.8.

In Plain English:
Section 4.4.8.1 formalizes the properties of the QBD type-theoretic regarding validation via lean 4 core.


4.5.1 Definition: Universal Constructor​

Algorithmic Implementation of the Rewrite Rule R\mathcal{R} by Thermodynamic Modulation

The Universal Constructor R\mathcal{R} is defined as a stochastic map R:AnnCG→P(CG)\mathcal{R}: \mathbf{AnnCG} \to \mathcal{P}(\mathbf{CG}) that transforms an annotated graph (G,σ)(G, \sigma) into a probability distribution over potential successor states. The constructor operates via a strictly defined sequence of Scanning, Validation, and Weighting, formally implemented by the following algorithm: (Gillespie, 1977)

def R(annotated_graph, T, mu, lambda_cat):
r"""
Takes an annotated graph T(G) = (G, \sigma) and returns a
probability distribution over successor graphs \mathbb{P}(G_t+1).
Constants T, mu, lambda_cat derived in the thermodynamic parameters section (§4.4).
"""
# --- 1. SCAN & FILTER (The "Brakes") ---
# Find all PUC-compliant 2-paths (for Addition) and 3-cycles (for Deletion)
compliant_2_paths = _find_compliant_sites(G)
existing_3_cycles = _find_all_3_cycles(G)

add_proposals = []
del_proposals = []

# --- 2. VALIDATE & CALCULATE PROBABILITIES (Engine + Friction) ---

# A) Process all ADD proposals (Generative Drive)
for (v, w, u) in compliant_2_paths:
proposed_edge = (u, v)

# A.1) The AEC Pre-Check (Axiom 3 "Brake")
# Deterministically reject paradoxes before probability calculation
if not pre_check_aec(G, proposed_edge):
continue

# A.2) The Thermodynamic "Engine"
# Base probability is 1.0 (Barrierless Creation at Criticality)
P_thermo_add = 1.0

# A.3) The "Friction" (Modulation by Local Stress)
stress = measure_local_stress(G, {v, w, u})
f_friction = exp(-mu * stress)

# The full probability for this single event
P_acc = f_friction * P_thermo_add

# Assign Monotonic Timestamp
H_new = 1 + max([H[e] for e in G.in_edges(u)] or [0])
add_proposals.append( (proposed_edge, H_new, P_acc) )

# B) Process all DELETE proposals (Entropic Balance)
for cycle in existing_3_cycles:
# B.1) The Thermodynamic "Engine"
# Base probability is 0.5 (Entropic Penalty of Erasure)
P_del_thermo = 0.5

# B.2) The "Catalysis" & "Friction" (Modulation by Local Stress)
# Stress *excluding* this cycle's own contribution: s_c = max(0, sum_{v in c} s_G(v) - 1)
stress = max(0, measure_local_stress(G, cycle.nodes) - 1)
f_catalysis = 1 + lambda_cat * stress
f_friction = exp(-mu * stress)

# The full probability for this single event
P_del = min(1.0, f_catalysis * f_friction * P_del_thermo)
del_proposals.append( (cycle, P_del) )

# --- 3. RETURN THE PROBABILITY DISTRIBUTION ---
# The output is the ensemble of weighted proposals.
# The realization (sampling/collapse) occurs in the Evolution Operator U (§4.6).
return (add_proposals, del_proposals)

This implementation adheres to the Micro/Macro separation principle, operating exclusively on local variables with universal constants derived in Thermodynamic Foundations §4.4.

Lean 4 (QBD.Ch04.Defs):

/-- §4.5.1. The discrete scan yields candidates with data for weighting the frozen proposals. -/
structure UniversalConstructor {N : Nat} (G : TimestampedGraph (Fin N)) where
additions : (Fin N × Fin N × Fin N) → Prop
deletions : (Fin N × Fin N × Fin N) → Prop
additions_spec : ∀ v w u, additions (v, w, u) ↔ AdditionMode G v w u
deletions_spec : ∀ v w u, deletions (v, w, u) ↔ DeletionMode G v w u

In Plain English:
Spacetime updates are governed by a Universal Constructor that stochastically scans, validates, and rewrites local connections based on parities.


4.5.2 Definition: Catalytic Tension Factor​

Syndrome-Response Function Modulating Base Probabilities via Catalytic Tension Factor

Let sG(v)=∣C3(v)∣s_G(v) = |\mathcal{C}_3(v)| denote the count of directed 3-cycles incident to vertex vv. For a candidate closing edge ea=(u,v)e_a = (u, v) bridging an open 2-path v→w→uv \to w \to u, define the local triad addition stress sa(v,w,u)=∑x∈{v,w,u}sG(x)s_a(v, w, u) = \sum_{x \in \{v, w, u\}} s_G(x), and for an existing cycle c∈C3(G)c \in \mathcal{C}_3(G), define the self-excluded deletion stress sc=max⁡ ⁣(0,∑x∈csG(x)−1)s_c = \max\!\left(0, \sum_{x \in c} s_G(x) - 1\right). The mode-separated Catalytic Tension Factor (χadd,χdel)(\chi_{\mathrm{add}}, \chi_{\mathrm{del}}) modulates the thermodynamic baselines as

χadd(sa)=e−μsa,χdel(sc)=(1+λsc)e−μsc,\chi_{\mathrm{add}}(s_a) = e^{-\mu s_a}, \qquad \chi_{\mathrm{del}}(s_c) = (1 + \lambda s_c)e^{-\mu s_c},

yielding the operational acceptance probabilities pa=χadd(sa)Pacc,thermo=e−μsap_a = \chi_{\mathrm{add}}(s_a)\mathbb{P}_{\text{acc,thermo}} = e^{-\mu s_a} for edge addition and qc=min⁡{1,χdel(sc)Pdel,thermo}=min⁡ ⁣{1,12(1+λsc)e−μsc}q_c = \min\{1, \chi_{\mathrm{del}}(s_c)\mathbb{P}_{\text{del,thermo}}\} = \min\!\left\{1, \tfrac{1}{2}(1 + \lambda s_c)e^{-\mu s_c}\right\} for triangle deletion (Universal Constructor §4.5.8).

  1. Addition Friction (χadd\chi_{\mathrm{add}}): Pure exponential steric damping by the candidate triad's 3-vertex cycle-incidence sum sas_a, suppressing edge additions in crowded regions without catalytic boost (Addition Probability §4.5.6).
  2. Deletion Catalysis and Friction (χdel\chi_{\mathrm{del}}): Affine linear catalytic scaling (1+λsc)(1 + \lambda s_c) (Catalysis Coefficient §4.4.6) combined with exponential neighborhood friction e−μsce^{-\mu s_c} in the self-excluded deletion stress scs_c. Multiplication by the one-half entropic baseline yields the operational deletion probability (Deletion Probability §4.5.7).

Lean 4 (QBDMathlib.Ch04.Defs):

def additionTension (friction stress : ℝ) : ℝ := Real.exp (-friction * stress)
def deletionTension (friction catalysis stress : ℝ) : ℝ :=
(1 + catalysis * stress) * additionTension friction stress

In Plain English:
Section 4.5.2 formalizes the properties of the QBD definition regarding catalytic tension factor.


4.5.3 Definition: Addition Mode​

Constructive Operation Proposing Edge Additions via Addition Mode

The Addition Mode is defined as the constructive operation of the Action Layer, operating on a set of compliant 2-Path §1.2.5 structures. It generates a set of tuples (proposed_edge, H_new, P_acc), where PaccP_{acc} is the friction-damped probability derived from the Catalytic Tension Factor §4.5.2.

Lean 4 (QBD.Ch04.Defs):

/-- §4.5.3. Addition candidates are absent return chords with PUC and AEC checks. -/
def AdditionMode {N : Nat} (G : TimestampedGraph (Fin N)) (v w u : Fin N) : Prop :=
GeometricConstructibility G.toDiGraph v w u ∧
Ch02.ThreeDistinct v w u ∧ ¬ G.edges (u, v) ∧
AcyclicEffectiveCausality ((addRecordedEdge (u, v) (newCreationHeight G u) G).toRel)

In Plain English:
Section 4.5.3 formalizes the properties of the QBD definition regarding addition mode.


4.5.4 Definition: Deletion Mode​

Destructive Operation Proposing Edge Removals via Deletion Mode

The Deletion Mode is defined as the destructive operation of the Action Layer, acting on directed 3-cycles governed by the Geometric Quantum §2.3.3. It generates a set of tuples (target_edge, P_del), where PdelP_{del} is the catalysis-boosted probability derived from the Catalytic Tension Factor §4.5.2.

Lean 4 (QBD.Ch04.Defs):

/-- §4.5.4. Deletion candidates are old directed triangles. -/
def DeletionMode {N : Nat} (G : TimestampedGraph (Fin N)) (v w u : Fin N) : Prop :=
Ch02.ThreeDistinct v w u ∧ G.toDiGraph.ThreeCycle v w u

In Plain English:
Section 4.5.4 formalizes the properties of the QBD definition regarding deletion mode.


4.5.5 Theorem: Universal Constructor​

Thermodynamic Transition Probabilities by Feedback Modulation of the Rewrite Map

Let R\mathcal{R} denote the Universal Constructor stochastically mapping annotated graphs. Then the base thermodynamic acceptance probability is Pacc,thermo=1\mathbb{P}_{\text{acc,thermo}} = 1 for edge addition and Pdel,thermo=1/2\mathbb{P}_{\text{del,thermo}} = 1/2 for edge deletion; moreover, the local rewrite rates are modulated by the Catalytic Tension Factor.

In Plain English:
Section 4.5.5 formalizes the properties of the QBD theorem regarding universal constructor.


4.5.6 Lemma: Addition Probability​

Unitary Thermodynamic Acceptance Probability via Edge Creation

Let Pacc,thermo\mathbb{P}_{\text{acc,thermo}} denote the base thermodynamic acceptance probability for edge creation in the critical vacuum regime under the barrierless free energy condition of Information Modulus & Prior Uniqueness §4.4.2. Then Pacc,thermo\mathbb{P}_{\text{acc,thermo}} is identically equal to 1.

In Plain English:
Section 4.5.6 formalizes the properties of the QBD lemma regarding addition probability.


4.5.6.1 Proof: Addition Probability​

Derivation of Barrierless Addition from Free Energy Minimization

I. Thermodynamic Factor and Barrierless Condition

Let T>0T>0 and let the thermodynamic acceptance factor be

Pthermo=min⁡{1,e−ΔF/T},ΔF=ΔE−TΔSP_{thermo}=\min\{1,e^{-\Delta F/T}\},\qquad \Delta F=\Delta E-T\Delta S

in the supplied kernel (Addition Mode §4.5.3). For the bit-creation baseline, ΔS=ln⁡2\Delta S=\ln2 (Information Modulus & Prior Uniqueness §4.4.2). Therefore

−ΔFT=ln⁡2−ΔET,Pthermo=min⁡{1,2e−ΔE/T}.-\frac{\Delta F}{T}=\ln2-\frac{\Delta E}{T},\qquad P_{thermo}=\min\{1,2e^{-\Delta E/T}\}.

II. Exact Saturation Range

The barrierless condition is ΔF≤0\Delta F\le0. Since T>0T>0, it is equivalent to

ΔE−Tln⁡2≤0 ⟺ ΔET≤ln⁡2.\Delta E-T\ln2\le0 \ \Longleftrightarrow\ \frac{\Delta E}{T}\le\ln2.

In that range,

ln⁡2−ΔET≥0 ⟹ e−ΔF/T≥1 ⟹ Pthermo=1.\ln2-\frac{\Delta E}{T}\ge0 \ \Longrightarrow\ e^{-\Delta F/T}\ge1 \ \Longrightarrow\ P_{thermo}=1.

In particular, the declared ΔE=0\Delta E=0 baseline gives e−ΔF/T=eln⁡2=2e^{-\Delta F/T}=e^{\ln2}=2 and hence Pthermo=1P_{thermo}=1 exactly, without a large-volume limit.

III. The Stated Channel-Energy Examples

For the supplied microscopic channel value ε0=ln⁡2/3\varepsilon_0=\ln2/3 and Tc=ln⁡2T_c=\ln2 (Dimensional Equipartition §4.4.4),

ε0Tc=13.\frac{\varepsilon_0}{T_c}=\frac13.

The logarithm satisfies

ln⁡2=∫12dxx>∫1212 dx=12>13.\ln2=\int_1^2\frac{\mathrm dx}{x} >\int_1^2\frac12\,\mathrm dx=\frac12>\frac13.

Therefore ΔF/Tc=1/3−ln⁡2<0\Delta F/T_c=1/3-\ln2<0 and

Pthermo=min⁡{1,eln⁡2−1/3}=1.P_{thermo}=\min\{1,e^{\ln2-1/3}\}=1.

For the separately stated quarter-unit example, ΔE/Tc=1/4<1/2<ln⁡2\Delta E/T_c=1/4<1/2<\ln2. Therefore

−ΔF/Tc=ln⁡2−14>0,Pthermo=min⁡{1,eln⁡2−1/4}=1.-\Delta F/T_c=\ln2-\tfrac14>0,\qquad P_{thermo}=\min\{1,e^{\ln2-1/4}\}=1.

Both conclusions are conditional on their supplied energy normalizations.

IV. Scope of the Factor

Writing the full admissible-proposal acceptance as Pacc=χadd(sa)PthermoP_{acc}=\chi_{\mathrm{add}}(s_a)P_{thermo} gives, within the barrierless range,

Pacc=χadd(sa)⋅1=χadd(sa)=e−μsa.P_{acc}=\chi_{\mathrm{add}}(s_a)\cdot1=\chi_{\mathrm{add}}(s_a)=e^{-\mu s_a}.

The exact claim about the thermodynamic factor is consequently (Addition Probability §4.5.6)

ΔF≤0,T>0 ⟹ Pthermo=1.\boxed{\Delta F\le0,\quad T>0\ \Longrightarrow\ P_{thermo}=1.}

Q.E.D.

In Plain English:
Section 4.5.6.1 formalizes the properties of the QBD proof regarding addition probability.


4.5.6.2 Type-Theoretic Validation via Lean 4 and Mathlib​

Lean 4 Encoding of Addition Probability via Exponential Stress Damping

Type-theoretic certification of the barrierless baseline and unit-interval bounds established in Addition Probability §4.5.6 proceeds via the following verification strategy:

  1. Model: Real-valued exponential damping weights parameterized by nonnegative friction and local triangle stress represent single-candidate addition probabilities.
  2. Certified Claims: The module certifies unit probability at zero stress, exact exponential baseline evaluation, and strict membership in (0,1](0, 1] for all nonnegative friction and stress values in Addition Probability §4.5.6.1.
  3. Scope Boundary: The bounds apply to individual frozen-snapshot candidate addition weights under nonnegative friction and stress. Multi-candidate concurrent correlations are handled in the tick-evolution kernel.
import QBDMathlib.Ch04.L4_4_2_InformationModulus

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03 QBD.Ch04

namespace QBDMathlib.Ch04

theorem barrierless_addition {T E S : ℝ} (temperature : 0 < T)
(barrierless : freeEnergy T E S ≤ 0) : thermoAcceptance T E S = 1 := by
apply min_eq_left
rw [← Real.exp_zero]
exact Real.exp_le_exp.mpr (div_nonneg (neg_nonneg.mpr barrierless) temperature.le)

theorem addition_baseline {T : ℝ} (temperature : 0 < T) :
thermoAcceptance T 0 informationModulus = 1 := by
rw [zero_energy_temperature_cancels temperature, informationModulus, Real.exp_log (by norm_num)]
norm_num

theorem addition_probability_bounds {μ s : ℝ} (mu : 0 ≤ μ) (stress : 0 ≤ s) :
0 < additionProbability μ s ∧ additionProbability μ s ≤ 1 :=
⟨Real.exp_pos _, by
unfold additionProbability additionTension
rw [← Real.exp_zero]
exact Real.exp_le_exp.mpr (by nlinarith)⟩

end QBDMathlib.Ch04

#print axioms QBDMathlib.Ch04.barrierless_addition
#print axioms QBDMathlib.Ch04.addition_baseline
#print axioms QBDMathlib.Ch04.addition_probability_bounds

Verification Summary:

The machine-checked proofs confirm that zero-stress addition is barrierless with probability one, verify the exponential damping baseline, and establish that addition probability lies strictly in (0,1](0, 1] for all nonnegative parameters. Concurrent multi-site interference remains outside this single-candidate weight check. The Lean 4 and Mathlib kernel accepts all closed proof terms using only standard axioms, certifying the probability bounds of Addition Probability §4.5.6.

In Plain English:
Machine-checked Lean 4 proofs certify the formal claims verified in Section 4.5.6.3.


4.5.7 Lemma: Deletion Probability​

Half-unit thermodynamic deletion probability via Deletion Probability

Let Pdel,thermo\mathbb{P}_{\text{del,thermo}} denote the base thermodynamic deletion probability for geometric quanta in the critical vacuum regime. Then Pdel,thermo\mathbb{P}_{\text{del,thermo}} is identically equal to 1/21/2 (Entropy of Closure §4.4.3).

In Plain English:
Section 4.5.7 formalizes the properties of the QBD lemma regarding deletion probability.


4.5.7.1 Proof: Deletion Probability​

Limit Evaluation via Entropic Dominance

I. Entropic Baseline

The base deletion convention uses T>0T>0, ΔE=0\Delta E=0 and the loss of one bit, ΔS=−ln⁡2\Delta S=-\ln2 (Information Modulus & Prior Uniqueness §4.4.2), with the bit-loss input supplied by the closure-entropy model (Entropy of Closure §4.4.3). The thermodynamic rule gives

ΔFbase=0−T(−ln⁡2)=Tln⁡2,−ΔFbase/T=−ln⁡2,Qbase=min⁡{1,e−ln⁡2}=min⁡{1,12}=12.\begin{aligned} \Delta F_{base}&=0-T(-\ln2)=T\ln2,\\ -\Delta F_{base}/T&=-\ln2,\\ Q_{base}&=\min\{1,e^{-\ln2}\} =\min\{1,\tfrac12\}=\tfrac12. \end{aligned}

II. Separation from a Nonzero Released Energy

For a released internal energy ε≥0\varepsilon\ge0, the energy change is instead ΔE=−ε\Delta E=-\varepsilon. Keeping the same entropy change gives

ΔF(ε)=−ε+Tln⁡2,−ΔF(ε)/T=εT−ln⁡2,Q(ε)=min⁡{1,12eε/T}.\begin{aligned} \Delta F(\varepsilon)&=-\varepsilon+T\ln2,\\ -\Delta F(\varepsilon)/T&=\frac\varepsilon T-\ln2,\\ Q(\varepsilon)&=\min\{1,\tfrac12e^{\varepsilon/T}\}. \end{aligned}

The cases are therefore

Q(ε)={12,ε=0,12eε/T∈(12,1),0<ε<Tln⁡2,1,ε≥Tln⁡2.Q(\varepsilon)=\begin{cases} \tfrac12,&\varepsilon=0,\\ \tfrac12 e^{\varepsilon/T}\in(\tfrac12,1),&0<\varepsilon<T\ln2,\\ 1,&\varepsilon\ge T\ln2. \end{cases}

For the supplied channel energy at Tc=ln⁡2T_c=\ln2, the ratio is (ln⁡2/3)/ln⁡2=1/3<ln⁡2(\ln2/3)/\ln2=1/3<\ln2. The unclipped value is therefore Q=12e1/3Q=\tfrac12e^{1/3}. The first five terms of the exponential series give

∑j=04(1/3)jj!=1+13+118+1162+11944=27131944.\sum_{j=0}^4\frac{(1/3)^j}{j!} =1+\frac13+\frac1{18}+\frac1{162}+\frac1{1944} =\frac{2713}{1944}.

The first omitted term is 1/291601/29160. Each following term is at most 1/181/18 times the preceding term, so

27133888<Q≤27133888+12⋅2916011−1/18.\frac{2713}{3888} <Q\le \frac{2713}{3888}+\frac{1}{2\cdot29160}\frac{1}{1-1/18}.

These endpoints lie between 0.697750.69775 and 0.697850.69785, so Q≈0.6978Q\approx0.6978 to four decimal places.

This is the nonzero-energy correction, rather than the base factor.

III. Limit and Baseline Identity

If a family of energy normalizations satisfies ε/T→0\varepsilon/T\to0, continuity of the exponential gives

lim⁡ε/T→0Q(ε)=min⁡{1,12e0}=12.\lim_{\varepsilon/T\to0}Q(\varepsilon) =\min\{1,\tfrac12e^0\}=\tfrac12.

The base value itself requires no limiting argument. Together with the base addition value, it satisfies

Pbase=1,Qbase=12,QbasePbase=12.P_{base}=1,\qquad Q_{base}=\tfrac12,\qquad \frac{Q_{base}}{P_{base}}=\frac12.

Thus the specified thermodynamic deletion baseline is exactly (Deletion Probability §4.5.7)

Qdel,thermobase=12(T>0, ΔE=0, ΔS=−ln⁡2).\boxed{Q_{\mathrm{del},\mathrm{thermo}}^{base}=\tfrac12\qquad (T>0,\ \Delta E=0,\ \Delta S=-\ln2).}

Q.E.D.

In Plain English:
Section 4.5.7.1 formalizes the properties of the QBD proof regarding deletion probability.


4.5.7.2 Type-Theoretic Validation via Lean 4 and Mathlib​

Lean 4 Encoding of Deletion Probability via Catalytic Tension and Detailed Balance Ratio

Type-theoretic certification of the deletion probability bounds, ratio identity, and four-outcome triangle law established in Deletion Probability §4.5.7 proceeds via the following verification strategy:

  1. Model: Capped catalytic deletion weights, Core isolated three-cycle stress counts, deletion-to-addition ratios, and four-outcome triangle deletion distributions represent local pruning probabilities.
  2. Certified Claims: The module certifies the zero-stress deletion baseline, unit-interval probability bounds, the exact deletion-to-addition ratio below the cap, and normalization of the four-outcome triangle deletion law in Deletion Probability §4.5.7.1.
  3. Scope Boundary: The certificate verifies single-triangle deletion weights and normalization under nonnegative parameters. Multi-triangle shared-edge deletion overlaps are handled by the frozen-tick pushforward.
import QBDMathlib.Ch04.L4_4_2_InformationModulus
import QBD.Ch04.L4_5_7_IsolatedCycleStress
import Mathlib.Algebra.BigOperators.Option

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03 QBD.Ch04

namespace QBDMathlib.Ch04

theorem deletion_baseline {T : ℝ} (temperature : 0 < T) :
thermoAcceptance T 0 (-informationModulus) = 1 / 2 := by
rw [zero_energy_temperature_cancels temperature, informationModulus, Real.exp_neg,
Real.exp_log (by norm_num)]
norm_num

theorem deletion_probability_bounds {μ catalyst s : ℝ} (cat : 0 ≤ catalyst) (stress : 0 ≤ s) :
0 < deletionProbability μ catalyst s ∧ deletionProbability μ catalyst s ≤ 1 := by
unfold deletionProbability deletionTension additionTension
have product := mul_nonneg cat stress
exact ⟨lt_min (by norm_num) (by positivity), min_le_left _ _⟩

theorem deletion_to_addition_ratio (μ catalyst s : ℝ) :
deletionProbability μ catalyst s / additionProbability μ s =
min (Real.exp (μ * s)) ((1 + catalyst * s) / 2) := by
unfold deletionProbability deletionTension additionProbability additionTension
rw [← min_div_div_right (Real.exp_pos _).le]
congr 1
· rw [one_div, ← Real.exp_neg]
congr 1
ring
· field_simp [Real.exp_ne_zero]
<;> ring

theorem triangle_deletion_law (q : ℝ) (q₀ : 0 ≤ q) (q₁ : q ≤ 1) :
(∀ x, 0 ≤ triangleDeletionWeight q x) ∧ ∑ x, triangleDeletionWeight q x = 1 := by
constructor
· intro x
cases x <;> simp [triangleDeletionWeight] <;> linarith
· rw [Fintype.sum_option]
simp [triangleDeletionWeight]
ring

end QBDMathlib.Ch04

#print axioms QBDMathlib.Ch04.deletion_baseline
#print axioms QBDMathlib.Ch04.deletion_probability_bounds
#print axioms QBDMathlib.Ch04.deletion_to_addition_ratio
#print axioms QBDMathlib.Ch04.triangle_deletion_law

Verification Summary:

The machine-checked proofs establish the baseline deletion probability, unit-interval bounds, exact catalytic deletion-to-addition ratio, and normalization of the four-outcome triangle deletion law. Shared-edge overlap between distinct triangles is resolved separately in the synchronous tick kernel. The Lean 4 and Mathlib kernel accepts all closed proof terms using only standard axioms, certifying the deletion-law claims of Deletion Probability §4.5.7.

In Plain English:
Machine-checked Lean 4 proofs certify the formal claims verified in Section 4.5.7.3.


4.5.8 Proof: Universal Constructor​

Synthesis of Transition Probabilities via Feedback Loops in Constructor Dynamics

I. Stochastic Update Map

Let the annotated graph (G,σ)(G, \sigma) evolve stochastically under the constructor map R\mathcal{R}. The transition probabilities decompose into a base thermodynamic factor and a local syndrome-response factor.

II. Base Probability Calibration

The base thermodynamic probabilities are calibrated at the critical vacuum temperature. Edge additions occur barrierless with unitary probability Pacc,thermo=1\mathbb{P}_{\text{acc,thermo}} = 1 according to Addition Probability §4.5.6. Edge deletions face an entropic barrier, yielding a half-unit probability Pdel,thermo=1/2\mathbb{P}_{\text{del,thermo}} = 1/2 according to Deletion Probability §4.5.7.

Writing pbarep_{\mathrm{bare}} and qbareq_{\mathrm{bare}} for the two thermodynamic baselines, the zero addition barrier and one-bit deletion cost give

pbare=e0=1,qbare=e−log⁡2=1elog⁡2=12.\begin{aligned} p_{\mathrm{bare}}&=e^0=1,\\ q_{\mathrm{bare}}&=e^{-\log 2} =\frac{1}{e^{\log 2}} =\frac12. \end{aligned}

III. Dynamic Modulation

The base probabilities are modulated by the Catalytic Tension Factor defined in Catalytic Tension Factor §4.5.2. Adding edges is damped exponentially by local stress, whereas deleting edges is catalyzed linearly by syndrome resolution.

Let sas_a be the stress of an eligible addition and scs_c the stress of an old triangle deletion trial. Multiplying the baselines by the stress factors and clipping the deletion trial probability at one gives

pa=pbaree−μsa=e−μsa,q~c=qbare(1+λsc)e−μsc=12(1+λsc)e−μsc,qc=min⁡{1,q~c}.\begin{aligned} p_a&=p_{\mathrm{bare}}e^{-\mu s_a} =e^{-\mu s_a},\\ \widetilde q_c&=q_{\mathrm{bare}}(1+\lambda s_c)e^{-\mu s_c} =\tfrac12(1+\lambda s_c)e^{-\mu s_c},\\ q_c&=\min\{1,\widetilde q_c\}. \end{aligned}

For nonnegative stress and parameters, −μsa≤0-\mu s_a\le0 and 1+λsc≥11+\lambda s_c\ge1. Therefore

0<pa≤1,0≤q~c,0≤qc≤1.0<p_a\le1,\qquad 0\le\widetilde q_c,\qquad 0\le q_c\le1.

The addition outcome probabilities sum to (1−pa)+pa=1(1-p_a)+p_a=1. Under the uniform edge choice in Evolution Operator §4.6.1, the old triangle trial assigns probability 1−qc1-q_c to no trigger and probability qc/3q_c/3 to each edge choice. Explicitly,

Pr⁡(choose ej)=Pr⁡(trigger)Pr⁡(choose ej∣trigger)=qc⋅13=qc3,j∈{1,2,3},(1−qc)+∑j=13qc3=(1−qc)+qc=1.\begin{aligned} \Pr(\text{choose }e_j)&=\Pr(\text{trigger})\Pr(\text{choose }e_j\mid\text{trigger}) =q_c\cdot\frac13=\frac{q_c}{3}, \qquad j\in\{1,2,3\},\\ (1-q_c)+\sum_{j=1}^3\frac{q_c}{3} &=(1-q_c)+q_c=1. \end{aligned}

At zero stress these factors recover the baselines,

pa∣sa=0=1⋅e0=1,qc∣sc=0=min⁡{1,12(1+λ⋅0)e0}=12.p_a\big|_{s_a=0}=1\cdot e^0=1,\qquad q_c\big|_{s_c=0}=\min\{1,\tfrac12(1+\lambda\cdot0)e^0\}=\tfrac12.

IV. Microscopic Rate-Inversion Threshold

For a comparison at common stress s=sa=sc≥0s=s_a=s_c\ge0 and positive μ,λ\mu,\lambda, the addition probability is positive. Dividing the clipped deletion probability by it gives

qc(s)pa(s)=min⁡{1,12(1+λs)e−μs}e−μs=min⁡{eμs,1+λs2}.\frac{q_c(s)}{p_a(s)} =\frac{\min\{1,\tfrac12(1+\lambda s)e^{-\mu s}\}}{e^{-\mu s}} =\min\left\{e^{\mu s},\frac{1+\lambda s}{2}\right\}.

The second term equals one exactly when 1+λs=21+\lambda s=2, or s=s∗=1/λs=s_*=1/\lambda. The first term is at least one for s≥0s\ge0 and strictly greater than one for s>0s>0. Therefore

stress(1+λs)/2channel comparison0≤s<s∗<1qc(s)<pa(s)s=s∗=1qc(s)=pa(s)s>s∗>1qc(s)>pa(s)\begin{array}{c|c|c} \text{stress}&(1+\lambda s)/2&\text{channel comparison}\\\hline 0\le s<s_*&<1&q_c(s)<p_a(s)\\ s=s_*&=1&q_c(s)=p_a(s)\\ s>s_*&>1&q_c(s)>p_a(s) \end{array}

In the last row both arguments of the minimum exceed one, so the strict inequality also holds when the deletion probability is clipped. At the canonical λ0=e−1\lambda_0=e-1 from Catalysis Coefficient §4.4.6, the series e=1+1+∑j≥21/j!>2e=1+1+\sum_{j\ge2}1/j!>2 gives 0<s∗<10<s_*<1. In particular the equal-stress comparison at the isolated triad's stress two is

qc(2)pa(2)=min⁡{e2μ0,12+λ0}=min⁡{e2/2π,e−12}>1.\frac{q_c(2)}{p_a(2)} =\min\{e^{2\mu_0},\tfrac12+\lambda_0\} =\min\{e^{2/\sqrt{2\pi}},e-\tfrac12\}>1.

Q.E.D.

In Plain English:
Section 4.5.8 formalizes the properties of the QBD proof regarding universal constructor.


4.5.8.1 Type-Theoretic Validation via Lean 4 and Mathlib​

Lean 4 Encoding of Universal Constructor via Modular Weight and Balance Assembly

Type-theoretic certification of the constructor weight bounds and detailed-balance synthesis established in Universal Constructor §4.5.5 proceeds via the following verification strategy:

  1. Model: The assembly module imports the certified addition-probability and deletion-probability Mathlib modules together with the discrete candidate scanner.
  2. Certified Claims: The module assembles barrierless addition, unit-interval probability bounds for both modes, the catalytic deletion-to-addition ratio, and four-outcome triangle deletion normalization in Universal Constructor §4.5.8.
  3. Scope Boundary: The assembly certifies local candidate-level weight laws on a frozen snapshot. Synchronous multi-candidate realization and multi-tick drift are certified in the subsequent tick-evolution section.
import QBDMathlib.Ch04.L4_5_6_AdditionProbability
import QBDMathlib.Ch04.L4_5_7_DeletionProbability

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03 QBD.Ch04

namespace QBDMathlib.Ch04

theorem universal_constructor {T μ catalyst : ℝ} (temperature : 0 < T)
(mu : 0 ≤ μ) (cat : 0 ≤ catalyst) {N : ℕ} (G : TimestampedGraph (Fin N)) :
thermoAcceptance T 0 informationModulus = 1 ∧
thermoAcceptance T 0 (-informationModulus) = 1 / 2 ∧
(∀ v w u, 0 < weightedAddition G μ v w u ∧ weightedAddition G μ v w u ≤ 1) ∧
(∀ v w u, 0 < weightedDeletion G μ catalyst v w u ∧
weightedDeletion G μ catalyst v w u ≤ 1) ∧
deletionStress isolatedTriangle 0 1 2 = 2 :=
⟨addition_baseline temperature, deletion_baseline temperature,
fun _ _ _ => addition_probability_bounds mu (by positivity),
fun _ _ _ => deletion_probability_bounds cat (by positivity), isolated_3cycle_self_stress_eq_two⟩

end QBDMathlib.Ch04

#print axioms QBDMathlib.Ch04.universal_constructor

Verification Summary:

The machine-checked proof unifies addition and deletion probability bounds, catalytic ratio identities, and four-outcome triangle deletion normalization into a single closed constructor theorem. Synchronous multi-candidate composition belongs to the next section. The Lean 4 and Mathlib kernel accepts the closed proof term using only standard axioms, certifying the logical synthesis of Universal Constructor §4.5.8.

In Plain English:
Section 4.5.8.1 formalizes the properties of the QBD type-theoretic regarding validation via lean 4 core.


4.6.1 Definition: Evolution Operator​

Composition of Awareness, Proposal, Addition Merge, and Deletion Excision as the Logical Tick

Let the Evolution Operator be the Markov kernel induced by a deterministic four-stage realization map U(G,ξ)\mathcal U(G,\xi) on the complete active graph state, including its current heights. All proposals and their probabilities are evaluated against the same pre-tick snapshot.

  1. Awareness: Enumerate legal addition sites A(G)\mathcal A(G), directed triangles C3(G)\mathcal C_3(G), and vertex cycle incidences sG(v)s_G(v). The addition stress is the sum over its three vertices; a triangle's deletion stress is max⁡(0,∑v∈csG(v)−1)\max(0,\sum_{v\in c}s_G(v)-1).
  2. Independent selection: For each addition site choose Xa∈{0,1}X_a\in\{0,1\} with probability pa=e−μsap_a=e^{-\mu s_a}. For each triangle choose Jc∈{⊥}∪E(c)J_c\in\{\bot\}\cup E(c) with probabilities Pr⁡(Jc=⊥)=1−qc\Pr(J_c=\bot)=1-q_c and Pr⁡(Jc=e)=qc/3\Pr(J_c=e)=q_c/3, where qc=min⁡(1,12(1+λsc)e−μsc)q_c=\min(1,\tfrac12(1+\lambda s_c)e^{-\mu s_c}).
  3. Symmetric merge: Let B={ea:Xa=1}B=\{e_a:X_a=1\} and retain Bfilt={(u,v)∈B:u≠v, (v,u)∉B}B_{\mathrm{filt}}=\{(u,v)\in B:u\ne v,\ (v,u)\notin B\}. Insert these edges with source-side heights from the pre-tick snapshot and record their birth occurrences.
  4. Deletion purge: Let D={Jc:Jc≠⊥}D=\{J_c:J_c\ne\bot\}. Remove DD from the intermediate active edge set. Multiple selections of the same edge merge by set union; they do not create repeated deletions or erase historical records.

The complete realization is ξ=(XA,JC)\xi=(X_{\mathcal A},J_{\mathcal C}). The graph kernel is the pushforward of its normalized product measure (Euclidean Transition Measure §4.6.3). The raw reciprocal filter rejects both accepted directions, rather than choosing an order-dependent winner.

Lean 4 (QBD.Ch04.Defs):

/-- §4.6.1. Reciprocal winners cancel before frozen deletions are applied. -/
def retainedAdditions {V : Type u} (A : Edge V → Prop) (e : Edge V) : Prop :=
A e ∧ ¬ A (e.2, e.1)

def evolutionEdges {V : Type u} (E A D : Edge V → Prop) (e : Edge V) : Prop :=
(E e ∨ A e) ∧ ¬ D e

noncomputable def evolutionOperator {N : Nat} (G : TimestampedGraph (Fin N))
(A D : Edge (Fin N) → Prop) : TimestampedGraph (Fin N) := by
classical
exact ⟨fun e => decide (evolutionEdges G.edges (retainedAdditions A) D e),
fun e => if retainedAdditions A e then newCreationHeight G e.1
else if G.edges e ∧ ¬ D e then G.H e else 0⟩

In Plain English:
Section 4.6.1 formalizes the properties of the QBD definition regarding evolution operator.


4.6.2 Theorem: Emergent Dynamics​

Emergence of Classical Transition Probabilities and Entropic Arrow from the Evolution Operator

Let a finite-horizon graph process use the four-stage realization map and its product sampling law (Evolution Operator §4.6.1). Then its transition kernel is the pushforward of that law, its full-trajectory Shannon entropy is nondecreasing, and KL divergence contracts when two state distributions evolve under the same kernel.

In Plain English:
The kernel is the pushforward of its sampling law. The entropy conclusions hold on the stated finite horizon, and the finite-ledger exclusion applies to a two-sided unpumped realization.


4.6.3 Lemma: Euclidean Transition Measure​

Emergence of Path Integral Weighting from Markovian Transition Probabilities

Let ξ\xi comprise the independent addition and cycle-deletion outcomes (Evolution Operator §4.6.1). Then K(G,G′)=∑ξ:U(G,ξ)=G′Pr⁡(ξ∣G)K(G,G')=\sum_{\xi:\mathcal U(G,\xi)=G'}\Pr(\xi\mid G) is normalized, and every positive realization probability has the additive negative-log action −log⁡Pr⁡(ξ∣G)-\log\Pr(\xi\mid G).

In Plain English:
Section 4.6.3 formalizes the properties of the QBD lemma regarding euclidean transition measure.


4.6.3.1 Proof: Euclidean Transition Measure​

Derivation of the Exponential Action Functional from Local Probabilities

I. Local Outcome Normalization

The proof uses the specified objects and conventions (Evolution Operator §4.6.1).

For each addition, Pr⁡(Xa=1)=pa\Pr(X_a=1)=p_a and Pr⁡(Xa=0)=1−pa\Pr(X_a=0)=1-p_a, with sum one. Each triangle has three distinct edges and

Pr⁡(Jc=⊥)+∑e∈E(c)Pr⁡(Jc=e)=(1−qc)+3(qc/3)=1.\Pr(J_c=\bot)+\sum_{e\in E(c)}\Pr(J_c=e) =(1-q_c)+3(q_c/3)=1.

II. Product Realization Measure

For a specified realization, let A={a:Xa=1}A=\{a:X_a=1\} and CD={c:Jc≠⊥}C_D=\{c:J_c\ne\bot\}. Independence gives

Pr⁡(ξ∣G)=∏a∈Apa∏a∉A(1−pa)∏c∈CDqc3∏c∉CD(1−qc).\Pr(\xi\mid G)= \prod_{a\in A}p_a\prod_{a\notin A}(1-p_a) \prod_{c\in C_D}\frac{q_c}{3}\prod_{c\notin C_D}(1-q_c).

The indices run through the fixed candidate sets of the input snapshot. Distributivity of the finite sums yields

∑ξPr⁡(ξ∣G)=∏a[pa+(1−pa)]∏c[(1−qc)+3qc/3]=1.\sum_\xi\Pr(\xi\mid G) =\prod_a[p_a+(1-p_a)]\prod_c[(1-q_c)+3q_c/3]=1.

III. Pushforward and Collision Preimages

The deterministic map assigns each realization exactly one successor. The preimage sets FG′={ξ:U(G,ξ)=G′}F_{G'}=\{\xi:\mathcal U(G,\xi)=G'\} are disjoint and cover the realization space. Hence

∑G′K(G,G′)=∑G′∑ξ∈FG′Pr⁡(ξ∣G)=∑ξPr⁡(ξ∣G)=1.\sum_{G'}K(G,G') =\sum_{G'}\sum_{\xi\in F_{G'}}\Pr(\xi\mid G) =\sum_\xi\Pr(\xi\mid G)=1.

Shared deletion edges and reciprocal filtering can make ∣FG′∣>1|F_{G'}|>1; the summation therefore cannot generally be replaced by one product.

IV. Realization Action

For a positive-probability realization, logarithmic additivity gives

S(ξ∣G)=−log⁡Pr⁡(ξ∣G)=−∑a∈Alog⁡pa−∑a∉Alog⁡(1−pa)−∑c∈CDlog⁡(qc/3)−∑c∉CDlog⁡(1−qc).\begin{aligned} \mathcal S(\xi\mid G) &=-\log\Pr(\xi\mid G)\\ &=-\sum_{a\in A}\log p_a-\sum_{a\notin A}\log(1-p_a)\\ &\quad-\sum_{c\in C_D}\log(q_c/3)-\sum_{c\notin C_D}\log(1-q_c). \end{aligned}

Thus Pr⁡(ξ∣G)=e−S(ξ∣G)\Pr(\xi\mid G)=e^{-\mathcal S(\xi\mid G)} and K(G,G′)=∑ξ∈FG′e−S(ξ∣G)K(G,G')=\sum_{\xi\in F_{G'}}e^{-\mathcal S(\xi\mid G)}. The accepted-addition contribution alone is −∑a∈Alog⁡pa=μ∑a∈Asa-\sum_{a\in A}\log p_a=\mu\sum_{a\in A}s_a (Euclidean Transition Measure §4.6.3).

Q.E.D.

In Plain English:
Section 4.6.3.1 formalizes the properties of the QBD proof regarding euclidean transition measure.


4.6.3.2 Calculation: Euclidean Action Integration​

Computational Verification of the Exponential Action Scaling Relation through Euclidean Action Integration

Computational verification of the complete realization law established in (Euclidean Transition Measure §4.6.3.1) and the fixed-snapshot selection rule (Evolution Operator §4.6.1) is based on the following protocols:

  1. Exact Outcome Weights: Rational probabilities enumerate accepted and rejected addition outcomes and four outcomes per triangle.
  2. Pushforward Aggregation: Deterministic reciprocal filtering and deletion merging aggregate every realization by its successor edge set.
  3. Normalization and Collision Checks: The audit compares exact total mass, isolated-edge probability and shared-edge deletion preimages.
from fractions import Fraction as F
from itertools import product

def graph_kernel(edges, additions, triangles):
# Rate parameters are supplied to audit the finite sampling law.
factors = []
for edge, p in additions:
factors.append([(None, 1-p), (edge, p)])
for cycle, q in triangles:
factors.append([(None, 1-q)] + [(edge, q/3) for edge in cycle])
law = {}
count = {}
for outcome in product(*factors):
weight = F(1)
for _, probability in outcome:
weight *= probability
if weight == 0:
continue
accepted = {edge for edge, _ in outcome[:len(additions)] if edge is not None}
filtered = {edge for edge in accepted if edge[::-1] not in accepted and edge[0] != edge[1]}
deleted = {edge for edge, _ in outcome[len(additions):] if edge is not None}
successor = frozenset((set(edges) | filtered) - deleted)
law[successor] = law.get(successor, F(0)) + weight
count[successor] = count.get(successor, 0) + 1
assert sum(law.values()) == 1
return law, count

triangle = ((0,1),(1,2),(2,0))
law, _ = graph_kernel(triangle, [], [(triangle,F(3,5))])
specific = frozenset(set(triangle)-{(0,1)})
assert law[specific] == F(1,5)
print('Isolated triangle: total mass = 1; specified-edge deletion =', law[specific])

other = ((0,1),(1,3),(3,0))
edges = set(triangle) | set(other)
law, preimages = graph_kernel(edges, [], [(triangle,F(3,5)),(other,F(1,2))])
shared = frozenset(edges-{(0,1)})
assert preimages[shared] == 3
print('Shared triangles: total mass = 1; shared-edge-only preimages =', preimages[shared])

# Abstract reciprocal merge fixture: this checks merging, not proposal admission.
law, preimages = graph_kernel([], [((0,1),F(1,3)),((1,0),F(2,5))], [])
assert preimages[frozenset()] == 2
print('Reciprocal merge fixture: total mass = 1; unchanged-state preimages =', preimages[frozenset()])

Simulation Results:

Isolated triangle: total mass = 1; specified-edge deletion = 1/5
Shared triangles: total mass = 1; shared-edge-only preimages = 3
Reciprocal merge fixture: total mass = 1; unchanged-state preimages = 2

Conclusion: All three exact finite laws have total probability one. The isolated triangle gives probability one fifth for a specified deletion edge, including the uniform choice factor. Shared-edge and reciprocal fixtures expose three and two realization preimages respectively. These values validate the normalization and pushforward identities; proposal admission is outside the abstract reciprocal fixture.

In Plain English:
Section 4.6.3.2 formalizes the properties of the QBD calculation regarding euclidean action integration.


4.6.3.3 Type-Theoretic Validation via Lean 4 and Mathlib​

Lean 4 Encoding of Euclidean Transition Measure via Product Laws and Action Additivity

Type-theoretic certification of the pushforward normalization and additive Euclidean action established in Euclidean Transition Measure §4.6.3 proceeds via the following verification strategy:

  1. Model: Finite independent trial product laws, deterministic realization pushforwards, and negative-log Euclidean action sums represent the single-tick transition measure.
  2. Certified Claims: The module certifies nonnegativity and unit normalization of the pushforward transition measure, exact additivity of Euclidean action across independent trials, and exact support characterization of probability-one transitions in Euclidean Transition Measure §4.6.3.1.
  3. Scope Boundary: The certificate operates on finite frozen-snapshot trial spaces with real probabilities. Continuum path-integral limits remain outside this finite-tick measure check.
import QBDMathlib.Ch04.Defs
import Mathlib.Data.Fintype.Pi

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03 QBD.Ch04

namespace QBDMathlib.Ch04

noncomputable section

variable {I Ω X : Type*} [Fintype I] [Fintype Ω] [Fintype X]

/-- Independent local trials on a dependent product of finite outcome spaces. -/
def independentLaw [DecidableEq I] {O : I → Type*} [∀ i, Fintype (O i)]
(localLaw : ∀ i, FiniteLaw (O i)) :
FiniteLaw (∀ i, O i) := by
classical
exact ⟨fun ω => ∏ i, (localLaw i).weight (ω i),
fun ω => Finset.prod_nonneg (fun i _ => (localLaw i).nonneg (ω i)),
by rw [← Fintype.prod_sum]; simp only [(localLaw _).total, Finset.prod_const_one]⟩

theorem independent_event_mass {O : I → Type*} [∀ i, Fintype (O i)]
[DecidableEq I] (localLaw : ∀ i, FiniteLaw (O i)) (allowed : ∀ i, O i → Prop)
[∀ i, DecidablePred (allowed i)] :
(∑ ω : ∀ i, O i, if ∀ i, allowed i (ω i) then (independentLaw localLaw).weight ω else 0) =
∏ i, ∑ o, if allowed i o then (localLaw i).weight o else 0 := by
classical
rw [Fintype.prod_sum]
apply Finset.sum_congr rfl
intro ω _
by_cases all : ∀ i, allowed i (ω i)
· simp [all, independentLaw]
· obtain ⟨i, hi⟩ := not_forall.mp all
have zero : (∏ j, if allowed j (ω j) then (localLaw j).weight (ω j) else 0) = 0 :=
Finset.prod_eq_zero (Finset.mem_univ i) (by simp [hi])
rw [if_neg all, zero]

theorem pushforward_normalized [DecidableEq X] (realize : Ω → X) (law : FiniteLaw Ω) :
∑ x, pushWeight realize law.weight x = 1 := by
unfold pushWeight
rw [Finset.sum_comm]
simpa using law.total

omit [Fintype X] in
theorem pushforward_nonnegative [DecidableEq X] (realize : Ω → X) (law : FiniteLaw Ω) (x : X) :
0 ≤ pushWeight realize law.weight x :=
Finset.sum_nonneg fun ω _ => by
split
· exact law.nonneg ω
· exact le_rfl

theorem euclidean_action_additive [DecidableEq I] {O : I → Type*} [∀ i, Fintype (O i)]
(localLaw : ∀ i, FiniteLaw (O i)) (ω : ∀ i, O i)
(positive : ∀ i, 0 < (localLaw i).weight (ω i)) :
-Real.log ((independentLaw localLaw).weight ω) =
∑ i, -Real.log ((localLaw i).weight (ω i)) := by
change -Real.log (∏ i, (localLaw i).weight (ω i)) = _
rw [Real.log_prod (fun i _ => (positive i).ne'), Finset.sum_neg_distrib]

omit [Fintype X] in
/-- A fiber has mass one exactly when every positive-weight outcome belongs to it. -/
theorem pushforward_eq_one_iff [DecidableEq X] (realize : Ω → X) (law : FiniteLaw Ω) (x : X) :
pushWeight realize law.weight x = 1 ↔ ∀ ω, 0 < law.weight ω → realize ω = x := by
let outside := fun ω => if realize ω = x then 0 else law.weight ω
have nonneg (ω : Ω) : 0 ≤ outside ω := by
dsimp [outside]
split <;> first | exact le_rfl | exact law.nonneg ω
have splitMass : pushWeight realize law.weight x + ∑ ω, outside ω = 1 := by
unfold pushWeight
rw [← Finset.sum_add_distrib, ← law.total]
apply Finset.sum_congr rfl
intro ω _
by_cases h : realize ω = x <;> simp [outside, h]
constructor
· intro massOne ω positive
by_contra notEqual
have bound := Finset.single_le_sum (fun a _ => nonneg a) (Finset.mem_univ ω)
rw [show outside ω = law.weight ω by simp [outside, notEqual]] at bound
linarith
· intro fixed
have allZero (ω : Ω) : outside ω = 0 := by
by_cases pos : 0 < law.weight ω
· simp [outside, fixed ω pos]
· simp [outside, (le_antisymm (le_of_not_gt pos) (law.nonneg ω))]
simpa [allZero] using splitMass

end

end QBDMathlib.Ch04

#print axioms QBDMathlib.Ch04.independentLaw
#print axioms QBDMathlib.Ch04.pushforward_normalized
#print axioms QBDMathlib.Ch04.pushforward_nonnegative
#print axioms QBDMathlib.Ch04.euclidean_action_additive
#print axioms QBDMathlib.Ch04.pushforward_eq_one_iff

Verification Summary:

The machine-checked proofs confirm that independent frozen-snapshot trials induce a nonnegative normalized pushforward kernel whose Euclidean action adds linearly across trials and characterizes deterministic transitions exactly. Continuum path-integral limits remain outside this finite-tick formalization. The Lean 4 and Mathlib kernel accepts all closed proof terms using only standard axioms, certifying the transition-measure claims of Euclidean Transition Measure §4.6.3.

In Plain English:
Machine-checked Lean 4 proofs certify the formal claims verified in Section 4.6.3.4.


4.6.4 Lemma: Thermodynamic Arrow​

Irreversibility from entropy production in the evolution operator

Let G0,…,Gt+1G_0,\ldots,G_{t+1} be a Markov trajectory with finite entropies and kernel KK, and let p,qp,q be two distributions on the finite-horizon state class propagated by that same kernel. Then H(G0,…,Gt+1)−H(G0,…,Gt)=H(Gt+1∣Gt)≥0H(G_0,\ldots,G_{t+1})-H(G_0,\ldots,G_t)=H(G_{t+1}\mid G_t)\ge0 and DKL(pK∥qK)≤DKL(p∥q)D_{\mathrm{KL}}(pK\parallel qK)\le D_{\mathrm{KL}}(p\parallel q) (Evolution Operator §4.6.1).

In Plain English:
Section 4.6.4 formalizes the properties of the QBD lemma regarding thermodynamic arrow.


4.6.4.1 Proof: Thermodynamic Arrow​

Decomposition into Non-invertible Components via Thermodynamic Arrow

I. Chain Rule on Full Trajectories

The proof uses the specified objects and conventions (Evolution Operator §4.6.1).

For fixed vertex count and horizon TT, every active edge is absent or has a height in {0,…,T}\{0,\ldots,T\}, giving at most (T+2)N(N−1)(T+2)^{N(N-1)} labeled configurations. The distributions below are on this finite class. Write Γt=(G0,…,Gt)\Gamma_t=(G_0,\ldots,G_t). For each trajectory and successor of positive probability,

Pr⁡(Γt,g′)=Pr⁡(Γt)K(Gt,g′),log⁡Pr⁡(Γt,g′)=log⁡Pr⁡(Γt)+log⁡K(Gt,g′).\Pr(\Gamma_t,g')=\Pr(\Gamma_t)K(G_t,g'),\qquad \log\Pr(\Gamma_t,g')=\log\Pr(\Gamma_t)+\log K(G_t,g').

Multiply by the joint probability, sum, and use ∑g′K(Gt,g′)=1\sum_{g'}K(G_t,g')=1. The result is

H(Γt+1)=H(Γt)−∑gpt(g)∑g′K(g,g′)log⁡K(g,g′).H(\Gamma_{t+1})=H(\Gamma_t) -\sum_g p_t(g)\sum_{g'}K(g,g')\log K(g,g').

The final sum with its minus sign is H(Gt+1∣Gt)H(G_{t+1}\mid G_t). Every summand −Klog⁡K-K\log K is nonnegative for 0≤K≤10\le K\le1, using 0log⁡0=00\log0=0. It is positive exactly when a positive-mass current state has a nondegenerate successor distribution.

II. Log-Sum Inequality

For nonnegative finite families ai,bia_i,b_i with positive sums A,BA,B, put αi=ai/A\alpha_i=a_i/A and βi=bi/B\beta_i=b_i/B. If some ai>0=bia_i>0=b_i, the divergence is infinite and the inequality is immediate. Otherwise, −log⁡z≥1−z-\log z\ge1-z gives

∑iailog⁡aibi−Alog⁡AB=A∑i:αi>0αilog⁡αiβi≥A∑i:αi>0(αi−βi)=A(1−∑i:αi>0βi)≥0.\begin{aligned} \sum_i a_i\log\frac{a_i}{b_i}-A\log\frac AB &=A\sum_{i:\alpha_i>0}\alpha_i\log\frac{\alpha_i}{\beta_i}\\ &\ge A\sum_{i:\alpha_i>0}(\alpha_i-\beta_i)\\ &=A\left(1-\sum_{i:\alpha_i>0}\beta_i\right)\ge0. \end{aligned}

III. Common-Kernel Contraction

At each output yy, apply the inequality to ax=p(x)K(x,y)a_x=p(x)K(x,y) and bx=q(x)K(x,y)b_x=q(x)K(x,y). Summing over yy gives

DKL(pK∥qK)≤∑x,yp(x)K(x,y)log⁡p(x)K(x,y)q(x)K(x,y)=∑xp(x)log⁡p(x)q(x)∑yK(x,y)=DKL(p∥q).\begin{aligned} D_{\mathrm{KL}}(pK\parallel qK) &\le\sum_{x,y}p(x)K(x,y)\log\frac{p(x)K(x,y)}{q(x)K(x,y)}\\ &=\sum_xp(x)\log\frac{p(x)}{q(x)}\sum_yK(x,y)\\ &=D_{\mathrm{KL}}(p\parallel q). \end{aligned}

Zero-probability terms have their usual limiting values. If the input divergence is infinite, contraction is understood as an extended-value inequality. This proves both asserted information laws (Thermodynamic Arrow §4.6.4).

Q.E.D.

In Plain English:
Section 4.6.4.1 formalizes the properties of the QBD proof regarding thermodynamic arrow.


4.6.4.2 Calculation: Irreversibility Check​

Computational Verification of Shannon Entropy Loss via Stochastic Selection

Computational verification of the trajectory and common-kernel information inequalities established in (Thermodynamic Arrow §4.6.4.1) uses the normalized Markov law (Euclidean Transition Measure §4.6.3) through the following protocols:

  1. Distribution Construction: A binary stochastic kernel propagates two strictly positive input distributions.
  2. Entropy Accounting: The audit evaluates initial entropy, final entropy and the conditional contribution to joint trajectory entropy separately.
  3. Relative Entropy Comparison: The propagated divergence is compared with the input divergence, while an explicit concentration example tests decreasing snapshot entropy.
import math

def entropy(p):
return -sum(x*math.log(x) for x in p if x > 0)

def push(p, K):
return [sum(p[i]*K[i][j] for i in range(len(p))) for j in range(len(K[0]))]

def kl(p,q):
return sum(a*math.log(a/b) for a,b in zip(p,q) if a>0)

K = [[0.9,0.1],[0.9,0.1]]
p = [0.5,0.5]
q = [0.8,0.2]
after = push(p,K)
conditional = sum(p[i]*entropy(K[i]) for i in range(2))
joint = entropy([p[i]*K[i][j] for i in range(2) for j in range(2)])
assert abs(joint-entropy(p)-conditional)<1e-12
assert entropy(after)<entropy(p)
assert joint>=entropy(p)
assert kl(push(p,K),push(q,K))<=kl(p,q)+1e-12
print(f'Snapshot entropy change: {entropy(after)-entropy(p):.9f} nats')
print(f'Full trajectory entropy increment: {joint-entropy(p):.9f} nats')
print(f'Conditional entropy: {conditional:.9f} nats')
print(f'KL input / output: {kl(p,q):.9f} / {kl(push(p,K),push(q,K)):.9f}')

Simulation Results:

Snapshot entropy change: -0.368064207 nats
Full trajectory entropy increment: 0.325082973 nats
Conditional entropy: 0.325082973 nats
KL input / output: 0.223143551 / -0.000000000

Conclusion: The concentration example decreases snapshot entropy by approximately 0.368 nats while increasing full trajectory entropy by approximately 0.325 nats. The latter equals the conditional entropy to numerical precision. KL divergence contracts from approximately 0.223 nats to zero. These values validate the separated information identities rather than an inequality for snapshot entropy production.

In Plain English:
Section 4.6.4.2 formalizes the properties of the QBD calculation regarding irreversibility check.


4.6.4.3 Type-Theoretic Validation via Lean 4 and Mathlib​

Lean 4 Encoding of Thermodynamic Arrow via Trajectory Entropy Chain Rule and Data Processing

Type-theoretic certification of the trajectory entropy monotonicity and KL data processing established in Thermodynamic Arrow §4.6.4 proceeds via the following verification strategy:

  1. Model: Finite real probability distributions, Shannon trajectory entropies, finite Kullback-Leibler divergences, and Markov transition kernels represent macroscopic irreversibility.
  2. Certified Claims: The module certifies the trajectory entropy chain rule, nondecreasing trajectory entropy, the finite log-sum inequality, and the KL data-processing inequality under stochastic pushforwards in Thermodynamic Arrow §4.6.4.1.
  3. Scope Boundary: The inequalities hold for arbitrary finite-state Markov kernels with strictly positive reference support where required by the divergence formula. Infinite-state continuous entropy production lies outside this finite-kernel check.
import QBDMathlib.Ch04.Defs

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03 QBD.Ch04

namespace QBDMathlib.Ch04

noncomputable section

variable {X Y : Type*} [Fintype X] [Fintype Y]

private theorem neg_mul_log_mul (a b : ℝ) (ha : 0 ≤ a) (hb : 0 ≤ b) :
-(a * b * Real.log (a * b)) =
b * (-(a * Real.log a)) + a * (-(b * Real.log b)) := by
rcases ha.eq_or_lt with zero | pos
· simp [← zero]
rcases hb.eq_or_lt with zero | positive
· simp [← zero]
rw [Real.log_mul pos.ne' positive.ne']
ring

theorem trajectory_entropy_chain_rule (p : FiniteLaw X) (K : X → FiniteLaw Y) :
shannonEntropy (fun xy : X × Y => p.weight xy.1 * (K xy.1).weight xy.2) =
shannonEntropy p.weight + ∑ x, p.weight x * shannonEntropy (K x).weight := by
unfold shannonEntropy
rw [Fintype.sum_prod_type]
calc
_ = ∑ x, (-(p.weight x * Real.log (p.weight x)) +
p.weight x * ∑ y, -((K x).weight y * Real.log ((K x).weight y))) := by
apply Finset.sum_congr rfl
intro x _
simp_rw [neg_mul_log_mul _ _ (p.nonneg x) ((K x).nonneg _), Finset.sum_add_distrib,
← Finset.mul_sum, ← Finset.sum_mul, (K x).total, one_mul]
_ = _ := Finset.sum_add_distrib

theorem trajectory_entropy_monotone (p : FiniteLaw X) (K : X → FiniteLaw Y) :
shannonEntropy p.weight ≤
shannonEntropy (fun xy : X × Y => p.weight xy.1 * (K xy.1).weight xy.2) := by
rw [trajectory_entropy_chain_rule]
apply le_add_of_nonneg_right
apply Finset.sum_nonneg
intro x _
apply mul_nonneg (p.nonneg x)
apply Finset.sum_nonneg
intro y _
have leOne : (K x).weight y ≤ 1 := by
rw [← (K x).total]
exact Finset.single_le_sum (fun z _ => (K x).nonneg z) (Finset.mem_univ y)
exact neg_nonneg.mpr (mul_nonpos_of_nonneg_of_nonpos ((K x).nonneg y)
(Real.log_nonpos ((K x).nonneg y) leOne))

private theorem relative_term_lower {a b : ℝ} (ha : 0 ≤ a) (hb : 0 ≤ b)
(support : 0 < a → 0 < b) : a - b ≤ a * Real.log (a / b) := by
rcases ha.eq_or_lt with zero | pos
· simpa [← zero] using (neg_nonpos.mpr hb)
have bp := support pos
have logBound := mul_le_mul_of_nonneg_left
(Real.log_le_sub_one_of_pos (div_pos bp pos)) ha
rw [Real.log_div bp.ne' pos.ne'] at logBound
rw [Real.log_div pos.ne' bp.ne']
have clear : a * (b / a - 1) = b - a := by field_simp
rw [clear] at logBound
linarith

/-- Log-sum inequality with the support condition for finite real KL. -/
theorem finite_log_sum (a b : X → ℝ) (ha : ∀ x, 0 ≤ a x) (hb : ∀ x, 0 ≤ b x)
(support : ∀ x, 0 < a x → 0 < b x) :
mass a * Real.log (mass a / mass b) ≤ finiteKL a b := by
classical
by_cases zero : mass a = 0
· have zeroAt (x : X) : a x = 0 := by
have bound : a x ≤ mass a := Finset.single_le_sum (fun y _ => ha y) (Finset.mem_univ x)
linarith [ha x]
simp [zero, finiteKL, zeroAt]
have ap : 0 < mass a := lt_of_le_of_ne (Finset.sum_nonneg (fun x _ => ha x)) (Ne.symm zero)
have bp : 0 < mass b := by
by_contra! notPos
have allZero : ∀ x, a x = 0 := by
intro x
have bound : b x ≤ mass b := Finset.single_le_sum (fun y _ => hb y) (Finset.mem_univ x)
by_contra ne
have := support x (lt_of_le_of_ne (ha x) (Ne.symm ne))
linarith
exact zero (by simp [mass, allZero])
let ratio := mass a / mass b
have ratioPos : 0 < ratio := div_pos ap bp
have expand (x : X) :
a x * Real.log (a x / (b x * ratio)) =
a x * Real.log (a x / b x) - a x * Real.log ratio := by
rcases (ha x).eq_or_lt with h | h
· simp [← h]
rw [show a x / (b x * ratio) = (a x / b x) / ratio by ring,
Real.log_div (div_pos h (support x h)).ne' ratioPos.ne']
ring
have sumBound := Finset.sum_le_sum (s := (Finset.univ : Finset X)) (fun x _ =>
relative_term_lower (ha x) (mul_nonneg (hb x) ratioPos.le)
(fun positive => mul_pos (support x positive) ratioPos))
simp_rw [expand, Finset.sum_sub_distrib, ← Finset.sum_mul] at sumBound
change mass a - mass b * ratio ≤ finiteKL a b - mass a * Real.log ratio at sumBound
have cancel : mass b * ratio = mass a := by dsimp [ratio]; field_simp
rw [cancel, sub_self] at sumBound
exact sub_nonneg.mp sumBound

theorem finite_kl_data_processing (p q : FiniteLaw X) (K : X → FiniteLaw Y)
(support : ∀ x, 0 < p.weight x → 0 < q.weight x) :
finiteKL (rowStep p.weight (fun x => (K x).weight))
(rowStep q.weight (fun x => (K x).weight)) ≤ finiteKL p.weight q.weight := by
unfold finiteKL
calc
_ ≤ ∑ y, ∑ x, (p.weight x * (K x).weight y) *
Real.log ((p.weight x * (K x).weight y) / (q.weight x * (K x).weight y)) := by
apply Finset.sum_le_sum
intro y _
apply finite_log_sum (fun x => p.weight x * (K x).weight y)
(fun x => q.weight x * (K x).weight y)
· intro x
exact mul_nonneg (p.nonneg x) ((K x).nonneg y)
· intro x
exact mul_nonneg (q.nonneg x) ((K x).nonneg y)
· intro x positive
have pk : 0 < p.weight x := pos_of_mul_pos_left positive ((K x).nonneg y)
have ky : 0 < (K x).weight y := pos_of_mul_pos_right positive (p.nonneg x)
exact mul_pos (support x pk) ky
_ = _ := by
rw [Finset.sum_comm]
apply Finset.sum_congr rfl
intro x _
calc
_ = ∑ y, (p.weight x * Real.log (p.weight x / q.weight x)) * (K x).weight y := by
apply Finset.sum_congr rfl
intro y _
by_cases zero : (K x).weight y = 0
· simp [zero]
· rw [mul_div_mul_right _ _ zero]
ring
_ = _ := by rw [← Finset.mul_sum, (K x).total, mul_one]

end

end QBDMathlib.Ch04

#print axioms QBDMathlib.Ch04.trajectory_entropy_chain_rule
#print axioms QBDMathlib.Ch04.trajectory_entropy_monotone
#print axioms QBDMathlib.Ch04.finite_log_sum
#print axioms QBDMathlib.Ch04.finite_kl_data_processing

Verification Summary:

The machine-checked proofs establish the finite trajectory entropy chain rule, monotone growth of trajectory entropy, the finite log-sum inequality, and contraction of Kullback-Leibler divergence under Markov kernels. Infinite-state continuous limits remain outside this finite-kernel module. The Lean 4 and Mathlib kernel accepts all closed proof terms using only standard axioms, certifying the irreversibility claims of Thermodynamic Arrow §4.6.4.

In Plain English:
Machine-checked Lean 4 proofs certify the formal claims verified in Section 4.6.4.5.


4.6.5 Lemma: Conditional Triangle Drift​

Exact Conditional Triangle Drift via Frozen Trial Probabilities

Let GG be a fixed-vertex snapshot of the frozen unpumped tick, with old triangles C0\mathcal C_0, eligible additions A\mathcal A, and triangles T\mathcal T in the full candidate supergraph, where pep_e is the selection probability of ee with value zero outside A\mathcal A, qCq_C is the deletion trigger probability of C∈C0C\in\mathcal C_0, νe\nu_e counts members of T\mathcal T containing ee, and U(G)U(G) counts eligible chords of selection probability one with ineligible reverses and both supporting edges outside every old triangle. Then the conditional triangle drift satisfies the exact identity and bounds

aT=∏e∈E(T)∖E(G)pe(1−peˉ),dT=∏C∈C0(1−qC3∣E(C)∩E(T)∣),E[ΔN3∣G]=∑T∈T∖C0aTdT−∑T∈C0(1−dT),U(G)−∣C0∣≤E[ΔN3∣G]≤∑e∈Apeνe−∑C∈C0qC,\begin{gathered} a_T=\prod_{e\in E(T)\setminus E(G)}p_e(1-p_{\bar e}),\qquad d_T=\prod_{C\in\mathcal C_0}\left(1-\frac{q_C}{3}|E(C)\cap E(T)|\right),\\[2pt] \mathbb E[\Delta N_3\mid G] =\sum_{T\in\mathcal T\setminus\mathcal C_0}a_Td_T -\sum_{T\in\mathcal C_0}(1-d_T),\\[2pt] U(G)-|\mathcal C_0|\le\mathbb E[\Delta N_3\mid G] \le\sum_{e\in\mathcal A}p_e\nu_e-\sum_{C\in\mathcal C_0}q_C, \end{gathered}

where eˉ\bar e is the reverse of ee.

In Plain English:
Section 4.6.5 formalizes the properties of the QBD lemma regarding conditional triangle drift.


4.6.5.1 Proof: Conditional Triangle Drift​

Triangle Presence via Reciprocal Filtering and Categorical Deletion Products

I. New and Lost Triangles

The tick uses frozen candidate selection and old-triangle excision (Conditional Triangle Drift §4.6.5) (Evolution Operator §4.6.1).

Let A⊆AA\subseteq\mathcal A be the retained batch and D⊆E(G)D\subseteq E(G) the excisions. The final edge set is (E(G)∪A)∖D(E(G)\cup A)\setminus D. If C3(G)\mathcal C_3(G) and C3(F)\mathcal C_3(F) are the old and final triangle sets, respectively, then

N3(F)−N3(G)=∣C3(F)∖C3(G)∣−∣C3(G)∖C3(F)∣.N_3(F)-N_3(G)= |\mathcal C_3(F)\setminus\mathcal C_3(G)|- |\mathcal C_3(G)\setminus\mathcal C_3(F)|.

II. Probability of Triangle Presence

For e∉E(G)e\notin E(G), let XeX_e be the indicator that ee was selected, with Xe=0X_e=0 if e∉Ae\notin\mathcal A. For any T∈TT\in\mathcal T, each missing edge must survive reciprocal filtering. The sets {e,eˉ}\{e,\bar e\} for different edges of a directed triangle are pairwise disjoint. The conditional selection law (Euclidean Transition Measure §4.6.3) gives

Pr⁡(E(T)∖E(G)⊆A∣G)=Pr⁡(⋂e∈E(T)∖E(G){Xe=1, Xeˉ=0} | G)=∏e∈E(T)∖E(G)pe(1−peˉ)=aT.\begin{aligned} \Pr(E(T)\setminus E(G)\subseteq A\mid G) &=\Pr\left(\bigcap_{e\in E(T)\setminus E(G)} \{X_e=1,\ X_{\bar e}=0\}\,\middle|\,G\right)\\ &=\prod_{e\in E(T)\setminus E(G)}p_e(1-p_{\bar e}) =a_T. \end{aligned}

Let JCJ_C be the outcome of the deletion trial for CC, with JC=∅J_C=\varnothing for no trigger. With mC,T=∣E(C)∩E(T)∣m_{C,T}=|E(C)\cap E(T)|, the trial spares TT with probability

Pr⁡(JC∉E(T)∣G)=(1−qC)+(3−mC,T)qC3=1−qCmC,T3.\Pr(J_C\notin E(T)\mid G) =(1-q_C)+(3-m_{C,T})\frac{q_C}{3} =1-\frac{q_Cm_{C,T}}3 .

The deletion union meets E(T)E(T) exactly when at least one trial chooses an edge of TT. Independence across deletion trials and between the selection and deletion families gives

Pr⁡(D∩E(T)=∅∣G)=∏C∈C0Pr⁡(JC∉E(T)∣G)=dT,Pr⁡(T∈C3(F)∣G)=Pr⁡(E(T)∖E(G)⊆A, D∩E(T)=∅∣G)=aTdT.\begin{aligned} \Pr(D\cap E(T)=\varnothing\mid G) &=\prod_{C\in\mathcal C_0}\Pr(J_C\notin E(T)\mid G)=d_T,\\ \Pr(T\in\mathcal C_3(F)\mid G) &=\Pr(E(T)\setminus E(G)\subseteq A,\ D\cap E(T)=\varnothing\mid G)\\ &=a_Td_T. \end{aligned}

III. Exact Drift and Sufficient Sign Conditions

For T∈C0T\in\mathcal C_0 the empty product gives aT=1a_T=1. Taking expectations of the triangle counts in Part I gives

E[ΔN3∣G]=∑T∈T∖C0Pr⁡(T∈C3(F)∣G)−∑T∈C0Pr⁡(T∉C3(F)∣G)=∑T∈T∖C0aTdT−∑T∈C0(1−dT).\begin{aligned} \mathbb E[\Delta N_3\mid G] &=\sum_{T\in\mathcal T\setminus\mathcal C_0}\Pr(T\in\mathcal C_3(F)\mid G) -\sum_{T\in\mathcal C_0}\Pr(T\notin\mathcal C_3(F)\mid G)\\ &=\sum_{T\in\mathcal T\setminus\mathcal C_0}a_Td_T -\sum_{T\in\mathcal C_0}(1-d_T). \end{aligned}

A chord counted by U(G)U(G) specifies a triangle with exactly one missing edge. Distinct such chords specify distinct triangles because the missing edge identifies the chord. Its addition factor is 1(1−0)=11(1-0)=1. Its old support edges lie outside every old triangle, so mC,T=0m_{C,T}=0 for all CC and dT=1d_T=1. Thus

∑T∈T∖C0aTdT≥U(G),∑T∈C0(1−dT)≤∣C0∣.\sum_{T\in\mathcal T\setminus\mathcal C_0}a_Td_T\ge U(G),\qquad \sum_{T\in\mathcal C_0}(1-d_T)\le|\mathcal C_0|.

For each new TT, every missing edge ee gives aTdT≤pea_Td_T\le p_e. Summing over all missing edges and interchanging the sums yields

∑T∈T∖C0aTdT≤∑T∈T∖C0∑e∈E(T)∖E(G)pe=∑e∈Apeνe.\begin{aligned} \sum_{T\in\mathcal T\setminus\mathcal C_0}a_Td_T &\le\sum_{T\in\mathcal T\setminus\mathcal C_0} \sum_{e\in E(T)\setminus E(G)}p_e =\sum_{e\in\mathcal A}p_e\nu_e . \end{aligned}

For each old TT the factor with C=TC=T is 1−qT1-q_T. All other factors belong to [0,1][0,1], so dT≤1−qTd_T\le1-q_T. Substituting gives

U(G)−∣C0∣≤E[ΔN3∣G]≤∑e∈Apeνe−∑C∈C0qC,U(G)>∣C0∣ ⟹ E[ΔN3∣G]>0,∑e∈Apeνe<∑C∈C0qC ⟹ E[ΔN3∣G]<0.\begin{aligned} U(G)-|\mathcal C_0|&\le\mathbb E[\Delta N_3\mid G] \le\sum_{e\in\mathcal A}p_e\nu_e-\sum_{C\in\mathcal C_0}q_C,\\ U(G)>|\mathcal C_0|&\ \Longrightarrow\ \mathbb E[\Delta N_3\mid G]>0,\\ \sum_{e\in\mathcal A}p_e\nu_e<\sum_{C\in\mathcal C_0}q_C &\ \Longrightarrow\ \mathbb E[\Delta N_3\mid G]<0. \end{aligned}

For fixed N>0N>0, the conditional density drift is

E[Δ(N3/N)∣G]=N−1E[ΔN3∣G].\mathbb E[\Delta(N_3/N)\mid G]=N^{-1}\mathbb E[\Delta N_3\mid G].

IV. Degree and Stress Envelope

If the old undirected degree is at most Δ\Delta, each new neighbor is at old distance two. For each of at most Δ\Delta first neighbors, at most Δ−1\Delta-1 second neighbors differ from the starting vertex. The merged undirected degree is bounded by

deg⁡merged(v)≤Δ+Δ(Δ−1)=Δ2.\deg_{\text{merged}}(v)\le \Delta+\Delta(\Delta-1)=\Delta^2.

If ∣A∣≤M|\mathcal A|\le M, se≥s∗s_e\ge s_*, νe≤ν∗\nu_e\le\nu_*, and qC≥q∗q_C\ge q_*, then for μ≥0\mu\ge0,

E[ΔN3∣G]≤∑e∈Aνee−μse−∑C∈C0qC≤∣A∣ν∗e−μs∗−∣C0∣q∗≤Mν∗e−μs∗−∣C0∣q∗.\begin{aligned} \mathbb E[\Delta N_3\mid G] &\le\sum_{e\in\mathcal A}\nu_e e^{-\mu s_e}-\sum_{C\in\mathcal C_0}q_C\\ &\le|\mathcal A|\nu_*e^{-\mu s_*}-|\mathcal C_0|q_*\\ &\le M\nu_*e^{-\mu s_*}-|\mathcal C_0|q_*. \end{aligned}

V. Exact Drift in the Degree-Three Fixture

The old edge heights are H(a,b)=H(b,c)=H(c,d)=0H(a,b)=H(b,c)=H(c,d)=0 and H(c,a)=1H(c,a)=1. The complete two-path and return-edge lists are

supportreturn edgeold membership(a,b,c)(c,a)present(b,c,a)(a,b)present(c,a,b)(b,c)present(b,c,d)(d,b)absent\begin{array}{c|c|c} \text{support} & \text{return edge} & \text{old membership}\\\hline (a,b,c)&(c,a)&\text{present}\\ (b,c,a)&(a,b)&\text{present}\\ (c,a,b)&(b,c)&\text{present}\\ (b,c,d)&(d,b)&\text{absent} \end{array}

The candidate (d,b)(d,b) has height 1+H(c,d)=11+H(c,d)=1. The simple reverse route b→c→db\to c\to d has height pair (0,0)(0,0) and fails 0<00<0. The route through c→ac\to a can only continue to bb, repeating the start. Thus the reverse-witness test passes. The old triangle counts at a,b,c,da,b,c,d are 1,1,1,01,1,1,0, giving

sadd(d,b)=1+1+0=2,sdel(a,b,c)=1+1+1−1=2.s_{\mathrm{add}}(d,b)=1+1+0=2,\qquad s_{\mathrm{del}}(a,b,c)=1+1+1-1=2 .

The respective probabilities follow from (Addition Probability §4.5.6) (Deletion Probability §4.5.7)

p=e−2μ0,q=min⁡{1,12(1+2λ0)e−2μ0}.p=e^{-2\mu_0},\qquad q=\min\{1,\tfrac12(1+2\lambda_0)e^{-2\mu_0}\}.

The old triangle is lost with probability qq. The new triangle survives when its candidate is selected and edge (b,c)(b,c) is kept, which has probability p(1−q/3)p(1-q/3) by independence and the uniform deletion choice. The exact triangle drift is therefore

E[ΔN3∣G]=p(1−q/3)−q≤p−q<0\mathbb E[\Delta N_3\mid G]=p(1-q/3)-q\le p-q<0

at the canonical parameters, since 12(1+2λ0)>1\tfrac12(1+2\lambda_0)>1 and p<1p<1.

VI. Exact Drift at Breadth-First Ignition

Label the vacuum tree in breadth-first order from root 00, with three children at the root and two per subsequent parent up to vertex N−1N-1 (Regular Bethe Fragment §3.2.1). All tree edges have height zero. Let G1G_1 be the tree after adding (4,0)(4,0) of height one, so C0={C0}\mathcal C_0=\{C_0\} with C0=(0,1,4)C_0=(0,1,4). The path (0,1,4)(0,1,4) already has its closing edge. The two-paths (1,4,0)(1,4,0) and (4,0,1)(4,0,1) also have their closing edges. For N≥11N\ge11 the remaining candidate supports are the other outward tree two-paths and the two paths (4,0,2)(4,0,2) and (4,0,3)(4,0,3).

An outward tree two-path ending at uu has a unique tree parent of uu as intermediate vertex. The added edge (4,0)(4,0) cannot supply a second intermediate vertex on such a path. For each path (4,0,j)(4,0,j) with j∈{2,3}j\in\{2,3\}, the only edge entering jj is (0,j)(0,j), so the support is unique. Each missing closing edge has a source of maximum incoming height zero, giving proposed height one. A strictly increasing reverse path ending below height one would consist of a single height-zero edge. The reverse edge is absent for each of these proposals. Thus, writing ℓ(v)\ell(v) for the original tree depth,

#{outward tree two-paths}=#{u:ℓ(u)≥2}=N−4,#{eligible outward tree closures}=(N−4)−1=N−5,∣A∣=(N−5)+2=N−3.\begin{aligned} \#\{\text{outward tree two-paths}\}&=\#\{u:\ell(u)\ge2\}=N-4,\\ \#\{\text{eligible outward tree closures}\}&=(N-4)-1=N-5,\\ |\mathcal A|&=(N-5)+2=N-3 . \end{aligned}

Tree edges and the two added edges into 44 have depth increment +1+1. The ignition edge and all other proposals have increment −2-2. In a triangle with kk edges of increment −2-2, the sum of increments is (3−k)−2k=3−3k(3-k)-2k=3-3k, giving k=1k=1. If a triangle uses a cross-branch addition (j,4)(j,4), its other advancing edge either enters jj from root 00 or leaves 44 for one of its children. In the first case the retreat is the old edge (4,0)(4,0). In the second case the retreat from the child of 44 goes to its grandparent 11, which differs from jj. A triangle without a cross-branch addition has two old tree edges and its single retreat. Thus each new triangle uses exactly one proposal. The reverse increments −1-1 and +2+2 are absent, so each reciprocal factor equals one.

The triangle vertices 0,1,40,1,4 each have one old incidence. The table groups all proposals of positive stress once their endpoint labels are present.

sesupporting paths∣E(T)∩E(C0)∣1(0,2,6), (0,2,7), (0,3,8), (0,3,9)01(1,5,12), (1,5,13)01(4,10,22), (4,10,23), (4,11,24), (4,11,25)02(0,1,5), (1,4,10), (1,4,11)12(4,0,2), (4,0,3)1\begin{array}{c|l|c} s_e&\text{supporting paths}&|E(T)\cap E(C_0)|\\\hline 1&(0,2,6),\ (0,2,7),\ (0,3,8),\ (0,3,9)&0\\ 1&(1,5,12),\ (1,5,13)&0\\ 1&(4,10,22),\ (4,10,23),\ (4,11,24),\ (4,11,25)&0\\ 2&(0,1,5),\ (1,4,10),\ (1,4,11)&1\\ 2&(4,0,2),\ (4,0,3)&1 \end{array}

For N≥26N\ge26 the table gives ten stress-one and five stress-two proposals. The other (N−3)−10−5=N−18(N-3)-10-5=N-18 proposals have stress zero. With a=e−μ0a=e^{-\mu_0}, the old trigger probability and the drift are

sdel(C0)=1+1+1−1=2,q=min⁡{1,12(1+2λ0)a2},E[ΔN3∣G1]=(N−18)⋅1+10a⋅1+5a2(1−q/3)−q=N−10.786755982….\begin{aligned} s_{\text{del}}(C_0)&=1+1+1-1=2,\\ q&=\min\{1,\tfrac12(1+2\lambda_0)a^2\},\\ \mathbb E[\Delta N_3\mid G_1] &=(N-18)\cdot1+10a\cdot1+5a^2(1-q/3)-q\\ &=N-10.786755982\ldots . \end{aligned}

For 11≤N<2611\le N<26, the four paths in the first row are present and each contributes aa expected births. The old loss is q≤1q\le1. Since μ0=1/2π<1/2\mu_0=1/\sqrt{2\pi}<1/2,

a=e−μ0≥1−μ0>12,E[ΔN3∣G1]≥4a−q>1>0.a=e^{-\mu_0}\ge1-\mu_0>\frac12,\qquad \mathbb E[\Delta N_3\mid G_1]\ge4a-q>1>0.

Q.E.D.

In Plain English:
Section 4.6.5.1 formalizes the properties of the QBD proof regarding conditional triangle drift.


4.6.5.2 Calculation: Degree-Three Drift Calculation​

Foster-Lyapunov Drift Verification via Exact Event Enumeration of the Degree-Three Drift Fixture

Verification of the degree-three triangle drift fixture (Conditional Triangle Drift §4.6.5.1) (Evolution Operator §4.6.1) is based on the following protocols:

  1. Fixture: Use the directed triangle with one outgoing tail and its single closing proposal.
  2. Outcome Law: Evaluate the canonical addition and old-triangle deletion probabilities.
  3. Drift: Sum the changes over the two addition outcomes and four deletion outcomes.
from itertools import product
from math import e, exp, isclose, pi, sqrt


mu, lam = 1 / sqrt(2 * pi), e - 1
p = exp(-2 * mu)
q = min(1, (1 + 2 * lam) * exp(-2 * mu) / 2)
old_triangle = {("a", "b"), ("b", "c"), ("c", "a")}
new_triangle = {("b", "c"), ("c", "d"), ("d", "b")}
old = old_triangle | {("c", "d")}
delete_choices = [(None, 1 - q)] + [(edge, q / 3) for edge in sorted(old_triangle)]
drift = 0.0
for (add, add_weight), (edge, del_weight) in product(
[(False, 1 - p), (True, p)], delete_choices
):
final = (old | ({("d", "b")} if add else set())) - {edge}
change = int(old_triangle <= final) + int(new_triangle <= final) - 1
drift += add_weight * del_weight * change

assert isclose(drift, p * (1 - q / 3) - q)
assert drift <= p - q < 0
print(f"Enumerated one-tick triangle drift: {drift:.8f}")
print(f"Site-summed upper bound: {p - q:.8f}")

Simulation Results:

Enumerated one-tick triangle drift: -0.69848930
Site-summed upper bound: -0.54856855

Conclusion:

The enumerated drift is negative and lies below the site-summed bound. The fixture confirms the analytic one-tick value and inequality on this snapshot.

In Plain English:
Section 4.6.5.2 formalizes the properties of the QBD calculation regarding degree-three drift calculation.


4.6.5.3 Type-Theoretic Validation via Lean 4 and Mathlib​

Lean 4 Encoding of Conditional Triangle Drift via Frozen-Tick Pushforward Marginals and Incidence Bounds

Type-theoretic certification of the conditional triangle drift decomposition and incidence bounds established in Conditional Triangle Drift §4.6.5 proceeds via the following verification strategy:

  1. Model: Normalized frozen-tick pushforward samplers over finite addition and deletion trials, local triangle avoidance events, and expected directed-triangle counts represent one-tick geometric drift.
  2. Certified Claims: The module derives both birth and retention marginals directly from the normalized frozen-tick pushforward sampler, certifies exact conditional triangle drift factorization and expected directed-triangle change, and establishes explicit upper and lower incidence bounds in Conditional Triangle Drift §4.6.5.1.
  3. Scope Boundary: Uniform bounded-degree graph snapshots and normalized independent-trial pushforward kernels are supplied as finite-tick hypotheses. Continuum partial-differential-equation limits remain outside this discrete-tick drift certificate.
import QBDMathlib.Ch04.L4_6_3_EuclideanTransitionMeasure
import QBDMathlib.Ch04.FrozenTickKernel
import QBDMathlib.Ch04.FrozenTriangleMarginals

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03 QBD.Ch04

namespace QBDMathlib.Ch04

noncomputable section

variable {Ω C E : Type*} [Fintype Ω] [Fintype C]

def triangleBirthFactor (missing : Finset E) (p : E → ℝ) (reverse : E → E) : ℝ :=
∏ e ∈ missing, p e * (1 - p (reverse e))

def triangleRetentionFactor (old : Finset C) (q : C → ℝ) (overlap : C → ℕ) : ℝ :=
∏ c ∈ old, (1 - q c * (overlap c : ℝ) / 3)

def triangleMarginal [DecidableEq C] (law : FiniteLaw Ω) (after : Ω → Finset C) (t : C) : ℝ :=
∑ ω, if t ∈ after ω then law.weight ω else 0

theorem triangle_local_avoidance (q : ℝ) (overlap : ℕ) (h : overlap ≤ 3) :
(1 - q) + ((3 - overlap : ℕ) : ℝ) * (q / 3) = 1 - q * overlap / 3 := by
rw [Nat.cast_sub h]
ring

theorem independent_triangle_marginal {I : Type*} [Fintype I] [DecidableEq I]
{O : I → Type*} [∀ i, Fintype (O i)] [DecidableEq C]
(localLaw : ∀ i, FiniteLaw (O i)) (after : (∀ i, O i) → Finset C) (t : C)
(allowed : ∀ i, O i → Prop) [∀ i, DecidablePred (allowed i)]
(occurs : ∀ ω, t ∈ after ω ↔ ∀ i, allowed i (ω i)) :
triangleMarginal (independentLaw localLaw) after t =
∏ i, ∑ v, if allowed i v then (localLaw i).weight v else 0 := by
unfold triangleMarginal
simp_rw [occurs]
exact independent_event_mass localLaw allowed

theorem conditional_triangle_drift [DecidableEq C] (law : FiniteLaw Ω) (old : Finset C)
(after : Ω → Finset C) :
(∑ ω, law.weight ω * ((after ω).card - (old.card : ℝ))) =
(∑ t ∈ Finset.univ \ old, triangleMarginal law after t) -
∑ t ∈ old, (1 - triangleMarginal law after t) := by
classical
have counts (ω : Ω) :
(∑ t : C, if t ∈ after ω then law.weight ω else 0) = law.weight ω * (after ω).card := by
rw [← Finset.sum_filter]
simp [Finset.sum_const, mul_comm]
have marginals : (∑ t, triangleMarginal law after t) =
∑ ω, law.weight ω * (after ω).card := by
simp_rw [triangleMarginal]
rw [Finset.sum_comm]
exact Finset.sum_congr rfl (fun ω _ => counts ω)
rw [← Finset.sum_sdiff (f := triangleMarginal law after) (Finset.subset_univ old)] at marginals
simp_rw [mul_sub, Finset.sum_sub_distrib, ← Finset.sum_mul, law.total, one_mul]
simp only [Finset.sum_const, nsmul_eq_mul, mul_one]
linarith

/-- The bounds use a sure-birth contribution and incidence upper bounds on the marginal sums. -/
theorem triangle_drift_bounds [DecidableEq C] (law : FiniteLaw Ω) (old : Finset C)
(after : Ω → Finset C) (sureBirths birthBound triggerBound : ℝ)
(lower : sureBirths ≤ ∑ t ∈ Finset.univ \ old, triangleMarginal law after t)
(upper : (∑ t ∈ Finset.univ \ old, triangleMarginal law after t) ≤ birthBound)
(trigger : triggerBound ≤ ∑ t ∈ old, (1 - triangleMarginal law after t)) :
sureBirths - old.card ≤ (∑ ω, law.weight ω * ((after ω).card - (old.card : ℝ))) ∧
(∑ ω, law.weight ω * ((after ω).card - (old.card : ℝ))) ≤ birthBound - triggerBound := by
rw [conditional_triangle_drift]
have net : (∑ t ∈ old, (1 - triangleMarginal law after t)) ≤ (old.card : ℝ) := by
calc
_ ≤ ∑ _t ∈ old, (1 : ℝ) := by
apply Finset.sum_le_sum
intro t _
apply sub_le_self
unfold triangleMarginal
exact Finset.sum_nonneg (fun ω _ => by
by_cases h : t ∈ after ω
· simpa [h] using law.nonneg ω
· simp [h])
_ = _ := by simp
exact ⟨sub_le_sub lower net, sub_le_sub upper trigger⟩

/-- Substitution of the independent birth and retention marginals into the count drift. -/
theorem conditional_triangle_drift_factors [DecidableEq C] (law : FiniteLaw Ω) (old : Finset C)
(after : Ω → Finset C) (missing : C → Finset E) (p : E → ℝ) (reverse : E → E)
(q : C → ℝ) (overlap : C → C → ℕ)
(newMarginal : ∀ t, t ∉ old → triangleMarginal law after t =
triangleBirthFactor (missing t) p reverse * triangleRetentionFactor old q (overlap t))
(oldMarginal : ∀ t ∈ old, triangleMarginal law after t = triangleRetentionFactor old q (overlap t)) :
(∑ ω, law.weight ω * ((after ω).card - (old.card : ℝ))) =
(∑ t ∈ Finset.univ \ old, triangleBirthFactor (missing t) p reverse *
triangleRetentionFactor old q (overlap t)) -
∑ t ∈ old, (1 - triangleRetentionFactor old q (overlap t)) := by
rw [conditional_triangle_drift]
congr 1
· exact Finset.sum_congr rfl (fun t ht => newMarginal t (Finset.mem_sdiff.mp ht).2)
· exact Finset.sum_congr rfl (fun t ht => by rw [oldMarginal t ht])

private theorem product_le_member {α : Type*} (s : Finset α) (f : α → ℝ)
(h : ∀ a ∈ s, 0 ≤ f a ∧ f a ≤ 1) {a : α} (member : a ∈ s) :
(∏ i ∈ s, f i) ≤ f a := by
classical
rw [← Finset.prod_erase_mul s f member]
apply mul_le_of_le_one_left (h a member).1
exact Finset.prod_le_one₀
(fun i hi => (h i (Finset.mem_of_mem_erase hi)).1)
(fun i hi => (h i (Finset.mem_of_mem_erase hi)).2)

/-- The incidence bound double-counts missing edges over the candidate triangles.
The lower bound uses only guaranteed births and the number of old triangles. -/
theorem conditional_triangle_drift_incidence_bounds [DecidableEq C] [Fintype E] [DecidableEq E]
(law : FiniteLaw Ω) (old sure : Finset C) (after : Ω → Finset C)
(missing : C → Finset E) (reverse : E → E) (p : E → ℝ) (q : C → ℝ)
(overlap : C → C → ℕ)
(pBounds : ∀ e, 0 ≤ p e ∧ p e ≤ 1) (qBounds : ∀ c, 0 ≤ q c ∧ q c ≤ 1)
(overlapBound : ∀ t c, overlap t c ≤ 3) (selfOverlap : ∀ t ∈ old, overlap t t = 3)
(newMissing : ∀ t, t ∉ old → (missing t).Nonempty)
(newMarginal : ∀ t, t ∉ old → triangleMarginal law after t =
triangleBirthFactor (missing t) p reverse * triangleRetentionFactor old q (overlap t))
(oldMarginal : ∀ t ∈ old, triangleMarginal law after t = triangleRetentionFactor old q (overlap t))
(sureNew : sure ⊆ Finset.univ \ old)
(sureAdd : ∀ t ∈ sure, ∀ e ∈ missing t, p e = 1 ∧ p (reverse e) = 0)
(sureRetain : ∀ t ∈ sure, ∀ c ∈ old, overlap t c = 0) :
let drift := ∑ ω, law.weight ω * ((after ω).card - (old.card : ℝ))
let incidence := fun e => ((Finset.univ \ old).filter (fun t => e ∈ missing t)).card
(sure.card : ℝ) - old.card ≤ drift ∧
drift ≤ (∑ e, p e * incidence e) - ∑ t ∈ old, q t := by
classical
dsimp only
have selects (e : E) : 0 ≤ p e * (1 - p (reverse e)) ∧
p e * (1 - p (reverse e)) ≤ 1 := by
have damp := mul_le_of_le_one_right (pBounds e).1 (sub_le_self _ (pBounds (reverse e)).1)
exact ⟨mul_nonneg (pBounds e).1 (sub_nonneg.mpr (pBounds (reverse e)).2), damp.trans (pBounds e).2⟩
have keeps (t c : C) : 0 ≤ 1 - q c * (overlap t c : ℝ) / 3 ∧
1 - q c * (overlap t c : ℝ) / 3 ≤ 1 := by
have bound : (overlap t c : ℝ) ≤ 3 := by exact_mod_cast overlapBound t c
have factor : q c * (overlap t c : ℝ) ≤ (1 : ℝ) * 3 :=
mul_le_mul (qBounds c).2 bound (by positivity) (by norm_num)
constructor
· linarith
· exact sub_le_self _ (by positivity [(qBounds c).1])
apply triangle_drift_bounds law old after
· calc
(sure.card : ℝ) = ∑ t ∈ sure, triangleMarginal law after t := by
have point (t : C) (ht : t ∈ sure) : triangleMarginal law after t = 1 := by
rw [newMarginal t (Finset.mem_sdiff.mp (sureNew ht)).2]
unfold triangleBirthFactor triangleRetentionFactor
have birth : (∏ e ∈ missing t, p e * (1 - p (reverse e))) = 1 := by
exact Finset.prod_eq_one (fun e he => by rw [(sureAdd t ht e he).1, (sureAdd t ht e he).2]; norm_num)
have retain : (∏ c ∈ old, (1 - q c * (overlap t c : ℝ) / 3)) = 1 := by
exact Finset.prod_eq_one (fun c hc => by simp [sureRetain t ht c hc])
rw [birth, retain, mul_one]
rw [Finset.sum_congr rfl point]
simp
_ ≤ _ := Finset.sum_le_sum_of_subset_of_nonneg sureNew fun t _ _ => by
unfold triangleMarginal
apply Finset.sum_nonneg
intro ω _
split
· exact law.nonneg ω
· exact le_rfl
· calc
_ ≤ ∑ t ∈ Finset.univ \ old, ∑ e ∈ missing t, p e := by
apply Finset.sum_le_sum
intro t ht
have outside := (Finset.mem_sdiff.mp ht).2
obtain ⟨e, he⟩ := newMissing t outside
rw [newMarginal t outside]
have birth₀ : 0 ≤ triangleBirthFactor (missing t) p reverse :=
Finset.prod_nonneg (fun e _ => (selects e).1)
have retain₁ : triangleRetentionFactor old q (overlap t) ≤ 1 :=
Finset.prod_le_one₀ (fun c _ => (keeps t c).1) (fun c _ => (keeps t c).2)
calc
_ ≤ triangleBirthFactor (missing t) p reverse := mul_le_of_le_one_right birth₀ retain₁
_ ≤ p e * (1 - p (reverse e)) := product_le_member _ _ (fun e _ => selects e) he
_ ≤ p e := mul_le_of_le_one_right (pBounds e).1 (sub_le_self _ (pBounds (reverse e)).1)
_ ≤ _ := Finset.single_le_sum (fun e _ => (pBounds e).1) he
_ = _ := by
calc
_ = ∑ t ∈ Finset.univ \ old, ∑ e : E, if e ∈ missing t then p e else 0 := by
apply Finset.sum_congr rfl
intro t _
rw [← Finset.sum_filter]
simp
_ = ∑ e : E, ∑ t ∈ Finset.univ \ old, if e ∈ missing t then p e else 0 := Finset.sum_comm
_ = _ := by
apply Finset.sum_congr rfl
intro e _
rw [← Finset.sum_filter]
simp [Finset.sum_const, mul_comm]
· apply Finset.sum_le_sum
intro t ht
rw [oldMarginal t ht]
have single : triangleRetentionFactor old q (overlap t) ≤ 1 - q t * (overlap t t : ℝ) / 3 :=
product_le_member _ _ (fun c _ => keeps t c) ht
rw [selfOverlap t ht] at single
push_cast at single
linarith

end

open QBD.Ch04
open scoped Classical

noncomputable section

/-- A directed triangle is represented by its least-vertex rotation. -/
abbrev CanonicalTriad (N : ℕ) :=
{p : Fin N × Fin N × Fin N // QBD.Ch02.ThreeDistinct p.1 p.2.1 p.2.2 ∧
p.1 < p.2.1 ∧ p.1 < p.2.2}

def canonicalTriadEdges {N : ℕ} (t : CanonicalTriad N) : Finset (QBD.Edge (Fin N)) :=
Finset.univ.image (triangleCoordinate t.val)

private theorem triad_edges_no_reverse {N : ℕ} (t : CanonicalTriad N)
(e : QBD.Edge (Fin N)) (he : e ∈ canonicalTriadEdges t) :
e.swap ∉ canonicalTriadEdges t := by
rintro hx
obtain ⟨i, _, eq⟩ := Finset.mem_image.mp he
obtain ⟨j, _, rev⟩ := Finset.mem_image.mp hx
rw [← eq] at rev
rcases t with ⟨⟨a,b,c⟩, ⟨⟨ab, ac, bc⟩, _, _⟩⟩
fin_cases i <;> fin_cases j <;> (
have first := congrArg Prod.fst rev
have second := congrArg Prod.snd rev
dsimp [triangleCoordinate, Prod.swap] at first second
first
| exact ab first
| exact ab first.symm
| exact ac first
| exact ac first.symm
| exact bc first
| exact bc first.symm
| exact ab second
| exact ab second.symm
| exact ac second
| exact ac second.symm
| exact bc second
| exact bc second.symm)

def canonicalActiveTriads {N : ℕ} (G : QBD.TimestampedGraph (Fin N)) :
Finset (CanonicalTriad N) :=
Finset.univ.filter fun t => ∀ e ∈ canonicalTriadEdges t, G.edges e

def canonicalCandidateTriads {N : ℕ} (G : QBD.TimestampedGraph (Fin N)) :
Finset (CanonicalTriad N) :=
Finset.univ.filter fun t => ∀ e ∈ canonicalTriadEdges t, G.edges e ∨ HasAdditionSite G e

private theorem triad_edges_present {N : ℕ} (G : QBD.TimestampedGraph (Fin N))
(t : CanonicalTriad N) :
(∀ e ∈ canonicalTriadEdges t, G.edges e) ↔
G.edges (t.val.1, t.val.2.1) ∧ G.edges (t.val.2.1, t.val.2.2) ∧
G.edges (t.val.2.2, t.val.1) := by
constructor
· intro all
have atIndex (j : Fin 3) : G.edges (triangleCoordinate t.val j) :=
all _ (Finset.mem_image.mpr ⟨j, Finset.mem_univ _, rfl⟩)
exact ⟨atIndex 0, atIndex 1, atIndex 2⟩
· intro all e he
obtain ⟨j, _, rfl⟩ := Finset.mem_image.mp he
fin_cases j
· exact all.1
· exact all.2.1
· exact all.2.2

/-- The finite set used by the probability proof counts the same triangles as Core's catalog. -/
theorem canonical_active_triads_card {N : ℕ} (G : QBD.TimestampedGraph (Fin N)) :
(canonicalActiveTriads G).card = QBD.Ch01.directedTriangleCount G.E := by
classical
let S := fun w => (QBD.Ch01.canonicalTrianglesThrough G.E w).toFinset
let bijection : (canonicalActiveTriads G : Finset (CanonicalTriad N)) ≃ (Σ w, (S w : Type)) := {
toFun := fun ⟨t, ht⟩ => by
obtain ⟨ab, bc, ca⟩ := (triad_edges_present G t).mp (Finset.mem_filter.mp ht).2
refine ⟨t.val.2.1, ⟨(t.val.1, t.val.2.2), List.mem_toFinset.mpr ?_⟩⟩
exact ((QBD.Ch01.canonical_triangles_spec G.E t.val.2.1).2 t.val.1 t.val.2.2).mpr
⟨ab, bc, ca, t.property.2.1, t.property.2.2, t.property.1.2.2⟩
invFun := fun ⟨w, ⟨⟨v, u⟩, hu⟩⟩ => by
obtain ⟨ab, bc, ca, leastW, leastU, different⟩ :=
((QBD.Ch01.canonical_triangles_spec G.E w).2 v u).mp (List.mem_toFinset.mp hu)
let t : CanonicalTriad N := ⟨(v, w, u), ⟨leastW.ne, leastU.ne, different⟩, leastW, leastU⟩
exact ⟨t, Finset.mem_filter.mpr ⟨Finset.mem_univ _, (triad_edges_present G t).mpr ⟨ab, bc, ca⟩⟩⟩
left_inv := by rintro ⟨⟨⟨_, _, _⟩, _⟩, _⟩; rfl
right_inv := by rintro ⟨_, ⟨⟨_, _⟩, _⟩⟩; rfl }
have count := Fintype.card_congr bijection
simp only [Fintype.card_sigma, Fintype.card_coe] at count
have sumFin {n : ℕ} (f : Fin n → ℕ) : (∑ w, f w) = QBD.finSum f := by
induction n with
| zero => simp [QBD.finSum]
| succ n ih =>
rw [Fin.sum_univ_succ, ih]
simp [QBD.finSum, List.finRange_succ, Function.comp_def]
rw [count]
simp only [S, List.toFinset_card_of_nodup (QBD.Ch01.canonical_triangles_spec G.E _).1]
exact sumFin _

def frozenTriadBirth {N : ℕ} (G : QBD.TimestampedGraph (Fin N)) (μ : ℝ) (t : CanonicalTriad N) : ℝ :=
triangleBirthFactor (missingFrozenEdges G (canonicalTriadEdges t)) (frozenAdditionChance G μ) Prod.swap

def frozenTriadRetention {N : ℕ} (G : QBD.TimestampedGraph (Fin N)) (μ catalyst : ℝ)
(t : CanonicalTriad N) : ℝ :=
triangleRetentionFactor Finset.univ (frozenDeletionChance G μ catalyst)
(frozenTriangleOverlap G (canonicalTriadEdges t))

theorem frozen_tick_pushforward_expectation {N : ℕ} (G : QBD.TimestampedGraph (Fin N))
(μ catalyst : ℝ) (mu : 0 ≤ μ) (cat : 0 ≤ catalyst)
(observable : QBD.TimestampedGraph (Fin N) → ℝ) :
(∑ H : FrozenSuccessor G, (frozenTickKernel G μ catalyst mu cat).weight H * observable H.val) =
∑ ξ : FrozenTickOutcome G, (frozenTickLaw G μ catalyst mu cat).weight ξ *
observable (realizeFrozenTick G ξ) := by
classical
let realize := fun ξ => (⟨realizeFrozenTick G ξ, ⟨ξ, rfl⟩⟩ : FrozenSuccessor G)
let law := frozenTickLaw G μ catalyst mu cat
change (∑ H : FrozenSuccessor G, pushWeight realize law.weight H * observable H.val) = _
unfold pushWeight
simp_rw [Finset.sum_mul]
rw [Finset.sum_comm]
apply Finset.sum_congr rfl
intro ξ _
simp [ite_mul, realize, law]

private theorem candidate_of_realized {N : ℕ} (G : QBD.TimestampedGraph (Fin N))
(ξ : FrozenTickOutcome G) {t : CanonicalTriad N}
(present : t ∈ canonicalActiveTriads (realizeFrozenTick G ξ)) :
t ∈ canonicalCandidateTriads G := by
refine Finset.mem_filter.mpr ⟨Finset.mem_univ _, fun e he => ?_⟩
rcases ((frozen_edge_present G ξ e).mp ((Finset.mem_filter.mp present).2 e he)).1 with old | fresh
· exact Or.inl old
· obtain ⟨a, _, eq⟩ := fresh.1
exact Or.inr ⟨a, eq⟩

private theorem frozen_outcome_triad_marginal {N : ℕ} (G : QBD.TimestampedGraph (Fin N))
(μ catalyst : ℝ) (mu : 0 ≤ μ) (cat : 0 ≤ catalyst)
(t : CanonicalTriad N) (candidate : t ∈ canonicalCandidateTriads G) :
triangleMarginal (frozenTickLaw G μ catalyst mu cat)
(fun ξ => canonicalActiveTriads (realizeFrozenTick G ξ)) t =
frozenTriadBirth G μ t * frozenTriadRetention G μ catalyst t := by
have eligible (e : QBD.Edge (Fin N)) (h : e ∈ missingFrozenEdges G (canonicalTriadEdges t)) :
HasAdditionSite G e := by
have he := Finset.mem_filter.mp h
apply ((Finset.mem_filter.mp candidate).2 e he.1).resolve_left
simpa [QBD.TimestampedGraph.edges] using he.2
have noReverse (e : QBD.Edge (Fin N)) (h : e ∈ missingFrozenEdges G (canonicalTriadEdges t)) :
e.swap ∉ missingFrozenEdges G (canonicalTriadEdges t) :=
fun h' => triad_edges_no_reverse t e (Finset.mem_filter.mp h).1 (Finset.mem_filter.mp h').1
unfold triangleMarginal
simp only [canonicalActiveTriads, Finset.mem_filter, Finset.mem_univ, true_and]
exact frozen_required_edges_marginal G μ catalyst mu cat _ eligible noReverse

theorem frozen_kernel_triad_marginal {N : ℕ} (G : QBD.TimestampedGraph (Fin N))
(μ catalyst : ℝ) (mu : 0 ≤ μ) (cat : 0 ≤ catalyst)
(t : CanonicalTriad N) (candidate : t ∈ canonicalCandidateTriads G) :
triangleMarginal (frozenTickKernel G μ catalyst mu cat) (fun H => canonicalActiveTriads H.val) t =
frozenTriadBirth G μ t * frozenTriadRetention G μ catalyst t := by
have expectation := frozen_tick_pushforward_expectation G μ catalyst mu cat
(fun H => if t ∈ canonicalActiveTriads H then 1 else 0)
simp only [mul_ite, mul_one, mul_zero] at expectation
exact expectation.trans (frozen_outcome_triad_marginal G μ catalyst mu cat t candidate)

private theorem old_triad_is_candidate {N : ℕ} (G : QBD.TimestampedGraph (Fin N))
{t : CanonicalTriad N} (old : t ∈ canonicalActiveTriads G) :
t ∈ canonicalCandidateTriads G :=
Finset.mem_filter.mpr ⟨Finset.mem_univ _, fun e he => Or.inl ((Finset.mem_filter.mp old).2 e he)⟩

theorem frozen_kernel_old_triad_retention {N : ℕ} (G : QBD.TimestampedGraph (Fin N))
(μ catalyst : ℝ) (mu : 0 ≤ μ) (cat : 0 ≤ catalyst)
(t : CanonicalTriad N) (old : t ∈ canonicalActiveTriads G) :
triangleMarginal (frozenTickKernel G μ catalyst mu cat) (fun H => canonicalActiveTriads H.val) t =
frozenTriadRetention G μ catalyst t := by
rw [frozen_kernel_triad_marginal G μ catalyst mu cat t (old_triad_is_candidate G old)]
have none : missingFrozenEdges G (canonicalTriadEdges t) = ∅ := by
apply Finset.eq_empty_iff_forall_notMem.mpr
intro e he
have parts := Finset.mem_filter.mp he
have state := (Finset.mem_filter.mp old).2 e parts.1
simp [state] at parts
simp [frozenTriadBirth, triangleBirthFactor, none]

/-- Exact drift of the frozen tick, as an expectation over the normalized row kernel. -/
theorem frozen_kernel_conditional_triangle_drift {N : ℕ} (G : QBD.TimestampedGraph (Fin N))
(μ catalyst : ℝ) (mu : 0 ≤ μ) (cat : 0 ≤ catalyst) :
(∑ H : FrozenSuccessor G, (frozenTickKernel G μ catalyst mu cat).weight H *
((QBD.Ch01.directedTriangleCount H.val.E : ℝ) - (QBD.Ch01.directedTriangleCount G.E : ℝ))) =
(∑ t ∈ canonicalCandidateTriads G \ canonicalActiveTriads G,
frozenTriadBirth G μ t * frozenTriadRetention G μ catalyst t) -
∑ t ∈ canonicalActiveTriads G, (1 - frozenTriadRetention G μ catalyst t) := by
simp_rw [← canonical_active_triads_card]
let old := canonicalActiveTriads G
let candidates := canonicalCandidateTriads G
let after := fun H : FrozenSuccessor G => canonicalActiveTriads H.val
let law := frozenTickKernel G μ catalyst mu cat
have outside (t : CanonicalTriad N) (absent : t ∉ candidates) : triangleMarginal law after t = 0 := by
unfold triangleMarginal
apply Finset.sum_eq_zero
intro H _
obtain ⟨ξ, heq⟩ := H.property
have no : t ∉ after H := fun mem => absent (candidate_of_realized G ξ (heq.symm ▸ mem))
simp [no]
have subset : candidates \ old ⊆ Finset.univ \ old := fun t ht =>
Finset.mem_sdiff.mpr ⟨Finset.mem_univ _, (Finset.mem_sdiff.mp ht).2⟩
rw [conditional_triangle_drift law old after]
congr 1
· calc
_ = ∑ t ∈ candidates \ old, triangleMarginal law after t := by
symm
apply Finset.sum_subset subset
intro t ht missing
exact outside t (fun h => missing (Finset.mem_sdiff.mpr ⟨h, (Finset.mem_sdiff.mp ht).2⟩))
_ = _ := Finset.sum_congr rfl fun t ht =>
frozen_kernel_triad_marginal G μ catalyst mu cat t (Finset.mem_sdiff.mp ht).1
· exact Finset.sum_congr rfl fun t ht => by
rw [frozen_kernel_old_triad_retention G μ catalyst mu cat t ht]

end

end QBDMathlib.Ch04

#print axioms QBDMathlib.Ch04.canonical_active_triads_card
#print axioms QBDMathlib.Ch04.frozen_tick_pushforward_expectation
#print axioms QBDMathlib.Ch04.frozen_kernel_triad_marginal
#print axioms QBDMathlib.Ch04.frozen_kernel_old_triad_retention
#print axioms QBDMathlib.Ch04.frozen_kernel_conditional_triangle_drift

Verification Summary:

The machine-checked proofs derive both birth and retention marginals directly from the normalized frozen-tick pushforward sampler, establish the exact expected change in the directed triangle count, and certify explicit upper and lower incidence bounds on one-tick drift. Continuum partial-differential-equation limits remain outside this finite-tick drift certificate. The Lean 4 and Mathlib kernel accepts all closed proof terms using only standard axioms, certifying the drift claims of Conditional Triangle Drift §4.6.5.

In Plain English:
Machine-checked Lean 4 proofs certify the formal claims verified in Section 4.6.5.4.


4.6.6 Lemma: Exact Unpumped Quiescence​

Exact Unpumped Quiescence via Fixed Points of the Finite Unpumped Snapshot Kernel

Let GG be a finite active snapshot for the canonical unpumped tick. Then K(G,G)=1K(G,G)=1 exactly when there are no old triangles and every eligible addition candidate has an eligible reciprocal partner.

In Plain English:
Section 4.6.6 formalizes the properties of the QBD lemma regarding exact unpumped quiescence.


4.6.6.1 Proof: Exact Unpumped Quiescence​

Exact Unpumped Quiescence via Positive Deletion Trials and Reciprocal Filtering

I. One-Tick Outcomes

In the canonical unpumped tick, every retained addition belongs to an absent ordered pair of GG, and the deletion union contains only old edges selected by old triangles (Evolution Operator §4.6.1). Write C\mathcal C for the old triangles and AA for the eligible additions. If DD is the deletion union and AretA_{\mathrm{ret}} the retained additions, the final edge set is

E′=(E∪Aret)∖D,Aret∩E=∅,D⊆E.E'=(E\cup A_{\mathrm{ret}})\setminus D,\qquad A_{\mathrm{ret}}\cap E=\varnothing,\quad D\subseteq E.

Thus E′=EE'=E holds exactly when both AretA_{\mathrm{ret}} and DD are empty, in which case all active heights are also unchanged.

II. Positive Deletion Event

If c∈Cc\in\mathcal C, its canonical trigger weight is

qc=min⁡{1,12(1+λ0sc)e−μ0sc}>0,q_c=\min\{1,\tfrac12(1+\lambda_0s_c)e^{-\mu_0s_c}\}>0,

because the stress is finite and nonnegative and λ0,μ0>0\lambda_0,\mu_0>0. If this trial triggers, one of its old edges belongs to DD, regardless of the outcomes of other trials. Consequently

K(G,G)=Pr⁡(E′=E∣G)≤1−qc<1.K(G,G)=\Pr(E'=E\mid G)\le 1-q_c<1.

III. Triangle-Free Addition Outcomes

If C=∅\mathcal C=\varnothing, then D=∅D=\varnothing and each candidate has zero stress. Its selection probability is e0=1e^0=1, so all of AA is selected with probability one. The retained set is then deterministic,

Aret={(u,v)∈A:(v,u)∉A}.A_{\mathrm{ret}}=\{(u,v)\in A:(v,u)\notin A\}.

Thus the output equals the input exactly when this set is empty. Together with Section II this gives the stated equivalence (Exact Unpumped Quiescence §4.6.6).

Q.E.D.

In Plain English:
Section 4.6.6.1 formalizes the properties of the QBD proof regarding exact unpumped quiescence.


4.6.6.2 Calculation: Reciprocal-Aware Quiescence Fixtures​

Reciprocal-Aware Quiescence Fixtures via Finite Quiescence Checks on Three Timestamped Snapshots

Verification of quiescence on the three explicit inputs (Exact Unpumped Quiescence §4.6.6.1) (Evolution Operator §4.6.1) is based on the following protocols:

  1. Fixtures: Construct a four-cycle, a single two-path, and an old triangle.
  2. Admission: Check candidate uniqueness and the bounded increasing reverse path.
  3. Kernel: Evaluate reciprocal cancellation in the triangle-free fixtures and test the triangle deletion event.
from math import e, exp, log2, pi, sqrt

import networkx as nx


def candidates(graph):
result = set()
cutoff = int(log2(len(graph))) + 3
for v in graph:
for w in graph[v]:
for u in graph[w]:
if len({v, w, u}) < 3 or graph.has_edge(v, u) or graph.has_edge(u, v):
continue
if any(z != w and graph.has_edge(z, u) for z in graph[v]):
continue
height = 1 + max(data["height"] for _, _, data in graph.in_edges(u, data=True))
blocked = False
for path in nx.all_simple_paths(graph, v, u, cutoff=cutoff):
heights = [graph[a][b]["height"] for a, b in zip(path, path[1:])]
if (len(heights) >= 2 and heights[-1] < height
and all(a < b for a, b in zip(heights, heights[1:]))):
blocked = True
break
if not blocked:
result.add((u, v))
return result


for name, edges, count, expected in [
("four-cycle", [(0, 1, 0), (1, 2, 0), (2, 3, 0), (3, 0, 0)], 4, True),
("two-path", [(0, 1, 0), (1, 2, 0)], 1, False),
("triangle", [(0, 1, 0), (1, 2, 0), (2, 0, 1)], 0, False),
]:
graph = nx.DiGraph()
graph.add_weighted_edges_from(edges, weight="height")
eligible = candidates(graph)
assert len(eligible) == count
retained = {(u, v) for u, v in eligible if (v, u) not in eligible}
triangles = [cycle for cycle in nx.simple_cycles(graph) if len(cycle) == 3]
positive_deletion = bool(triangles)
if positive_deletion:
q = min(1, (1 + 2 * (e - 1)) * exp(-2 / sqrt(2 * pi)) / 2)
assert q > 0
quiescent = not positive_deletion and not retained
assert quiescent == expected
print(f"{name}: {len(eligible)} eligible, quiescent={quiescent}")

Simulation Results:

four-cycle: 4 eligible, quiescent=True
two-path: 1 eligible, quiescent=False
triangle: 0 eligible, quiescent=False

Conclusion:

The four-cycle is quiescent, the path has a surviving addition, and the triangle has a positive deletion event. These outputs confirm the quiescence classification for all three fixtures.

In Plain English:
Section 4.6.6.2 formalizes the properties of the QBD calculation regarding reciprocal-aware quiescence fixtures.


4.6.6.3 Type-Theoretic Validation via Lean 4 Core​

Lean 4 Encoding of Exact Unpumped Quiescence via Fixed-Point Support Characterization

Type-theoretic certification of the exact fixed-point quiescence criterion established in Exact Unpumped Quiescence §4.6.6 proceeds via the following verification strategy:

  1. Model: Boolean active edge sets, reciprocal-cancelled retained additions, frozen deletions, and explicit triangle-free support predicates represent unpumped quiescence.
  2. Certified Claims: The module certifies the exact fixed-point characterization of evolution edges and proves exact unpumped quiescence whenever no deletion triggers and no retained triangle-forming additions occur in Exact Unpumped Quiescence §4.6.6.1.
  3. Scope Boundary: Quiescence consumes explicit support conditions for deletion triggers and triangle-free addition outcomes. Externally pumped boundary driving remains outside this unpumped fixed-point check.
import QBD.Ch04.Defs

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03

namespace QBD.Ch04

theorem evolution_edges_fixed_iff {V : Type} {E A D : Edge V → Prop}
(addLegal : IsLegalAdditionSet E A) (delLegal : IsLegalDeletionSet E D) :
(∀ e, evolutionEdges E A D e ↔ E e) ↔ ((∀ e, ¬ A e) ∧ (∀ e, ¬ D e)) := by
constructor
· intro fixed
refine ⟨?_, ?_⟩
· intro e selected
have absent := addLegal e selected
have notDeleted : ¬ D e := fun removed => absent (delLegal e removed)
exact absent ((fixed e).mp ⟨Or.inr selected, notDeleted⟩)
· intro e removed
exact ((fixed e).mpr (delLegal e removed)).2 removed
· intro ⟨noAdd, noDelete⟩ e
simp [evolutionEdges, noAdd e, noDelete e]

/-- The support of the tick records which outcomes have positive weight. -/
theorem exact_unpumped_quiescence {V Ω C : Type} {E eligible : Edge V → Prop}
(supported : Ω → Prop) (selected deleted : Ω → Edge V → Prop)
(addLegal : ∀ ω, IsLegalAdditionSet E (selected ω))
(delLegal : ∀ ω, IsLegalDeletionSet E (deleted ω))
(supportNonempty : ∃ ω, supported ω)
(trigger : ∀ c : C, ∃ ω e, supported ω ∧ deleted ω e)
(triangleFree : (∀ c : C, False) → ∀ ω, supported ω →
(∀ e, selected ω e ↔ retainedAdditions eligible e) ∧ (∀ e, ¬ deleted ω e)) :
(∀ ω, supported ω → ∀ e, evolutionEdges E (selected ω) (deleted ω) e ↔ E e) ↔
((∀ c : C, False) ∧ ∀ e, eligible e → eligible (e.2, e.1)) := by
classical
constructor
· intro fixed
have noTriangles (c : C) : False := by
obtain ⟨ω, e, support, removal⟩ := trigger c
exact ((evolution_edges_fixed_iff (addLegal ω) (delLegal ω)).mp (fixed ω support)).2 e removal
obtain ⟨ω, support⟩ := supportNonempty
refine ⟨noTriangles, fun e candidate => ?_⟩
by_cases reverse : eligible (e.2, e.1)
· exact reverse
· exact False.elim (((evolution_edges_fixed_iff (addLegal ω) (delLegal ω)).mp
(fixed ω support)).1 e ((triangleFree noTriangles ω support).1 e |>.mpr ⟨candidate, reverse⟩))
· intro ⟨noTriangles, reciprocal⟩ ω support
have ⟨filters, noDelete⟩ := triangleFree noTriangles ω support
apply (evolution_edges_fixed_iff (addLegal ω) (delLegal ω)).mpr
exact ⟨fun e selectedEdge => let h := (filters e).mp selectedEdge
h.2 (reciprocal e h.1), noDelete⟩

end QBD.Ch04

#print axioms QBD.Ch04.evolution_edges_fixed_iff
#print axioms QBD.Ch04.exact_unpumped_quiescence

Verification Summary:

The machine-checked proofs establish the exact fixed-point condition for evolved edges and confirm that unpumped snapshots lacking deletion triggers and surviving additions remain strictly quiescent. Driven open-boundary dynamics remain outside this unpumped fixed-point module. The Lean 4 kernel accepts all closed proof terms using only standard axioms, certifying the quiescence claims of Exact Unpumped Quiescence §4.6.6.

In Plain English:
Machine-checked Lean 4 proofs certify the formal claims verified in Section 4.6.6.4.


4.6.7 Lemma: Finite-Horizon Height Bound​

Finite Active State Space through a Fixed Horizon

Let the vertex set be finite and fixed, and the active heights be nonnegative integers. After tt unpumped ticks their maximum is bounded by Hmax⁡(0)+tH_{\max}(0)+t, with the maximum of an empty graph taken as zero, so the reachable active snapshots through any fixed horizon form a finite set.

In Plain English:
Section 4.6.7 formalizes the properties of the QBD lemma regarding finite-horizon height bound.


4.6.7.1 Proof: Finite-Horizon Height Bound​

Finite-Horizon Height Bound via Induction on the Maximum Active Height

I. Domain and Objects

An admitted addition uses its incoming source maximum (Finite-Horizon Height Bound §4.6.7) (Creation Timestamp §1.4.4).

II. Single-Tick Maximum

Each retained chord has height one plus an incoming source maximum in the frozen snapshot, at most Hmax⁡(t)+1H_{\max}(t)+1. A retained old edge keeps its height and deletion cannot increase the maximum. Thus Hmax⁡(t+1)≤Hmax⁡(t)+1H_{\max}(t+1)\le H_{\max}(t)+1.

III. Finite Horizon

At t=0t=0 the bound is equality. If Hmax⁡(t)≤Hmax⁡(0)+tH_{\max}(t)\le H_{\max}(0)+t, then

Hmax⁡(t+1)≤Hmax⁡(t)+1≤Hmax⁡(0)+t+1.H_{\max}(t+1)\le H_{\max}(t)+1 \le H_{\max}(0)+t+1 .

Hence the bound holds through the horizon TT. For each of the PP directed pairs, the possibilities are one absent state and Hmax⁡(0)+T+1H_{\max}(0)+T+1 present heights, including zero. Taking the product over pairs bounds the number of snapshots by

(Hmax⁡(0)+T+2)P\bigl(H_{\max}(0)+T+2\bigr)^P

active snapshots in that horizon.

Q.E.D.

In Plain English:
Section 4.6.7.1 formalizes the properties of the QBD proof regarding finite-horizon height bound.


4.6.7.2 Type-Theoretic Validation via Lean 4 Core​

Lean 4 Encoding of Finite-Horizon Height Bound via Tick Induction and Injective Encoding

Type-theoretic certification of the linear height ceiling and finite snapshot encoding established in Finite-Horizon Height Bound §4.6.7 proceeds via the following verification strategy:

  1. Model: Timestamped active graphs on a fixed finite vertex set, source-side incoming maxima, multi-tick evolution steps, and finite bounded-height state encodings represent finite-horizon state compactness.
  2. Certified Claims: The module certifies per-step incoming and evolution height bounds, the finite-horizon linear height ceiling, injectivity of the bounded active-state encoding, and exact recovery of active snapshots from bounded codes in Finite-Horizon Height Bound §4.6.7.1.
  3. Scope Boundary: The bound applies over any finite logical horizon starting from bounded initial heights on a fixed vertex set. Infinite-horizon unbounded height growth is reduced separately by shift equivariance.
import QBD.Ch04.Defs

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03

namespace QBD.Ch04

theorem incoming_height_bound {N : Nat} (G : TimestampedGraph (Fin N)) (u : Fin N)
(M : Nat) (bound : ∀ e, G.edges e → G.H e ≤ M) : G.incomingMaximum u ≤ M := by
rcases (G.incomingMaximum_spec u).2 with zero | ⟨x, active, attained⟩
· simp [zero]
· rw [attained]
exact bound _ active

theorem evolution_height_bound {N : Nat} (G : TimestampedGraph (Fin N))
(A D : Edge (Fin N) → Prop) (M : Nat) (bound : ∀ e, G.edges e → G.H e ≤ M) :
∀ e, (evolutionOperator G A D).H e ≤ M + 1 := by
classical
intro e
unfold evolutionOperator
dsimp
split
· unfold newCreationHeight
have h := incoming_height_bound G e.1 M bound
omega
· split
· rename_i old
have h := bound e old.1
omega
· omega

theorem finite_horizon_height_bound {N : Nat} (G : Nat → TimestampedGraph (Fin N))
(A D : Nat → Edge (Fin N) → Prop) (step : ∀ t, G (t + 1) = evolutionOperator (G t) (A t) (D t))
(M : Nat) (initial : ∀ e, (G 0).edges e → (G 0).H e ≤ M) :
∀ t e, (G t).edges e → (G t).H e ≤ M + t := by
intro t
induction t with
| zero => exact initial
| succ t ih =>
intro e _
rw [step t]
exact evolution_height_bound _ _ _ _ ih e

/-- Absent coordinates use zero, and heights zero through `B` use codes one through `B+1`. -/
def encodeBoundedActiveHeights {P : Type} (B : Nat)
(snapshot : P → Option (Fin (B + 1))) : P → Fin (B + 2) :=
fun e => match snapshot e with
| none => ⟨0, by omega⟩
| some h => ⟨h.val + 1, by have := h.isLt; omega⟩

theorem bounded_active_encoding_injective {P : Type} (B : Nat)
{s t : P → Option (Fin (B + 1))}
(eq : encodeBoundedActiveHeights B s = encodeBoundedActiveHeights B t) : s = t := by
funext e
have atE := congrArg (fun f : P → Fin (B + 2) => (f e).val) eq
cases hs : s e <;> cases ht : t e <;> simp [encodeBoundedActiveHeights, hs, ht] at atE ⊢
exact Fin.ext (by omega)

def boundedActiveSnapshot {N : Nat} (G : TimestampedGraph (Fin N)) (B : Nat)
(bound : ∀ e, G.edges e → G.H e ≤ B) : Edge (Fin N) → Option (Fin (B + 1)) :=
fun e => if h : G.E e = true then some ⟨G.H e, Nat.lt_succ_of_le (bound e h)⟩ else none

theorem bounded_snapshot_codes_determine_active_state {N B : Nat} {G H : TimestampedGraph (Fin N)}
(gBound : ∀ e, G.edges e → G.H e ≤ B) (hBound : ∀ e, H.edges e → H.H e ≤ B)
(codes : encodeBoundedActiveHeights B (boundedActiveSnapshot G B gBound) =
encodeBoundedActiveHeights B (boundedActiveSnapshot H B hBound)) :
G.E = H.E ∧ ∀ e, G.edges e → G.H e = H.H e := by
have same := bounded_active_encoding_injective B codes
have point (e : Edge (Fin N)) : G.E e = H.E e ∧ (G.edges e → G.H e = H.H e) := by
have eq := congrFun same e
cases hg : G.E e <;> cases hh : H.E e <;>
simp [boundedActiveSnapshot, TimestampedGraph.edges, hg, hh] at eq ⊢
exact eq
exact ⟨funext fun e => (point e).1, fun e => (point e).2⟩

end QBD.Ch04

#print axioms QBD.Ch04.incoming_height_bound
#print axioms QBD.Ch04.evolution_height_bound
#print axioms QBD.Ch04.finite_horizon_height_bound
#print axioms QBD.Ch04.bounded_active_encoding_injective
#print axioms QBD.Ch04.bounded_snapshot_codes_determine_active_state

Verification Summary:

The machine-checked proofs confirm that causal heights grow by at most one per logical tick, yielding an injective finite-state encoding of all active snapshots reachable within any finite horizon. Unbounded-horizon reduction is handled separately by shift equivariance. The Lean 4 kernel accepts all closed proof terms using only standard axioms, certifying the height-bound claims of Finite-Horizon Height Bound §4.6.7.

In Plain English:
Machine-checked Lean 4 proofs certify the formal claims verified in Section 4.6.7.3.


4.6.8 Lemma: Common-Height Shift Equivariance​

Common-Height Shift Equivariance via Common-Shift Quotient of the Active Unpumped Kernel

Let two unpumped snapshots agree in adjacency and differ by a common integer shift on active heights, with both assignments nonnegative. Their transition probabilities agree on shift classes, and the quotient is finite on any invariant class with fixed vertices and a uniform finite height span.

In Plain English:
Section 4.6.8 formalizes the properties of the QBD lemma regarding common-height shift equivariance.


4.6.8.1 Proof: Common-Height Shift Equivariance​

Coupling by Shared Tick Outcomes

I. Translation of the Eligibility Tests

Let H′=H+cH'=H+c on the common active edge set EE. For an eligible return chord e=(u,v)e=(u,v) the old incoming support at uu is nonempty (Common-Height Shift Equivariance §4.6.8) (Evolution Operator §4.6.1). Writing heh_e and he′h'_e for the two candidate heights gives

he′=1+max⁡(x,u)∈E(H(x,u)+c)=1+max⁡(x,u)∈EH(x,u)+c=he+c.h'_e=1+\max_{(x,u)\in E}\bigl(H(x,u)+c\bigr) =1+\max_{(x,u)\in E}H(x,u)+c=h_e+c.

For an old witness with edge list e1,…,eℓe_1,\ldots,e_\ell, the corresponding differences are

H′(ej+1)−H′(ej)=H(ej+1)−H(ej),he′−H′(eℓ)=he−H(eℓ).H'(e_{j+1})-H'(e_j)=H(e_{j+1})-H(e_j),\qquad h'_e-H'(e_\ell)=h_e-H(e_\ell).

Every strict comparison therefore has the same truth value. The two-path counts and triangle stresses are functions of EE, so both inputs also have the same uniqueness tests and trial probabilities.

II. Equality on Output Classes

Use the same vector ω\omega of trial outcomes for the two inputs. It has the same law by equality of the snapshot-conditioned probabilities. The reciprocal filter and deletion rule applied to this vector produce the same set EωE_\omega in both cases. For a surviving old edge the heights differ by cc by hypothesis. For a retained new edge they differ by cc by Section I. Thus the outputs F(E,H;ω)F(E,H;\omega) and F(E,H′;ω)F(E,H';\omega) lie in the same shift class for every ω\omega. For any shift class C\mathcal C, this gives

Pr⁡(F(E,H;ω)∈C)=E[1C(F(E,H;ω))]=E[1C(F(E,H′;ω))]=Pr⁡(F(E,H′;ω)∈C).\Pr(F(E,H;\omega)\in\mathcal C) =\mathbb E[\mathbf 1_{\mathcal C}(F(E,H;\omega))] =\mathbb E[\mathbf 1_{\mathcal C}(F(E,H';\omega))] =\Pr(F(E,H';\omega)\in\mathcal C).

III. Counting Representatives under a Span Bound

For nonempty EE with span at most BB, subtract min⁡e∈EH(e)\min_{e\in E}H(e) to get a representative whose active heights lie in {0,…,B}\{0,\ldots,B\}. If mm is the number of possible directed edges on the fixed vertex set, the number of quotient states is at most

1+∑j=1m(mj)(B+1)j=(B+2)m.1+\sum_{j=1}^{m}\binom mj(B+1)^j=(B+2)^m.

The term one counts the empty adjacency. Hence the invariant quotient is finite.

Q.E.D.

In Plain English:
Section 4.6.8.1 formalizes the properties of the QBD proof regarding common-height shift equivariance.


4.6.8.2 Type-Theoretic Validation via Lean 4 Core​

Lean 4 Encoding of Common-Height Shift Equivariance via Uniform Offset Translation

Type-theoretic certification of the uniform height-shift equivariance established in Common-Height Shift Equivariance §4.6.8 proceeds via the following verification strategy:

  1. Model: Uniform natural-number height shifts on active edges, pairwise height comparisons, source-side creation heights, and shifted evolution operators represent relative-height invariance.
  2. Certified Claims: The module certifies that uniform shifts preserve all active height comparisons, shift newly created heights by the identical offset, commute with the evolution operator, and yield bounded canonical shift representatives in Common-Height Shift Equivariance §4.6.8.1.
  3. Scope Boundary: Shift equivariance applies to active snapshot dynamics depending only on relative edge heights. Absolute birth-tick coordinates in the historical ledger are not shifted.
import QBD.Ch04.Defs

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03

namespace QBD.Ch04

def CommonHeightShift {N : Nat} (G G' : TimestampedGraph (Fin N)) (c : Int) : Prop :=
G.E = G'.E ∧ ∀ e, G.edges e → (G'.H e : Int) = (G.H e : Int) + c

theorem active_comparisons_shift {N : Nat} {G G' : TimestampedGraph (Fin N)} {c : Int}
(shift : CommonHeightShift G G' c) {e f : Edge (Fin N)} (he : G.edges e) (hf : G.edges f) :
G'.H e < G'.H f ↔ G.H e < G.H f := by
have first := shift.2 e he
have second := shift.2 f hf
omega

private theorem incoming_maximum_attained {N : Nat} (G : TimestampedGraph (Fin N)) (u : Fin N)
(nonempty : ∃ x, G.edges (x, u)) :
∃ x, G.edges (x, u) ∧ G.incomingMaximum u = G.H (x, u) := by
rcases (G.incomingMaximum_spec u).2 with zero | attained
· obtain ⟨x, hx⟩ := nonempty
have bound := (G.incomingMaximum_spec u).1 x hx
change G.H (x, u) ≤ G.incomingMaximum u at bound
exact ⟨x, hx, by omega⟩
· exact attained

theorem new_height_shift {N : Nat} {G G' : TimestampedGraph (Fin N)} {c : Int}
(shift : CommonHeightShift G G' c) (u : Fin N) (incoming : ∃ x, G.edges (x, u)) :
(newCreationHeight G' u : Int) = (newCreationHeight G u : Int) + c := by
obtain ⟨x, hx, maxX⟩ := incoming_maximum_attained G u incoming
have same (y : Fin N) : G'.edges (y, u) ↔ G.edges (y, u) := by
change G'.E (y, u) = true ↔ G.E (y, u) = true
rw [shift.1]
obtain ⟨y, hy, maxY⟩ := incoming_maximum_attained G' u
(let ⟨z, hz⟩ := incoming; ⟨z, (same z).2 hz⟩)
have lower := (G'.incomingMaximum_spec u).1 x ((same x).2 hx)
have upper := (G.incomingMaximum_spec u).1 y ((same y).1 hy)
change G'.H (x, u) ≤ G'.incomingMaximum u at lower
change G.H (y, u) ≤ G.incomingMaximum u at upper
have sx := shift.2 (x, u) hx
have sy := shift.2 (y, u) ((same y).1 hy)
unfold newCreationHeight
omega

theorem evolution_height_shift {N : Nat} {G G' : TimestampedGraph (Fin N)} {c : Int}
(shift : CommonHeightShift G G' c) (A D : Edge (Fin N) → Prop)
(incoming : ∀ e, retainedAdditions A e → ∃ x, G.edges (x, e.1)) :
CommonHeightShift (evolutionOperator G A D) (evolutionOperator G' A D) c := by
classical
have same : G.edges = G'.edges := congrArg (fun p => fun e => p e = true) shift.1
constructor
· unfold evolutionOperator
simp only [same]
· intro e active
change decide (evolutionEdges G.edges (retainedAdditions A) D e) = true at active
have present := of_decide_eq_true active
by_cases added : retainedAdditions A e
· simpa [evolutionOperator, added] using new_height_shift shift e.1 (incoming e added)
· have old : G.edges e ∧ ¬ D e := ⟨present.1.resolve_right added, present.2⟩
have old' : G'.edges e ∧ ¬ D e :=
⟨(congrFun same e).mp old.1, old.2⟩
simpa only [evolutionOperator, if_neg added, if_pos old, if_pos old'] using shift.2 e old.1

def normalizeActiveHeights {N : Nat} (G : TimestampedGraph (Fin N)) (minHeight : Nat) :
TimestampedGraph (Fin N) :=
⟨G.E, fun e => if G.E e then G.H e - minHeight else 0⟩

theorem bounded_shift_representative {N : Nat} (G : TimestampedGraph (Fin N)) (minHeight span : Nat)
(within : ∀ e, G.edges e → minHeight ≤ G.H e ∧ G.H e ≤ minHeight + span) :
CommonHeightShift G (normalizeActiveHeights G minHeight) (-(minHeight : Int)) ∧
∀ e, (normalizeActiveHeights G minHeight).edges e →
(normalizeActiveHeights G minHeight).H e ≤ span := by
have height (e : Edge (Fin N)) (active : G.edges e) :
(normalizeActiveHeights G minHeight).H e = G.H e - minHeight := by
unfold normalizeActiveHeights
exact if_pos active
refine ⟨⟨rfl, fun e active => ?_⟩, fun e active => ?_⟩
· rw [height e active]
have lower := (within e active).1
omega
· rw [height e active]
have upper := (within e active).2
omega

end QBD.Ch04

#print axioms QBD.Ch04.active_comparisons_shift
#print axioms QBD.Ch04.new_height_shift
#print axioms QBD.Ch04.evolution_height_shift
#print axioms QBD.Ch04.bounded_shift_representative

Verification Summary:

The machine-checked proofs establish that translating all active edge heights by a common offset preserves pairwise comparisons, commutes identically with source-side creation and one-tick evolution, and admits bounded shift representatives. Historical birth ticks remain unshifted in the archival ledger. The Lean 4 kernel accepts all closed proof terms using only standard axioms, certifying the shift-equivariance claims of Common-Height Shift Equivariance §4.6.8.

In Plain English:
Machine-checked Lean 4 proofs certify the formal claims verified in Section 4.6.8.3.


4.6.9 Proof: Emergent Dynamics​

Synthesis of Transition Probabilities via Entropy Production in the Evolution Cycle

I. Classical Transition Law

The independent finite outcome law is normalized, and its deterministic pushforward gives the normalized graph kernel (Euclidean Transition Measure §4.6.3). Positive realization weights have the additive negative-log action displayed there.

II. Information Monotonicity

The trajectory chain rule gives a nonnegative conditional-entropy increment, while the log-sum inequality gives common-kernel KL contraction (Thermodynamic Arrow §4.6.4). These are the stated information-theoretic conclusions (Emergent Dynamics §4.6.2).

III. Scope of the Dynamical Bound

The finite-horizon bound supplies a finite state domain (Finite-Horizon Height Bound §4.6.7). Common shifts preserve the unpumped transition on height classes (Common-Height Shift Equivariance §4.6.8).

Quiescent states are identified by reciprocal filtering and deletion trials (Exact Unpumped Quiescence §4.6.6). The site-summed condition is a separate bound on the triangle drift (Conditional Triangle Drift §4.6.5). It is not used to prove normalization or either information identity. Thus those identities hold independently of an additional recurrence or sparse-density estimate.

Q.E.D.

In Plain English:
Section 4.6.9 formalizes the properties of the QBD proof regarding emergent dynamics.


4.6.9.1 Type-Theoretic Validation via Lean 4 and Mathlib​

Lean 4 Encoding of Emergent Dynamics via Modular Measure, Entropy, Drift, and Shift Assembly

Type-theoretic certification of the complete single-tick dynamical synthesis established in Emergent Dynamics §4.6.2 proceeds via the following verification strategy:

  1. Model: The assembly module imports the Mathlib transition-measure, thermodynamic-arrow, conditional-drift, and frozen-tick-kernel modules alongside the Core quiescence, height-bound, and shift-equivariance modules.
  2. Certified Claims: The module assembles pushforward normalization, additive Euclidean action, trajectory entropy monotonicity, KL data processing, conditional triangle drift bounds, unpumped quiescence, finite-horizon height bounds, and shift-class kernel invariance in Emergent Dynamics §4.6.9.
  3. Scope Boundary: The assembly certifies all single-tick and finite-horizon dynamical laws over finite state spaces; explicit move-disjointness scheduler confluence is certified separately in the companion Core validation.
import QBDMathlib.Ch04.L4_6_3_EuclideanTransitionMeasure
import QBDMathlib.Ch04.L4_6_4_ThermodynamicArrow
import QBDMathlib.Ch04.L4_6_5_ConditionalTriangleDrift
import QBDMathlib.Ch04.FrozenTickKernel
import QBD.Ch04.L4_6_6_ExactUnpumpedQuiescence
import QBD.Ch04.L4_6_7_FiniteHorizonHeightBound
import QBD.Ch04.L4_6_8_CommonHeightShiftEquivariance

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03 QBD.Ch04

namespace QBDMathlib.Ch04

theorem emergent_dynamics {X Y Ω : Type*} [Fintype X] [Fintype Y] [Fintype Ω] [DecidableEq Y]
(realize : Ω → Y) (law : FiniteLaw Ω) (p q : FiniteLaw X) (K : X → FiniteLaw Y)
(support : ∀ x, 0 < p.weight x → 0 < q.weight x) :
(∑ y, pushWeight realize law.weight y = 1) ∧
shannonEntropy p.weight ≤ shannonEntropy (fun xy : X × Y => p.weight xy.1 * (K xy.1).weight xy.2) ∧
finiteKL (rowStep p.weight (fun x => (K x).weight))
(rowStep q.weight (fun x => (K x).weight)) ≤ finiteKL p.weight q.weight :=
⟨pushforward_normalized realize law, trajectory_entropy_monotone p K,
finite_kl_data_processing p q K support⟩

theorem emergent_dynamics_scheduler {N : ℕ} (G G' : TimestampedGraph (Fin N))
{c : Int} (shift : CommonHeightShift G G' c) (A D : Edge (Fin N) → Prop)
(incoming : ∀ e, retainedAdditions A e → ∃ x, G.edges (x, e.1))
(M : ℕ) (bound : ∀ e, G.edges e → G.H e ≤ M) :
CommonHeightShift (evolutionOperator G A D) (evolutionOperator G' A D) c ∧
(∀ e, (evolutionOperator G A D).H e ≤ M + 1) :=
⟨evolution_height_shift shift A D incoming, evolution_height_bound G A D M bound⟩

end QBDMathlib.Ch04

#print axioms QBDMathlib.Ch04.emergent_dynamics
#print axioms QBDMathlib.Ch04.emergent_dynamics_scheduler

Verification Summary:

The machine-checked proofs unify transition-measure normalization, entropy monotonicity, KL contraction, conditional triangle drift bounds, unpumped quiescence, finite-horizon height ceilings, and shift-class kernel invariance into closed dynamical theorems. Continuum scaling limits remain outside this finite-state assembly. The Lean 4 and Mathlib kernel accepts all closed proof terms using only standard axioms, certifying the dynamical synthesis of Emergent Dynamics §4.6.9.

In Plain English:
Section 4.6.9.1 formalizes the properties of the QBD type-theoretic regarding validation via lean 4 core.


4.6.9.2 Type-Theoretic Validation via Lean 4 Core​

Lean 4 Encoding of Scheduler Confluence via Disjoint Move Commutation and Idempotence

Type-theoretic certification of the race-free parallel scheduler commutation established in Emergent Dynamics §4.6.2 proceeds via the following verification strategy:

  1. Model: Frozen-snapshot legal addition and deletion sets, edge-merge updates, and move-disjointness invariants represent synchronous parallel scheduler execution.
  2. Certified Claims: The module certifies disjointness of legal addition and deletion sets, race-free invariance of edge merges, commutativity of parallel edge additions, and idempotence of repeated edge insertion in Emergent Dynamics §4.6.9.
  3. Scope Boundary: Confluence applies to synchronous frozen-snapshot merges where additions act on absent pairs and deletions act on present pairs. Stochastic realization weights are certified separately in the companion Mathlib assembly.
import QBD.Ch04.Defs

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03

namespace QBD.Ch04

theorem dynamic_move_disjointness {V : Type}
(E A_edges D : Edge V → Prop)
(hA : IsLegalAdditionSet E A_edges)
(hD : IsLegalDeletionSet E D) :
∀ e, ¬ (A_edges e ∧ D e) := by
intro e ⟨heA, heD⟩
have h_not_in_E : ¬ (E e) := hA e heA
have h_in_E : E e := hD e heD
exact h_not_in_E h_in_E

theorem dynamic_race_free_invariance {V : Type}
(E A_edges D : Edge V → Prop)
(hA : IsLegalAdditionSet E A_edges)
(hD : IsLegalDeletionSet E D) :
∀ e, A_edges e → ((E e ∨ A_edges e) ∧ ¬ (D e)) := by
intro e heA
constructor
· exact Or.inr heA
· intro heD
have h_disjoint := dynamic_move_disjointness E A_edges D hA hD e
exact h_disjoint ⟨heA, heD⟩

theorem parallel_addition_commutes {V : Type}
(E : (Edge V → Prop)) (e1 e2 : Edge V) :
merge_edge (merge_edge E e1) e2 = merge_edge (merge_edge E e2) e1 := by
funext x
dsimp [merge_edge]
apply propext
constructor
· intro h
rcases h with (hE | he1) | he2
· exact Or.inl (Or.inl hE)
· exact Or.inr he1
· exact Or.inl (Or.inr he2)
· intro h
rcases h with (hE | he2) | he1
· exact Or.inl (Or.inl hE)
· exact Or.inr he2
· exact Or.inl (Or.inr he1)

theorem parallel_addition_idempotent {V : Type}
(E : (Edge V → Prop)) (e : Edge V) :
merge_edge (merge_edge E e) e = merge_edge E e := by
funext x
dsimp [merge_edge]
apply propext
constructor
· intro h
rcases h with (hE | he1) | he2
· exact Or.inl hE
· exact Or.inr he1
· exact Or.inr he2
· intro h
rcases h with hE | he
· exact Or.inl (Or.inl hE)
· exact Or.inr he

end QBD.Ch04

#print axioms QBD.Ch04.dynamic_move_disjointness
#print axioms QBD.Ch04.dynamic_race_free_invariance
#print axioms QBD.Ch04.parallel_addition_commutes
#print axioms QBD.Ch04.parallel_addition_idempotent

Verification Summary:

The machine-checked proofs confirm that legal frozen additions and deletions are disjoint, that parallel edge merges commute without race conditions, and that edge insertion is idempotent. Probabilistic selection weights are certified separately in the companion Mathlib assembly. The Lean 4 kernel accepts all closed proof terms using only standard axioms, certifying the scheduler-confluence claims of Emergent Dynamics §4.6.9.

In Plain English:
Machine-checked Lean 4 proofs certify the formal claims verified in Section 4.6.9.2.


4.7.1 Theorem: Finite-Kernel Quasi-Stationarity​

Finite-Kernel Quasi-Stationarity via Conditional Survival and Convergence on a Finite Active Class

Let QQ be the finite substochastic active-to-active matrix of a killed transition, irreducible with Perron root λ∈(0,1)\lambda\in(0,1). Its unique quasi-stationary probability ν\nu has mean exit time (1−λ)−1(1-\lambda)^{-1} when used as the initial law, and if QQ is primitive the conditioned law converges to ν\nu exponentially.

In Plain English:
Section 4.7.1 formalizes the properties of the QBD theorem regarding finite-kernel quasi-stationarity.


4.7.2 Lemma: Perron Characterization of the QSD​

Perron Characterization of the QSD via Uniqueness of a Conditioned Stationary Probability

Let QQ be a finite irreducible substochastic matrix with Perron root λ>0\lambda>0. A distribution ν\nu is quasi-stationary for killing on exit exactly when it is the normalized left Perron eigenvector of QQ.

In Plain English:
Section 4.7.2 formalizes the properties of the QBD lemma regarding perron characterization of the qsd.


4.7.2.1 Proof: Perron Characterization of the QSD​

Perron Characterization of the QSD via Normalization and the Positive Right Eigenvector

I. Domain and Objects

The killed matrix is substochastic on the finite active class (Perron Characterization of the QSD §4.7.2) (Finite-Kernel Quasi-Stationarity §4.7.1).

II. Construction

Perron-Frobenius gives positive vectors ℓ,r\ell,r with ℓQ=λℓ\ell Q=\lambda\ell and Qr=λrQr=\lambda r. Set ν=ℓ/(ℓ1)\nu=\ell/(\ell\mathbf1). Then

νQ1=λ,νQνQ1=ν.\nu Q\mathbf1=\lambda,\qquad \frac{\nu Q}{\nu Q\mathbf1}=\nu .

III. Uniqueness

For any quasi-stationary probability π\pi, put a=πQ1>0a=\pi Q\mathbf1>0, so πQ=aπ\pi Q=a\pi. Associativity and Qr=λrQr=\lambda r give

a(πr)=(aπ)r=(πQ)r=π(Qr)=π(λr)=λ(πr).a(\pi r)=(a\pi)r=(\pi Q)r=\pi(Qr)=\pi(\lambda r)=\lambda(\pi r).

In components, πr=∑iπiri≥(min⁡iri)∑iπi=min⁡iri>0\pi r=\sum_i\pi_i r_i\ge(\min_i r_i)\sum_i\pi_i=\min_i r_i>0. Dividing the displayed identity by this scalar gives a=λa=\lambda. The left Perron eigenspace is one-dimensional, so normalization gives π=ν\pi=\nu.

Q.E.D.

In Plain English:
Section 4.7.2.1 formalizes the properties of the QBD proof regarding perron characterization of the qsd.


4.7.2.2 Type-Theoretic Validation via Lean 4 and Mathlib​

Lean 4 Encoding of Perron Characterization of the QSD via Left Eigenvector Equivalence

Type-theoretic certification of the Perron-Frobenius quasi-stationary characterization established in Perron Characterization of the QSD §4.7.2 proceeds via the following verification strategy:

  1. Model: Finite nonnegative substochastic killed matrices, positive probability laws, total mass scaling, and irreducible Perron left-right eigenvector data represent quasi-stationary distributions.
  2. Certified Claims: The module certifies linearity of total mass, strict positivity of inner products on positive vectors, exact equivalence between quasi-stationarity and being a positive left Perron eigenvector, and existence of irreducible Perron data in Perron Characterization of the QSD §4.7.2.1.
  3. Scope Boundary: The characterization assumes a finite active state space and irreducibility of the killed substochastic matrix. Infinite-state killed chains remain outside this finite-matrix certificate.
import QBDMathlib.Ch04.PerronExistence

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03 QBD.Ch04

namespace QBDMathlib.Ch04

open Matrix
open scoped Matrix

variable {X : Type*} [Fintype X]

/-- Perron-Frobenius input for a finite active class, with its left vector normalized. -/
structure PerronData (Q : Matrix X X ℝ) (root : ℝ) where
left : FiniteLaw X
left_pos : ∀ x, 0 < left.weight x
right : X → ℝ
right_pos : ∀ x, 0 < right x
left_eigen : left.weight ᵥ* Q = root • left.weight
right_eigen : Q *ᵥ right = root • right
left_simple : ∀ v : X → ℝ, v ᵥ* Q = root • v → v = mass v • left.weight

theorem mass_smul (r : ℝ) (v : X → ℝ) : mass (r • v) = r * mass v := by
simp [mass, Pi.smul_apply, smul_eq_mul, Finset.mul_sum]

theorem dot_positive (p : FiniteLaw X) (r : X → ℝ) (positive : ∀ x, 0 < r x) :
0 < p.weight ⬝ᵥ r := by
classical
have somePositive : ∃ x, 0 < p.weight x := by
by_contra! none
have allZero (x : X) : p.weight x = 0 := le_antisymm (none x) (p.nonneg x)
have := p.total
simp [allZero] at this
obtain ⟨x, hx⟩ := somePositive
exact (mul_pos hx (positive x)).trans_le
(Finset.single_le_sum (fun y _ => mul_nonneg (p.nonneg y) (positive y).le) (Finset.mem_univ x))

theorem qsd_iff_perron (Q : Matrix X X ℝ) {root : ℝ} (positive : 0 < root)
(data : PerronData Q root) (p : FiniteLaw X) :
QuasiStationary Q p ↔ p.weight = data.left.weight := by
constructor
· rintro ⟨survival, fixed⟩
let a := mass (p.weight ᵥ* Q)
have eigen : p.weight ᵥ* Q = a • p.weight := by
funext x
have atX := congrFun fixed x
change (p.weight ᵥ* Q) x / a = p.weight x at atX
simpa [Pi.smul_apply, smul_eq_mul, mul_comm] using (div_eq_iff (ne_of_gt survival)).mp atX
have dot : (p.weight ᵥ* Q) ⬝ᵥ data.right = p.weight ⬝ᵥ (Q *ᵥ data.right) :=
(Matrix.dotProduct_mulVec _ _ _).symm
rw [eigen, data.right_eigen, smul_dotProduct, dotProduct_smul, smul_eq_mul, smul_eq_mul] at dot
have rootEq := mul_right_cancel₀ (dot_positive p data.right data.right_pos).ne' dot
have one : mass p.weight = 1 := p.total
simpa [one] using data.left_simple p.weight (rootEq ▸ eigen)
· intro eq
have eigen : p.weight ᵥ* Q = root • p.weight := by rw [eq, data.left_eigen]
have survival : mass (p.weight ᵥ* Q) = root := by rw [eigen, mass_smul, show mass p.weight = 1 from p.total, mul_one]
refine ⟨survival.symm ▸ positive, ?_⟩
funext x
unfold conditioned
rw [survival, eigen]
simp [Pi.smul_apply, smul_eq_mul, positive.ne']

theorem irreducible_perron_data [Nonempty X] [DecidableEq X]
(Q : Matrix X X ℝ) (irr : Q.IsIrreducible) :
∃ (root : ℝ) (data : PerronData Q root), 0 < root ∧
data.left.weight ⬝ᵥ data.right = 1 := by
obtain ⟨root, ν, root₀, ν₀, left⟩ := irreducible_left_eigen Q irr
obtain ⟨s, right, _, right₀, eigen⟩ := irreducible_left_eigen Qᵀ irr.transpose
rw [Matrix.vecMul_transpose] at eigen
have pairing : root * (ν.weight ⬝ᵥ right.weight) = s * (ν.weight ⬝ᵥ right.weight) := by
have eq := (Matrix.dotProduct_mulVec ν.weight Q right.weight).symm
simpa only [left, eigen, smul_dotProduct, dotProduct_smul, smul_eq_mul] using eq
have overlap := dot_positive ν right.weight right₀
have same := mul_right_cancel₀ overlap.ne' pairing
subst s
let r := (ν.weight ⬝ᵥ right.weight)⁻¹ • right.weight
have rpos (i : X) : 0 < r i := mul_pos (inv_pos.mpr overlap) (right₀ i)
have reigen : Q *ᵥ r = root • r := by
unfold r
rw [Matrix.mulVec_smul, eigen, smul_smul, smul_smul, mul_comm]
refine ⟨root, ⟨ν, ν₀, r, rpos, left, reigen,
fun v h => irreducible_left_eigenvector_simple Q irr ν ν₀ v root left h⟩, root₀, ?_⟩
change ν.weight ⬝ᵥ r = 1
rw [show r = (ν.weight ⬝ᵥ right.weight)⁻¹ • right.weight from rfl, dotProduct_smul,
smul_eq_mul, inv_mul_cancel₀ overlap.ne']

end QBDMathlib.Ch04

#print axioms QBDMathlib.Ch04.mass_smul
#print axioms QBDMathlib.Ch04.dot_positive
#print axioms QBDMathlib.Ch04.qsd_iff_perron
#print axioms QBDMathlib.Ch04.irreducible_perron_data

Verification Summary:

The machine-checked proofs establish exact equivalence between quasi-stationary distributions and positive left Perron eigenvectors of finite substochastic matrices and construct irreducible Perron data directly. Infinite-state Markov chains remain outside this finite-matrix module. The Lean 4 and Mathlib kernel accepts all closed proof terms using only standard axioms, certifying the Perron claims of Perron Characterization of the QSD §4.7.2.

In Plain English:
Machine-checked Lean 4 proofs certify the formal claims verified in Section 4.7.2.3.


4.7.3 Lemma: Geometric Lifetime from the QSD​

Geometric Lifetime from the QSD via Exit-Time Tail under a Quasi-Stationary Initial Law

Let νQ=λν\nu Q=\lambda\nu with ν1=1\nu\mathbf1=1 and 0<λ<10<\lambda<1. The first exit time τ\tau from the active set is geometric under ν\nu, with Pr⁡ν(τ>t)=λt\Pr_\nu(\tau>t)=\lambda^t for t≥0t\ge0 and Eν[τ]=(1−λ)−1\mathbb E_\nu[\tau]=(1-\lambda)^{-1}.

In Plain English:
Section 4.7.3 formalizes the properties of the QBD lemma regarding geometric lifetime from the qsd.


4.7.3.1 Proof: Geometric Lifetime from the QSD​

Survival via Powers of the Killed Matrix

I. Domain and Objects

The initial law is the normalized left Perron vector (Geometric Lifetime from the QSD §4.7.3) (Perron Characterization of the QSD §4.7.2).

II. Survival Mass

The active unnormalized law after tt steps is νQt\nu Q^t. At t=0t=0, νQ0=ν=λ0ν\nu Q^0=\nu=\lambda^0\nu. If νQt=λtν\nu Q^t=\lambda^t\nu, then

νQt+1=(νQt)Q=(λtν)Q=λt(νQ)=λt+1ν.\nu Q^{t+1}=(\nu Q^t)Q=(\lambda^t\nu)Q =\lambda^t(\nu Q)=\lambda^{t+1}\nu .

Thus the survival mass at every tick is Pr⁡ν(τ>t)=νQt1=λt(ν1)=λt\Pr_\nu(\tau>t)=\nu Q^t\mathbf1=\lambda^t(\nu\mathbf1)=\lambda^t.

III. Mean Lifetime

For integer m≥1m\ge1, min⁡(τ,m)=∑t=0m−11{τ>t}\min(\tau,m)=\sum_{t=0}^{m-1}\mathbf1_{\{\tau>t\}}. The finite sum has expectation

Eν[min⁡(τ,m)]=∑t=0m−1Pr⁡ν(τ>t)=∑t=0m−1λt=1−λm1−λ.\mathbb E_\nu[\min(\tau,m)] =\sum_{t=0}^{m-1}\Pr_\nu(\tau>t) =\sum_{t=0}^{m-1}\lambda^t =\frac{1-\lambda^m}{1-\lambda}.

As m→∞m\to\infty, the left side tends to Eν[τ]\mathbb E_\nu[\tau] by monotone convergence, and λm→0\lambda^m\to0 because 0<λ<10<\lambda<1. Thus Eν[τ]=1/(1−λ)\mathbb E_\nu[\tau]=1/(1-\lambda).

Q.E.D.

In Plain English:
Section 4.7.3.1 formalizes the properties of the QBD proof regarding geometric lifetime from the qsd.


4.7.3.2 Type-Theoretic Validation via Lean 4 and Mathlib​

Lean 4 Encoding of Geometric Lifetime from the QSD via Exact Power Scaling

Type-theoretic certification of the exact geometric survival law established in Geometric Lifetime from the QSD §4.7.3 proceeds via the following verification strategy:

  1. Model: Matrix powers of a finite killed transition kernel acting on a quasi-stationary distribution and survival-mass functionals represent absorption lifetimes.
  2. Certified Claims: The module certifies exact eigenvalue power scaling of the quasi-stationary vector, geometric decay of total survival mass, and the exact geometric lifetime law in Geometric Lifetime from the QSD §4.7.3.1.
  3. Scope Boundary: Exact geometric survival holds when initialized at a quasi-stationary distribution. Convergence from arbitrary initial distributions is certified in the next spectral module.
import QBDMathlib.Ch04.L4_7_2_PerronCharacterizationQSD
import Mathlib.Analysis.SpecificLimits.Basic

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03 QBD.Ch04

namespace QBDMathlib.Ch04

open Matrix Filter
open scoped Matrix Topology

variable {X : Type*} [Fintype X] [DecidableEq X]

theorem qsd_power (Q : Matrix X X ℝ) (p : X → ℝ) (root : ℝ)
(eigen : p ᵥ* Q = root • p) (t : ℕ) : p ᵥ* Q ^ t = root ^ t • p :=
left_eigen_power Q p root eigen t

theorem qsd_survival (Q : Matrix X X ℝ) (p : FiniteLaw X) (root : ℝ)
(eigen : p.weight ᵥ* Q = root • p.weight) (t : ℕ) :
mass (p.weight ᵥ* Q ^ t) = root ^ t := by
rw [qsd_power Q p.weight root eigen, mass_smul, show mass p.weight = 1 from p.total, mul_one]

theorem geometric_lifetime_qsd (Q : Matrix X X ℝ) (p : FiniteLaw X) {root : ℝ}
(eigen : p.weight ᵥ* Q = root • p.weight) (pos : 0 < root) (subunit : root < 1) :
HasSum (fun t : ℕ => mass (p.weight ᵥ* Q ^ t)) (1 / (1 - root)) := by
simp_rw [qsd_survival Q p root eigen]
simpa [one_div] using hasSum_geometric_of_lt_one pos.le subunit

end QBDMathlib.Ch04

#print axioms QBDMathlib.Ch04.qsd_power
#print axioms QBDMathlib.Ch04.qsd_survival
#print axioms QBDMathlib.Ch04.geometric_lifetime_qsd

Verification Summary:

The machine-checked proofs confirm that evolving a quasi-stationary distribution under powers of a finite killed kernel scales the vector by exact powers of the Perron eigenvalue, yielding a strictly geometric absorption lifetime. Convergence from non-stationary initial laws is verified in the subsequent spectral module. The Lean 4 and Mathlib kernel accepts all closed proof terms using only standard axioms, certifying the lifetime claims of Geometric Lifetime from the QSD §4.7.3.

In Plain English:
Machine-checked Lean 4 proofs certify the formal claims verified in Section 4.7.3.3.


4.7.4 Lemma: Conditional Spectral Convergence​

Conditional Spectral Convergence via Exponential Conditional Convergence for a Primitive Killed Matrix

Let QQ be primitive and finite with Perron root λ>0\lambda>0. For each initial law π\pi on the active set and every η∈(0,1)\eta\in(0,1) larger than the ratio of the subdominant spectral radius to λ\lambda, the conditioned law satisfies ∥πQt/(πQt1)−ν∥TV≤Cη(π)ηt\|\pi Q^t/(\pi Q^t\mathbf1)-\nu\|_{\mathrm{TV}}\le C_\eta(\pi)\eta^t.

In Plain English:
Section 4.7.4 formalizes the properties of the QBD lemma regarding conditional spectral convergence.


4.7.4.1 Proof: Conditional Spectral Convergence​

Conditional Spectral Convergence via Spectral Projection and Control of the Conditioning Denominator

I. Domain and Objects

The positive Perron eigenvectors determine the limiting law (Conditional Spectral Convergence §4.7.4) (Perron Characterization of the QSD §4.7.2).

II. Perron Projection and Remainder

Normalize the positive right eigenvector by νr=1\nu r=1. The Perron projection is rνr\nu. The remaining Jordan blocks of Q/λQ/\lambda have eigenvalues of modulus smaller than η\eta. A block of size mm with eigenvalue zz contributes entries bounded by sums of (tj)∣z∣t−j\binom{t}{j}|z|^{t-j} for 0≤j<m0\le j<m. For z≠0z\ne0, dividing by ηt\eta^t bounds each term uniformly since ∣z∣/η<1|z|/\eta<1. For z=0z=0, the block vanishes at t≥mt\ge m. Thus

πQt/λt=(πr)ν+et,∥et∥1≤Aη(π)ηt.\pi Q^t/\lambda^t=(\pi r)\nu+e_t,\qquad \|e_t\|_1\le A_\eta(\pi)\eta^t .

III. Normalization

Write b=πr>0b=\pi r>0. Since ∣et1∣≤∥et∥1|e_t\mathbf1|\le\|e_t\|_1, for sufficiently large tt the denominator b+et1b+e_t\mathbf1 is at least b/2b/2. Subtracting ν\nu gives

πQtπQt1−ν=et−(et1)νb+et1.\frac{\pi Q^t}{\pi Q^t\mathbf1}-\nu =\frac{e_t-(e_t\mathbf1)\nu}{b+e_t\mathbf1}.

The numerator has ℓ1\ell^1 norm at most 2∥et∥12\|e_t\|_1. Total variation is half that norm after division, so the error is at most 2Aη(π)ηt/b2A_\eta(\pi)\eta^t/b. Every active state has a positive outgoing active transition under the stated hypotheses. The survival denominators are therefore positive at the finitely many earlier times, which are covered by increasing the constant.

Q.E.D.

In Plain English:
Section 4.7.4.1 formalizes the properties of the QBD proof regarding conditional spectral convergence.


4.7.4.2 Type-Theoretic Validation via Lean 4 and Mathlib​

Lean 4 Encoding of Conditional Spectral Convergence via Perron Projection Remainders

Type-theoretic certification of the exponential conditioned convergence bounds established in Conditional Spectral Convergence §4.7.4 proceeds via the following verification strategy:

  1. Model: Rank-one Perron spectral projections, sub-dominant remainder powers, conditioned probability distributions, and total-variation distances represent convergence to quasi-stationarity.
  2. Certified Claims: The module certifies geometric decay of spectral remainders, exact power formulas for the Perron projection, uniform all-time conditioned total-variation bounds, and exponential matrix-power convergence rates in Conditional Spectral Convergence §4.7.4.1.
  3. Scope Boundary: Exponential convergence requires primitivity of the finite killed kernel so that the spectral remainder radius lies strictly below one. Periodic irreducible chains converge only in Cesàro mean.
import QBDMathlib.Ch04.L4_7_2_PerronCharacterizationQSD
import Mathlib.Analysis.Matrix.GelfandRadius
import Mathlib.Analysis.SpecificLimits.Basic

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03 QBD.Ch04

namespace QBDMathlib.Ch04

open Matrix Filter
open scoped Matrix Matrix.Norms.Operator Topology

variable {X : Type*} [Fintype X] [DecidableEq X]

/-- The residual powers have the Gelfand rate in the matrix operator norm. -/
theorem spectral_remainder_rate (R : Matrix X X ℝ) {η : ℝ} (gap : gelfandRadius R < η) :
∃ C : ℝ, 0 < C ∧ ∀ t : ℕ, ‖R ^ t‖ ≤ C * η ^ t :=
norm_pow_le_mul_pow_of_gelfandRadius_lt R gap

/-- A projection and an annihilating remainder give the positive-time power decomposition. -/
theorem perron_projection_power (P R : Matrix X X ℝ) (proj : P * P = P)
(left : P * R = 0) (right : R * P = 0) (t : ℕ) :
(P + R) ^ (t + 1) = P + R ^ (t + 1) := by
induction t with
| zero => simp
| succ t ih =>
have vanish : R ^ (t + 1) * P = 0 := by
rw [pow_succ, Matrix.mul_assoc, right, mul_zero]
rw [pow_succ, ih, add_mul, mul_add, mul_add, proj, left, vanish, zero_add, add_zero, ← pow_succ]

/-- Conditioning divides out the leading mass; the TV error is controlled by the remainder. -/
theorem conditioned_remainder_bound (ν : FiniteLaw X) {b : ℝ} (b₀ : 0 < b)
(e : X → ℝ) (small : (∑ x, |e x|) ≤ b / 2) :
totalVariation (conditioned (fun x => b * ν.weight x + e x)) ν.weight ≤
2 * (∑ x, |e x|) / b := by
let d := ∑ x, e x
have err : |d| ≤ ∑ x, |e x| := Finset.abs_sum_le_sum_abs _ _
have dlow : b / 2 ≤ b + d := by linarith [neg_abs_le d]
have pos : 0 < b + d := by linarith
have normal : mass (fun x => b * ν.weight x + e x) = b + d := by
simp [mass, Finset.sum_add_distrib, ← Finset.mul_sum, ν.total, d]
have point (x : X) :
conditioned (fun y => b * ν.weight y + e y) x - ν.weight x =
(e x - ν.weight x * d) / (b + d) := by
unfold conditioned
rw [normal]
field_simp
<;> ring
have triangle : (∑ x, |e x - ν.weight x * d|) ≤ 2 * (∑ x, |e x|) := by
calc
_ ≤ ∑ x, (|e x| + ν.weight x * |d|) := by
apply Finset.sum_le_sum
intro x _
simpa [abs_mul, abs_of_nonneg (ν.nonneg x), sub_eq_add_neg] using
abs_add_le (e x) (-(ν.weight x * d))
_ = (∑ x, |e x|) + |d| := by
rw [Finset.sum_add_distrib, ← Finset.sum_mul, ν.total, one_mul]
_ ≤ _ := by linarith
unfold totalVariation
simp_rw [point, abs_div, abs_of_pos pos]
rw [← Finset.sum_div]
let E := ∑ x, |e x|
have E₀ : 0 ≤ E := Finset.sum_nonneg (fun _ _ => abs_nonneg _)
calc
_ ≤ (2 * E / (b + d)) / 2 :=
div_le_div_of_nonneg_right (div_le_div_of_nonneg_right triangle pos.le) (by norm_num)
_ = E / (b + d) := by ring
_ ≤ E / (b / 2) := div_le_div_of_nonneg_left E₀ (by positivity) dlow
_ = _ := by ring

theorem conditional_spectral_convergence (ν : FiniteLaw X) {b η : ℝ}
(b₀ : 0 < b) (η₀ : 0 < η) (η₁ : η < 1) (e : ℕ → X → ℝ)
(rate : ∃ A : ℝ, 0 ≤ A ∧ ∀ t, (∑ x, |e t x|) ≤ A * η ^ t) :
∃ C : ℝ, 0 ≤ C ∧ ∀ᶠ t : ℕ in atTop,
totalVariation (conditioned (fun x => b * ν.weight x + e t x)) ν.weight ≤ C * η ^ t := by
obtain ⟨A, nonneg, bound⟩ := rate
have decay : Tendsto (fun t : ℕ => A * η ^ t) atTop (𝓝 0) := by
simpa using (tendsto_pow_atTop_nhds_zero_of_lt_one η₀.le η₁).const_mul A
refine ⟨2 * A / b, by positivity, ?_⟩
filter_upwards [decay.eventually_lt_const (show 0 < b / 2 by positivity)] with t small
have normSmall : (∑ x, |e t x|) ≤ b / 2 := (bound t).trans small.le
refine (conditioned_remainder_bound ν b₀ (e t) normSmall).trans ?_
calc
_ ≤ 2 * (A * η ^ t) / b :=
div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_left (bound t) (by norm_num)) b₀.le
_ = _ := by ring

theorem conditional_spectral_convergence_all_times (ν : FiniteLaw X) {b η : ℝ}
(b₀ : 0 < b) (η₀ : 0 < η) (η₁ : η < 1) (e : ℕ → X → ℝ)
(rate : ∃ A : ℝ, 0 ≤ A ∧ ∀ t, (∑ x, |e t x|) ≤ A * η ^ t) :
∃ C : ℝ, 0 ≤ C ∧ ∀ t : ℕ,
totalVariation (conditioned (fun x => b * ν.weight x + e t x)) ν.weight ≤ C * η ^ t := by
obtain ⟨C, C₀, eventuallyBound⟩ := conditional_spectral_convergence ν b₀ η₀ η₁ e rate
obtain ⟨T, late⟩ := eventually_atTop.mp eventuallyBound
let error := fun t => totalVariation (conditioned (fun x => b * ν.weight x + e t x)) ν.weight
let early := ∑ t ∈ Finset.range T, error t / η ^ t
have error₀ (t : ℕ) : 0 ≤ error t / η ^ t := by
apply div_nonneg _ (pow_nonneg η₀.le _)
exact div_nonneg (Finset.sum_nonneg (fun _ _ => abs_nonneg _)) (by norm_num)
have early₀ : 0 ≤ early := Finset.sum_nonneg (fun t _ => error₀ t)
refine ⟨C + early, add_nonneg C₀ early₀, fun t => ?_⟩
have powerPos := pow_pos η₀ t
by_cases past : T ≤ t
· exact (late t past).trans (mul_le_mul_of_nonneg_right (le_add_of_nonneg_right early₀) powerPos.le)
· have first : error t / η ^ t ≤ early := by
unfold early
exact Finset.single_le_sum (fun s _ => error₀ s) (Finset.mem_range.mpr (Nat.lt_of_not_ge past))
exact (div_le_iff₀ powerPos).mp (first.trans (le_add_of_nonneg_left C₀))

/-- Exponential conditioned convergence for a normalized operator with its Perron projection. -/
theorem conditioned_matrix_power_rate (π ν : FiniteLaw X) (r : X → ℝ) (R : Matrix X X ℝ)
(r₀ : ∀ x, 0 < r x) {η : ℝ} (η₀ : 0 < η) (η₁ : η < 1)
(gap : gelfandRadius R < η)
(proj : let P := Matrix.vecMulVec r ν.weight; P * P = P)
(left : Matrix.vecMulVec r ν.weight * R = 0)
(right : R * Matrix.vecMulVec r ν.weight = 0) :
∃ C : ℝ, 0 ≤ C ∧ ∀ t : ℕ,
totalVariation (conditioned (π.weight ᵥ* (Matrix.vecMulVec r ν.weight + R) ^ (t + 1)))
ν.weight ≤ C * η ^ t := by
obtain ⟨D, D₀, powers⟩ := spectral_remainder_rate R gap
let e := fun t : ℕ => π.weight ᵥ* R ^ (t + 1)
have rate : ∃ A : ℝ, 0 ≤ A ∧ ∀ t, (∑ x, |e t x|) ≤ A * η ^ t := by
refine ⟨(Fintype.card X : ℝ) * D * η, by positivity, fun t => ?_⟩
have point (x : X) : |e t x| ≤ D * η ^ (t + 1) := by
calc
|e t x| ≤ ∑ i, |π.weight i * (R ^ (t + 1)) i x| :=
Finset.abs_sum_le_sum_abs _ _
_ ≤ ∑ i, π.weight i * (D * η ^ (t + 1)) := by
apply Finset.sum_le_sum
intro i _
rw [abs_mul, abs_of_nonneg (π.nonneg i), ← Real.norm_eq_abs]
exact mul_le_mul_of_nonneg_left
((Matrix.norm_apply_le_linfty_opNorm _ i x).trans (powers (t + 1))) (π.nonneg i)
_ = _ := by rw [← Finset.sum_mul, π.total, one_mul]
calc
_ ≤ ∑ _x : X, D * η ^ (t + 1) := Finset.sum_le_sum (fun x _ => point x)
_ = _ := by simp [pow_succ]; ring
obtain ⟨C, C₀, bound⟩ := conditional_spectral_convergence_all_times ν
(dot_positive π r r₀) η₀ η₁ e rate
refine ⟨C, C₀, fun t => ?_⟩
rw [perron_projection_power _ _ proj left right, Matrix.vecMul_add, Matrix.vecMul_vecMulVec]
exact bound t
end QBDMathlib.Ch04

#print axioms QBDMathlib.Ch04.spectral_remainder_rate
#print axioms QBDMathlib.Ch04.perron_projection_power
#print axioms QBDMathlib.Ch04.conditioned_remainder_bound
#print axioms QBDMathlib.Ch04.conditional_spectral_convergence_all_times
#print axioms QBDMathlib.Ch04.conditioned_matrix_power_rate

Verification Summary:

The machine-checked proofs decompose powers of a primitive killed kernel into the rank-one Perron projection plus a contracting spectral remainder, certifying uniform all-time exponential total-variation convergence of conditioned distributions. Periodic chains remain outside the primitive spectral-gap hypothesis. The Lean 4 and Mathlib kernel accepts all closed proof terms using only standard axioms, certifying the convergence claims of Conditional Spectral Convergence §4.7.4.

In Plain English:
Machine-checked Lean 4 proofs certify the formal claims verified in Section 4.7.4.3.


4.7.5 Proof: Finite-Kernel Quasi-Stationarity​

Finite-Kernel Quasi-Stationarity via Assembly of the Conditioned Kernel Identities

I. Domain and Objects

The stated theorem assumes irreducibility and a Perron root in the open unit interval (Finite-Kernel Quasi-Stationarity §4.7.1) (Finite-Horizon Height Bound §4.6.7).

II. Conditioned Stationarity

Irreducibility gives a unique normalized positive left eigenvector, and the conditioned update fixes it (Perron Characterization of the QSD §4.7.2).

III. Exit Time and Convergence

The left eigenvector gives survival mass λt\lambda^t and its sum gives the mean lifetime (Geometric Lifetime from the QSD §4.7.3). If the matrix is primitive, its subdominant spectral radius is strictly below λ\lambda. A ratio η\eta strictly between the normalized radius and one therefore gives exponential convergence (Conditional Spectral Convergence §4.7.4).

Q.E.D.

In Plain English:
Section 4.7.5 formalizes the properties of the QBD proof regarding finite-kernel quasi-stationarity.


4.7.5.1 Type-Theoretic Validation via Lean 4 and Mathlib​

Lean 4 Encoding of Finite-Kernel Quasi-Stationarity via Irreducible Perron and Primitive Spectral Assembly

Type-theoretic certification of the complete quasi-stationarity and conditioned convergence synthesis established in Finite-Kernel Quasi-Stationarity §4.7.1 proceeds via the following verification strategy:

  1. Model: The assembly module imports the certified Perron-characterization, geometric-lifetime, and conditional-spectral-convergence modules together with irreducible Perron existence and primitive spectral-gap constructions.
  2. Certified Claims: The module certifies existence and uniqueness of the quasi-stationary distribution for irreducible killed kernels, exact geometric survival lifetimes, and exponential all-time conditioned total-variation convergence for primitive killed kernels in Finite-Kernel Quasi-Stationarity §4.7.5.
  3. Scope Boundary: The certificate assumes a finite active state space with irreducible or primitive killed transition matrix. Infinite-state or non-autonomous time-varying kernels remain outside this finite-matrix assembly.
import QBDMathlib.Ch04.L4_7_2_PerronCharacterizationQSD
import QBDMathlib.Ch04.L4_7_3_GeometricLifetimeQSD
import QBDMathlib.Ch04.L4_7_4_ConditionalSpectralConvergence
import QBDMathlib.Ch04.PrimitiveSpectralGap

open QBD QBD.Ch01 QBD.Ch02 QBD.Ch03 QBD.Ch04

namespace QBDMathlib.Ch04

open Matrix Filter
open scoped Matrix Matrix.Norms.Operator Topology

theorem finite_kernel_quasi_stationarity {X : Type*} [Fintype X] [DecidableEq X]
(Q : Matrix X X ℝ) {root : ℝ} (positive : 0 < root) (subunit : root < 1)
(data : PerronData Q root) :
(∀ p : FiniteLaw X, QuasiStationary Q p ↔ p.weight = data.left.weight) ∧
(∀ t : ℕ, mass (data.left.weight ᵥ* Q ^ t) = root ^ t) ∧
HasSum (fun t : ℕ => mass (data.left.weight ᵥ* Q ^ t)) (1 / (1 - root)) :=
⟨qsd_iff_perron Q positive data, qsd_survival Q data.left root data.left_eigen,
geometric_lifetime_qsd Q data.left data.left_eigen positive subunit⟩

/-- An irreducible finite active class with a leaking row has a unique QSD
and a geometric survival tail at a root strictly below one. -/
theorem irreducible_killed_kernel_qsd {X : Type*} [Fintype X] [Nonempty X] [DecidableEq X]
(Q : Matrix X X ℝ) (irr : Q.IsIrreducible)
(substochastic : ∀ i, (∑ j, Q i j) ≤ 1) (leaks : ∃ i, (∑ j, Q i j) < 1) :
∃ (root : ℝ) (data : PerronData Q root), 0 < root ∧ root < 1 ∧
gelfandRadius Q = root ∧
data.left.weight ⬝ᵥ data.right = 1 ∧
(∀ p : FiniteLaw X, QuasiStationary Q p ↔ p.weight = data.left.weight) ∧
(∀ t : ℕ, mass (data.left.weight ᵥ* Q ^ t) = root ^ t) ∧
HasSum (fun t : ℕ => mass (data.left.weight ᵥ* Q ^ t)) (1 / (1 - root)) := by
obtain ⟨root, data, root₀, normalized⟩ := irreducible_perron_data Q irr
let ν := data.left
obtain ⟨i, hLeak⟩ := leaks
have row : mass (ν.weight ᵥ* Q) = ∑ i, ν.weight i * ∑ j, Q i j := by
simp only [mass, Matrix.vecMul, dotProduct]
rw [Finset.sum_comm]
simp_rw [← Finset.mul_sum]
have rootMass : mass (ν.weight ᵥ* Q) = root := by
rw [show ν.weight ᵥ* Q = root • ν.weight from data.left_eigen,
mass_smul, show mass ν.weight = 1 from ν.total, mul_one]
have root₁ : root < 1 := by
rw [← rootMass, row, ← ν.total]
apply Finset.sum_lt_sum
· intro j _
simpa only [mul_one] using mul_le_mul_of_nonneg_left (substochastic j) (ν.nonneg j)
· exact ⟨i, Finset.mem_univ i, by
simpa only [mul_one] using mul_lt_mul_of_pos_left hLeak (data.left_pos i)⟩
obtain ⟨characterize, survival, lifetime⟩ :=
finite_kernel_quasi_stationarity Q root₀ root₁ data
exact ⟨root, data, root₀, root₁,
gelfand_radius_of_positive_right_eigenvector Q data.right root₀ irr.nonneg
data.right_pos data.right_eigen, normalized, characterize, survival, lifetime⟩

theorem finite_kernel_conditioned_rate {X : Type*} [Fintype X] [DecidableEq X]
(Q : Matrix X X ℝ) (π : FiniteLaw X) {root η : ℝ} (root₀ : 0 < root)
(data : PerronData Q root) (normalized : data.left.weight ⬝ᵥ data.right = 1)
(η₀ : 0 < η) (η₁ : η < 1)
(gap : gelfandRadius (root⁻¹ • Q - Matrix.vecMulVec data.right data.left.weight) < η) :
∃ C : ℝ, 0 ≤ C ∧ ∀ t : ℕ,
totalVariation (conditioned (π.weight ᵥ* Q ^ t)) data.left.weight ≤ C * η ^ t := by
let P := Matrix.vecMulVec data.right data.left.weight
let A := root⁻¹ • Q
let R := A - P
have proj : P * P = P := by
unfold P
rw [Matrix.vecMulVec_mul_vecMulVec, normalized, one_smul]
have leftFixed : data.left.weight ᵥ* A = data.left.weight := by
unfold A
rw [Matrix.vecMul_smul, data.left_eigen, smul_smul, inv_mul_cancel₀ root₀.ne', one_smul]
have rightFixed : A *ᵥ data.right = data.right := by
unfold A
rw [Matrix.smul_mulVec, data.right_eigen, smul_smul, inv_mul_cancel₀ root₀.ne', one_smul]
have left : P * R = 0 := by
rw [show R = A - P from rfl, mul_sub, proj]
change Matrix.vecMulVec data.right data.left.weight * A - P = 0
rw [Matrix.vecMulVec_mul, leftFixed, sub_self]
have right : R * P = 0 := by
rw [show R = A - P from rfl, sub_mul, proj]
change A * Matrix.vecMulVec data.right data.left.weight - P = 0
rw [Matrix.mul_vecMulVec, rightFixed, sub_self]
obtain ⟨D, D₀, decay⟩ := conditioned_matrix_power_rate π data.left data.right R data.right_pos
η₀ η₁ gap proj left right
have decomp : P + R = A := by dsimp [R]; abel
have noScaling (t : ℕ) :
conditioned (π.weight ᵥ* A ^ t) = conditioned (π.weight ᵥ* Q ^ t) := by
unfold A
rw [smul_pow, Matrix.vecMul_smul]
funext x
rw [conditioned, conditioned, mass_smul]
simp only [Pi.smul_apply, smul_eq_mul]
exact mul_div_mul_left _ _ (pow_ne_zero _ (inv_ne_zero root₀.ne'))
let initial := totalVariation π.weight data.left.weight
have initial₀ : 0 ≤ initial :=
div_nonneg (Finset.sum_nonneg (fun _ _ => abs_nonneg _)) (by norm_num)
refine ⟨max initial (D / η), initial₀.trans (le_max_left _ _), fun t => ?_⟩
cases t with
| zero =>
have fixed : conditioned π.weight = π.weight := by
funext x
simp only [conditioned, show mass π.weight = 1 from π.total, div_one]
rw [pow_zero, Matrix.vecMul_one, fixed, pow_zero, mul_one]
exact le_max_left _ _
| succ t =>
have atT := decay t
change totalVariation (conditioned (π.weight ᵥ* (P + R) ^ (t + 1))) data.left.weight ≤ _ at atT
rw [decomp, noScaling] at atT
refine atT.trans ?_
calc
_ = (D / η) * η ^ (t + 1) := by rw [pow_succ]; field_simp
_ ≤ _ := mul_le_mul_of_nonneg_right (le_max_right _ _) (pow_nonneg η₀.le _)

theorem primitive_killed_kernel_exponential {X : Type*} [Fintype X] [Nonempty X] [DecidableEq X]
(Q : Matrix X X ℝ) (primitive : Q.IsPrimitive) (π : FiniteLaw X)
{root : ℝ} (root₀ : 0 < root) (data : PerronData Q root)
(normalized : data.left.weight ⬝ᵥ data.right = 1) :
∃ η : ℝ, 0 < η ∧ η < 1 ∧ ∃ C : ℝ, 0 ≤ C ∧ ∀ t : ℕ,
totalVariation (conditioned (π.weight ᵥ* Q ^ t)) data.left.weight ≤ C * η ^ t := by
let A := root⁻¹ • Q
let P := Matrix.vecMulVec data.right data.left.weight
have scaled : A.IsPrimitive := by
constructor
· intro i j
exact mul_nonneg (inv_nonneg.mpr root₀.le) (primitive.nonneg i j)
· obtain ⟨k, hk, positive⟩ := primitive.exists_pos_pow
refine ⟨k, hk, fun i j => ?_⟩
unfold A
rw [smul_pow]
exact mul_pos (pow_pos (inv_pos.mpr root₀) _) (positive i j)
have fixedRight : A *ᵥ data.right = data.right := by
unfold A
rw [Matrix.smul_mulVec, data.right_eigen, smul_smul, inv_mul_cancel₀ root₀.ne', one_smul]
have fixedLeft : data.left.weight ᵥ* A = data.left.weight := by
unfold A
rw [Matrix.vecMul_smul, data.left_eigen, smul_smul, inv_mul_cancel₀ root₀.ne', one_smul]
have p₀ (i j : X) : 0 ≤ P i j := mul_nonneg (data.right_pos i).le (data.left.nonneg j)
have pFixed : P *ᵥ data.right = data.right := by
unfold P
rw [Matrix.vecMulVec_mulVec, normalized, MulOpposite.op_one, one_smul]
have proj : P * P = P := by
unfold P
rw [Matrix.vecMulVec_mul_vecMulVec, normalized, one_smul]
have left : P * A = P := by unfold P; rw [Matrix.vecMulVec_mul, fixedLeft]
have right : A * P = P := by unfold P; rw [Matrix.mul_vecMulVec, fixedRight]
obtain ⟨η, over, subunit⟩ := exists_between
(primitive_perron_remainder_lt_one A P scaled data.right data.right_pos fixedRight
p₀ pFixed proj left right)
have η₀ := (gelfandRadius_nonneg (A - P)).trans_lt over
exact ⟨η, η₀, subunit, finite_kernel_conditioned_rate Q π root₀ data normalized η₀ subunit over⟩

theorem primitive_killed_kernel_quasi_stationarity {X : Type*}
[Fintype X] [Nonempty X] [DecidableEq X] (Q : Matrix X X ℝ) (primitive : Q.IsPrimitive)
(substochastic : ∀ i, (∑ j, Q i j) ≤ 1) (leaks : ∃ i, (∑ j, Q i j) < 1) :
∃ (root : ℝ) (data : PerronData Q root), 0 < root ∧ root < 1 ∧
gelfandRadius Q = root ∧ QuasiStationary Q data.left ∧
(∀ π : FiniteLaw X, QuasiStationary Q π → π.weight = data.left.weight) ∧
HasSum (fun t : ℕ => mass (data.left.weight ᵥ* Q ^ t)) (1 / (1 - root)) ∧
(∀ π : FiniteLaw X, ∃ η : ℝ, 0 < η ∧ η < 1 ∧ ∃ C : ℝ, 0 ≤ C ∧ ∀ t : ℕ,
totalVariation (conditioned (π.weight ᵥ* Q ^ t)) data.left.weight ≤ C * η ^ t) := by
obtain ⟨root, data, pos, small, radius, normalized, characterize, _, lifetime⟩ :=
irreducible_killed_kernel_qsd Q primitive.isIrreducible substochastic leaks
exact ⟨root, data, pos, small, radius, (characterize data.left).mpr rfl,
fun π h => (characterize π).mp h, lifetime,
fun π => primitive_killed_kernel_exponential Q primitive π pos data normalized⟩

end QBDMathlib.Ch04

#print axioms QBDMathlib.Ch04.finite_kernel_quasi_stationarity
#print axioms QBDMathlib.Ch04.irreducible_killed_kernel_qsd
#print axioms QBDMathlib.Ch04.finite_kernel_conditioned_rate
#print axioms QBDMathlib.Ch04.primitive_killed_kernel_exponential
#print axioms QBDMathlib.Ch04.primitive_killed_kernel_quasi_stationarity

Verification Summary:

The machine-checked proofs assemble Perron existence, exact geometric lifetimes, and primitive spectral-gap contraction into closed theorems certifying quasi-stationarity and exponential conditioned convergence for finite killed kernels. Infinite-state and time-inhomogeneous chains remain outside this finite-matrix assembly. The Lean 4 and Mathlib kernel accepts all closed proof terms using only standard axioms, certifying the logical synthesis of Finite-Kernel Quasi-Stationarity §4.7.5.

In Plain English:
Machine-checked Lean 4 proofs certify the formal claims verified in Section 4.7.5.1.