Documentation

CategorialAlgebras.Heterogeneous.Models

Validity of heterogeneous equations #

Expansion satisfies every contextual equation. The verification uses only categorical laws and preservation by the original higher functors, with no inhabitedness assumptions.

Evaluation in expanded algebras #

def CategorialAlgebras.Heterogeneous.CategorialAlgebra.boundary {I : Type i} [Preorder I] {S : Type u} {sig : Signature S} (A : CategorialAlgebra I sig) {j k : I} (h : j < k) (b : Bool) {s : S} (x : A.carrier (k, s)) :

Select either boundary between two dimensions.

Equations
Instances For
    theorem CategorialAlgebras.Heterogeneous.CategorialAlgebra.boundary_retract {I : Type i} [Preorder I] {S : Type u} {sig : Signature S} (A : CategorialAlgebra I sig) {j k : I} (h : j < k) (b : Bool) {s : S} (x : A.carrier (j, s)) :
    A.boundary h b (((A.sort s).str.dim j k h).identity x) = x

    Boundaries retract identities.

    theorem CategorialAlgebras.Heterogeneous.CategorialAlgebra.boundary_comp {I : Type i} [Preorder I] {S : Type u} {sig : Signature S} (A : CategorialAlgebra I sig) {j k : I} (h : j < k) (b : Bool) {s : S} {x y z : A.carrier (k, s)} (hz : z ∈ ((A.sort s).str.dim j k h).comp x y) :
    A.boundary h b z = A.boundary h b (if b = true then x else y)

    Boundaries of composites are their outer boundaries.

    theorem CategorialAlgebras.Heterogeneous.CategorialAlgebra.operation_boundary {I : Type i} [Preorder I] {S : Type u} {sig : Signature S} (A : CategorialAlgebra I sig) {a : List S} {s : S} (σ : sig a s) {j k : I} (h : j < k) (b : Bool) (x : Word.Family (fun (s : S) => A.carrier (k, s)) a) :
    A.boundary h b ((A.op σ).toFun k x) = (A.op σ).toFun j fun (p : Fin a.length) => A.boundary h b (x p)

    Original operations preserve both boundaries.

    theorem CategorialAlgebras.Heterogeneous.eval_expansion_boundary {I : Type i} [Preorder I] {S : Type u} {sig : Signature S} {X : I × S → Type x} (A : CategorialAlgebra I sig) (v : SortedSet.Map X A.carrier) {j k : I} (h : j < k) (b : Bool) {s : S} (t : Term (Symbol I sig) X (k, s)) :

    Evaluate a boundary in an expansion.

    theorem CategorialAlgebras.Heterogeneous.eval_expansion_identity {I : Type i} [Preorder I] {S : Type u} {sig : Signature S} {X : I × S → Type x} (A : CategorialAlgebra I sig) (v : SortedSet.Map X A.carrier) {j k : I} (h : j < k) {s : S} (t : Term (Symbol I sig) X (j, s)) :

    Evaluate an identity in an expansion.

    theorem CategorialAlgebras.Heterogeneous.eval_expansion_base {I : Type i} [Preorder I] {S : Type u} {sig : Signature S} {X : I × S → Type x} (A : CategorialAlgebra I sig) (v : SortedSet.Map X A.carrier) (k : I) {a : List S} {s : S} (σ : sig a s) (t : Word.Family (fun (s : S) => Term (Symbol I sig) X (k, s)) a) :
    Term.partialEval v (base k σ t) = (partFamily fun (p : Fin a.length) => Term.partialEval v (t p)).bind fun (z : (j : Fin a.length) → A.toPartialAlgebra.carrier (k, a.get j)) => Part.some ((A.op σ).toFun k z)

    Evaluate an original operation in an expansion using original input positions.

    theorem CategorialAlgebras.Heterogeneous.eval_expansion_binary {I : Type i} [Preorder I] {S : Type u} {sig : Signature S} (A : CategorialAlgebra I sig) {j k : I} {s : S} {m : ℕ} (x : Fin m → A.carrier (k, s)) (h : j < k) (p q : Fin m) :
    Term.partialEval (uniformValuation x) (binary h (variableTerm (k, s) p) (variableTerm (k, s) q)) = ((A.sort s).str.dim j k h).comp (x p) (x q)

    Compositions of uniform variables evaluate to the basic partial composition.

    Functoriality equations #

    theorem CategorialAlgebras.Heterogeneous.operation_boundary_valid {I : Type i} [Preorder I] {S : Type u} {sig : Signature S} (A : CategorialAlgebra I sig) {a : List S} {s : S} (σ : sig a s) {j k : I} (hk : j < k) (b : Bool) :

    Original operation boundary equations hold because operations are higher functors.

    theorem CategorialAlgebras.Heterogeneous.operation_identity_valid {I : Type i} [Preorder I] {S : Type u} {sig : Signature S} (A : CategorialAlgebra I sig) {a : List S} {s : S} (σ : sig a s) {j k : I} (hk : j < k) :

    Original operation identity equations hold because operations preserve identities.

    theorem CategorialAlgebras.Heterogeneous.operation_composition_valid {I : Type i} [Preorder I] {S : Type u} {sig : Signature S} (A : CategorialAlgebra I sig) {a : List S} {s : S} (σ : sig a s) {j k : I} (hk : j < k) :

    Original operation composition equations hold for every componentwise defined tuple.

    Verification of all schemas #

    Every contextual equation is valid in the expansion of a categorial algebra.