-
Notifications
You must be signed in to change notification settings - Fork 1
/
Path.agda
63 lines (53 loc) · 1.36 KB
/
Path.agda
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{-# OPTIONS --cubical --safe #-}
module Path where
open import Cubical.Foundations.Everything
using ( _≡_
; sym
; refl
; subst
; transport
; Path
; PathP
; I
; i0
; i1
; funExt
; cong
; toPathP
; cong₂
; ~_
; _∧_
; _∨_
; hcomp
; transp
; J
)
renaming
( congS to cong′
; _∙_ to _;_
; subst2 to subst₂)
public
open import Data.Empty using (¬_)
open import Level
infix 4 _≢_
_≢_ : {A : Type a} → A → A → Type a
x ≢ y = ¬ (x ≡ y)
infix 4 PathP-syntax
PathP-syntax = PathP
{-# DISPLAY PathP-syntax = PathP #-}
syntax PathP-syntax (λ i → Ty) lhs rhs = lhs ≡[ i ≔ Ty ]≡ rhs
import Agda.Builtin.Equality as MLTT
builtin-eq-to-path : {A : Type a} {x y : A} → x MLTT.≡ y → x ≡ y
builtin-eq-to-path {x = x} MLTT.refl i = x
path-to-builtin-eq : {A : Type a} {x y : A} → x ≡ y → x MLTT.≡ y
path-to-builtin-eq {x = x} x≡y = subst (x MLTT.≡_) x≡y MLTT.refl
cong₃ : ∀ {d} {D : Type d}
→ (f : A → B → C → D)
→ {x x′ : A}
→ {y y′ : B}
→ {z z′ : C}
→ x ≡ x′
→ y ≡ y′
→ z ≡ z′
→ f x y z ≡ f x′ y′ z′
cong₃ f x y z = cong₂ (λ f x → f x) (cong₂ f x y) z