11import Incompleteness.Arith.D3
22import Logic.Logic.HilbertStyle.Supplemental
3+ import Incompleteness.ToFoundation.Basic
34
45noncomputable section
56
@@ -15,7 +16,7 @@ def substNumeral (p x : V) : V := ⌜ℒₒᵣ⌝.substs₁ (numeral x) p
1516
1617lemma substNumeral_app_quote (σ : Semisentence ℒₒᵣ 1 ) (n : ℕ) :
1718 substNumeral ⌜σ⌝ (n : V) = ⌜(σ/[‘↑n’] : Sentence ℒₒᵣ)⌝ := by
18- simp [substNumeral]
19+ dsimp [substNumeral]
1920 let w : Fin 1 → Semiterm ℒₒᵣ Empty 0 := ![‘↑n’]
2021 have : ?[numeral (n : V)] = (⌜fun i : Fin 1 ↦ ⌜w i⌝⌝ : V) := nth_ext' 1 (by simp) (by simp) (by simp)
2122 rw [Language.substs₁, this, quote_substs' (L := ℒₒᵣ)]
@@ -24,6 +25,22 @@ lemma substNumeral_app_quote_quote (σ π : Semisentence ℒₒᵣ 1) :
2425 substNumeral (⌜σ⌝ : V) ⌜π⌝ = ⌜(σ/[⌜π⌝] : Sentence ℒₒᵣ)⌝ := by
2526 simpa [coe_quote, quote_eq_encode] using substNumeral_app_quote σ ⌜π⌝
2627
28+ def substNumerals (p : V) (v : Fin k → V) : V := ⌜ℒₒᵣ⌝.substs ⌜fun i ↦ numeral (v i)⌝ p
29+
30+ lemma substNumerals_app_quote (σ : Semisentence ℒₒᵣ k) (v : Fin k → ℕ) :
31+ (substNumerals ⌜σ⌝ (v ·) : V) = ⌜((Rew.substs (fun i ↦ ‘↑(v i)’)).hom σ : Sentence ℒₒᵣ)⌝ := by
32+ dsimp [substNumerals]
33+ let w : Fin k → Semiterm ℒₒᵣ Empty 0 := fun i ↦ ‘↑(v i)’
34+ have : ⌜fun i ↦ numeral (v i : V)⌝ = (⌜fun i : Fin k ↦ ⌜w i⌝⌝ : V) := by
35+ apply nth_ext' (k : V) (by simp) (by simp)
36+ intro i hi; rcases eq_fin_of_lt_nat hi with ⟨i, rfl⟩
37+ simp [w]
38+ rw [this, quote_substs' (L := ℒₒᵣ)]
39+
40+ lemma substNumerals_app_quote_quote (σ : Semisentence ℒₒᵣ k) (π : Fin k → Semisentence ℒₒᵣ k) :
41+ substNumerals (⌜σ⌝ : V) (fun i ↦ ⌜π i⌝) = ⌜((Rew.substs (fun i ↦ ⌜π i⌝)).hom σ : Sentence ℒₒᵣ)⌝ := by
42+ simpa [coe_quote, quote_eq_encode] using substNumerals_app_quote σ (fun i ↦ ⌜π i⌝)
43+
2744section
2845
2946def _root_.LO.FirstOrder.Arith.ssnum : 𝚺₁.Semisentence 3 := .mkSigma
@@ -35,6 +52,29 @@ lemma substNumeral_defined : 𝚺₁-Function₂ (substNumeral : V → V → V)
3552@[simp] lemma eval_ssnum (v) :
3653 Semiformula.Evalbm V v ssnum.val ↔ v 0 = substNumeral (v 1 ) (v 2 ) := substNumeral_defined.df.iff v
3754
55+ def _root_.LO.FirstOrder.Arith.ssnums : 𝚺₁.Semisentence (k + 2 ) := .mkSigma
56+ “y p. ∃ n, !lenDef ↑k n ∧
57+ (⋀ i, ∃ z, !nthDef z n ↑(i : Fin k) ∧ !numeralDef z #i.succ.succ.succ.succ) ∧
58+ !p⌜ℒₒᵣ⌝.substsDef y n p” (by simp)
59+
60+ lemma substNumerals_defined :
61+ Arith.HierarchySymbol.DefinedFunction (fun v ↦ substNumerals (v 0 ) (v ·.succ) : (Fin (k + 1 ) → V) → V) ssnums := by
62+ intro v
63+ suffices
64+ (v 0 = ⌜ℒₒᵣ⌝.substs ⌜fun (i : Fin k) ↦ numeral (v i.succ.succ)⌝ (v 1 )) ↔
65+ ∃ x, ↑k = len x ∧ (∀ (i : Fin k), x.[↑↑i] = numeral (v i.succ.succ)) ∧ v 0 = ⌜ℒₒᵣ⌝.substs x (v 1 ) by
66+ simpa [ssnums, ⌜ℒₒᵣ⌝.substs_defined.df.iff, substNumerals, numeral_eq_natCast] using this
67+ constructor
68+ · intro e
69+ refine ⟨_, by simp, by intro i; simp, e⟩
70+ · rintro ⟨w, hk, h, e⟩
71+ have : w = ⌜fun (i : Fin k) ↦ numeral (v i.succ.succ)⌝ := nth_ext' (k : V) hk.symm (by simp)
72+ (by intro i hi; rcases eq_fin_of_lt_nat hi with ⟨i, rfl⟩; simp [h])
73+ rcases this; exact e
74+
75+ @[simp] lemma eval_ssnums (v : Fin (k + 2 ) → V) :
76+ Semiformula.Evalbm V v ssnums.val ↔ v 0 = substNumerals (v 1 ) (fun i ↦ v i.succ.succ) := substNumerals_defined.df.iff v
77+
3878end
3979
4080end LO.Arith.Formalized
@@ -73,6 +113,32 @@ theorem diagonal (θ : Semisentence ℒₒᵣ 1) :
73113
74114end Diagonalization
75115
116+ section Multidiagonalization
117+
118+ /-- $\mathrm{diag}_i(\vec{x}) := (\forall \vec{y})\left[ \left(\bigwedge_j \mathrm{ssnums}(y_j, x_j, \vec{x})\right) \to \theta_i(\vec{y}) \right]$ -/
119+ def multidiag (θ : Semisentence ℒₒᵣ k) : Semisentence ℒₒᵣ k :=
120+ ∀^[k] (
121+ (Matrix.conj fun j : Fin k ↦ (Rew.substs <| #(j.addCast k) :> #(j.addNat k) :> fun l ↦ #(l.addNat k)).hom ssnums.val) ➝
122+ (Rew.substs fun j ↦ #(j.addCast k)).hom θ)
123+
124+ def multifixpoint (θ : Fin k → Semisentence ℒₒᵣ k) (i : Fin k) : Sentence ℒₒᵣ := (Rew.substs fun j ↦ ⌜multidiag (θ j)⌝).hom (multidiag (θ i))
125+
126+ theorem multidiagonal (θ : Fin k → Semisentence ℒₒᵣ k) :
127+ T ⊢!. multifixpoint θ i ⭤ (Rew.substs fun j ↦ ⌜multifixpoint θ j⌝).hom (θ i) :=
128+ haveI : 𝐄𝐐 ≼ T := System.Subtheory.comp (𝓣 := 𝐈𝚺₁) inferInstance inferInstance
129+ complete (T := T) <| oRing_consequence_of _ _ fun (V : Type ) _ _ ↦ by
130+ haveI : V ⊧ₘ* 𝐈𝚺₁ := ModelsTheory.of_provably_subtheory V 𝐈𝚺₁ T inferInstance inferInstance
131+ suffices V ⊧/![] (multifixpoint θ i) ↔ V ⊧/(fun i ↦ ⌜multifixpoint θ i⌝) (θ i) by simpa [models_iff]
132+ let t : Fin k → V := fun i ↦ ⌜multidiag (θ i)⌝
133+ have ht : ∀ i, substNumerals (t i) t = ⌜multifixpoint θ i⌝ := by
134+ intro i; simp [t, multifixpoint, substNumerals_app_quote_quote]
135+ calc
136+ V ⊧/![] (multifixpoint θ i) ↔ V ⊧/t (multidiag (θ i)) := by simp [multifixpoint]
137+ _ ↔ V ⊧/(fun i ↦ substNumerals (t i) t) (θ i) := by simp [multidiag, ←Function.funext_iff]
138+ _ ↔ V ⊧/(fun i ↦ ⌜multifixpoint θ i⌝) (θ i) := by simp [ht]
139+
140+ end Multidiagonalization
141+
76142section
77143
78144variable (U : Theory ℒₒᵣ) [U.Delta1Definable]
0 commit comments