pith. machine review for the scientific record. sign in

IndisputableMonolith.Foundation.IntegrationGap

IndisputableMonolith/Foundation/IntegrationGap.lean · 141 lines · 18 declarations

show as:
view math explainer →

open module explainer GitHub source

Explainer status: ready · generated 2026-05-13 03:09:05.593313+00:00

   1import Mathlib
   2import IndisputableMonolith.Constants
   3
   4/-!
   5# Integration Gap: D²(D+2) and Coprimality
   6
   7This module establishes two structural facts about the integer `D²(D+2)`,
   8which we call the **integration gap** of the framework:
   9
  10* At `D = 3`: `consciousnessGap D = D² × (D+2) = 9 × 5 = 45`.
  11  (The name "consciousness gap" is used in companion work on consciousness
  12  modeling within the broader framework. Within the present file the integer
  13  is purely combinatorial: `D² = 9` is the parity count and `D + 2 = 5` is
  14  the configuration dimension at `D = 3`.)
  15* `gcd(2^D, D²(D+2)) = 1` if and only if `D` is odd. This forces `D` odd
  16  in any setting where `2^D` is the natural recognition period and the
  17  recognition cycle must remain orderly.
  18
  19Combined with the linking argument in `Foundation.DimensionForcing`
  20(which selects `D = 3` among all dimensions), the coprimality result
  21restricts the dimension to `D = 3` among the odd dimensions consistent
  22with non-trivial linking.
  23
  24## Status
  25
  26* `0 sorry`
  27* Depends only on `Mathlib`, `IndisputableMonolith.Constants`, and the
  28  standard kernel axioms `propext`, `Classical.choice`, `Quot.sound`.
  29-/
  30
  31namespace IndisputableMonolith
  32namespace Foundation
  33namespace IntegrationGap
  34
  35open Constants
  36
  37/-! ## The dimension and the integration gap -/
  38
  39/-- The spatial dimension forced by linking (cf. `Foundation.DimensionForcing`). -/
  40def D : ℕ := 3
  41
  42/-- The configuration dimension of a recognition event:
  43    `D` spatial degrees of freedom + 1 temporal + 1 ledger balance. -/
  44def configDim (d : ℕ) : ℕ := d + 2
  45
  46/-- The parity count (number of independent ledger parities): `D²`.
  47    At `D = 3`, this equals `9`. -/
  48def parityCount (d : ℕ) : ℕ := d ^ 2
  49
  50/-- The integration gap: parity count times configuration dimension. -/
  51def integrationGap (d : ℕ) : ℕ := parityCount d * configDim d
  52
  53theorem configDim_at_D3 : configDim D = 5 := by native_decide
  54
  55theorem parityCount_at_D3 : parityCount D = 9 := by native_decide
  56
  57theorem integrationGap_at_D3 : integrationGap D = 45 := by native_decide
  58
  59theorem integrationGap_factors : integrationGap D = 9 * 5 := by native_decide
  60
  61/-! ## Coprimality forces odd dimension -/
  62
  63/-- For odd `D = 2k+1`, `D²(D+2)` is odd (a product of odd numbers),
  64    hence coprime with any power of `2`. -/
  65theorem coprimality_odd (k : ℕ) :
  66    Nat.Coprime (2 ^ (2 * k + 1)) ((2 * k + 1) ^ 2 * (2 * k + 3)) := by
  67  suffices h : Nat.Coprime 2 ((2 * k + 1) ^ 2 * (2 * k + 3)) from h.pow_left _
  68  show Nat.gcd 2 ((2 * k + 1) ^ 2 * (2 * k + 3)) = 1
  69  have hodd : (2 * k + 1) ^ 2 * (2 * k + 3) =
  70      2 * (4 * k ^ 3 + 10 * k ^ 2 + 7 * k + 1) + 1 := by ring
  71  rw [hodd]
  72  set n := 4 * k ^ 3 + 10 * k ^ 2 + 7 * k + 1
  73  rw [Nat.gcd_rec]
  74  have : (2 * n + 1) % 2 = 1 := by omega
  75  rw [this]
  76  decide
  77
  78/-- For even `D = 2k` (with `k ≥ 1`), `D²(D+2)` is even, so the gcd is `> 1`. -/
  79theorem coprimality_even_fails (k : ℕ) (hk : 0 < k) :
  80    ¬ Nat.Coprime (2 ^ (2 * k)) ((2 * k) ^ 2 * (2 * k + 2)) := by
  81  intro h
  82  have h1 : 2 ∣ 2 ^ (2 * k) := dvd_pow (dvd_refl 2) (by omega)
  83  have h2 : 2 ∣ (2 * k) ^ 2 * (2 * k + 2) := ⟨2 * k ^ 2 * (2 * k + 2), by ring⟩
  84  have h3 := Nat.dvd_gcd h1 h2
  85  rw [h] at h3
  86  exact absurd h3 (by norm_num)
  87
  88/-- At `D = 3`: `gcd(8, 45) = 1`. -/
  89theorem coprime_at_D3 : Nat.Coprime (2 ^ D) (integrationGap D) := by native_decide
  90
  91/-! ## Integration gap minus one -/
  92
  93/-- The integer `D²(D+2) - 1`. At `D = 3` this equals `44`. -/
  94def gapMinusOne (d : ℕ) : ℕ := integrationGap d - 1
  95
  96theorem gapMinusOne_at_D3 : gapMinusOne D = 44 := by native_decide
  97
  98theorem gapMinusOne_factor : gapMinusOne D = 4 * 11 := by native_decide
  99
 100/-! ## φ-power identity (matter-balance bridge) -/
 101
 102noncomputable section
 103
 104/-- The active edge count per fundamental tick. -/
 105def A : ℤ := 1
 106
 107/-- The φ-power balance identity at `D = 3`:
 108    `φ^(A − gap) · φ^gap = φ`, equivalently `φ^(−44) · φ^45 = φ`. -/
 109theorem gap_balance :
 110    phi ^ (A - ↑(integrationGap D)) * phi ^ (↑(integrationGap D) : ℤ) = phi := by
 111  have hg : (↑(integrationGap D) : ℤ) = 45 := by exact_mod_cast integrationGap_at_D3
 112  rw [hg, show A = (1 : ℤ) from rfl, ← zpow_add₀ (ne_of_gt phi_pos)]
 113  have : (1 : ℤ) - 45 + 45 = 1 := by norm_num
 114  rw [this, zpow_one]
 115
 116end
 117
 118/-! ## Master certificate -/
 119
 120structure IntegrationGapCert where
 121  config_dim : configDim D = 5
 122  parity_count : parityCount D = 9
 123  gap_value : integrationGap D = 45
 124  gap_minus_one : gapMinusOne D = 44
 125  coprime_at_3 : Nat.Coprime (2 ^ D) (integrationGap D)
 126  odd_coprime : ∀ k, Nat.Coprime (2 ^ (2*k+1)) ((2*k+1)^2 * (2*k+3))
 127  even_not_coprime : ∀ k, 0 < k → ¬ Nat.Coprime (2^(2*k)) ((2*k)^2 * (2*k+2))
 128
 129theorem integrationGapCert : IntegrationGapCert where
 130  config_dim := configDim_at_D3
 131  parity_count := parityCount_at_D3
 132  gap_value := integrationGap_at_D3
 133  gap_minus_one := gapMinusOne_at_D3
 134  coprime_at_3 := coprime_at_D3
 135  odd_coprime := coprimality_odd
 136  even_not_coprime := coprimality_even_fails
 137
 138end IntegrationGap
 139end Foundation
 140end IndisputableMonolith
 141

source mirrored from github.com/jonwashburn/shape-of-logic