MGS.SIP
This is ported from the Midlands Graduate School 2019 lecture notes
https://www.cs.bham.ac.uk/~mhe/HoTT-UF.in-Agda-Lecture-Notes/HoTT-UF-Agda.html
https://github.com/martinescardo/HoTT-UF.Agda-Lecture-Notes
{-# OPTIONS --safe --without-K #-}
module MGS.SIP where
open import MGS.More-FunExt-Consequences public
open import MGS.Yoneda public
open import MGS.Powerset public
open import MGS.Classifiers public
open import MGS.Subsingleton-Truncation public
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 (id-โ โจ A โฉ))
{X : ๐ค ฬ }
(s t : S X)
โ s ๏ผ t โ ฮน (X , s) (X , t) (id-โ X)
canonical-map ฮน ฯ {X} s s (refl s) = ฯ (X , s)
SNS : (๐ค ฬ โ ๐ฅ ฬ ) โ (๐ฆ : Universe) โ ๐ค โบ โ ๐ฅ โ (๐ฆ โบ) ฬ
SNS {๐ค} {๐ฅ} S ๐ฆ = ฮฃ ฮน ๊ ((A B : ฮฃ S) โ (โจ A โฉ โ โจ B โฉ โ ๐ฆ ฬ ))
, ฮฃ ฯ ๊ ((A : ฮฃ S) โ ฮน A A (id-โ โจ 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 (IdโEq โจ A โฉ โจ B โฉ p)
homomorphism-lemma (ฮน , ฯ , ฮธ) (X , s) (X , t) (refl X) = ฮณ
where
ฮณ : (s ๏ผ t) โ ฮน (X , s) (X , t) (id-โ 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 (IdโEq โจ A โฉ โจ B โฉ p)) โโจ iii โฉ
(ฮฃ e ๊ โจ A โฉ โ โจ B โฉ , ฮน A B e) โโจ iv โฉ
(A โ[ ฯ ] B) โ
where
ฮน = homomorphic ฯ
i = ฮฃ-๏ผ-โ A B
ii = ฮฃ-cong (homomorphism-lemma ฯ A B)
iii = โ-sym (ฮฃ-change-of-variable (ฮน A B) (IdโEq โจ 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)
ฮณ = equivs-closed-under-โผ
(โโ-is-equiv (characterization-of-๏ผ ua ฯ A B))
(h A B)
module _ {S : ๐ค ฬ โ ๐ฅ ฬ }
(ฮน : (A B : ฮฃ S) โ โจ A โฉ โ โจ B โฉ โ ๐ฆ ฬ )
(ฯ : (A : ฮฃ S) โ ฮน A A (id-โ โจ A โฉ))
{X : ๐ค ฬ }
where
canonical-map-charac : (s t : S X) (p : s ๏ผ t)
โ canonical-map ฮน ฯ s t p
๏ผ transport (ฮป - โ ฮน (X , s) (X , -) (id-โ X)) p (ฯ (X , s))
canonical-map-charac s = transport-lemma (ฮป t โ ฮน (X , s) (X , t) (id-โ X)) s
(canonical-map ฮน ฯ s)
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) (id-โ X))
when-canonical-map-is-equiv = (ฮป e s โ fiberwise-equiv-universal (A s) s (ฯ s) (e s)) ,
(ฮป ฯ s โ universal-fiberwise-equiv (A s) (ฯ s) s (ฯ s))
where
A = ฮป s t โ ฮน (X , s) (X , t) (id-โ X)
ฯ = canonical-map ฮน ฯ
canonical-map-equiv-criterion : ((s t : S X) โ (s ๏ผ t) โ ฮน (X , s) (X , t) (id-โ X))
โ (s t : S X) โ is-equiv (canonical-map ฮน ฯ s t)
canonical-map-equiv-criterion ฯ s = fiberwise-equiv-criterion'
(ฮป t โ ฮน (X , s) (X , t) (id-โ X))
s (ฯ s) (canonical-map ฮน ฯ s)
canonical-map-equiv-criterion' : ((s t : S X) โ ฮน (X , s) (X , t) (id-โ 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) (id-โ X))
s (ฯ s) (canonical-map ฮน ฯ s)
module โ-magma {๐ค : Universe} where
open sip
โ-magma-structure : ๐ค ฬ โ ๐ค ฬ
โ-magma-structure X = X โ X โ X
โ-Magma : ๐ค โบ ฬ
โ-Magma = ฮฃ X ๊ ๐ค ฬ , โ-magma-structure X
sns-data : SNS โ-magma-structure ๐ค
sns-data = (ฮน , ฯ , ฮธ)
where
ฮน : (A B : โ-Magma) โ โจ A โฉ โ โจ B โฉ โ ๐ค ฬ
ฮน (X , _ยท_) (Y , _*_) (f , _) = (ฮป x x' โ f (x ยท x')) ๏ผ (ฮป x x' โ f x * f x')
ฯ : (A : โ-Magma) โ ฮน A A (id-โ โจ A โฉ)
ฯ (X , _ยท_) = refl _ยท_
h : {X : ๐ค ฬ } {_ยท_ _*_ : โ-magma-structure X}
โ canonical-map ฮน ฯ _ยท_ _*_ โผ ๐๐ (_ยท_ ๏ผ _*_)
h (refl _ยท_) = refl (refl _ยท_)
ฮธ : {X : ๐ค ฬ } (_ยท_ _*_ : โ-magma-structure X)
โ is-equiv (canonical-map ฮน ฯ _ยท_ _*_)
ฮธ _ยท_ _*_ = equivs-closed-under-โผ (id-is-equiv (_ยท_ ๏ผ _*_)) h
_โ
_ : โ-Magma โ โ-Magma โ ๐ค ฬ
(X , _ยท_) โ
(Y , _*_) =
ฮฃ f ๊ (X โ Y), is-equiv f
ร ((ฮป x x' โ f (x ยท x')) ๏ผ (ฮป x x' โ f x * f x'))
characterization-of-โ-Magma-๏ผ : is-univalent ๐ค โ (A B : โ-Magma) โ (A ๏ผ B) โ (A โ
B)
characterization-of-โ-Magma-๏ผ ua = characterization-of-๏ผ ua sns-data
characterization-of-characterization-of-โ-Magma-๏ผ :
(ua : is-univalent ๐ค) (A : โ-Magma)
โ
โ characterization-of-โ-Magma-๏ผ ua A A โ (refl A)
๏ผ
(๐๐ โจ A โฉ , id-is-equiv โจ A โฉ , refl _)
characterization-of-characterization-of-โ-Magma-๏ผ ua A = refl _
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-subsingleton (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 (id-โ โจ 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โ-embedding (i X)
k : {s' t' : S' X} โ is-equiv (ap ฯ {s'} {t'})
k {s'} {t'} = embedding-gives-ap-is-equiv ฯ j s' t'
l : canonical-map ฮน' ฯ' (s , a) (t , b)
โผ canonical-map ฮน ฯ s t โ ap ฯ {s , a} {t , b}
l (refl (s , a)) = refl (ฯ (X , s))
e : is-equiv (canonical-map ฮน ฯ s t โ ap ฯ {s , a} {t , b})
e = โ-is-equiv (ฮธ s t) k
ฮณ : is-equiv (canonical-map ฮน' ฯ' (s , a) (t , b))
ฮณ = equivs-closed-under-โผ e l
characterization-of-๏ผ-with-axioms :
is-univalent ๐ค
โ {S : ๐ค ฬ โ ๐ฅ ฬ }
(ฯ : SNS S ๐ฃ)
(axioms : (X : ๐ค ฬ ) โ S X โ ๐ฆ ฬ )
โ ((X : ๐ค ฬ ) (s : S X) โ is-subsingleton (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 magma {๐ค : Universe} where
open sip-with-axioms
Magma : ๐ค โบ ฬ
Magma = ฮฃ X ๊ ๐ค ฬ , (X โ X โ X) ร is-set X
_โ
_ : Magma โ Magma โ ๐ค ฬ
(X , _ยท_ , _) โ
(Y , _*_ , _) =
ฮฃ f ๊ (X โ Y), is-equiv f
ร ((ฮป x x' โ f (x ยท x')) ๏ผ (ฮป x x' โ f x * f x'))
characterization-of-Magma-๏ผ : is-univalent ๐ค โ (A B : Magma ) โ (A ๏ผ B) โ (A โ
B)
characterization-of-Magma-๏ผ ua =
characterization-of-๏ผ-with-axioms ua
โ-magma.sns-data
(ฮป X s โ is-set X)
(ฮป X s โ being-set-is-subsingleton (univalence-gives-dfunext ua))
module pointed-type {๐ค : Universe} where
open sip
Pointed : ๐ค ฬ โ ๐ค ฬ
Pointed X = X
sns-data : SNS Pointed ๐ค
sns-data = (ฮน , ฯ , ฮธ)
where
ฮน : (A B : ฮฃ Pointed) โ โจ A โฉ โ โจ B โฉ โ ๐ค ฬ
ฮน (X , xโ) (Y , yโ) (f , _) = (f xโ ๏ผ yโ)
ฯ : (A : ฮฃ Pointed) โ ฮน A A (id-โ โจ A โฉ)
ฯ (X , xโ) = refl xโ
ฮธ : {X : ๐ค ฬ } (xโ xโ : Pointed X) โ is-equiv (canonical-map ฮน ฯ xโ xโ)
ฮธ xโ xโ = equivs-closed-under-โผ (id-is-equiv (xโ ๏ผ xโ)) h
where
h : canonical-map ฮน ฯ xโ xโ โผ ๐๐ (xโ ๏ผ xโ)
h (refl xโ) = refl (refl xโ)
_โ
_ : ฮฃ Pointed โ ฮฃ Pointed โ ๐ค ฬ
(X , xโ) โ
(Y , yโ) = ฮฃ f ๊ (X โ Y), is-equiv f ร (f xโ ๏ผ yโ)
characterization-of-pointed-type-๏ผ : is-univalent ๐ค
โ (A B : ฮฃ Pointed)
โ (A ๏ผ B) โ (A โ
B)
characterization-of-pointed-type-๏ผ ua = characterization-of-๏ผ ua sns-data
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
u : โ! xโ ๊ X , A xโ xโ
u = fiberwise-equiv-universal (A xโ) xโ (f xโ) (i xโ)
v : โ! yโ ๊ Y , B yโ yโ
v = fiberwise-equiv-universal (B yโ) yโ (g yโ) (j yโ)
C : X ร Y โ ๐ฅ โ ๐ฃ ฬ
C (xโ , yโ) = A xโ xโ ร B yโ yโ
w : (โ! xโ ๊ X , A xโ xโ)
โ (โ! yโ ๊ Y , B yโ yโ)
โ โ! (xโ , yโ) ๊ X ร Y , C (xโ , yโ)
w ((xโ , aโ) , ฯ) ((yโ , bโ) , ฯ) = ((xโ , yโ) , (aโ , bโ)) , ฮด
where
p : โ x y a b
โ (xโ , aโ) ๏ผ (x , a)
โ (yโ , bโ) ๏ผ (y , b)
โ (xโ , yโ) , (aโ , bโ) ๏ผ (x , y) , (a , b)
p .xโ .yโ .aโ .bโ (refl .(xโ , aโ)) (refl .(yโ , bโ)) = refl ((xโ , yโ) , (aโ , bโ))
ฮด : (((x , y) , (a , b)) : ฮฃ C) โ (xโ , yโ) , (aโ , bโ) ๏ผ ((x , y) , (a , b))
ฮด ((x , y) , (a , b)) = p x y a b (ฯ (x , a)) (ฯ (y , b))
ฯ : Nat (๐จ (xโ , yโ)) C
ฯ (xโ , yโ) p = f xโ xโ (ap prโ p) , g yโ yโ (ap prโ p)
ฮณ : is-fiberwise-equiv ฯ
ฮณ = universal-fiberwise-equiv C (w u v) (xโ , yโ) ฯ
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 (id-โ โจ A โฉ)
ฯ A = (ฯโ [ A ]โ , ฯโ [ A ]โ)
ฮธ : {X : ๐ค ฬ } (s t : S X) โ is-equiv (canonical-map ฮน ฯ s t)
ฮธ {X} (sโ , sโ) (tโ , tโ) = ฮณ
where
c : (p : sโ , sโ ๏ผ tโ , tโ) โ ฮนโ (X , sโ) (X , tโ) (id-โ X)
ร ฮนโ (X , sโ) (X , tโ) (id-โ 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โ , sโ) (tโ , tโ)
e : canonical-map ฮน ฯ (sโ , sโ) (tโ , tโ) โผ c
e (refl (sโ , sโ)) = refl (ฯโ (X , sโ) , ฯโ (X , sโ))
ฮณ : is-equiv (canonical-map ฮน ฯ (sโ , sโ) (tโ , tโ))
ฮณ = equivs-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 ฯโ ฯโ)
module pointed-โ-magma {๐ค : Universe} where
open sip-join
โ-Magmaยท : ๐ค โบ ฬ
โ-Magmaยท = ฮฃ X ๊ ๐ค ฬ , (X โ X โ X) ร X
_โ
_ : โ-Magmaยท โ โ-Magmaยท โ ๐ค ฬ
(X , _ยท_ , xโ) โ
(Y , _*_ , yโ) =
ฮฃ f ๊ (X โ Y), is-equiv f
ร ((ฮป x x' โ f (x ยท x')) ๏ผ (ฮป x x' โ f x * f x'))
ร (f xโ ๏ผ yโ)
characterization-of-pointed-magma-๏ผ : is-univalent ๐ค
โ (A B : โ-Magmaยท)
โ (A ๏ผ B) โ (A โ
B)
characterization-of-pointed-magma-๏ผ ua = characterization-of-join-๏ผ ua
โ-magma.sns-data
pointed-type.sns-data
module monoid {๐ค : Universe} (ua : is-univalent ๐ค) where
dfe : dfunext ๐ค ๐ค
dfe = univalence-gives-dfunext ua
open sip
open sip-join
open sip-with-axioms
monoid-structure : ๐ค ฬ โ ๐ค ฬ
monoid-structure X = (X โ X โ X) ร X
monoid-axioms : (X : ๐ค ฬ ) โ monoid-structure X โ ๐ค ฬ
monoid-axioms X (_ยท_ , e) = is-set X
ร monoids.left-neutral e _ยท_
ร monoids.right-neutral e _ยท_
ร monoids.associative _ยท_
Monoid : ๐ค โบ ฬ
Monoid = ฮฃ X ๊ ๐ค ฬ , ฮฃ s ๊ monoid-structure X , monoid-axioms X s
monoid-axioms-subsingleton : (X : ๐ค ฬ ) (s : monoid-structure X)
โ is-subsingleton (monoid-axioms X s)
monoid-axioms-subsingleton X (_ยท_ , e) s = ฮณ s
where
i : is-set X
i = prโ s
ฮณ : is-subsingleton (monoid-axioms X (_ยท_ , e))
ฮณ = ร-is-subsingleton
(being-set-is-subsingleton dfe)
(ร-is-subsingleton
(ฮ -is-subsingleton dfe
(ฮป x โ i (e ยท x) x))
(ร-is-subsingleton
(ฮ -is-subsingleton dfe
(ฮป x โ i (x ยท e) x))
(ฮ -is-subsingleton dfe
(ฮป x โ ฮ -is-subsingleton dfe
(ฮป y โ ฮ -is-subsingleton dfe
(ฮป z โ i ((x ยท y) ยท z) (x ยท (y ยท z))))))))
sns-data : SNS (ฮป X โ ฮฃ s ๊ monoid-structure X , monoid-axioms X s) ๐ค
sns-data = add-axioms
monoid-axioms monoid-axioms-subsingleton
(join
โ-magma.sns-data
pointed-type.sns-data)
_โ
_ : Monoid โ Monoid โ ๐ค ฬ
(X , (_ยท_ , d) , _) โ
(Y , (_*_ , e) , _) =
ฮฃ f ๊ (X โ Y), is-equiv f
ร ((ฮป x x' โ f (x ยท x')) ๏ผ (ฮป x x' โ f x * f x'))
ร (f d ๏ผ e)
characterization-of-monoid-๏ผ : is-univalent ๐ค
โ (A B : Monoid)
โ (A ๏ผ B) โ (A โ
B)
characterization-of-monoid-๏ผ ua = characterization-of-๏ผ ua sns-data
module associative-โ-magma
{๐ค : Universe}
(ua : is-univalent ๐ค)
where
fe : dfunext ๐ค ๐ค
fe = univalence-gives-dfunext ua
associative : {X : ๐ค ฬ } โ (X โ X โ X) โ ๐ค ฬ
associative _ยท_ = โ x y z โ (x ยท y) ยท z ๏ผ x ยท (y ยท z)
โ-amagma-structure : ๐ค ฬ โ ๐ค ฬ
โ-amagma-structure X = ฮฃ _ยท_ ๊ (X โ X โ X), (associative _ยท_)
โ-aMagma : ๐ค โบ ฬ
โ-aMagma = ฮฃ X ๊ ๐ค ฬ , โ-amagma-structure X
homomorphic : {X Y : ๐ค ฬ } โ (X โ X โ X) โ (Y โ Y โ Y) โ (X โ Y) โ ๐ค ฬ
homomorphic _ยท_ _*_ f = (ฮป x y โ f (x ยท y)) ๏ผ (ฮป x y โ f x * f y)
respect-assoc : {X A : ๐ค ฬ } (_ยท_ : X โ X โ X) (_*_ : A โ A โ A)
โ associative _ยท_ โ associative _*_
โ (f : X โ A) โ homomorphic _ยท_ _*_ f โ ๐ค ฬ
respect-assoc _ยท_ _*_ ฮฑ ฮฒ f h = fฮฑ ๏ผ ฮฒf
where
l = ฮป x y z โ f ((x ยท y) ยท z) ๏ผโจ ap (ฮป - โ - (x ยท y) z) h โฉ
f (x ยท y) * f z ๏ผโจ ap (ฮป - โ - x y * f z) h โฉ
(f x * f y) * f z โ
r = ฮป x y z โ f (x ยท (y ยท z)) ๏ผโจ ap (ฮป - โ - x (y ยท z)) h โฉ
f x * f (y ยท z) ๏ผโจ ap (ฮป - โ f x * - y z) h โฉ
f x * (f y * f z) โ
fฮฑ ฮฒf : โ x y z โ (f x * f y) * f z ๏ผ f x * (f y * f z)
fฮฑ x y z = (l x y z)โปยน โ ap f (ฮฑ x y z) โ r x y z
ฮฒf x y z = ฮฒ (f x) (f y) (f z)
remark : {X : ๐ค ฬ } (_ยท_ : X โ X โ X) (ฮฑ ฮฒ : associative _ยท_ )
โ respect-assoc _ยท_ _ยท_ ฮฑ ฮฒ id (refl _ยท_)
๏ผ ((ฮป x y z โ refl ((x ยท y) ยท z) โ ap id (ฮฑ x y z)) ๏ผ ฮฒ)
remark _ยท_ ฮฑ ฮฒ = refl _
open sip hiding (homomorphic)
sns-data : SNS โ-amagma-structure ๐ค
sns-data = (ฮน , ฯ , ฮธ)
where
ฮน : (๐ง ๐ : โ-aMagma) โ โจ ๐ง โฉ โ โจ ๐ โฉ โ ๐ค ฬ
ฮน (X , _ยท_ , ฮฑ) (A , _*_ , ฮฒ) (f , i) = ฮฃ h ๊ homomorphic _ยท_ _*_ f
, respect-assoc _ยท_ _*_ ฮฑ ฮฒ f h
ฯ : (๐ง : โ-aMagma) โ ฮน ๐ง ๐ง (id-โ โจ ๐ง โฉ)
ฯ (X , _ยท_ , ฮฑ) = h , p
where
h : homomorphic _ยท_ _ยท_ id
h = refl _ยท_
p : (ฮป x y z โ refl ((x ยท y) ยท z) โ ap id (ฮฑ x y z)) ๏ผ ฮฑ
p = fe (ฮป x โ fe (ฮป y โ fe (ฮป z โ refl-left โ ap-id (ฮฑ x y z))))
u : (X : ๐ค ฬ ) โ โ s โ โ! t ๊ โ-amagma-structure X , ฮน (X , s) (X , t) (id-โ X)
u X (_ยท_ , ฮฑ) = c , ฯ
where
c : ฮฃ t ๊ โ-amagma-structure X , ฮน (X , _ยท_ , ฮฑ) (X , t) (id-โ X)
c = (_ยท_ , ฮฑ) , ฯ (X , _ยท_ , ฮฑ)
ฯ : (ฯ : ฮฃ t ๊ โ-amagma-structure X , ฮน (X , _ยท_ , ฮฑ) (X , t) (id-โ X)) โ c ๏ผ ฯ
ฯ ((_ยท_ , ฮฒ) , refl _ยท_ , k) = ฮณ
where
a : associative _ยท_
a x y z = refl ((x ยท y) ยท z) โ ap id (ฮฑ x y z)
g : singleton-type' a โ ฮฃ t ๊ โ-amagma-structure X , ฮน (X , _ยท_ , ฮฑ) (X , t) (id-โ X)
g (ฮฒ , k) = (_ยท_ , ฮฒ) , refl _ยท_ , k
i : is-subsingleton (singleton-type' a)
i = singletons-are-subsingletons _ (singleton-types'-are-singletons _ a)
q : ฮฑ , prโ (ฯ (X , _ยท_ , ฮฑ)) ๏ผ ฮฒ , k
q = i _ _
ฮณ : c ๏ผ (_ยท_ , ฮฒ) , refl _ยท_ , k
ฮณ = ap g q
ฮธ : {X : ๐ค ฬ } (s t : โ-amagma-structure X) โ is-equiv (canonical-map ฮน ฯ s t)
ฮธ {X} s = universal-fiberwise-equiv (ฮป t โ ฮน (X , s) (X , t) (id-โ X))
(u X s) s (canonical-map ฮน ฯ s)
_โ
_ : โ-aMagma โ โ-aMagma โ ๐ค ฬ
(X , _ยท_ , ฮฑ) โ
(Y , _*_ , ฮฒ) = ฮฃ f ๊ (X โ Y)
, is-equiv f
ร (ฮฃ h ๊ homomorphic _ยท_ _*_ f
, respect-assoc _ยท_ _*_ ฮฑ ฮฒ f h)
characterization-of-โ-aMagma-๏ผ : (A B : โ-aMagma) โ (A ๏ผ B) โ (A โ
B)
characterization-of-โ-aMagma-๏ผ = characterization-of-๏ผ ua sns-data
module group {๐ค : Universe} (ua : is-univalent ๐ค) where
hfe : hfunext ๐ค ๐ค
hfe = univalence-gives-hfunext ua
open sip
open sip-with-axioms
open monoid {๐ค} ua hiding (sns-data ; _โ
_)
group-structure : ๐ค ฬ โ ๐ค ฬ
group-structure X = ฮฃ s ๊ monoid-structure X , monoid-axioms X s
group-axiom : (X : ๐ค ฬ ) โ monoid-structure X โ ๐ค ฬ
group-axiom X (_ยท_ , e) = (x : X) โ ฮฃ x' ๊ X , (x ยท x' ๏ผ e) ร (x' ยท x ๏ผ e)
Group : ๐ค โบ ฬ
Group = ฮฃ X ๊ ๐ค ฬ , ฮฃ ((_ยท_ , e) , a) ๊ group-structure X , group-axiom X (_ยท_ , e)
inv-lemma : (X : ๐ค ฬ ) (_ยท_ : X โ X โ X) (e : X)
โ monoid-axioms X (_ยท_ , e)
โ (x y z : X)
โ (y ยท x) ๏ผ e
โ (x ยท z) ๏ผ e
โ y ๏ผ z
inv-lemma X _ยท_ e (s , l , r , a) x y z q p =
y ๏ผโจ (r y)โปยน โฉ
(y ยท e) ๏ผโจ ap (y ยท_) (p โปยน) โฉ
(y ยท (x ยท z)) ๏ผโจ (a y x z)โปยน โฉ
((y ยท x) ยท z) ๏ผโจ ap (_ยท z) q โฉ
(e ยท z) ๏ผโจ l z โฉ
z โ
group-axiom-is-subsingleton : (X : ๐ค ฬ )
โ (s : group-structure X)
โ is-subsingleton (group-axiom X (prโ s))
group-axiom-is-subsingleton X ((_ยท_ , e) , (s , l , r , a)) = ฮณ
where
i : (x : X) โ is-subsingleton (ฮฃ x' ๊ X , (x ยท x' ๏ผ e) ร (x' ยท x ๏ผ e))
i x (y , _ , q) (z , p , _) = u
where
t : y ๏ผ z
t = inv-lemma X _ยท_ e (s , l , r , a) x y z q p
u : (y , _ , q) ๏ผ (z , p , _)
u = to-subtype-๏ผ (ฮป x' โ ร-is-subsingleton (s (x ยท x') e) (s (x' ยท x) e)) t
ฮณ : is-subsingleton (group-axiom X (_ยท_ , e))
ฮณ = ฮ -is-subsingleton dfe i
sns-data : SNS (ฮป X โ ฮฃ s ๊ group-structure X , group-axiom X (prโ s)) ๐ค
sns-data = add-axioms
(ฮป X s โ group-axiom X (prโ s)) group-axiom-is-subsingleton
(monoid.sns-data ua)
_โ
_ : Group โ Group โ ๐ค ฬ
(X , ((_ยท_ , d) , _) , _) โ
(Y , ((_*_ , e) , _) , _) =
ฮฃ f ๊ (X โ Y), is-equiv f
ร ((ฮป x x' โ f (x ยท x')) ๏ผ (ฮป x x' โ f x * f x'))
ร (f d ๏ผ e)
characterization-of-group-๏ผ : (A B : Group) โ (A ๏ผ B) โ (A โ
B)
characterization-of-group-๏ผ = characterization-of-๏ผ ua sns-data
_โ
'_ : Group โ Group โ ๐ค ฬ
(X , ((_ยท_ , d) , _) , _) โ
' (Y , ((_*_ , e) , _) , _) =
ฮฃ f ๊ (X โ Y), is-equiv f
ร ((ฮป x x' โ f (x ยท x')) ๏ผ (ฮป x x' โ f x * f x'))
group-structure-of : (G : Group) โ group-structure โจ G โฉ
group-structure-of (X , ((_ยท_ , e) , i , l , r , a) , ฮณ) = (_ยท_ , e) , i , l , r , a
monoid-structure-of : (G : Group) โ monoid-structure โจ G โฉ
monoid-structure-of (X , ((_ยท_ , e) , i , l , r , a) , ฮณ) = (_ยท_ , e)
monoid-axioms-of : (G : Group) โ monoid-axioms โจ G โฉ (monoid-structure-of G)
monoid-axioms-of (X , ((_ยท_ , e) , i , l , r , a) , ฮณ) = i , l , r , a
multiplication : (G : Group) โ โจ G โฉ โ โจ G โฉ โ โจ G โฉ
multiplication (X , ((_ยท_ , e) , i , l , r , a) , ฮณ) = _ยท_
syntax multiplication G x y = x ยทโจ G โฉ y
unit : (G : Group) โ โจ G โฉ
unit (X , ((_ยท_ , e) , i , l , r , a) , ฮณ) = e
group-is-set : (G : Group)
โ is-set โจ G โฉ
group-is-set (X , ((_ยท_ , e) , i , l , r , a) , ฮณ) = i
unit-left : (G : Group) (x : โจ G โฉ)
โ unit G ยทโจ G โฉ x ๏ผ x
unit-left (X , ((_ยท_ , e) , i , l , r , a) , ฮณ) x = l x
unit-right : (G : Group) (x : โจ G โฉ)
โ x ยทโจ G โฉ unit G ๏ผ x
unit-right (X , ((_ยท_ , e) , i , l , r , a) , ฮณ) x = r x
assoc : (G : Group) (x y z : โจ G โฉ)
โ (x ยทโจ G โฉ y) ยทโจ G โฉ z ๏ผ x ยทโจ G โฉ (y ยทโจ G โฉ z)
assoc (X , ((_ยท_ , e) , i , l , r , a) , ฮณ) = a
inv : (G : Group) โ โจ G โฉ โ โจ G โฉ
inv (X , ((_ยท_ , e) , i , l , r , a) , ฮณ) x = prโ (ฮณ x)
inv-left : (G : Group) (x : โจ G โฉ)
โ inv G x ยทโจ G โฉ x ๏ผ unit G
inv-left (X , ((_ยท_ , e) , i , l , r , a) , ฮณ) x = prโ (prโ (ฮณ x))
inv-right : (G : Group) (x : โจ G โฉ)
โ x ยทโจ G โฉ inv G x ๏ผ unit G
inv-right (X , ((_ยท_ , e) , i , l , r , a) , ฮณ) x = prโ (prโ (ฮณ x))
preserves-multiplication : (G H : Group) โ (โจ G โฉ โ โจ H โฉ) โ ๐ค ฬ
preserves-multiplication G H f = (ฮป (x y : โจ G โฉ) โ f (x ยทโจ G โฉ y))
๏ผ (ฮป (x y : โจ G โฉ) โ f x ยทโจ H โฉ f y)
preserves-unit : (G H : Group) โ (โจ G โฉ โ โจ H โฉ) โ ๐ค ฬ
preserves-unit G H f = f (unit G) ๏ผ unit H
idempotent-is-unit : (G : Group) (x : โจ G โฉ)
โ x ยทโจ G โฉ x ๏ผ x
โ x ๏ผ unit G
idempotent-is-unit G x p = ฮณ
where
x' = inv G x
ฮณ = x ๏ผโจ (unit-left G x)โปยน โฉ
unit G ยทโจ G โฉ x ๏ผโจ (ap (ฮป - โ - ยทโจ G โฉ x) (inv-left G x))โปยน โฉ
(x' ยทโจ G โฉ x) ยทโจ G โฉ x ๏ผโจ assoc G x' x x โฉ
x' ยทโจ G โฉ (x ยทโจ G โฉ x) ๏ผโจ ap (ฮป - โ x' ยทโจ G โฉ -) p โฉ
x' ยทโจ G โฉ x ๏ผโจ inv-left G x โฉ
unit G โ
unit-preservation-lemma : (G H : Group) (f : โจ G โฉ โ โจ H โฉ)
โ preserves-multiplication G H f
โ preserves-unit G H f
unit-preservation-lemma G H f m = idempotent-is-unit H e p
where
e = f (unit G)
p = e ยทโจ H โฉ e ๏ผโจ ap (ฮป - โ - (unit G) (unit G)) (m โปยน) โฉ
f (unit G ยทโจ G โฉ unit G) ๏ผโจ ap f (unit-left G (unit G)) โฉ
e โ
inv-Lemma : (G : Group) (x y z : โจ G โฉ)
โ (y ยทโจ G โฉ x) ๏ผ unit G
โ (x ยทโจ G โฉ z) ๏ผ unit G
โ y ๏ผ z
inv-Lemma G = inv-lemma โจ G โฉ (multiplication G) (unit G) (monoid-axioms-of G)
one-left-inv : (G : Group) (x x' : โจ G โฉ)
โ (x' ยทโจ G โฉ x) ๏ผ unit G
โ x' ๏ผ inv G x
one-left-inv G x x' p = inv-Lemma G x x' (inv G x) p (inv-right G x)
one-right-inv : (G : Group) (x x' : โจ G โฉ)
โ (x ยทโจ G โฉ x') ๏ผ unit G
โ x' ๏ผ inv G x
one-right-inv G x x' p = (inv-Lemma G x (inv G x) x' (inv-left G x) p)โปยน
preserves-inv : (G H : Group) โ (โจ G โฉ โ โจ H โฉ) โ ๐ค ฬ
preserves-inv G H f = (x : โจ G โฉ) โ f (inv G x) ๏ผ inv H (f x)
inv-preservation-lemma : (G H : Group) (f : โจ G โฉ โ โจ H โฉ)
โ preserves-multiplication G H f
โ preserves-inv G H f
inv-preservation-lemma G H f m x = ฮณ
where
p = f (inv G x) ยทโจ H โฉ f x ๏ผโจ (ap (ฮป - โ - (inv G x) x) m)โปยน โฉ
f (inv G x ยทโจ G โฉ x) ๏ผโจ ap f (inv-left G x) โฉ
f (unit G) ๏ผโจ unit-preservation-lemma G H f m โฉ
unit H โ
ฮณ : f (inv G x) ๏ผ inv H (f x)
ฮณ = one-left-inv H (f x) (f (inv G x)) p
is-homomorphism : (G H : Group) โ (โจ G โฉ โ โจ H โฉ) โ ๐ค ฬ
is-homomorphism G H f = preserves-multiplication G H f
ร preserves-unit G H f
preservation-of-mult-is-subsingleton : (G H : Group) (f : โจ G โฉ โ โจ H โฉ)
โ is-subsingleton (preserves-multiplication G H f)
preservation-of-mult-is-subsingleton G H f = j
where
j : is-subsingleton (preserves-multiplication G H f)
j = ฮ -is-set hfe
(ฮป _ โ ฮ -is-set hfe
(ฮป _ โ group-is-set H))
(ฮป (x y : โจ G โฉ) โ f (x ยทโจ G โฉ y))
(ฮป (x y : โจ G โฉ) โ f x ยทโจ H โฉ f y)
being-homomorphism-is-subsingleton : (G H : Group) (f : โจ G โฉ โ โจ H โฉ)
โ is-subsingleton (is-homomorphism G H f)
being-homomorphism-is-subsingleton G H f = i
where
i : is-subsingleton (is-homomorphism G H f)
i = ร-is-subsingleton
(preservation-of-mult-is-subsingleton G H f)
(group-is-set H (f (unit G)) (unit H))
notions-of-homomorphism-agree : (G H : Group) (f : โจ G โฉ โ โจ H โฉ)
โ is-homomorphism G H f
โ preserves-multiplication G H f
notions-of-homomorphism-agree G H f = ฮณ
where
ฮฑ : is-homomorphism G H f โ preserves-multiplication G H f
ฮฑ = prโ
ฮฒ : preserves-multiplication G H f โ is-homomorphism G H f
ฮฒ m = m , unit-preservation-lemma G H f m
ฮณ : is-homomorphism G H f โ preserves-multiplication G H f
ฮณ = logically-equivalent-subsingletons-are-equivalent _ _
(being-homomorphism-is-subsingleton G H f)
(preservation-of-mult-is-subsingleton G H f)
(ฮฑ , ฮฒ)
โ
-agreement : (G H : Group) โ (G โ
H) โ (G โ
' H)
โ
-agreement G H = ฮฃ-cong (ฮป f โ ฮฃ-cong (ฮป _ โ notions-of-homomorphism-agree G H f))
forget-unit-preservation : (G H : Group) โ (G โ
H) โ (G โ
' H)
forget-unit-preservation G H (f , e , m , _) = f , e , m
NB : (G H : Group) โ โ โ
-agreement G H โ ๏ผ forget-unit-preservation G H
NB G H = refl _
forget-unit-preservation-is-equiv : (G H : Group)
โ is-equiv (forget-unit-preservation G H)
forget-unit-preservation-is-equiv G H = โโ-is-equiv (โ
-agreement G H)
module subgroup
(๐ค : Universe)
(ua : Univalence)
where
gfe : global-dfunext
gfe = univalence-gives-global-dfunext ua
open sip
open monoid {๐ค} (ua ๐ค) hiding (sns-data ; _โ
_)
open group {๐ค} (ua ๐ค)
module ambient (G : Group) where
_ยท_ : โจ G โฉ โ โจ G โฉ โ โจ G โฉ
x ยท y = x ยทโจ G โฉ y
infixl 42 _ยท_
group-closed : (โจ G โฉ โ ๐ฅ ฬ ) โ ๐ค โ ๐ฅ ฬ
group-closed ๐ = ๐ (unit G)
ร ((x y : โจ G โฉ) โ ๐ x โ ๐ y โ ๐ (x ยท y))
ร ((x : โจ G โฉ) โ ๐ x โ ๐ (inv G x))
Subgroups : ๐ค โบ ฬ
Subgroups = ฮฃ A ๊ ๐ โจ G โฉ , group-closed (_โ A)
โช_โซ : Subgroups โ ๐ โจ G โฉ
โช A , u , c , ฮน โซ = A
being-group-closed-subset-is-subsingleton : (A : ๐ โจ G โฉ) โ is-subsingleton (group-closed (_โ A))
being-group-closed-subset-is-subsingleton A = ร-is-subsingleton
(โ-is-subsingleton A (unit G))
(ร-is-subsingleton
(ฮ -is-subsingleton dfe
(ฮป x โ ฮ -is-subsingleton dfe
(ฮป y โ ฮ -is-subsingleton dfe
(ฮป _ โ ฮ -is-subsingleton dfe
(ฮป _ โ โ-is-subsingleton A (x ยท y))))))
(ฮ -is-subsingleton dfe
(ฮป x โ ฮ -is-subsingleton dfe
(ฮป _ โ โ-is-subsingleton A (inv G x)))))
โชโซ-is-embedding : is-embedding โช_โซ
โชโซ-is-embedding = prโ-embedding being-group-closed-subset-is-subsingleton
ap-โชโซ : (S T : Subgroups) โ S ๏ผ T โ โช S โซ ๏ผ โช T โซ
ap-โชโซ S T = ap โช_โซ
ap-โชโซ-is-equiv : (S T : Subgroups) โ is-equiv (ap-โชโซ S T)
ap-โชโซ-is-equiv = embedding-gives-ap-is-equiv โช_โซ โชโซ-is-embedding
subgroups-form-a-set : is-set Subgroups
subgroups-form-a-set S T = equiv-to-subsingleton
(ap-โชโซ S T , ap-โชโซ-is-equiv S T)
(powersets-are-sets' ua โช S โซ โช T โซ)
subgroup-equality : (S T : Subgroups)
โ (S ๏ผ T)
โ ((x : โจ G โฉ) โ (x โ โช S โซ) โ (x โ โช T โซ))
subgroup-equality S T = ฮณ
where
f : S ๏ผ T โ (x : โจ G โฉ) โ x โ โช S โซ โ x โ โช T โซ
f p x = transport (ฮป - โ x โ โช - โซ) p , transport (ฮป - โ x โ โช - โซ) (p โปยน)
h : ((x : โจ G โฉ) โ x โ โช S โซ โ x โ โช T โซ) โ โช S โซ ๏ผ โช T โซ
h ฯ = subset-extensionality' ua ฮฑ ฮฒ
where
ฮฑ : โช S โซ โ โช T โซ
ฮฑ x = lr-implication (ฯ x)
ฮฒ : โช T โซ โ โช S โซ
ฮฒ x = rl-implication (ฯ x)
g : ((x : โจ G โฉ) โ x โ โช S โซ โ x โ โช T โซ) โ S ๏ผ T
g = inverse (ap-โชโซ S T) (ap-โชโซ-is-equiv S T) โ h
ฮณ : (S ๏ผ T) โ ((x : โจ G โฉ) โ x โ โช S โซ โ x โ โช T โซ)
ฮณ = logically-equivalent-subsingletons-are-equivalent _ _
(subgroups-form-a-set S T)
(ฮ -is-subsingleton dfe
(ฮป x โ ร-is-subsingleton
(ฮ -is-subsingleton dfe (ฮป _ โ โ-is-subsingleton โช T โซ x))
(ฮ -is-subsingleton dfe (ฮป _ โ โ-is-subsingleton โช S โซ x))))
(f , g)
T : ๐ค ฬ โ ๐ค ฬ
T X = ฮฃ ((_ยท_ , e) , a) ๊ group-structure X , group-axiom X (_ยท_ , e)
module _ {X : ๐ค ฬ } (h : X โ โจ G โฉ) (e : is-embedding h) where
private
h-lc : left-cancellable h
h-lc = embeddings-are-lc h e
having-group-closed-fiber-is-subsingleton : is-subsingleton (group-closed (fiber h))
having-group-closed-fiber-is-subsingleton = being-group-closed-subset-is-subsingleton
(ฮป x โ (fiber h x , e x))
at-most-one-homomorphic-structure : is-subsingleton (ฮฃ ฯ ๊ T X , is-homomorphism (X , ฯ) G h)
at-most-one-homomorphic-structure
((((_*_ , unitH) , maxioms) , gaxiom) , (pmult , punit))
((((_*'_ , unitH') , maxioms') , gaxiom') , (pmult' , punit'))
= ฮณ
where
ฯ ฯ' : T X
ฯ = ((_*_ , unitH) , maxioms) , gaxiom
ฯ' = ((_*'_ , unitH') , maxioms') , gaxiom'
i : is-homomorphism (X , ฯ) G h
i = (pmult , punit)
i' : is-homomorphism (X , ฯ') G h
i' = (pmult' , punit')
p : _*_ ๏ผ _*'_
p = gfe (ฮป x โ gfe (ฮป y โ h-lc (h (x * y) ๏ผโจ ap (ฮป - โ - x y) pmult โฉ
h x ยท h y ๏ผโจ (ap (ฮป - โ - x y) pmult')โปยน โฉ
h (x *' y) โ)))
q : unitH ๏ผ unitH'
q = h-lc (h unitH ๏ผโจ punit โฉ
unit G ๏ผโจ punit' โปยน โฉ
h unitH' โ)
r : (_*_ , unitH) ๏ผ (_*'_ , unitH')
r = to-ร-๏ผ (p , q)
ฮด : ฯ ๏ผ ฯ'
ฮด = to-subtype-๏ผ
(group-axiom-is-subsingleton X)
(to-subtype-๏ผ
(monoid-axioms-subsingleton X)
r)
ฮณ : (ฯ , i) ๏ผ (ฯ' , i')
ฮณ = to-subtype-๏ผ (ฮป ฯ โ being-homomorphism-is-subsingleton (X , ฯ) G h) ฮด
group-closed-fiber-gives-homomorphic-structure : group-closed (fiber h)
โ (ฮฃ ฯ ๊ T X , is-homomorphism (X , ฯ) G h)
group-closed-fiber-gives-homomorphic-structure (unitc , mulc , invc) = ฯ , i
where
ฯ : (x : X) โ fiber h (h x)
ฯ x = (x , refl (h x))
unitH : X
unitH = fiber-point unitc
_*_ : X โ X โ X
x * y = fiber-point (mulc (h x) (h y) (ฯ x) (ฯ y))
invH : X โ X
invH x = fiber-point (invc (h x) (ฯ x))
pmul : (x y : X) โ h (x * y) ๏ผ h x ยท h y
pmul x y = fiber-identification (mulc (h x) (h y) (ฯ x) (ฯ y))
punit : h unitH ๏ผ unit G
punit = fiber-identification unitc
pinv : (x : X) โ h (invH x) ๏ผ inv G (h x)
pinv x = fiber-identification (invc (h x) (ฯ x))
unitH-left : (x : X) โ unitH * x ๏ผ x
unitH-left x = h-lc (h (unitH * x) ๏ผโจ pmul unitH x โฉ
h unitH ยท h x ๏ผโจ ap (_ยท h x) punit โฉ
unit G ยท h x ๏ผโจ unit-left G (h x) โฉ
h x โ)
unitH-right : (x : X) โ x * unitH ๏ผ x
unitH-right x = h-lc (h (x * unitH) ๏ผโจ pmul x unitH โฉ
h x ยท h unitH ๏ผโจ ap (h x ยท_) punit โฉ
h x ยท unit G ๏ผโจ unit-right G (h x) โฉ
h x โ)
assocH : (x y z : X) โ ((x * y) * z) ๏ผ (x * (y * z))
assocH x y z = h-lc (h ((x * y) * z) ๏ผโจ pmul (x * y) z โฉ
h (x * y) ยท h z ๏ผโจ ap (_ยท h z) (pmul x y) โฉ
(h x ยท h y) ยท h z ๏ผโจ assoc G (h x) (h y) (h z) โฉ
h x ยท (h y ยท h z) ๏ผโจ (ap (h x ยท_) (pmul y z))โปยน โฉ
h x ยท h (y * z) ๏ผโจ (pmul x (y * z))โปยน โฉ
h (x * (y * z)) โ)
group-axiomH : (x : X) โ ฮฃ x' ๊ X , (x * x' ๏ผ unitH) ร (x' * x ๏ผ unitH)
group-axiomH x = invH x ,
h-lc (h (x * invH x) ๏ผโจ pmul x (invH x) โฉ
h x ยท h (invH x) ๏ผโจ ap (h x ยท_) (pinv x) โฉ
h x ยท inv G (h x) ๏ผโจ inv-right G (h x) โฉ
unit G ๏ผโจ punit โปยน โฉ
h unitH โ),
h-lc ((h (invH x * x) ๏ผโจ pmul (invH x) x โฉ
h (invH x) ยท h x ๏ผโจ ap (_ยท h x) (pinv x) โฉ
inv G (h x) ยท h x ๏ผโจ inv-left G (h x) โฉ
unit G ๏ผโจ punit โปยน โฉ
h unitH โ))
j : is-set X
j = subtypes-of-sets-are-sets' h h-lc (group-is-set G)
ฯ : T X
ฯ = ((_*_ , unitH) , (j , unitH-left , unitH-right , assocH)) , group-axiomH
i : is-homomorphism (X , ฯ) G h
i = gfe (ฮป x โ gfe (pmul x)) , punit
homomorphic-structure-gives-group-closed-fiber : (ฮฃ ฯ ๊ T X , is-homomorphism (X , ฯ) G h)
โ group-closed (fiber h)
homomorphic-structure-gives-group-closed-fiber
((((_*_ , unitH) , maxioms) , gaxiom) , (pmult , punit))
= (unitc , mulc , invc)
where
H : Group
H = X , ((_*_ , unitH) , maxioms) , gaxiom
unitc : fiber h (unit G)
unitc = unitH , punit
mulc : ((x y : โจ G โฉ) โ fiber h x โ fiber h y โ fiber h (x ยท y))
mulc x y (a , p) (b , q) = (a * b) ,
(h (a * b) ๏ผโจ ap (ฮป - โ - a b) pmult โฉ
h a ยท h b ๏ผโจ apโ (ฮป - -' โ - ยท -') p q โฉ
x ยท y โ)
invc : ((x : โจ G โฉ) โ fiber h x โ fiber h (inv G x))
invc x (a , p) = inv H a ,
(h (inv H a) ๏ผโจ inv-preservation-lemma H G h pmult a โฉ
inv G (h a) ๏ผโจ ap (inv G) p โฉ
inv G x โ)
fiber-structure-lemma : group-closed (fiber h)
โ (ฮฃ ฯ ๊ T X , is-homomorphism (X , ฯ) G h)
fiber-structure-lemma = logically-equivalent-subsingletons-are-equivalent _ _
having-group-closed-fiber-is-subsingleton
at-most-one-homomorphic-structure
(group-closed-fiber-gives-homomorphic-structure ,
homomorphic-structure-gives-group-closed-fiber)
characterization-of-the-type-of-subgroups : Subgroups โ (ฮฃ H ๊ Group
, ฮฃ h ๊ (โจ H โฉ โ โจ G โฉ)
, is-embedding h
ร is-homomorphism H G h)
characterization-of-the-type-of-subgroups =
Subgroups โโจ i โฉ
(ฮฃ A ๊ ๐ โจ G โฉ , group-closed (_โ A)) โโจ ii โฉ
(ฮฃ (X , h , e) ๊ Subtypes โจ G โฉ , group-closed (fiber h)) โโจ iii โฉ
(ฮฃ X ๊ ๐ค ฬ , ฮฃ (h , e) ๊ X โช โจ G โฉ , group-closed (fiber h)) โโจ iv โฉ
(ฮฃ X ๊ ๐ค ฬ , ฮฃ (h , e) ๊ X โช โจ G โฉ , ฮฃ ฯ ๊ T X , is-homomorphism (X , ฯ) G h) โโจ v โฉ
(ฮฃ X ๊ ๐ค ฬ , ฮฃ h ๊ (X โ โจ G โฉ) , ฮฃ e ๊ is-embedding h , ฮฃ ฯ ๊ T X , is-homomorphism (X , ฯ) G h) โโจ vi โฉ
(ฮฃ X ๊ ๐ค ฬ , ฮฃ h ๊ (X โ โจ G โฉ) , ฮฃ ฯ ๊ T X , ฮฃ e ๊ is-embedding h , is-homomorphism (X , ฯ) G h) โโจ vii โฉ
(ฮฃ X ๊ ๐ค ฬ , ฮฃ ฯ ๊ T X , ฮฃ h ๊ (X โ โจ G โฉ) , is-embedding h ร is-homomorphism (X , ฯ) G h) โโจ viii โฉ
(ฮฃ H ๊ Group , ฮฃ h ๊ (โจ H โฉ โ โจ G โฉ) , is-embedding h ร is-homomorphism H G h) โ
where
ฯ : Subtypes โจ G โฉ โ ๐ โจ G โฉ
ฯ = ฯ-special is-subsingleton โจ G โฉ
j : is-equiv ฯ
j = ฯ-special-is-equiv (ua ๐ค) gfe is-subsingleton โจ G โฉ
i = id-โ Subgroups
ii = ฮฃ-change-of-variable (ฮป (A : ๐ โจ G โฉ) โ group-closed (_โ A)) ฯ j
iii = ฮฃ-assoc
iv = ฮฃ-cong (ฮป X โ ฮฃ-cong (ฮป (h , e) โ fiber-structure-lemma h e))
v = ฮฃ-cong (ฮป X โ ฮฃ-assoc)
vi = ฮฃ-cong (ฮป X โ ฮฃ-cong (ฮป h โ ฮฃ-flip))
vii = ฮฃ-cong (ฮป X โ ฮฃ-flip)
viii = โ-sym ฮฃ-assoc
induced-group : Subgroups โ Group
induced-group S = prโ (โ characterization-of-the-type-of-subgroups โ S)
module slice
{๐ค ๐ฅ : Universe}
(R : ๐ฅ ฬ )
where
open sip
S : ๐ค ฬ โ ๐ค โ ๐ฅ ฬ
S X = X โ R
sns-data : SNS S (๐ค โ ๐ฅ)
sns-data = (ฮน , ฯ , ฮธ)
where
ฮน : (A B : ฮฃ S) โ โจ A โฉ โ โจ B โฉ โ ๐ค โ ๐ฅ ฬ
ฮน (X , g) (Y , h) (f , _) = (g ๏ผ h โ f)
ฯ : (A : ฮฃ S) โ ฮน A A (id-โ โจ A โฉ)
ฯ (X , g) = refl g
k : {X : ๐ค ฬ } {g h : S X} โ canonical-map ฮน ฯ g h โผ ๐๐ (g ๏ผ h)
k (refl g) = refl (refl g)
ฮธ : {X : ๐ค ฬ } (g h : S X) โ is-equiv (canonical-map ฮน ฯ g h)
ฮธ g h = equivs-closed-under-โผ (id-is-equiv (g ๏ผ h)) k
_โ
_ : ๐ค / R โ ๐ค / R โ ๐ค โ ๐ฅ ฬ
(X , g) โ
(Y , h) = ฮฃ f ๊ (X โ Y), is-equiv f ร (g ๏ผ h โ f )
characterization-of-/-๏ผ : is-univalent ๐ค โ (A B : ๐ค / R) โ (A ๏ผ B) โ (A โ
B)
characterization-of-/-๏ผ ua = characterization-of-๏ผ ua sns-data
module generalized-metric-space
{๐ค ๐ฅ : Universe}
(R : ๐ฅ ฬ )
(axioms : (X : ๐ค ฬ ) โ (X โ X โ R) โ ๐ค โ ๐ฅ ฬ )
(axiomss : (X : ๐ค ฬ ) (d : X โ X โ R) โ is-subsingleton (axioms X d))
where
open sip
open sip-with-axioms
S : ๐ค ฬ โ ๐ค โ ๐ฅ ฬ
S X = X โ X โ R
sns-data : SNS S (๐ค โ ๐ฅ)
sns-data = (ฮน , ฯ , ฮธ)
where
ฮน : (A B : ฮฃ S) โ โจ A โฉ โ โจ B โฉ โ ๐ค โ ๐ฅ ฬ
ฮน (X , d) (Y , e) (f , _) = (d ๏ผ ฮป x x' โ e (f x) (f x'))
ฯ : (A : ฮฃ S) โ ฮน A A (id-โ โจ A โฉ)
ฯ (X , d) = refl d
h : {X : ๐ค ฬ } {d e : S X} โ canonical-map ฮน ฯ d e โผ ๐๐ (d ๏ผ e)
h (refl d) = refl (refl d)
ฮธ : {X : ๐ค ฬ } (d e : S X) โ is-equiv (canonical-map ฮน ฯ d e)
ฮธ d e = equivs-closed-under-โผ (id-is-equiv (d ๏ผ e)) h
M : ๐ค โบ โ ๐ฅ ฬ
M = ฮฃ X ๊ ๐ค ฬ , ฮฃ d ๊ (X โ X โ R) , axioms X d
_โ
_ : M โ M โ ๐ค โ ๐ฅ ฬ
(X , d , _) โ
(Y , e , _) = ฮฃ f ๊ (X โ Y), is-equiv f
ร (d ๏ผ ฮป x x' โ e (f x) (f x'))
characterization-of-M-๏ผ : is-univalent ๐ค
โ (A B : M)
โ (A ๏ผ B) โ (A โ
B)
characterization-of-M-๏ผ ua = characterization-of-๏ผ-with-axioms ua
sns-data
axioms axiomss
module generalized-topological-space
(๐ค ๐ฅ : Universe)
(R : ๐ฅ ฬ )
(axioms : (X : ๐ค ฬ ) โ ((X โ R) โ R) โ ๐ค โ ๐ฅ ฬ )
(axiomss : (X : ๐ค ฬ ) (๐ : (X โ R) โ R) โ is-subsingleton (axioms X ๐))
where
open sip
open sip-with-axioms
โ : ๐ฆ ฬ โ ๐ฅ โ ๐ฆ ฬ
โ X = X โ R
_โ_ : {X : ๐ฆ ฬ } โ X โ โ X โ R
x โ A = A x
inverse-image : {X Y : ๐ค ฬ } โ (X โ Y) โ โ Y โ โ X
inverse-image f B = ฮป x โ f x โ B
โโ : ๐ค ฬ โ ๐ค โ ๐ฅ ฬ
โโ X = โ (โ X)
Space : ๐ค โบ โ ๐ฅ ฬ
Space = ฮฃ X ๊ ๐ค ฬ , ฮฃ ๐ ๊ โโ X , axioms X ๐
sns-data : SNS โโ (๐ค โ ๐ฅ)
sns-data = (ฮน , ฯ , ฮธ)
where
ฮน : (A B : ฮฃ โโ) โ โจ A โฉ โ โจ B โฉ โ ๐ค โ ๐ฅ ฬ
ฮน (X , ๐X) (Y , ๐Y) (f , _) = (ฮป (V : โ Y) โ inverse-image f V โ ๐X) ๏ผ ๐Y
ฯ : (A : ฮฃ โโ) โ ฮน A A (id-โ โจ A โฉ)
ฯ (X , ๐) = refl ๐
h : {X : ๐ค ฬ } {๐ ๐' : โโ X} โ canonical-map ฮน ฯ ๐ ๐' โผ ๐๐ (๐ ๏ผ ๐')
h (refl ๐) = refl (refl ๐)
ฮธ : {X : ๐ค ฬ } (๐ ๐' : โโ X) โ is-equiv (canonical-map ฮน ฯ ๐ ๐')
ฮธ {X} ๐ ๐' = equivs-closed-under-โผ (id-is-equiv (๐ ๏ผ ๐')) h
_โ
_ : Space โ Space โ ๐ค โ ๐ฅ ฬ
(X , ๐X , _) โ
(Y , ๐Y , _) =
ฮฃ f ๊ (X โ Y), is-equiv f
ร ((ฮป V โ inverse-image f V โ ๐X) ๏ผ ๐Y)
characterization-of-Space-๏ผ : is-univalent ๐ค
โ (A B : Space)
โ (A ๏ผ B) โ (A โ
B)
characterization-of-Space-๏ผ ua = characterization-of-๏ผ-with-axioms ua
sns-data axioms axiomss
_โ
'_ : Space โ Space โ ๐ค โ ๐ฅ ฬ
(X , F , _) โ
' (Y , G , _) =
ฮฃ f ๊ (X โ Y), is-equiv f
ร ((ฮป (v : Y โ R) โ F (v โ f)) ๏ผ G)
characterization-of-Space-๏ผ' : is-univalent ๐ค
โ (A B : Space)
โ (A ๏ผ B) โ (A โ
' B)
characterization-of-Space-๏ผ' = characterization-of-Space-๏ผ
module selection-space
(๐ค ๐ฅ : Universe)
(R : ๐ฅ ฬ )
(axioms : (X : ๐ค ฬ ) โ ((X โ R) โ X) โ ๐ค โ ๐ฅ ฬ )
(axiomss : (X : ๐ค ฬ ) (ฮต : (X โ R) โ X) โ is-subsingleton (axioms X ฮต))
where
open sip
open sip-with-axioms
S : ๐ค ฬ โ ๐ค โ ๐ฅ ฬ
S X = (X โ R) โ X
SelectionSpace : ๐ค โบ โ ๐ฅ ฬ
SelectionSpace = ฮฃ X ๊ ๐ค ฬ , ฮฃ ฮต ๊ S X , axioms X ฮต
sns-data : SNS S (๐ค โ ๐ฅ)
sns-data = (ฮน , ฯ , ฮธ)
where
ฮน : (A B : ฮฃ S) โ โจ A โฉ โ โจ B โฉ โ ๐ค โ ๐ฅ ฬ
ฮน (X , ฮต) (Y , ฮด) (f , _) = (ฮป (q : Y โ R) โ f (ฮต (q โ f))) ๏ผ ฮด
ฯ : (A : ฮฃ S) โ ฮน A A (id-โ โจ A โฉ)
ฯ (X , ฮต) = refl ฮต
ฮธ : {X : ๐ค ฬ } (ฮต ฮด : S X) โ is-equiv (canonical-map ฮน ฯ ฮต ฮด)
ฮธ {X} ฮต ฮด = ฮณ
where
h : canonical-map ฮน ฯ ฮต ฮด โผ ๐๐ (ฮต ๏ผ ฮด)
h (refl ฮต) = refl (refl ฮต)
ฮณ : is-equiv (canonical-map ฮน ฯ ฮต ฮด)
ฮณ = equivs-closed-under-โผ (id-is-equiv (ฮต ๏ผ ฮด)) h
_โ
_ : SelectionSpace โ SelectionSpace โ ๐ค โ ๐ฅ ฬ
(X , ฮต , _) โ
(Y , ฮด , _) =
ฮฃ f ๊ (X โ Y), is-equiv f
ร ((ฮป (q : Y โ R) โ f (ฮต (q โ f))) ๏ผ ฮด)
characterization-of-selection-space-๏ผ : is-univalent ๐ค
โ (A B : SelectionSpace)
โ (A ๏ผ B) โ (A โ
B)
characterization-of-selection-space-๏ผ ua = characterization-of-๏ผ-with-axioms ua
sns-data
axioms axiomss
module contrived-example (๐ค : Universe) where
open sip
contrived-๏ผ : is-univalent ๐ค โ
(X Y : ๐ค ฬ ) (ฯ : (X โ X) โ X) (ฮณ : (Y โ Y) โ Y)
โ
((X , ฯ) ๏ผ (Y , ฮณ)) โ (ฮฃ f ๊ (X โ Y)
, ฮฃ i ๊ is-equiv f
, (ฮป (g : Y โ Y) โ f (ฯ (inverse f i โ g โ f))) ๏ผ ฮณ)
contrived-๏ผ ua X Y ฯ ฮณ =
characterization-of-๏ผ ua
((ฮป (X , ฯ) (Y , ฮณ) (f , i) โ (ฮป (g : Y โ Y) โ f (ฯ (inverse f i โ g โ f))) ๏ผ ฮณ) ,
(ฮป (X , ฯ) โ refl ฯ) ,
(ฮป ฯ ฮณ โ equivs-closed-under-โผ (id-is-equiv (ฯ ๏ผ ฮณ)) (ฮป {(refl ฯ) โ refl (refl ฯ)})))
(X , ฯ) (Y , ฮณ)
module generalized-functor-algebra
{๐ค ๐ฅ : Universe}
(F : ๐ค ฬ โ ๐ฅ ฬ )
(๐ : {X Y : ๐ค ฬ } โ (X โ Y) โ F X โ F Y)
(๐-id : {X : ๐ค ฬ } โ ๐ (๐๐ X) ๏ผ ๐๐ (F X))
where
open sip
S : ๐ค ฬ โ ๐ค โ ๐ฅ ฬ
S X = F X โ X
sns-data : SNS S (๐ค โ ๐ฅ)
sns-data = (ฮน , ฯ , ฮธ)
where
ฮน : (A B : ฮฃ S) โ โจ A โฉ โ โจ B โฉ โ ๐ค โ ๐ฅ ฬ
ฮน (X , ฮฑ) (Y , ฮฒ) (f , _) = f โ ฮฑ ๏ผ ฮฒ โ ๐ f
ฯ : (A : ฮฃ S) โ ฮน A A (id-โ โจ A โฉ)
ฯ (X , ฮฑ) = ฮฑ ๏ผโจ ap (ฮฑ โ_) (๐-id โปยน) โฉ
ฮฑ โ ๐ id โ
ฮธ : {X : ๐ค ฬ } (ฮฑ ฮฒ : S X) โ is-equiv (canonical-map ฮน ฯ ฮฑ ฮฒ)
ฮธ {X} ฮฑ ฮฒ = ฮณ
where
c : ฮฑ ๏ผ ฮฒ โ ฮฑ ๏ผ ฮฒ โ ๐ id
c = transport (ฮฑ ๏ผ_) (ฯ (X , ฮฒ))
i : is-equiv c
i = transport-is-equiv (ฮฑ ๏ผ_) (ฯ (X , ฮฒ))
h : canonical-map ฮน ฯ ฮฑ ฮฒ โผ c
h (refl _) = ฯ (X , ฮฑ) ๏ผโจ refl-left โปยน โฉ
refl ฮฑ โ ฯ (X , ฮฑ) โ
ฮณ : is-equiv (canonical-map ฮน ฯ ฮฑ ฮฒ)
ฮณ = equivs-closed-under-โผ i h
characterization-of-functor-algebra-๏ผ : is-univalent ๐ค
โ (X Y : ๐ค ฬ ) (ฮฑ : F X โ X) (ฮฒ : F Y โ Y)
โ ((X , ฮฑ) ๏ผ (Y , ฮฒ)) โ (ฮฃ f ๊ (X โ Y), is-equiv f ร (f โ ฮฑ ๏ผ ฮฒ โ ๐ f))
characterization-of-functor-algebra-๏ผ ua X Y ฮฑ ฮฒ =
characterization-of-๏ผ ua sns-data (X , ฮฑ) (Y , ฮฒ)
type-valued-preorder-S : ๐ค ฬ โ ๐ค โ (๐ฅ โบ) ฬ
type-valued-preorder-S {๐ค} {๐ฅ} X = ฮฃ _โค_ ๊ (X โ X โ ๐ฅ ฬ )
, ((x : X) โ x โค x)
ร ((x y z : X) โ x โค y โ y โค z โ x โค z)
module type-valued-preorder
(๐ค ๐ฅ : Universe)
(ua : Univalence)
where
open sip
fe : global-dfunext
fe = univalence-gives-global-dfunext ua
hfe : global-hfunext
hfe = univalence-gives-global-hfunext ua
S : ๐ค ฬ โ ๐ค โ (๐ฅ โบ) ฬ
S = type-valued-preorder-S {๐ค} {๐ฅ}
Type-valued-preorder : (๐ค โ ๐ฅ) โบ ฬ
Type-valued-preorder = ฮฃ S
Ob : ฮฃ S โ ๐ค ฬ
Ob (X , homX , idX , compX ) = X
hom : (๐ง : ฮฃ S) โ Ob ๐ง โ Ob ๐ง โ ๐ฅ ฬ
hom (X , homX , idX , compX) = homX
๐พ๐น : (๐ง : ฮฃ S) (x : Ob ๐ง) โ hom ๐ง x x
๐พ๐น (X , homX , idX , compX) = idX
comp : (๐ง : ฮฃ S) (x y z : Ob ๐ง) โ hom ๐ง x y โ hom ๐ง y z โ hom ๐ง x z
comp (X , homX , idX , compX) = compX
functorial : (๐ง ๐ : ฮฃ S)
โ (F : Ob ๐ง โ Ob ๐)
โ ((x y : Ob ๐ง) โ hom ๐ง x y โ hom ๐ (F x) (F y))
โ ๐ค โ ๐ฅ ฬ
functorial ๐ง ๐ F ๐' = pidentity ร pcomposition
where
_o_ : {x y z : Ob ๐ง} โ hom ๐ง y z โ hom ๐ง x y โ hom ๐ง x z
g o f = comp ๐ง _ _ _ f g
_โก_ : {a b c : Ob ๐} โ hom ๐ b c โ hom ๐ a b โ hom ๐ a c
g โก f = comp ๐ _ _ _ f g
๐ : {x y : Ob ๐ง} โ hom ๐ง x y โ hom ๐ (F x) (F y)
๐ f = ๐' _ _ f
pidentity = (ฮป x โ ๐ (๐พ๐น ๐ง x)) ๏ผ (ฮป x โ ๐พ๐น ๐ (F x))
pcomposition = (ฮป x y z (f : hom ๐ง x y) (g : hom ๐ง y z) โ ๐ (g o f))
๏ผ (ฮป x y z (f : hom ๐ง x y) (g : hom ๐ง y z) โ ๐ g โก ๐ f)
sns-data : SNS S (๐ค โ (๐ฅ โบ))
sns-data = (ฮน , ฯ , ฮธ)
where
ฮน : (๐ง ๐ : ฮฃ S) โ โจ ๐ง โฉ โ โจ ๐ โฉ โ ๐ค โ (๐ฅ โบ) ฬ
ฮน ๐ง ๐ (F , _) = ฮฃ p ๊ hom ๐ง ๏ผ (ฮป x y โ hom ๐ (F x) (F y))
, functorial ๐ง ๐ F (ฮป x y โ transport (ฮป - โ - x y) p)
ฯ : (๐ง : ฮฃ S) โ ฮน ๐ง ๐ง (id-โ โจ ๐ง โฉ)
ฯ ๐ง = refl (hom ๐ง) , refl (๐พ๐น ๐ง) , refl (comp ๐ง)
ฮธ : {X : ๐ค ฬ } (s t : S X) โ is-equiv (canonical-map ฮน ฯ s t)
ฮธ {X} (homX , idX , compX) (homA , idA , compA) = g
where
ฯ = canonical-map ฮน ฯ (homX , idX , compX) (homA , idA , compA)
ฮณ : codomain ฯ โ domain ฯ
ฮณ (refl _ , refl _ , refl _) = refl _
ฮท : ฮณ โ ฯ โผ id
ฮท (refl _) = refl _
ฮต : ฯ โ ฮณ โผ id
ฮต (refl _ , refl _ , refl _) = refl _
g : is-equiv ฯ
g = invertibles-are-equivs ฯ (ฮณ , ฮท , ฮต)
lemma : (๐ง ๐ : ฮฃ S) (F : Ob ๐ง โ Ob ๐)
โ
(ฮฃ p ๊ hom ๐ง ๏ผ (ฮป x y โ hom ๐ (F x) (F y))
, functorial ๐ง ๐ F (ฮป x y โ transport (ฮป - โ - x y) p))
โ
(ฮฃ ๐ ๊ ((x y : Ob ๐ง) โ hom ๐ง x y โ hom ๐ (F x) (F y))
, (โ x y โ is-equiv (๐ x y))
ร functorial ๐ง ๐ F ๐)
lemma ๐ง ๐ F = ฮณ
where
e = (hom ๐ง ๏ผ ฮป x y โ hom ๐ (F x) (F y)) โโจ i โฉ
(โ x y โ hom ๐ง x y ๏ผ hom ๐ (F x) (F y)) โโจ ii โฉ
(โ x y โ hom ๐ง x y โ hom ๐ (F x) (F y)) โโจ iii โฉ
(โ x โ ฮฃ ฯ ๊ (โ y โ hom ๐ง x y โ hom ๐ (F x) (F y))
, โ y โ is-equiv (ฯ y)) โโจ iv โฉ
(ฮฃ ๐ ๊ ((x y : Ob ๐ง) โ hom ๐ง x y โ hom ๐ (F x) (F y))
, (โ x y โ is-equiv (๐ x y))) โ
where
i = hfunextโ-โ hfe hfe (hom ๐ง ) ฮป x y โ hom ๐ (F x) (F y)
ii = ฮ -cong fe fe
(ฮป x โ ฮ -cong fe fe
(ฮป y โ univalence-โ (ua ๐ฅ) (hom ๐ง x y) (hom ๐ (F x) (F y))))
iii = ฮ -cong fe fe (ฮป y โ ฮ ฮฃ-distr-โ)
iv = ฮ ฮฃ-distr-โ
v : (p : hom ๐ง ๏ผ ฮป x y โ hom ๐ (F x) (F y))
โ functorial ๐ง ๐ F (ฮป x y โ transport (ฮป - โ - x y) p)
โ functorial ๐ง ๐ F (prโ (โ e โ p))
v (refl _) = id-โ _
ฮณ =
(ฮฃ p ๊ hom ๐ง ๏ผ (ฮป x y โ hom ๐ (F x) (F y))
, functorial ๐ง ๐ F (ฮป x y โ transport (ฮป - โ - x y) p)) โโจ vi โฉ
(ฮฃ p ๊ hom ๐ง ๏ผ (ฮป x y โ hom ๐ (F x) (F y))
, functorial ๐ง ๐ F (prโ (โ e โ p))) โโจ vii โฉ
(ฮฃ ฯ ๊ (ฮฃ ๐ ๊ ((x y : Ob ๐ง) โ hom ๐ง x y โ hom ๐ (F x) (F y))
, (โ x y โ is-equiv (๐ x y)))
, functorial ๐ง ๐ F (prโ ฯ)) โโจ viii โฉ
(ฮฃ ๐ ๊ ((x y : Ob ๐ง) โ hom ๐ง x y โ hom ๐ (F x) (F y))
, (โ x y โ is-equiv (๐ x y))
ร functorial ๐ง ๐ F ๐) โ
where
vi = ฮฃ-cong v
vii = โ-sym (ฮฃ-change-of-variable _ โ e โ (โโ-is-equiv e))
viii = ฮฃ-assoc
characterization-of-type-valued-preorder-๏ผ :
(๐ง ๐ : ฮฃ S)
โ
(๐ง ๏ผ ๐)
โ
(ฮฃ F ๊ (Ob ๐ง โ Ob ๐)
, is-equiv F
ร (ฮฃ ๐ ๊ ((x y : Ob ๐ง) โ hom ๐ง x y โ hom ๐ (F x) (F y))
, (โ x y โ is-equiv (๐ x y))
ร functorial ๐ง ๐ F ๐))
characterization-of-type-valued-preorder-๏ผ ๐ง ๐ =
(๐ง ๏ผ ๐) โโจ i โฉ
(ฮฃ F ๊ (Ob ๐ง โ Ob ๐)
, is-equiv F
ร (ฮฃ p ๊ hom ๐ง ๏ผ (ฮป x y โ hom ๐ (F x) (F y))
, functorial ๐ง ๐ F (ฮป x y โ transport (ฮป - โ - x y) p))) โโจ ii โฉ
(ฮฃ F ๊ (Ob ๐ง โ Ob ๐)
, is-equiv F
ร (ฮฃ ๐ ๊ ((x y : Ob ๐ง) โ hom ๐ง x y โ hom ๐ (F x) (F y))
, (โ x y โ is-equiv (๐ x y))
ร functorial ๐ง ๐ F ๐)) โ
where
i = characterization-of-๏ผ (ua ๐ค) sns-data ๐ง ๐
ii = ฮฃ-cong (ฮป F โ ฮฃ-cong (ฮป _ โ lemma ๐ง ๐ F))
module type-valued-preorder-with-axioms
(๐ค ๐ฅ ๐ฆ : Universe)
(ua : Univalence)
(axioms : (X : ๐ค ฬ ) โ type-valued-preorder-S {๐ค} {๐ฅ} X โ ๐ฆ ฬ )
(axiomss : (X : ๐ค ฬ ) (s : type-valued-preorder-S X) โ is-subsingleton (axioms X s))
where
open sip
open sip-with-axioms
open type-valued-preorder ๐ค ๐ฅ ua
S' : ๐ค ฬ โ ๐ค โ (๐ฅ โบ) โ ๐ฆ ฬ
S' X = ฮฃ s ๊ S X , axioms X s
sns-data' : SNS S' (๐ค โ (๐ฅ โบ))
sns-data' = add-axioms axioms axiomss sns-data
characterization-of-type-valued-preorder-๏ผ-with-axioms :
(๐ง' ๐' : ฮฃ S')
โ
(๐ง' ๏ผ ๐')
โ
(ฮฃ F ๊ (Ob [ ๐ง' ] โ Ob [ ๐' ])
, is-equiv F
ร (ฮฃ ๐ ๊ ((x y : Ob [ ๐ง' ]) โ hom [ ๐ง' ] x y โ hom [ ๐' ] (F x) (F y))
, (โ x y โ is-equiv (๐ x y))
ร functorial [ ๐ง' ] [ ๐' ] F ๐))
characterization-of-type-valued-preorder-๏ผ-with-axioms ๐ง' ๐' =
(๐ง' ๏ผ ๐') โโจ i โฉ
([ ๐ง' ] โ[ sns-data ] [ ๐' ]) โโจ ii โฉ
_ โ
where
i = characterization-of-๏ผ-with-axioms (ua ๐ค) sns-data axioms axiomss ๐ง' ๐'
ii = ฮฃ-cong (ฮป F โ ฮฃ-cong (ฮป _ โ lemma [ ๐ง' ] [ ๐' ] F))
module category
(๐ค ๐ฅ : Universe)
(ua : Univalence)
where
open type-valued-preorder-with-axioms ๐ค ๐ฅ (๐ค โ ๐ฅ) ua
fe : global-dfunext
fe = univalence-gives-global-dfunext ua
S : ๐ค ฬ โ ๐ค โ (๐ฅ โบ) ฬ
S = type-valued-preorder-S {๐ค} {๐ฅ}
category-axioms : (X : ๐ค ฬ ) โ S X โ ๐ค โ ๐ฅ ฬ
category-axioms X (homX , idX , compX) = hom-sets ร identityl ร identityr ร associativity
where
_o_ : {x y z : X} โ homX y z โ homX x y โ homX x z
g o f = compX _ _ _ f g
hom-sets = โ x y โ is-set (homX x y)
identityl = โ x y (f : homX x y) โ f o (idX x) ๏ผ f
identityr = โ x y (f : homX x y) โ (idX y) o f ๏ผ f
associativity = โ x y z t (f : homX x y) (g : homX y z) (h : homX z t)
โ (h o g) o f ๏ผ h o (g o f)
category-axioms-subsingleton : (X : ๐ค ฬ ) (s : S X) โ is-subsingleton (category-axioms X s)
category-axioms-subsingleton X (homX , idX , compX) ca = ฮณ ca
where
i : โ x y โ is-set (homX x y)
i = prโ ca
ฮณ : is-subsingleton (category-axioms X (homX , idX , compX))
ฮณ = ร-is-subsingleton ss (ร-is-subsingleton ls (ร-is-subsingleton rs as))
where
ss = ฮ -is-subsingleton fe
(ฮป x โ ฮ -is-subsingleton fe
(ฮป y โ being-set-is-subsingleton fe))
ls = ฮ -is-subsingleton fe
(ฮป x โ ฮ -is-subsingleton fe
(ฮป y โ ฮ -is-subsingleton fe
(ฮป f โ i x y (compX x x y (idX x) f) f)))
rs = ฮ -is-subsingleton fe
(ฮป x โ ฮ -is-subsingleton fe
(ฮป y โ ฮ -is-subsingleton fe
(ฮป f โ i x y (compX x y y f (idX y)) f)))
as = ฮ -is-subsingleton fe
(ฮป x โ ฮ -is-subsingleton fe
(ฮป y โ ฮ -is-subsingleton fe
(ฮป z โ ฮ -is-subsingleton fe
(ฮป t โ ฮ -is-subsingleton fe
(ฮป f โ ฮ -is-subsingleton fe
(ฮป g โ ฮ -is-subsingleton fe
(ฮป h โ i x t (compX x y t f (compX y z t g h))
(compX x z t (compX x y z f g) h))))))))
Cat : (๐ค โ ๐ฅ)โบ ฬ
Cat = ฮฃ X ๊ ๐ค ฬ , ฮฃ s ๊ S X , category-axioms X s
Ob : Cat โ ๐ค ฬ
Ob (X , (homX , idX , compX) , _) = X
hom : (๐ง : Cat) โ Ob ๐ง โ Ob ๐ง โ ๐ฅ ฬ
hom (X , (homX , idX , compX) , _) = homX
๐พ๐น : (๐ง : Cat) (x : Ob ๐ง) โ hom ๐ง x x
๐พ๐น (X , (homX , idX , compX) , _) = idX
comp : (๐ง : Cat) (x y z : Ob ๐ง) (f : hom ๐ง x y) (g : hom ๐ง y z) โ hom ๐ง x z
comp (X , (homX , idX , compX) , _) = compX
is-functorial : (๐ง ๐ : Cat)
โ (F : Ob ๐ง โ Ob ๐)
โ ((x y : Ob ๐ง) โ hom ๐ง x y โ hom ๐ (F x) (F y))
โ ๐ค โ ๐ฅ ฬ
is-functorial ๐ง ๐ F ๐' = pidentity ร pcomposition
where
_o_ : {x y z : Ob ๐ง} โ hom ๐ง y z โ hom ๐ง x y โ hom ๐ง x z
g o f = comp ๐ง _ _ _ f g
_โก_ : {a b c : Ob ๐} โ hom ๐ b c โ hom ๐ a b โ hom ๐ a c
g โก f = comp ๐ _ _ _ f g
๐ : {x y : Ob ๐ง} โ hom ๐ง x y โ hom ๐ (F x) (F y)
๐ f = ๐' _ _ f
pidentity = (ฮป x โ ๐ (๐พ๐น ๐ง x)) ๏ผ (ฮป x โ ๐พ๐น ๐ (F x))
pcomposition = (ฮป x y z (f : hom ๐ง x y) (g : hom ๐ง y z) โ ๐ (g o f))
๏ผ (ฮป x y z (f : hom ๐ง x y) (g : hom ๐ง y z) โ ๐ g โก ๐ f)
_โ_ : Cat โ Cat โ ๐ค โ ๐ฅ ฬ
๐ง โ ๐ = ฮฃ F ๊ (Ob ๐ง โ Ob ๐)
, is-equiv F
ร (ฮฃ ๐ ๊ ((x y : Ob ๐ง) โ hom ๐ง x y โ hom ๐ (F x) (F y))
, (โ x y โ is-equiv (๐ x y))
ร is-functorial ๐ง ๐ F ๐)
IdโEqCat : (๐ง ๐ : Cat) โ ๐ง ๏ผ ๐ โ ๐ง โ ๐
IdโEqCat ๐ง ๐ง (refl ๐ง) = ๐๐ (Ob ๐ง ) ,
id-is-equiv (Ob ๐ง ) ,
(ฮป x y โ ๐๐ (hom ๐ง x y)) ,
(ฮป x y โ id-is-equiv (hom ๐ง x y)) ,
refl (๐พ๐น ๐ง) ,
refl (comp ๐ง)
characterization-of-category-๏ผ : (๐ง ๐ : Cat) โ (๐ง ๏ผ ๐) โ (๐ง โ ๐)
characterization-of-category-๏ผ = characterization-of-type-valued-preorder-๏ผ-with-axioms
category-axioms category-axioms-subsingleton
IdโEqCat-is-equiv : (๐ง ๐ : Cat) โ is-equiv (IdโEqCat ๐ง ๐)
IdโEqCat-is-equiv ๐ง ๐ = equivs-closed-under-โผ
(โโ-is-equiv (characterization-of-category-๏ผ ๐ง ๐))
(ฮณ ๐ง ๐)
where
ฮณ : (๐ง ๐ : Cat) โ IdโEqCat ๐ง ๐ โผ โ characterization-of-category-๏ผ ๐ง ๐ โ
ฮณ ๐ง ๐ง (refl ๐ง) = refl _
module ring {๐ค : Universe} (ua : Univalence) where
open sip hiding (โจ_โฉ)
open sip-with-axioms
open sip-join
fe : global-dfunext
fe = univalence-gives-global-dfunext ua
hfe : global-hfunext
hfe = univalence-gives-global-hfunext ua
rng-structure : ๐ค ฬ โ ๐ค ฬ
rng-structure X = (X โ X โ X) ร (X โ X โ X)
rng-axioms : (R : ๐ค ฬ ) โ rng-structure R โ ๐ค ฬ
rng-axioms R (_+_ , _ยท_) = I ร II ร III ร IV ร V ร VI ร VII
where
I = is-set R
II = (x y z : R) โ (x + y) + z ๏ผ x + (y + z)
III = (x y : R) โ x + y ๏ผ y + x
IV = ฮฃ O ๊ R , ((x : R) โ x + O ๏ผ x) ร ((x : R) โ ฮฃ x' ๊ R , x + x' ๏ผ O)
V = (x y z : R) โ (x ยท y) ยท z ๏ผ x ยท (y ยท z)
VI = (x y z : R) โ x ยท (y + z) ๏ผ (x ยท y) + (x ยท z)
VII = (x y z : R) โ (y + z) ยท x ๏ผ (y ยท x) + (z ยท x)
Rng : ๐ค โบ ฬ
Rng = ฮฃ R ๊ ๐ค ฬ , ฮฃ s ๊ rng-structure R , rng-axioms R s
rng-axioms-is-subsingleton : (R : ๐ค ฬ ) (s : rng-structure R)
โ is-subsingleton (rng-axioms R s)
rng-axioms-is-subsingleton R (_+_ , _ยท_) (i , ii , iii , iv-vii) = ฮด
where
A = ฮป (O : R) โ ((x : R) โ x + O ๏ผ x)
ร ((x : R) โ ฮฃ x' ๊ R , x + x' ๏ผ O)
IV = ฮฃ A
a : (O O' : R) โ ((x : R) โ x + O ๏ผ x) โ ((x : R) โ x + O' ๏ผ x) โ O ๏ผ O'
a O O' f f' = O ๏ผโจ (f' O)โปยน โฉ
(O + O') ๏ผโจ iii O O' โฉ
(O' + O) ๏ผโจ f O' โฉ
O' โ
b : (O : R) โ is-subsingleton ((x : R) โ x + O ๏ผ x)
b O = ฮ -is-subsingleton fe (ฮป x โ i (x + O) x)
c : (O : R)
โ ((x : R) โ x + O ๏ผ x)
โ (x : R) โ is-subsingleton (ฮฃ x' ๊ R , x + x' ๏ผ O)
c O f x (x' , p') (x'' , p'') = to-subtype-๏ผ (ฮป x' โ i (x + x') O) r
where
r : x' ๏ผ x''
r = x' ๏ผโจ (f x')โปยน โฉ
(x' + O) ๏ผโจ ap (x' +_) (p'' โปยน) โฉ
(x' + (x + x'')) ๏ผโจ (ii x' x x'')โปยน โฉ
((x' + x) + x'') ๏ผโจ ap (_+ x'') (iii x' x) โฉ
((x + x') + x'') ๏ผโจ ap (_+ x'') p' โฉ
(O + x'') ๏ผโจ iii O x'' โฉ
(x'' + O) ๏ผโจ f x'' โฉ
x'' โ
d : (O : R) โ is-subsingleton (A O)
d O (f , g) = ฯ (f , g)
where
ฯ : is-subsingleton (A O)
ฯ = ร-is-subsingleton (b O) (ฮ -is-subsingleton fe (ฮป x โ c O f x))
IV-is-subsingleton : is-subsingleton IV
IV-is-subsingleton (O , f , g) (O' , f' , g') = e
where
e : (O , f , g) ๏ผ (O' , f' , g')
e = to-subtype-๏ผ d (a O O' f f')
ฮณ : is-subsingleton (rng-axioms R (_+_ , _ยท_))
ฮณ = ร-is-subsingleton
(being-set-is-subsingleton fe)
(ร-is-subsingleton
(ฮ -is-subsingleton fe
(ฮป x โ ฮ -is-subsingleton fe
(ฮป y โ ฮ -is-subsingleton fe
(ฮป z โ i ((x + y) + z) (x + (y + z))))))
(ร-is-subsingleton
(ฮ -is-subsingleton fe
(ฮป x โ ฮ -is-subsingleton fe
(ฮป y โ i (x + y) (y + x))))
(ร-is-subsingleton
IV-is-subsingleton
(ร-is-subsingleton
(ฮ -is-subsingleton fe
(ฮป x โ ฮ -is-subsingleton fe
(ฮป y โ ฮ -is-subsingleton fe
(ฮป z โ i ((x ยท y) ยท z) (x ยท (y ยท z))))))
(ร-is-subsingleton
(ฮ -is-subsingleton fe
(ฮป x โ ฮ -is-subsingleton fe
(ฮป y โ ฮ -is-subsingleton fe
(ฮป z โ i (x ยท (y + z)) ((x ยท y) + (x ยท z))))))
(ฮ -is-subsingleton fe
(ฮป x โ ฮ -is-subsingleton fe
(ฮป y โ ฮ -is-subsingleton fe
(ฮป z โ i ((y + z) ยท x) ((y ยท x) + (z ยท x)))))))))))
ฮด : (ฮฑ : rng-axioms R (_+_ , _ยท_)) โ (i , ii , iii , iv-vii) ๏ผ ฮฑ
ฮด = ฮณ (i , ii , iii , iv-vii)
_โ
[Rng]_ : Rng โ Rng โ ๐ค ฬ
(R , (_+_ , _ยท_) , _) โ
[Rng] (R' , (_+'_ , _ยท'_) , _) =
ฮฃ f ๊ (R โ R')
, is-equiv f
ร ((ฮป x y โ f (x + y)) ๏ผ (ฮป x y โ f x +' f y))
ร ((ฮป x y โ f (x ยท y)) ๏ผ (ฮป x y โ f x ยท' f y))
characterization-of-rng-๏ผ : (๐ก ๐ก' : Rng) โ (๐ก ๏ผ ๐ก') โ (๐ก โ
[Rng] ๐ก')
characterization-of-rng-๏ผ = characterization-of-๏ผ (ua ๐ค)
(add-axioms
rng-axioms
rng-axioms-is-subsingleton
(join
โ-magma.sns-data
โ-magma.sns-data))
โจ_โฉ : (๐ก : Rng) โ ๐ค ฬ
โจ R , _ โฉ = R
ring-structure : ๐ค ฬ โ ๐ค ฬ
ring-structure X = X ร rng-structure X
ring-axioms : (R : ๐ค ฬ ) โ ring-structure R โ ๐ค ฬ
ring-axioms R (๐ , _+_ , _ยท_) = rng-axioms R (_+_ , _ยท_) ร VIII
where
VIII = (x : R) โ (x ยท ๐ ๏ผ x) ร (๐ ยท x ๏ผ x)
ring-axioms-is-subsingleton : (R : ๐ค ฬ ) (s : ring-structure R)
โ is-subsingleton (ring-axioms R s)
ring-axioms-is-subsingleton R (๐ , _+_ , _ยท_) ((i , ii-vii) , viii) = ฮณ ((i , ii-vii) , viii)
where
ฮณ : is-subsingleton (ring-axioms R (๐ , _+_ , _ยท_))
ฮณ = ร-is-subsingleton
(rng-axioms-is-subsingleton R (_+_ , _ยท_))
(ฮ -is-subsingleton fe (ฮป x โ ร-is-subsingleton (i (x ยท ๐) x) (i (๐ ยท x) x)))
Ring : ๐ค โบ ฬ
Ring = ฮฃ R ๊ ๐ค ฬ , ฮฃ s ๊ ring-structure R , ring-axioms R s
_โ
[Ring]_ : Ring โ Ring โ ๐ค ฬ
(R , (๐ , _+_ , _ยท_) , _) โ
[Ring] (R' , (๐' , _+'_ , _ยท'_) , _) =
ฮฃ f ๊ (R โ R')
, is-equiv f
ร (f ๐ ๏ผ ๐')
ร ((ฮป x y โ f (x + y)) ๏ผ (ฮป x y โ f x +' f y))
ร ((ฮป x y โ f (x ยท y)) ๏ผ (ฮป x y โ f x ยท' f y))
characterization-of-ring-๏ผ : (๐ก ๐ก' : Ring) โ (๐ก ๏ผ ๐ก') โ (๐ก โ
[Ring] ๐ก')
characterization-of-ring-๏ผ = sip.characterization-of-๏ผ (ua ๐ค)
(sip-with-axioms.add-axioms
ring-axioms
ring-axioms-is-subsingleton
(sip-join.join
pointed-type.sns-data
(join
โ-magma.sns-data
โ-magma.sns-data)))
is-commutative : Rng โ ๐ค ฬ
is-commutative (R , (_+_ , _ยท_) , _) = (x y : R) โ x ยท y ๏ผ y ยท x
being-commutative-is-subsingleton : (๐ก : Rng) โ is-subsingleton (is-commutative ๐ก)
being-commutative-is-subsingleton (R , (_+_ , _ยท_) , i , ii-vii) =
ฮ -is-subsingleton fe
(ฮป x โ ฮ -is-subsingleton fe
(ฮป y โ i (x ยท y) (y ยท x)))
is-ideal : (๐ก : Rng) โ ๐ โจ ๐ก โฉ โ ๐ค ฬ
is-ideal (R , (_+_ , _ยท_) , _) I = (x y : R) โ (x โ I โ y โ I โ (x + y) โ I)
ร (x โ I โ (x ยท y) โ I)
ร (y โ I โ (x ยท y) โ I)
is-local : Rng โ ๐ค โบ ฬ
is-local ๐ก = โ! I ๊ ๐ โจ ๐ก โฉ , (is-ideal ๐ก I โ (J : ๐ โจ ๐ก โฉ) โ is-ideal ๐ก J โ J โ I)
being-local-is-subsingleton : (๐ก : Rng) โ is-subsingleton (is-local ๐ก)
being-local-is-subsingleton ๐ก = โ!-is-subsingleton _ fe
module _ (pt : subsingleton-truncations-exist) where
open basic-truncation-development pt hfe
open โ-order
is-noetherian : (๐ก : Rng) โ ๐ค โบ ฬ
is-noetherian ๐ก = (I : โ โ ๐ โจ ๐ก โฉ)
โ ((n : โ) โ is-ideal ๐ก (I n))
โ ((n : โ) โ I n โ I (succ n))
โ โ m ๊ โ , ((n : โ) โ m โค n โ I m ๏ผ I n)
NoetherianRng : ๐ค โบ ฬ
NoetherianRng = ฮฃ ๐ก ๊ Rng , is-noetherian ๐ก
being-noetherian-is-subsingleton : (๐ก : Rng) โ is-subsingleton (is-noetherian ๐ก)
being-noetherian-is-subsingleton ๐ก = ฮ -is-subsingleton fe
(ฮป I โ ฮ -is-subsingleton fe
(ฮป _ โ ฮ -is-subsingleton fe
(ฮป _ โ โ-is-subsingleton)))
forget-Noether : NoetherianRng โ Rng
forget-Noether (๐ก , _) = ๐ก
forget-Noether-is-embedding : is-embedding forget-Noether
forget-Noether-is-embedding = prโ-embedding being-noetherian-is-subsingleton
_โ
[NoetherianRng]_ : NoetherianRng โ NoetherianRng โ ๐ค ฬ
((R , (_+_ , _ยท_) , _) , _) โ
[NoetherianRng] ((R' , (_+'_ , _ยท'_) , _) , _) =
ฮฃ f ๊ (R โ R')
, is-equiv f
ร ((ฮป x y โ f (x + y)) ๏ผ (ฮป x y โ f x +' f y))
ร ((ฮป x y โ f (x ยท y)) ๏ผ (ฮป x y โ f x ยท' f y))
NB : (๐ก ๐ก' : NoetherianRng)
โ (๐ก โ
[NoetherianRng] ๐ก') ๏ผ (forget-Noether ๐ก โ
[Rng] forget-Noether ๐ก')
NB ๐ก ๐ก' = refl _
characterization-of-nrng-๏ผ : (๐ก ๐ก' : NoetherianRng)
โ (๐ก ๏ผ ๐ก') โ (๐ก โ
[NoetherianRng] ๐ก')
characterization-of-nrng-๏ผ ๐ก ๐ก' =
(๐ก ๏ผ ๐ก') โโจ i โฉ
(forget-Noether ๐ก ๏ผ forget-Noether ๐ก') โโจ ii โฉ
(๐ก โ
[NoetherianRng] ๐ก') โ
where
i = โ-sym (embedding-criterion-converse forget-Noether
forget-Noether-is-embedding ๐ก ๐ก')
ii = characterization-of-rng-๏ผ (forget-Noether ๐ก) (forget-Noether ๐ก')
isomorphic-NoetherianRng-transport :
(A : NoetherianRng โ ๐ฅ ฬ )
โ (๐ก ๐ก' : NoetherianRng) โ ๐ก โ
[NoetherianRng] ๐ก' โ A ๐ก โ A ๐ก'
isomorphic-NoetherianRng-transport A ๐ก ๐ก' i a = a'
where
p : ๐ก ๏ผ ๐ก'
p = โ โ-sym (characterization-of-nrng-๏ผ ๐ก ๐ก') โ i
a' : A ๐ก'
a' = transport A p a
is-CNL : Ring โ ๐ค โบ ฬ
is-CNL (R , (๐ , _+_ , _ยท_) , i-vii , viii) = is-commutative ๐ก
ร is-noetherian ๐ก
ร is-local ๐ก
where
๐ก : Rng
๐ก = (R , (_+_ , _ยท_) , i-vii)
being-CNL-is-subsingleton : (๐ก : Ring) โ is-subsingleton (is-CNL ๐ก)
being-CNL-is-subsingleton (R , (๐ , _+_ , _ยท_) , i-vii , viii) =
ร-is-subsingleton (being-commutative-is-subsingleton ๐ก)
(ร-is-subsingleton (being-noetherian-is-subsingleton ๐ก)
(being-local-is-subsingleton ๐ก))
where
๐ก : Rng
๐ก = (R , (_+_ , _ยท_) , i-vii)
CNL-Ring : ๐ค โบ ฬ
CNL-Ring = ฮฃ ๐ก ๊ Ring , is-CNL ๐ก
_โ
[CNL]_ : CNL-Ring โ CNL-Ring โ ๐ค ฬ
((R , (๐ , _+_ , _ยท_) , _) , _) โ
[CNL] ((R' , (๐' , _+'_ , _ยท'_) , _) , _) =
ฮฃ f ๊ (R โ R')
, is-equiv f
ร (f ๐ ๏ผ ๐')
ร ((ฮป x y โ f (x + y)) ๏ผ (ฮป x y โ f x +' f y))
ร ((ฮป x y โ f (x ยท y)) ๏ผ (ฮป x y โ f x ยท' f y))
forget-CNL : CNL-Ring โ Ring
forget-CNL (๐ก , _) = ๐ก
forget-CNL-is-embedding : is-embedding forget-CNL
forget-CNL-is-embedding = prโ-embedding being-CNL-is-subsingleton
NB' : (๐ก ๐ก' : CNL-Ring)
โ (๐ก โ
[CNL] ๐ก') ๏ผ (forget-CNL ๐ก โ
[Ring] forget-CNL ๐ก')
NB' ๐ก ๐ก' = refl _
characterization-of-CNL-ring-๏ผ : (๐ก ๐ก' : CNL-Ring)
โ (๐ก ๏ผ ๐ก') โ (๐ก โ
[CNL] ๐ก')
characterization-of-CNL-ring-๏ผ ๐ก ๐ก' =
(๐ก ๏ผ ๐ก') โโจ i โฉ
(forget-CNL ๐ก ๏ผ forget-CNL ๐ก') โโจ ii โฉ
(๐ก โ
[CNL] ๐ก') โ
where
i = โ-sym (embedding-criterion-converse forget-CNL
forget-CNL-is-embedding ๐ก ๐ก')
ii = characterization-of-ring-๏ผ (forget-CNL ๐ก) (forget-CNL ๐ก')
isomorphic-CNL-Ring-transport :
(A : CNL-Ring โ ๐ฅ ฬ )
โ (๐ก ๐ก' : CNL-Ring) โ ๐ก โ
[CNL] ๐ก' โ A ๐ก โ A ๐ก'
isomorphic-CNL-Ring-transport A ๐ก ๐ก' i a = a'
where
p : ๐ก ๏ผ ๐ก'
p = โ โ-sym (characterization-of-CNL-ring-๏ผ ๐ก ๐ก') โ i
a' : A ๐ก'
a' = transport A p a