Documentation

LeanPool.PointwiseComposition.CategoricalRiceShapiro.ArithmeticCode.Evaluation

Supporting results for pointwise provable equality.

Evaluation of arithmetic codes in an arbitrary model #

Every result in this module describes Semiformula.Evalb for the arithmetic formula FFL.FirstOrder.Arithmetic.code c under an arbitrary assignment in an arbitrary structure.

Two results assume a model of 𝐏𝐀⁻. eval_codeConst states the value of a constant code, and needs that assumption already for the numeral cast (m : M). eval_codeConst_iff characterises that value, and additionally uses evaluator functionality (eval_unique, proved in CategoricalRiceShapiro.ArithmeticCode.FoundationCompat, which also assumes 𝐏𝐀⁻). Every other evaluation result in this module assumes only ORingStructure M.

The equivalences for the primitive constructors and for composition are the reusable core; the derived constructors and the congruence law under a composed-code context are proved from them.

Primitive constructors #

Composition #

Derived constructors #

Weakening and constants #

Bridges between a graph and a constant #

A code whose graph holds at the standard value m under the assignment v has, at that same assignment, exactly the graph of the constant code m.

The hypothesis is one instance of the graph; functionality of evaluation turns it into the full equivalence.

Graph agreement across arities and assignments #

@[reducible, inline]

Two codes have the same graph, each under its own assignment.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    theorem PointwiseComposition.CategoricalRiceShapiro.ArithmeticCode.evalEq_proj {M : Type u_1} [FFL.ORingStructure M] {k l : ℕ} (i : Fin k) (j : Fin l) (v : Fin k → M) (v' : Fin l → M) (h : v i = v' j) :

    Projections agree when the selected assignment entries agree.

    Zero codes have the same graph under any two assignments.

    theorem PointwiseComposition.CategoricalRiceShapiro.ArithmeticCode.evalEq_codeHead {M : Type u_1} [FFL.ORingStructure M] {k l : ℕ} (t : M) (v : Fin k → M) (v' : Fin l → M) :

    Head codes agree under assignments with the same head.

    theorem PointwiseComposition.CategoricalRiceShapiro.ArithmeticCode.evalEq_codeSucc {M : Type u_1} [FFL.ORingStructure M] {k l : ℕ} {A : Nat.ArithPart₁.Code k} {A' : Nat.ArithPart₁.Code l} {v : Fin k → M} {v' : Fin l → M} (hA : EvalEq A v A' v') :
    EvalEq (codeSucc A) v (codeSucc A') v'

    Successor-code construction preserves heterogeneous graph agreement.

    theorem PointwiseComposition.CategoricalRiceShapiro.ArithmeticCode.evalEq_codePos {M : Type u_1} [FFL.ORingStructure M] {k l : ℕ} {A : Nat.ArithPart₁.Code k} {A' : Nat.ArithPart₁.Code l} {v : Fin k → M} {v' : Fin l → M} (hA : EvalEq A v A' v') :
    EvalEq (codePos A) v (codePos A') v'

    Positive-test code construction preserves heterogeneous graph agreement.

    theorem PointwiseComposition.CategoricalRiceShapiro.ArithmeticCode.evalEq_codeInv {M : Type u_1} [FFL.ORingStructure M] {k l : ℕ} {A : Nat.ArithPart₁.Code k} {A' : Nat.ArithPart₁.Code l} {v : Fin k → M} {v' : Fin l → M} (hA : EvalEq A v A' v') :
    EvalEq (codeInv A) v (codeInv A') v'

    Boolean-inverse code construction preserves heterogeneous graph agreement.

    theorem PointwiseComposition.CategoricalRiceShapiro.ArithmeticCode.evalEq_codeAdd {M : Type u_1} [FFL.ORingStructure M] {k l : ℕ} {A B : Nat.ArithPart₁.Code k} {A' B' : Nat.ArithPart₁.Code l} {v : Fin k → M} {v' : Fin l → M} (hA : EvalEq A v A' v') (hB : EvalEq B v B' v') :
    EvalEq (codeAdd A B) v (codeAdd A' B') v'

    Addition-code construction preserves heterogeneous graph agreement.

    theorem PointwiseComposition.CategoricalRiceShapiro.ArithmeticCode.evalEq_codeMul {M : Type u_1} [FFL.ORingStructure M] {k l : ℕ} {A B : Nat.ArithPart₁.Code k} {A' B' : Nat.ArithPart₁.Code l} {v : Fin k → M} {v' : Fin l → M} (hA : EvalEq A v A' v') (hB : EvalEq B v B' v') :
    EvalEq (codeMul A B) v (codeMul A' B') v'

    Multiplication-code construction preserves heterogeneous graph agreement.

    theorem PointwiseComposition.CategoricalRiceShapiro.ArithmeticCode.evalEq_codeEq {M : Type u_1} [FFL.ORingStructure M] {k l : ℕ} {A B : Nat.ArithPart₁.Code k} {A' B' : Nat.ArithPart₁.Code l} {v : Fin k → M} {v' : Fin l → M} (hA : EvalEq A v A' v') (hB : EvalEq B v B' v') :
    EvalEq (codeEq A B) v (codeEq A' B') v'

    Equality-test code construction preserves heterogeneous graph agreement.

    theorem PointwiseComposition.CategoricalRiceShapiro.ArithmeticCode.evalEq_codeLt {M : Type u_1} [FFL.ORingStructure M] {k l : ℕ} {A B : Nat.ArithPart₁.Code k} {A' B' : Nat.ArithPart₁.Code l} {v : Fin k → M} {v' : Fin l → M} (hA : EvalEq A v A' v') (hB : EvalEq B v B' v') :
    EvalEq (codeLt A B) v (codeLt A' B') v'

    Order-test code construction preserves heterogeneous graph agreement.

    theorem PointwiseComposition.CategoricalRiceShapiro.ArithmeticCode.evalEq_codeAnd {M : Type u_1} [FFL.ORingStructure M] {k l : ℕ} {A B : Nat.ArithPart₁.Code k} {A' B' : Nat.ArithPart₁.Code l} {v : Fin k → M} {v' : Fin l → M} (hA : EvalEq A v A' v') (hB : EvalEq B v B' v') :
    EvalEq (codeAnd A B) v (codeAnd A' B') v'

    Conjunction-code construction preserves heterogeneous graph agreement.

    theorem PointwiseComposition.CategoricalRiceShapiro.ArithmeticCode.evalEq_codeOr {M : Type u_1} [FFL.ORingStructure M] {k l : ℕ} {A B : Nat.ArithPart₁.Code k} {A' B' : Nat.ArithPart₁.Code l} {v : Fin k → M} {v' : Fin l → M} (hA : EvalEq A v A' v') (hB : EvalEq B v B' v') :
    EvalEq (codeOr A B) v (codeOr A' B') v'

    Disjunction-code construction preserves heterogeneous graph agreement.

    theorem PointwiseComposition.CategoricalRiceShapiro.ArithmeticCode.evalEq_codeLift {M : Type u_1} [FFL.ORingStructure M] {k l : ℕ} {A : Nat.ArithPart₁.Code k} {A' : Nat.ArithPart₁.Code l} {v : Fin k → M} {v' : Fin l → M} (t t' : M) (hA : EvalEq A v A' v') :
    EvalEq (codeLift A) (t :> v) (codeLift A') (t' :> v')

    A lift ignores its head, so the two heads need not agree.

    One codes have the same graph under any two assignments.

    theorem PointwiseComposition.CategoricalRiceShapiro.ArithmeticCode.evalEq_comp {M : Type u_1} [FFL.ORingStructure M] {k l m : ℕ} (c : Nat.ArithPart₁.Code m) (ds : Fin m → Nat.ArithPart₁.Code k) (ds' : Fin m → Nat.ArithPart₁.Code l) {v : Fin k → M} {v' : Fin l → M} (h : ∀ (i : Fin m), EvalEq (ds i) v (ds' i) v') :
    EvalEq (c.comp ds) v (c.comp ds') v'

    Composition with a shared outer code.

    Constant codes agree under assignments of any arities.

    Valuation-local congruence for the derived constructors #

    Each lemma below fixes one assignment v and transports an equivalence of the argument codes, quantified over the possible argument values, to an equivalence of the constructed codes. No assignment other than v occurs, and no model assumption beyond ORingStructure M is used. Composition is already covered by eval_comp_congr.