Skip to content

Instantly share code, notes, and snippets.

@favonia
Last active October 8, 2018 12:11
Show Gist options
  • Save favonia/d5d40cec11bebaf9f2c4372e2e388b05 to your computer and use it in GitHub Desktop.
Save favonia/d5d40cec11bebaf9f2c4372e2e388b05 to your computer and use it in GitHub Desktop.
A cube with all faces being the same 2-loop.
import path
let cube/2loop
(A : type) (a : A)
(sq : [i j] A [∂[i j] → a])
: [i j k] A [
| ∂[i] → sq j k
| ∂[j] → sq i k
| ∂[k] → sq i j
]
=
λ i j k →
let face0 (x m : dim) : A =
comp 0 x a [∂[k] | m=0 → refl | m=1 x → sq x k]
in
let face1 (x m : dim) : A =
comp 1 x a [∂[k] | m=0 → refl | m=1 x → sq x k]
in
comp 0 1 (sq i j) [
| i=0 → face1 j
| j=1 → face0 i
| j=0 → face1 i
| i=1 → face0 j
| ∂[k] → refl
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment