Documentation

MathematicalLogic.FirstOrder.Theories.Peano.BetaFunction

Gödel's beta function #

This file formalizes Gödel's beta function, and proves its properties in Q and PA. Gödel's beta function enables encoding of finite sequences, which is a crucial step towards the representation theorem.

In Q, we only prove its representability (beta_ofNat). In PA, we also prove its uniqueness (beta_unique), totality (beta_total), and the comprehension theorem (beta_comprehension). The comprehension theorem allows us to encode a finite sequence described by a formula; to prove that, we have to formalize the Chinese remainder theorem in PA.

References #

def Vec.unbeta {n : } (v : Vec n) :
Equations
Instances For
    theorem Vec.beta_unbeta {n : } (v : Vec n) (i : Fin n) :
    v.unbeta.beta i = v i
    def FirstOrder.Language.peano.pair {n : } (t t₁ t₂ : peano.Term n) :

    Pairing function (the same as Nat.pair).

    Equations
    Instances For
      @[simp]
      theorem FirstOrder.Language.peano.subst_pair {n : } {t t₁ t₂ : peano.Term n} {m✝ : } {σ : peano.Subst n m✝} :
      (pair t t₁ t₂)[σ]ₚ = pair t[σ]ₜ t₁[σ]ₜ t₂[σ]ₜ
      theorem FirstOrder.Language.peano.Sigma₁.pair {n : } {t t₁ t₂ : peano.Term n} :
      Sigma₁ (peano.pair t t₁ t₂)
      theorem FirstOrder.Language.peano.iff_congr_pair {n : } {t t' t₁ t₁' t₂ t₂' : peano.Term n} {Γ : peano.FormulaSet n} :
      Γt t' t₁ t₁' t₂ t₂' pair t t₁ t₂ pair t' t₁' t₂'
      def FirstOrder.Language.peano.mod {n : } (t t₁ t₂ : peano.Term n) :

      Remainder function.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        @[simp]
        theorem FirstOrder.Language.peano.subst_mod {n : } {t t₁ t₂ : peano.Term n} {m✝ : } {σ : peano.Subst n m✝} :
        (mod t t₁ t₂)[σ]ₚ = mod t[σ]ₜ t₁[σ]ₜ t₂[σ]ₜ
        theorem FirstOrder.Language.peano.Sigma₁.mod {n : } {t t₁ t₂ : peano.Term n} :
        Sigma₁ (peano.mod t t₁ t₂)
        theorem FirstOrder.Language.peano.iff_congr_mod {n : } {t t' t₁ t₁' t₂ t₂' : peano.Term n} {Γ : peano.FormulaSet n} :
        Γt t' t₁ t₁' t₂ t₂' mod t t₁ t₂ mod t' t₁' t₂'
        def FirstOrder.Language.peano.nmod {n : } (t t₁ t₂ : peano.Term n) :

        The negation of remainder function, in Σ₁.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          @[simp]
          theorem FirstOrder.Language.peano.subst_nmod {n : } {t t₁ t₂ : peano.Term n} {m✝ : } {σ : peano.Subst n m✝} :
          (nmod t t₁ t₂)[σ]ₚ = nmod t[σ]ₜ t₁[σ]ₜ t₂[σ]ₜ
          theorem FirstOrder.Language.peano.Sigma₁.nmod {n : } {t t₁ t₂ : peano.Term n} :
          Sigma₁ (peano.nmod t t₁ t₂)
          theorem FirstOrder.Language.peano.iff_congr_nmod {n : } {t t' t₁ t₁' t₂ t₂' : peano.Term n} {Γ : peano.FormulaSet n} :
          Γt t' t₁ t₁' t₂ t₂' nmod t t₁ t₂ nmod t' t₁' t₂'
          def FirstOrder.Language.peano.beta {n : } (t t₁ t₂ : peano.Term n) :

          Gödel's beta function.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            @[simp]
            theorem FirstOrder.Language.peano.subst_beta {n : } {t t₁ t₂ : peano.Term n} {m✝ : } {σ : peano.Subst n m✝} :
            (beta t t₁ t₂)[σ]ₚ = beta t[σ]ₜ t₁[σ]ₜ t₂[σ]ₜ
            theorem FirstOrder.Language.peano.Sigma₁.beta {n : } {t t₁ t₂ : peano.Term n} :
            Sigma₁ (peano.beta t t₁ t₂)
            theorem FirstOrder.Language.peano.iff_congr_beta {n : } {t t' t₁ t₁' t₂ t₂' : peano.Term n} {Γ : peano.FormulaSet n} :
            Γt t' t₁ t₁' t₂ t₂' beta t t₁ t₂ beta t' t₁' t₂'

            The negation of Gödel's beta function, in Σ₁.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              @[simp]
              theorem FirstOrder.Language.peano.subst_nbeta {n : } {t t₁ t₂ : peano.Term n} {m✝ : } {σ : peano.Subst n m✝} :
              (nbeta t t₁ t₂)[σ]ₚ = nbeta t[σ]ₜ t₁[σ]ₜ t₂[σ]ₜ
              theorem FirstOrder.Language.peano.Sigma₁.nbeta {n : } {t t₁ t₂ : peano.Term n} :
              Sigma₁ (peano.nbeta t t₁ t₂)
              theorem FirstOrder.Language.peano.iff_congr_nbeta {n : } {t t' t₁ t₁' t₂ t₂' : peano.Term n} {Γ : peano.FormulaSet n} :
              Γt t' t₁ t₁' t₂ t₂' nbeta t t₁ t₂ nbeta t' t₁' t₂'
              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                @[simp]
                theorem FirstOrder.Language.peano.subst_dvd {n : } {t₁ t₂ : peano.Term n} {m✝ : } {σ : peano.Subst n m✝} :
                (dvd t₁ t₂)[σ]ₚ = dvd t₁[σ]ₜ t₂[σ]ₜ
                theorem FirstOrder.Language.peano.iff_congr_dvd {n : } {t₁ t₁' t₂ t₂' : peano.Term n} {Γ : peano.FormulaSet n} :
                Γt₁ t₁' t₂ t₂' dvd t₁ t₂ dvd t₁' t₂'
                @[simp]
                theorem FirstOrder.Language.peano.subst_prime {n : } {t : peano.Term n} {m✝ : } {σ : peano.Subst n m✝} :
                theorem FirstOrder.Language.peano.iff_congr_prime {n : } {t t' : peano.Term n} {Γ : peano.FormulaSet n} :
                Γt t' prime t prime t'
                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  @[simp]
                  theorem FirstOrder.Language.peano.subst_coprime {n : } {t₁ t₂ : peano.Term n} {m✝ : } {σ : peano.Subst n m✝} :
                  (coprime t₁ t₂)[σ]ₚ = coprime t₁[σ]ₜ t₂[σ]ₜ
                  theorem FirstOrder.Language.peano.iff_congr_coprime {n : } {t₁ t₁' t₂ t₂' : peano.Term n} {Γ : peano.FormulaSet n} :
                  Γt₁ t₁' t₂ t₂' coprime t₁ t₂ coprime t₁' t₂'
                  theorem FirstOrder.Language.Theory.PA.pair_unique {n : } {t t' t₁ t₂ : peano.Term n} :
                  ↑ᵀ^[n] PApeano.pair t t₁ t₂ peano.pair t' t₁ t₂ t t'
                  theorem FirstOrder.Language.Theory.PA.add_le_pair {n : } {t t₁ t₂ : peano.Term n} :
                  ↑ᵀ^[n] PApeano.pair t t₁ t₂ t₁ + t₂ t
                  theorem FirstOrder.Language.Theory.PA.left_le_pair {n : } {t t₁ t₂ : peano.Term n} :
                  ↑ᵀ^[n] PApeano.pair t t₁ t₂ t₁ t
                  theorem FirstOrder.Language.Theory.PA.right_le_pair {n : } {t t₁ t₂ : peano.Term n} :
                  ↑ᵀ^[n] PApeano.pair t t₁ t₂ t₂ t
                  theorem FirstOrder.Language.Theory.PA.unpair_unique {n : } {t t₁ t₂ t₃ t₄ : peano.Term n} :
                  ↑ᵀ^[n] PApeano.pair t t₁ t₂ peano.pair t t₃ t₄ t₁ t₃ t₂ t₄
                  theorem FirstOrder.Language.Theory.PA.mod_unique {n : } {t t' t₁ t₂ : peano.Term n} :
                  ↑ᵀ^[n] PApeano.mod t t₁ t₂ peano.mod t' t₁ t₂ t t'
                  theorem FirstOrder.Language.Theory.PA.self_mod_of_lt {n : } {t₁ t₂ : peano.Term n} :
                  ↑ᵀ^[n] PAt₁ t₂ peano.mod t₁ t₁ t₂
                  theorem FirstOrder.Language.Theory.PA.add_mod_iff {n : } {t t₁ t₂ : peano.Term n} :
                  ↑ᵀ^[n] PApeano.mod t (t₁ + t₂) t₂ peano.mod t t₁ t₂
                  theorem FirstOrder.Language.Theory.PA.add_mul_mod_iff {n : } {t t₁ t₂ t₃ : peano.Term n} :
                  ↑ᵀ^[n] PApeano.mod t (t₁ + t₂ * t₃) t₂ peano.mod t t₁ t₂
                  theorem FirstOrder.Language.Theory.PA.nmod_iff {n : } {t t₁ t₂ : peano.Term n} :
                  ↑ᵀ^[n] PApeano.nmod t t₁ t₂ ~ peano.mod t t₁ t₂
                  theorem FirstOrder.Language.Theory.PA.beta_unique {n : } {t t' t₁ t₂ : peano.Term n} :
                  ↑ᵀ^[n] PApeano.beta t t₁ t₂ peano.beta t' t₁ t₂ t t'
                  theorem FirstOrder.Language.Theory.PA.nbeta_iff {n : } {t t₁ t₂ : peano.Term n} :
                  ↑ᵀ^[n] PApeano.nbeta t t₁ t₂ ~ peano.beta t t₁ t₂
                  theorem FirstOrder.Language.Theory.PA.le_of_dvd {n : } {t₁ t₂ : peano.Term n} :
                  ↑ᵀ^[n] PA0 t₂ peano.dvd t₁ t₂ t₁ t₂
                  theorem FirstOrder.Language.Theory.PA.dvd_trans {n : } {t₁ t₂ t₃ : peano.Term n} :
                  ↑ᵀ^[n] PApeano.dvd t₁ t₂ peano.dvd t₂ t₃ peano.dvd t₁ t₃
                  theorem FirstOrder.Language.Theory.PA.dvd_mul_of_dvd_left {n : } {t t₁ t₂ : peano.Term n} :
                  ↑ᵀ^[n] PApeano.dvd t t₁ peano.dvd t (t₂ * t₁)
                  theorem FirstOrder.Language.Theory.PA.dvd_mul_of_dvd_right {n : } {t t₁ t₂ : peano.Term n} :
                  ↑ᵀ^[n] PApeano.dvd t t₁ peano.dvd t (t₁ * t₂)
                  theorem FirstOrder.Language.Theory.PA.dvd_add_iff_left {n : } {t t₁ t₂ : peano.Term n} :
                  ↑ᵀ^[n] PApeano.dvd t t₁ peano.dvd t (t₁ + t₂) peano.dvd t t₂
                  theorem FirstOrder.Language.Theory.PA.dvd_add_iff_right {n : } {t t₁ t₂ : peano.Term n} :
                  ↑ᵀ^[n] PApeano.dvd t t₂ peano.dvd t (t₁ + t₂) peano.dvd t t₁
                  theorem FirstOrder.Language.Theory.PA.dvd_mul_coprime {n : } {t t₁ t₂ : peano.Term n} :
                  ↑ᵀ^[n] PA0 t 0 t₁ peano.coprime t t₁ peano.dvd t (t₁ * t₂) peano.dvd t t₂
                  theorem FirstOrder.Language.Theory.PA.dvd_mul_prime {n : } {t t₁ t₂ : peano.Term n} :
                  ↑ᵀ^[n] PApeano.prime t₁ peano.dvd t (t₁ * t₂) peano.dvd t₁ t peano.dvd t t₂
                  theorem FirstOrder.Language.Theory.PA.add_mod_iff_of_dvd_right {n : } {t t₁ t₂ t₃ : peano.Term n} :
                  ↑ᵀ^[n] PApeano.dvd t₃ t₂ peano.mod t (t₁ + t₂) t₃ peano.mod t t₁ t₃
                  theorem FirstOrder.Language.Theory.PA.add_mod_iff_of_dvd_left {n : } {t t₁ t₂ t₃ : peano.Term n} :
                  ↑ᵀ^[n] PApeano.dvd t₃ t₂ peano.mod t (t₂ + t₁) t₃ peano.mod t t₁ t₃

                  Chinese remainder theorem formalized in PA: if p(x, i) and q(x, i) uniquely describe two sequences of numbers a₀, ⋯, aₗ₋₁ and d₀, ⋯, dₗ₋₁ with aᵢ < dᵢ for each i, and d₀, ⋯, dₗ₋₁ are coprime, then there exists a number m such that m % dᵢ = aᵢ for each i.

                  Comprehension theorem for Gödel's beta function: if p(x, i) uniquely describes a sequence of numbers a₀, ⋯, aₗ₋₁, then there exists a number m that encodes this sequence, i.e. β(m, i) = aᵢ for each i.

                  Proof sketch: let lcm(1, 2, ⋯, l) ∣ A, B ≥ max(a₀, ⋯, aₗ₋₁) and dᵢ = (i + 1) * A * B + 1, then d₀, ⋯, dₗ₋₁ are coprime. By Chinese remainder theorem, there exists a C such that C % dᵢ = aᵢ, i.e. β(⟪C, A * B⟫, i) = aᵢ.

                  With minimization, the description formula p in beta_comprehension does not have to be unique.