-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
836 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{-# OPTIONS --without-K --rewriting #-} | ||
|
||
open import lib.Basics | ||
open import lib.types.Pi | ||
|
||
module lib.types.Cospan where | ||
|
||
record Cospan {i j k : ULevel} : Type (lsucc (lmax (lmax i j) k)) where | ||
constructor cospan | ||
field | ||
A : Type i | ||
B : Type j | ||
C : Type k | ||
f : A → C | ||
g : B → C | ||
|
||
record ⊙Cospan {i j k : ULevel} : Type (lsucc (lmax (lmax i j) k)) where | ||
constructor ⊙cospan | ||
field | ||
X : Ptd i | ||
Y : Ptd j | ||
Z : Ptd k | ||
f : X ⊙→ Z | ||
g : Y ⊙→ Z | ||
|
||
⊙cospan-out : ∀ {i j k} → ⊙Cospan {i} {j} {k} → Cospan {i} {j} {k} | ||
⊙cospan-out (⊙cospan X Y Z f g) = | ||
cospan (de⊙ X) (de⊙ Y) (de⊙ Z) (fst f) (fst g) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
{-# OPTIONS --without-K --rewriting --overlapping-instances #-} | ||
|
||
open import lib.Basics | ||
open import lib.NType | ||
open import lib.types.Cospan | ||
open import lib.types.Pointed | ||
open import lib.types.Sigma | ||
|
||
module lib.types.Pullback where | ||
|
||
module _ {i j k} (D : Cospan {i} {j} {k}) where | ||
|
||
open Cospan D | ||
|
||
record Pullback : Type (lmax i (lmax j k)) where | ||
constructor pullback | ||
field | ||
a : A | ||
b : B | ||
h : f a == g b | ||
|
||
pullback= : {a a' : A} (p : a == a') {b b' : B} (q : b == b') | ||
{h : f a == g b} {h' : f a' == g b'} (r : h ∙ ap g q == ap f p ∙ h') | ||
→ pullback a b h == pullback a' b' h' | ||
pullback= idp idp r = | ||
ap (pullback _ _) (! (∙-unit-r _) ∙ r) | ||
|
||
pullback-aβ : {a a' : A} (p : a == a') {b b' : B} (q : b == b') | ||
{h : f a == g b} {h' : f a' == g b'} (r : h ∙ ap g q == ap f p ∙ h') | ||
→ ap Pullback.a (pullback= p q {h = h} {h' = h'} r) == p | ||
pullback-aβ idp idp r = | ||
ap Pullback.a (ap (pullback _ _) (! (∙-unit-r _) ∙ r)) | ||
=⟨ ∘-ap Pullback.a (pullback _ _) _ ⟩ | ||
ap (λ _ → _) (! (∙-unit-r _) ∙ r) | ||
=⟨ ap-cst _ _ ⟩ | ||
idp =∎ | ||
|
||
pullback-bβ : {a a' : A} (p : a == a') {b b' : B} (q : b == b') | ||
{h : f a == g b} {h' : f a' == g b'} (r : h ∙ ap g q == ap f p ∙ h') | ||
→ ap Pullback.b (pullback= p q {h = h} {h' = h'} r) == q | ||
pullback-bβ idp idp r = | ||
ap Pullback.b (ap (pullback _ _) (! (∙-unit-r _) ∙ r)) | ||
=⟨ ∘-ap Pullback.b (pullback _ _) _ ⟩ | ||
ap (λ _ → _) (! (∙-unit-r _) ∙ r) | ||
=⟨ ap-cst _ _ ⟩ | ||
idp =∎ | ||
|
||
module _ {i j k} (D : ⊙Cospan {i} {j} {k}) where | ||
|
||
⊙Pullback : Ptd (lmax i (lmax j k)) | ||
⊙Pullback = | ||
⊙[ Pullback (⊙cospan-out D) , | ||
pullback (pt X) (pt Y) (snd f ∙ ! (snd g)) ] | ||
where open ⊙Cospan D | ||
|
||
module _ {i j k} (D : Cospan {i} {j} {k}) where | ||
open Cospan D | ||
|
||
pullback-decomp-equiv : Pullback D ≃ Σ (A × B) (λ {(a , b) → f a == g b}) | ||
pullback-decomp-equiv = equiv | ||
(λ {(pullback a b h) → ((a , b) , h)}) | ||
(λ {((a , b) , h) → pullback a b h}) | ||
(λ _ → idp) | ||
(λ _ → idp) | ||
|
||
module _ {i j k} (n : ℕ₋₂) {D : Cospan {i} {j} {k}} where | ||
open Cospan D | ||
|
||
pullback-level : has-level n A → has-level n B → has-level n C | ||
→ has-level n (Pullback D) | ||
pullback-level pA pB pC = | ||
equiv-preserves-level ((pullback-decomp-equiv D)⁻¹) where instance _ = pA; _ = pB; _ = pC | ||
|
||
instance | ||
pullback-level-instance : {i j k : ULevel} {n : ℕ₋₂} {D : Cospan {i} {j} {k}} → | ||
{{has-level n (Cospan.A D)}} → {{has-level n (Cospan.B D)}} → {{has-level n (Cospan.C D)}} | ||
→ has-level n (Pullback D) | ||
pullback-level-instance {n = n} {{pA}} {{pB}} {{pC}} = pullback-level n pA pB pC |
Oops, something went wrong.