Documentation

ReflectiveSubsystems.GodelChecker

A concrete sound bounded proof-checker over Foundation ([Decoupling] §6.3, the Level-2 witness) #

Provenance: [Decoupling] §6.3 (Theorem 6.3, Levels L2a/L2b). This discharges the abstract BoundedChecker interface of ReflectiveSubsystems/GodelInternalization.lean (FV-8) with a concrete decidable sound checker over Foundation's Sentence ℒₒᵣ, so the L2b decision Decide(G) = true holds for a real Gödel sentence.

The checker is restated, not instantiated #

Rather than literally instantiating the Mathlib-side BoundedChecker structure of ReflectiveSubsystems/GodelInternalization.lean, the (tiny) L2b decision step is re-proved here directly against Foundation's Sentence ℒₒᵣ — the same architecture ReflectiveSubsystems/GodelComplete.lean uses for the incompleteness import, and it keeps the concrete checker readable on its own terms. The checker below provides, concretely, every field of BoundedChecker: Formula := Sentence ℒₒᵣ, gnum := Encodable.encode, Derivable := (T ⊢ ·), the decidable Prf, and the soundness Prf φ p = true → T ⊢ φ (Prf_sound).

The checker (faithful, NOT degenerate) #

A proof code decodes (via Encodable) to a List Step, a Hilbert-style script over a fixed, decidable, provable axiom list Ax:

Witness theory and axioms #

The checker + soundness are generic over any T : ArithmeticTheory (axiom-clean). The capstone instantiates it at T★ = 𝗣𝗔⁻ (PeanoMinus) — paMinus_decides_bounded_nonprovability, fully axiom-clean (#print axioms = propext, Classical.choice, Quot.sound). 𝗣𝗔⁻ is a finite theory, so its Δ₁-definability is constructed from Theory.Δ₁.ofFinite PeanoMinus.finite with no named axiom. This is the recommended witness. The earlier obstruction (no Δ₁ instance for 𝗥₀/𝗤, both infinite via the 𝗘𝗤 schema) is sidestepped because 𝗣𝗔⁻ — though it extends 𝗥₀ — is itself finite.

A parallel 𝗜𝚺₁ witness (isigma1_decides_bounded_nonprovability', the same statement at T = 𝗜𝚺₁) is also fully axiom-clean: Foundation's 𝗜𝚺₁/𝗣𝗔 Δ₁-definability is a theorem (an instance synthesized from PeanoMinus.delta1, InductionScheme.delta1_prenexHierarchy and the union instance), so exists_true_but_unprovable_sentence_of_sigma1sound 𝗜𝚺₁ carries no named axiom and #print axioms of the witness shows only propext, Classical.choice, Quot.sound. 𝗣𝗔⁻ ⊊ 𝗜𝚺₁, so the 𝗣𝗔⁻ capstone is the weaker, more faithful (§5.3-class) statement, and the 𝗜𝚺₁ form is the parallel witness at Foundation's canonical Σ₁-induction theory.

Computable but INCOMPLETE (the other half of the wall) #

This checker is computable (Prf #evals — see prf_nondegenerate/prf_accepts_mp) but incomplete: it is a Hilbert (ax+MP) script checker over a fixed finite axiom list, whereas Foundation's classical first-order ⊢ is the one-sided sequent calculus 𝐋𝐊¹, with no exposed Hilbert-vs-𝐋𝐊¹ completeness bridge. ReflectiveSubsystems/GodelCheckerComplete.lean (FV-9) supplies the dual — sound AND complete, but noncomputable. Merging the two into a single computable-and-complete bounded decider is a documented WALL; the precise missing object is a runnable Decidable/Bool form of Foundation's noncomputable Δ₁-fixpoint proof predicate Bootstrapping.Proof — see the wall section of GodelCheckerComplete.lean for the full statement. Non-load-bearing: the §6.3 verdict needs only this checker's soundness.

@[reducible, inline]

Sentences of the language of ordered rings — the Formula object of §6.3 (abstractly; the L2a finite carving is Formula below).

Equations
Instances For

    A single proof-script step (§6.3 L2b, the bounded checker's instruction set): assert an axiom, apply modus ponens. mp i j b stores the conclusion b explicitly so validity is a decidable equality line i = (line j 🡒 b) — no implication-destructuring needed.

    Instances For

      Step ≃ S ⊕ (ℕ × ℕ × S), giving Encodable Step from Foundation's Encodable S.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        @[instance_reducible]
        Equations
        • One or more equations did not get rendered due to their size.

        Validate one step against the axiom list Ax and the formulas proven so far; returns the proven formula, or none if the step is invalid.

        Equations
        Instances For

          Fold a script left-to-right, threading the list of proven formulas; none if any step fails.

          Equations
          Instances For

            Run a proof script from the empty context.

            Equations
            Instances For

              §6.3 L2b — the concrete bounded proof relation Prf : Formula → ProofCode → Bool. Prf Ax φ p decodes the code p to a script and accepts iff the script is valid and proves φ. Decidable and total.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For

                Soundness: every accepted formula is genuinely T-provable #

                theorem ReflectiveSubsystems.HilbertChecker.Prf_sound (T : FFL.FirstOrder.ArithmeticTheory) (Ax : List S) (hAx : ∀ c ∈ Ax, T ⊢ c) (φ : S) (p : ℕ) :
                Prf Ax φ p = true → T ⊢ φ

                §6.3 L2b soundness: Prf Ax φ p = true → T ⊢ φ — the BoundedChecker.sound field, concretely. The only direction the decision needs.

                Non-degeneracy: the checker accepts a genuine proof #

                theorem ReflectiveSubsystems.HilbertChecker.Prf_accepts (Ax : List S) (steps : List Step) (φ : S) (proven : List S) (hrun : run Ax steps = some proven) (hmem : φ ∈ proven) :
                Prf Ax φ (Encodable.encode steps) = true

                If a script steps validly proves φ (under Ax), then Prf accepts its code. Via Encodable.encodek (decode (encode steps) = some steps), avoiding any heavy decide on the encoding. Shows the checker is NOT the degenerate always-false one.

                Capstone — L2b for the real 𝗣𝗔⁻ Gödel sentence #

                theorem ReflectiveSubsystems.HilbertChecker.paMinus_decides_bounded_nonprovability (Ax : List S) (hAx : ∀ c ∈ Ax, 𝗣𝗔⁻ ⊢ c) (Mchk : ℕ) :
                ∃ (G : S), ℕ↓[ℒₒᵣ] ⊧ G ∧ 𝗣𝗔⁻ ⊬ G ∧ ∀ p ≤ Mchk, Prf Ax G p = false

                §6.3 Theorem 6.3, L2b — concrete, FULLY axiom-clean. With witness theory T★ = 𝗣𝗔⁻ (PeanoMinus). Because 𝗣𝗔⁻ is a finite theory (PeanoMinus.finite), its Δ₁-definability is obtained constructively from Theory.Δ₁.ofFinite, needing no appeal to Foundation's 𝗜𝚺₁/𝗣𝗔 Δ₁-definability result (its synthesized 𝗜𝚺₁.Δ₁ instance) at all (the parallel 𝗜𝚺₁ witness isigma1_decides_bounded_nonprovability' below does route through it — now discharged upstream, so it too is axiom-clean). So the actual Gödel sentence G of 𝗣𝗔⁻ (true in ℕ, unprovable in 𝗣𝗔⁻) is decided as bounded-non-provable for the concrete sound checker over any provable axiom Ax, and #print axioms shows only propext, Classical.choice, Quot.sound.

                𝗣𝗔⁻ ⊊ 𝗜𝚺₁, so unprovability in 𝗣𝗔⁻ is the weaker (and thus more faithful, §5.3-class) statement; the three incompleteness instances are 𝗣𝗔⁻.Δ₁ (here, via ofFinite), 𝗥₀ ⪯ 𝗣𝗔⁻ (PeanoMinus/Basic.lean:402), and ℕ↓[ℒₒᵣ] ⊧* 𝗣𝗔⁻ (PeanoMinus/Basic.lean:184).

                theorem ReflectiveSubsystems.HilbertChecker.isigma1_decides_bounded_nonprovability' (Ax : List S) (hAx : ∀ c ∈ Ax, 𝗜𝚺₁ ⊢ c) (Mchk : ℕ) :
                ∃ (G : S), ℕ↓[ℒₒᵣ] ⊧ G ∧ 𝗜𝚺₁ ⊬ G ∧ ∀ p ≤ Mchk, Prf Ax G p = false

                §6.3 Theorem 6.3, L2b — concrete, for the real 𝗜𝚺₁ Gödel sentence. The parallel witness to paMinus_decides_bounded_nonprovability at Foundation's canonical Σ₁-induction theory T = 𝗜𝚺₁: the actual Gödel sentence G of 𝗜𝚺₁ (true in ℕ, unprovable in 𝗜𝚺₁) is decided as bounded-non-provable for the concrete sound checker over any provable axiom Ax. Foundation's 𝗜𝚺₁.Δ₁ instance is a theorem (synthesized from PeanoMinus.delta1, InductionScheme.delta1_prenexHierarchy and the union instance, the 𝗜𝚺₁/𝗣𝗔 Δ₁-definability obligation discharged upstream), so this witness is fully axiom-clean: #print axioms shows only propext, Classical.choice, Quot.sound. 𝗣𝗔⁻ ⊊ 𝗜𝚺₁, so paMinus_decides_bounded_nonprovability above is the weaker, more faithful (§5.3-class) statement.

                Non-degeneracy. The checker accepts a genuine proof: the one-line script [Step.ax ⊤] proves ⊤ under the axiom set [⊤], so Prf returns true on its code. Hence Prf is NOT the degenerate always-false checker, and Decide(⊤) would correctly be false (a bounded proof exists). Combined with topAx_provable, the axiom set is real and provable.

                The axiom set [⊤🡒⊤, ⊤] is genuinely 𝗜𝚺₁-provable (C_id for ⊤🡒⊤, verum for ⊤): a real, non-empty, provable axiom set for the modus-ponens witness below.

                Non-degeneracy on the mp branch (the EXECUTABLE checker accepts a real inference). The three-line script [ax (⊤🡒⊤), ax ⊤, mp 0 1 ⊤] over the provable axiom set [⊤🡒⊤, ⊤] runs validly and proves ⊤ by a genuine modus-ponens step — line 2 reads lines 0,1 and fires MP — so Prf accepts its code. Unlike prf_nondegenerate (which exercises only the ax/⊤ path), this drives the mp path of checkStep. With impTopAx_provable the axiom set is real and 𝗜𝚺₁-provable, so this is a non-degenerate acceptance of a derived (non-axiom) theorem, not a trivial restatement.

                L2a — the Formula object as a finite carving of codes (Theorem 6.3 L2a) #

                §6.3 L2a well-formedness: a code is a well-formed formula iff it decodes to a sentence. (via Option.isSome), as required for the Formula subobject to be a base object of Rep(S).

                Equations
                Instances For
                  @[reducible, inline]

                  §6.3 L2a — the Formula object: the finite subobject {c ≤ M_chk : Wff c} of S_work, cut out by the decidable predicate Wff. A Fintype (finite products + decidable predicate — a base no exponential, Proposition 4.5).

                  Equations
                  Instances For

                    §6.3 L2a — G_{T_S} a global element 1 → Formula: the Gödel sentence's code gnum G lies in the Formula object once the indexing budget reaches it (gnum G ≤ M_chk).