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 Nat.Core.Require Import Spaces.Int.Require Import Spaces.Finite.Fin.Require Import WildCat.Core.Local Set Universe Minimization ToSet.(** * Successor Structures. *)(** A successor structure is just a type with a endofunctor on it, called 'successor'. Typical examples include either the integers or natural numbers with the successor (or predecessor) operation. *)RecordSuccStr : Type := {
ss_carrier :> Type ;
ss_succ : ss_carrier -> ss_carrier ;
}.Declare Scope succ_scope.LocalOpen Scope nat_scope.LocalOpen Scope type_scope.LocalOpen Scope succ_scope.Delimit Scope succ_scope with succ.Arguments ss_succ {_} _.Notation"x .+1" := (ss_succ x) : succ_scope.(** Successor structure of naturals *)DefinitionNatSucc : SuccStr := Build_SuccStr nat nat_succ.(** Successor structure of integers *)DefinitionBinIntSucc : SuccStr := Build_SuccStr Int int_succ.Notation"'+N'" := NatSucc : succ_scope.Notation"'+Z'" := BinIntSucc : succ_scope.(** Stratified successor structures *)(** If [N] has a successor structure, then so does the product [N * Fin n]. The successor operation increases the second factor, and if it wraps around, it also increases the first factor. *)DefinitionStratifiedType (N : SuccStr) (n : nat) := N * Fin n.
N: SuccStr n: nat x: StratifiedType N n
StratifiedType N n
N: SuccStr n: nat x: StratifiedType N n
StratifiedType N n
N: SuccStr n: nat x: StratifiedType N n
N
N: SuccStr n: nat x: StratifiedType N n
Fin n
N: SuccStr n: nat x: StratifiedType N n
N
N: SuccStr x: StratifiedType N 0
N
N: SuccStr n: nat x: StratifiedType N n.+1
N
N: SuccStr x: StratifiedType N 0
N
exact (Empty_rec _ (snd x)).
N: SuccStr n: nat x: StratifiedType N n.+1
N
N: SuccStr n: nat x: StratifiedType N n.+1 p: snd x = inr tt
N
N: SuccStr n: nat x: StratifiedType N n.+1 n0: snd x <> inr tt
N
N: SuccStr n: nat x: StratifiedType N n.+1 p: snd x = inr tt
N
exact (ss_succ (fst x)).
N: SuccStr n: nat x: StratifiedType N n.+1 n0: snd x <> inr tt
N
exact (fst x).
N: SuccStr n: nat x: StratifiedType N n
Fin n
exact (fsucc_mod (snd x)).Defined.DefinitionStratified (N : SuccStr) (n : nat) : SuccStr
:= Build_SuccStr (StratifiedType N n) (stratified_succ N n).(** Addition in successor structures *)Definitionss_add {N : SuccStr} (n : N) (k : nat) : N := nat_iter k ss_succ n.Infix"+" := ss_add : succ_scope.Definitionss_add_succ {N : SuccStr} (n : N) (k : nat)
: n + k.+1 = n.+1 + k
:= nat_iter_succ_r k ss_succ n.Definitionss_add_sum {N : SuccStr} (n : N) (kl : nat)
: n + (k + l) = (n + l) + k
:= nat_iter_add k l ss_succ n.(** Nat and Int segmented by triples *)Notation"'N3'" := (Stratified (+N) 3) : succ_scope.Notation"'Z3'" := (Stratified (+Z) 3) : succ_scope.(** ** Category of successor structures *)(** Inspired by the construction of the wildcat structure on [pType], we can give [SuccStr] a wildcat structure in a similar manner (all the way up). *)RecordssFam (A : SuccStr) := {
ss_fam :> A -> Type;
dss_succ {x} : ss_fam x -> ss_fam (x.+1);
}.Arguments ss_fam {_ _} _.Arguments dss_succ {_ _ _}.RecordssForall {A : SuccStr} (B : ssFam A) := {
ss_fun :> forallx, B x;
ss_fun_succ : forallx, ss_fun x.+1 = dss_succ (ss_fun x);
}.Arguments ss_fun {_ _} _ _.Arguments ss_fun_succ {_ _} _ _.Definitionssfam_const {A : SuccStr} (B : SuccStr) : ssFam A
:= Build_ssFam A (fun_ => B) (fun_ => ss_succ).
A: SuccStr P: ssFam A f, g: ssForall P
ssFam A
A: SuccStr P: ssFam A f, g: ssForall P
ssFam A
A: SuccStr P: ssFam A f, g: ssForall P
A -> Type
A: SuccStr P: ssFam A f, g: ssForall P
forallx : A, ?ss_fam x -> ?ss_fam x.+1
A: SuccStr P: ssFam A f, g: ssForall P
forallx : A,
(funx0 : A => f x0 = g x0) x ->
(funx0 : A => f x0 = g x0) x.+1
A: SuccStr P: ssFam A f, g: ssForall P x: A p: f x = g x
f x.+1 = g x.+1
exact (ss_fun_succ f x @ ap dss_succ p @ (ss_fun_succ g x)^).Defined.DefinitionssHomotopy {A : SuccStr} {P : ssFam A} (fg : ssForall P)
:= ssForall (ssfam_sshomotopy f g).
IsGraph SuccStr
IsGraph SuccStr
SuccStr -> SuccStr -> Type
X, Y: SuccStr
Type
exact (@ssForall X (ssfam_const Y)).Defined.
A: SuccStr P: ssFam A
IsGraph (ssForall P)
A: SuccStr P: ssFam A
IsGraph (ssForall P)
A: SuccStr P: ssFam A
ssForall P -> ssForall P -> Type
exact ssHomotopy.Defined.Instanceis2graph_ssforall {A : SuccStr} (P : ssFam A)
: Is2Graph (ssForall P)
:= {}.Instanceis2graph_ss : Is2Graph SuccStr := {}.Instanceis3graph_ss : Is3Graph SuccStr := {}.Ltacsselim_elim eq x :=
matchtype of (eq x) with
| ?lhs = _ =>
generalize dependent (eq x);
generalize dependent lhs
| _ => fail"sselim: no lhs found"end.Ltacsselim f :=
leteq := fresh"eq"indestruct f as [f eq];
cbnin *;
matchtype of eq with
| forallx : ?X, _ = _ =>
multimatch goal with
| x : X |- _ => sselim_elim eq x
| f : ?Y -> X |- _ =>
match goal with
| y : Y |- _ => sselim_elim eq (f y)
| g : ?Z -> Y |- _ =>
match goal with
| z : Z |- _ => sselim_elim eq (f (g z))
endend
| _ => fail"sselim: no hyp found"end
| _ => fail"sselim: no eq found"end;
napply paths_ind_r;
tryclear eq;
tryclear f.Tactic Notation"sselim"constr(x0) := sselim x0.Tactic Notation"sselim"constr(x0) constr(x1) := sselim x0; sselim x1.Tactic Notation"sselim"constr(x0) constr(x1) constr(x2) := sselim x0; sselim x1 x2.Tactic Notation"sselim"constr(x0) constr(x1) constr(x2) constr(x3) := sselim x0; sselim x1 x2 x3.Tactic Notation"sselim"constr(x0) constr(x1) constr(x2) constr(x3) constr(x4) := sselim x0; sselim x1 x2 x3 x4.Tactic Notation"sselim"constr(x0) constr(x1) constr(x2) constr(x3) constr(x4) constr(x5) := sselim x0; sselim x1 x2 x3 x4 x5.Tactic Notation"sselim"constr(x0) constr(x1) constr(x2) constr(x3) constr(x4) constr(x5) constr(x6) := sselim x0; sselim x1 x2 x3 x4 x5 x6.
Is01Cat SuccStr
Is01Cat SuccStr
foralla : SuccStr, a $-> a
forallabc : SuccStr,
(b $-> c) -> (a $-> b) -> a $-> c
foralla : SuccStr, a $-> a
X: SuccStr
X $-> X
X: SuccStr
forallx : X, ssfam_const X x
X: SuccStr
forallx : X, ?ss_fun x.+1 = dss_succ (?ss_fun x)
X: SuccStr
forallx : X, ssfam_const X x
exact (funx => x).
X: SuccStr
forallx : X, idmap x.+1 = dss_succ (idmap x)
reflexivity.
forallabc : SuccStr,
(b $-> c) -> (a $-> b) -> a $-> c
X, Y, Z: SuccStr f: Y $-> Z g: X $-> Y
X $-> Z
X, Y, Z: SuccStr f: Y $-> Z g: X $-> Y
forallx : X, ssfam_const Z x
X, Y, Z: SuccStr f: Y $-> Z g: X $-> Y
forallx : X, ?ss_fun x.+1 = dss_succ (?ss_fun x)
X, Y, Z: SuccStr f: Y $-> Z g: X $-> Y
forallx : X, ssfam_const Z x
X, Y, Z: SuccStr f: Y $-> Z g: X $-> Y x: X
ssfam_const Z x
exact (f (g x)).
X, Y, Z: SuccStr f: Y $-> Z g: X $-> Y
forallx : X,
(funx0 : X => f (g x0)) x.+1 =
dss_succ ((funx0 : X => f (g x0)) x)
X, Y, Z: SuccStr f: Y $-> Z g: X $-> Y x: X
(funx : X => f (g x)) x.+1 =
dss_succ ((funx : X => f (g x)) x)
exact (ap f (ss_fun_succ g x) @ ss_fun_succ f (g x)).Defined.
A: SuccStr P: ssFam A
Is01Cat (ssForall P)
A: SuccStr P: ssFam A
Is01Cat (ssForall P)
A: SuccStr P: ssFam A
foralla : ssForall P, a $-> a
A: SuccStr P: ssFam A
forallabc : ssForall P,
(b $-> c) -> (a $-> b) -> a $-> c
A: SuccStr P: ssFam A
foralla : ssForall P, a $-> a
A: SuccStr P: ssFam A f: ssForall P
f $-> f
A: SuccStr P: ssFam A f: ssForall P
forallx : A, ssfam_sshomotopy f f x
A: SuccStr P: ssFam A f: ssForall P
forallx : A, ?ss_fun x.+1 = dss_succ (?ss_fun x)
A: SuccStr P: ssFam A f: ssForall P
forallx : A, ssfam_sshomotopy f f x
reflexivity.
A: SuccStr P: ssFam A f: ssForall P
forallx : A,
(funx0 : A => 1) x.+1 =
dss_succ ((funx0 : A => 1) x)
A: SuccStr P: ssFam A f: ssForall P x: A
1 = (ss_fun_succ f x @ 1) @ (ss_fun_succ f x)^
bydestruct (ss_fun_succ f x).
A: SuccStr P: ssFam A
forallabc : ssForall P,
(b $-> c) -> (a $-> b) -> a $-> c
A: SuccStr P: ssFam A f, g, h: ssForall P p: g $-> h q: f $-> g
f $-> h
A: SuccStr P: ssFam A f, g, h: ssForall P p: g $-> h q: f $-> g
forallx : A, ssfam_sshomotopy f h x
A: SuccStr P: ssFam A f, g, h: ssForall P p: g $-> h q: f $-> g
forallx : A, ?ss_fun x.+1 = dss_succ (?ss_fun x)
A: SuccStr P: ssFam A f, g, h: ssForall P p: g $-> h q: f $-> g
forallx : A, ssfam_sshomotopy f h x
A: SuccStr P: ssFam A f, g, h: ssForall P p: g $-> h q: f $-> g x: A
ssfam_sshomotopy f h x
exact (q x @ p x).
A: SuccStr P: ssFam A f, g, h: ssForall P p: g $-> h q: f $-> g
forallx : A,
(funx0 : A => q x0 @ p x0) x.+1 =
dss_succ ((funx0 : A => q x0 @ p x0) x)
A: SuccStr P: ssFam A f, g, h: ssForall P p: g $-> h q: f $-> g x: A
q x.+1 @ p x.+1 =
(ss_fun_succ f x @ ap dss_succ (q x @ p x)) @
(ss_fun_succ h x)^
A: SuccStr P: ssFam A f, g, h: forallx : A, P x p: forallx : A, g x = h x q: forallx : A, f x = g x x: A
((1 @ ap dss_succ (q x)) @ 1) @
((1 @ ap dss_succ (p x)) @ 1^) =
(1 @ ap dss_succ (q x @ p x)) @ 1^
A: SuccStr P: ssFam A f, g, h: forallx : A, P x p: forallx : A, g x = h x q: forallx : A, f x = g x x: A
((1 @ ap dss_succ (q x)) @ 1) @
((1 @ ap dss_succ (p x)) @ 1) =
(1 @ ap dss_succ (q x @ p x)) @ 1
bydestruct (p x), (q x).Defined.
A: SuccStr P: ssFam A
Is0Gpd (ssForall P)
A: SuccStr P: ssFam A
Is0Gpd (ssForall P)
A: SuccStr P: ssFam A
forallab : ssForall P, (a $-> b) -> b $-> a
A: SuccStr P: ssFam A f, g: ssForall P p: f $-> g
g $-> f
A: SuccStr P: ssFam A f, g: ssForall P p: f $-> g
forallx : A, ssfam_sshomotopy g f x
A: SuccStr P: ssFam A f, g: ssForall P p: f $-> g
forallx : A, ?ss_fun x.+1 = dss_succ (?ss_fun x)
A: SuccStr P: ssFam A f, g: ssForall P p: f $-> g
forallx : A, ssfam_sshomotopy g f x
A: SuccStr P: ssFam A f, g: ssForall P p: f $-> g x: A
ssfam_sshomotopy g f x
exact (p x)^.
A: SuccStr P: ssFam A f, g: ssForall P p: f $-> g
forallx : A,
(funx0 : A => (p x0)^) x.+1 =
dss_succ ((funx0 : A => (p x0)^) x)
A: SuccStr P: ssFam A f, g: ssForall P p: f $-> g x: A
(p x.+1)^ =
(ss_fun_succ g x @ ap dss_succ (p x)^) @
(ss_fun_succ f x)^
A: SuccStr P: ssFam A f, g: forallx : A, P x p: forallx : A, f x = g x x: A
((1 @ ap dss_succ (p x)) @ 1^)^ =
(1 @ ap dss_succ (p x)^) @ 1
bydestruct (p x).Defined.
Is1Cat SuccStr
Is1Cat SuccStr
forallab : SuccStr, Is01Cat (a $-> b)
forallab : SuccStr, Is0Gpd (a $-> b)
forall (abc : SuccStr) (g : b $-> c),
Is0Functor (cat_postcomp a g)
forall (abc : SuccStr) (f : a $-> b),
Is0Functor (cat_precomp c f)
forall (abcd : SuccStr) (f : a $-> b) (g : b $-> c)
(h : c $-> d), h $o g $o f $== h $o (g $o f)
forall (ab : SuccStr) (f : a $-> b), Id b $o f $== f
forall (ab : SuccStr) (f : a $-> b), f $o Id a $== f
forall (abc : SuccStr) (g : b $-> c),
Is0Functor (cat_postcomp a g)
forall (abc : SuccStr) (f : a $-> b),
Is0Functor (cat_precomp c f)
forall (abcd : SuccStr) (f : a $-> b) (g : b $-> c)
(h : c $-> d), h $o g $o f $== h $o (g $o f)
forall (ab : SuccStr) (f : a $-> b), Id b $o f $== f
forall (ab : SuccStr) (f : a $-> b), f $o Id a $== f
forall (abc : SuccStr) (g : b $-> c),
Is0Functor (cat_postcomp a g)
X, Y, Z: SuccStr g: Y $-> Z
Is0Functor (cat_postcomp X g)
X, Y, Z: SuccStr g: Y $-> Z
forallab : X $-> Y,
(a $-> b) -> cat_postcomp X g a $-> cat_postcomp X g b
X, Y, Z: SuccStr g: Y $-> Z f, h: X $-> Y p: f $-> h
cat_postcomp X g f $-> cat_postcomp X g h
X, Y, Z: SuccStr g: Y $-> Z f, h: X $-> Y p: f $-> h
forallx : X,
ssfam_sshomotopy (cat_postcomp X g f)
(cat_postcomp X g h) x
X, Y, Z: SuccStr g: Y $-> Z f, h: X $-> Y p: f $-> h
forallx : X, ?ss_fun x.+1 = dss_succ (?ss_fun x)
X, Y, Z: SuccStr g: Y $-> Z f, h: X $-> Y p: f $-> h
forallx : X,
ssfam_sshomotopy (cat_postcomp X g f)
(cat_postcomp X g h) x
X, Y, Z: SuccStr g: Y $-> Z f, h: X $-> Y p: f $-> h x: X
ssfam_sshomotopy (cat_postcomp X g f)
(cat_postcomp X g h) x
exact (ap g (p x)).
X, Y, Z: SuccStr g: Y $-> Z f, h: X $-> Y p: f $-> h
forallx : X,
(funx0 : X => ap g (p x0)) x.+1 =
dss_succ ((funx0 : X => ap g (p x0)) x)
X, Y, Z: SuccStr g: Y $-> Z f, h: X $-> Y p: f $-> h x: X
ap g (p x.+1) =
((ap g (ss_fun_succ f x) @ ss_fun_succ g (f x)) @
ap ss_succ (ap g (p x))) @
(ap g (ss_fun_succ h x) @ ss_fun_succ g (h x))^
X, Y, Z: SuccStr g: ssForall (ssfam_const Z) f, h: X -> Y p: forallx : X, f x = h x x: X
ap g ((1 @ ap ss_succ (p x)) @ 1^) =
((1 @ ss_fun_succ g (f x)) @ ap ss_succ (ap g (p x))) @
(ap g 1 @ ss_fun_succ g (h x))^
X, Y, Z: SuccStr g: ssForall (ssfam_const Z) f, h: X -> Y x: X
1 =
((1 @ ss_fun_succ g (f x)) @ 1) @
(1 @ ss_fun_succ g (f x))^
X, Y, Z: SuccStr g: Y -> Z eq: forallx : Y, g x.+1 = (g x).+1 f, h: X -> Y x: X
1 = ((1 @ eq (f x)) @ 1) @ (1 @ eq (f x))^
bydestruct (eq (f x)).
forall (abc : SuccStr) (f : a $-> b),
Is0Functor (cat_precomp c f)
X, Y, Z: SuccStr g: X $-> Y
Is0Functor (cat_precomp Z g)
X, Y, Z: SuccStr g: X $-> Y
forallab : Y $-> Z,
(a $-> b) -> cat_precomp Z g a $-> cat_precomp Z g b
X, Y, Z: SuccStr g: X $-> Y f, h: Y $-> Z q: f $-> h
cat_precomp Z g f $-> cat_precomp Z g h
X, Y, Z: SuccStr g: X $-> Y f, h: Y $-> Z q: f $-> h
forallx : X,
ssfam_sshomotopy (cat_precomp Z g f)
(cat_precomp Z g h) x
X, Y, Z: SuccStr g: X $-> Y f, h: Y $-> Z q: f $-> h
forallx : X, ?ss_fun x.+1 = dss_succ (?ss_fun x)
X, Y, Z: SuccStr g: X $-> Y f, h: Y $-> Z q: f $-> h
forallx : X,
ssfam_sshomotopy (cat_precomp Z g f)
(cat_precomp Z g h) x
X, Y, Z: SuccStr g: X $-> Y f, h: Y $-> Z q: f $-> h x: X
ssfam_sshomotopy (cat_precomp Z g f)
(cat_precomp Z g h) x
apply q.
X, Y, Z: SuccStr g: X $-> Y f, h: Y $-> Z q: f $-> h
forallx : X,
(funx0 : X => letX0 := ss_fun q in X0 (g x0)) x.+1 =
dss_succ
((funx0 : X => letX0 := ss_fun q in X0 (g x0)) x)
X, Y, Z: SuccStr g: X $-> Y f, h: Y $-> Z q: f $-> h x: X
q (g x.+1) =
((ap f (ss_fun_succ g x) @ ss_fun_succ f (g x)) @
ap ss_succ (q (g x))) @
(ap h (ss_fun_succ g x) @ ss_fun_succ h (g x))^
by sselim g q f h.
forall (abcd : SuccStr) (f : a $-> b) (g : b $-> c)
(h : c $-> d), h $o g $o f $== h $o (g $o f)
X, Y, Z, W: SuccStr f: X $-> Y g: Y $-> Z h: Z $-> W
h $o g $o f $== h $o (g $o f)
X, Y, Z, W: SuccStr f: X $-> Y g: Y $-> Z h: Z $-> W
forallx : X,
ssfam_sshomotopy (h $o g $o f) (h $o (g $o f)) x
X, Y, Z, W: SuccStr f: X $-> Y g: Y $-> Z h: Z $-> W
forallx : X, ?ss_fun x.+1 = dss_succ (?ss_fun x)
X, Y, Z, W: SuccStr f: X $-> Y g: Y $-> Z h: Z $-> W
forallx : X,
ssfam_sshomotopy (h $o g $o f) (h $o (g $o f)) x
X, Y, Z, W: SuccStr f: X $-> Y g: Y $-> Z h: Z $-> W x: X
ssfam_sshomotopy (h $o g $o f) (h $o (g $o f)) x
reflexivity.
X, Y, Z, W: SuccStr f: X $-> Y g: Y $-> Z h: Z $-> W
forallx : X,
(funx0 : X => 1) x.+1 =
dss_succ ((funx0 : X => 1) x)
X, Y, Z, W: SuccStr f: X $-> Y g: Y $-> Z h: Z $-> W x: X
1 =
((ap (funx : Y => h (g x)) (ss_fun_succ f x) @
(ap h (ss_fun_succ g (f x)) @
ss_fun_succ h (g (f x)))) @ 1) @
(ap h (ap g (ss_fun_succ f x) @ ss_fun_succ g (f x)) @
ss_fun_succ h (g (f x)))^
by sselim f g h.
forall (ab : SuccStr) (f : a $-> b), Id b $o f $== f
X, Y: SuccStr f: X $-> Y
Id Y $o f $== f
X, Y: SuccStr f: X $-> Y
forallx : X, ssfam_sshomotopy (Id Y $o f) f x
X, Y: SuccStr f: X $-> Y
forallx : X, ?ss_fun x.+1 = dss_succ (?ss_fun x)
X, Y: SuccStr f: X $-> Y
forallx : X,
(funx0 : X => 1) x.+1 =
dss_succ ((funx0 : X => 1) x)
X, Y: SuccStr f: X $-> Y x: X
(funx : X => 1) x.+1 = dss_succ ((funx : X => 1) x)
by sselim f.
forall (ab : SuccStr) (f : a $-> b), f $o Id a $== f
X, Y: SuccStr f: X $-> Y
f $o Id X $== f
X, Y: SuccStr f: X $-> Y
forallx : X, ssfam_sshomotopy (f $o Id X) f x
X, Y: SuccStr f: X $-> Y
forallx : X, ?ss_fun x.+1 = dss_succ (?ss_fun x)
X, Y: SuccStr f: X $-> Y
forallx : X,
(funx0 : X => 1) x.+1 =
dss_succ ((funx0 : X => 1) x)
X, Y: SuccStr f: X $-> Y x: X
(funx : X => 1) x.+1 = dss_succ ((funx : X => 1) x)