Rename variable

This commit is contained in:
Frederik Hanghøj Iversen 2018-04-25 08:19:36 +02:00
parent 129eef1150
commit 6b6e6672e0

View file

@ -87,18 +87,18 @@ module _ {a b : Level} { : Category a b} {A B : Category.Object
q = lemPropF propIsProduct p q = lemPropF propIsProduct p
module Try0 {a b : Level} { : Category a b} module Try0 {a b : Level} { : Category a b}
(let module = Category ) {A B : .Object} where (let module = Category ) {𝓐 𝓑 : .Object} where
open P open P
module _ where module _ where
raw : RawCategory _ _ raw : RawCategory _ _
raw = record raw = record
{ Object = Σ[ X .Object ] .Arrow X A × .Arrow X B { Object = Σ[ X .Object ] .Arrow X 𝓐 × .Arrow X 𝓑
; Arrow = λ{ (X , x0 , x1) (Y , y0 , y1) ; Arrow = λ{ (A , a0 , a1) (B , b0 , b1)
Σ[ f .Arrow X Y ] Σ[ f .Arrow A B ]
[ y0 f ] x0 [ b0 f ] a0
× [ y1 f ] x1 × [ b1 f ] a1
} }
; identity = λ{ {X , f , g} .identity {X} , .rightIdentity , .rightIdentity} ; identity = λ{ {X , f , g} .identity {X} , .rightIdentity , .rightIdentity}
; _<<<_ = λ { {_ , a0 , a1} {_ , b0 , b1} {_ , c0 , c1} (f , f0 , f1) (g , g0 , g1) ; _<<<_ = λ { {_ , a0 , a1} {_ , b0 , b1} {_ , c0 , c1} (f , f0 , f1) (g , g0 , g1)
@ -176,7 +176,7 @@ module Try0 {a b : Level} { : Category a b}
open import Cat.Equivalence using (composeIso) renaming (_≅_ to _≅_) open import Cat.Equivalence using (composeIso) renaming (_≅_ to _≅_)
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) 𝓐) xa ya) × (PathP (λ i .Arrow (p i) 𝓑) xb yb))
step0 step0
= (λ p cong fst p , cong-d (fst snd) p , cong-d (snd snd) p) = (λ p cong fst p , cong-d (fst snd) p , cong-d (snd snd) p)
-- , (λ x → λ i → fst x i , (fst (snd x) i) , (snd (snd x) i)) -- , (λ x → λ i → fst x i , (fst (snd x) i) , (snd (snd x) i))
@ -203,12 +203,12 @@ module Try0 {a b : Level} { : Category a b}
p p
step1 step1
: (Σ[ 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) 𝓐) xa ya) × (PathP (λ i .Arrow (p i) 𝓑) xb yb))
Σ (X .≊ Y) (λ iso Σ (X .≊ Y) (λ iso
let p = .isoToId iso let p = .isoToId iso
in in
( PathP (λ i .Arrow (p i) A) xa ya) ( PathP (λ i .Arrow (p i) 𝓐) xa ya)
× PathP (λ i .Arrow (p i) B) xb yb × PathP (λ i .Arrow (p i) 𝓑) xb yb
) )
step1 step1
= symIso = symIso
@ -216,7 +216,7 @@ module Try0 {a b : Level} { : Category a b}
{A = (X .≊ Y)} {A = (X .≊ Y)}
{B = (X Y)} {B = (X Y)}
(.groupoidObject _ _) (.groupoidObject _ _)
{Q = \ p (PathP (λ i .Arrow (p i) A) xa ya) × (PathP (λ i .Arrow (p i) B) xb yb)} {Q = \ p (PathP (λ i .Arrow (p i) 𝓐) xa ya) × (PathP (λ i .Arrow (p i) 𝓑) xb yb)}
.isoToId .isoToId
(symIso (_ , .asTypeIso {X} {Y}) .snd) (symIso (_ , .asTypeIso {X} {Y}) .snd)
) )
@ -225,8 +225,8 @@ module Try0 {a b : Level} { : Category a b}
: Σ (X .≊ Y) (λ iso : Σ (X .≊ Y) (λ iso
let p = .isoToId iso let p = .isoToId iso
in in
( PathP (λ i .Arrow (p i) A) xa ya) ( PathP (λ i .Arrow (p i) 𝓐) xa ya)
× PathP (λ i .Arrow (p i) B) xb yb × PathP (λ i .Arrow (p i) 𝓑) xb yb
) )
((X , xa , xb) (Y , ya , yb)) ((X , xa , xb) (Y , ya , yb))
step2 step2
@ -243,10 +243,10 @@ module Try0 {a b : Level} { : Category a b}
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~
p : X Y p : X Y
p = .isoToId iso p = .isoToId iso
pA : .Arrow X A .Arrow Y A pA : .Arrow X 𝓐 .Arrow Y 𝓐
pA = cong (λ x .Arrow x A) p pA = cong (λ x .Arrow x 𝓐) p
pB : .Arrow X B .Arrow Y B pB : .Arrow X 𝓑 .Arrow Y 𝓑
pB = cong (λ x .Arrow x B) p pB = cong (λ x .Arrow x 𝓑) p
k0 = begin k0 = begin
coe pB xb ≡⟨ .coe-dom iso coe pB xb ≡⟨ .coe-dom iso
xb .<<< fst f~ ≡⟨ snd (snd f~) xb .<<< fst f~ ≡⟨ snd (snd f~)
@ -264,10 +264,10 @@ module Try0 {a b : Level} { : Category a b}
(Σ≡ refl (.propIsomorphism _ _ _))) (Σ≡ refl (.propIsomorphism _ _ _)))
, funExt (λ{ (f , _) lemSig propIsomorphism _ _ (Σ≡ refl (propEqs _ _ _))}) , funExt (λ{ (f , _) lemSig propIsomorphism _ _ (Σ≡ refl (propEqs _ _ _))})
where where
prop0 : {x} isProp (PathP (λ i .Arrow (.isoToId x i) A) xa ya) prop0 : {x} isProp (PathP (λ i .Arrow (.isoToId x i) 𝓐) xa ya)
prop0 {x} = pathJ (λ y p x isProp (PathP (λ i .Arrow (p i) A) xa x)) (λ x .arrowsAreSets _ _) Y (.isoToId x) ya prop0 {x} = pathJ (λ y p x isProp (PathP (λ i .Arrow (p i) 𝓐) xa x)) (λ x .arrowsAreSets _ _) Y (.isoToId x) ya
prop1 : {x} isProp (PathP (λ i .Arrow (.isoToId x i) B) xb yb) prop1 : {x} isProp (PathP (λ i .Arrow (.isoToId x i) 𝓑) xb yb)
prop1 {x} = pathJ (λ y p x isProp (PathP (λ i .Arrow (p i) B) xb x)) (λ x .arrowsAreSets _ _) Y (.isoToId x) yb prop1 {x} = pathJ (λ y p x isProp (PathP (λ i .Arrow (p i) 𝓑) xb x)) (λ x .arrowsAreSets _ _) Y (.isoToId x) yb
-- One thing to watch out for here is that the isomorphisms going forwards -- One thing to watch out for here is that the isomorphisms going forwards
-- must compose to give idToIso -- must compose to give idToIso
iso iso
@ -297,34 +297,34 @@ module Try0 {a b : Level} { : Category a b}
open Category cat open Category cat
lemma : Terminal Product A B lemma : Terminal Product 𝓐 𝓑
lemma = fromIsomorphism Terminal (Product A B) (f , g , inv) lemma = fromIsomorphism Terminal (Product 𝓐 𝓑) (f , g , inv)
where where
f : Terminal Product A B f : Terminal Product 𝓐 𝓑
f ((X , x0 , x1) , uniq) = p f ((X , x0 , x1) , uniq) = p
where where
rawP : RawProduct A B rawP : RawProduct 𝓐 𝓑
rawP = record rawP = record
{ object = X { object = X
; fst = x0 ; fst = x0
; snd = x1 ; snd = x1
} }
-- open RawProduct rawP renaming (fst to x0 ; snd to x1) -- open RawProduct rawP renaming (fst to x0 ; snd to x1)
module _ {Y : .Object} (p0 : [ Y , A ]) (p1 : [ Y , B ]) where module _ {Y : .Object} (p0 : [ Y , 𝓐 ]) (p1 : [ Y , 𝓑 ]) where
uy : isContr (Arrow (Y , p0 , p1) (X , x0 , x1)) uy : isContr (Arrow (Y , p0 , p1) (X , x0 , x1))
uy = uniq {Y , p0 , p1} uy = uniq {Y , p0 , p1}
open Σ uy renaming (fst to Y→X ; snd to contractible) open Σ uy renaming (fst to Y→X ; snd to contractible)
open Σ Y→X renaming (fst to p0×p1 ; snd to cond) open Σ Y→X renaming (fst to p0×p1 ; snd to cond)
ump : ∃![ f×g ] ( [ x0 f×g ] p0 P.× [ x1 f×g ] p1) ump : ∃![ f×g ] ( [ x0 f×g ] p0 P.× [ x1 f×g ] p1)
ump = p0×p1 , cond , λ {y} x let k = contractible (y , x) in λ i fst (k i) ump = p0×p1 , cond , λ {y} x let k = contractible (y , x) in λ i fst (k i)
isP : IsProduct A B rawP isP : IsProduct 𝓐 𝓑 rawP
isP = record { ump = ump } isP = record { ump = ump }
p : Product A B p : Product 𝓐 𝓑
p = record p = record
{ raw = rawP { raw = rawP
; isProduct = isP ; isProduct = isP
} }
g : Product A B Terminal g : Product 𝓐 𝓑 Terminal
g p = o , t g p = o , t
where where
module p = Product p module p = Product p
@ -375,7 +375,7 @@ module Try0 {a b : Level} { : Category a b}
inv : AreInverses f g inv : AreInverses f g
inv = funExt ve-re , funExt re-ve inv = funExt ve-re , funExt re-ve
propProduct : isProp (Product A B) propProduct : isProp (Product 𝓐 𝓑)
propProduct = equivPreservesNType {n = ⟨-1⟩} lemma Propositionality.propTerminal propProduct = equivPreservesNType {n = ⟨-1⟩} lemma Propositionality.propTerminal
module _ {a b : Level} { : Category a b} {A B : Category.Object } where module _ {a b : Level} { : Category a b} {A B : Category.Object } where