Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve and add a few path operators #746

Merged
merged 4 commits into from
Apr 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Cubical/Categories/Category/Properties.agda
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ module _ {C : Category ℓ ℓ'} where
→ (f : C [ x , y ]) (g : C [ y , z ]) (g' : C [ y' , z ])
→ (r : PathP (λ i → C [ p i , z ]) g g')
→ f ⋆⟨ C ⟩ g ≡ seqP {p = p} f g'
lCatWhiskerP f g g' r = cong (λ v → f ⋆⟨ C ⟩ v) (sym (fromPathP (symP r)))
lCatWhiskerP {z = z} {p = p} f g g' r =
cong (λ v → f ⋆⟨ C ⟩ v) (sym (fromPathP (symP {A = λ i → C [ p (~ i) , z ]} r)))

rCatWhiskerP : {x y' y z : C .ob} {p : y' ≡ y}
→ (f' : C [ x , y' ]) (f : C [ x , y ]) (g : C [ y , z ])
Expand Down
7 changes: 7 additions & 0 deletions Cubical/Foundations/Path.agda
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ cong′ : ∀ {B : Type ℓ'} (f : A → B) {x y : A} (p : x ≡ y)
cong′ f = cong f
{-# INLINE cong′ #-}

module _ {A : I → Type ℓ} {x : A i0} {y : A i1} where
toPathP⁻ : x ≡ transport⁻ (λ i → A i) y → PathP A x y
toPathP⁻ p = symP (toPathP (sym p))

fromPathP⁻ : PathP A x y → x ≡ transport⁻ (λ i → A i) y
fromPathP⁻ p = sym (fromPathP {A = λ i → A (~ i)} (symP p))

PathP≡Path : ∀ (P : I → Type ℓ) (p : P i0) (q : P i1) →
PathP P p q ≡ Path (P i1) (transport (λ i → P i) p) q
PathP≡Path P p q i = PathP (λ j → P (i ∨ j)) (transport-filler (λ j → P j) p i) q
Expand Down
6 changes: 3 additions & 3 deletions Cubical/Foundations/Prelude.agda
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ sym : x ≡ y → y ≡ x
sym p i = p (~ i)
{-# INLINE sym #-}

symP : {A : I → Type ℓ} → {x : A i0} → {y : A i1} →
(p : PathP A x y) → PathP (λ i → A (~ i)) y x
symP : {A : I → Type ℓ} → {x : A i1} → {y : A i0} →
(p : PathP (λ i → A (~ i)) x y) → PathP A y x
symP p j = p (~ j)

cong : (f : (a : A) → B a) (p : x ≡ y) →
Expand Down Expand Up @@ -261,7 +261,7 @@ subst2 : ∀ {ℓ' ℓ''} {B : Type ℓ'} {z w : B} (C : A → B → Type ℓ'')
(p : x ≡ y) (q : z ≡ w) → C x z → C y w
subst2 B p q b = transport (λ i → B (p i) (q i)) b

substRefl : (px : B x) → subst B refl px ≡ px
substRefl : ∀ {B : A → Type ℓ} {x} → (px : B x) → subst B refl px ≡ px
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why add these to the type?

Copy link
Contributor Author

@anuyts anuyts Apr 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I needed to explicitly pass the value for A and somewhere. The type of B defines a name for A and .

substRefl px = transportRefl px

subst-filler : (B : A → Type ℓ') (p : x ≡ y) (b : B x)
Expand Down