UF.SIP
Martin Escardo, 30 April 2020
The structure identity principle and tools from the 2019 paper and links
https://arxiv.org/abs/1911.00580
https://www.cs.bham.ac.uk/~mhe/HoTT-UF-in-Agda-Lecture-Notes/index.html
https://github.com/martinescardo/HoTT-UF-Agda-Lecture-Notes
There are three submodules:
* sip
* sip-with-axioms
* sip-join
{-# OPTIONS --safe --without-K #-}
module UF.SIP where
open import MLTT.Spartan
open import UF.Base
open import UF.Embeddings
open import UF.Equiv
open import UF.EquivalenceExamples
open import UF.Retracts
open import UF.Subsingletons
open import UF.Univalence
open import UF.Yoneda
module sip where
โจ_โฉ : {S : ๐ค ฬ โ ๐ฅ ฬ } โ ฮฃ S โ ๐ค ฬ
โจ X , s โฉ = X
structure : {S : ๐ค ฬ โ ๐ฅ ฬ } (A : ฮฃ S) โ S โจ A โฉ
structure (X , s) = s
canonical-map : {S : ๐ค ฬ โ ๐ฅ ฬ }
(ฮน : (A B : ฮฃ S) โ โจ A โฉ โ โจ B โฉ โ ๐ฆ ฬ )
(ฯ : (A : ฮฃ S) โ ฮน A A (โ-refl โจ A โฉ))
{X : ๐ค ฬ }
(s t : S X)
โ s ๏ผ t โ ฮน (X , s) (X , t) (โ-refl X)
canonical-map ฮน ฯ {X} s s (refl {s}) = ฯ (X , s)
SNS : (๐ค ฬ โ ๐ฅ ฬ ) โ (๐ฆ : Universe) โ ๐ค โบ โ ๐ฅ โ (๐ฆ โบ) ฬ
SNS {๐ค} {๐ฅ} S ๐ฆ = ฮฃ ฮน ๊ ((A B : ฮฃ S) โ (โจ A โฉ โ โจ B โฉ โ ๐ฆ ฬ ))
, ฮฃ ฯ ๊ ((A : ฮฃ S) โ ฮน A A (โ-refl โจ A โฉ))
, ({X : ๐ค ฬ } (s t : S X) โ is-equiv (canonical-map ฮน ฯ s t))
homomorphic : {S : ๐ค ฬ โ ๐ฅ ฬ } โ SNS S ๐ฆ
โ (A B : ฮฃ S) โ โจ A โฉ โ โจ B โฉ โ ๐ฆ ฬ
homomorphic (ฮน , ฯ , ฮธ) = ฮน
_โ[_]_ : {S : ๐ค ฬ โ ๐ฅ ฬ } โ ฮฃ S โ SNS S ๐ฆ โ ฮฃ S โ ๐ค โ ๐ฆ ฬ
A โ[ ฯ ] B = ฮฃ f ๊ (โจ A โฉ โ โจ B โฉ)
, ฮฃ i ๊ is-equiv f
, homomorphic ฯ A B (f , i)
IdโhomEq : {S : ๐ค ฬ โ ๐ฅ ฬ } (ฯ : SNS S ๐ฆ)
โ (A B : ฮฃ S) โ (A ๏ผ B) โ (A โ[ ฯ ] B)
IdโhomEq (_ , ฯ , _) A A (refl {A}) = id , id-is-equiv โจ A โฉ , ฯ A
homomorphism-lemma : {S : ๐ค ฬ โ ๐ฅ ฬ } (ฯ : SNS S ๐ฆ)
(A B : ฮฃ S) (p : โจ A โฉ ๏ผ โจ B โฉ)
โ
(transport S p (structure A) ๏ผ structure B)
โ homomorphic ฯ A B (idtoeq โจ A โฉ โจ B โฉ p)
homomorphism-lemma (ฮน , ฯ , ฮธ) (X , s) (X , t) (refl {X}) = ฮณ
where
ฮณ : (s ๏ผ t) โ ฮน (X , s) (X , t) (โ-refl X)
ฮณ = (canonical-map ฮน ฯ s t , ฮธ s t)
characterization-of-๏ผ : is-univalent ๐ค
โ {S : ๐ค ฬ โ ๐ฅ ฬ } (ฯ : SNS S ๐ฆ)
โ (A B : ฮฃ S)
โ (A ๏ผ B) โ (A โ[ ฯ ] B)
characterization-of-๏ผ ua {S} ฯ A B =
(A ๏ผ B) โโจ i โฉ
(ฮฃ p ๊ โจ A โฉ ๏ผ โจ B โฉ , transport S p (structure A) ๏ผ structure B) โโจ ii โฉ
(ฮฃ p ๊ โจ A โฉ ๏ผ โจ B โฉ , ฮน A B (idtoeq โจ A โฉ โจ B โฉ p)) โโจ iii โฉ
(ฮฃ e ๊ โจ A โฉ โ โจ B โฉ , ฮน A B e) โโจ iv โฉ
(A โ[ ฯ ] B) โ
where
ฮน = homomorphic ฯ
i = ฮฃ-๏ผ-โ
ii = ฮฃ-cong (homomorphism-lemma ฯ A B)
iii = ฮฃ-change-of-variable (ฮน A B) (idtoeq โจ A โฉ โจ B โฉ) (ua โจ A โฉ โจ B โฉ)
iv = ฮฃ-assoc
IdโhomEq-is-equiv : (ua : is-univalent ๐ค) {S : ๐ค ฬ โ ๐ฅ ฬ } (ฯ : SNS S ๐ฆ)
โ (A B : ฮฃ S) โ is-equiv (IdโhomEq ฯ A B)
IdโhomEq-is-equiv ua {S} ฯ A B = ฮณ
where
h : (A B : ฮฃ S) โ IdโhomEq ฯ A B โผ โ characterization-of-๏ผ ua ฯ A B โ
h A A (refl {A}) = refl
ฮณ : is-equiv (IdโhomEq ฯ A B)
ฮณ = equiv-closed-under-โผ _ _
(โโ-is-equiv (characterization-of-๏ผ ua ฯ A B))
(h A B)
module _ {S : ๐ค ฬ โ ๐ฅ ฬ }
(ฮน : (A B : ฮฃ S) โ โจ A โฉ โ โจ B โฉ โ ๐ฆ ฬ )
(ฯ : (A : ฮฃ S) โ ฮน A A (โ-refl โจ A โฉ))
{X : ๐ค ฬ }
where
canonical-map-charac
: (s t : S X) (p : s ๏ผ t)
โ canonical-map ฮน ฯ s t p
๏ผ transport (ฮป - โ ฮน (X , s) (X , -) (โ-refl X)) p (ฯ (X , s))
canonical-map-charac s t p =
(yoneda-lemma
s
(ฮป t โ ฮน (X , s) (X , t) (โ-refl X))
(canonical-map ฮน ฯ s) t p)โปยน
when-canonical-map-is-equiv
: ((s t : S X) โ is-equiv (canonical-map ฮน ฯ s t))
โ ((s : S X) โ โ! t ๊ S X , ฮน (X , s) (X , t) (โ-refl X))
when-canonical-map-is-equiv = (ฮป e s โ Yoneda-Theorem-back s (c s) (e s)) ,
(ฮป ฯ s โ Yoneda-Theorem-forth s (c s) (ฯ s))
where
c = canonical-map ฮน ฯ
canonical-map-equiv-criterion :
((s t : S X) โ (s ๏ผ t) โ ฮน (X , s) (X , t) (โ-refl X))
โ (s t : S X) โ is-equiv (canonical-map ฮน ฯ s t)
canonical-map-equiv-criterion ฯ s = fiberwise-equiv-criterion'
(ฮป t โ ฮน (X , s) (X , t) (โ-refl X))
s (ฯ s) (canonical-map ฮน ฯ s)
canonical-map-equiv-criterion' :
((s t : S X) โ ฮน (X , s) (X , t) (โ-refl X) โ (s ๏ผ t))
โ (s t : S X) โ is-equiv (canonical-map ฮน ฯ s t)
canonical-map-equiv-criterion' ฯ s = fiberwise-equiv-criterion
(ฮป t โ ฮน (X , s) (X , t) (โ-refl X))
s (ฯ s) (canonical-map ฮน ฯ s)
module sip-with-axioms where
open sip
[_] : {S : ๐ค ฬ โ ๐ฅ ฬ } {axioms : (X : ๐ค ฬ ) โ S X โ ๐ฆ ฬ }
โ (ฮฃ X ๊ ๐ค ฬ , ฮฃ s ๊ S X , axioms X s) โ ฮฃ S
[ X , s , _ ] = (X , s)
โช_โซ : {S : ๐ค ฬ โ ๐ฅ ฬ } {axioms : (X : ๐ค ฬ ) โ S X โ ๐ฆ ฬ }
โ (ฮฃ X ๊ ๐ค ฬ , ฮฃ s ๊ S X , axioms X s) โ ๐ค ฬ
โช X , _ , _ โซ = X
add-axioms : {S : ๐ค ฬ โ ๐ฅ ฬ }
(axioms : (X : ๐ค ฬ ) โ S X โ ๐ฆ ฬ )
โ ((X : ๐ค ฬ ) (s : S X) โ is-prop (axioms X s))
โ SNS S ๐ฃ
โ SNS (ฮป X โ ฮฃ s ๊ S X , axioms X s) ๐ฃ
add-axioms {๐ค} {๐ฅ} {๐ฆ} {๐ฃ} {S} axioms i (ฮน , ฯ , ฮธ) = ฮน' , ฯ' , ฮธ'
where
S' : ๐ค ฬ โ ๐ฅ โ ๐ฆ ฬ
S' X = ฮฃ s ๊ S X , axioms X s
ฮน' : (A B : ฮฃ S') โ โจ A โฉ โ โจ B โฉ โ ๐ฃ ฬ
ฮน' A B = ฮน [ A ] [ B ]
ฯ' : (A : ฮฃ S') โ ฮน' A A (โ-refl โจ A โฉ)
ฯ' A = ฯ [ A ]
ฮธ' : {X : ๐ค ฬ } (s' t' : S' X) โ is-equiv (canonical-map ฮน' ฯ' s' t')
ฮธ' {X} (s , a) (t , b) = ฮณ
where
ฯ : S' X โ S X
ฯ (s , _) = s
j : is-embedding ฯ
j = prโ-is-embedding (i X)
k : {s' t' : S' X} โ is-equiv (ap ฯ {s'} {t'})
k {s'} {t'} = embedding-gives-embedding' ฯ j s' t'
l : canonical-map ฮน' ฯ' (s , a) (t , b)
โผ canonical-map ฮน ฯ s t โ ap ฯ {s , a} {t , b}
l (refl {s , a}) = ๐ป๐ฎ๐ป๐ต (ฯ (X , s))
e : is-equiv (canonical-map ฮน ฯ s t โ ap ฯ {s , a} {t , b})
e = โ-is-equiv k (ฮธ s t)
ฮณ : is-equiv (canonical-map ฮน' ฯ' (s , a) (t , b))
ฮณ = equiv-closed-under-โผ _ _ e l
characterization-of-๏ผ-with-axioms
: is-univalent ๐ค
โ {S : ๐ค ฬ โ ๐ฅ ฬ }
(ฯ : SNS S ๐ฃ)
(axioms : (X : ๐ค ฬ ) โ S X โ ๐ฆ ฬ )
โ ((X : ๐ค ฬ ) (s : S X) โ is-prop (axioms X s))
โ (A B : ฮฃ X ๊ ๐ค ฬ , ฮฃ s ๊ S X , axioms X s)
โ (A ๏ผ B) โ ([ A ] โ[ ฯ ] [ B ])
characterization-of-๏ผ-with-axioms ua ฯ axioms i =
characterization-of-๏ผ ua (add-axioms axioms i ฯ)
module sip-join where
technical-lemma :
{X : ๐ค ฬ } {A : X โ X โ ๐ฅ ฬ }
{Y : ๐ฆ ฬ } {B : Y โ Y โ ๐ฃ ฬ }
(f : (xโ xโ : X) โ xโ ๏ผ xโ โ A xโ xโ)
(g : (yโ yโ : Y) โ yโ ๏ผ yโ โ B yโ yโ)
โ ((xโ xโ : X) โ is-equiv (f xโ xโ))
โ ((yโ yโ : Y) โ is-equiv (g yโ yโ))
โ ((xโ , yโ) (xโ , yโ) : X ร Y) โ
is-equiv (ฮป (p : (xโ , yโ) ๏ผ (xโ , yโ)) โ f xโ xโ (ap prโ p) ,
g yโ yโ (ap prโ p))
technical-lemma {๐ค} {๐ฅ} {๐ฆ} {๐ฃ} {X} {A} {Y} {B} f g i j (xโ , yโ) = ฮณ
where
module _ ((xโ , yโ) : X ร Y) where
r : (xโ , yโ) ๏ผ (xโ , yโ) โ A xโ xโ ร B yโ yโ
r p = f xโ xโ (ap prโ p) , g yโ yโ (ap prโ p)
f' : (a : A xโ xโ) โ xโ ๏ผ xโ
f' = inverse (f xโ xโ) (i xโ xโ)
g' : (b : B yโ yโ) โ yโ ๏ผ yโ
g' = inverse (g yโ yโ) (j yโ yโ)
s : A xโ xโ ร B yโ yโ โ (xโ , yโ) ๏ผ (xโ , yโ)
s (a , b) = to-ร-๏ผ (f' a) (g' b)
ฮท : (c : A xโ xโ ร B yโ yโ) โ r (s c) ๏ผ c
ฮท (a , b) =
r (s (a , b)) ๏ผโจreflโฉ
r (to-ร-๏ผ (f' a) (g' b)) ๏ผโจreflโฉ
(f xโ xโ (ap prโ (to-ร-๏ผ (f' a) (g' b))) ,
g yโ yโ (ap prโ (to-ร-๏ผ (f' a) (g' b)))) ๏ผโจ ii โฉ
(f xโ xโ (f' a) , g yโ yโ (g' b)) ๏ผโจ iii โฉ
a , b โ
where
ii = apโ (ฮป p q โ f xโ xโ p , g yโ yโ q)
(ap-prโ-to-ร-๏ผ (f' a) (g' b))
(ap-prโ-to-ร-๏ผ (f' a) (g' b))
iii = to-ร-๏ผ (inverses-are-sections (f xโ xโ) (i xโ xโ) a)
(inverses-are-sections (g yโ yโ) (j yโ yโ) b)
ฮณ : (z : X ร Y) โ is-equiv (r z)
ฮณ = nats-with-sections-are-equivs (xโ , yโ) r (ฮป z โ (s z , ฮท z))
open sip
โช_โซ : {Sโ : ๐ค ฬ โ ๐ฅโ ฬ } {Sโ : ๐ค ฬ โ ๐ฅโ ฬ }
โ (ฮฃ X ๊ ๐ค ฬ , Sโ X ร Sโ X) โ ๐ค ฬ
โช X , sโ , sโ โซ = X
[_]โ : {Sโ : ๐ค ฬ โ ๐ฅโ ฬ } {Sโ : ๐ค ฬ โ ๐ฅโ ฬ }
โ (ฮฃ X ๊ ๐ค ฬ , Sโ X ร Sโ X) โ ฮฃ Sโ
[ X , sโ , sโ ]โ = (X , sโ)
[_]โ : {Sโ : ๐ค ฬ โ ๐ฅโ ฬ } {Sโ : ๐ค ฬ โ ๐ฅโ ฬ }
โ (ฮฃ X ๊ ๐ค ฬ , Sโ X ร Sโ X) โ ฮฃ Sโ
[ X , sโ , sโ ]โ = (X , sโ)
join : {Sโ : ๐ค ฬ โ ๐ฅโ ฬ } {Sโ : ๐ค ฬ โ ๐ฅโ ฬ }
โ SNS Sโ ๐ฆโ
โ SNS Sโ ๐ฆโ
โ SNS (ฮป X โ Sโ X ร Sโ X) (๐ฆโ โ ๐ฆโ)
join {๐ค} {๐ฅโ} {๐ฅโ} {๐ฆโ} {๐ฆโ} {Sโ} {Sโ} (ฮนโ , ฯโ , ฮธโ) (ฮนโ , ฯโ , ฮธโ) =
ฮน , ฯ , ฮธ
where
S : ๐ค ฬ โ ๐ฅโ โ ๐ฅโ ฬ
S X = Sโ X ร Sโ X
ฮน : (A B : ฮฃ S) โ โจ A โฉ โ โจ B โฉ โ ๐ฆโ โ ๐ฆโ ฬ
ฮน A B e = ฮนโ [ A ]โ [ B ]โ e ร ฮนโ [ A ]โ [ B ]โ e
ฯ : (A : ฮฃ S) โ ฮน A A (โ-refl โจ A โฉ)
ฯ A = (ฯโ [ A ]โ , ฯโ [ A ]โ)
ฮธ : {X : ๐ค ฬ } (s t : S X) โ is-equiv (canonical-map ฮน ฯ s t)
ฮธ {X} s@(sโ , sโ) t@(tโ , tโ) = ฮณ
where
c : (p : s ๏ผ t) โ ฮนโ (X , sโ) (X , tโ) (โ-refl X)
ร ฮนโ (X , sโ) (X , tโ) (โ-refl X)
c p = (canonical-map ฮนโ ฯโ sโ tโ (ap prโ p) ,
canonical-map ฮนโ ฯโ sโ tโ (ap prโ p))
i : is-equiv c
i = technical-lemma
(canonical-map ฮนโ ฯโ)
(canonical-map ฮนโ ฯโ)
ฮธโ ฮธโ s t
e : canonical-map ฮน ฯ s t โผ c
e (refl {s}) = ๐ป๐ฎ๐ป๐ต (ฯโ (X , sโ) , ฯโ (X , sโ))
ฮณ : is-equiv (canonical-map ฮน ฯ s t)
ฮณ = equiv-closed-under-โผ _ _ i e
_โโฆ_,_โง_ : {Sโ : ๐ค ฬ โ ๐ฅ ฬ } {Sโ : ๐ค ฬ โ ๐ฅโ ฬ }
โ (ฮฃ X ๊ ๐ค ฬ , Sโ X ร Sโ X)
โ SNS Sโ ๐ฆโ
โ SNS Sโ ๐ฆโ
โ (ฮฃ X ๊ ๐ค ฬ , Sโ X ร Sโ X)
โ ๐ค โ ๐ฆโ โ ๐ฆโ ฬ
A โโฆ ฯโ , ฯโ โง B = ฮฃ f ๊ (โช A โซ โ โช B โซ)
, ฮฃ i ๊ is-equiv f , homomorphic ฯโ [ A ]โ [ B ]โ (f , i)
ร homomorphic ฯโ [ A ]โ [ B ]โ (f , i)
characterization-of-join-๏ผ : is-univalent ๐ค
โ {Sโ : ๐ค ฬ โ ๐ฅ ฬ } {Sโ : ๐ค ฬ โ ๐ฅโ ฬ }
(ฯโ : SNS Sโ ๐ฆโ) (ฯโ : SNS Sโ ๐ฆโ)
(A B : ฮฃ X ๊ ๐ค ฬ , Sโ X ร Sโ X)
โ (A ๏ผ B) โ (A โโฆ ฯโ , ฯโ โง B)
characterization-of-join-๏ผ ua ฯโ ฯโ = characterization-of-๏ผ ua (join ฯโ ฯโ)