Documentation

LeanPool.PointwiseComposition.CategoricalRiceShapiro.ArithmeticCode.Basic

Supporting results for pointwise provable equality.

Total arithmetic codes and their standard computations #

Computes c f says that the partial-recursive code c realizes the total function f over the natural numbers. This module collects the constructors used throughout the development -- projection, zero, one, addition, multiplication, equality, strict order and composition -- together with the derived total constructors built from them, and records the standard computation theorem for each.

These are statements about the natural numbers. Arbitrary-model evaluation is the subject of CategoricalRiceShapiro.ArithmeticCode.Evaluation.

theorem PointwiseComposition.CategoricalRiceShapiro.ArithmeticCode.computes_comp {m k : ℕ} {c : Nat.ArithPart₁.Code k} {d : Fin k → Nat.ArithPart₁.Code m} {f : List.Vector ℕ k → ℕ} {g : Fin k → List.Vector ℕ m → ℕ} (hc : Computes c f) (hd : ∀ (i : Fin k), Computes (d i) (g i)) :
Computes (c.comp d) fun (v : List.Vector ℕ m) => f (List.Vector.ofFn fun (i : Fin k) => g i v)

Generic composition at the total-function layer.

Arity-specific composition #

theorem PointwiseComposition.CategoricalRiceShapiro.ArithmeticCode.computes_comp₁ {n : ℕ} {c : Nat.ArithPart₁.Code 1} {d : Nat.ArithPart₁.Code n} {f : ℕ → ℕ} {g : List.Vector ℕ n → ℕ} (hc : Computes c fun (w : List.Vector ℕ 1) => f (w.get 0)) (hd : Computes d g) :
Computes (c.comp ![d]) fun (v : List.Vector ℕ n) => f (g v)
theorem PointwiseComposition.CategoricalRiceShapiro.ArithmeticCode.computes_comp₂ {n : ℕ} {c : Nat.ArithPart₁.Code 2} {d₀ d₁ : Nat.ArithPart₁.Code n} {f : ℕ → ℕ → ℕ} {g₀ g₁ : List.Vector ℕ n → ℕ} (hc : Computes c fun (w : List.Vector ℕ 2) => f (w.get 0) (w.get 1)) (h₀ : Computes d₀ g₀) (h₁ : Computes d₁ g₁) :
Computes (c.comp ![d₀, d₁]) fun (v : List.Vector ℕ n) => f (g₀ v) (g₁ v)

Derived total functions #

The code Const construction in CategoricalRiceShapiro.ArithmeticCode.

Equations
Instances For

    Boolean combinators #

    The code And construction in CategoricalRiceShapiro.ArithmeticCode.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      theorem PointwiseComposition.CategoricalRiceShapiro.ArithmeticCode.computes_codeAnd {n : ℕ} {d₀ d₁ : Nat.ArithPart₁.Code n} {g₀ g₁ : List.Vector ℕ n → ℕ} (h₀ : Computes d₀ g₀) (h₁ : Computes d₁ g₁) :
      Computes (codeAnd d₀ d₁) fun (v : List.Vector ℕ n) => Nat.and (g₀ v) (g₁ v)

      The code Or construction in CategoricalRiceShapiro.ArithmeticCode.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        theorem PointwiseComposition.CategoricalRiceShapiro.ArithmeticCode.computes_codeOr {n : ℕ} {d₀ d₁ : Nat.ArithPart₁.Code n} {g₀ g₁ : List.Vector ℕ n → ℕ} (h₀ : Computes d₀ g₀) (h₁ : Computes d₁ g₁) :
        Computes (codeOr d₀ d₁) fun (v : List.Vector ℕ n) => Nat.or (g₀ v) (g₁ v)
        theorem PointwiseComposition.CategoricalRiceShapiro.ArithmeticCode.computes_codeEq {n : ℕ} {d₀ d₁ : Nat.ArithPart₁.Code n} {g₀ g₁ : List.Vector ℕ n → ℕ} (h₀ : Computes d₀ g₀) (h₁ : Computes d₁ g₁) :
        Computes (codeEq d₀ d₁) fun (v : List.Vector ℕ n) => Nat.isEqNat (g₀ v) (g₁ v)
        theorem PointwiseComposition.CategoricalRiceShapiro.ArithmeticCode.computes_codeLt {n : ℕ} {d₀ d₁ : Nat.ArithPart₁.Code n} {g₀ g₁ : List.Vector ℕ n → ℕ} (h₀ : Computes d₀ g₀) (h₁ : Computes d₁ g₁) :
        Computes (codeLt d₀ d₁) fun (v : List.Vector ℕ n) => Nat.isLtNat (g₀ v) (g₁ v)
        theorem PointwiseComposition.CategoricalRiceShapiro.ArithmeticCode.computes_codeAdd {n : ℕ} {d₀ d₁ : Nat.ArithPart₁.Code n} {g₀ g₁ : List.Vector ℕ n → ℕ} (h₀ : Computes d₀ g₀) (h₁ : Computes d₁ g₁) :
        Computes (codeAdd d₀ d₁) fun (v : List.Vector ℕ n) => g₀ v + g₁ v
        theorem PointwiseComposition.CategoricalRiceShapiro.ArithmeticCode.computes_codeMul {n : ℕ} {d₀ d₁ : Nat.ArithPart₁.Code n} {g₀ g₁ : List.Vector ℕ n → ℕ} (h₀ : Computes d₀ g₀) (h₁ : Computes d₁ g₁) :
        Computes (codeMul d₀ d₁) fun (v : List.Vector ℕ n) => g₀ v * g₁ v

        Lifting a code under an extra search variable #