From: Anders Mörtberg Date: Tue, 14 Nov 2017 21:13:16 +0000 (-0500) Subject: unfolded version of propIsEquivDirect X-Git-Url: https://git.ak3n.com/?a=commitdiff_plain;h=6b26f79f71969a3b54c2eaf4a876eabd2c527c38;p=cubicaltt.git unfolded version of propIsEquivDirect --- diff --git a/examples/equiv.ctt b/examples/equiv.ctt index d4877eb..81d063f 100644 --- a/examples/equiv.ctt +++ b/examples/equiv.ctt @@ -37,6 +37,52 @@ propIsEquivDirect (A B : U) (f : A -> B) : prop (isEquiv A B f) = , (j = 1) -> w ] in sq @ i) +-- Unfolded version of propIsEquiv with the same normal form as propIsEquivDirect: +propIsEquivDirect' (A B : U) (f : A -> B) : prop (isEquiv A B f) = + \(p q : isEquiv A B f) -> + \(y : B) -> + let p0 : A = (p y).1.1 + p1 : Path B y (f p0) = (p y).1.2 + p2 : (w1 : fiber A B f y) -> Path (fiber A B f y) (p0,p1) w1 = (p y).2 + q0 : A = (q y).1.1 + q1 : Path B y (f q0) = (q y).1.2 + q2 : (w1 : fiber A B f y) -> Path (fiber A B f y) (q0,q1) w1 = (q y).2 + alpha : Path (fiber A B f y) (p0,p1) (q0,q1) = p2 (q0,q1) + in (alpha @ i, + \(w : fiber A B f y) -> + let x : A = w.1 + wx : Path B y (f x) = w.2 + alpha1 : Path A p0 q0 = (alpha @ i).1 + alpha2 : PathP ( Path B y (f (alpha1 @ i))) p1 q1 = + (alpha @ i).2 + p2w1 : Path A p0 x = (p2 w @ i).1 + q2w1 : Path A q0 x = (q2 w @ i).1 + p2w2 : PathP ( Path B y (f (p2w1 @ i))) p1 wx = (p2 w @ i).2 + q2w2 : PathP ( Path B y (f (q2w1 @ i))) q1 wx = (q2 w @ i).2 + sq1 : PathP ( Path A (alpha1 @ j) x) p2w1 q2w1 = + comp (<_> A) (p2w1 @ i \/ j) + [ (i = 0) -> p2w1 @ j + , (i = 1) -> q2w1 @ j \/ -k + , (j = 0) -> (p2 (q2 w @ -k) @ i).1 + , (j = 1) -> x ] + + -- The l=0 face is f applied to the fill version of sq1, maybe + -- compute the filler separately? + sq2 : PathP ( PathP ( Path B y (f (sq1 @ i @ j))) + (alpha2 @ i) wx) + p2w2 q2w2 = + comp (<_> B) (p2w2 @ i \/ j @ l) + [ (i = 0) -> p2w2 @ j @ l + , (i = 1) -> q2w2 @ j \/ -k @ l + , (j = 0) -> (p2 (q2 w @ -k) @ i).2 @ l + , (j = 1) -> wx @ l + , (l = 0) -> y + , (l = 1) -> f (fill (<_> A) (p2w1 @ i \/ j) + [ (i = 0) -> p2w1 @ j + , (i = 1) -> q2w1 @ j \/ -k + , (j = 0) -> (p2 (q2 w @ -k) @ i).1 + , (j = 1) -> x ] @ k) ] + in (sq1 @ i @ j,sq2 @ i @ j)) equivLemma (A B : U) : (v w : equiv A B) -> Path (A -> B) v.1 w.1 -> Path (equiv A B) v w