Built with Alectryon, running Coq+SerAPI v8.19.0+0.19.3. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑Ctrl+↓ to navigate, Ctrl+🖱️ to focus. On Mac, use ⌘ instead of Ctrl.
(** This file defines [Algebra], which is a generalization of group, ring, module, etc. An [Algebra] moreover generalizes structures with infinitary operations, such as infinite complete lattice. *)Local Unset Elimination Schemes.
[Loading ML file number_string_notation_plugin.cmxs (using legacy method) ... done]
Require Import
HoTT.Types.Declare Scope Algebra_scope.Delimit Scope Algebra_scope with Algebra.(** The below definition [SymbolTypeOf] is used to specify algebra operations. See [SymbolType] and [Operation] below. *)RecordSymbolTypeOf {Sort : Type} := Build_SymbolTypeOf
{ Arity : Type
; sorts_dom : Arity -> Sort
; sort_cod : Sort }.Arguments SymbolTypeOf : clear implicits.Arguments Build_SymbolTypeOf {Sort}.(** A [Signature] is used to specify [Algebra]s. A signature describes which operations (functions) an algebra for the signature is expected to provide. A signature consists of - A type of [Sort]s. An algebra for the signature provides a type for each [Sort] element. - A type of function symbols [Symbol]. For each function symbol [u : Symbol], an algebra for the signature provides a corresponding operation. - The field [symbol_types σ u] indicates which type the operation corresponding to [u] is expected to have. *)RecordSignature := Build_Signature
{ Sort : Type
; Symbol : Type
; symbol_types : Symbol -> SymbolTypeOf Sort
; hset_sort :: IsHSet Sort
; hset_symbol :: IsHSet Symbol }.NotationSymbolType σ := (SymbolTypeOf (Sort σ)).Global Coercionsymbol_types : Signature >-> Funclass.(** Each [Algebra] has a collection of carrier types [Carriers σ], indexed by the type of sorts [Sort σ]. *)NotationCarriers σ := (Sort σ -> Type).(** Given [A : Carriers σ] and [w : SymbolType σ], the domain of an algebra operation [DomOperation A w] is a product of carrier types from [A], indexed by [Arity w]. *)NotationDomOperation A w
:= (foralli : Arity w, A (sorts_dom w i)) (only parsing).(** Given a symbol type [w : SymbolType σ], an algebra with carriers [A : Carriers σ] provides a corresponding operation of type [Operation A w]. See below for definition [Algerba]. Algebra operations are developed further in [HoTT.Algebra.Universal.Operation]. *)DefinitionOperation {σ} (A : Carriers σ) (w : SymbolType σ) : Type
:= DomOperation A w -> A (sort_cod w).(** An [Algebra σ] for a signature [σ] consists of a collection of carriers [Carriers σ], and for each symbol [u : Symbol σ], an operation/function of type [Operation carriers (σ u)], where [σ u : SymbolType σ] is the symbol type of [u]. Notice that [Algebra] does not specify equations involving carriers and operations. Equations are defined elsewhere. *)RecordAlgebra {σ : Signature} : Type := Build_Algebra
{ carriers : Carriers σ
; operations : forall (u : Symbol σ), Operation carriers (σ u)
; hset_algebra :: forall (s : Sort σ), IsHSet (carriers s) }.Arguments Algebra : clear implicits.Arguments Build_Algebra {σ} carriers operations {hset_algebra}.Global Coercioncarriers : Algebra >-> Funclass.Bind Scope Algebra_scope with Algebra.DefinitionSigAlgebra (σ : Signature) : Type
:= {c : Carriers σ
| { _ : forall (u : Symbol σ), Operation c (σ u)
| forall (s : Sort σ), IsHSet (c s) } }.
σ: Signature
SigAlgebra σ <~> Algebra σ
σ: Signature
SigAlgebra σ <~> Algebra σ
issig.Defined.
H: Funext σ: Signature A, B: Algebra σ p: A = B q: transport
(funi : Carriers σ =>
forallu : Symbol σ, Operation i (σ u)) p
(operations A) = operations B
A = B
H: Funext σ: Signature A, B: Algebra σ p: A = B q: transport
(funi : Carriers σ =>
forallu : Symbol σ, Operation i (σ u)) p
(operations A) = operations B
A = B
H: Funext σ: Signature A, B: Algebra σ p: A = B q: transport
(funi : Carriers σ =>
forallu : Symbol σ, Operation i (σ u)) p
(operations A) = operations B
(A; operations A; hset_algebra A) =
(B; operations B; hset_algebra B)
H: Funext σ: Signature A, B: Algebra σ p: A = B q: transport
(funi : Carriers σ =>
forallu : Symbol σ, Operation i (σ u)) p
(operations A) = operations B
transport
(func : Carriers σ =>
{_ : forallu : Symbol σ, Operation c (σ u) &
foralls : Sort σ, IsHSet (c s)}) p
(operations A; hset_algebra A) =
(operations B; hset_algebra B)
H: Funext σ: Signature A, B: Algebra σ p: A = B q: transport
(funi : Carriers σ =>
forallu : Symbol σ, Operation i (σ u)) p
(operations A) = operations B
(transport
(funx : Carriers σ =>
forallu : Symbol σ, Operation x (σ u)) p
(operations A; hset_algebra A).1;
transportD
(funx : Carriers σ =>
forallu : Symbol σ, Operation x (σ u))
(fun (x : Carriers σ)
(_ : forallu : Symbol σ, Operation x (σ u)) =>
foralls : Sort σ, IsHSet (x s)) p
(operations A; hset_algebra A).1
(operations A; hset_algebra A).2) =
(operations B; hset_algebra B)
H: Funext σ: Signature A, B: Algebra σ p: A = B q: transport
(funi : Carriers σ =>
forallu : Symbol σ, Operation i (σ u)) p
(operations A) = operations B
(transport
(funx : Carriers σ =>
forallu : Symbol σ, Operation x (σ u)) p
(operations A; hset_algebra A).1;
transportD
(funx : Carriers σ =>
forallu : Symbol σ, Operation x (σ u))
(fun (x : Carriers σ)
(_ : forallu : Symbol σ, Operation x (σ u)) =>
foralls : Sort σ, IsHSet (x s)) p
(operations A; hset_algebra A).1
(operations A; hset_algebra A).2).1 =
(operations B; hset_algebra B).1
exact q.Defined.Arguments path_algebra {_} {_} (A B)%_Algebra_scope (p q)%_path_scope.
H: Funext σ: Signature A, B: Algebra σ p: A = B q: transport
(funi : Carriers σ =>
forallu : Symbol σ, Operation i (σ u)) p
(operations A) = operations B
ap carriers (path_algebra A B p q) = p
H: Funext σ: Signature A, B: Algebra σ p: A = B q: transport
(funi : Carriers σ =>
forallu : Symbol σ, Operation i (σ u)) p
(operations A) = operations B
ap carriers (path_algebra A B p q) = p
H: Funext σ: Signature A: Carriers σ a: forallu : Symbol σ, Operation A (σ u) ha: foralls : Sort σ, IsHSet (A s) B: Carriers σ b: forallu : Symbol σ, Operation B (σ u) hb: foralls : Sort σ, IsHSet (B s) p: A = B q: transport
(funi : Carriers σ =>
forallu : Symbol σ, Operation i (σ u)) p a = b
ap carriers
(path_algebra
{|
carriers := A;
operations := a;
hset_algebra := ha
|}
{|
carriers := B;
operations := b;
hset_algebra := hb
|} p q) = p
H: Funext σ: Signature A: Carriers σ a: forallu : Symbol σ, Operation A (σ u) ha, hb: foralls : Sort σ, IsHSet (A s)
ap carriers
(path_algebra
{|
carriers := A;
operations := a;
hset_algebra := ha
|}
{|
carriers := A;
operations :=
transport
(funi : Carriers σ =>
forallu : Symbol σ, Operation i (σ u)) 1
a;
hset_algebra := hb
|} 11) = 1
H: Funext σ: Signature A: Carriers σ a: forallu : Symbol σ, Operation A (σ u) ha, hb: foralls : Sort σ, IsHSet (A s)
ap carriers
((ap (issig_algebra σ)^-1)^-1
(path_sigma'
(func : Carriers σ =>
{_ : forallu : Symbol σ, Operation c (σ u) &
foralls : Sort σ, IsHSet (c s)}) 1
(transport_sigma 1 (a; ha) @
match
(pr1^-11).2in (_ = v2)
return
((transport
(funx : Carriers σ =>
forallu : Symbol σ,
Operation x (σ u)) 1 (a; ha).1;
transportD
(funx : Carriers σ =>
forallu : Symbol σ,
Operation x (σ u))
(fun (x : Carriers σ)
(_ : forallu : Symbol σ,
Operation x (σ u)) =>
foralls : Sort σ, IsHSet (x s)) 1
(a; ha).1 (a; ha).2) =
((transport
(funi : Carriers σ =>
forallu : Symbol σ,
Operation i (σ u)) 1 a; hb).1; v2))
with
| 1 =>
match
(pr1^-11).1as p in (_ = v1)
return
((transport
(funx : Carriers σ =>
forallu : Symbol σ,
Operation x (σ u)) 1 (a; ha).1;
transportD
(funx : Carriers σ =>
forallu : Symbol σ,
Operation x (σ u))
(fun (x : Carriers σ)
(_ : forallu : Symbol σ,
Operation x (σ u)) =>
foralls : Sort σ, IsHSet (x s))
1 (a; ha).1 (a; ha).2) =
(v1;
transport
(fun_ : forallu : Symbol σ,
Operation
{|
carriers := A;
operations := ...;
hset_algebra := hb
|} (σ u) =>
foralls : Sort σ,
IsHSet
({|
carriers := A;
operations := ...;
hset_algebra := hb
|} s)) p
(transport
(funx : Carriers σ =>
forallu : Symbol σ,
Operation x (σ u)) 1 (a; ha).1;
transportD
(funx : Carriers σ =>
forallu : Symbol σ,
Operation x (σ u))
(fun (x : Carriers σ)
(_ : forallu : Symbol σ,
Operation x (...)) =>
foralls : Sort σ, IsHSet (x s))
1 (a; ha).1 (a; ha).2).2))
with
| 1 => 1endend))) = 1
H: Funext σ: Signature A: Carriers σ a: forallu : Symbol σ, Operation A (σ u) ha, hb: foralls : Sort σ, IsHSet (A s)
ap carriers
((1 @
ap
(funu : SigAlgebra σ =>
{|
carriers := u.1;
operations := (u.2).1;
hset_algebra := (u.2).2
|})
(path_sigma'
(func : Carriers σ =>
{_ : forallu : Symbol σ, Operation c (σ u)
& foralls : Sort σ, IsHSet (c s)}) 1
(1 @
match
center (ha = hb) in (_ = v2)
return ((a; ha) = (a; v2))
with
| 1 => 1end))) @ 1) = 1
σ: Signature A, B: Algebra σ p, q: A = B r: ap (issig_algebra σ)^-1 p =
ap (issig_algebra σ)^-1 q
p = q
σ: Signature A, B: Algebra σ p, q: A = B r: ap (issig_algebra σ)^-1 p =
ap (issig_algebra σ)^-1 q
p = q
σ: Signature A, B: Algebra σ p, q: A = B r: ap (issig_algebra σ)^-1 p =
ap (issig_algebra σ)^-1 q e:= equiv_ap (issig_algebra σ)^-1 A B: A = B <~>
(issig_algebra σ)^-1 A = (issig_algebra σ)^-1 B
H: Funext σ: Signature A, B: Algebra σ p, q: A = B r: ap carriers p = ap carriers q
p = q
H: Funext σ: Signature A, B: Algebra σ p, q: A = B r: ap carriers p = ap carriers q
p = q
H: Funext σ: Signature A, B: Algebra σ p, q: A = B r: ap carriers p = ap carriers q
ap (issig_algebra σ)^-1 p = ap (issig_algebra σ)^-1 q
H: Funext σ: Signature A, B: Algebra σ p, q: A = B r: ap carriers p = ap carriers q
(ap (issig_algebra σ)^-1 p) ..1 =
(ap (issig_algebra σ)^-1 q) ..1
H: Funext σ: Signature A, B: Algebra σ p, q: A = B r: ap carriers p = ap carriers q
transport
(funx : ((issig_algebra σ)^-1 A).1 =
((issig_algebra σ)^-1 B).1 =>
transport
(func : Carriers σ =>
{_ : forallu : Symbol σ, Operation c (σ u) &
foralls : Sort σ, IsHSet (c s)}) x
((issig_algebra σ)^-1 A).2 =
((issig_algebra σ)^-1 B).2) ?r
(ap (issig_algebra σ)^-1 p) ..2 =
(ap (issig_algebra σ)^-1 q) ..2
H: Funext σ: Signature A, B: Algebra σ p, q: A = B r: ap carriers p = ap carriers q
(ap (issig_algebra σ)^-1 p) ..1 =
(ap (issig_algebra σ)^-1 q) ..1
H: Funext σ: Signature A, B: Algebra σ p, q: A = B r: ap carriers p = ap carriers q
ap carriers p = (ap (issig_algebra σ)^-1 q) ..1
transitivity (ap carriers q); [exact r | bydestruct q].
H: Funext σ: Signature A, B: Algebra σ p, q: A = B r: ap carriers p = ap carriers q
transport
(funx : ((issig_algebra σ)^-1 A).1 =
((issig_algebra σ)^-1 B).1 =>
transport
(func : Carriers σ =>
{_ : forallu : Symbol σ, Operation c (σ u) &
foralls : Sort σ, IsHSet (c s)}) x
((issig_algebra σ)^-1 A).2 =
((issig_algebra σ)^-1 B).2)
(match
p in (_ = a)
return
(forallq : A = a,
ap carriers p = ap carriers q ->
(ap (issig_algebra σ)^-1 p) ..1 =
ap carriers p)
with
| 1 =>
fun (q : A = A)
(_ : ap carriers 1 = ap carriers q) => 1end q r @
(r @
match
q as p in (_ = a)
return
(forallp0 : A = a,
ap carriers p0 = ap carriers p ->
ap carriers p =
(ap (issig_algebra σ)^-1 p) ..1)
with
| 1 =>
fun (p : A = A)
(_ : ap carriers p = ap carriers 1) => 1end p r)) (ap (issig_algebra σ)^-1 p) ..2 =
(ap (issig_algebra σ)^-1 q) ..2