2015-04-07 01:01:08 +00:00
|
|
|
|
/-
|
|
|
|
|
Copyright (c) 2015 Floris van Doorn. All rights reserved.
|
|
|
|
|
Released under Apache 2.0 license as described in the file LICENSE.
|
|
|
|
|
Authors: Floris van Doorn
|
|
|
|
|
|
2015-04-11 00:33:33 +00:00
|
|
|
|
Definition of general colimits and sequential colimits.
|
2015-04-07 01:01:08 +00:00
|
|
|
|
-/
|
|
|
|
|
|
2015-04-11 00:33:33 +00:00
|
|
|
|
/- definition of a general colimit -/
|
2015-11-20 22:47:11 +00:00
|
|
|
|
open eq nat quotient sigma equiv equiv.ops is_trunc
|
2015-04-07 01:01:08 +00:00
|
|
|
|
|
|
|
|
|
namespace colimit
|
2015-04-23 22:27:56 +00:00
|
|
|
|
section
|
2015-04-11 00:33:33 +00:00
|
|
|
|
parameters {I J : Type} (A : I → Type) (dom cod : J → I)
|
|
|
|
|
(f : Π(j : J), A (dom j) → A (cod j))
|
|
|
|
|
variables {i : I} (a : A i) (j : J) (b : A (dom j))
|
2015-04-07 01:01:08 +00:00
|
|
|
|
|
2015-04-11 00:33:33 +00:00
|
|
|
|
local abbreviation B := Σ(i : I), A i
|
|
|
|
|
inductive colim_rel : B → B → Type :=
|
|
|
|
|
| Rmk : Π{j : J} (a : A (dom j)), colim_rel ⟨cod j, f j a⟩ ⟨dom j, a⟩
|
|
|
|
|
open colim_rel
|
|
|
|
|
local abbreviation R := colim_rel
|
2015-04-07 01:01:08 +00:00
|
|
|
|
|
2015-04-11 00:33:33 +00:00
|
|
|
|
-- TODO: define this in root namespace
|
|
|
|
|
definition colimit : Type :=
|
2015-06-04 19:57:00 +00:00
|
|
|
|
quotient colim_rel
|
2015-04-11 00:33:33 +00:00
|
|
|
|
|
|
|
|
|
definition incl : colimit :=
|
|
|
|
|
class_of R ⟨i, a⟩
|
|
|
|
|
abbreviation ι := @incl
|
|
|
|
|
|
|
|
|
|
definition cglue : ι (f j b) = ι b :=
|
2015-04-27 21:34:55 +00:00
|
|
|
|
eq_of_rel colim_rel (Rmk f b)
|
2015-04-11 00:33:33 +00:00
|
|
|
|
|
|
|
|
|
protected definition rec {P : colimit → Type}
|
|
|
|
|
(Pincl : Π⦃i : I⦄ (x : A i), P (ι x))
|
2015-05-22 08:35:38 +00:00
|
|
|
|
(Pglue : Π(j : J) (x : A (dom j)), Pincl (f j x) =[cglue j x] Pincl x)
|
2015-04-11 00:33:33 +00:00
|
|
|
|
(y : colimit) : P y :=
|
|
|
|
|
begin
|
2015-06-04 19:57:00 +00:00
|
|
|
|
fapply (quotient.rec_on y),
|
2015-04-11 00:33:33 +00:00
|
|
|
|
{ intro a, cases a, apply Pincl},
|
2015-04-30 18:00:39 +00:00
|
|
|
|
{ intro a a' H, cases H, apply Pglue}
|
2015-04-11 00:33:33 +00:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
protected definition rec_on [reducible] {P : colimit → Type} (y : colimit)
|
|
|
|
|
(Pincl : Π⦃i : I⦄ (x : A i), P (ι x))
|
2015-05-22 08:35:38 +00:00
|
|
|
|
(Pglue : Π(j : J) (x : A (dom j)), Pincl (f j x) =[cglue j x] Pincl x) : P y :=
|
2015-04-11 00:33:33 +00:00
|
|
|
|
rec Pincl Pglue y
|
|
|
|
|
|
2015-04-27 21:34:55 +00:00
|
|
|
|
theorem rec_cglue {P : colimit → Type}
|
2015-04-19 21:56:24 +00:00
|
|
|
|
(Pincl : Π⦃i : I⦄ (x : A i), P (ι x))
|
2015-05-22 08:35:38 +00:00
|
|
|
|
(Pglue : Π(j : J) (x : A (dom j)), Pincl (f j x) =[cglue j x] Pincl x)
|
|
|
|
|
{j : J} (x : A (dom j)) : apdo (rec Pincl Pglue) (cglue j x) = Pglue j x :=
|
2015-04-28 01:30:20 +00:00
|
|
|
|
!rec_eq_of_rel
|
2015-04-19 21:56:24 +00:00
|
|
|
|
|
2015-05-22 08:35:38 +00:00
|
|
|
|
protected definition elim {P : Type} (Pincl : Π⦃i : I⦄ (x : A i), P)
|
2015-04-11 00:33:33 +00:00
|
|
|
|
(Pglue : Π(j : J) (x : A (dom j)), Pincl (f j x) = Pincl x) (y : colimit) : P :=
|
2015-05-22 08:35:38 +00:00
|
|
|
|
rec Pincl (λj a, pathover_of_eq (Pglue j a)) y
|
2015-04-11 00:33:33 +00:00
|
|
|
|
|
|
|
|
|
protected definition elim_on [reducible] {P : Type} (y : colimit)
|
|
|
|
|
(Pincl : Π⦃i : I⦄ (x : A i), P)
|
|
|
|
|
(Pglue : Π(j : J) (x : A (dom j)), Pincl (f j x) = Pincl x) : P :=
|
2015-04-07 01:01:08 +00:00
|
|
|
|
elim Pincl Pglue y
|
|
|
|
|
|
2015-04-27 21:34:55 +00:00
|
|
|
|
theorem elim_cglue {P : Type}
|
2015-04-11 00:33:33 +00:00
|
|
|
|
(Pincl : Π⦃i : I⦄ (x : A i), P)
|
|
|
|
|
(Pglue : Π(j : J) (x : A (dom j)), Pincl (f j x) = Pincl x)
|
2015-04-23 22:27:56 +00:00
|
|
|
|
{j : J} (x : A (dom j)) : ap (elim Pincl Pglue) (cglue j x) = Pglue j x :=
|
2015-04-27 21:34:55 +00:00
|
|
|
|
begin
|
2015-05-22 08:35:38 +00:00
|
|
|
|
apply eq_of_fn_eq_fn_inv !(pathover_constant (cglue j x)),
|
|
|
|
|
rewrite [▸*,-apdo_eq_pathover_of_eq_ap,↑elim,rec_cglue],
|
2015-04-27 21:34:55 +00:00
|
|
|
|
end
|
2015-04-07 01:01:08 +00:00
|
|
|
|
|
2015-04-19 21:56:24 +00:00
|
|
|
|
protected definition elim_type (Pincl : Π⦃i : I⦄ (x : A i), Type)
|
|
|
|
|
(Pglue : Π(j : J) (x : A (dom j)), Pincl (f j x) ≃ Pincl x) (y : colimit) : Type :=
|
|
|
|
|
elim Pincl (λj a, ua (Pglue j a)) y
|
|
|
|
|
|
|
|
|
|
protected definition elim_type_on [reducible] (y : colimit)
|
|
|
|
|
(Pincl : Π⦃i : I⦄ (x : A i), Type)
|
|
|
|
|
(Pglue : Π(j : J) (x : A (dom j)), Pincl (f j x) ≃ Pincl x) : Type :=
|
|
|
|
|
elim_type Pincl Pglue y
|
|
|
|
|
|
2015-04-27 21:34:55 +00:00
|
|
|
|
theorem elim_type_cglue (Pincl : Π⦃i : I⦄ (x : A i), Type)
|
2015-04-19 21:56:24 +00:00
|
|
|
|
(Pglue : Π(j : J) (x : A (dom j)), Pincl (f j x) ≃ Pincl x)
|
2015-04-27 21:34:55 +00:00
|
|
|
|
{j : J} (x : A (dom j)) : transport (elim_type Pincl Pglue) (cglue j x) = Pglue j x :=
|
|
|
|
|
by rewrite [tr_eq_cast_ap_fn,↑elim_type,elim_cglue];apply cast_ua_fn
|
2015-04-19 21:56:24 +00:00
|
|
|
|
|
2015-11-20 22:47:11 +00:00
|
|
|
|
protected definition rec_hprop {P : colimit → Type} [H : Πx, is_hprop (P x)]
|
|
|
|
|
(Pincl : Π⦃i : I⦄ (x : A i), P (ι x)) (y : colimit) : P y :=
|
|
|
|
|
rec Pincl (λa b, !is_hprop.elimo) y
|
|
|
|
|
|
|
|
|
|
protected definition elim_hprop {P : Type} [H : is_hprop P] (Pincl : Π⦃i : I⦄ (x : A i), P)
|
|
|
|
|
(y : colimit) : P :=
|
|
|
|
|
elim Pincl (λa b, !is_hprop.elim) y
|
|
|
|
|
|
2015-04-11 00:33:33 +00:00
|
|
|
|
end
|
2015-04-07 01:01:08 +00:00
|
|
|
|
end colimit
|
|
|
|
|
|
|
|
|
|
/- definition of a sequential colimit -/
|
2015-04-11 00:33:33 +00:00
|
|
|
|
namespace seq_colim
|
2015-04-23 22:27:56 +00:00
|
|
|
|
section
|
2015-04-28 01:30:20 +00:00
|
|
|
|
/-
|
2015-06-04 19:57:00 +00:00
|
|
|
|
we define it directly in terms of quotients. An alternative definition could be
|
2015-07-29 12:17:16 +00:00
|
|
|
|
definition seq_colim := colimit.colimit A id succ f
|
2015-04-28 01:30:20 +00:00
|
|
|
|
-/
|
2015-04-07 01:01:08 +00:00
|
|
|
|
parameters {A : ℕ → Type} (f : Π⦃n⦄, A n → A (succ n))
|
|
|
|
|
variables {n : ℕ} (a : A n)
|
|
|
|
|
|
2015-04-11 00:33:33 +00:00
|
|
|
|
local abbreviation B := Σ(n : ℕ), A n
|
|
|
|
|
inductive seq_rel : B → B → Type :=
|
|
|
|
|
| Rmk : Π{n : ℕ} (a : A n), seq_rel ⟨succ n, f a⟩ ⟨n, a⟩
|
|
|
|
|
open seq_rel
|
|
|
|
|
local abbreviation R := seq_rel
|
2015-04-07 01:01:08 +00:00
|
|
|
|
|
|
|
|
|
-- TODO: define this in root namespace
|
2015-04-11 00:33:33 +00:00
|
|
|
|
definition seq_colim : Type :=
|
2015-06-04 19:57:00 +00:00
|
|
|
|
quotient seq_rel
|
2015-04-07 01:01:08 +00:00
|
|
|
|
|
2015-04-11 00:33:33 +00:00
|
|
|
|
definition inclusion : seq_colim :=
|
|
|
|
|
class_of R ⟨n, a⟩
|
2015-04-07 01:01:08 +00:00
|
|
|
|
|
|
|
|
|
abbreviation sι := @inclusion
|
|
|
|
|
|
|
|
|
|
definition glue : sι (f a) = sι a :=
|
2015-04-27 21:34:55 +00:00
|
|
|
|
eq_of_rel seq_rel (Rmk f a)
|
2015-04-07 01:01:08 +00:00
|
|
|
|
|
2015-04-27 21:34:55 +00:00
|
|
|
|
protected definition rec {P : seq_colim → Type}
|
2015-04-07 01:01:08 +00:00
|
|
|
|
(Pincl : Π⦃n : ℕ⦄ (a : A n), P (sι a))
|
2015-05-22 08:35:38 +00:00
|
|
|
|
(Pglue : Π(n : ℕ) (a : A n), Pincl (f a) =[glue a] Pincl a) (aa : seq_colim) : P aa :=
|
2015-04-11 00:33:33 +00:00
|
|
|
|
begin
|
2015-06-04 19:57:00 +00:00
|
|
|
|
fapply (quotient.rec_on aa),
|
2015-04-11 00:33:33 +00:00
|
|
|
|
{ intro a, cases a, apply Pincl},
|
2015-04-30 18:00:39 +00:00
|
|
|
|
{ intro a a' H, cases H, apply Pglue}
|
2015-04-11 00:33:33 +00:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
protected definition rec_on [reducible] {P : seq_colim → Type} (aa : seq_colim)
|
2015-04-07 01:01:08 +00:00
|
|
|
|
(Pincl : Π⦃n : ℕ⦄ (a : A n), P (sι a))
|
2015-05-22 08:35:38 +00:00
|
|
|
|
(Pglue : Π⦃n : ℕ⦄ (a : A n), Pincl (f a) =[glue a] Pincl a)
|
2015-04-07 01:01:08 +00:00
|
|
|
|
: P aa :=
|
|
|
|
|
rec Pincl Pglue aa
|
|
|
|
|
|
2015-04-27 21:34:55 +00:00
|
|
|
|
theorem rec_glue {P : seq_colim → Type} (Pincl : Π⦃n : ℕ⦄ (a : A n), P (sι a))
|
2015-05-22 08:35:38 +00:00
|
|
|
|
(Pglue : Π⦃n : ℕ⦄ (a : A n), Pincl (f a) =[glue a] Pincl a) {n : ℕ} (a : A n)
|
|
|
|
|
: apdo (rec Pincl Pglue) (glue a) = Pglue a :=
|
2015-04-28 01:30:20 +00:00
|
|
|
|
!rec_eq_of_rel
|
2015-04-27 21:34:55 +00:00
|
|
|
|
|
2015-04-07 01:01:08 +00:00
|
|
|
|
protected definition elim {P : Type} (Pincl : Π⦃n : ℕ⦄ (a : A n), P)
|
2015-04-11 00:33:33 +00:00
|
|
|
|
(Pglue : Π⦃n : ℕ⦄ (a : A n), Pincl (f a) = Pincl a) : seq_colim → P :=
|
2015-05-22 08:35:38 +00:00
|
|
|
|
rec Pincl (λn a, pathover_of_eq (Pglue a))
|
2015-04-07 01:01:08 +00:00
|
|
|
|
|
2015-04-11 00:33:33 +00:00
|
|
|
|
protected definition elim_on [reducible] {P : Type} (aa : seq_colim)
|
2015-04-07 01:01:08 +00:00
|
|
|
|
(Pincl : Π⦃n : ℕ⦄ (a : A n), P)
|
|
|
|
|
(Pglue : Π⦃n : ℕ⦄ (a : A n), Pincl (f a) = Pincl a) : P :=
|
|
|
|
|
elim Pincl Pglue aa
|
|
|
|
|
|
2015-04-27 21:34:55 +00:00
|
|
|
|
theorem elim_glue {P : Type} (Pincl : Π⦃n : ℕ⦄ (a : A n), P)
|
2015-04-07 01:01:08 +00:00
|
|
|
|
(Pglue : Π⦃n : ℕ⦄ (a : A n), Pincl (f a) = Pincl a) {n : ℕ} (a : A n)
|
2015-04-27 21:34:55 +00:00
|
|
|
|
: ap (elim Pincl Pglue) (glue a) = Pglue a :=
|
|
|
|
|
begin
|
2015-05-22 08:35:38 +00:00
|
|
|
|
apply eq_of_fn_eq_fn_inv !(pathover_constant (glue a)),
|
|
|
|
|
rewrite [▸*,-apdo_eq_pathover_of_eq_ap,↑elim,rec_glue],
|
2015-04-27 21:34:55 +00:00
|
|
|
|
end
|
2015-04-07 01:01:08 +00:00
|
|
|
|
|
2015-04-19 21:56:24 +00:00
|
|
|
|
protected definition elim_type (Pincl : Π⦃n : ℕ⦄ (a : A n), Type)
|
|
|
|
|
(Pglue : Π⦃n : ℕ⦄ (a : A n), Pincl (f a) ≃ Pincl a) : seq_colim → Type :=
|
|
|
|
|
elim Pincl (λn a, ua (Pglue a))
|
|
|
|
|
|
|
|
|
|
protected definition elim_type_on [reducible] (aa : seq_colim)
|
|
|
|
|
(Pincl : Π⦃n : ℕ⦄ (a : A n), Type)
|
|
|
|
|
(Pglue : Π⦃n : ℕ⦄ (a : A n), Pincl (f a) ≃ Pincl a) : Type :=
|
|
|
|
|
elim_type Pincl Pglue aa
|
|
|
|
|
|
2015-04-27 21:34:55 +00:00
|
|
|
|
theorem elim_type_glue (Pincl : Π⦃n : ℕ⦄ (a : A n), Type)
|
2015-04-19 21:56:24 +00:00
|
|
|
|
(Pglue : Π⦃n : ℕ⦄ (a : A n), Pincl (f a) ≃ Pincl a) {n : ℕ} (a : A n)
|
2015-04-27 21:34:55 +00:00
|
|
|
|
: transport (elim_type Pincl Pglue) (glue a) = Pglue a :=
|
|
|
|
|
by rewrite [tr_eq_cast_ap_fn,↑elim_type,elim_glue];apply cast_ua_fn
|
2015-04-19 21:56:24 +00:00
|
|
|
|
|
2015-11-20 22:47:11 +00:00
|
|
|
|
protected definition rec_hprop {P : seq_colim → Type} [H : Πx, is_hprop (P x)]
|
|
|
|
|
(Pincl : Π⦃n : ℕ⦄ (a : A n), P (sι a)) (aa : seq_colim) : P aa :=
|
|
|
|
|
rec Pincl (λa b, !is_hprop.elimo) aa
|
|
|
|
|
|
|
|
|
|
protected definition elim_hprop {P : Type} [H : is_hprop P] (Pincl : Π⦃n : ℕ⦄ (a : A n), P)
|
|
|
|
|
: seq_colim → P :=
|
|
|
|
|
elim Pincl (λa b, !is_hprop.elim)
|
|
|
|
|
|
|
|
|
|
|
2015-04-07 01:01:08 +00:00
|
|
|
|
end
|
2015-04-11 00:33:33 +00:00
|
|
|
|
end seq_colim
|
2015-05-07 20:35:14 +00:00
|
|
|
|
|
|
|
|
|
attribute colimit.incl seq_colim.inclusion [constructor]
|
2015-07-07 23:37:06 +00:00
|
|
|
|
attribute colimit.rec colimit.elim [unfold 10] [recursor 10]
|
|
|
|
|
attribute colimit.elim_type [unfold 9]
|
|
|
|
|
attribute colimit.rec_on colimit.elim_on [unfold 8]
|
|
|
|
|
attribute colimit.elim_type_on [unfold 7]
|
|
|
|
|
attribute seq_colim.rec seq_colim.elim [unfold 6] [recursor 6]
|
|
|
|
|
attribute seq_colim.elim_type [unfold 5]
|
|
|
|
|
attribute seq_colim.rec_on seq_colim.elim_on [unfold 4]
|
|
|
|
|
attribute seq_colim.elim_type_on [unfold 3]
|