Move lemma to equivalence-module

This commit is contained in:
Frederik Hanghøj Iversen 2018-04-11 12:27:33 +02:00
parent db5fb3603a
commit c23c2716a5
4 changed files with 75 additions and 87 deletions

View file

@ -106,59 +106,6 @@ module _ ( : Level) where
iso : (p q) (fst p fst q) iso : (p q) (fst p fst q)
iso = f , g , inv iso = f , g , inv
lem3 : {c} {Q : A Set (c b)}
((a : A) P a Q a) Σ A P Σ A Q
lem3 {Q = Q} eA = res
where
f : Σ A P Σ A Q
f (a , pA) = a , fst (eA a) pA
g : Σ A Q Σ A P
g (a , qA) = a , g' qA
where
k : TypeIsomorphism _
k = toIso _ _ (snd (eA a))
open Σ k renaming (fst to g')
ve-re : (x : Σ A P) (g f) x x
ve-re x i = fst x , eq i
where
eq : snd ((g f) x) snd x
eq = begin
snd ((g f) x) ≡⟨⟩
snd (g (f (a , pA))) ≡⟨⟩
g' (fst (eA a) pA) ≡⟨ lem
pA
where
open Σ x renaming (fst to a ; snd to pA)
k : TypeIsomorphism _
k = toIso _ _ (snd (eA a))
open Σ k renaming (fst to g' ; snd to inv)
module A = AreInverses inv
-- anti-funExt
lem : (g' (fst (eA a))) pA pA
lem i = A.verso-recto i pA
re-ve : (x : Σ A Q) (f g) x x
re-ve x i = fst x , eq i
where
open Σ x renaming (fst to a ; snd to qA)
eq = begin
snd ((f g) x) ≡⟨⟩
fst (eA a) (g' qA) ≡⟨ (λ i A.recto-verso i qA)
qA
where
k : TypeIsomorphism _
k = toIso _ _ (snd (eA a))
open Σ k renaming (fst to g' ; snd to inv)
module A = AreInverses inv
inv : AreInverses f g
inv = record
{ verso-recto = funExt ve-re
; recto-verso = funExt re-ve
}
iso : Σ A P Σ A Q
iso = f , g , inv
res : Σ A P Σ A Q
res = fromIsomorphism _ _ iso
module _ {a b : Level} {A : Set a} {B : Set b} where module _ {a b : Level} {A : Set a} {B : Set b} where
lem4 : isSet A isSet B (f : A B) lem4 : isSet A isSet B (f : A B)
isEquiv A B f isIso f isEquiv A B f isIso f
@ -186,7 +133,7 @@ module _ ( : Level) where
-- lem3 and the equivalence from lem4 -- lem3 and the equivalence from lem4
step0 : Σ (A B) isIso Σ (A B) (isEquiv A B) step0 : Σ (A B) isIso Σ (A B) (isEquiv A B)
step0 = lem3 {c = lzero} (λ f sym≃ (lem4 sA sB f)) step0 = equivSig (λ f sym≃ (lem4 sA sB f))
-- univalence -- univalence
step1 : Σ (A B) (isEquiv A B) (A B) step1 : Σ (A B) (isEquiv A B) (A B)
@ -219,7 +166,7 @@ module _ ( : Level) where
open Σ hA renaming (fst to A) open Σ hA renaming (fst to A)
eq1 : (Σ[ hB Object ] hA hB) (Σ[ hB Object ] hA hB) eq1 : (Σ[ hB Object ] hA hB) (Σ[ hB Object ] hA hB)
eq1 = ua (lem3 (\ hB univ≃)) eq1 = ua (equivSig (\ hB univ≃))
univalent[Contr] : isContr (Σ[ hB Object ] hA hB) univalent[Contr] : isContr (Σ[ hB Object ] hA hB)
univalent[Contr] = subst {P = isContr} (sym eq1) tres univalent[Contr] = subst {P = isContr} (sym eq1) tres

View file

@ -147,8 +147,11 @@ record RawCategory (a b : Level) : Set (lsuc (a ⊔ b)) where
from[Andrea] = from[Contr] step from[Andrea] = from[Contr] step
where where
module _ (f : Univalent[Andrea]) (A : Object) where module _ (f : Univalent[Andrea]) (A : Object) where
lem : Σ Object (A ≅_) Σ Object (A ≡_)
lem = equivSig {a} {b} {Object} {A ≅_} {_} {A ≡_} (f A)
aux : isContr (Σ[ B Object ] A B) aux : isContr (Σ[ B Object ] A B)
aux = {!!} aux = {!Σ Object (A ≡_)!}
step : isContr (Σ Object (A ≅_)) step : isContr (Σ Object (A ≅_))
step = {!subst {P = isContr} {!!} aux!} step = {!subst {P = isContr} {!!} aux!}

View file

@ -172,32 +172,15 @@ module Try0 {a b : Level} { : Category a b}
open IsPreCategory isPreCat open IsPreCategory isPreCat
univalent : Univalent univalent : Univalent
univalent {(X , xa , xb)} {(Y , ya , yb)} = univalenceFromIsomorphism res univalent {(X , xa , xb)} {(Y , ya , yb)} = {!!}
where
open import Cat.Equivalence using (composeIso) renaming (_≅_ to _≈_)
-- open import Relation.Binary.PreorderReasoning (Cat.Equivalence.preorder≅ {!!}) using ()
-- renaming
-- ( _⟨_⟩_ to _≈⟨_⟩_
-- ; begin_ to begin!_
-- ; _∎ to _∎! )
-- lawl
-- : ((X , xa , xb) (Y , ya , yb))
-- ≈ (Σ[ iso ∈ (X .≅ Y) ] let p = .isoToId iso in (PathP (λ i → .Arrow (p i) A) xa ya) × (PathP (λ i → .Arrow (p i) B) xb yb))
-- lawl = {!begin! ? ≈⟨ ? ⟩ ? ∎!!}
-- Problem with the above approach: Preorders only work for heterogeneous equaluties.
-- (X , xa , xb) ≡ (Y , ya , yb) -- module _ {(X , xa , xb) : Object} {(Y , ya , yb) : Object} where
-- ≅ module _ (𝕏 𝕐 : Object) where
-- Σ[ p ∈ (X ≡ Y) ] (PathP (λ i → .Arrow (p i) A) xa ya) × (PathP (λ i → .Arrow (p i) B) xb yb) open Σ 𝕏 renaming (fst to X ; snd to x)
-- ≅ open Σ x renaming (fst to xa ; snd to xb)
-- Σ (X .≅ Y) (λ iso open Σ 𝕐 renaming (fst to Y ; snd to y)
-- → let p = .isoToId iso open Σ y renaming (fst to ya ; snd to yb)
-- in open import Cat.Equivalence using (composeIso) renaming (_≅_ to _≈_)
-- ( PathP (λ i → .Arrow (p i) A) xa ya)
-- × PathP (λ i → .Arrow (p i) B) xb yb
-- )
-- ≅
-- (X , xa , xb) ≅ (Y , ya , yb)
step0 step0
: ((X , xa , xb) (Y , ya , yb)) : ((X , xa , xb) (Y , ya , yb))
(Σ[ p (X Y) ] (PathP (λ i .Arrow (p i) A) xa ya) × (PathP (λ i .Arrow (p i) B) xb yb)) (Σ[ p (X Y) ] (PathP (λ i .Arrow (p i) A) xa ya) × (PathP (λ i .Arrow (p i) B) xb yb))
@ -287,7 +270,7 @@ module Try0 {a b : Level} { : Category a b}
let let
iso : X .≅ Y iso : X .≅ Y
iso = fst f , fst f~ , cong fst inv-f , cong fst inv-f~ iso = fst f , fst f~ , cong fst inv-f , cong fst inv-f~
helper : PathP (λ i .Arrow (.isoToId ? i) A) xa ya helper : PathP (λ i .Arrow (.isoToId {!!} i) A) xa ya
helper = {!!} helper = {!!}
in iso , helper , {!!}}) in iso , helper , {!!}})
, record , record
@ -315,12 +298,13 @@ module Try0 {a b : Level} { : Category a b}
: ((X , xa , xb) (Y , ya , yb)) : ((X , xa , xb) (Y , ya , yb))
((X , xa , xb) (Y , ya , yb)) ((X , xa , xb) (Y , ya , yb))
equiv1 = _ , fromIso _ _ (snd iso) equiv1 = _ , fromIso _ _ (snd iso)
equiv4reel
: ((X , xa , xb) (Y , ya , yb))
((X , xa , xb) (Y , ya , yb))
equiv4reel = {!!}
res : TypeIsomorphism (idToIso (X , xa , xb) (Y , ya , yb)) univalent' : Univalent
res = {!snd equiv1!} univalent' = from[Andrea] equiv4reel
univalent2 : X Y (X Y) (X Y)
univalent2 = {!!}
isCat : IsCategory raw isCat : IsCategory raw
IsCategory.isPreCategory isCat = isPreCat IsCategory.isPreCategory isCat = isPreCat

View file

@ -445,3 +445,57 @@ module _ {a b : Level} {A : Set a} {B : Set b} where
; recto-verso = funExt ve-re ; recto-verso = funExt ve-re
} }
in fromIsomorphism _ _ iso in fromIsomorphism _ _ iso
module _ {a b : Level} {A : Set a} {P : A Set b} where
equivSig : {c : Level} {Q : A Set c}
((a : A) P a Q a) Σ A P Σ A Q
equivSig {Q = Q} eA = res
where
f : Σ A P Σ A Q
f (a , pA) = a , fst (eA a) pA
g : Σ A Q Σ A P
g (a , qA) = a , g' qA
where
k : Isomorphism _
k = toIso _ _ (snd (eA a))
open Σ k renaming (fst to g')
ve-re : (x : Σ A P) (g f) x x
ve-re x i = fst x , eq i
where
eq : snd ((g f) x) snd x
eq = begin
snd ((g f) x) ≡⟨⟩
snd (g (f (a , pA))) ≡⟨⟩
g' (fst (eA a) pA) ≡⟨ lem
pA
where
open Σ x renaming (fst to a ; snd to pA)
k : Isomorphism _
k = toIso _ _ (snd (eA a))
open Σ k renaming (fst to g' ; snd to inv)
module A = AreInverses inv
-- anti-funExt
lem : (g' (fst (eA a))) pA pA
lem i = A.verso-recto i pA
re-ve : (x : Σ A Q) (f g) x x
re-ve x i = fst x , eq i
where
open Σ x renaming (fst to a ; snd to qA)
eq = begin
snd ((f g) x) ≡⟨⟩
fst (eA a) (g' qA) ≡⟨ (λ i A.recto-verso i qA)
qA
where
k : Isomorphism _
k = toIso _ _ (snd (eA a))
open Σ k renaming (fst to g' ; snd to inv)
module A = AreInverses inv
inv : AreInverses f g
inv = record
{ verso-recto = funExt ve-re
; recto-verso = funExt re-ve
}
iso : Σ A P Σ A Q
iso = f , g , inv
res : Σ A P Σ A Q
res = fromIsomorphism _ _ iso