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

Dependent Composition #144

Merged
merged 43 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
c68b463
experiment
thchatzidiamantis Apr 29, 2024
9e06319
nonsense
thchatzidiamantis Apr 29, 2024
d9a8ee0
hello mr google how do I compose maps
thchatzidiamantis Apr 29, 2024
0b2de2f
hello google how do I compose maps
thchatzidiamantis Apr 29, 2024
1688283
If an infinite number of monkeys type randomly on infinite typewriter…
thchatzidiamantis Apr 29, 2024
e50e3b1
?
thchatzidiamantis May 1, 2024
13c6f0b
fdjahFIJ
thchatzidiamantis May 8, 2024
9bd60f5
dcomp
thchatzidiamantis May 8, 2024
a12e804
Update 08-covariant.rzk.md
thchatzidiamantis May 8, 2024
4eb0fb8
stuff
thchatzidiamantis May 26, 2024
6256e3f
Merge branch 'main' of https://github.com/thchatzidiamantis/sHoTT
thchatzidiamantis May 26, 2024
8d96c09
problem
thchatzidiamantis May 26, 2024
b2de3fa
problem
thchatzidiamantis May 26, 2024
4917e1b
nothing works
thchatzidiamantis May 26, 2024
51ea1e9
approach 3
thchatzidiamantis May 28, 2024
3b771ec
approach 3
thchatzidiamantis May 28, 2024
49aad75
new crash!
thchatzidiamantis May 28, 2024
30115a2
Labeled the crashes
thchatzidiamantis May 28, 2024
d6039a0
more problems
thchatzidiamantis May 29, 2024
c4930c1
crash again
thchatzidiamantis May 29, 2024
0bd1544
something works
thchatzidiamantis Jun 5, 2024
2d67a0b
new crashes dropped
thchatzidiamantis Jun 6, 2024
f4b7a89
modified 06-contractible
thchatzidiamantis Jun 16, 2024
b8888fd
looks better
thchatzidiamantis Jun 16, 2024
56bb0d9
contractible over sum type
thchatzidiamantis Jun 16, 2024
15e947d
formatting
thchatzidiamantis Jun 18, 2024
19b1fef
formatting
thchatzidiamantis Jun 18, 2024
30de393
Merge branch 'Contractible' of https://github.com/thchatzidiamantis/s…
thchatzidiamantis Jun 18, 2024
999e8d8
dependent comp
thchatzidiamantis Jun 19, 2024
ac57b2b
start
thchatzidiamantis Jun 19, 2024
2315266
progress
thchatzidiamantis Jun 19, 2024
fcc98a9
Merge branch 'Contractible' of https://github.com/thchatzidiamantis/s…
thchatzidiamantis Jun 20, 2024
9a2de67
dependent composition?
thchatzidiamantis Jun 20, 2024
80767a8
dcomp
thchatzidiamantis Jun 21, 2024
51a2ffb
Merge branch 'Contractible' of https://github.com/thchatzidiamantis/s…
thchatzidiamantis Jun 21, 2024
b1ccbb4
dcomp
thchatzidiamantis Jun 21, 2024
6dac4ba
Merge branch 'rzk-lang:main' into dcomp
thchatzidiamantis Jun 21, 2024
4c980e1
Update 08-covariant.rzk.md
thchatzidiamantis Jun 21, 2024
a2feb93
added witness and uniqueness
thchatzidiamantis Jun 21, 2024
1c55c8c
Merge branch 'dcomp' of https://github.com/thchatzidiamantis/sHoTT in…
thchatzidiamantis Jun 21, 2024
c45f467
renamings
thchatzidiamantis Jul 12, 2024
07bcfee
improved comments
emilyriehl Jul 14, 2024
32dd953
formatting+settings
thchatzidiamantis Jul 15, 2024
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 .vscode/settings.json
emilyriehl marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,6 @@
"editor.detectIndentation": false,
"editor.insertSpaces": true
},
"rzk.format.enable": true
"rzk.format.enable": true,
"agdaMode.connection.agdaLanguageServer": true
}
268 changes: 250 additions & 18 deletions src/simplicial-hott/08-covariant.rzk.md
emilyriehl marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,256 @@ Segal, then so is `Σ A, C`.
( is-naive-left-fibration-is-covariant A C is-covariant-C))
```

## Dependent composition

We can compose dependent arrows given a covariant type family.

```rzk title="RS17, Remark 8.11"
emilyriehl marked this conversation as resolved.
Show resolved Hide resolved
#def is-contr-ext-is-covariant uses (extext)
emilyriehl marked this conversation as resolved.
Show resolved Hide resolved
( A : U)
( is-segal-A : is-segal A)
( C : A → U)
( is-covariant-C : is-covariant A C)
( a : (t : Λ) → A)
( c : (t : Λ) → C (a t))
: is-contr
( Σ ( f : ((t : Δ²) → A [Λ t ↦ a t]))
, ( ( t : Δ²) → C (f t) [Λ t ↦ c t]))
:=
is-contr-equiv-is-contr
( ( t : Δ²) → (Σ (x : A) , C x) [Λ t ↦ (a t , c t)])
( Σ ( f : ((t : Δ²) → A [Λ t ↦ a t]))
, ( ( t : Δ²) → C (f t) [Λ t ↦ c t]))
( axiom-choice
( 2 × 2)
( Δ²)
( \ t → Λ t)
( \ t → A)
( \ t → \ x → C x)
( a)
( c))
( has-unique-inner-extensions-is-segal
( Σ ( x : A) , C x)
( is-segal-total-type-covariant-family-is-segal-base
A C is-covariant-C is-segal-A)
( \ t → (a t , c t)))

#def equiv-ext-is-segal-base
emilyriehl marked this conversation as resolved.
Show resolved Hide resolved
( A : U)
( is-segal-A : is-segal A)
( C : A → U)
( a : (t : Λ) → A)
( c : (t : Λ) → C (a t))
: Equiv
( Σ ( f : ((t : Δ²) → A [Λ t ↦ a t]))
, ( ( t : Δ²) → C (f t) [Λ t ↦ c t]))
( ( t : Δ²)
→ C (witness-comp-is-segal A is-segal-A (a (0₂ , 0₂)) (a (1₂ , 0₂))
( a (1₂ , 1₂)) (\ s → a (s , 0₂)) (\ s → a (1₂ , s)) t) [Λ t ↦ c t])
:=
transport-equiv-center-fiber-total-type-is-contr-base
( ( t : Δ²) → A [Λ t ↦ a t])
( has-unique-inner-extensions-is-segal A is-segal-A a)
( \ f → ((t : Δ²) → C (f t) [Λ t ↦ c t]))
( witness-comp-is-segal A is-segal-A (a (0₂ , 0₂)) (a (1₂ , 0₂))
( a (1₂ , 1₂)) (\ s → a (s , 0₂)) (\ s → a (1₂ , s)))

#def is-contr-horn-ext-is-covariant uses (extext)
emilyriehl marked this conversation as resolved.
Show resolved Hide resolved
( A : U)
( is-segal-A : is-segal A)
( C : A → U)
( is-covariant-C : is-covariant A C)
( a : (t : Λ) → A)
( c : (t : Λ) → C (a t))
: is-contr
( ( t : Δ²)
→ C (witness-comp-is-segal A is-segal-A (a (0₂ , 0₂)) (a (1₂ , 0₂))
( a (1₂ , 1₂)) (\ s → a (s , 0₂)) (\ s → a (1₂ , s)) t) [Λ t ↦ c t])
:=
is-contr-equiv-is-contr
( Σ ( f : ((t : Δ²) → A [Λ t ↦ a t]))
, ( ( t : Δ²) → C (f t) [Λ t ↦ c t]))
( ( t : Δ²)
→ C (witness-comp-is-segal A is-segal-A (a (0₂ , 0₂)) (a (1₂ , 0₂))
( a (1₂ , 1₂)) (\ s → a (s , 0₂)) (\ s → a (1₂ , s)) t) [Λ t ↦ c t])
( equiv-ext-is-segal-base A is-segal-A C a c)
( is-contr-ext-is-covariant A is-segal-A C is-covariant-C a c)

#def dhorn
( A : U)
( x y z : A)
( f : hom A x y)
( g : hom A y z)
( C : A → U)
( u : C x)
( v : C y)
( w : C z)
( ff : dhom A x y f C u v)
( gg : dhom A y z g C v w)
: ( ( t : Λ) → C (horn A x y z f g t))
:=
\ (t , s) →
recOR
( s ≡ 0₂ ↦ ff t
, t ≡ 1₂ ↦ gg s)

#def compositions-are-dhorn-fillings
emilyriehl marked this conversation as resolved.
Show resolved Hide resolved
( A : U)
( x y z : A)
( f : hom A x y)
( g : hom A y z)
( h : hom A x z)
( α : hom2 A x y z f g h)
( C : A → U)
( u : C x)
( v : C y)
( w : C z)
( ff : dhom A x y f C u v)
( gg : dhom A y z g C v w)
: Equiv
( Σ ( hh : dhom A x z h C u w)
, ( dhom2 A x y z f g h α C u v w ff gg hh))
( ( t : Δ²) → C (α t) [Λ t ↦ dhorn A x y z f g C u v w ff gg t])
:=
( \ (hh , H) t → H t
, ( ( \ k → (\ t → k (t , t) , \ (t , s) → k (t , s))
, \ (hh , H) → refl)
, ( \ k → (\ t → k (t , t) , \ (t , s) → k (t , s))
, \ (hh , H) → refl)))

#def is-contr-ext-dhom-is-covariant uses (extext)
( A : U)
( is-segal-A : is-segal A)
( C : A → U)
( is-covariant-C : is-covariant A C)
( x y z : A)
( f : hom A x y)
( g : hom A y z)
( u : C x)
( v : C y)
( w : C z)
( ff : dhom A x y f C u v)
( gg : dhom A y z g C v w)
: is-contr
( Σ ( hh : dhom A x z (comp-is-segal A is-segal-A x y z f g) C u w)
, dhom2 A x y z f g (comp-is-segal A is-segal-A x y z f g)
( witness-comp-is-segal A is-segal-A x y z f g) C u v w ff gg hh)
:=
is-contr-equiv-is-contr'
( Σ ( hh : dhom A x z (comp-is-segal A is-segal-A x y z f g) C u w)
, dhom2 A x y z f g (comp-is-segal A is-segal-A x y z f g)
( witness-comp-is-segal A is-segal-A x y z f g) C u v w ff gg hh)
( ( t : Δ²) → C ((witness-comp-is-segal A is-segal-A x y z f g) t)
[Λ t ↦ dhorn A x y z f g C u v w ff gg t])
( compositions-are-dhorn-fillings A x y z f g
( comp-is-segal A is-segal-A x y z f g)
( witness-comp-is-segal A is-segal-A x y z f g)
C u v w ff gg)
( is-contr-horn-ext-is-covariant A is-segal-A C is-covariant-C
( horn A x y z f g)
( dhorn A x y z f g C u v w ff gg))

#def dcomp-is-covariant-family-is-segal-base uses (extext)
( A : U)
( is-segal-A : is-segal A)
( C : A → U)
( is-covariant-C : is-covariant A C)
( x y z : A)
( f : hom A x y)
( g : hom A y z)
( u : C x)
( v : C y)
( w : C z)
( ff : dhom A x y f C u v)
( gg : dhom A y z g C v w)
: dhom A x z (comp-is-segal A is-segal-A x y z f g) C u w
:=
( first
( first
( is-contr-ext-dhom-is-covariant
A is-segal-A C is-covariant-C x y z f g u v w ff gg)))

#def witness-dcomp-is-covariant-family-is-segal-base uses (extext)
( A : U)
( is-segal-A : is-segal A)
( C : A → U)
( is-covariant-C : is-covariant A C)
( x y z : A)
( f : hom A x y)
( g : hom A y z)
( u : C x)
( v : C y)
( w : C z)
( ff : dhom A x y f C u v)
( gg : dhom A y z g C v w)
: dhom2 A x y z f g (comp-is-segal A is-segal-A x y z f g)
( witness-comp-is-segal A is-segal-A x y z f g) C u v w ff gg
( dcomp-is-covariant-family-is-segal-base
A is-segal-A C is-covariant-C x y z f g u v w ff gg)
:=
( second
( first
( is-contr-ext-dhom-is-covariant
A is-segal-A C is-covariant-C x y z f g u v w ff gg)))
```

emilyriehl marked this conversation as resolved.
Show resolved Hide resolved
```rzk
#def uniqueness-dcomp-is-covariant-family-is-segal-base uses (extext)
( A : U)
( is-segal-A : is-segal A)
( C : A → U)
( is-covariant-C : is-covariant A C)
( x y z : A)
( f : hom A x y)
( g : hom A y z)
( u : C x)
( v : C y)
( w : C z)
( ff : dhom A x y f C u v)
( gg : dhom A y z g C v w)
( hh : dhom A x z (comp-is-segal A is-segal-A x y z f g) C u w)
( H : dhom2 A x y z f g (comp-is-segal A is-segal-A x y z f g)
( witness-comp-is-segal A is-segal-A x y z f g) C u v w ff gg hh)
: ( dcomp-is-covariant-family-is-segal-base
A is-segal-A C is-covariant-C x y z f g u v w ff gg) = hh
:=
first-path-Σ
( dhom A x z (comp-is-segal A is-segal-A x y z f g) C u w)
( \ hh →
dhom2 A x y z f g (comp-is-segal A is-segal-A x y z f g)
( witness-comp-is-segal A is-segal-A x y z f g) C u v w ff gg hh)
( ( dcomp-is-covariant-family-is-segal-base
A is-segal-A C is-covariant-C x y z f g u v w ff gg)
, ( witness-dcomp-is-covariant-family-is-segal-base
A is-segal-A C is-covariant-C x y z f g u v w ff gg))
( hh , H)
( homotopy-contraction
( ( Σ ( hh : dhom A x z (comp-is-segal A is-segal-A x y z f g) C u w)
, dhom2 A x y z f g (comp-is-segal A is-segal-A x y z f g)
( witness-comp-is-segal A is-segal-A x y z f g) C u v w ff gg hh))
( is-contr-ext-dhom-is-covariant
A is-segal-A C is-covariant-C x y z f g u v w ff gg)
( hh , H))
```

## Covariant lifts, transport, and uniqueness

In a covariant family C over a base type A , a term u : C x may be transported
along an arrow f : hom A x y to give a term in C y.

```rzk title="RS17, covariant transport from beginning of Section 8.2"
#def covariant-transport
( A : U)
( x y : A)
( f : hom A x y)
( C : A → U)
( is-covariant-C : is-covariant A C)
( u : C x)
: C y
:=
first (center-contraction (dhom-from A x y f C u) (is-covariant-C x y f u))
```

## Representable covariant families

If `A` is a Segal type and `a : A` is any term, then `hom A a` defines a
Expand Down Expand Up @@ -1056,24 +1306,6 @@ types as follows.
( representable-dhom-from-cofibration-composition A a x y f u)
```

## Covariant lifts, transport, and uniqueness

In a covariant family C over a base type A , a term u : C x may be transported
along an arrow f : hom A x y to give a term in C y.

```rzk title="RS17, covariant transport from beginning of Section 8.2"
#def covariant-transport
emilyriehl marked this conversation as resolved.
Show resolved Hide resolved
( A : U)
( x y : A)
( f : hom A x y)
( C : A → U)
( is-covariant-C : is-covariant A C)
( u : C x)
: C y
:=
first (center-contraction (dhom-from A x y f C u) (is-covariant-C x y f u))
```

For example, if `A` is a Segal type and `a : A`, the family `C x := hom A a x`
is covariant as shown above. Transport of an `e : C x` along an arrow
`f : hom A x y` just yields composition of `f` with `e`.
Expand Down
Loading