Legacy.Base.Structures.Sigma.Congruences
{-# OPTIONS --cubical-compatible --exact-split --safe #-}
module Legacy.Base.Structures.Sigma.Congruences where
open import Agda.Primitive using () renaming ( Set to Type )
open import Data.Product using ( _,_ ; _Γ_ ; Ξ£-syntax ) renaming ( projβ to fst )
open import Function using ( _β_ )
open import Level using ( _β_ ; suc ; Level ; Lift ; lift ; lower ) renaming ( 0β to ββ )
open import Relation.Unary using ( Pred ; _β_ )
open import Relation.Binary using ( IsEquivalence ) renaming ( Rel to BinRel )
open import Relation.Binary.PropositionalEquality using ( _β‘_ )
open import Overture using ( β£_β£ )
open import Legacy.Base.Equality using ( swelldef )
open import Legacy.Base.Relations using ( _|:_ ; 0[_] ; Equivalence ; βͺ_β« ; β_β )
using ( 0[_]Equivalence ; _/_ ; βͺ_βΌ_β«-elim ; Quotient )
open import Legacy.Base.Structures.Sigma.Basic
using ( Signature ; Structure ; _α΅_ ; Compatible ; _Κ³_ )
private variable π
πΉ : Signature
module _ {Ξ± Ο : Level} where
Con : (π¨ : Structure π
πΉ {Ξ±}{Ο}) β Type (suc (Ξ± β Ο))
Con π¨ = Ξ£[ ΞΈ β Equivalence β£ π¨ β£{Ξ± β Ο} ] (Compatible π¨ β£ ΞΈ β£)
0[_]Compatible : (π¨ : Structure π
πΉ {Ξ±}{Ο}) β swelldef ββ Ξ±
β (π : β£ πΉ β£) β (π α΅ π¨) |: (0[ β£ π¨ β£ ]{Ο})
0[ π¨ ]Compatible wd π {i}{j} ptws0 = lift Ξ³
where
Ξ³ : (π α΅ π¨) i β‘ (π α΅ π¨) j
Ξ³ = wd (π α΅ π¨) i j (lower β ptws0)
0Con[_] : (π¨ : Structure π
πΉ {Ξ±}{Ο}) β swelldef ββ Ξ± β Con π¨
0Con[ π¨ ] wd = 0[ β£ π¨ β£ ]Equivalence , 0[ π¨ ]Compatible wd
_β±_ : (π¨ : Structure π
πΉ {Ξ±}{Ο}) β Con π¨ β Structure π
πΉ {suc (Ξ± β Ο)}{Ο}
π¨ β± ΞΈ = ( Quotient (β£ π¨ β£) {Ξ± β Ο} β£ ΞΈ β£)
, (Ξ» r x β (r Κ³ π¨) Ξ» i β β x i β)
, Ξ» f b β βͺ (f α΅ π¨) (Ξ» i β β b i β) β«
/β‘-elim : {π¨ : Structure π
πΉ {Ξ±}{Ο}}( (ΞΈ , _ ) : Con π¨){u v : β£ π¨ β£}
β βͺ u β«{β£ ΞΈ β£} β‘ βͺ v β« β β£ ΞΈ β£ u v
/β‘-elim ΞΈ {u}{v} x = βͺ u βΌ v β«-elim {R = β£ ΞΈ β£} x
π[_β±_] : (π¨ : Structure π
πΉ {Ξ±}{Ο})(ΞΈ : Con π¨)
β BinRel (β£ π¨ β£ / (fst β£ ΞΈ β£)) (suc (Ξ± β Ο))
π[ π¨ β± ΞΈ ] = Ξ» u v β u β‘ v
π[_β±_] : {Ξ± Ο : Level}(π¨ : Structure π
πΉ {Ξ±}{Ο})(ΞΈ : Con π¨)
β swelldef ββ (suc (Ξ± β Ο)) β Con (π¨ β± ΞΈ)
π[ π¨ β± ΞΈ ] wd = 0[ β£ π¨ β± ΞΈ β£ ]Equivalence , 0[ π¨ β± ΞΈ ]Compatible wd