pith. machine review for the scientific record. sign in

IndisputableMonolith.Foundation.UniversalForcingSelfReference

IndisputableMonolith/Foundation/UniversalForcingSelfReference.lean · 276 lines · 14 declarations

show as:
view math explainer →

open module explainer GitHub source

Explainer status: ready · generated 2026-05-13 14:25:00.662258+00:00

   1import Mathlib
   2import IndisputableMonolith.Foundation.LogicRealization
   3import IndisputableMonolith.Foundation.UniversalForcing
   4import IndisputableMonolith.Foundation.UniversalForcing.NaturalNumberObject
   5import IndisputableMonolith.Foundation.UniversalForcing.DiscreteRealization
   6
   7/-!
   8# Universal Forcing: Self-Reference
   9
  10The Universal Forcing Meta-Theorem (`Foundation.UniversalForcing`) says
  11that any two `LogicRealization`s have canonically isomorphic forced
  12arithmetic. This module formalises the next step: the meta-theorem
  13itself fits the Law-of-Logic structural shape. The framework is
  14reflexively closed.
  15
  16## Honest scope
  17
  18"Self-reference" here is *structural*, not Gödel-style. We do not prove
  19"the meta-theorem proves the meta-theorem". We prove that the act of
  20comparing realizations is itself a Law-of-Logic-shaped structure, with:
  21
  22* a meta-carrier (the type of `LogicRealization.{0,0}` instances),
  23* a meta-cost (zero when two realizations are propositionally equal,
  24  positive otherwise),
  25* the three definitional Aristotelian conditions (identity, non-
  26  contradiction, totality) on this meta-cost,
  27* a forced-arithmetic-invariance theorem (the meta-theorem itself,
  28  reified as the comparison law).
  29
  30Universe handling: `LogicRealization.{0,0}` is `Type 1`, so the
  31meta-carrier sits one universe above the carriers of the realizations
  32it compares. Following the existing convention of
  33`UniversalForcing.NaturalNumberObject` (which already fixes
  34`LogicRealization.{0,0}` for `universal_forcing_via_NNO`), we restrict
  35the meta-realization to `Type 1` and make the universe lift explicit.
  36
  37We do not attempt to instantiate the full heavy `LogicRealization`
  38structure for the meta-realization (the orbit/step coherence axioms
  39require additional design choices that are not part of the
  40self-reference content). Instead, we give a `MetaRealizationCert`
  41recording all the structural properties that *would* be required of
  42such an instance, and prove that the meta-theorem already supplies
  43each one.
  44
  45## What this earns
  46
  47The framework is reflexively closed: the meta-theorem is itself a
  48Law-of-Logic-shaped operation comparing realizations, with the three
  49definitional Aristotelian conditions automatic and the meta-theorem's
  50canonical equivalence supplying the forced-arithmetic invariance for
  51free.
  52-/
  53
  54namespace IndisputableMonolith
  55namespace Foundation
  56namespace UniversalForcingSelfReference
  57
  58open Classical
  59open UniversalForcing
  60
  61/-! ## The Meta-Carrier and Meta-Cost -/
  62
  63/-- The **meta-carrier**: the type of `LogicRealization.{0,0}` instances.
  64This sits in `Type 1` because `LogicRealization.{0,0}` is itself in
  65`Type 1`. -/
  66abbrev MetaCarrier : Type 1 := LogicRealization.{0, 0}
  67
  68/-- The **meta-cost** between two realizations. By Classical decidability,
  69this is `0` if the realizations are propositionally equal and `1`
  70otherwise. The choice is structural: the cost detects definitional
  71distinctness, not orbit non-isomorphism (which by the meta-theorem is
  72always trivial). -/
  73noncomputable def metaCost (R S : MetaCarrier) : ℕ :=
  74  if R = S then 0 else 1
  75
  76/-! ## The Three Definitional Aristotelian Conditions on Meta-Cost -/
  77
  78/-- **(L1) Identity** for the meta-cost: comparing a realization with
  79itself has zero cost. -/
  80theorem metaCost_self (R : MetaCarrier) : metaCost R R = 0 := by
  81  unfold metaCost
  82  simp
  83
  84/-- **(L2) Non-Contradiction** for the meta-cost: the comparison is
  85symmetric in its arguments. -/
  86theorem metaCost_symm (R S : MetaCarrier) : metaCost R S = metaCost S R := by
  87  unfold metaCost
  88  by_cases h : R = S
  89  · subst h; rfl
  90  · have hSR : ¬ S = R := fun h' => h h'.symm
  91    simp [h, hSR]
  92
  93/-- **(L3a) Totality** for the meta-cost: defined on every pair of
  94realizations, returns a value (the function type signature). -/
  95theorem metaCost_total (R S : MetaCarrier) : ∃ c : ℕ, metaCost R S = c :=
  96  ⟨metaCost R S, rfl⟩
  97
  98/-- The meta-cost is zero iff the realizations are definitionally
  99equal. -/
 100theorem metaCost_eq_zero_iff (R S : MetaCarrier) :
 101    metaCost R S = 0 ↔ R = S := by
 102  unfold metaCost
 103  by_cases h : R = S
 104  · simp [h]
 105  · simp [h]
 106
 107/-! ## Forced-Arithmetic Invariance: The Meta-Theorem -/
 108
 109/-- **The meta-theorem reified.** For any two realizations, the canonical
 110equivalence between their forced arithmetic objects exists. This is
 111exactly `universal_forcing_via_NNO`, packaged as the comparison law of
 112the meta-realization. -/
 113noncomputable def metaForcedArithmeticInvariance (R S : MetaCarrier) :
 114    R.Orbit ≃ S.Orbit :=
 115  universal_forcing_via_NNO R S
 116
 117/-- The meta-theorem is reflexive: comparing a realization to itself
 118yields the identity equivalence on its orbit. -/
 119theorem metaForcedArithmeticInvariance_self (R : MetaCarrier) :
 120    metaForcedArithmeticInvariance R R = Equiv.refl R.Orbit := by
 121  -- Both sides are the canonical NNO equivalence from R to itself,
 122  -- which by uniqueness is the identity.
 123  apply Equiv.ext
 124  intro n
 125  -- The NNO equivalence applied at n satisfies the universal property
 126  -- of the recursor: it is the unique map R.Orbit → R.Orbit sending
 127  -- orbitZero to orbitZero and intertwining orbitStep. The identity
 128  -- is one such map. By uniqueness, the canonical equivalence equals
 129  -- the identity.
 130  unfold metaForcedArithmeticInvariance universal_forcing_via_NNO
 131    IsNaturalNumberObject.equiv
 132  simp only [Equiv.refl_apply, Equiv.coe_fn_mk]
 133  -- Use the recursor uniqueness: the recursor with target (R.orbitZero, R.orbitStep)
 134  -- is the identity.
 135  have h_id_zero : (id : R.Orbit → R.Orbit) R.orbitZero = R.orbitZero := rfl
 136  have h_id_step : ∀ k, (id : R.Orbit → R.Orbit) (R.orbitStep k) =
 137      R.orbitStep ((id : R.Orbit → R.Orbit) k) := fun _ => rfl
 138  have huniq := (realizationOrbit_isNNO R).recursor_unique
 139    R.orbitZero R.orbitStep
 140    (id : R.Orbit → R.Orbit) h_id_zero h_id_step n
 141  -- huniq : id n = (realizationOrbit_isNNO R).recursor R.orbitZero R.orbitStep n
 142  -- Goal : (realizationOrbit_isNNO R).recursor R.orbitZero R.orbitStep n = n
 143  -- `id n` reduces to `n`.
 144  simpa using huniq.symm
 145
 146/-! ## Meta-Realization Certificate
 147
 148The structural properties that a "meta-realization" of the Law-of-Logic
 149framework would carry, all proved.
 150-/
 151
 152/-- **Meta-Realization Certificate.**
 153
 154The Universal Forcing Meta-Theorem fits the Law-of-Logic structural shape:
 155the meta-cost is identity, non-contradiction, total; and the meta-theorem
 156itself supplies the forced-arithmetic-invariance condition that completes
 157the structure.
 158
 159This is the reflexive-closure content of the framework. We do not claim
 160to instantiate the heavy `LogicRealization` structure with all its
 161orbit/step coherence axioms; instead, we record that every structural
 162property the heavy structure would require has been independently
 163proved. -/
 164structure MetaRealizationCert where
 165  /-- Meta-carrier exists at universe 1. -/
 166  carrier_type : Type 1
 167  carrier_eq_realization_type : carrier_type = LogicRealization.{0, 0}
 168  /-- Meta-cost is well-defined and total. -/
 169  cost_total : ∀ R S : MetaCarrier, ∃ c : ℕ, metaCost R S = c
 170  /-- (L1) Identity on the meta-cost. -/
 171  identity : ∀ R : MetaCarrier, metaCost R R = 0
 172  /-- (L2) Non-contradiction on the meta-cost. -/
 173  non_contradiction : ∀ R S : MetaCarrier, metaCost R S = metaCost S R
 174  /-- (L3a) Totality on the meta-cost. -/
 175  totality : ∀ R S : MetaCarrier, ∃ c : ℕ, metaCost R S = c
 176  /-- The meta-cost equals zero iff the realizations are equal. -/
 177  cost_zero_iff_eq : ∀ R S : MetaCarrier, metaCost R S = 0 ↔ R = S
 178  /-- Forced-arithmetic invariance: the meta-theorem reified as the
 179      comparison law of the meta-realization. -/
 180  forced_arithmetic_invariance :
 181    ∀ R S : MetaCarrier, R.Orbit ≃ S.Orbit
 182  /-- Reflexivity of the forced-arithmetic invariance. -/
 183  arithmetic_invariance_self :
 184    ∀ R : MetaCarrier,
 185      forced_arithmetic_invariance R R = Equiv.refl R.Orbit
 186
 187noncomputable def metaRealizationCert : MetaRealizationCert where
 188  carrier_type := LogicRealization.{0, 0}
 189  carrier_eq_realization_type := rfl
 190  cost_total := metaCost_total
 191  identity := metaCost_self
 192  non_contradiction := metaCost_symm
 193  totality := metaCost_total
 194  cost_zero_iff_eq := metaCost_eq_zero_iff
 195  forced_arithmetic_invariance := metaForcedArithmeticInvariance
 196  arithmetic_invariance_self := metaForcedArithmeticInvariance_self
 197
 198theorem metaRealizationCert_inhabited : Nonempty MetaRealizationCert :=
 199  ⟨metaRealizationCert⟩
 200
 201/-! ## The Reflexive-Closure Theorem -/
 202
 203/-- **The framework is reflexively closed.**
 204
 205The Universal Forcing Meta-Theorem itself instantiates the Law-of-Logic
 206structural shape: the meta-cost satisfies the three definitional
 207Aristotelian conditions, and the meta-theorem itself supplies the
 208forced-arithmetic-invariance condition. The framework that proves
 209"every Law-of-Logic realization has the same forced arithmetic" is
 210itself a Law-of-Logic-shaped structure on the type of realizations.
 211
 212The forced-arithmetic-invariance condition is wrapped in `Nonempty`
 213because the equivalence is `Type 1`-valued, while the conjunction here
 214is propositional. The Nonempty wrapper is harmless: the equivalence
 215exists for every pair, so its `Nonempty` is trivially inhabited. -/
 216theorem framework_is_reflexively_closed :
 217    -- Identity, non-contradiction, totality of meta-cost are automatic:
 218    (∀ R : MetaCarrier, metaCost R R = 0) ∧
 219    (∀ R S : MetaCarrier, metaCost R S = metaCost S R) ∧
 220    (∀ R S : MetaCarrier, ∃ c : ℕ, metaCost R S = c) ∧
 221    -- The meta-theorem supplies the comparison law:
 222    (∀ R S : MetaCarrier, Nonempty (R.Orbit ≃ S.Orbit)) := by
 223  refine ⟨metaCost_self, metaCost_symm, metaCost_total, ?_⟩
 224  intro R S
 225  exact ⟨metaForcedArithmeticInvariance R S⟩
 226
 227/-! ## The Meta-Meta-Theorem -/
 228
 229/-- **Meta-meta-theorem.** Applying the meta-theorem inside the
 230meta-realization yields the meta-theorem again. The structure of the
 231meta-theorem is preserved under self-application: comparing two
 232realizations through the meta-realization gives the same canonical
 233equivalence as comparing them directly through `universal_forcing`.
 234
 235This is the reflexive-fixed-point property: `universal_forcing` is its
 236own input under the meta-realization shape. -/
 237theorem meta_meta_theorem (R S : MetaCarrier) :
 238    metaForcedArithmeticInvariance R S = universal_forcing_via_NNO R S :=
 239  rfl
 240
 241/-! ## Honest acknowledgements
 242
 243What this module *does not* prove:
 244
 245* It does not prove `universal_forcing` proves itself in the
 246  metalogical sense. Gödel-style self-reference would require a
 247  different setup involving Gödel numbering and reflection principles.
 248
 249* It does not produce a full `LogicRealization.{1, 0}` instance with
 250  every orbit/step coherence axiom. The orbit fields require design
 251  choices that are not part of the self-reference content; in
 252  particular, choosing a meaningful "step on realizations" is its own
 253  programme.
 254
 255What this module *does* prove:
 256
 257* The meta-cost on `LogicRealization.{0,0}` satisfies the three
 258  definitional Aristotelian conditions automatically.
 259
 260* The meta-theorem `universal_forcing_via_NNO` already supplies the
 261  forced-arithmetic-invariance condition that the structural shape
 262  requires.
 263
 264* The meta-realization is reflexive: comparing a realization to itself
 265  yields the identity equivalence.
 266
 267* Therefore the framework is reflexively closed in the structural
 268  sense: the act of comparing realizations is itself a
 269  Law-of-Logic-shaped operation, with all definitional conditions
 270  automatic and the meta-theorem itself filling the substantive role.
 271-/
 272
 273end UniversalForcingSelfReference
 274end Foundation
 275end IndisputableMonolith
 276

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