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
module Try0 {a b : Level} { : Category a b}
(let module = Category ) {A B : .Object} where
(let module = Category ) {𝓐 𝓑 : .Object} where
open P
module _ where
raw : RawCategory _ _
raw = record
{ Object = Σ[ X .Object ] .Arrow X A × .Arrow X B
; Arrow = λ{ (X , x0 , x1) (Y , y0 , y1)
Σ[ f .Arrow X Y ]
[ y0 f ] x0
× [ y1 f ] x1
{ Object = Σ[ X .Object ] .Arrow X 𝓐 × .Arrow X 𝓑
; Arrow = λ{ (A , a0 , a1) (B , b0 , b1)
Σ[ f .Arrow A B ]
[ b0 f ] a0
× [ b1 f ] a1
}
; identity = λ{ {X , f , g} .identity {X} , .rightIdentity , .rightIdentity}
; _<<<_ = λ { {_ , 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 _≅_)
step0
: ((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
= (λ 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))
@ -203,12 +203,12 @@ module Try0 {a b : Level} { : Category a b}
p
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
let p = .isoToId iso
in
( PathP (λ i .Arrow (p i) A) xa ya)
× PathP (λ i .Arrow (p i) B) xb yb
( PathP (λ i .Arrow (p i) 𝓐) xa ya)
× PathP (λ i .Arrow (p i) 𝓑) xb yb
)
step1
= symIso
@ -216,7 +216,7 @@ module Try0 {a b : Level} { : Category a b}
{A = (X .≊ Y)}
{B = (X Y)}
(.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
(symIso (_ , .asTypeIso {X} {Y}) .snd)
)
@ -225,8 +225,8 @@ module Try0 {a b : Level} { : Category a b}
: Σ (X .≊ Y) (λ iso
let p = .isoToId iso
in
( PathP (λ i .Arrow (p i) A) xa ya)
× PathP (λ i .Arrow (p i) B) xb yb
( PathP (λ i .Arrow (p i) 𝓐) xa ya)
× PathP (λ i .Arrow (p i) 𝓑) xb yb
)
((X , xa , xb) (Y , ya , yb))
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~
p : X Y
p = .isoToId iso
pA : .Arrow X A .Arrow Y A
pA = cong (λ x .Arrow x A) p
pB : .Arrow X B .Arrow Y B
pB = cong (λ x .Arrow x B) p
pA : .Arrow X 𝓐 .Arrow Y 𝓐
pA = cong (λ x .Arrow x 𝓐) p
pB : .Arrow X 𝓑 .Arrow Y 𝓑
pB = cong (λ x .Arrow x 𝓑) p
k0 = begin
coe pB xb ≡⟨ .coe-dom iso
xb .<<< fst f~ ≡⟨ snd (snd f~)
@ -264,10 +264,10 @@ module Try0 {a b : Level} { : Category a b}
(Σ≡ refl (.propIsomorphism _ _ _)))
, funExt (λ{ (f , _) lemSig propIsomorphism _ _ (Σ≡ refl (propEqs _ _ _))})
where
prop0 : {x} isProp (PathP (λ i .Arrow (.isoToId x i) A) xa ya)
prop0 {x} = pathJ (λ y p x isProp (PathP (λ i .Arrow (p i) A) xa x)) (λ x .arrowsAreSets _ _) Y (.isoToId x) ya
prop1 : {x} isProp (PathP (λ i .Arrow (.isoToId x i) B) xb yb)
prop1 {x} = pathJ (λ y p x isProp (PathP (λ i .Arrow (p i) B) xb x)) (λ x .arrowsAreSets _ _) Y (.isoToId x) yb
prop0 : {x} isProp (PathP (λ i .Arrow (.isoToId x i) 𝓐) xa 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) 𝓑) xb 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
-- must compose to give idToIso
iso
@ -297,34 +297,34 @@ module Try0 {a b : Level} { : Category a b}
open Category cat
lemma : Terminal Product A B
lemma = fromIsomorphism Terminal (Product A B) (f , g , inv)
lemma : Terminal Product 𝓐 𝓑
lemma = fromIsomorphism Terminal (Product 𝓐 𝓑) (f , g , inv)
where
f : Terminal Product A B
f : Terminal Product 𝓐 𝓑
f ((X , x0 , x1) , uniq) = p
where
rawP : RawProduct A B
rawP : RawProduct 𝓐 𝓑
rawP = record
{ object = X
; fst = x0
; snd = 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 = uniq {Y , p0 , p1}
open Σ uy renaming (fst to Y→X ; snd to contractible)
open Σ Y→X renaming (fst to p0×p1 ; snd to cond)
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)
isP : IsProduct A B rawP
isP : IsProduct 𝓐 𝓑 rawP
isP = record { ump = ump }
p : Product A B
p : Product 𝓐 𝓑
p = record
{ raw = rawP
; isProduct = isP
}
g : Product A B Terminal
g : Product 𝓐 𝓑 Terminal
g p = o , t
where
module p = Product p
@ -375,7 +375,7 @@ module Try0 {a b : Level} { : Category a b}
inv : AreInverses f g
inv = funExt ve-re , funExt re-ve
propProduct : isProp (Product A B)
propProduct : isProp (Product 𝓐 𝓑)
propProduct = equivPreservesNType {n = ⟨-1⟩} lemma Propositionality.propTerminal
module _ {a b : Level} { : Category a b} {A B : Category.Object } where