Coding #
TODO: move to Foundation
theorem
LO.FirstOrder.Semiformula.encode_rel
{L : Language}
{ξ : Type u_1}
[Encodable ξ]
[(k : ℕ) → Encodable (L.Func k)]
[(k : ℕ) → Encodable (L.Rel k)]
{n arity : ℕ}
(R : L.Rel arity)
(v : Fin arity → Semiterm L ξ n)
:
Encodable.encode (rel R v) = Nat.pair 0
(Nat.pair arity (Nat.pair (Encodable.encode R) (Matrix.vecToNat fun (i : Fin arity) => Encodable.encode (v i)))) + 1
theorem
LO.FirstOrder.Semiformula.encode_nrel
{L : Language}
{ξ : Type u_1}
[Encodable ξ]
[(k : ℕ) → Encodable (L.Func k)]
[(k : ℕ) → Encodable (L.Rel k)]
{n arity : ℕ}
(R : L.Rel arity)
(v : Fin arity → Semiterm L ξ n)
:
Encodable.encode (nrel R v) = Nat.pair 1
(Nat.pair arity (Nat.pair (Encodable.encode R) (Matrix.vecToNat fun (i : Fin arity) => Encodable.encode (v i)))) + 1
Imported declaration from the Incompleteness formalization.
Equations
- LO.Arith.finArrowToVec x_2 = 0
- LO.Arith.finArrowToVec v = cons (v 0) (LO.Arith.finArrowToVec fun (x : Fin k) => v x.succ)
Instances For
@[implicit_reducible]
noncomputable instance
LO.Arith.instGoedelQuoteForallFin
{V : Type u_1}
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{k : ℕ}
:
GoedelQuote (Fin k → V) V
quasi-quotation rather than Godel quotation
Equations
theorem
LO.Arith.quote_matrix_def
{V : Type u_1}
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{k : ℕ}
(v : Fin k → V)
:
@[simp]
@[implicit_reducible]
instance
LO.Arith.instGoedelQuote
{V : Type u_1}
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{α : Type u_2}
[Encodable α]
:
GoedelQuote α V
Equations
- LO.Arith.instGoedelQuote = { quote := fun (x : α) => ↑(Encodable.encode x) }
theorem
LO.Arith.quote_eq_coe_encode
{V : Type u_1}
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{α : Type u_2}
[Encodable α]
(x : α)
:
@[simp]
@[simp]
@[simp]
theorem
LO.FirstOrder.Semiterm.quote_eq_encode
{L : Language}
[(k : ℕ) → Encodable (L.Func k)]
{n : ℕ}
(t : SyntacticSemiterm L n)
:
theorem
LO.Arith.eq_fin_of_lt_nat
{V : Type u_1}
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{n : ℕ}
{x : V}
(hx : x < ↑n)
:
TODO: move
@[simp]
theorem
LO.Arith.semiterm_codeIn
{V : Type u_1}
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{L : FirstOrder.Language}
[(k : ℕ) → Encodable (L.Func k)]
[(k : ℕ) → Encodable (L.Rel k)]
[DefinableLanguage L]
{n : ℕ}
(t : FirstOrder.SyntacticSemiterm L n)
:
(L.codeIn V).IsSemiterm ↑n ⌜t⌝
@[simp]
theorem
LO.Arith.semitermVec_codeIn
{V : Type u_1}
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{L : FirstOrder.Language}
[(k : ℕ) → Encodable (L.Func k)]
[(k : ℕ) → Encodable (L.Rel k)]
[DefinableLanguage L]
{k n : ℕ}
(v : Fin k → FirstOrder.SyntacticSemiterm L n)
:
@[simp]
theorem
LO.Arith.isUTermVec_codeIn
{V : Type u_1}
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{L : FirstOrder.Language}
[(k : ℕ) → Encodable (L.Func k)]
[(k : ℕ) → Encodable (L.Rel k)]
[DefinableLanguage L]
{k n : ℕ}
(v : Fin k → FirstOrder.SyntacticSemiterm L n)
:
@[simp]
theorem
LO.Arith.quote_termSubst
{V : Type u_1}
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{L : FirstOrder.Language}
[(k : ℕ) → Encodable (L.Func k)]
[(k : ℕ) → Encodable (L.Rel k)]
[DefinableLanguage L]
{n m : ℕ}
(t : FirstOrder.SyntacticSemiterm L n)
(w : Fin n → FirstOrder.SyntacticSemiterm L m)
:
theorem
LO.Arith.quote_termSubstVec
{V : Type u_1}
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{L : FirstOrder.Language}
[(k : ℕ) → Encodable (L.Func k)]
[(k : ℕ) → Encodable (L.Rel k)]
[DefinableLanguage L]
{k n m : ℕ}
(w : Fin n → FirstOrder.SyntacticSemiterm L m)
(v : Fin k → FirstOrder.SyntacticSemiterm L n)
:
@[simp]
theorem
LO.Arith.quote_termShift
{V : Type u_1}
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{L : FirstOrder.Language}
[(k : ℕ) → Encodable (L.Func k)]
[(k : ℕ) → Encodable (L.Rel k)]
[DefinableLanguage L]
{n : ℕ}
(t : FirstOrder.SyntacticSemiterm L n)
:
theorem
LO.Arith.quote_termShiftVec
{V : Type u_1}
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{L : FirstOrder.Language}
[(k : ℕ) → Encodable (L.Func k)]
[(k : ℕ) → Encodable (L.Rel k)]
[DefinableLanguage L]
{k n : ℕ}
(v : Fin k → FirstOrder.SyntacticSemiterm L n)
:
@[simp]
theorem
LO.Arith.quote_termBShift
{V : Type u_1}
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{L : FirstOrder.Language}
[(k : ℕ) → Encodable (L.Func k)]
[(k : ℕ) → Encodable (L.Rel k)]
[DefinableLanguage L]
{n : ℕ}
(t : FirstOrder.SyntacticSemiterm L n)
:
theorem
LO.Arith.quote_eterm_eq_quote_emb
{V : Type u_1}
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{L : FirstOrder.Language}
[(k : ℕ) → Encodable (L.Func k)]
{n : ℕ}
(t : FirstOrder.Semiterm L Empty n)
:
@[simp]
theorem
LO.Arith.semiformula_quote
{V : Type u_1}
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{L : FirstOrder.Language}
[(k : ℕ) → Encodable (L.Func k)]
[(k : ℕ) → Encodable (L.Rel k)]
[DefinableLanguage L]
{n : ℕ}
(φ : FirstOrder.SyntacticSemiformula L n)
:
(L.codeIn V).IsSemiformula ↑n ⌜φ⌝
@[simp]
theorem
LO.Arith.semiformula_quote0
{V : Type u_1}
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{L : FirstOrder.Language}
[(k : ℕ) → Encodable (L.Func k)]
[(k : ℕ) → Encodable (L.Rel k)]
[DefinableLanguage L]
(φ : FirstOrder.SyntacticFormula L)
:
@[simp]
theorem
LO.Arith.semiformula_quote1
{V : Type u_1}
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{L : FirstOrder.Language}
[(k : ℕ) → Encodable (L.Func k)]
[(k : ℕ) → Encodable (L.Rel k)]
[DefinableLanguage L]
(φ : FirstOrder.SyntacticSemiformula L 1)
:
(L.codeIn V).IsSemiformula 1 ⌜φ⌝
@[simp]
theorem
LO.Arith.semiformula_quote2
{V : Type u_1}
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{L : FirstOrder.Language}
[(k : ℕ) → Encodable (L.Func k)]
[(k : ℕ) → Encodable (L.Rel k)]
[DefinableLanguage L]
(φ : FirstOrder.SyntacticSemiformula L 2)
:
(L.codeIn V).IsSemiformula 2 ⌜φ⌝
@[simp]
theorem
LO.Arith.isUFormula_quote
{V : Type u_1}
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{L : FirstOrder.Language}
[(k : ℕ) → Encodable (L.Func k)]
[(k : ℕ) → Encodable (L.Rel k)]
[DefinableLanguage L]
{n : ℕ}
(φ : FirstOrder.SyntacticSemiformula L n)
:
(L.codeIn V).IsUFormula ⌜φ⌝
@[simp]
theorem
LO.Arith.semiformula_quote_succ
{V : Type u_1}
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{L : FirstOrder.Language}
[(k : ℕ) → Encodable (L.Func k)]
[(k : ℕ) → Encodable (L.Rel k)]
[DefinableLanguage L]
{n : ℕ}
(φ : FirstOrder.SyntacticSemiformula L (n + 1))
:
(L.codeIn V).IsSemiformula (↑n + 1) ⌜φ⌝
@[simp]
theorem
LO.Arith.quote_neg
{V : Type u_1}
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{L : FirstOrder.Language}
[(k : ℕ) → Encodable (L.Func k)]
[(k : ℕ) → Encodable (L.Rel k)]
[DefinableLanguage L]
{n : ℕ}
(φ : FirstOrder.SyntacticSemiformula L n)
:
@[simp]
theorem
LO.Arith.quote_shift
{V : Type u_1}
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{L : FirstOrder.Language}
[(k : ℕ) → Encodable (L.Func k)]
[(k : ℕ) → Encodable (L.Rel k)]
[DefinableLanguage L]
{n : ℕ}
(φ : FirstOrder.SyntacticSemiformula L n)
:
theorem
LO.Arith.qVec_quote
{V : Type u_1}
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{L : FirstOrder.Language}
[(k : ℕ) → Encodable (L.Func k)]
[(k : ℕ) → Encodable (L.Rel k)]
[DefinableLanguage L]
{n m : ℕ}
(w : Fin n → FirstOrder.SyntacticSemiterm L m)
:
@[simp]
theorem
LO.Arith.quote_substs
{V : Type u_1}
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{L : FirstOrder.Language}
[(k : ℕ) → Encodable (L.Func k)]
[(k : ℕ) → Encodable (L.Rel k)]
[DefinableLanguage L]
{n m : ℕ}
(w : Fin n → FirstOrder.SyntacticSemiterm L m)
(φ : FirstOrder.SyntacticSemiformula L n)
:
theorem
LO.Arith.quote_sentence_eq_quote_emb
{V : Type u_1}
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{L : FirstOrder.Language}
[(k : ℕ) → Encodable (L.Func k)]
[(k : ℕ) → Encodable (L.Rel k)]
{n : ℕ}
(σ : FirstOrder.Semisentence L n)
:
theorem
LO.Arith.quote_substs'
{V : Type u_1}
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{L : FirstOrder.Language}
[(k : ℕ) → Encodable (L.Func k)]
[(k : ℕ) → Encodable (L.Rel k)]
[DefinableLanguage L]
{n m : ℕ}
(w : Fin n → FirstOrder.Semiterm L Empty m)
(σ : FirstOrder.Semisentence L n)
:
@[simp]
theorem
LO.Arith.free_quote
{V : Type u_1}
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{L : FirstOrder.Language}
[(k : ℕ) → Encodable (L.Func k)]
[(k : ℕ) → Encodable (L.Rel k)]
[DefinableLanguage L]
(φ : FirstOrder.SyntacticSemiformula L 1)
:
Typed #
def
LO.FirstOrder.Semiterm.codeIn'
(V : Type u_1)
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{L : Language}
[(k : ℕ) → Encodable (L.Func k)]
[(k : ℕ) → Encodable (L.Rel k)]
[Arith.DefinableLanguage L]
{n : ℕ}
(t : SyntacticSemiterm L n)
:
Imported declaration from the Incompleteness formalization.
Instances For
@[implicit_reducible]
instance
LO.FirstOrder.Semiterm.instGoedelQuoteSyntacticSemitermSemitermCodeInCast
(V : Type u_1)
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{L : Language}
[(k : ℕ) → Encodable (L.Func k)]
[(k : ℕ) → Encodable (L.Rel k)]
[Arith.DefinableLanguage L]
{n : ℕ}
:
GoedelQuote (SyntacticSemiterm L n) ((L.codeIn V).Semiterm ↑n)
noncomputable def
LO.FirstOrder.Semiterm.vCodeIn'
(V : Type u_1)
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{L : Language}
[(k : ℕ) → Encodable (L.Func k)]
[(k : ℕ) → Encodable (L.Rel k)]
[Arith.DefinableLanguage L]
{k n : ℕ}
(v : Fin k → SyntacticSemiterm L n)
:
(L.codeIn V).SemitermVec ↑k ↑n
Imported declaration from the Incompleteness formalization.
Instances For
@[implicit_reducible]
noncomputable instance
LO.FirstOrder.Semiterm.instGoedelQuoteForallFinSyntacticSemitermSemitermVecCodeInCast
(V : Type u_1)
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{L : Language}
[(k : ℕ) → Encodable (L.Func k)]
[(k : ℕ) → Encodable (L.Rel k)]
[Arith.DefinableLanguage L]
{k n : ℕ}
:
GoedelQuote (Fin k → SyntacticSemiterm L n) ((L.codeIn V).SemitermVec ↑k ↑n)
@[simp]
@[simp]
@[simp]
theorem
LO.FirstOrder.Semiterm.codeIn'_add
(V : Type u_1)
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{n : ℕ}
(v : Fin 2 → SyntacticSemiterm ℒₒᵣ n)
:
@[simp]
theorem
LO.FirstOrder.Semiterm.codeIn'_mul
(V : Type u_1)
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{n : ℕ}
(v : Fin 2 → SyntacticSemiterm ℒₒᵣ n)
:
def
LO.FirstOrder.Semiformula.codeIn'
(V : Type u_1)
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{L : Language}
[(k : ℕ) → Encodable (L.Func k)]
[(k : ℕ) → Encodable (L.Rel k)]
[Arith.DefinableLanguage L]
{n : ℕ}
(φ : SyntacticSemiformula L n)
:
(L.codeIn V).Semiformula ↑n
Imported declaration from the Incompleteness formalization.
Instances For
@[implicit_reducible]
instance
LO.FirstOrder.Semiformula.goedelQuoteSyntacticSemiformulaToCodedSemiformula
(V : Type u_1)
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{L : Language}
[(k : ℕ) → Encodable (L.Func k)]
[(k : ℕ) → Encodable (L.Rel k)]
[Arith.DefinableLanguage L]
{n : ℕ}
:
GoedelQuote (SyntacticSemiformula L n) ((L.codeIn V).Semiformula ↑n)
@[implicit_reducible]
instance
LO.FirstOrder.Semiformula.goedelQuoteSyntacticFormulaToCodedFormula
(V : Type u_1)
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{L : Language}
[(k : ℕ) → Encodable (L.Func k)]
[(k : ℕ) → Encodable (L.Rel k)]
[Arith.DefinableLanguage L]
:
GoedelQuote (SyntacticFormula L) (L.codeIn V).Formula
Equations
@[simp]
theorem
LO.FirstOrder.Semiformula.codeIn'_weight
(V : Type u_1)
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{L : Language}
[(k : ℕ) → Encodable (L.Func k)]
[(k : ℕ) → Encodable (L.Rel k)]
[Arith.DefinableLanguage L]
(k n : ℕ)
:
@[simp]
theorem
LO.FirstOrder.Semiformula.codeIn'_nlt
(V : Type u_1)
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{n : ℕ}
(v : Fin 2 → SyntacticSemiterm ℒₒᵣ n)
:
@[simp]
theorem
LO.FirstOrder.Semiformula.codeIn'_ball
(V : Type u_1)
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{n : ℕ}
(t : SyntacticSemiterm ℒₒᵣ n)
(φ : SyntacticSemiformula ℒₒᵣ (n + 1))
:
@[simp]
theorem
LO.FirstOrder.Semiformula.codeIn'_bex
(V : Type u_1)
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{n : ℕ}
(t : SyntacticSemiterm ℒₒᵣ n)
(φ : SyntacticSemiformula ℒₒᵣ (n + 1))
:
@[implicit_reducible]
instance
LO.FirstOrder.Semiformula.instGoedelQuoteSentenceFormulaCodeIn
(V : Type u_1)
[ORingStruc V]
[V ⊧ₘ* 𝐈Sg1]
{L : Language}
[(k : ℕ) → Encodable (L.Func k)]
[(k : ℕ) → Encodable (L.Rel k)]
[Arith.DefinableLanguage L]
:
GoedelQuote (Sentence L) (L.codeIn V).Formula
Equations
- LO.FirstOrder.Semiformula.instGoedelQuoteSentenceFormulaCodeIn V = { quote := fun (σ : LO.FirstOrder.Sentence L) => ⌜(LO.FirstOrder.Rewriting.app LO.FirstOrder.Rew.embs) σ⌝ }
theorem
LO.Arith.Language.IsSemiterm.sound
{L : FirstOrder.Language}
[(k : ℕ) → Encodable (L.Func k)]
[(k : ℕ) → Encodable (L.Rel k)]
[DefinableLanguage L]
{n t : ℕ}
(ht : (L.codeIn ℕ).IsSemiterm n t)
:
∃ (T : FirstOrder.SyntacticSemiterm L n), ⌜T⌝ = t
theorem
LO.Arith.Language.IsSemiformula.sound
{L : FirstOrder.Language}
[(k : ℕ) → Encodable (L.Func k)]
[(k : ℕ) → Encodable (L.Rel k)]
[DefinableLanguage L]
{n φ : ℕ}
(h : (L.codeIn ℕ).IsSemiformula n φ)
:
∃ (F : FirstOrder.SyntacticSemiformula L n), ⌜F⌝ = φ