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.
[Loading ML file number_string_notation_plugin.cmxs (using legacy method) ... done]
Require Import Types.Require Import HoTT.Tactics.Require Import Diagrams.CommutativeSquares.Require Import Diagrams.Graph.LocalOpen Scope path_scope.(** This file contains the definition of diagrams, diagram maps and equivalences of diagrams. *)(** * Diagrams *)(** A [Diagram] over a graph [G] associates a type to each point of the graph and a function to each arrow. *)RecordDiagram (G : Graph) := {
obj : G -> Type;
arr {i j : G} : G i j -> obj i -> obj j
}.Arguments obj [G] D i : rename.Arguments arr [G] D [i j] g x : rename.Coercionobj : Diagram >-> Funclass.Notation"D '_f' g" := (arr D g).SectionDiagram.Context `{Funext} {G: Graph}.(** [path_diagram] says when two diagrams are equals (up to funext). *)Definitionpath_diagram_naive (D1D2 : Diagram G)
(P := funD' => forallij, G i j -> (D' i -> D' j))
(path_obj : obj D1 = obj D2)
(path_arr : transport P path_obj (arr D1) = arr D2)
: D1 = D2 :=
match path_arr in (_ = v1)
return D1 = {|obj := obj D2; arr := v1 |}
with
| idpath => match path_obj in (_ = v0)
return D1 = {|obj := v0; arr := path_obj # (arr D1) |}
with
| idpath => 1endend.
H: Funext G: Graph D1, D2: Diagram G path_obj: foralli : G, D1 i = D2 i path_arr: forall (ij : G) (g : G i j)
(x : D1 i),
transport idmap (path_obj j) ((D1 _f g) x) =
(D2 _f g) (transport idmap (path_obj i) x)
D1 = D2
H: Funext G: Graph D1, D2: Diagram G path_obj: foralli : G, D1 i = D2 i path_arr: forall (ij : G) (g : G i j)
(x : D1 i),
transport idmap (path_obj j) ((D1 _f g) x) =
(D2 _f g) (transport idmap (path_obj i) x)
D1 = D2
H: Funext G: Graph D1, D2: Diagram G path_obj: foralli : G, D1 i = D2 i path_arr: forall (ij : G) (g : G i j)
(x : D1 i),
transport idmap (path_obj j) ((D1 _f g) x) =
(D2 _f g) (transport idmap (path_obj i) x) i: G
D1 i = D2 i
H: Funext G: Graph D1, D2: Diagram G path_obj: foralli : G, D1 i = D2 i path_arr: forall (ij : G) (g : G i j)
(x : D1 i),
transport idmap (path_obj j) ((D1 _f g) x) =
(D2 _f g) (transport idmap (path_obj i) x) i: G
transport
(funD' : G -> Type =>
forallij : G, G i j -> D' i -> D' j)
(path_forall D1 D2 (funi : G => ?Goal))
(arr D1) i = arr D2 (i:=i)
H: Funext G: Graph D1, D2: Diagram G path_obj: foralli : G, D1 i = D2 i path_arr: forall (ij : G) (g : G i j)
(x : D1 i),
transport idmap (path_obj j) ((D1 _f g) x) =
(D2 _f g) (transport idmap (path_obj i) x) i: G
transport
(funD' : G -> Type =>
forallij : G, G i j -> D' i -> D' j)
(path_forall D1 D2 (funi : G => path_obj i))
(arr D1) i = arr D2 (i:=i)
H: Funext G: Graph D1, D2: Diagram G path_obj: foralli : G, D1 i = D2 i path_arr: forall (ij : G) (g : G i j)
(x : D1 i),
transport idmap (path_obj j) ((D1 _f g) x) =
(D2 _f g) (transport idmap (path_obj i) x) i, j: G g: G i j x: D2 i
transport
(funD' : G -> Type =>
forallij : G, G i j -> D' i -> D' j)
(path_forall D1 D2 (funi : G => path_obj i))
(arr D1) i j g x = (D2 _f g) x
H: Funext G: Graph D1, D2: Diagram G path_obj: foralli : G, D1 i = D2 i path_arr: forall (ij : G) (g : G i j)
(x : D1 i),
transport idmap (path_obj j) ((D1 _f g) x) =
(D2 _f g) (transport idmap (path_obj i) x) i, j: G g: G i j x: D2 i
transport (funx : G -> Type => x j)
(path_forall D1 D2 (funi : G => path_obj i))
((D1 _f g)
(transport (funx : G -> Type => x i)
(path_forall D1 D2 (funi : G => path_obj i))^
x)) = (D2 _f g) x
H: Funext G: Graph D1, D2: Diagram G path_obj: foralli : G, D1 i = D2 i path_arr: forall (ij : G) (g : G i j)
(x : D1 i),
transport idmap (path_obj j) ((D1 _f g) x) =
(D2 _f g) (transport idmap (path_obj i) x) i, j: G g: G i j x: D2 i
transport idmap (path_obj j)
((D1 _f g)
(transport (funx : G -> Type => x i)
(path_forall D1 D2 (funi : G => path_obj i))^
x)) = (D2 _f g) x
H: Funext G: Graph D1, D2: Diagram G path_obj: foralli : G, D1 i = D2 i path_arr: forall (ij : G) (g : G i j)
(x : D1 i),
transport idmap (path_obj j) ((D1 _f g) x) =
(D2 _f g) (transport idmap (path_obj i) x) i, j: G g: G i j x: D2 i
transport idmap (path_obj j)
((D1 _f g)
(transport (funx : G -> Type => x i)
(path_forall D1 D2 (funi : G => path_obj i))^
x)) =
transport idmap (path_obj j)
((D1 _f g) (transport idmap (path_obj i)^ x))
H: Funext G: Graph D1, D2: Diagram G path_obj: foralli : G, D1 i = D2 i path_arr: forall (ij : G) (g : G i j)
(x : D1 i),
transport idmap (path_obj j) ((D1 _f g) x) =
(D2 _f g) (transport idmap (path_obj i) x) i, j: G g: G i j x: D2 i
H: Funext G: Graph D1, D2: Diagram G path_obj: foralli : G, D1 i = D2 i path_arr: forall (ij : G) (g : G i j)
(x : D1 i),
transport idmap (path_obj j) ((D1 _f g) x) =
(D2 _f g) (transport idmap (path_obj i) x) i, j: G g: G i j x: D2 i
transport idmap (path_obj i)
(transport idmap (path_obj i)^ x) = x
exact (transport_pV idmap _ x).Defined.(** * Diagram map *)(** A map between two diagrams is a family of maps between the types of the diagrams making commuting the squares formed with the arrows. *)RecordDiagramMap (D1D2 : Diagram G) := {
DiagramMap_obj :> foralli, D1 i -> D2 i;
DiagramMap_comm : forallij (g: G i j) x,
D2 _f g (DiagramMap_obj i x) = DiagramMap_obj j (D1 _f g x)
}.GlobalArguments DiagramMap_obj [D1 D2] m i x : rename.GlobalArguments DiagramMap_comm [D1 D2] m [i j] f x : rename.GlobalArguments Build_DiagramMap [D1 D2] _ _.DefinitionDiagramMap_homotopy {D1D2 : Diagram G}
(m1m2 : DiagramMap D1 D2) : Type
:= {h_obj : (foralli, m1 i == m2 i) & (forallij (g : G i j) x,
DiagramMap_comm m1 g x @ h_obj j (D1 _f g x)
= ap (D2 _f g) (h_obj i x) @ DiagramMap_comm m2 g x)}.
(funh_obj : foralli : G, m i == m i =>
forall (ij : G) (g : G i j) (x : D1 i),
DiagramMap_comm m g x @ h_obj j ((D1 _f g) x) =
ap (D2 _f g) (h_obj i x) @ DiagramMap_comm m g x)
?proj1
(funh_obj : foralli : G, m i == m i =>
forall (ij : G) (g : G i j) (x : D1 i),
DiagramMap_comm m g x @ h_obj j ((D1 _f g) x) =
ap (D2 _f g) (h_obj i x) @ DiagramMap_comm m g x)
(fun (i : G) (x0 : D1 i) => 1)
H: Funext G: Graph D1, D2: Diagram G m: DiagramMap D1 D2 i, j: G g: G i j x: D1 i
DiagramMap_comm m g x @ 1 = 1 @ DiagramMap_comm m g x
apply concat_p1_1p.Defined.(** [path_DiagramMap] says when two maps are equals (up to funext). *)
H: Funext G: Graph D1, D2: Diagram G m1_obj: foralli : G, D1 i -> D2 i m1_comm, m2_comm: forall (ij : G) (g : G i j)
(x : D1 i),
(D2 _f g) (m1_obj i x) =
m1_obj j ((D1 _f g) x) E:= equiv_functor_forall idmap (funi : G => apD10): (foralla : G, m1_obj a = m1_obj a) <~>
(forallb : G, m1_obj b == m1_obj b) h_comm: forall (ij : G) (g : G i j)
(x : D1 i),
m1_comm i j g x @
functor_forall idmap (funi0 : G => apD10)
(apD10 1) j ((D1 _f g) x) =
1 @ m2_comm i j g x
m1_comm = m2_comm
H: Funext G: Graph D1, D2: Diagram G m1_obj: foralli : G, D1 i -> D2 i m1_comm, m2_comm: forall (ij : G) (g : G i j)
(x : D1 i),
(D2 _f g) (m1_obj i x) =
m1_obj j ((D1 _f g) x) E:= equiv_functor_forall idmap (funi : G => apD10): (foralla : G, m1_obj a = m1_obj a) <~>
(forallb : G, m1_obj b == m1_obj b) h_comm: forall (ij : G) (g : G i j)
(x : D1 i),
m1_comm i j g x @
functor_forall idmap (funi0 : G => apD10)
(apD10 1) j ((D1 _f g) x) =
1 @ m2_comm i j g x i, j: G f: G i j x: D1 i
m1_comm i j f x = m2_comm i j f x
H: Funext G: Graph D1, D2: Diagram G m1_obj: foralli : G, D1 i -> D2 i m1_comm, m2_comm: forall (ij : G) (g : G i j)
(x : D1 i),
(D2 _f g) (m1_obj i x) =
m1_obj j ((D1 _f g) x) E:= equiv_functor_forall idmap (funi : G => apD10): (foralla : G, m1_obj a = m1_obj a) <~>
(forallb : G, m1_obj b == m1_obj b) h_comm: forall (ij : G) (g : G i j)
(x : D1 i),
m1_comm i j g x @
functor_forall idmap (funi0 : G => apD10)
(apD10 1) j ((D1 _f g) x) =
1 @ m2_comm i j g x i, j: G f: G i j x: D1 i
m1_comm i j f x = 1 @ m2_comm i j f x
H: Funext G: Graph D1, D2: Diagram G m1_obj: foralli : G, D1 i -> D2 i m1_comm, m2_comm: forall (ij : G) (g : G i j)
(x : D1 i),
(D2 _f g) (m1_obj i x) =
m1_obj j ((D1 _f g) x) E:= equiv_functor_forall idmap (funi : G => apD10): (foralla : G, m1_obj a = m1_obj a) <~>
(forallb : G, m1_obj b == m1_obj b) h_comm: forall (ij : G) (g : G i j)
(x : D1 i),
m1_comm i j g x @
functor_forall idmap (funi0 : G => apD10)
(apD10 1) j ((D1 _f g) x) =
1 @ m2_comm i j g x i, j: G f: G i j x: D1 i
m1_comm i j f x =
m1_comm i j f x @
functor_forall idmap (funi : G => apD10) (apD10 1) j
((D1 _f f) x)
apply inverse, concat_p1.
H: Funext G: Graph D1, D2: Diagram G m1_obj: foralli : G, D1 i -> D2 i m1_comm, m2_comm: forall (ij : G) (g : G i j)
(x : D1 i),
(D2 _f g) (m1_obj i x) =
m1_obj j ((D1 _f g) x) E:= equiv_functor_forall idmap (funi : G => apD10): (foralla : G, m1_obj a = m1_obj a) <~>
(forallb : G, m1_obj b == m1_obj b) h_comm: forall (ij : G) (g : G i j)
(x : D1 i),
m1_comm i j g x @
functor_forall idmap (funi0 : G => apD10)
(apD10 1) j ((D1 _f g) x) =
1 @ m2_comm i j g x HH: m1_comm = m2_comm
H: Funext G: Graph D1, D2: Diagram G w_obj: foralli : G, D1 i -> D2 i w_comm: forall (ij : G) (g : G i j)
(x : D1 i),
(D2 _f g) (w_obj i x) = w_obj j ((D1 _f g) x) is_eq_w: foralli : G, IsEquiv (w_obj i) we:= funi : G =>
{|
equiv_fun := w_obj i; equiv_isequiv := is_eq_w i
|}: foralli : G, D1 i <~> D2 i
forall (ij : G) (g : G i j) (x : D1 i),
comm_square_comp (w_comm i j g)
(comm_square_inverse
(funx0 : D1 i => w_comm i j g x0)) x @
eissect (w_obj j) ((D1 _f g) x) =
ap (D1 _f g) (eissect (w_obj i) x) @ 1
H: Funext G: Graph D1, D2: Diagram G w_obj: foralli : G, D1 i -> D2 i w_comm: forall (ij : G) (g : G i j)
(x : D1 i),
(D2 _f g) (w_obj i x) = w_obj j ((D1 _f g) x) is_eq_w: foralli : G, IsEquiv (w_obj i) we:= funi : G =>
{|
equiv_fun := w_obj i; equiv_isequiv := is_eq_w i
|}: foralli : G, D1 i <~> D2 i i, j: G f: G i j x: D1 i
comm_square_comp (w_comm i j f)
(comm_square_inverse
(funx : D1 i => w_comm i j f x)) x @
eissect (w_obj j) ((D1 _f f) x) =
ap (D1 _f f) (eissect (w_obj i) x) @ 1
H: Funext G: Graph D1, D2: Diagram G w_obj: foralli : G, D1 i -> D2 i w_comm: forall (ij : G) (g : G i j)
(x : D1 i),
(D2 _f g) (w_obj i x) = w_obj j ((D1 _f g) x) is_eq_w: foralli : G, IsEquiv (w_obj i) we:= funi : G =>
{|
equiv_fun := w_obj i; equiv_isequiv := is_eq_w i
|}: foralli : G, D1 i <~> D2 i i, j: G f: G i j x: D1 i
comm_square_comp (w_comm i j f)
(comm_square_inverse
(funx : D1 i => w_comm i j f x)) x @
eissect (w_obj j) ((D1 _f f) x) =
ap (D1 _f f) (eissect (w_obj i) x)
exact (comm_square_inverse_is_sect (we i) (we j) _ x).Defined.(** The equivalence of diagram is an equivalence relation. *)(** Those instances allows to use the tactics reflexivity, symmetry and transitivity. *)#[export] Instancereflexive_diagram_equiv : Reflexive diagram_equiv | 1
:= funD => Build_diagram_equiv (diagram_idmap D) _.#[export] Instancesymmetric_diagram_equiv : Symmetric diagram_equiv | 1
:= funD1D2m => Build_diagram_equiv (diagram_equiv_inv m) _.