From 02fc36027ff69f774907773092a931a9254d1246 Mon Sep 17 00:00:00 2001 From: Rahul Chhabra Date: Thu, 19 Sep 2024 22:44:03 +0530 Subject: [PATCH] Render HTML --- docs/Categories.CartesianMorphism.html | 104 +++++ docs/Categories.GenericObject.html | 30 ++ docs/Cubical.Categories.Displayed.Base.html | 131 ++++++ ...ubical.Categories.Displayed.Reasoning.html | 110 +++++ ...ubical.HITs.SetCoequalizer.Properties.html | 14 +- docs/Realizability.ApplicativeStructure.html | 407 ++++++++++-------- docs/Realizability.Assembly.Base.html | 90 ++-- .../Realizability.Assembly.BinCoproducts.html | 361 ++++++++-------- docs/Realizability.Assembly.BinProducts.html | 305 +++++-------- docs/Realizability.Assembly.Coequalizers.html | 141 +++--- docs/Realizability.Assembly.Equalizers.html | 68 +-- docs/Realizability.Assembly.Everything.html | 3 +- docs/Realizability.Assembly.Exponentials.html | 245 ++++++----- docs/Realizability.Assembly.Morphism.html | 270 ++++++------ docs/Realizability.Assembly.SIP.html | 35 ++ ...ty.Assembly.SetsReflectiveSubcategory.html | 64 +++ docs/Realizability.Assembly.Terminal.html | 51 +++ docs/Realizability.CombinatoryAlgebra.html | 186 ++++---- docs/Realizability.Modest.Base.html | 87 ++++ docs/Realizability.Modest.CanonicalPER.html | 62 +++ docs/Realizability.Modest.Everything.html | 11 + ...ealizability.Modest.PartialSurjection.html | 390 +++++++++++++++++ ...ity.Modest.SubQuotientCanonicalPERIso.html | 149 +++++++ docs/Realizability.Modest.UniformFamily.html | 219 ++++++++++ ...zability.Modest.UniformFamilyCleavage.html | 102 +++++ ...Realizability.Modest.UnresizedGeneric.html | 94 ++++ docs/Realizability.PERs.Everything.html | 7 + docs/Realizability.PERs.PER.html | 226 ++++++++++ docs/Realizability.PERs.ResizedPER.html | 197 +++++++++ docs/Realizability.PERs.SubQuotient.html | 271 ++++++++++++ docs/Realizability.PropResizing.html | 86 +++- docs/Realizability.Topos.BinProducts.html | 242 +++++------ docs/Realizability.Topos.Equalizer.html | 196 ++++----- docs/Realizability.Topos.Everything.html | 21 +- ...ealizability.Topos.FunctionalRelation.html | 182 ++++---- .../Realizability.Topos.MonicReprFuncRel.html | 96 ++--- docs/Realizability.Topos.Object.html | 8 +- .../Realizability.Topos.ResizedPredicate.html | 10 +- docs/Realizability.Topos.StrictRelation.html | 186 ++++---- ...alizability.Topos.SubobjectClassifier.html | 396 ++++++++--------- docs/Realizability.Topos.TerminalObject.html | 28 +- ...Tripos.Prealgebra.Meets.Commutativity.html | 28 +- ...lity.Tripos.Prealgebra.Meets.Identity.html | 18 +- ...ripos.Prealgebra.Predicate.Properties.html | 126 +++--- docs/index.html | 5 +- src/Realizability/Modest/Everything.agda | 9 + .../Modest/PartialSurjection.agda | 9 - src/Realizability/PERs/Everything.agda | 5 + src/Realizability/PERs/SubQuotient.agda | 93 +++- .../Topos/SubobjectClassifier.agda | 30 -- src/index.agda | 3 + 51 files changed, 4354 insertions(+), 1853 deletions(-) create mode 100644 docs/Categories.CartesianMorphism.html create mode 100644 docs/Categories.GenericObject.html create mode 100644 docs/Cubical.Categories.Displayed.Base.html create mode 100644 docs/Cubical.Categories.Displayed.Reasoning.html create mode 100644 docs/Realizability.Assembly.SIP.html create mode 100644 docs/Realizability.Assembly.SetsReflectiveSubcategory.html create mode 100644 docs/Realizability.Assembly.Terminal.html create mode 100644 docs/Realizability.Modest.Base.html create mode 100644 docs/Realizability.Modest.CanonicalPER.html create mode 100644 docs/Realizability.Modest.Everything.html create mode 100644 docs/Realizability.Modest.PartialSurjection.html create mode 100644 docs/Realizability.Modest.SubQuotientCanonicalPERIso.html create mode 100644 docs/Realizability.Modest.UniformFamily.html create mode 100644 docs/Realizability.Modest.UniformFamilyCleavage.html create mode 100644 docs/Realizability.Modest.UnresizedGeneric.html create mode 100644 docs/Realizability.PERs.Everything.html create mode 100644 docs/Realizability.PERs.PER.html create mode 100644 docs/Realizability.PERs.ResizedPER.html create mode 100644 docs/Realizability.PERs.SubQuotient.html create mode 100644 src/Realizability/Modest/Everything.agda create mode 100644 src/Realizability/PERs/Everything.agda diff --git a/docs/Categories.CartesianMorphism.html b/docs/Categories.CartesianMorphism.html new file mode 100644 index 0000000..900f768 --- /dev/null +++ b/docs/Categories.CartesianMorphism.html @@ -0,0 +1,104 @@ + +Categories.CartesianMorphism
open import Cubical.Foundations.Prelude
+open import Cubical.Categories.Category
+open import Cubical.Categories.Displayed.Base
+open import Cubical.Foundations.Equiv
+open import Cubical.Foundations.HLevels
+open import Cubical.Data.Sigma
+open import Cubical.HITs.PropositionalTruncation
+
+module Categories.CartesianMorphism where
+
+module Contravariant
+  {ℓB ℓ'B ℓE ℓ'E}
+  {B : Category ℓB ℓ'B}
+  (E : Categoryᴰ B ℓE ℓ'E) where
+
+  open Category B
+  open Categoryᴰ E
+
+  opaque
+    isCartesian :
+      {a b : ob} (f : B [ a , b ])
+      {aᴰ : ob[ a ]} {bᴰ : ob[ b ]}
+      (fᴰ : Hom[ f ][ aᴰ , bᴰ ]) 
+      Type (ℓ-max (ℓ-max ℓB ℓ'B) (ℓ-max ℓE ℓ'E))
+    isCartesian {a} {b} f {aᴰ} {bᴰ} fᴰ =
+       {c : ob} {cᴰ : ob[ c ]} (g : B [ c , a ])  isEquiv λ (gᴰ : Hom[ g ][ cᴰ , aᴰ ])  gᴰ ⋆ᴰ fᴰ
+
+  opaque
+    unfolding isCartesian
+    isPropIsCartesian :
+      {a b : ob} (f : B [ a , b ])
+      {aᴰ : ob[ a ]} {bᴰ : ob[ b ]}
+      (fᴰ : Hom[ f ][ aᴰ , bᴰ ]) 
+      isProp (isCartesian f fᴰ)
+    isPropIsCartesian f fᴰ = isPropImplicitΠ2 λ c cᴰ  isPropΠ λ g  isPropIsEquiv (_⋆ᴰ fᴰ)
+
+  opaque
+    isCartesian' :
+      {a b : ob} (f : B [ a , b ])
+      {aᴰ : ob[ a ]} {bᴰ : ob[ b ]}
+      (fᴰ : Hom[ f ][ aᴰ , bᴰ ]) 
+      Type (ℓ-max (ℓ-max ℓB ℓ'B) (ℓ-max ℓE ℓ'E))
+    isCartesian' {a} {b} f {aᴰ} {bᴰ} fᴰ =
+       {c : ob} {cᴰ : ob[ c ]} (g : B [ c , a ]) 
+        (∀ (hᴰ : Hom[ g  f ][ cᴰ , bᴰ ])  ∃![ gᴰ  Hom[ g ][ cᴰ , aᴰ ] ] gᴰ ⋆ᴰ fᴰ  hᴰ)
+
+  opaque
+    unfolding isCartesian'
+    isPropIsCartesian' :
+      {a b : ob} {f : B [ a , b ]}
+      {aᴰ : ob[ a ]} {bᴰ : ob[ b ]}
+      (fᴰ : Hom[ f ][ aᴰ , bᴰ ]) 
+      isProp (isCartesian' f fᴰ)
+    isPropIsCartesian' {a} {b} {f} {aᴰ} {bᴰ} fᴰ =
+      isPropImplicitΠ2 λ c cᴰ  isPropΠ2 λ g hᴰ  isPropIsContr
+
+  opaque
+    unfolding isCartesian
+    unfolding isCartesian'
+    isCartesian→isCartesian' :
+      {a b : ob} (f : B [ a , b ])
+      {aᴰ : ob[ a ]} {bᴰ : ob[ b ]}
+      (fᴰ : Hom[ f ][ aᴰ , bᴰ ]) 
+      isCartesian f fᴰ 
+      isCartesian' f fᴰ
+    isCartesian→isCartesian' {a} {b} f {aᴰ} {bᴰ} fᴰ cartfᴰ g hᴰ =
+      ((invIsEq (cartfᴰ g) hᴰ) , (secIsEq (cartfᴰ g) hᴰ)) ,
+       { (gᴰ , gᴰ⋆fᴰ≡hᴰ)  cartfᴰ g .equiv-proof hᴰ .snd (gᴰ , gᴰ⋆fᴰ≡hᴰ) })
+
+  opaque
+    unfolding isCartesian
+    unfolding isCartesian'
+    isCartesian'→isCartesian :
+      {a b : ob} (f : B [ a , b ])
+      {aᴰ : ob[ a ]} {bᴰ : ob[ b ]}
+      (fᴰ : Hom[ f ][ aᴰ , bᴰ ]) 
+      isCartesian' f fᴰ 
+      isCartesian f fᴰ
+    equiv-proof (isCartesian'→isCartesian {a} {b} f {aᴰ} {bᴰ} fᴰ cart'fᴰ g) hᴰ = (cart'fᴰ g hᴰ .fst) , (cart'fᴰ g hᴰ .snd)
+
+  isCartesian≃isCartesian' :
+    {a b : ob} (f : B [ a , b ])
+    {aᴰ : ob[ a ]} {bᴰ : ob[ b ]}
+    (fᴰ : Hom[ f ][ aᴰ , bᴰ ]) 
+    isCartesian f fᴰ  isCartesian' f fᴰ
+  isCartesian≃isCartesian' {a} {b} f {aᴰ} {bᴰ} fᴰ =
+    propBiimpl→Equiv (isPropIsCartesian f fᴰ) (isPropIsCartesian' fᴰ) (isCartesian→isCartesian' f fᴰ) (isCartesian'→isCartesian f fᴰ)
+
+  cartesianLift : {a b : ob} (f : B [ a , b ]) (bᴰ : ob[ b ])  Type _
+  cartesianLift {a} {b} f bᴰ = Σ[ aᴰ  ob[ a ] ] Σ[ fᴰ  Hom[ f ][ aᴰ , bᴰ ] ] isCartesian f fᴰ
+
+  isCartesianFibration : Type _
+  isCartesianFibration =
+     {a b : ob} {bᴰ : ob[ b ]}
+     (f : Hom[ a , b ])
+      cartesianLift f bᴰ ∥₁
+
+  isPropIsCartesianFibration : isProp isCartesianFibration
+  isPropIsCartesianFibration = isPropImplicitΠ3 λ a b bᴰ  isPropΠ λ f  isPropPropTrunc
+
+  cleavage : Type _
+  cleavage = {a b : ob} (f : Hom[ a , b ]) (bᴰ : ob[ b ])  cartesianLift f bᴰ
+
\ No newline at end of file diff --git a/docs/Categories.GenericObject.html b/docs/Categories.GenericObject.html new file mode 100644 index 0000000..7ca3cbb --- /dev/null +++ b/docs/Categories.GenericObject.html @@ -0,0 +1,30 @@ + +Categories.GenericObject
open import Cubical.Foundations.Prelude
+open import Cubical.Categories.Category
+open import Cubical.Categories.Displayed.Base
+open import Cubical.Foundations.Equiv
+open import Cubical.Foundations.HLevels
+open import Cubical.Data.Sigma
+open import Cubical.HITs.PropositionalTruncation
+open import Categories.CartesianMorphism
+
+module Categories.GenericObject where
+
+module _
+  {ℓB ℓ'B ℓE ℓ'E}
+  {B : Category ℓB ℓ'B}
+  (E : Categoryᴰ B ℓE ℓ'E) where
+
+  open Category B
+  open Categoryᴰ E
+  open Contravariant E
+
+  record GenericObject : Type (ℓ-max (ℓ-max ℓB ℓ'B) (ℓ-max ℓE ℓ'E)) where
+    constructor makeGenericObject
+    field
+      base : ob
+      displayed : ob[ base ]
+      isGeneric :
+         {t : ob} (tᴰ : ob[ t ])
+         Σ[ f  Hom[ t , base ] ] Σ[ fᴰ  Hom[ f ][ tᴰ , displayed ] ] isCartesian f fᴰ
+
\ No newline at end of file diff --git a/docs/Cubical.Categories.Displayed.Base.html b/docs/Cubical.Categories.Displayed.Base.html new file mode 100644 index 0000000..ef08d5e --- /dev/null +++ b/docs/Cubical.Categories.Displayed.Base.html @@ -0,0 +1,131 @@ + +Cubical.Categories.Displayed.Base
{-
+  Definition of a category displayed over another category.
+  Some definitions were guided by those at https://1lab.dev
+-}
+{-# OPTIONS --safe #-}
+module Cubical.Categories.Displayed.Base where
+
+open import Cubical.Foundations.Prelude
+open import Cubical.Foundations.HLevels
+open import Cubical.Data.Sigma
+open import Cubical.Categories.Category.Base
+
+private
+  variable
+    ℓC ℓC' ℓCᴰ ℓCᴰ' ℓDᴰ ℓDᴰ' : Level
+
+-- Displayed categories with hom-sets
+record Categoryᴰ (C : Category ℓC ℓC') ℓCᴰ ℓCᴰ' : Type (ℓ-suc (ℓ-max (ℓ-max ℓC ℓC') (ℓ-max ℓCᴰ ℓCᴰ'))) where
+  no-eta-equality
+  open Category C
+  field
+    ob[_] : ob  Type ℓCᴰ
+    Hom[_][_,_] : {x y : ob}  Hom[ x , y ]  ob[ x ]  ob[ y ]  Type ℓCᴰ'
+    idᴰ :  {x} {p : ob[ x ]}  Hom[ id ][ p , p ]
+    _⋆ᴰ_ :  {x y z} {f : Hom[ x , y ]} {g : Hom[ y , z ]} {xᴰ yᴰ zᴰ}
+       Hom[ f ][ xᴰ , yᴰ ]  Hom[ g ][ yᴰ , zᴰ ]  Hom[ f  g ][ xᴰ , zᴰ ]
+
+  infixr 9 _⋆ᴰ_
+  infixr 9 _∘ᴰ_
+
+  _≡[_]_ :  {x y xᴰ yᴰ} {f g : Hom[ x , y ]}  Hom[ f ][ xᴰ , yᴰ ]  f  g  Hom[ g ][ xᴰ , yᴰ ]  Type ℓCᴰ'
+  _≡[_]_ {x} {y} {xᴰ} {yᴰ} fᴰ p gᴰ = PathP  i  Hom[ p i ][ xᴰ , yᴰ ]) fᴰ gᴰ
+
+  infix 2 _≡[_]_
+
+  field
+    ⋆IdLᴰ :  {x y} {f : Hom[ x , y ]} {xᴰ yᴰ} (fᴰ : Hom[ f ][ xᴰ , yᴰ ])  idᴰ ⋆ᴰ fᴰ ≡[ ⋆IdL f ] fᴰ
+    ⋆IdRᴰ :  {x y} {f : Hom[ x , y ]} {xᴰ yᴰ} (fᴰ : Hom[ f ][ xᴰ , yᴰ ])  fᴰ ⋆ᴰ idᴰ ≡[ ⋆IdR f ] fᴰ
+    ⋆Assocᴰ :  {x y z w} {f : Hom[ x , y ]} {g : Hom[ y , z ]}  {h : Hom[ z , w ]} {xᴰ yᴰ zᴰ wᴰ}
+      (fᴰ : Hom[ f ][ xᴰ , yᴰ ]) (gᴰ : Hom[ g ][ yᴰ , zᴰ ]) (hᴰ : Hom[ h ][ zᴰ , wᴰ ])
+       (fᴰ ⋆ᴰ gᴰ) ⋆ᴰ hᴰ ≡[ ⋆Assoc f g h ] fᴰ ⋆ᴰ (gᴰ ⋆ᴰ hᴰ)
+    isSetHomᴰ :  {x y} {f : Hom[ x , y ]} {xᴰ yᴰ}  isSet Hom[ f ][ xᴰ , yᴰ ]
+
+  -- composition: alternative to diagramatic order
+  _∘ᴰ_ :  {x y z} {f : Hom[ x , y ]} {g : Hom[ y , z ]} {xᴰ yᴰ zᴰ}
+       Hom[ g ][ yᴰ , zᴰ ]  Hom[ f ][ xᴰ , yᴰ ]  Hom[ f  g ][ xᴰ , zᴰ ]
+  g ∘ᴰ f = f ⋆ᴰ g
+
+-- Helpful syntax/notation
+_[_][_,_] = Categoryᴰ.Hom[_][_,_]
+
+-- Total category of a displayed category
+module _ {C : Category ℓC ℓC'} (Cᴰ : Categoryᴰ C ℓCᴰ ℓCᴰ') where
+
+  open Category
+  open Categoryᴰ Cᴰ
+  private
+    module C = Category C
+
+  ∫C : Category (ℓ-max ℓC ℓCᴰ) (ℓ-max ℓC' ℓCᴰ')
+  ∫C .ob = Σ _ ob[_]
+  ∫C .Hom[_,_] (_ , xᴰ) (_ , yᴰ) = Σ _ Hom[_][ xᴰ , yᴰ ]
+  ∫C .id = _ , idᴰ
+  ∫C ._⋆_ (_ , fᴰ) (_ , gᴰ) = _ , fᴰ ⋆ᴰ gᴰ
+  ∫C .⋆IdL _ = ΣPathP (_ , ⋆IdLᴰ _)
+  ∫C .⋆IdR _ = ΣPathP (_ , ⋆IdRᴰ _)
+  ∫C .⋆Assoc _ _ _ = ΣPathP (_ , ⋆Assocᴰ _ _ _)
+  ∫C .isSetHom = isSetΣ C.isSetHom  _  isSetHomᴰ)
+
+-- Displayed total category, i.e. Σ for displayed categories
+module _ {C : Category ℓC ℓC'}
+  (Cᴰ : Categoryᴰ C ℓCᴰ ℓCᴰ')
+  (Dᴰ : Categoryᴰ (∫C Cᴰ) ℓDᴰ ℓDᴰ')
+  where
+
+  open Categoryᴰ
+  private
+    module Cᴰ = Categoryᴰ Cᴰ
+    module Dᴰ = Categoryᴰ Dᴰ
+
+  ∫Cᴰ : Categoryᴰ C (ℓ-max ℓCᴰ ℓDᴰ) (ℓ-max ℓCᴰ' ℓDᴰ')
+  ∫Cᴰ .ob[_] x = Σ[ xᴰ  Cᴰ.ob[ x ] ] Dᴰ.ob[ x , xᴰ ]
+  ∫Cᴰ .Hom[_][_,_] f (_ , zᴰ) (_ , wᴰ) = Σ[ fᴰ  Cᴰ.Hom[ f ][ _ , _ ] ] Dᴰ.Hom[ f , fᴰ ][ zᴰ , wᴰ ]
+  ∫Cᴰ .idᴰ = Cᴰ.idᴰ , Dᴰ.idᴰ
+  ∫Cᴰ ._⋆ᴰ_ (_ , hᴰ) (_ , kᴰ) = _ , hᴰ Dᴰ.⋆ᴰ kᴰ
+  ∫Cᴰ .⋆IdLᴰ _ = ΣPathP (_ , Dᴰ.⋆IdLᴰ _)
+  ∫Cᴰ .⋆IdRᴰ _ = ΣPathP (_ , Dᴰ.⋆IdRᴰ _)
+  ∫Cᴰ .⋆Assocᴰ _ _ _ = ΣPathP (_ , Dᴰ.⋆Assocᴰ _ _ _)
+  ∫Cᴰ .isSetHomᴰ = isSetΣ Cᴰ.isSetHomᴰ  _  Dᴰ.isSetHomᴰ)
+
+module _ {C : Category ℓC ℓC'}
+  (Cᴰ : Categoryᴰ C ℓCᴰ ℓCᴰ')
+  (Dᴰ : Categoryᴰ C ℓDᴰ ℓDᴰ')
+  where
+
+  open Categoryᴰ
+  private
+    module Dᴰ = Categoryᴰ Dᴰ
+
+  weakenᴰ : Categoryᴰ (∫C Cᴰ) ℓDᴰ ℓDᴰ'
+  weakenᴰ .ob[_] (x , _) = Dᴰ.ob[ x ]
+  weakenᴰ .Hom[_][_,_] (f , _) = Dᴰ.Hom[ f ][_,_]
+  weakenᴰ .idᴰ = Dᴰ.idᴰ
+  weakenᴰ ._⋆ᴰ_ = Dᴰ._⋆ᴰ_
+  weakenᴰ .⋆IdLᴰ = Dᴰ.⋆IdLᴰ
+  weakenᴰ .⋆IdRᴰ = Dᴰ.⋆IdRᴰ
+  weakenᴰ .⋆Assocᴰ = Dᴰ.⋆Assocᴰ
+  weakenᴰ .isSetHomᴰ = Dᴰ.isSetHomᴰ
+
+module _ {C : Category ℓC ℓC'} (Cᴰ : Categoryᴰ C ℓCᴰ ℓCᴰ') where
+  open Category C
+  open Categoryᴰ Cᴰ
+
+  record isIsoᴰ {a b : ob} {f : C [ a , b ]} (f-isIso : isIso C f)
+    {aᴰ : ob[ a ]} {bᴰ : ob[ b ]} (fᴰ : Hom[ f ][ aᴰ , bᴰ ])
+    : Type ℓCᴰ'
+    where
+    constructor isisoᴰ
+    open isIso f-isIso
+    field
+      invᴰ : Hom[ inv ][ bᴰ , aᴰ ]
+      secᴰ : invᴰ ⋆ᴰ fᴰ ≡[ sec ] idᴰ
+      retᴰ : fᴰ ⋆ᴰ invᴰ ≡[ ret ] idᴰ
+
+  CatIsoᴰ : {a b : ob}  CatIso C a b  ob[ a ]  ob[ b ]  Type ℓCᴰ'
+  CatIsoᴰ (f , f-isIso) aᴰ bᴰ = Σ[ fᴰ  Hom[ f ][ aᴰ , bᴰ ] ] isIsoᴰ f-isIso fᴰ
+
+  idᴰCatIsoᴰ : {x : ob} {xᴰ : ob[ x ]}  CatIsoᴰ idCatIso xᴰ xᴰ
+  idᴰCatIsoᴰ = idᴰ , isisoᴰ idᴰ (⋆IdLᴰ idᴰ) (⋆IdLᴰ idᴰ)
+
\ No newline at end of file diff --git a/docs/Cubical.Categories.Displayed.Reasoning.html b/docs/Cubical.Categories.Displayed.Reasoning.html new file mode 100644 index 0000000..6e7e7da --- /dev/null +++ b/docs/Cubical.Categories.Displayed.Reasoning.html @@ -0,0 +1,110 @@ + +Cubical.Categories.Displayed.Reasoning
{-# OPTIONS --safe #-}
+
+open import Cubical.Foundations.Prelude
+open import Cubical.Foundations.Function
+open import Cubical.Foundations.GroupoidLaws
+open import Cubical.Foundations.Transport
+
+open import Cubical.Categories.Category.Base
+open import Cubical.Categories.Displayed.Base
+
+module Cubical.Categories.Displayed.Reasoning
+  {ℓC ℓ'C ℓCᴰ ℓ'Cᴰ : Level}
+  {C : Category ℓC ℓ'C}
+  (Cᴰ : Categoryᴰ C ℓCᴰ ℓ'Cᴰ)
+  where
+
+  open Categoryᴰ Cᴰ
+  private module C = Category C
+  open Category hiding (_∘_)
+
+  reind : {a b : C.ob} {f g : C [ a , b ]} (p : f  g)
+      {aᴰ : ob[ a ]} {bᴰ : ob[ b ]}
+     Hom[ f ][ aᴰ , bᴰ ]  Hom[ g ][ aᴰ , bᴰ ]
+  reind p = subst Hom[_][ _ , _ ] p
+
+  reind-filler : {a b : C.ob} {f g : C [ a , b ]} (p : f  g)
+      {aᴰ : ob[ a ]} {bᴰ : ob[ b ]}
+      (f : Hom[ f ][ aᴰ , bᴰ ])
+     f ≡[ p ] reind p f
+  reind-filler p = subst-filler Hom[_][ _ , _ ] p
+
+  reind-filler-sym : {a b : C.ob} {f g : C [ a , b ]} (p : f  g)
+      {aᴰ : ob[ a ]} {bᴰ : ob[ b ]}
+      (f : Hom[ g ][ aᴰ , bᴰ ])
+     reind (sym p) f ≡[ p ] f
+  reind-filler-sym p = symP  reind-filler (sym p)
+
+  ≡[]-rectify : {a b : C.ob} {f g : C [ a , b ]} {p p' : f  g}
+      {aᴰ : ob[ a ]} {bᴰ : ob[ b ]}
+      {fᴰ : Hom[ f ][ aᴰ , bᴰ ]}
+      {gᴰ : Hom[ g ][ aᴰ , bᴰ ]}
+     fᴰ ≡[ p ] gᴰ  fᴰ ≡[ p' ] gᴰ
+  ≡[]-rectify {fᴰ = fᴰ} {gᴰ = gᴰ} = subst (fᴰ ≡[_] gᴰ) (C.isSetHom _ _ _ _)
+
+  ≡[]∙ : {a b : C.ob} {f g h : C [ a , b ]}
+      {aᴰ : ob[ a ]} {bᴰ : ob[ b ]}
+      {fᴰ : Hom[ f ][ aᴰ , bᴰ ]}
+      {gᴰ : Hom[ g ][ aᴰ , bᴰ ]}
+      {hᴰ : Hom[ h ][ aᴰ , bᴰ ]}
+      (p : f  g) (q : g  h)
+     fᴰ ≡[ p ] gᴰ
+     gᴰ ≡[ q ] hᴰ  fᴰ ≡[ p  q ] hᴰ
+  ≡[]∙ {fᴰ = fᴰ} {hᴰ = hᴰ} p q eq1 eq2 =
+    subst
+       p  PathP  i  p i) fᴰ hᴰ)
+      (sym $ congFunct Hom[_][ _ , _ ] p q)
+      (compPathP eq1 eq2)
+
+  infixr 30 ≡[]∙
+  syntax ≡[]∙ p q eq1 eq2 = eq1 [ p ]∙[ q ] eq2
+
+  ≡[]⋆ : {a b c : C.ob} {f g : C [ a , b ]} {h i : C [ b , c ]}
+      {aᴰ : ob[ a ]} {bᴰ : ob[ b ]} {cᴰ : ob[ c ]}
+      {fᴰ : Hom[ f ][ aᴰ , bᴰ ]}
+      {gᴰ : Hom[ g ][ aᴰ , bᴰ ]}
+      {hᴰ : Hom[ h ][ bᴰ , cᴰ ]}
+      {iᴰ : Hom[ i ][ bᴰ , cᴰ ]}
+      (p : f  g) (q : h  i)
+     fᴰ ≡[ p ] gᴰ  hᴰ ≡[ q ] iᴰ  fᴰ ⋆ᴰ hᴰ ≡[ cong₂ C._⋆_ p q ] gᴰ ⋆ᴰ iᴰ
+  ≡[]⋆ _ _ = congP₂  _  _⋆ᴰ_)
+
+  infixr 30 ≡[]⋆
+  syntax ≡[]⋆ p q eq1 eq2 = eq1 [ p ]⋆[ q ] eq2
+
+  reind-rectify : {a b : C.ob} {f g : C [ a , b ]} {p p' : f  g}
+      {aᴰ : ob[ a ]} {bᴰ : ob[ b ]}
+      {fᴰ : Hom[ f ][ aᴰ , bᴰ ]}
+     reind p fᴰ  reind p' fᴰ
+  reind-rectify {fᴰ = fᴰ} = cong  p  reind p fᴰ) (C.isSetHom _ _ _ _)
+
+  reind-contractʳ : {a b c : C.ob} {f g : C [ a , b ]} {h : C [ b , c ]}
+      {p : f  g}
+      {aᴰ : ob[ a ]} {bᴰ : ob[ b ]} {cᴰ : ob[ c ]}
+      {fᴰ : Hom[ f ][ aᴰ , bᴰ ]} {hᴰ : Hom[ h ][ bᴰ , cᴰ ]}
+     reind (cong (C._⋆ h) p) (fᴰ ⋆ᴰ hᴰ)  reind p fᴰ ⋆ᴰ hᴰ
+  reind-contractʳ {hᴰ = hᴰ} = fromPathP $
+    congP  _  _⋆ᴰ hᴰ) (transport-filler _ _)
+
+  reind-comp : {a b : C.ob} {f g h : C [ a , b ]} {p : f  g} {q : g  h}
+      {aᴰ : ob[ a ]} {bᴰ : ob[ b ]}
+      {fᴰ : Hom[ f ][ aᴰ , bᴰ ]}
+     reind (p  q) fᴰ  reind q (reind p fᴰ)
+  reind-comp = substComposite Hom[_][ _ , _ ] _ _ _
+
+  reind-contractˡ : {a b c : C.ob} {f : C [ a , b ]} {g h : C [ b , c ]}
+      {p : g  h}
+      {aᴰ : ob[ a ]} {bᴰ : ob[ b ]} {cᴰ : ob[ c ]}
+      {fᴰ : Hom[ f ][ aᴰ , bᴰ ]} {gᴰ : Hom[ g ][ bᴰ , cᴰ ]}
+     reind (cong (f C.⋆_) p) (fᴰ ⋆ᴰ gᴰ)  fᴰ ⋆ᴰ reind p gᴰ
+  reind-contractˡ {fᴰ = fᴰ} = fromPathP $
+    congP  _  fᴰ ⋆ᴰ_) (transport-filler _ _)
+
+  ≡→≡[] : {a b : C.ob} {f g : C [ a , b ]} {p : f  g}
+      {aᴰ : ob[ a ]} {bᴰ : ob[ b ]}
+      {fᴰ : Hom[ f ][ aᴰ , bᴰ ]}
+      {gᴰ : Hom[ g ][ aᴰ , bᴰ ]}
+     reind p fᴰ  gᴰ  fᴰ ≡[ p ] gᴰ
+  ≡→≡[] = toPathP
+
\ No newline at end of file diff --git a/docs/Cubical.HITs.SetCoequalizer.Properties.html b/docs/Cubical.HITs.SetCoequalizer.Properties.html index 5c15678..1422113 100644 --- a/docs/Cubical.HITs.SetCoequalizer.Properties.html +++ b/docs/Cubical.HITs.SetCoequalizer.Properties.html @@ -24,21 +24,21 @@ -- Some helpful lemmas, similar to those in Cubical/HITs/SetQuotients/Properties.agda elimProp : {f g : A B} {C : SetCoequalizer f g Type } - (Cprop : (x : SetCoequalizer f g) isProp (C x)) + (Cprop : (x : SetCoequalizer f g) isProp (C x)) (Cinc : (b : B) C (inc b)) (x : SetCoequalizer f g) C x elimProp Cprop Cinc (inc x) = Cinc x elimProp {f = f} {g = g} Cprop Cinc (coeq a i) = - isProp→PathP i Cprop (coeq a i)) (Cinc (f a)) (Cinc (g a)) i + isProp→PathP i Cprop (coeq a i)) (Cinc (f a)) (Cinc (g a)) i elimProp Cprop Cinc (squash x y p q i j) = - isOfHLevel→isOfHLevelDep - 2 x isProp→isSet (Cprop x)) (g x) (g y) (cong g p) (cong g q) (squash x y p q) i j + isOfHLevel→isOfHLevelDep + 2 x isProp→isSet (Cprop x)) (g x) (g y) (cong g p) (cong g q) (squash x y p q) i j where g = elimProp Cprop Cinc elimProp2 : {A' : Type } {B' : Type ℓ'} {f g : A B} {f' g' : A' B'} {C : SetCoequalizer f g SetCoequalizer f' g' Type (ℓ-max ℓ')} - (Cprop : (x : SetCoequalizer f g) (y : SetCoequalizer f' g') isProp (C x y)) + (Cprop : (x : SetCoequalizer f g) (y : SetCoequalizer f' g') isProp (C x y)) (Cinc : (b : B) (b' : B') C (inc b) (inc b')) (x : SetCoequalizer f g) (y : SetCoequalizer f' g') C x y elimProp2 Cprop Cinc = elimProp x isPropΠ y Cprop x y)) @@ -51,7 +51,7 @@ (Cprop : (x : SetCoequalizer f g) (y : SetCoequalizer f' g') (z : SetCoequalizer f'' g'') - isProp (C x y z)) + isProp (C x y z)) (Cinc : (b : B) (b' : B') (b'' : B'') C (inc b) (inc b') (inc b'')) (x : SetCoequalizer f g) (y : SetCoequalizer f' g') (z : SetCoequalizer f'' g'') C x y z @@ -77,7 +77,7 @@ SetCoequalizer f g SetCoequalizer f' g' C rec2 Cset h hcoeqsl hcoeqsr = rec - (isSetΠ _ Cset)) + (isSetΠ _ Cset)) b rec Cset b' h b b') a' hcoeqsr a' b)) a funExt (elimProp _ Cset _ _) b' hcoeqsl a b'))) diff --git a/docs/Realizability.ApplicativeStructure.html b/docs/Realizability.ApplicativeStructure.html index 8499598..7fcf1d3 100644 --- a/docs/Realizability.ApplicativeStructure.html +++ b/docs/Realizability.ApplicativeStructure.html @@ -1,173 +1,238 @@ -Realizability.ApplicativeStructure
open import Cubical.Core.Everything
-open import Cubical.Foundations.Prelude
-open import Cubical.Foundations.HLevels
-open import Cubical.Relation.Nullary
-open import Cubical.Data.Nat
-open import Cubical.Data.Nat.Order
-open import Cubical.Data.FinData
-open import Cubical.Data.Vec
-open import Cubical.Data.Empty renaming (elim to ⊥elim)
-open import Cubical.Tactics.NatSolver
-
-module Realizability.ApplicativeStructure where
-
-private module _ {} {A : Type } where
-  -- Taken from Data.Vec.Base from agda-stdlib
-  foldlOp :  {ℓ'} (B :   Type ℓ')  Type _
-  foldlOp B =  {n}  B n  A  B (suc n)
-
-  opaque
-    foldl :  {ℓ'} {n : } (B :   Type ℓ')  foldlOp B  B zero  Vec A n  B n
-    foldl {ℓ'} {.zero} B op acc emptyVec = acc
-    foldl {ℓ'} {.(suc _)} B op acc (x ∷vec vec) = foldl  n  B (suc n)) op (op acc x) vec
-
-  opaque
-    reverse :  {n}  Vec A n  Vec A n
-    reverse vec = foldl  n  Vec A n)  acc curr  curr  acc) [] vec
-
-  opaque
-    chain :  {n}  Vec A (suc n)  (A  A  A)  A
-    chain {n} (x ∷vec vec) op = foldl  _  A)  acc curr  op acc curr) x vec
-
-record ApplicativeStructure {} (A : Type ) : Type  where
-  infixl 20 _⨾_
-  field
-    isSetA : isSet A
-    _⨾_ : A  A  A
-
-module _ {} {A : Type } (as : ApplicativeStructure A) where
-  open ApplicativeStructure as
-  infix 23 `_
-  infixl 22 _̇_
-  data Term (n : ) : Type  where
-    # : Fin n  Term n
-    `_ : A  Term n
-    _̇_ : Term n  Term n  Term n
-
-  ⟦_⟧ :  {n}  Term n  Vec A n  A
-  ⟦_⟧ (` a) _ = a
-  ⟦_⟧ {n} (# k) subs = lookup k subs
-  ⟦_⟧ (a ̇ b) subs = ( a  subs)  ( b  subs)
-
-  applicationChain :  {n m}  Vec (Term m) (suc n)  Term m
-  applicationChain {n} {m} vec = chain vec  x y  x ̇ y)
-
-  apply :  {n}  A  Vec A n  A
-  apply {n} a vec = chain (a  vec)  x y  x  y)
-  
-  private
-    opaque
-      unfolding reverse
-      unfolding foldl
-      unfolding chain
-      applyWorks :  K a b  apply K (a  b  [])  K  a  b
-      applyWorks K a b = refl
-
-  record Feferman : Type  where
-    field
-      s : A
-      k : A
-      kab≡a :  a b  k  a  b  a
-      sabc≡ac_bc :  a b c  s  a  b  c  (a  c)  (b  c)
-      
-  module ComputationRules (feferman : Feferman) where
-    open Feferman feferman
-
-    opaque
-      λ*abst :  {n}  (e : Term (suc n))  Term n
-      λ*abst {n} (# zero) = ` s ̇ ` k ̇ ` k
-      λ*abst {n} (# (suc x)) = ` k ̇ # x
-      λ*abst {n} (` x) = ` k ̇ ` x
-      λ*abst {n} (e ̇ e₁) = ` s ̇ λ*abst e ̇ λ*abst e₁
-
-    -- Some shortcuts
-
-    λ* : Term one  A
-    λ* t =  λ*abst t  []
-
-    λ*2 : Term two  A
-    λ*2 t =  λ*abst (λ*abst t)  []
-
-    λ*3 : Term three  A
-    λ*3 t =  λ*abst (λ*abst (λ*abst t))  []
-
-    λ*4 : Term four  A
-    λ*4 t =  λ*abst (λ*abst (λ*abst (λ*abst t)))  []
-
-    opaque
-      unfolding λ*abst
-      βreduction :  {n}  (body : Term (suc n))  (prim : A)  (subs : Vec A n)   λ*abst body ̇ ` prim  subs   body  (prim  subs)
-      βreduction {n} (# zero) prim subs =
-        s  k  k  prim
-          ≡⟨ sabc≡ac_bc _ _ _ 
-        k  prim  (k  prim)
-          ≡⟨ kab≡a _ _ 
-        prim
-          
-      βreduction {n} (# (suc x)) prim subs = kab≡a _ _
-      βreduction {n} (` x) prim subs = kab≡a _ _
-      βreduction {n} (rator ̇ rand) prim subs =
-        s   λ*abst rator  subs   λ*abst rand  subs  prim
-          ≡⟨ sabc≡ac_bc _ _ _ 
-         λ*abst rator  subs  prim  ( λ*abst rand  subs  prim)
-          ≡⟨ cong₂  x y  x  y) (βreduction rator prim subs) (βreduction rand prim subs) 
-         rator  (prim  subs)   rand  (prim  subs)
-          
-
-    λ*chainTerm :  n  Term n  Term zero
-    λ*chainTerm zero t = t
-    λ*chainTerm (suc n) t = λ*chainTerm n (λ*abst t)
-
-    λ*chain :  {n}  Term n  A
-    λ*chain {n} t =  λ*chainTerm n t  []
-
-    opaque
-      unfolding reverse
-      unfolding foldl
-      unfolding chain
-
-      λ*ComputationRule :  (t : Term 1) (a : A)  λ* t  a   t  (a  [])
-      λ*ComputationRule t a =
-         λ*abst t  []  a
-          ≡⟨ βreduction t a [] 
-         t  (a  [])
-          
-
-      λ*2ComputationRule :  (t : Term 2) (a b : A)  λ*2 t  a  b   t  (b  a  [])
-      λ*2ComputationRule t a b =
-         λ*abst (λ*abst t)  []  a  b
-          ≡⟨ refl 
-         λ*abst (λ*abst t)  []   ` a  []   ` b  []
-          ≡⟨ refl 
-         λ*abst (λ*abst t) ̇ ` a  []   ` b  []
-          ≡⟨ cong  x  x  b) (βreduction (λ*abst t) a []) 
-         λ*abst t  (a  [])  b
-          ≡⟨ βreduction t b (a  []) 
-         t  (b  a  [])
-          
+Realizability.ApplicativeStructure
---
+title: Applicative Structure
+author: Rahul Chhabra
+---
+# Applicative Structure
+
+In this module we define the notion of an _applicative structure_.
+
+A type $A$ has applicative structure if it has an "application operation" (here represented by `_⨾_`) and is a set.
+
+<details>
+```agda
+open import Cubical.Core.Everything
+open import Cubical.Foundations.Prelude
+open import Cubical.Foundations.HLevels
+open import Cubical.Relation.Nullary
+open import Cubical.Data.Nat
+open import Cubical.Data.Nat.Order
+open import Cubical.Data.FinData
+open import Cubical.Data.Vec
+open import Cubical.Data.Empty renaming (elim to ⊥elim)
+open import Cubical.Tactics.NatSolver
+
+module Realizability.ApplicativeStructure where
+
+private module _ {} {A : Type } where
+  -- Taken from Data.Vec.Base from agda-stdlib
+  foldlOp :  {ℓ'} (B :   Type ℓ')  Type _
+  foldlOp B =  {n}  B n  A  B (suc n)
+
+  opaque
+    foldl :  {ℓ'} {n : } (B :   Type ℓ')  foldlOp B  B zero  Vec A n  B n
+    foldl {ℓ'} {.zero} B op acc emptyVec = acc
+    foldl {ℓ'} {.(suc _)} B op acc (x ∷vec vec) = foldl  n  B (suc n)) op (op acc x) vec
+
+  opaque
+    reverse :  {n}  Vec A n  Vec A n
+    reverse vec = foldl  n  Vec A n)  acc curr  curr  acc) [] vec
+
+  opaque
+    chain :  {n}  Vec A (suc n)  (A  A  A)  A
+    chain {n} (x ∷vec vec) op = foldl  _  A)  acc curr  op acc curr) x vec
+```
+</details>
+
+```agda
+record ApplicativeStructure {} (A : Type ) : Type  where
+  infixl 20 _⨾_
+  field
+    isSetA : isSet A
+    _⨾_ : A  A  A
+```
+
+Since being a set is a property - we will generally not have to think about it too much. Also, since `A` is a set - we can drop the relevance of paths and simply talk about "equality".
+
+We can define the notion of a term over an applicative structure.
+```agda
+module _ {} {A : Type } (as : ApplicativeStructure A) where
+  open ApplicativeStructure as
+  infix 23 `_
+  infixl 22 _̇_
+  data Term (n : ) : Type  where
+    # : Fin n  Term n
+    `_ : A  Term n
+    _̇_ : Term n  Term n  Term n
+```
+
+These terms can be evaluated into $A$ if we can give the values of the free variables.
+
+```agda
+  ⟦_⟧ :  {n}  Term n  Vec A n  A
+  ⟦_⟧ (` a) _ = a
+  ⟦_⟧ {n} (# k) subs = lookup k subs
+  ⟦_⟧ (a ̇ b) subs = ( a  subs)  ( b  subs)
+
+  applicationChain :  {n m}  Vec (Term m) (suc n)  Term m
+  applicationChain {n} {m} vec = chain vec  x y  x ̇ y)
+
+  apply :  {n}  A  Vec A n  A
+  apply {n} a vec = chain (a  vec)  x y  x  y)
+```
+
+<details>
+```agda
+  private
+    opaque
+      unfolding reverse
+      unfolding foldl
+      unfolding chain
+      applyWorks :  K a b  apply K (a  b  [])  K  a  b
+      applyWorks K a b = refl
+```
+</details>
+
+On an applicative structure we can define Feferman structure (or SK structure). We call an applicative structure endowed with Feferman structure a **combinatory algebra**.
+
+```agda
+  record Feferman : Type  where
+    field
+      s : A
+      k : A
+      kab≡a :  a b  k  a  b  a
+      sabc≡ac_bc :  a b c  s  a  b  c  (a  c)  (b  c)
+```
+
+Feferman structure allows us to construct **combinatorial completeness** structure.
+
+Imagine we have a term `t : Term n` (for some `n : ℕ`). We can ask if `A` has a "copy" of `t` so that application would correspond to subsitution. That is, we may ask if we can find an `a : A` such that
+`a ⨾ < a¹ ⨾ a² ⨾ .... ⨾ aⁿ >` (here the `< ... >` notation represents a chain of applications) would be equal to `t [a¹ / # 0 , a² / # 1 , .... , aⁿ / # (pred n) ]`. If the applicative structure additionally can be endowed with Feferman structure - then the answer is yes. 
+
+To get to such a term, we first need to define a function that takes `Term (suc n)` to `Term n` by "abstracting" the free variable represented by the index `# 0`.
+
+We will call this `λ*abst` and this will turn out to behave very similar to λ abstraction - and we will also show that it validates a kind of β reduction rule.
+
+```agda
+  module ComputationRules (feferman : Feferman) where
+    open Feferman feferman
+
+    opaque
+      λ*abst :  {n}  (e : Term (suc n))  Term n
+      λ*abst {n} (# zero) = ` s ̇ ` k ̇ ` k
+      λ*abst {n} (# (suc x)) = ` k ̇ # x
+      λ*abst {n} (` x) = ` k ̇ ` x
+      λ*abst {n} (e ̇ e₁) = ` s ̇ λ*abst e ̇ λ*abst e₁
+```
+
+**Remark** : It is important to note that in general, realizability is developed using **partial combinatory algebras** and **partial applicative structures**. In this case, `λ*abst` is not particularly well-behaved. The β reduction-esque rule we derive also does not behave *completely* like β reduction. See Jonh Longley's PhD thesis "Realizability Toposes and Language Semantics" Theorem 1.1.9.
+
+**Remark** : We declare the definition as `opaque` - this is important. If we let Agda unfold this definition all the way we ocassionally end up with unreadable goals containing a mess of `s` and `k`. 
+
+We define meta-syntactic sugar for some of the more common cases :
+
+```agda
+    λ* : Term one  A
+    λ* t =  λ*abst t  []
+
+    λ*2 : Term two  A
+    λ*2 t =  λ*abst (λ*abst t)  []
+
+    λ*3 : Term three  A
+    λ*3 t =  λ*abst (λ*abst (λ*abst t))  []
+
+    λ*4 : Term four  A
+    λ*4 t =  λ*abst (λ*abst (λ*abst (λ*abst t)))  []
+```
+
+We now show that we have a β-reduction-esque operation. We proceed by induction on the structure of the term and the number of free variables.
+
+For the particular combinatory algebra Λ/β (terms of the untyped λ calculus quotiented by β equality) - this β reduction actually coincides with the "actual" β reduction.
+TODO : Prove this.
+
+```agda
+    opaque
+      unfolding λ*abst
+      βreduction :  {n}  (body : Term (suc n))  (prim : A)  (subs : Vec A n)   λ*abst body ̇ ` prim  subs   body  (prim  subs)
+      βreduction {n} (# zero) prim subs =
+        s  k  k  prim
+          ≡⟨ sabc≡ac_bc _ _ _ 
+        k  prim  (k  prim)
+          ≡⟨ kab≡a _ _ 
+        prim
+          
+      βreduction {n} (# (suc x)) prim subs = kab≡a _ _
+      βreduction {n} (` x) prim subs = kab≡a _ _
+      βreduction {n} (rator ̇ rand) prim subs =
+        s   λ*abst rator  subs   λ*abst rand  subs  prim
+          ≡⟨ sabc≡ac_bc _ _ _ 
+         λ*abst rator  subs  prim  ( λ*abst rand  subs  prim)
+          ≡⟨ cong₂  x y  x  y) (βreduction rator prim subs) (βreduction rand prim subs) 
+         rator  (prim  subs)   rand  (prim  subs)
+          
+```
+
+<details>
+```agda
+    λ*chainTerm :  n  Term n  Term zero
+    λ*chainTerm zero t = t
+    λ*chainTerm (suc n) t = λ*chainTerm n (λ*abst t)
+
+    λ*chain :  {n}  Term n  A
+    λ*chain {n} t =  λ*chainTerm n t  []
+```
+</details>
+
+We provide useful reasoning combinators that are useful and frequent.
+
+```agda
+    opaque
+      unfolding reverse
+      unfolding foldl
+      unfolding chain
+
+      λ*ComputationRule :  (t : Term 1) (a : A)  λ* t  a   t  (a  [])
+      λ*ComputationRule t a =
+         λ*abst t  []  a
+          ≡⟨ βreduction t a [] 
+         t  (a  [])
+          
+
+      λ*2ComputationRule :  (t : Term 2) (a b : A)  λ*2 t  a  b   t  (b  a  [])
+      λ*2ComputationRule t a b =
+         λ*abst (λ*abst t)  []  a  b
+          ≡⟨ refl 
+         λ*abst (λ*abst t)  []   ` a  []   ` b  []
+          ≡⟨ refl 
+         λ*abst (λ*abst t) ̇ ` a  []   ` b  []
+          ≡⟨ cong  x  x  b) (βreduction (λ*abst t) a []) 
+         λ*abst t  (a  [])  b
+          ≡⟨ βreduction t b (a  []) 
+         t  (b  a  [])
+          
           
-      λ*3ComputationRule :  (t : Term 3) (a b c : A)  λ*3 t  a  b  c   t  (c  b  a  [])
-      λ*3ComputationRule t a b c =
-         λ*abst (λ*abst (λ*abst t))  []   ` a  []   ` b  []   ` c  []
-          ≡⟨ cong  x  x  b  c) (βreduction (λ*abst (λ*abst t)) a []) 
-         λ*abst (λ*abst t)  (a  [])   ` b  (a  [])   ` c  (a  [])
-          ≡⟨ cong  x  x  c) (βreduction (λ*abst t) b (a  [])) 
-         λ*abst t  (b  a  [])   ` c  (b  a  [])
-          ≡⟨ βreduction t c (b  a  []) 
-         t  (c  b  a  [])
-          
-
-      λ*4ComputationRule :  (t : Term 4) (a b c d : A)  λ*4 t  a  b  c  d   t  (d  c  b  a  [])
-      λ*4ComputationRule t a b c d =
-         λ*abst (λ*abst (λ*abst (λ*abst t)))  []   ` a  []   ` b  []   ` c  []   ` d  []
-          ≡⟨ cong  x  x  b  c  d) (βreduction (λ*abst (λ*abst (λ*abst t))) a []) 
-         λ*abst (λ*abst (λ*abst t))  (a  [])   ` b  (a  [])   ` c  (a  [])   ` d  (a  [])
-          ≡⟨ cong  x  x  c  d) (βreduction (λ*abst (λ*abst t)) b (a  [])) 
-         λ*abst (λ*abst t)  (b  a  [])   ` c  (b  a  [])   ` d  (b  a  [])
-          ≡⟨ cong  x  x  d) (βreduction (λ*abst t) c (b  a  [])) 
-         λ*abst t  (c  b  a  [])   ` d  (c  b  a  [])
-          ≡⟨ βreduction t d (c  b  a  []) 
-         t  (d  c  b  a  [])
-          
-
\ No newline at end of file + λ*3ComputationRule : (t : Term 3) (a b c : A) λ*3 t a b c t (c b a []) + λ*3ComputationRule t a b c = + λ*abst (λ*abst (λ*abst t)) [] ` a [] ` b [] ` c [] + ≡⟨ cong x x b c) (βreduction (λ*abst (λ*abst t)) a []) + λ*abst (λ*abst t) (a []) ` b (a []) ` c (a []) + ≡⟨ cong x x c) (βreduction (λ*abst t) b (a [])) + λ*abst t (b a []) ` c (b a []) + ≡⟨ βreduction t c (b a []) + t (c b a []) + + + λ*4ComputationRule : (t : Term 4) (a b c d : A) λ*4 t a b c d t (d c b a []) + λ*4ComputationRule t a b c d = + λ*abst (λ*abst (λ*abst (λ*abst t))) [] ` a [] ` b [] ` c [] ` d [] + ≡⟨ cong x x b c d) (βreduction (λ*abst (λ*abst (λ*abst t))) a []) + λ*abst (λ*abst (λ*abst t)) (a []) ` b (a []) ` c (a []) ` d (a []) + ≡⟨ cong x x c d) (βreduction (λ*abst (λ*abst t)) b (a [])) + λ*abst (λ*abst t) (b a []) ` c (b a []) ` d (b a []) + ≡⟨ cong x x d) (βreduction (λ*abst t) c (b a [])) + λ*abst t (c b a []) ` d (c b a []) + ≡⟨ βreduction t d (c b a []) + t (d c b a []) + +``` +
\ No newline at end of file diff --git a/docs/Realizability.Assembly.Base.html b/docs/Realizability.Assembly.Base.html index 79b7f6d..92ea81c 100644 --- a/docs/Realizability.Assembly.Base.html +++ b/docs/Realizability.Assembly.Base.html @@ -3,42 +3,70 @@ open import Cubical.Foundations.Prelude open import Cubical.Foundations.HLevels open import Cubical.Foundations.Structure -open import Cubical.Data.Sigma -open import Cubical.HITs.PropositionalTruncation -open import Cubical.Reflection.RecordEquiv -open import Realizability.CombinatoryAlgebra +open import Cubical.Foundations.Equiv +open import Cubical.Foundations.Univalence +open import Cubical.Foundations.Isomorphism +open import Cubical.Functions.FunExtEquiv +open import Cubical.Data.Sigma +open import Cubical.HITs.PropositionalTruncation +open import Cubical.Reflection.RecordEquiv +open import Realizability.CombinatoryAlgebra -module Realizability.Assembly.Base {} {A : Type } (ca : CombinatoryAlgebra A) where - record Assembly (X : Type ) : Type (ℓ-suc ) where - infix 25 _⊩_ - field - isSetX : isSet X - _⊩_ : A X Type - ⊩isPropValued : a x isProp (a x) - ⊩surjective : x ∃[ a A ] a x +module Realizability.Assembly.Base {} {A : Type } (ca : CombinatoryAlgebra A) where + record Assembly (X : Type ) : Type (ℓ-suc ) where + constructor makeAssembly + infix 25 _⊩_ + field + _⊩_ : A X Type + isSetX : isSet X + ⊩isPropValued : a x isProp (a x) + ⊩surjective : x ∃[ a A ] a x + open Assembly public + _⊩[_]_ : {X : Type } A Assembly X X Type + a ⊩[ A ] x = A ._⊩_ a x - AssemblyΣ : Type Type _ - AssemblyΣ X = - Σ[ isSetX isSet X ] - Σ[ _⊩_ (A X hProp ) ] - (∀ x ∃[ a A ] a x ) + AssemblyΣ : Type Type _ + AssemblyΣ X = + Σ[ _⊩_ (A X hProp ) ] + (∀ x ∃[ a A ] a x ) × + (isSet X) - AssemblyΣX→isSetX : X AssemblyΣ X isSet X - AssemblyΣX→isSetX X (isSetX , _ , _) = isSetX - - AssemblyΣX→⊩ : X AssemblyΣ X (A X hProp ) - AssemblyΣX→⊩ X (_ , , _) = - - AssemblyΣX→⊩surjective : X (asm : AssemblyΣ X) (∀ x ∃[ a A ] AssemblyΣX→⊩ X asm a x ) - AssemblyΣX→⊩surjective X (_ , _ , ⊩surjective) = ⊩surjective - - isSetAssemblyΣ : X isSet (AssemblyΣ X) - isSetAssemblyΣ X = isSetΣ (isProp→isSet isPropIsSet) λ isSetX isSetΣ (isSetΠ a isSetΠ λ x isSetHProp)) λ _⊩_ isSetΠ λ x isProp→isSet isPropPropTrunc + isSetAssemblyΣ : X isSet (AssemblyΣ X) + isSetAssemblyΣ X = isSetΣ (isSetΠ2 λ _ _ isSetHProp) rel isSet× (isSetΠ λ x isProp→isSet isPropPropTrunc) (isProp→isSet isPropIsSet)) - unquoteDecl AssemblyIsoΣ = declareRecordIsoΣ AssemblyIsoΣ (quote Assembly) + AssemblyΣ≡Equiv : X (a b : AssemblyΣ X) (a b) (∀ r x a .fst r x b .fst r x ) + AssemblyΣ≡Equiv X a b = + a b + ≃⟨ invEquiv (Σ≡PropEquiv rel isProp× (isPropΠ λ x isPropPropTrunc) isPropIsSet) {u = a} {v = b}) + a .fst b .fst + ≃⟨ invEquiv (funExt₂Equiv {f = a .fst} {g = b .fst}) + (∀ (r : A) (x : X) a .fst r x b .fst r x) + ≃⟨ + equivΠCod + r + equivΠCod + λ x + compEquiv + (invEquiv (Σ≡PropEquiv _ isPropIsProp) {u = a .fst r x} {v = b .fst r x})) + (univalence {A = a .fst r x .fst} {B = b .fst r x .fst})) + + (∀ (r : A) (x : X) a .fst r x b .fst r x ) + - open Assembly public + -- definitional isomorphism + AssemblyΣIsoAssembly : X Iso (AssemblyΣ X) (Assembly X) + _⊩_ (Iso.fun (AssemblyΣIsoAssembly X) (rel , surj , isSetX)) a x = rel a x + Assembly.isSetX (Iso.fun (AssemblyΣIsoAssembly X) (rel , surj , isSetX)) = isSetX + ⊩isPropValued (Iso.fun (AssemblyΣIsoAssembly X) (rel , surj , isSetX)) a x = str (rel a x) + ⊩surjective (Iso.fun (AssemblyΣIsoAssembly X) (rel , surj , isSetX)) x = surj x + Iso.inv (AssemblyΣIsoAssembly X) asm = a x (a ⊩[ asm ] x) , (asm .⊩isPropValued a x)) , x asm .⊩surjective x) , asm .isSetX + Iso.rightInv (AssemblyΣIsoAssembly X) asm = refl + Iso.leftInv (AssemblyΣIsoAssembly X) (rel , surj , isSetX) = refl - + AssemblyΣ≃Assembly : X AssemblyΣ X Assembly X + AssemblyΣ≃Assembly X = isoToEquiv (AssemblyΣIsoAssembly X) + + isSetAssembly : X isSet (Assembly X) + isSetAssembly X = isOfHLevelRespectEquiv 2 (AssemblyΣ≃Assembly X) (isSetAssemblyΣ X) \ No newline at end of file diff --git a/docs/Realizability.Assembly.BinCoproducts.html b/docs/Realizability.Assembly.BinCoproducts.html index 2dc0932..b6dc069 100644 --- a/docs/Realizability.Assembly.BinCoproducts.html +++ b/docs/Realizability.Assembly.BinCoproducts.html @@ -4,197 +4,196 @@ open import Cubical.Foundations.HLevels open import Cubical.Data.Sum hiding (map) open import Cubical.Data.Sigma -open import Cubical.Data.Fin -open import Cubical.Data.Nat -open import Cubical.Data.Vec hiding (map) -open import Cubical.HITs.PropositionalTruncation hiding (map) -open import Cubical.HITs.PropositionalTruncation.Monad -open import Cubical.Categories.Category -open import Cubical.Categories.Limits.BinCoproduct -open import Realizability.CombinatoryAlgebra -open import Realizability.ApplicativeStructure renaming (λ*-chain to `λ*; λ*-naturality to `λ*ComputationRule) hiding (λ*) +open import Cubical.Data.FinData +open import Cubical.Data.Nat +open import Cubical.Data.Vec hiding (map) +open import Cubical.HITs.PropositionalTruncation hiding (map) +open import Cubical.HITs.PropositionalTruncation.Monad +open import Cubical.Categories.Category +open import Cubical.Categories.Limits.BinCoproduct +open import Realizability.CombinatoryAlgebra +open import Realizability.ApplicativeStructure -module Realizability.Assembly.BinCoproducts {} {A : Type } (ca : CombinatoryAlgebra A) where +module Realizability.Assembly.BinCoproducts {} {A : Type } (ca : CombinatoryAlgebra A) where -open CombinatoryAlgebra ca -open import Realizability.Assembly.Base ca -open Realizability.CombinatoryAlgebra.Combinators ca renaming (i to Id; ia≡a to Ida≡a) -open import Realizability.Assembly.Morphism ca +open CombinatoryAlgebra ca +open import Realizability.Assembly.Base ca +open Realizability.CombinatoryAlgebra.Combinators ca renaming (i to Id; ia≡a to Ida≡a) +open import Realizability.Assembly.Morphism ca -λ* = `λ* as fefermanStructure -λ*ComputationRule = `λ*ComputationRule as fefermanStructure - -infixl 23 _⊕_ -_⊕_ : {A B : Type } Assembly A Assembly B Assembly (A B) -(as bs) .isSetX = isSet⊎ (as .isSetX) (bs .isSetX) -(as bs) ._⊩_ r (inl a) = ∃[ aᵣ A ] (as ._⊩_ aᵣ a) × (r pair true aᵣ) -(as bs) ._⊩_ r (inr b) = ∃[ bᵣ A ] (bs ._⊩_ bᵣ b) × (r pair false bᵣ) -(as bs) .⊩isPropValued r (inl a) = squash₁ -(as bs) .⊩isPropValued r (inr b) = squash₁ -(as bs) .⊩surjective (inl a) = - do - (a~ , a~realizes) as .⊩surjective a - return ( pair true a~ - , a~ - , a~realizes - , refl ∣₁ - ) -(as bs) .⊩surjective (inr b) = - do - (b~ , b~realizes) bs .⊩surjective b - return ( pair false b~ - , b~ - , b~realizes - , refl ∣₁ - ) +infixl 23 _⊕_ +_⊕_ : {A B : Type } Assembly A Assembly B Assembly (A B) +(as bs) .isSetX = isSet⊎ (as .isSetX) (bs .isSetX) +(as bs) ._⊩_ r (inl a) = ∃[ aᵣ A ] (as ._⊩_ aᵣ a) × (r pair true aᵣ) +(as bs) ._⊩_ r (inr b) = ∃[ bᵣ A ] (bs ._⊩_ bᵣ b) × (r pair false bᵣ) +(as bs) .⊩isPropValued r (inl a) = squash₁ +(as bs) .⊩isPropValued r (inr b) = squash₁ +(as bs) .⊩surjective (inl a) = + do + (a~ , a~realizes) as .⊩surjective a + return ( pair true a~ + , a~ + , a~realizes + , refl ∣₁ + ) +(as bs) .⊩surjective (inr b) = + do + (b~ , b~realizes) bs .⊩surjective b + return ( pair false b~ + , b~ + , b~realizes + , refl ∣₁ + ) -κ₁ : {A B : Type } {as : Assembly A} {bs : Assembly B} AssemblyMorphism as (as bs) -κ₁ .map = inl -κ₁ .tracker = pair true , x aₓ aₓ⊩x aₓ , aₓ⊩x , refl ∣₁) ∣₁ +κ₁ : {A B : Type } {as : Assembly A} {bs : Assembly B} AssemblyMorphism as (as bs) +κ₁ .map = inl +κ₁ .tracker = pair true , x aₓ aₓ⊩x aₓ , aₓ⊩x , refl ∣₁) ∣₁ -κ₂ : {A B : Type } {as : Assembly A} {bs : Assembly B} AssemblyMorphism bs (as bs) -κ₂ .map b = inr b -κ₂ .tracker = pair false , x bₓ bₓ⊩x bₓ , bₓ⊩x , refl ∣₁) ∣₁ +κ₂ : {A B : Type } {as : Assembly A} {bs : Assembly B} AssemblyMorphism bs (as bs) +κ₂ .map b = inr b +κ₂ .tracker = pair false , x bₓ bₓ⊩x bₓ , bₓ⊩x , refl ∣₁) ∣₁ -{-# TERMINATING #-} -[_,_] : {X Y Z : Type } {asmX : Assembly X} {asmY : Assembly Y} {asmZ : Assembly Z} (f : AssemblyMorphism asmX asmZ) (g : AssemblyMorphism asmY asmZ) AssemblyMorphism (asmX asmY) asmZ -[ f , g ] .map (inl x) = f .map x -[ f , g ] .map (inr y) = g .map y -[_,_] {asmZ = asmZ} f g .tracker = - do - (f~ , f~tracks) f .tracker - (g~ , g~tracks) g .tracker - -- if (pr₁ r) then f (pr₂ r) else g (pr₂ r) - let - tracker : Term as (suc zero) - tracker = ` Id ̇ (` pr₁ ̇ (# fzero)) ̇ (` f~ ̇ (` pr₂ ̇ (# fzero))) ̇ (` g~ ̇ (` pr₂ ̇ (# fzero))) - return - (λ* tracker , - λ { (inl x) r r⊩inl - transport - (propTruncIdempotent (asmZ .⊩isPropValued _ _)) - (do - (rₓ , rₓ⊩x , r≡pair⨾true⨾rₓ) r⊩inl - return - (subst - r asmZ ._⊩_ r ([ f , g ] .map (inl x))) - (sym - (λ* tracker r - ≡⟨ λ*ComputationRule tracker (r []) - Id (pr₁ r) (f~ (pr₂ r)) (g~ (pr₂ r)) - ≡⟨ cong r Id (pr₁ r) (f~ (pr₂ r)) (g~ (pr₂ r))) r≡pair⨾true⨾rₓ - Id (pr₁ (pair true rₓ)) (f~ (pr₂ (pair true rₓ))) (g~ (pr₂ (pair true rₓ))) - ≡⟨ cong x Id x (f~ (pr₂ (pair true rₓ))) (g~ (pr₂ (pair true rₓ)))) (pr₁pxy≡x _ _) - Id true (f~ (pr₂ (pair true rₓ))) (g~ (pr₂ (pair true rₓ))) - ≡⟨ ifTrueThen _ _ - f~ (pr₂ (pair true rₓ)) - ≡⟨ cong x f~ x) (pr₂pxy≡y _ _) - f~ rₓ - )) - (f~tracks x rₓ rₓ⊩x))) - ; (inr y) r r⊩inr - transport - (propTruncIdempotent (asmZ .⊩isPropValued _ _)) - (do - (yᵣ , yᵣ⊩y , r≡pair⨾false⨾yᵣ) r⊩inr - return - (subst - r asmZ ._⊩_ r ([ f , g ] .map (inr y))) - (sym - ((λ* tracker r - ≡⟨ λ*ComputationRule tracker (r []) - Id (pr₁ r) (f~ (pr₂ r)) (g~ (pr₂ r)) - ≡⟨ cong r Id (pr₁ r) (f~ (pr₂ r)) (g~ (pr₂ r))) r≡pair⨾false⨾yᵣ - Id (pr₁ (pair false yᵣ)) (f~ (pr₂ (pair false yᵣ))) (g~ (pr₂ (pair false yᵣ))) - ≡⟨ cong x Id x (f~ (pr₂ (pair false yᵣ))) (g~ (pr₂ (pair false yᵣ)))) (pr₁pxy≡x _ _) - Id false (f~ (pr₂ (pair false yᵣ))) (g~ (pr₂ (pair false yᵣ))) - ≡⟨ ifFalseElse _ _ - g~ (pr₂ (pair false yᵣ)) - ≡⟨ cong x g~ x) (pr₂pxy≡y _ _) - g~ yᵣ - ))) - (g~tracks y yᵣ yᵣ⊩y))) }) +{-# TERMINATING #-} +[_,_] : {X Y Z : Type } {asmX : Assembly X} {asmY : Assembly Y} {asmZ : Assembly Z} (f : AssemblyMorphism asmX asmZ) (g : AssemblyMorphism asmY asmZ) AssemblyMorphism (asmX asmY) asmZ +[ f , g ] .map (inl x) = f .map x +[ f , g ] .map (inr y) = g .map y +[_,_] {asmZ = asmZ} f g .tracker = + do + -- these are not considered structurally smaller since these are in the propositional truncation + (f~ , f~tracks) f .tracker + (g~ , g~tracks) g .tracker + -- if (pr₁ r) then f (pr₂ r) else g (pr₂ r) + let + tracker : Term as (suc zero) + tracker = ` Id ̇ (` pr₁ ̇ (# zero)) ̇ (` f~ ̇ (` pr₂ ̇ (# zero))) ̇ (` g~ ̇ (` pr₂ ̇ (# zero))) + return + (λ* tracker , + λ { (inl x) r r⊩inl + transport + (propTruncIdempotent (asmZ .⊩isPropValued _ _)) + (do + (rₓ , rₓ⊩x , r≡pair⨾true⨾rₓ) r⊩inl + return + (subst + r asmZ ._⊩_ r ([ f , g ] .map (inl x))) + (sym + (λ* tracker r + ≡⟨ λ*ComputationRule tracker r + Id (pr₁ r) (f~ (pr₂ r)) (g~ (pr₂ r)) + ≡⟨ cong r Id (pr₁ r) (f~ (pr₂ r)) (g~ (pr₂ r))) r≡pair⨾true⨾rₓ + Id (pr₁ (pair true rₓ)) (f~ (pr₂ (pair true rₓ))) (g~ (pr₂ (pair true rₓ))) + ≡⟨ cong x Id x (f~ (pr₂ (pair true rₓ))) (g~ (pr₂ (pair true rₓ)))) (pr₁pxy≡x _ _) + Id true (f~ (pr₂ (pair true rₓ))) (g~ (pr₂ (pair true rₓ))) + ≡⟨ ifTrueThen _ _ + f~ (pr₂ (pair true rₓ)) + ≡⟨ cong x f~ x) (pr₂pxy≡y _ _) + f~ rₓ + )) + (f~tracks x rₓ rₓ⊩x))) + ; (inr y) r r⊩inr + transport + (propTruncIdempotent (asmZ .⊩isPropValued _ _)) + (do + (yᵣ , yᵣ⊩y , r≡pair⨾false⨾yᵣ) r⊩inr + return + (subst + r asmZ ._⊩_ r ([ f , g ] .map (inr y))) + (sym + ((λ* tracker r + ≡⟨ λ*ComputationRule tracker r + Id (pr₁ r) (f~ (pr₂ r)) (g~ (pr₂ r)) + ≡⟨ cong r Id (pr₁ r) (f~ (pr₂ r)) (g~ (pr₂ r))) r≡pair⨾false⨾yᵣ + Id (pr₁ (pair false yᵣ)) (f~ (pr₂ (pair false yᵣ))) (g~ (pr₂ (pair false yᵣ))) + ≡⟨ cong x Id x (f~ (pr₂ (pair false yᵣ))) (g~ (pr₂ (pair false yᵣ)))) (pr₁pxy≡x _ _) + Id false (f~ (pr₂ (pair false yᵣ))) (g~ (pr₂ (pair false yᵣ))) + ≡⟨ ifFalseElse _ _ + g~ (pr₂ (pair false yᵣ)) + ≡⟨ cong x g~ x) (pr₂pxy≡y _ _) + g~ yᵣ + ))) + (g~tracks y yᵣ yᵣ⊩y))) }) -open BinCoproduct -BinCoproductsASM : BinCoproducts ASM -BinCoproductsASM (X , asmX) (Y , asmY) .binCoprodOb = X Y , asmX asmY -BinCoproductsASM (X , asmX) (Y , asmY) .binCoprodInj₁ = κ₁ -BinCoproductsASM (X , asmX) (Y , asmY) .binCoprodInj₂ = κ₂ -BinCoproductsASM (X , asmX) (Y , asmY) .univProp {Z , asmZ} f g = - uniqueExists - [ f , g ] - ((AssemblyMorphism≡ _ _ (funExt x refl))) , (AssemblyMorphism≡ _ _ (funExt y refl)))) - ! isProp× (isSetAssemblyMorphism _ _ _ _) (isSetAssemblyMorphism _ _ _ _)) - λ ! (κ₁⊚!≡f , κ₂⊚!≡g) AssemblyMorphism≡ _ _ (funExt λ { (inl x) i κ₁⊚!≡f (~ i) .map x ; (inr y) i κ₂⊚!≡g (~ i) .map y }) +open BinCoproduct +BinCoproductsASM : BinCoproducts ASM +BinCoproductsASM (X , asmX) (Y , asmY) .binCoprodOb = X Y , asmX asmY +BinCoproductsASM (X , asmX) (Y , asmY) .binCoprodInj₁ = κ₁ +BinCoproductsASM (X , asmX) (Y , asmY) .binCoprodInj₂ = κ₂ +BinCoproductsASM (X , asmX) (Y , asmY) .univProp {Z , asmZ} f g = + uniqueExists + [ f , g ] + ((AssemblyMorphism≡ _ _ (funExt x refl))) , (AssemblyMorphism≡ _ _ (funExt y refl)))) + ! isProp× (isSetAssemblyMorphism _ _ _ _) (isSetAssemblyMorphism _ _ _ _)) + λ ! (κ₁⊚!≡f , κ₂⊚!≡g) AssemblyMorphism≡ _ _ (funExt λ { (inl x) i κ₁⊚!≡f (~ i) .map x ; (inr y) i κ₂⊚!≡g (~ i) .map y }) -module _ - {X Y : Type } - (asmX : Assembly X) - (asmY : Assembly Y) - where +-- I have no idea why I did these since this can be derived from the universal property of the coproduct anyway? +module _ + {X Y : Type } + (asmX : Assembly X) + (asmY : Assembly Y) + where - asmX+Y = asmX asmY - asmY+X = asmY asmX + asmX+Y = asmX asmY + asmY+X = asmY asmX - X+Y→Y+X : AssemblyMorphism asmX+Y asmY+X - X+Y→Y+X .map (inl x) = inr x - X+Y→Y+X .map (inr y) = inl y - X+Y→Y+X .tracker = - do - let - tracker : Term as 1 - tracker = ` Id ̇ (` pr₁ ̇ # fzero) ̇ (` pair ̇ ` false ̇ (` pr₂ ̇ # fzero)) ̇ (` pair ̇ ` true ̇ (` pr₂ ̇ # fzero)) - return - ((λ* tracker) , - { (inl x) r r⊩inl - transport - (propTruncIdempotent (asmY+X .⊩isPropValued (λ* tracker r) (inr x))) - (do - (rₓ , rₓ⊩x , r≡pair⨾true⨾rₓ) r⊩inl - let - λ*trackerEq : λ* tracker r pair false rₓ - λ*trackerEq = - λ* tracker r - ≡⟨ λ*ComputationRule tracker (r []) - Id (pr₁ r) (pair false (pr₂ r)) (pair true (pr₂ r)) - ≡⟨ cong r Id (pr₁ r) (pair false (pr₂ r)) (pair true (pr₂ r))) r≡pair⨾true⨾rₓ - Id (pr₁ (pair true rₓ)) (pair false (pr₂ (pair true rₓ))) (pair true (pr₂ (pair true rₓ))) - ≡⟨ cong r Id r (pair false (pr₂ (pair true rₓ))) (pair true (pr₂ (pair true rₓ)))) (pr₁pxy≡x _ _) - Id true (pair false (pr₂ (pair true rₓ))) (pair true (pr₂ (pair true rₓ))) - ≡⟨ ifTrueThen _ _ - pair false (pr₂ (pair true rₓ)) - ≡⟨ cong r pair false r) (pr₂pxy≡y _ _) - pair false rₓ - - return (return (rₓ , subst _ (sym λ*trackerEq) rₓ⊩x , λ*trackerEq))) - ; (inr y) r r⊩inr - transport - (propTruncIdempotent (asmY+X .⊩isPropValued (λ* tracker r) (inl y))) - (do - (yᵣ , yᵣ⊩y , r≡pair⨾false⨾yᵣ) r⊩inr - let - λ*trackerEq : λ* tracker r pair true yᵣ - λ*trackerEq = - λ* tracker r - ≡⟨ λ*ComputationRule tracker (r []) - Id (pr₁ r) (pair false (pr₂ r)) (pair true (pr₂ r)) - ≡⟨ cong r Id (pr₁ r) (pair false (pr₂ r)) (pair true (pr₂ r))) r≡pair⨾false⨾yᵣ - Id (pr₁ (pair false yᵣ)) (pair false (pr₂ (pair false yᵣ))) (pair true (pr₂ (pair false yᵣ))) - ≡⟨ cong r Id r (pair false (pr₂ (pair false yᵣ))) (pair true (pr₂ (pair false yᵣ)))) (pr₁pxy≡x _ _) - Id false (pair false (pr₂ (pair false yᵣ))) (pair true (pr₂ (pair false yᵣ))) - ≡⟨ ifFalseElse _ _ - pair true (pr₂ (pair false yᵣ)) - ≡⟨ cong r pair true r) (pr₂pxy≡y _ _) - pair true yᵣ - - return (return (yᵣ , subst _ (sym λ*trackerEq) yᵣ⊩y , λ*trackerEq))) })) + X+Y→Y+X : AssemblyMorphism asmX+Y asmY+X + X+Y→Y+X .map (inl x) = inr x + X+Y→Y+X .map (inr y) = inl y + X+Y→Y+X .tracker = + do + let + tracker : Term as 1 + tracker = ` Id ̇ (` pr₁ ̇ # zero) ̇ (` pair ̇ ` false ̇ (` pr₂ ̇ # zero)) ̇ (` pair ̇ ` true ̇ (` pr₂ ̇ # zero)) + return + ((λ* tracker) , + { (inl x) r r⊩inl + transport + (propTruncIdempotent (asmY+X .⊩isPropValued (λ* tracker r) (inr x))) + (do + (rₓ , rₓ⊩x , r≡pair⨾true⨾rₓ) r⊩inl + let + λ*trackerEq : λ* tracker r pair false rₓ + λ*trackerEq = + λ* tracker r + ≡⟨ λ*ComputationRule tracker r + Id (pr₁ r) (pair false (pr₂ r)) (pair true (pr₂ r)) + ≡⟨ cong r Id (pr₁ r) (pair false (pr₂ r)) (pair true (pr₂ r))) r≡pair⨾true⨾rₓ + Id (pr₁ (pair true rₓ)) (pair false (pr₂ (pair true rₓ))) (pair true (pr₂ (pair true rₓ))) + ≡⟨ cong r Id r (pair false (pr₂ (pair true rₓ))) (pair true (pr₂ (pair true rₓ)))) (pr₁pxy≡x _ _) + Id true (pair false (pr₂ (pair true rₓ))) (pair true (pr₂ (pair true rₓ))) + ≡⟨ ifTrueThen _ _ + pair false (pr₂ (pair true rₓ)) + ≡⟨ cong r pair false r) (pr₂pxy≡y _ _) + pair false rₓ + + return (return (rₓ , subst _ (sym λ*trackerEq) rₓ⊩x , λ*trackerEq))) + ; (inr y) r r⊩inr + transport + (propTruncIdempotent (asmY+X .⊩isPropValued (λ* tracker r) (inl y))) + (do + (yᵣ , yᵣ⊩y , r≡pair⨾false⨾yᵣ) r⊩inr + let + λ*trackerEq : λ* tracker r pair true yᵣ + λ*trackerEq = + λ* tracker r + ≡⟨ λ*ComputationRule tracker r + Id (pr₁ r) (pair false (pr₂ r)) (pair true (pr₂ r)) + ≡⟨ cong r Id (pr₁ r) (pair false (pr₂ r)) (pair true (pr₂ r))) r≡pair⨾false⨾yᵣ + Id (pr₁ (pair false yᵣ)) (pair false (pr₂ (pair false yᵣ))) (pair true (pr₂ (pair false yᵣ))) + ≡⟨ cong r Id r (pair false (pr₂ (pair false yᵣ))) (pair true (pr₂ (pair false yᵣ)))) (pr₁pxy≡x _ _) + Id false (pair false (pr₂ (pair false yᵣ))) (pair true (pr₂ (pair false yᵣ))) + ≡⟨ ifFalseElse _ _ + pair true (pr₂ (pair false yᵣ)) + ≡⟨ cong r pair true r) (pr₂pxy≡y _ _) + pair true yᵣ + + return (return (yᵣ , subst _ (sym λ*trackerEq) yᵣ⊩y , λ*trackerEq))) })) -CatIsoX+Y-Y+X : {X Y : Type } (asmX : Assembly X) (asmY : Assembly Y) CatIso ASM (X Y , asmX asmY) (Y X , asmY asmX) -CatIsoX+Y-Y+X asmX asmY = - (X+Y→Y+X asmX asmY) , - (isiso - (X+Y→Y+X asmY asmX) - (AssemblyMorphism≡ _ _ (funExt { (inl y) refl ; (inr x) refl }))) - (AssemblyMorphism≡ _ _ (funExt { (inl x) refl ; (inr y) refl })))) +CatIsoX+Y-Y+X : {X Y : Type } (asmX : Assembly X) (asmY : Assembly Y) CatIso ASM (X Y , asmX asmY) (Y X , asmY asmX) +CatIsoX+Y-Y+X asmX asmY = + (X+Y→Y+X asmX asmY) , + (isiso + (X+Y→Y+X asmY asmX) + (AssemblyMorphism≡ _ _ (funExt { (inl y) refl ; (inr x) refl }))) + (AssemblyMorphism≡ _ _ (funExt { (inl x) refl ; (inr y) refl })))) \ No newline at end of file diff --git a/docs/Realizability.Assembly.BinProducts.html b/docs/Realizability.Assembly.BinProducts.html index 3f768ee..9626ba2 100644 --- a/docs/Realizability.Assembly.BinProducts.html +++ b/docs/Realizability.Assembly.BinProducts.html @@ -1,201 +1,126 @@ -Realizability.Assembly.BinProducts
{-# OPTIONS --cubical --allow-unsolved-metas #-}
-open import Cubical.Foundations.Prelude
-open import Cubical.Foundations.HLevels
-open import Cubical.Data.Sigma
-open import Cubical.HITs.PropositionalTruncation hiding (map)
-open import Cubical.HITs.PropositionalTruncation.Monad
-open import Cubical.Categories.Limits.BinProduct
-open import Realizability.CombinatoryAlgebra
+Realizability.Assembly.BinProducts
{-# OPTIONS --cubical #-}
+open import Cubical.Foundations.Prelude
+open import Cubical.Foundations.HLevels
+open import Cubical.Data.Sigma
+open import Cubical.Data.FinData
+open import Cubical.HITs.PropositionalTruncation hiding (map)
+open import Cubical.HITs.PropositionalTruncation.Monad
+open import Cubical.Categories.Limits.BinProduct
+open import Realizability.CombinatoryAlgebra
+open import Realizability.ApplicativeStructure
 
-module Realizability.Assembly.BinProducts {} {A : Type } (ca : CombinatoryAlgebra A) where
+module Realizability.Assembly.BinProducts {} {A : Type } (ca : CombinatoryAlgebra A) where
 
-open Realizability.CombinatoryAlgebra.Combinators ca renaming (i to Id; ia≡a to Ida≡a)
-open import Realizability.Assembly.Base ca
-open import Realizability.Assembly.Morphism ca
-open CombinatoryAlgebra ca
-open Assembly
-open AssemblyMorphism
+open Realizability.CombinatoryAlgebra.Combinators ca renaming (i to Id; ia≡a to Ida≡a)
+open import Realizability.Assembly.Base ca
+open import Realizability.Assembly.Morphism ca
+open CombinatoryAlgebra ca
+open Assembly
+open AssemblyMorphism
 
-infixl 23 _⊗_
-_⊗_ : {A B : Type }  Assembly A  Assembly B  Assembly (A × B)
-(as  bs) .isSetX = isSetΣ (as .isSetX)  _  bs .isSetX)
-(as  bs) ._⊩_ r (a , b) = (as ._⊩_ (pr₁  r) a) × (bs ._⊩_ (pr₂  r) b)
-(as  bs) .⊩isPropValued r (a , b) = isPropΣ (as .⊩isPropValued (pr₁  r) a)
-                                              _  bs .⊩isPropValued (pr₂  r) b)
-(as  bs) .⊩surjective (a , b) = do
-                                   (b~ , b~realizes)  bs .⊩surjective b
-                                   (a~ , a~realizes)  as .⊩surjective a
-                                   return
-                                     ( pair  a~  b~
-                                     , subst  x  as ._⊩_ x a) (sym (pr₁pxy≡x a~ b~)) a~realizes
-                                     , subst  x  bs ._⊩_ x b) (sym (pr₂pxy≡y a~ b~)) b~realizes
-                                     )
+infixl 23 _⊗_
+_⊗_ : {A B : Type }  Assembly A  Assembly B  Assembly (A × B)
+(as  bs) .isSetX = isSetΣ (as .isSetX)  _  bs .isSetX)
+(as  bs) ._⊩_ r (a , b) = (as ._⊩_ (pr₁  r) a) × (bs ._⊩_ (pr₂  r) b)
+(as  bs) .⊩isPropValued r (a , b) = isPropΣ (as .⊩isPropValued (pr₁  r) a)
+                                              _  bs .⊩isPropValued (pr₂  r) b)
+(as  bs) .⊩surjective (a , b) = do
+                                   (b~ , b~realizes)  bs .⊩surjective b
+                                   (a~ , a~realizes)  as .⊩surjective a
+                                   return
+                                     ( pair  a~  b~
+                                     , subst  x  as ._⊩_ x a) (sym (pr₁pxy≡x a~ b~)) a~realizes
+                                     , subst  x  bs ._⊩_ x b) (sym (pr₂pxy≡y a~ b~)) b~realizes
+                                     )
 
-⟪_,_⟫ : {X Y Z W : Type }
-        {xs : Assembly X}
-        {ys : Assembly Y}
-        {zs : Assembly Z}
-        {ws : Assembly W}
-        (f : AssemblyMorphism xs ys)
-        (g : AssemblyMorphism zs ws)
-         AssemblyMorphism (xs  zs) (ys  ws)
- f , g  .map (x , z) = f .map x , g .map z
-⟪_,_⟫ {ys = ys} {ws = ws} f g .tracker = (do
-                      (f~ , f~tracks)  f .tracker
-                      (g~ , g~tracks)  g .tracker
-                      return (s  (s  (k  pair)  (s  (k  f~)  (s  (k  pr₁)  Id)))  (s  (k  g~)  (s  (k  pr₂)  Id))
-                             , λ xz r r⊩xz 
-                               ( subst  y  ys ._⊩_ y (f .map (xz .fst)))
-                                 (sym (subst _
-                                             (sym (t⨾r≡pair_fg f~ g~ r))
-                                             (pr₁pxy≡x (f~  (pr₁  r)) (g~  (pr₂  r)))))
-                                 (f~tracks (xz .fst) (pr₁  r) (r⊩xz .fst)))
-                               , subst  y  ws ._⊩_ y (g .map (xz .snd)))
-                                 (sym (subst _
-                                             (sym (t⨾r≡pair_fg f~ g~ r))
-                                             (pr₂pxy≡y (f~  (pr₁  r)) (g~  (pr₂  r)))))
-                                 (g~tracks (xz .snd) (pr₂  r) (r⊩xz .snd))))
-                               where
-                      module _ (f~ g~ r : A) where
-                        subf≡fprr :  f pr  (s  (k  f)  (s  (k  pr)  Id)  r)  (f  (pr  r))
-                        subf≡fprr f pr =
-                                    s  (k  f)  (s  (k  pr)  Id)  r
-                                      ≡⟨ sabc≡ac_bc _ _ _ 
-                                    (k  f  r)  (s  (k  pr)  Id  r)
-                                      ≡⟨ cong  x  x  _) (kab≡a f r) 
-                                    f  (s  (k  pr)  Id  r)
-                                      ≡⟨ cong  x  f  x) (sabc≡ac_bc _ _ _) 
-                                    f  (k  pr  r  (Id  r))
-                                      ≡⟨ cong  x  f  (x  (Id  r))) (kab≡a _ _ ) 
-                                    f  (pr  (Id  r))
-                                      ≡⟨ cong  x  f  (pr  x)) (Ida≡a r) 
-                                    f  (pr  r)
-                                      
-                        t⨾r≡pair_fg :
-                          s  (s  (k  pair)  (s  (k  f~)  (s  (k  pr₁)  Id)))  (s  (k  g~)  (s  (k  pr₂)  Id))  r
-                           pair  (f~  (pr₁  r))  (g~  (pr₂  r))
-                        t⨾r≡pair_fg =
-                          s  (s  (k  pair)  (s  (k  f~)  (s  (k  pr₁)  Id)))  (s  (k  g~)  (s  (k  pr₂)  Id))  r
-                            ≡⟨ sabc≡ac_bc _ _ _ 
-                          s  (k  pair)  (s  (k  f~)  (s  (k  pr₁)  Id))  r  (s  (k  g~)  (s  (k  pr₂)  Id)  r)
-                            ≡⟨ cong  x  x  (s  (k  g~)  (s  (k  pr₂)  Id)  r)) (sabc≡ac_bc _ _ _) 
-                          k  pair  r  (s  (k  f~)  (s  (k  pr₁)  Id)  r)  (s  (k  g~)  (s  (k  pr₂)  Id)  r)
-                            ≡⟨ cong  x  x  (s  (k  f~)  (s  (k  pr₁)  Id)  r)  (s  (k  g~)  (s  (k  pr₂)  Id)  r))
-                              (kab≡a pair r) 
-                          pair  (s  (k  f~)  (s  (k  pr₁)  Id)  r)  (s  (k  g~)  (s  (k  pr₂)  Id)  r)
-                            ≡⟨ cong₂  x y  pair  x  y) (subf≡fprr f~ pr₁) (subf≡fprr g~ pr₂) 
-                          pair  (f~  (pr₁  r))  (g~  (pr₂  r))
-                            
-π₁ : {A B : Type } {as : Assembly A} {bs : Assembly B}  AssemblyMorphism (as  bs) as
-π₁ .map (a , b) = a
-π₁ .tracker =  pr₁ ,  (a , b) p (goal , _)  goal) ∣₁
+⟪_,_⟫ : {X Y Z W : Type }
+        {xs : Assembly X}
+        {ys : Assembly Y}
+        {zs : Assembly Z}
+        {ws : Assembly W}
+        (f : AssemblyMorphism xs ys)
+        (g : AssemblyMorphism zs ws)
+         AssemblyMorphism (xs  zs) (ys  ws)
+ f , g  .map (x , z) = f .map x , g .map z
+⟪_,_⟫ {ys = ys} {ws = ws} f g .tracker =
+  do
+    (f~ , f~⊩isTrackedF)  f .tracker
+    (g~ , g~⊩isTrackedG)  g .tracker
+    let
+      realizer : Term as 1
+      realizer = ` pair ̇ (` f~ ̇ (` pr₁ ̇ # zero)) ̇ (` g~ ̇ (` pr₂ ̇ # zero))
+    return
+      (λ* realizer ,
+       { (x , z) r (pr₁r⊩x , pr₂r⊩z) 
+        subst  r'  r' ⊩[ ys ] (f .map x)) (sym (cong  x  pr₁  x) (λ*ComputationRule realizer r)  pr₁pxy≡x _ _)) (f~⊩isTrackedF x (pr₁  r) pr₁r⊩x) ,
+        subst  r'  r' ⊩[ ws ] (g .map z)) (sym (cong  x  pr₂  x) (λ*ComputationRule realizer r)  pr₂pxy≡y _ _)) (g~⊩isTrackedG z (pr₂  r) pr₂r⊩z) }))
+        
+π₁ : {A B : Type } {as : Assembly A} {bs : Assembly B}  AssemblyMorphism (as  bs) as
+π₁ .map (a , b) = a
+π₁ .tracker =  pr₁ ,  (a , b) p (goal , _)  goal) ∣₁
 
-π₂ : {A B : Type } {as : Assembly A} {bs : Assembly B}  AssemblyMorphism (as  bs) bs
-π₂ .map (a , b) = b
-π₂ .tracker =  pr₂ ,  (a , b) p (_ , goal)  goal) ∣₁
+π₂ : {A B : Type } {as : Assembly A} {bs : Assembly B}  AssemblyMorphism (as  bs) bs
+π₂ .map (a , b) = b
+π₂ .tracker =  pr₂ ,  (a , b) p (_ , goal)  goal) ∣₁
 
-⟨_,_⟩ : {X Y Z : Type }
-       {xs : Assembly X} {ys : Assembly Y} {zs : Assembly Z}
-       AssemblyMorphism zs xs
-       AssemblyMorphism zs ys
-       AssemblyMorphism zs (xs  ys)
- f , g  .map z = f .map z , g .map z
-⟨_,_⟩ {X} {Y} {Z} {xs} {ys} {zs} f g .tracker = map2 untruncated (f .tracker) (g .tracker) where
-  module _ 
-         ((f~ , f~tracks) : Σ[ f~  A ] tracks {xs = zs} {ys = xs}  f~ (f .map))
-         ((g~ , g~tracks) : Σ[ g~  A ] tracks {xs = zs} {ys = ys} g~ (g .map)) where
-           
-         _⊩X_ = xs ._⊩_
-         _⊩Y_ = ys ._⊩_
-         _⊩Z_ = zs ._⊩_
-             
-         t = s  (s  (k  pair)  (s  (k  f~)  Id))  (s  (k  g~)  Id)
-         untruncated : Σ[ t  A ] (∀ z zᵣ zᵣ⊩z  ((pr₁  (t  zᵣ)) ⊩X (f .map z)) × ((pr₂  (t  zᵣ)) ⊩Y (g .map z)))
-         untruncated = t , λ z zᵣ zᵣ⊩z  goal₁ z zᵣ zᵣ⊩z , goal₂ z zᵣ zᵣ⊩z where
-           module _ (z : Z) (zᵣ : A) (zᵣ⊩z : zᵣ ⊩Z z) where
-
-             pr₁⨾tracker⨾zᵣ≡f~⨾zᵣ : pr₁  (t  zᵣ)  f~  zᵣ
-             pr₁⨾tracker⨾zᵣ≡f~⨾zᵣ =
-               pr₁  (s  (s  (k  pair)  (s  (k  f~)  Id))  (s  (k  g~)  Id)  zᵣ)
-                          ≡⟨ cong  x  pr₁  x) (sabc≡ac_bc _ _ _) 
-               pr₁  (s  (k  pair)  (s  (k  f~)  Id)  zᵣ  (s  (k  g~)  Id  zᵣ))
-                          ≡⟨ cong  x  pr₁  (x  (s  (k  g~)  Id  zᵣ))) (sabc≡ac_bc _ _ _) 
-               pr₁  (k  pair  zᵣ  (s  (k  f~)  Id  zᵣ)  (s  (k  g~)  Id  zᵣ))
-                          ≡⟨ cong  x  pr₁  (x  (s  (k  f~)  Id  zᵣ)  (s  (k  g~)  Id  zᵣ))) (kab≡a _ _) 
-               pr₁  (pair  (s  (k  f~)  Id  zᵣ)  (s  (k  g~)  Id  zᵣ))
-                           ≡⟨ pr₁pxy≡x _ _ 
-               s  (k  f~)  Id  zᵣ
-                            ≡⟨ sabc≡ac_bc _ _ _ 
-               k  f~  zᵣ  (Id  zᵣ)
-                           ≡⟨ cong  x  x  (Id  zᵣ)) (kab≡a _ _) 
-               f~  (Id  zᵣ)
-                          ≡⟨ cong  x  f~  x) (Ida≡a _) 
-               f~  zᵣ
-                    
-
-             pr₂⨾tracker⨾zᵣ≡g~⨾zᵣ : pr₂  (t  zᵣ)  g~  zᵣ
-             pr₂⨾tracker⨾zᵣ≡g~⨾zᵣ =
-               pr₂  (s  (s  (k  pair)  (s  (k  f~)  Id))  (s  (k  g~)  Id)  zᵣ)
-                   ≡⟨ cong  x  pr₂  x) (sabc≡ac_bc _ _ _) 
-               pr₂  (s  (k  pair)  (s  (k  f~)  Id)  zᵣ  (s  (k  g~)  Id  zᵣ))
-                   ≡⟨ cong  x  pr₂  (x  (s  (k  g~)  Id  zᵣ))) (sabc≡ac_bc _ _ _) 
-               pr₂  (k  pair  zᵣ  (s  (k  f~)  Id  zᵣ)  (s  (k  g~)  Id  zᵣ))
-                   ≡⟨ cong  x  pr₂  (x  (s  (k  f~)  Id  zᵣ)  (s  (k  g~)  Id  zᵣ))) (kab≡a _ _) 
-               pr₂  (pair  (s  (k  f~)  Id  zᵣ)  (s  (k  g~)  Id  zᵣ))
-                   ≡⟨ pr₂pxy≡y _ _ 
-               s  (k  g~)  Id  zᵣ
-                   ≡⟨ sabc≡ac_bc _ _ _ 
-               k  g~  zᵣ  (Id  zᵣ)
-                   ≡⟨ cong  x  x  (Id  zᵣ)) (kab≡a _ _) 
-               g~  (Id  zᵣ)
-                  ≡⟨ cong  x  g~  x) (Ida≡a _) 
-               g~  zᵣ
-                    
-                  
-             goal₁ : (pr₁  (t  zᵣ)) ⊩X (f .map z)
-             goal₁ = subst  y  y ⊩X (f .map z)) (sym pr₁⨾tracker⨾zᵣ≡f~⨾zᵣ) (f~tracks z zᵣ zᵣ⊩z)
+⟨_,_⟩ : {X Y Z : Type }
+       {xs : Assembly X} {ys : Assembly Y} {zs : Assembly Z}
+       AssemblyMorphism zs xs
+       AssemblyMorphism zs ys
+       AssemblyMorphism zs (xs  ys)
+ f , g  .map z = f .map z , g .map z
+⟨_,_⟩ {X} {Y} {Z} {xs} {ys} {zs} f g .tracker =
+  do
+    (f~ , f~⊩isTrackedF)  f .tracker
+    (g~ , g~⊩isTrackedG)  g .tracker
+    let
+      realizer : Term as 1
+      realizer = ` pair ̇ (` f~ ̇ # zero) ̇ (` g~ ̇ # zero)
+    return
+      (λ* realizer ,
+       z r r⊩z 
+        subst  r'  r' ⊩[ xs ] (f .map z)) (sym (cong  x  pr₁  x) (λ*ComputationRule realizer r)  pr₁pxy≡x _ _)) (f~⊩isTrackedF z r r⊩z) ,
+        subst  r'  r' ⊩[ ys ] (g .map z)) (sym (cong  x  pr₂  x) (λ*ComputationRule realizer r)  pr₂pxy≡y _ _)) (g~⊩isTrackedG z r r⊩z)))
   
-             goal₂ : (pr₂  (t  zᵣ)) ⊩Y (g .map z)
-             goal₂ = subst  y  y ⊩Y (g .map z)) (sym pr₂⨾tracker⨾zᵣ≡g~⨾zᵣ) (g~tracks z zᵣ zᵣ⊩z)
-module _ {X Y : Type } (xs : Assembly X) (ys : Assembly Y) where
-    theπ₁ = π₁ {A = X} {B = Y} {as = xs} {bs = ys}
-    theπ₂ = π₂ {A = X} {B = Y} {as = xs} {bs = ys}
-    isBinProduct⊗ : ((Z , zs) : Σ[ Z  Type  ] Assembly Z)
-                    (f : AssemblyMorphism zs xs)
-                    (g : AssemblyMorphism zs ys)
-                    ∃![ fg  AssemblyMorphism zs (xs  ys) ] (fg  theπ₁  f) × (fg  theπ₂  g)
-    isBinProduct⊗ (Z , zs) f g =
-                  uniqueExists
-                    {B = λ fg  (fg  theπ₁  f) × (fg  theπ₂  g)}
-                     f , g 
-                    ( AssemblyMorphism≡ ( f , g   theπ₁) f (funExt  x  refl))
-                    , AssemblyMorphism≡ ( f , g   theπ₂) g (funExt  x  refl)))
-                     fg  isProp×
-                            (isSetAssemblyMorphism zs xs (fg  theπ₁) f)
-                            (isSetAssemblyMorphism zs ys (fg  theπ₂) g))
-                    -- TODO : Come up with a prettier proof
-                    λ fg (fgπ₁≡f , fgπ₂≡g)  sym ((lemma₂ fg fgπ₁≡f fgπ₂≡g)  (lemma₁ fg fgπ₁≡f fgπ₂≡g)) where
-                      module _ (fg : AssemblyMorphism zs (xs  ys))
-                               (fgπ₁≡f : fg  theπ₁  f)
-                               (fgπ₂≡g : fg  theπ₂  g) where
-                             lemma₁ :  fg  theπ₁ , fg  theπ₂    f , g 
-                             lemma₁ = AssemblyMorphism≡
-                                       fg  theπ₁ , fg  theπ₂ 
-                                       f , g 
-                                       i z  (fgπ₁≡f i .map z) , (fgπ₂≡g i .map z))
+module _ {X Y : Type } (xs : Assembly X) (ys : Assembly Y) where
+    theπ₁ = π₁ {A = X} {B = Y} {as = xs} {bs = ys}
+    theπ₂ = π₂ {A = X} {B = Y} {as = xs} {bs = ys}
+    isBinProduct⊗ : ((Z , zs) : Σ[ Z  Type  ] Assembly Z)
+                    (f : AssemblyMorphism zs xs)
+                    (g : AssemblyMorphism zs ys)
+                    ∃![ fg  AssemblyMorphism zs (xs  ys) ] (fg  theπ₁  f) × (fg  theπ₂  g)
+    isBinProduct⊗ (Z , zs) f g =
+                  uniqueExists
+                    {B = λ fg  (fg  theπ₁  f) × (fg  theπ₂  g)}
+                     f , g 
+                    ( AssemblyMorphism≡ ( f , g   theπ₁) f (funExt  x  refl))
+                    , AssemblyMorphism≡ ( f , g   theπ₂) g (funExt  x  refl)))
+                     fg  isProp×
+                            (isSetAssemblyMorphism zs xs (fg  theπ₁) f)
+                            (isSetAssemblyMorphism zs ys (fg  theπ₂) g))
+                    -- TODO : Come up with a prettier proof
+                    λ fg (fgπ₁≡f , fgπ₂≡g)  sym ((lemma₂ fg fgπ₁≡f fgπ₂≡g)  (lemma₁ fg fgπ₁≡f fgπ₂≡g)) where
+                      module _ (fg : AssemblyMorphism zs (xs  ys))
+                               (fgπ₁≡f : fg  theπ₁  f)
+                               (fgπ₂≡g : fg  theπ₂  g) where
+                             lemma₁ :  fg  theπ₁ , fg  theπ₂    f , g 
+                             lemma₁ = AssemblyMorphism≡
+                                       fg  theπ₁ , fg  theπ₂ 
+                                       f , g 
+                                       i z  (fgπ₁≡f i .map z) , (fgπ₂≡g i .map z))
 
-                             lemma₂ : fg   fg  theπ₁ , fg  theπ₂ 
-                             lemma₂ = AssemblyMorphism≡
-                                      fg
-                                       fg  theπ₁ , fg  theπ₂ 
-                                      (funExt λ x  ΣPathP (refl , refl))
+                             lemma₂ : fg   fg  theπ₁ , fg  theπ₂ 
+                             lemma₂ = AssemblyMorphism≡
+                                      fg
+                                       fg  theπ₁ , fg  theπ₂ 
+                                      (funExt λ x  ΣPathP (refl , refl))
 
-module _ where
-    open BinProduct
-    ASMBinProducts : BinProducts ASM
-    ASMBinProducts (X , xs) (Y , ys) .binProdOb = (X × Y) , (xs  ys)
-    ASMBinProducts (X , xs) (Y , ys) .binProdPr₁ = π₁ {as = xs} {bs = ys}
-    ASMBinProducts (X , xs) (Y , ys) .binProdPr₂ = π₂ {as = xs} {bs = ys}
-    ASMBinProducts (X , xs) (Y , ys) .univProp {z} f g = isBinProduct⊗ xs ys z f g
+module _ where
+    open BinProduct
+    ASMBinProducts : BinProducts ASM
+    ASMBinProducts (X , xs) (Y , ys) .binProdOb = (X × Y) , (xs  ys)
+    ASMBinProducts (X , xs) (Y , ys) .binProdPr₁ = π₁ {as = xs} {bs = ys}
+    ASMBinProducts (X , xs) (Y , ys) .binProdPr₂ = π₂ {as = xs} {bs = ys}
+    ASMBinProducts (X , xs) (Y , ys) .univProp {z} f g = isBinProduct⊗ xs ys z f g
 
\ No newline at end of file diff --git a/docs/Realizability.Assembly.Coequalizers.html b/docs/Realizability.Assembly.Coequalizers.html index b8faa75..4e7daf1 100644 --- a/docs/Realizability.Assembly.Coequalizers.html +++ b/docs/Realizability.Assembly.Coequalizers.html @@ -6,82 +6,87 @@ open import Cubical.HITs.PropositionalTruncation hiding (map) open import Cubical.HITs.PropositionalTruncation.Monad open import Cubical.Data.Sigma -open import Cubical.Categories.Limits.Coequalizers -open import Realizability.CombinatoryAlgebra +open import Realizability.CombinatoryAlgebra +open import Realizability.ApplicativeStructure -module Realizability.Assembly.Coequalizers {} {A : Type } (ca : CombinatoryAlgebra A) where +module Realizability.Assembly.Coequalizers {} {A : Type } (ca : CombinatoryAlgebra A) where -open import Realizability.Assembly.Base ca -open import Realizability.Assembly.Morphism ca -open Realizability.CombinatoryAlgebra.Combinators ca renaming (i to Id; ia≡a to Ida≡a) +open CombinatoryAlgebra ca +open import Realizability.Assembly.Base ca +open import Realizability.Assembly.Morphism ca +open Realizability.CombinatoryAlgebra.Combinators ca renaming (i to Id; ia≡a to Ida≡a) -module _ - {X Y : Type } - (xs : Assembly X) - (ys : Assembly Y) - (f g : AssemblyMorphism xs ys) - where - private - _⊩X_ = xs ._⊩_ - _⊩Y_ = ys ._⊩_ +module _ + {X Y : Type } + (xs : Assembly X) + (ys : Assembly Y) + (f g : AssemblyMorphism xs ys) + where + private + _⊩X_ = xs ._⊩_ + _⊩Y_ = ys ._⊩_ - _⊩coeq_ : (a : A) (x : SetCoequalizer (f .map) (g .map)) hProp - a ⊩coeq x = - setCoequalizerRec - isSetHProp - y (∃[ y' Y ] (inc {f = f .map} {g = g .map} y inc y') × (a ⊩Y y')) , squash₁) - x i (∃[ y' Y ] (coeq {f = f .map} {g = g .map} x i inc y') × (a ⊩Y y')) , squash₁) - x + _⊩coeq_ : (a : A) (x : SetCoequalizer (f .map) (g .map)) hProp + a ⊩coeq x = + setCoequalizerRec + isSetHProp + y (∃[ y' Y ] (inc {f = f .map} {g = g .map} y inc y') × (a ⊩Y y')) , squash₁) + x i (∃[ y' Y ] (coeq {f = f .map} {g = g .map} x i inc y') × (a ⊩Y y')) , squash₁) + x - coequalizer : Assembly (SetCoequalizer (f .map) (g .map)) - ⊩coeqSurjective : (x : SetCoequalizer (f .map) (g .map)) ∃[ a A ] ((a ⊩coeq x) .fst) + coequalizer : Assembly (SetCoequalizer (f .map) (g .map)) + ⊩coeqSurjective : (x : SetCoequalizer (f .map) (g .map)) ∃[ a A ] ((a ⊩coeq x) .fst) - coequalizer .isSetX = squash - coequalizer ._⊩_ a x = (a ⊩coeq x) .fst - coequalizer .⊩isPropValued a x = (a ⊩coeq x) .snd - coequalizer .⊩surjective x = ⊩coeqSurjective x + coequalizer .isSetX = squash + coequalizer ._⊩_ a x = (a ⊩coeq x) .fst + coequalizer .⊩isPropValued a x = (a ⊩coeq x) .snd + coequalizer .⊩surjective x = ⊩coeqSurjective x - ⊩coeqSurjective x = - setCoequalizerElimProp - {C = λ b ∃[ a A ] ((a ⊩coeq b) .fst)} - x squash₁) - b do - (b~ , b~realizes) ys .⊩surjective b - return (b~ , b~⊩coeq_inc_b b b~ b~realizes)) - x where - b~⊩coeq_inc_b : (b : Y) (b~ : A) (b~realizes : b~ ⊩Y b) (b~ ⊩coeq inc b) .fst - b~⊩coeq_inc_b b b~ b~realizes = b , refl , b~realizes ∣₁ - {- + ⊩coeqSurjective x = + setCoequalizerElimProp + {C = λ b ∃[ a A ] ((a ⊩coeq b) .fst)} + x squash₁) + b do + (b~ , b~realizes) ys .⊩surjective b + return (b~ , b~⊩coeq_inc_b b b~ b~realizes)) + x where + b~⊩coeq_inc_b : (b : Y) (b~ : A) (b~realizes : b~ ⊩Y b) (b~ ⊩coeq inc b) .fst + b~⊩coeq_inc_b b b~ b~realizes = b , refl , b~realizes ∣₁ + {- Coequalziers have a map E ← Y ⇇ X -} - ιcoequalizer : AssemblyMorphism ys coequalizer - ιcoequalizer .map = inc - ιcoequalizer .tracker = Id , y yᵣ yᵣ⊩y subst r (r ⊩coeq inc y) .fst) (sym (Ida≡a yᵣ)) y , refl , yᵣ⊩y ∣₁) ∣₁ + ιcoequalizer : AssemblyMorphism ys coequalizer + ιcoequalizer .map = inc + ιcoequalizer .tracker = Id , y yᵣ yᵣ⊩y subst r (r ⊩coeq inc y) .fst) (sym (Ida≡a yᵣ)) y , refl , yᵣ⊩y ∣₁) ∣₁ - coequalizerFactors : ((Z , zs) : Σ[ Z Type ] Assembly Z) - (ι' : AssemblyMorphism ys zs) - (f ι' g ι') - ∃![ ! AssemblyMorphism coequalizer zs ] (ιcoequalizer ! ι') - coequalizerFactors (Z , zs) ι' f⊚ι'≡g⊚ι' = - uniqueExists where - .map setCoequalizerRec (zs .isSetX) (ι' .map) λ x λ i f⊚ι'≡g⊚ι' i .map x - .tracker {!!}) - (AssemblyMorphism≡ _ _ (funExt λ x refl)) - ! isSetAssemblyMorphism ys zs (ιcoequalizer !) ι') - λ ! ιcoequalizer⊚!≡ι' AssemblyMorphism≡ _ _ - (funExt λ x - setCoequalizerElimProp - {C = λ x setCoequalizerRec (zs .isSetX) (ι' .map) x₁ i f⊚ι'≡g⊚ι' i .map x₁) x ! .map x} - x zs .isSetX _ _) y λ i ιcoequalizer⊚!≡ι' (~ i) .map y) x) - open Coequalizer - open IsCoequalizer - - ιIsCoequalizer : IsCoequalizer {C = ASM} f g ιcoequalizer - ιIsCoequalizer .glues = AssemblyMorphism≡ _ _ (funExt λ x SetCoequalizer.coeq x) - ιIsCoequalizer .univProp q qGlues = coequalizerFactors _ q qGlues - - ASMCoequalizer : Coequalizer {C = ASM} f g - ASMCoequalizer .coapex = (SetCoequalizer (f .map) (g .map)) , coequalizer - Coequalizer.coeq ASMCoequalizer = ιcoequalizer - ASMCoequalizer .isCoequalizer = ιIsCoequalizer + coequalizerFactors : ((Z , zs) : Σ[ Z Type ] Assembly Z) + (ι' : AssemblyMorphism ys zs) + (f ι' g ι') + ∃![ ! AssemblyMorphism coequalizer zs ] (ιcoequalizer ! ι') + coequalizerFactors (Z , zs) ι' f⊚ι'≡g⊚ι' = + uniqueExists + (let + map = x setCoequalizerRec (zs .isSetX) (ι' .map) x i f⊚ι'≡g⊚ι' i .map x) x) + in + makeAssemblyMorphism + map + (do + (ι'~ , ι'~⊩isTrackedι') ι' .tracker + return + (ι'~ , + x r r⊩x setCoequalizerElimProp {C = λ x (r : A) r ⊩[ coequalizer ] x (ι'~ r) ⊩[ zs ] (map x)} {!!} y r r⊩y {!!}) x r r⊩x)))) + {!!} + {!!} + {!!} + {- + uniqueExists (λ where + .map → setCoequalizerRec (zs .isSetX) (ι' .map) λ x → λ i → f⊚ι'≡g⊚ι' i .map x + .tracker → return ({!!} , (λ x r r⊩x → {!setCoequalizerElimProp {C = λ x → !}))) + (AssemblyMorphism≡ _ _ (funExt λ x → refl)) + (λ ! → isSetAssemblyMorphism ys zs (ιcoequalizer ⊚ !) ι') + λ ! ιcoequalizer⊚!≡ι' → AssemblyMorphism≡ _ _ + (funExt λ x → + setCoequalizerElimProp + {C = λ x → setCoequalizerRec (zs .isSetX) (ι' .map) (λ x₁ i → f⊚ι'≡g⊚ι' i .map x₁) x ≡ ! .map x} + (λ x → zs .isSetX _ _) (λ y → λ i → ιcoequalizer⊚!≡ι' (~ i) .map y) x) -}
\ No newline at end of file diff --git a/docs/Realizability.Assembly.Equalizers.html b/docs/Realizability.Assembly.Equalizers.html index 9f7c018..1f96bcd 100644 --- a/docs/Realizability.Assembly.Equalizers.html +++ b/docs/Realizability.Assembly.Equalizers.html @@ -1,42 +1,42 @@ -Realizability.Assembly.Equalizers
{-# OPTIONS --cubical --allow-unsolved-metas #-}
-open import Cubical.Foundations.Prelude
-open import Cubical.Foundations.HLevels
-open import Cubical.Data.Sigma
-open import Cubical.HITs.PropositionalTruncation hiding (map)
-open import Realizability.CombinatoryAlgebra
+Realizability.Assembly.Equalizers
{-# OPTIONS --cubical #-}
+open import Cubical.Foundations.Prelude
+open import Cubical.Foundations.HLevels
+open import Cubical.Data.Sigma
+open import Cubical.HITs.PropositionalTruncation hiding (map)
+open import Realizability.CombinatoryAlgebra
 
-module Realizability.Assembly.Equalizers {} {A : Type } (ca : CombinatoryAlgebra A) where
+module Realizability.Assembly.Equalizers {} {A : Type } (ca : CombinatoryAlgebra A) where
 
-open CombinatoryAlgebra ca
-open Realizability.CombinatoryAlgebra.Combinators ca renaming (i to Id; ia≡a to Ida≡a)
-open import Realizability.Assembly.Base ca
-open import Realizability.Assembly.Morphism ca
+open CombinatoryAlgebra ca
+open Realizability.CombinatoryAlgebra.Combinators ca renaming (i to Id; ia≡a to Ida≡a)
+open import Realizability.Assembly.Base ca
+open import Realizability.Assembly.Morphism ca
 
-module _ {A B : Type } {as : Assembly A} {bs : Assembly B} (f g : AssemblyMorphism as bs) where
-  _⊩A_ = as ._⊩_
-  equalizer : Assembly (Σ[ a  A ] f .map a  g .map a)
-  equalizer .isSetX = isSetΣ (as .isSetX) λ x  isProp→isSet (bs .isSetX (f .map x) (g .map x))
-  equalizer ._⊩_ r (a , fa≡ga) = as ._⊩_ r a
-  equalizer .⊩isPropValued r (a , fa≡ga) = as .⊩isPropValued r a
-  equalizer .⊩surjective (a , fa≡ga) = as .⊩surjective a
+module _ {A B : Type } {as : Assembly A} {bs : Assembly B} (f g : AssemblyMorphism as bs) where
+  _⊩A_ = as ._⊩_
+  equalizer : Assembly (Σ[ a  A ] f .map a  g .map a)
+  equalizer .isSetX = isSetΣ (as .isSetX) λ x  isProp→isSet (bs .isSetX (f .map x) (g .map x))
+  equalizer ._⊩_ r (a , fa≡ga) = as ._⊩_ r a
+  equalizer .⊩isPropValued r (a , fa≡ga) = as .⊩isPropValued r a
+  equalizer .⊩surjective (a , fa≡ga) = as .⊩surjective a
 
-  ιequalizer : AssemblyMorphism equalizer as
-  ιequalizer .map (a , fa≡ga) = a
-  ιequalizer .tracker =  Id ,  x aₓ aₓ⊩x  subst  y  y ⊩A (x .fst)) (sym (Ida≡a aₓ)) aₓ⊩x) ∣₁
+  ιequalizer : AssemblyMorphism equalizer as
+  ιequalizer .map (a , fa≡ga) = a
+  ιequalizer .tracker =  Id ,  x aₓ aₓ⊩x  subst  y  y ⊩A (x .fst)) (sym (Ida≡a aₓ)) aₓ⊩x) ∣₁
                                                                                                  
-  equalizerFactors : ((Z , zs) : Σ[ Z  Type  ] (Assembly Z))
-                    (ι' : AssemblyMorphism zs as)
-                    (ι'  f  ι'  g)
-                    ∃![ !  AssemblyMorphism zs equalizer ] (!  ιequalizer  ι')
-  equalizerFactors (Z , zs) ι' ι'f≡ι'g =
-                   uniqueExists  where
-                                   .map z  ι' .map z , λ i  ι'f≡ι'g i .map z
-                                   .tracker  ι' .tracker)
-                                   (AssemblyMorphism≡ _ _ refl)
-                                    !  isSetAssemblyMorphism _ _ (!  ιequalizer) ι')
-                                   λ !' !'⊚ι≡ι'  AssemblyMorphism≡ _ _
-                                                  (funExt λ z  Σ≡Prop  x  bs .isSetX (f .map x) (g .map x))
-                                                           i  !'⊚ι≡ι' (~ i) .map z))
+  equalizerFactors : ((Z , zs) : Σ[ Z  Type  ] (Assembly Z))
+                    (ι' : AssemblyMorphism zs as)
+                    (ι'  f  ι'  g)
+                    ∃![ !  AssemblyMorphism zs equalizer ] (!  ιequalizer  ι')
+  equalizerFactors (Z , zs) ι' ι'f≡ι'g =
+                   uniqueExists  where
+                                   .map z  ι' .map z , λ i  ι'f≡ι'g i .map z
+                                   .tracker  ι' .tracker)
+                                   (AssemblyMorphism≡ _ _ refl)
+                                    !  isSetAssemblyMorphism _ _ (!  ιequalizer) ι')
+                                   λ !' !'⊚ι≡ι'  AssemblyMorphism≡ _ _
+                                                  (funExt λ z  Σ≡Prop  x  bs .isSetX (f .map x) (g .map x))
+                                                           i  !'⊚ι≡ι' (~ i) .map z))
 
 
\ No newline at end of file diff --git a/docs/Realizability.Assembly.Everything.html b/docs/Realizability.Assembly.Everything.html index e3bda71..f044745 100644 --- a/docs/Realizability.Assembly.Everything.html +++ b/docs/Realizability.Assembly.Everything.html @@ -8,5 +8,6 @@ open import Realizability.Assembly.Equalizers open import Realizability.Assembly.Exponentials open import Realizability.Assembly.Morphism -open import Realizability.Assembly.Regular.Everything +-- TODO : Fix regular structure modules +-- open import Realizability.Assembly.Regular.Everything
\ No newline at end of file diff --git a/docs/Realizability.Assembly.Exponentials.html b/docs/Realizability.Assembly.Exponentials.html index beee3f4..677cefa 100644 --- a/docs/Realizability.Assembly.Exponentials.html +++ b/docs/Realizability.Assembly.Exponentials.html @@ -2,128 +2,143 @@ Realizability.Assembly.Exponentials
{-# OPTIONS --cubical --allow-unsolved-metas #-}
 open import Cubical.Foundations.Prelude
 open import Cubical.Data.Sigma
-open import Cubical.HITs.PropositionalTruncation hiding (map)
-open import Cubical.HITs.PropositionalTruncation.Monad
-open import Realizability.CombinatoryAlgebra
+open import Cubical.Data.FinData hiding (eq)
+open import Cubical.HITs.PropositionalTruncation hiding (map)
+open import Cubical.HITs.PropositionalTruncation.Monad
+open import Realizability.CombinatoryAlgebra
+open import Realizability.ApplicativeStructure
 
-module Realizability.Assembly.Exponentials {} {A : Type } (ca : CombinatoryAlgebra A) where
+module Realizability.Assembly.Exponentials {} {A : Type } (ca : CombinatoryAlgebra A) where
 
-open CombinatoryAlgebra ca
-open Realizability.CombinatoryAlgebra.Combinators ca renaming (i to Id; ia≡a to Ida≡a)
-open import Realizability.Assembly.Base ca
-open import Realizability.Assembly.Morphism ca
-open import Realizability.Assembly.BinProducts ca
+open CombinatoryAlgebra ca
+open Realizability.CombinatoryAlgebra.Combinators ca renaming (i to Id; ia≡a to Ida≡a)
+open import Realizability.Assembly.Base ca
+open import Realizability.Assembly.Morphism ca
+open import Realizability.Assembly.BinProducts ca
 
--- Exponential objects
-_⇒_ : {A B : Type }  (as : Assembly A)  (bs : Assembly B)  Assembly (AssemblyMorphism as bs)
-(as  bs) .isSetX = isSetAssemblyMorphism as bs
-(as  bs) ._⊩_ r f = tracks {xs = as} {ys = bs} r (f .map)
-_⇒_ {A} {B} as bs .⊩isPropValued r f = isPropTracks {X = A} {Y = B} {xs = as} {ys = bs}  r (f .map)
-(as  bs) .⊩surjective f = f .tracker
+-- Exponential objects
+_⇒_ : {A B : Type }  (as : Assembly A)  (bs : Assembly B)  Assembly (AssemblyMorphism as bs)
+(as  bs) .isSetX = isSetAssemblyMorphism as bs
+(as  bs) ._⊩_ r f = tracks {xs = as} {ys = bs} r (f .map)
+_⇒_ {A} {B} as bs .⊩isPropValued r f = isPropTracks {X = A} {Y = B} {xs = as} {ys = bs}  r (f .map)
+(as  bs) .⊩surjective f = f .tracker
 
--- What a distinguished gentleman
-eval : {X Y : Type }  (xs : Assembly X)  (ys : Assembly Y)  AssemblyMorphism ((xs  ys)  xs) ys
-eval xs ys .map (f , x) = f .map x
-eval {X} {Y} xs ys .tracker =
-        (s  (s  (k  pr₁)  Id)  (s  (k  pr₂)  Id))
-       ,  (f , x) r r⊩fx  subst
-                y  y ⊩Y (f .map x))
-               (sym (tracker⨾r≡pr₁r⨾pr₂r (f , x) r r⊩fx))
-               (pr₁r⨾pr₂rTracks (f , x) r r⊩fx))
-       ∣₁ where
-          _⊩Y_ = ys ._⊩_
-          module _ (fx : (AssemblyMorphism xs ys) × X)
-                   (r : A)
-                   (r⊩fx : ((xs  ys)  xs) ._⊩_ r (fx .fst , fx .snd)) where
-            f = fx .fst
-            x = fx .snd
+-- What a distinguished gentleman
+eval : {X Y : Type }  (xs : Assembly X)  (ys : Assembly Y)  AssemblyMorphism ((xs  ys)  xs) ys
+eval xs ys .map (f , x) = f .map x
+eval {X} {Y} xs ys .tracker =
+        (s  (s  (k  pr₁)  Id)  (s  (k  pr₂)  Id))
+       ,  (f , x) r r⊩fx  subst
+                y  y ⊩Y (f .map x))
+               (sym (tracker⨾r≡pr₁r⨾pr₂r (f , x) r r⊩fx))
+               (pr₁r⨾pr₂rTracks (f , x) r r⊩fx))
+       ∣₁ where
+          _⊩Y_ = ys ._⊩_
+          module _ (fx : (AssemblyMorphism xs ys) × X)
+                   (r : A)
+                   (r⊩fx : ((xs  ys)  xs) ._⊩_ r (fx .fst , fx .snd)) where
+            f = fx .fst
+            x = fx .snd
                           
-            pr₁r⨾pr₂rTracks : (pr₁  r  (pr₂  r)) ⊩Y (f .map x)
-            pr₁r⨾pr₂rTracks = r⊩fx .fst x (pr₂  r) (r⊩fx .snd)
+            pr₁r⨾pr₂rTracks : (pr₁  r  (pr₂  r)) ⊩Y (f .map x)
+            pr₁r⨾pr₂rTracks = r⊩fx .fst x (pr₂  r) (r⊩fx .snd)
                           
-            tracker⨾r≡pr₁r⨾pr₂r : s  (s  (k  pr₁)  Id)  (s  (k  pr₂)  Id)  r  (pr₁  r)  (pr₂  r)
-            tracker⨾r≡pr₁r⨾pr₂r =
-              s  (s  (k  pr₁)  Id)  (s  (k  pr₂)  Id)  r
-                ≡⟨ sabc≡ac_bc _ _ _  
-              (s  (k  pr₁)  Id  r)  (s  (k  pr₂)  Id  r)
-                ≡⟨ cong  x  x  (s  (k  pr₂)  Id  r)) (sabc≡ac_bc _ _ _)  
-              (k  pr₁  r  (Id  r))  (s  (k  pr₂)  Id  r)
-                ≡⟨ cong  x  (k  pr₁  r  (Id  r))  x) (sabc≡ac_bc _ _ _) 
-              (k  pr₁  r  (Id  r))  (k  pr₂  r  (Id  r))
-                ≡⟨ cong  x  (x  (Id  r))  (k  pr₂  r  (Id  r))) (kab≡a _ _) 
-              (pr₁  (Id  r))  (k  pr₂  r  (Id  r))
-                ≡⟨ cong  x  (pr₁  x)  (k  pr₂  r  (Id  r))) (Ida≡a r) 
-              (pr₁  r)  (k  pr₂  r  (Id  r))
-                ≡⟨ cong  x  (pr₁  r)  (x  (Id  r))) (kab≡a _ _)  
-              (pr₁  r)  (pr₂  (Id  r))
-                ≡⟨ cong  x  (pr₁  r)  (pr₂  x)) (Ida≡a r) 
-              (pr₁  r)  (pr₂  r)
-              
+            tracker⨾r≡pr₁r⨾pr₂r : s  (s  (k  pr₁)  Id)  (s  (k  pr₂)  Id)  r  (pr₁  r)  (pr₂  r)
+            tracker⨾r≡pr₁r⨾pr₂r =
+              s  (s  (k  pr₁)  Id)  (s  (k  pr₂)  Id)  r
+                ≡⟨ sabc≡ac_bc _ _ _  
+              (s  (k  pr₁)  Id  r)  (s  (k  pr₂)  Id  r)
+                ≡⟨ cong  x  x  (s  (k  pr₂)  Id  r)) (sabc≡ac_bc _ _ _)  
+              (k  pr₁  r  (Id  r))  (s  (k  pr₂)  Id  r)
+                ≡⟨ cong  x  (k  pr₁  r  (Id  r))  x) (sabc≡ac_bc _ _ _) 
+              (k  pr₁  r  (Id  r))  (k  pr₂  r  (Id  r))
+                ≡⟨ cong  x  (x  (Id  r))  (k  pr₂  r  (Id  r))) (kab≡a _ _) 
+              (pr₁  (Id  r))  (k  pr₂  r  (Id  r))
+                ≡⟨ cong  x  (pr₁  x)  (k  pr₂  r  (Id  r))) (Ida≡a r) 
+              (pr₁  r)  (k  pr₂  r  (Id  r))
+                ≡⟨ cong  x  (pr₁  r)  (x  (Id  r))) (kab≡a _ _)  
+              (pr₁  r)  (pr₂  (Id  r))
+                ≡⟨ cong  x  (pr₁  r)  (pr₂  x)) (Ida≡a r) 
+              (pr₁  r)  (pr₂  r)
+              
 
-module _ {X Y Z : Type }
-         {xs : Assembly X}
-         {ys : Assembly Y}
-         {zs : Assembly Z}
-         (f : AssemblyMorphism (zs  xs) ys) where
-         theEval = eval {X} {Y} xs ys
-         ⇒isExponential : ∃![ g  AssemblyMorphism zs (xs  ys) ]
-                           g , identityMorphism xs   theEval  f
-         ⇒isExponential = uniqueExists  where
-                                           .map z  λ where
-                                                        .map x  f .map (z , x)
-                                                        .tracker  do
-                                                                    (f~ , f~tracks)  f .tracker
-                                                                    (z~ , z~realizes)  zs .⊩surjective z
-                                                                    return ( (s  (k  f~)  (s  (k  (pair  z~))  Id)
-                                                                           , λ x aₓ aₓ⊩x
-                                                                            subst  k  k ⊩Y (f .map (z , x)))
-                                                                             (sym (eq f~ f~tracks z (z~ , z~realizes) x aₓ aₓ⊩x))
-                                                                             (pair⨾z~⨾aₓtracks f~ f~tracks z (z~ , z~realizes) x aₓ aₓ⊩x)))
-                                           .tracker  do
-                                                       (f~ , f~tracker)  f .tracker
-                                                       -- λ* x. λ* y. f~ ⨾ (pair ⨾ x ⨾ y)
-                                                       return ({!!} ,  z zᵣ zᵣ⊩z x xᵣ xᵣ⊩x  {!!})))
-                                        (AssemblyMorphism≡ _ _ (funExt  (z , x)  refl)))
-                                         g  isSetAssemblyMorphism _ _ ( g , identityMorphism xs   theEval) f)
-                                        λ g g×id⊚eval≡f  AssemblyMorphism≡ _ _
-                                                          (funExt  z  AssemblyMorphism≡ _ _
-                                                                         (funExt  x  λ i  g×id⊚eval≡f (~ i) .map (z , x))))) where
-                         _⊩X_ = xs ._⊩_
-                         _⊩Y_ = ys ._⊩_
-                         _⊩Z_ = zs ._⊩_
-                         _⊩Z×X_ = (zs  xs) ._⊩_
-                         Z×X = Z × X
-                         module _ (f~ : A)
-                                   (f~tracks : (∀ (zx : Z×X) (r : A) (rRealizes : (r ⊩Z×X zx))  ((f~  r) ⊩Y (f .map zx))))
-                                   (z : Z)
-                                   (zRealizer : Σ[ z~  A ] (z~ ⊩Z z))
-                                   (x : X)
-                                   (aₓ : A)
-                                   (aₓ⊩x : aₓ ⊩X x) where
-                            z~ : A
-                            z~ = zRealizer .fst
-                            z~realizes = zRealizer .snd
+module _ {X Y Z : Type }
+         {xs : Assembly X}
+         {ys : Assembly Y}
+         {zs : Assembly Z}
+         (f : AssemblyMorphism (zs  xs) ys) where
+         theEval = eval {X} {Y} xs ys
+         ⇒isExponential : ∃![ g  AssemblyMorphism zs (xs  ys) ]
+                           g , identityMorphism xs   theEval  f
+         ⇒isExponential = uniqueExists  where
+                                           .map z  λ where
+                                                        .map x  f .map (z , x)
+                                                        .tracker  do
+                                                                    (f~ , f~tracks)  f .tracker
+                                                                    (z~ , z~realizes)  zs .⊩surjective z
+                                                                    return ( (s  (k  f~)  (s  (k  (pair  z~))  Id)
+                                                                           , λ x aₓ aₓ⊩x
+                                                                            subst  k  k ⊩Y (f .map (z , x)))
+                                                                             (sym (eq f~ f~tracks z (z~ , z~realizes) x aₓ aₓ⊩x))
+                                                                             (pair⨾z~⨾aₓtracks f~ f~tracks z (z~ , z~realizes) x aₓ aₓ⊩x)))
+                                           .tracker  do
+                                                       (f~ , f~tracker)  f .tracker
+                                                       -- λ* x. λ* y. f~ ⨾ (pair ⨾ x ⨾ y)
+                                                       let
+                                                         realizer : Term as 2
+                                                         realizer = ` f~ ̇ (` pair ̇ # one ̇ # zero)
+                                                       return
+                                                         (λ*2 realizer ,
+                                                          z a a⊩z x b b⊩x 
+                                                           subst
+                                                              r'  r' ⊩[ ys ] (f .map (z , x)))
+                                                             (sym (λ*2ComputationRule realizer a b))
+                                                             (f~tracker
+                                                               (z , x)
+                                                               (pair  a  b)
+                                                               ((subst  r'  r' ⊩[ zs ] z) (sym (pr₁pxy≡x _ _)) a⊩z) ,
+                                                                (subst  r'  r' ⊩[ xs ] x) (sym (pr₂pxy≡y _ _)) b⊩x))))))
+                                        (AssemblyMorphism≡ _ _ (funExt  (z , x)  refl)))
+                                         g  isSetAssemblyMorphism _ _ ( g , identityMorphism xs   theEval) f)
+                                        λ g g×id⊚eval≡f  AssemblyMorphism≡ _ _
+                                                          (funExt  z  AssemblyMorphism≡ _ _
+                                                                         (funExt  x  λ i  g×id⊚eval≡f (~ i) .map (z , x))))) where
+                         _⊩X_ = xs ._⊩_
+                         _⊩Y_ = ys ._⊩_
+                         _⊩Z_ = zs ._⊩_
+                         _⊩Z×X_ = (zs  xs) ._⊩_
+                         Z×X = Z × X
+                         module _ (f~ : A)
+                                   (f~tracks : (∀ (zx : Z×X) (r : A) (rRealizes : (r ⊩Z×X zx))  ((f~  r) ⊩Y (f .map zx))))
+                                   (z : Z)
+                                   (zRealizer : Σ[ z~  A ] (z~ ⊩Z z))
+                                   (x : X)
+                                   (aₓ : A)
+                                   (aₓ⊩x : aₓ ⊩X x) where
+                            z~ : A
+                            z~ = zRealizer .fst
+                            z~realizes = zRealizer .snd
 
-                            eq : s  (k  f~)  (s  (k  (pair  z~))  Id)  aₓ  f~  (pair  z~  aₓ)
-                            eq =
-                              s  (k  f~)  (s  (k  (pair  z~))  Id)  aₓ
-                                ≡⟨ sabc≡ac_bc _ _ _ 
-                              (k  f~  aₓ)  (s  (k  (pair  z~))  Id  aₓ)
-                                ≡⟨ cong  x  x  (s  (k  (pair  z~))  Id  aₓ)) (kab≡a f~ aₓ) 
-                              f~  (s  (k  (pair  z~))  Id  aₓ)
-                                ≡⟨ cong  x  f~  x) (sabc≡ac_bc _ _ _) 
-                              f~  ((k  (pair  z~)  aₓ)  (Id  aₓ))
-                                ≡⟨ cong  x  f~  (x  (Id  aₓ))) (kab≡a (pair  z~) aₓ) 
-                              f~  (pair  z~  (Id  aₓ))
-                                ≡⟨ cong  x  f~  (pair  z~  x)) (Ida≡a aₓ) 
-                              f~  (pair  z~  aₓ)
-                                
+                            eq : s  (k  f~)  (s  (k  (pair  z~))  Id)  aₓ  f~  (pair  z~  aₓ)
+                            eq =
+                              s  (k  f~)  (s  (k  (pair  z~))  Id)  aₓ
+                                ≡⟨ sabc≡ac_bc _ _ _ 
+                              (k  f~  aₓ)  (s  (k  (pair  z~))  Id  aₓ)
+                                ≡⟨ cong  x  x  (s  (k  (pair  z~))  Id  aₓ)) (kab≡a f~ aₓ) 
+                              f~  (s  (k  (pair  z~))  Id  aₓ)
+                                ≡⟨ cong  x  f~  x) (sabc≡ac_bc _ _ _) 
+                              f~  ((k  (pair  z~)  aₓ)  (Id  aₓ))
+                                ≡⟨ cong  x  f~  (x  (Id  aₓ))) (kab≡a (pair  z~) aₓ) 
+                              f~  (pair  z~  (Id  aₓ))
+                                ≡⟨ cong  x  f~  (pair  z~  x)) (Ida≡a aₓ) 
+                              f~  (pair  z~  aₓ)
+                                
 
-                            pair⨾z~⨾aₓtracks : (f~  (pair  z~  aₓ)) ⊩Y (f .map (z , x))
-                            pair⨾z~⨾aₓtracks =
-                              f~tracks
-                                (z , x)
-                                (pair  z~  aₓ)
-                                ( (subst  y  y ⊩Z z) (sym (pr₁pxy≡x z~ aₓ)) z~realizes)
-                                , (subst  y  y ⊩X x) (sym (pr₂pxy≡y z~ aₓ)) aₓ⊩x))
+                            pair⨾z~⨾aₓtracks : (f~  (pair  z~  aₓ)) ⊩Y (f .map (z , x))
+                            pair⨾z~⨾aₓtracks =
+                              f~tracks
+                                (z , x)
+                                (pair  z~  aₓ)
+                                ( (subst  y  y ⊩Z z) (sym (pr₁pxy≡x z~ aₓ)) z~realizes)
+                                , (subst  y  y ⊩X x) (sym (pr₂pxy≡y z~ aₓ)) aₓ⊩x))
 
\ No newline at end of file diff --git a/docs/Realizability.Assembly.Morphism.html b/docs/Realizability.Assembly.Morphism.html index 52b2539..32739ba 100644 --- a/docs/Realizability.Assembly.Morphism.html +++ b/docs/Realizability.Assembly.Morphism.html @@ -4,152 +4,148 @@ open import Cubical.Foundations.HLevels open import Cubical.Foundations.Isomorphism open import Cubical.Foundations.Function -open import Cubical.Data.Sigma -open import Cubical.HITs.PropositionalTruncation hiding (map) -open import Cubical.Reflection.RecordEquiv -open import Cubical.Categories.Category -open import Realizability.CombinatoryAlgebra +open import Cubical.Foundations.Equiv +open import Cubical.Data.Sigma +open import Cubical.Data.FinData +open import Cubical.HITs.PropositionalTruncation hiding (map) +open import Cubical.HITs.PropositionalTruncation.Monad +open import Cubical.Reflection.RecordEquiv +open import Cubical.Categories.Category +open import Realizability.CombinatoryAlgebra +open import Realizability.ApplicativeStructure -module Realizability.Assembly.Morphism {} {A : Type } (ca : CombinatoryAlgebra A) where +module Realizability.Assembly.Morphism {} {A : Type } (ca : CombinatoryAlgebra A) where -open import Realizability.Assembly.Base ca +open import Realizability.Assembly.Base ca -open Assembly -open CombinatoryAlgebra ca -open Realizability.CombinatoryAlgebra.Combinators ca renaming (i to Id; ia≡a to Ida≡a) +open Assembly +open CombinatoryAlgebra ca +open Realizability.CombinatoryAlgebra.Combinators ca renaming (i to Id; ia≡a to Ida≡a) -module _ {X Y : Type } {xs : Assembly X} {ys : Assembly Y} (t : A) (f : X Y) where +module _ {X Y : Type } {xs : Assembly X} {ys : Assembly Y} (t : A) (f : X Y) where - tracks : Type - tracks = (x : X) (aₓ : A) (aₓ ⊩X x) (t aₓ) ⊩Y (f x) where - _⊩X_ = xs ._⊩_ - _⊩Y_ = ys ._⊩_ + tracks : Type + tracks = (x : X) (aₓ : A) (aₓ ⊩X x) (t aₓ) ⊩Y (f x) where + _⊩X_ = xs ._⊩_ + _⊩Y_ = ys ._⊩_ - isPropTracks : isProp tracks - isPropTracks = isPropΠ λ x - isPropΠ λ aₓ - isPropΠ λ aₓ⊩x - ys .⊩isPropValued (t aₓ) (f x) + isPropTracks : isProp tracks + isPropTracks = isPropΠ λ x + isPropΠ λ aₓ + isPropΠ λ aₓ⊩x + ys .⊩isPropValued (t aₓ) (f x) -record AssemblyMorphism {X Y : Type } (as : Assembly X) (bs : Assembly Y) : Type where - open Assembly as renaming (_⊩_ to _⊩X_) - open Assembly bs renaming (_⊩_ to _⊩Y_) - field - map : X Y - tracker : ∃[ t A ] ((x : X) (aₓ : A) (aₓ ⊩X x) (t aₓ) ⊩Y (map x)) -open AssemblyMorphism - -unquoteDecl AssemblyMorphismIsoΣ = declareRecordIsoΣ AssemblyMorphismIsoΣ (quote AssemblyMorphism) - -module _ {X Y : Type } (xs : Assembly X) (ys : Assembly Y) where +record AssemblyMorphism {X Y : Type } (as : Assembly X) (bs : Assembly Y) : Type where + no-eta-equality + constructor makeAssemblyMorphism + open Assembly as renaming (_⊩_ to _⊩X_) + open Assembly bs renaming (_⊩_ to _⊩Y_) + field + map : X Y + tracker : ∃[ t A ] ((x : X) (aₓ : A) (aₓ ⊩X x) (t aₓ) ⊩Y (map x)) +open AssemblyMorphism + +unquoteDecl AssemblyMorphismIsoΣ = declareRecordIsoΣ AssemblyMorphismIsoΣ (quote AssemblyMorphism) + +module _ {X Y : Type } (xs : Assembly X) (ys : Assembly Y) where - AssemblyMorphismΣ : Type - AssemblyMorphismΣ = Σ[ map (X Y) ] ∃[ t A ] ((x : X) (aₓ : A) (aₓ ⊩X x) (t aₓ) ⊩Y (map x)) where - _⊩X_ = xs ._⊩_ - _⊩Y_ = ys ._⊩_ + AssemblyMorphismΣ : Type + AssemblyMorphismΣ = Σ[ map (X Y) ] ∃[ t A ] ((x : X) (aₓ : A) (aₓ ⊩X x) (t aₓ) ⊩Y (map x)) where + _⊩X_ = xs ._⊩_ + _⊩Y_ = ys ._⊩_ - isSetAssemblyMorphismΣ : isSet AssemblyMorphismΣ - isSetAssemblyMorphismΣ = isSetΣ (isSet→ (ys .isSetX)) map isProp→isSet squash₁) + isSetAssemblyMorphismΣ : isSet AssemblyMorphismΣ + isSetAssemblyMorphismΣ = isSetΣ (isSet→ (ys .isSetX)) map isProp→isSet squash₁) - AssemblyMorphism≡Σ = isoToPath (AssemblyMorphismIsoΣ {as = xs} {bs = ys}) - - isSetAssemblyMorphism : isSet (AssemblyMorphism xs ys) - isSetAssemblyMorphism = subst t isSet t) (sym AssemblyMorphism≡Σ) isSetAssemblyMorphismΣ - -AssemblyMorphismΣ≡ : {X Y : Type } - {xs : Assembly X} - {ys : Assembly Y} - (f g : AssemblyMorphismΣ xs ys) - f .fst g .fst - --------------------------------- - f g -AssemblyMorphismΣ≡ f g = Σ≡Prop λ _ squash₁ - -module _ {X Y : Type } - {xs : Assembly X} - {ys : Assembly Y} - (f g : AssemblyMorphism xs ys) where - -- Necessary to please the constraint solver - theIso = AssemblyMorphismIsoΣ {X} {Y} {as = xs} {bs = ys} - thePath = AssemblyMorphismΣ≡ {X = X} {Y = Y} {xs = xs} {ys = ys} - open Iso - AssemblyMorphism≡ : (f .map g .map) f g - AssemblyMorphism≡ fmap≡gmap i = theIso .inv (thePath (theIso .fun f) (theIso .fun g) (fmap≡gmap) i) - -identityMorphism : {X : Type } (as : Assembly X) AssemblyMorphism as as -identityMorphism as .map x = x -identityMorphism as .tracker = Id , x aₓ aₓ⊩x subst y (as y) x) (sym (Ida≡a aₓ)) aₓ⊩x) ∣₁ - -compositeMorphism : {X Y Z : Type } {xs : Assembly X} {ys : Assembly Y} {zs : Assembly Z} - (f : AssemblyMorphism xs ys) - (g : AssemblyMorphism ys zs) - AssemblyMorphism xs zs -compositeMorphism f g .map x = g .map (f .map x) -compositeMorphism {X} {Y} {Z} {xs} {ys} {zs} f g .tracker = map2 untruncated (f .tracker) (g .tracker) where - open Assembly xs renaming (_⊩_ to _⊩X_) - open Assembly ys renaming (_⊩_ to _⊩Y_) - open Assembly zs renaming (_⊩_ to _⊩Z_) - module _ (fTracker : Σ[ f~ A ] tracks {xs = xs} {ys = ys} f~ (f .map)) - (gTracker : Σ[ g~ A ] tracks {xs = ys} {ys = zs} g~ (g .map)) where - - f~ = fTracker .fst - f~tracks = fTracker .snd - - g~ = gTracker .fst - g~tracks = gTracker .snd - - easierVariant : x aₓ aₓ⊩x (g~ (f~ aₓ)) ⊩Z g .map (f .map x) - easierVariant x aₓ aₓ⊩x = g~tracks (f .map x) (f~ aₓ) (f~tracks x aₓ aₓ⊩x) - - goal : (x : X) (aₓ : A) (aₓ⊩x : aₓ ⊩X x) - (B g~ f~ aₓ) ⊩Z (compositeMorphism f g .map x) - goal x aₓ aₓ⊩x = subst y y ⊩Z g .map (f .map x)) - (sym (Ba≡gfa g~ f~ aₓ)) - (easierVariant x aₓ aₓ⊩x) - - untruncated : Σ[ t A ] - ((x : X) (aₓ : A) - aₓ ⊩X x - (t aₓ) ⊩Z (compositeMorphism f g) .map x) - untruncated = B g~ f~ , goal - -infixl 23 _⊚_ -_⊚_ : {X Y Z : Type } {xs : Assembly X} {ys : Assembly Y} {zs : Assembly Z} - AssemblyMorphism xs ys - AssemblyMorphism ys zs - AssemblyMorphism xs zs -f g = compositeMorphism f g - -module _ {X Y : Type } (xs : Assembly X) (ys : Assembly Y) where - ⊚idL : (f : AssemblyMorphism xs ys) identityMorphism xs f f - ⊚idL f = AssemblyMorphism≡ (identityMorphism xs f) f (funExt λ x refl) - - ⊚idR : (f : AssemblyMorphism ys xs) f identityMorphism xs f - ⊚idR f = AssemblyMorphism≡ (f identityMorphism xs) f (funExt λ x refl) - -module _ {X Y Z W : Type } - (xs : Assembly X) - (ys : Assembly Y) - (zs : Assembly Z) - (ws : Assembly W) - (f : AssemblyMorphism xs ys) - (g : AssemblyMorphism ys zs) - (h : AssemblyMorphism zs ws) where - - ⊚assoc : (f g) h f (g h) - ⊚assoc = AssemblyMorphism≡ ((f g) h) (f (g h)) (∘-assoc (h .map) (g .map) (f .map)) - -open Category + AssemblyMorphism≡Σ = isoToPath (AssemblyMorphismIsoΣ {as = xs} {bs = ys}) + + isSetAssemblyMorphism : isSet (AssemblyMorphism xs ys) + isSetAssemblyMorphism = subst t isSet t) (sym AssemblyMorphism≡Σ) isSetAssemblyMorphismΣ + +AssemblyMorphism≡Equiv : {X Y : Type } {xs : Assembly X} {ys : Assembly Y} (f g : AssemblyMorphismΣ xs ys) (f .fst g .fst) (f g) +AssemblyMorphism≡Equiv {X} {Y} {xs} {ys} f g = Σ≡PropEquiv λ _ isPropPropTrunc + +AssemblyMorphismΣ≡ : {X Y : Type } + {xs : Assembly X} + {ys : Assembly Y} + (f g : AssemblyMorphismΣ xs ys) + f .fst g .fst + --------------------------------- + f g +AssemblyMorphismΣ≡ f g = Σ≡Prop λ _ squash₁ + +module _ {X Y : Type } + {xs : Assembly X} + {ys : Assembly Y} + (f g : AssemblyMorphism xs ys) where + -- Necessary to please the constraint solver + theIso = AssemblyMorphismIsoΣ {X} {Y} {as = xs} {bs = ys} + thePath = AssemblyMorphismΣ≡ {X = X} {Y = Y} {xs = xs} {ys = ys} + open Iso + AssemblyMorphism≡ : (f .map g .map) f g + map (AssemblyMorphism≡ fmap≡gmap i) x = fmap≡gmap i x + tracker (AssemblyMorphism≡ fmap≡gmap i) = + isProp→PathP + i isPropPropTrunc {A = Σ[ t A ] (∀ x aₓ aₓ ⊩[ xs ] x (t aₓ) ⊩[ ys ] (fmap≡gmap i x))}) + (f .tracker) (g .tracker) i + +identityMorphism : {X : Type } (as : Assembly X) AssemblyMorphism as as +identityMorphism as .map x = x +identityMorphism as .tracker = Id , x aₓ aₓ⊩x subst y (as y) x) (sym (Ida≡a aₓ)) aₓ⊩x) ∣₁ + +compositeMorphism : {X Y Z : Type } {xs : Assembly X} {ys : Assembly Y} {zs : Assembly Z} + (f : AssemblyMorphism xs ys) + (g : AssemblyMorphism ys zs) + AssemblyMorphism xs zs +compositeMorphism f g .map x = g .map (f .map x) +compositeMorphism {X} {Y} {Z} {xs} {ys} {zs} f g .tracker = + do + (f~ , isTrackedF) f .tracker + (g~ , isTrackedG) g .tracker + let + realizer : Term as 1 + realizer = ` g~ ̇ (` f~ ̇ # zero) + return + (λ* realizer , + x aₓ aₓ⊩x subst r' r' ⊩[ zs ] (g .map (f .map x))) (sym (λ*ComputationRule realizer aₓ)) (isTrackedG (f .map x) (f~ aₓ) (isTrackedF x aₓ aₓ⊩x)))) + +infixl 23 _⊚_ +_⊚_ : {X Y Z : Type } {xs : Assembly X} {ys : Assembly Y} {zs : Assembly Z} + AssemblyMorphism xs ys + AssemblyMorphism ys zs + AssemblyMorphism xs zs +f g = compositeMorphism f g + +module _ {X Y : Type } (xs : Assembly X) (ys : Assembly Y) where + ⊚idL : (f : AssemblyMorphism xs ys) identityMorphism xs f f + ⊚idL f = AssemblyMorphism≡ (identityMorphism xs f) f (funExt λ x refl) + + ⊚idR : (f : AssemblyMorphism ys xs) f identityMorphism xs f + ⊚idR f = AssemblyMorphism≡ (f identityMorphism xs) f (funExt λ x refl) + +module _ {X Y Z W : Type } + (xs : Assembly X) + (ys : Assembly Y) + (zs : Assembly Z) + (ws : Assembly W) + (f : AssemblyMorphism xs ys) + (g : AssemblyMorphism ys zs) + (h : AssemblyMorphism zs ws) where + + ⊚assoc : (f g) h f (g h) + ⊚assoc = AssemblyMorphism≡ ((f g) h) (f (g h)) (∘-assoc (h .map) (g .map) (f .map)) + +open Category -ASM : Category (ℓ-suc ) -ASM .ob = Σ[ X Type ] Assembly X -ASM .Hom[_,_] x y = AssemblyMorphism (x .snd) (y .snd) -ASM .id {x} = identityMorphism (x .snd) -ASM ._⋆_ f g = f g -ASM .⋆IdL {x} {y} f = ⊚idL (x .snd) (y .snd) f -ASM .⋆IdR {x} {y} f = ⊚idR (y .snd) (x .snd) f -ASM .⋆Assoc {x} {y} {z} {w} f g h = ⊚assoc (x .snd) (y .snd) (z .snd) (w .snd) f g h -ASM .isSetHom {x} {y} f g = isSetAssemblyMorphism (x .snd) (y .snd) f g - -open AssemblyMorphism public +ASM : Category (ℓ-suc ) +ASM .ob = Σ[ X Type ] Assembly X +ASM .Hom[_,_] x y = AssemblyMorphism (x .snd) (y .snd) +ASM .id {x} = identityMorphism (x .snd) +ASM ._⋆_ f g = f g +ASM .⋆IdL {x} {y} f = ⊚idL (x .snd) (y .snd) f +ASM .⋆IdR {x} {y} f = ⊚idR (y .snd) (x .snd) f +ASM .⋆Assoc {x} {y} {z} {w} f g h = ⊚assoc (x .snd) (y .snd) (z .snd) (w .snd) f g h +ASM .isSetHom {x} {y} f g = isSetAssemblyMorphism (x .snd) (y .snd) f g + +open AssemblyMorphism public \ No newline at end of file diff --git a/docs/Realizability.Assembly.SIP.html b/docs/Realizability.Assembly.SIP.html new file mode 100644 index 0000000..8b3edc0 --- /dev/null +++ b/docs/Realizability.Assembly.SIP.html @@ -0,0 +1,35 @@ + +Realizability.Assembly.SIP
open import Cubical.Foundations.Prelude
+open import Cubical.Foundations.Structure
+open import Cubical.Foundations.Equiv
+open import Cubical.Foundations.HLevels
+open import Cubical.Foundations.Univalence
+open import Cubical.Foundations.Isomorphism
+open import Cubical.Functions.FunExtEquiv
+open import Cubical.Data.Sigma
+open import Cubical.HITs.PropositionalTruncation
+open import Realizability.CombinatoryAlgebra
+
+module Realizability.Assembly.SIP {} {A : Type } (ca : CombinatoryAlgebra A) where
+open CombinatoryAlgebra ca
+open Realizability.CombinatoryAlgebra.Combinators ca renaming (i to Id; ia≡a to Ida≡a)
+open import Realizability.Assembly.Base ca
+open import Realizability.Assembly.Morphism ca
+
+module _ {X : Type } where
+
+  Assembly≡Iso :  (asmA asmB : Assembly X)  Iso (asmA  asmB) (∀ r x  r ⊩[ asmA ] x  r ⊩[ asmB ] x)
+  Iso.fun (Assembly≡Iso asmA asmB) path r x i = r ⊩[ path i ] x
+  Assembly._⊩_ (Iso.inv (Assembly≡Iso asmA asmB) pointwisePath i) r x = pointwisePath r x i
+  Assembly.isSetX (Iso.inv (Assembly≡Iso asmA asmB) pointwisePath i) = isPropIsSet {A = X} (asmA .isSetX) (asmB .isSetX) i
+  Assembly.⊩isPropValued (Iso.inv (Assembly≡Iso asmA asmB) pointwisePath i) r x = isProp→PathP {B = λ j  isProp (pointwisePath r x j)}  j  isPropIsProp) (asmA .⊩isPropValued r x) (asmB .⊩isPropValued r x) i
+  Assembly.⊩surjective (Iso.inv (Assembly≡Iso asmA asmB) pointwisePath i) x = isProp→PathP {B = λ j  ∃[ a  A ] (pointwisePath a x j)}  j  isPropPropTrunc) (asmA .⊩surjective x) (asmB .⊩surjective x) i
+  Iso.rightInv (Assembly≡Iso asmA asmB) pointwise = funExt₂ λ r x  refl
+  Iso.leftInv (Assembly≡Iso asmA asmB) path = isSetAssembly X asmA asmB _ _
+
+  Assembly≡Equiv :  (asmA asmB : Assembly X)  (asmA  asmB)  (∀ r x  r ⊩[ asmA ] x  r ⊩[ asmB ] x)
+  Assembly≡Equiv asmA asmB = isoToEquiv (Assembly≡Iso asmA asmB)
+
+  Assembly≡ :  (asmA asmB : Assembly X)  (∀ r x  r ⊩[ asmA ] x  r ⊩[ asmB ] x)  (asmA  asmB)
+  Assembly≡ asmA asmB pointwise = Iso.inv (Assembly≡Iso asmA asmB) pointwise
+
\ No newline at end of file diff --git a/docs/Realizability.Assembly.SetsReflectiveSubcategory.html b/docs/Realizability.Assembly.SetsReflectiveSubcategory.html new file mode 100644 index 0000000..cf7c6ea --- /dev/null +++ b/docs/Realizability.Assembly.SetsReflectiveSubcategory.html @@ -0,0 +1,64 @@ + +Realizability.Assembly.SetsReflectiveSubcategory
open import Cubical.Foundations.Prelude
+open import Cubical.Foundations.HLevels
+open import Cubical.Foundations.Isomorphism
+open import Cubical.Foundations.Function
+open import Cubical.Foundations.Equiv
+open import Cubical.Data.Sigma
+open import Cubical.Data.FinData
+open import Cubical.Data.Unit
+open import Cubical.HITs.PropositionalTruncation hiding (map)
+open import Cubical.HITs.PropositionalTruncation.Monad
+open import Cubical.Reflection.RecordEquiv
+open import Cubical.Categories.Category
+open import Cubical.Categories.Functor
+open import Cubical.Categories.Instances.Sets
+open import Cubical.Categories.Adjoint
+open import Cubical.Categories.NaturalTransformation
+open import Realizability.CombinatoryAlgebra
+open import Realizability.ApplicativeStructure
+
+module Realizability.Assembly.SetsReflectiveSubcategory {} {A : Type } (ca : CombinatoryAlgebra A) where
+
+open import Realizability.Assembly.Base ca
+open import Realizability.Assembly.Morphism ca
+
+open Assembly
+open CombinatoryAlgebra ca
+open Realizability.CombinatoryAlgebra.Combinators ca renaming (i to Id; ia≡a to Ida≡a)
+
+forgetfulFunctor : Functor ASM (SET )
+Functor.F-ob forgetfulFunctor (X , asmX) = X , asmX .isSetX
+Functor.F-hom forgetfulFunctor {X , asmX} {Y , asmY} f = f .map
+Functor.F-id forgetfulFunctor = refl
+Functor.F-seq forgetfulFunctor {X , asmX} {Y , asmY} {Z , asmZ} f g = refl
+
+ : Functor (SET ) ASM
+Functor.F-ob  (X , isSetX) = X , makeAssembly  a x  Unit*) isSetX  _ _  isPropUnit*) λ x   k , tt* ∣₁
+Functor.F-hom  {X , isSetX} {Y , isSetY} f = makeAssemblyMorphism f (return (k ,  _ _ _  tt*)))
+Functor.F-id  {X , isSetX} = AssemblyMorphism≡ _ _ refl
+Functor.F-seq  {X , isSetX} {Y , isSetY} {Z , isSetZ} f g = AssemblyMorphism≡ _ _ refl
+
+module _ where
+  open UnitCounit
+
+  adjointUnitCounit : forgetfulFunctor  
+  NatTrans.N-ob (_⊣_.η adjointUnitCounit) (X , asmX) = makeAssemblyMorphism  x  x) (return (k ,  _ _ _  tt*)))
+  NatTrans.N-hom (_⊣_.η adjointUnitCounit) {X , asmX} {Y , asmY} f = AssemblyMorphism≡ _ _ refl
+  NatTrans.N-ob (_⊣_.ε adjointUnitCounit) (X , isSetX) x = x
+  NatTrans.N-hom (_⊣_.ε adjointUnitCounit) {X , isSetX} {Y , isSetY} f = refl
+  TriangleIdentities.Δ₁ (_⊣_.triangleIdentities adjointUnitCounit) (X , asmX) = refl
+  TriangleIdentities.Δ₂ (_⊣_.triangleIdentities adjointUnitCounit) (X , isSetX) = AssemblyMorphism≡ _ _ refl
+
+module _ where
+  open NaturalBijection
+
+  adjointNaturalBijection : forgetfulFunctor  
+  Iso.fun (_⊣_.adjIso adjointNaturalBijection) f = makeAssemblyMorphism f (return (k ,  x r r⊩x  tt*)))
+  Iso.inv (_⊣_.adjIso adjointNaturalBijection) f = f .map
+  Iso.rightInv (_⊣_.adjIso adjointNaturalBijection) b = AssemblyMorphism≡ _ _ refl
+  Iso.leftInv (_⊣_.adjIso adjointNaturalBijection) a = refl
+  _⊣_.adjNatInD adjointNaturalBijection {X , isSetX} {Y , isSetY} f g = AssemblyMorphism≡ _ _ refl
+  _⊣_.adjNatInC adjointNaturalBijection {X , asmX} {Y , asmY} f g = refl
+
+
\ No newline at end of file diff --git a/docs/Realizability.Assembly.Terminal.html b/docs/Realizability.Assembly.Terminal.html new file mode 100644 index 0000000..b696816 --- /dev/null +++ b/docs/Realizability.Assembly.Terminal.html @@ -0,0 +1,51 @@ + +Realizability.Assembly.Terminal
open import Cubical.Foundations.Prelude
+open import Cubical.Foundations.HLevels
+open import Cubical.Data.Sigma
+open import Cubical.Data.FinData
+open import Cubical.Data.Unit
+open import Cubical.HITs.PropositionalTruncation hiding (map)
+open import Cubical.HITs.PropositionalTruncation.Monad
+open import Cubical.Categories.Limits.Terminal
+open import Realizability.CombinatoryAlgebra
+open import Realizability.ApplicativeStructure
+
+module Realizability.Assembly.Terminal {} {A : Type } (ca : CombinatoryAlgebra A)  where
+
+open Realizability.CombinatoryAlgebra.Combinators ca renaming (i to Id; ia≡a to Ida≡a)
+open import Realizability.Assembly.Base ca
+open import Realizability.Assembly.Morphism ca
+open CombinatoryAlgebra ca
+open Assembly
+open AssemblyMorphism
+
+terminalAsm : Assembly Unit*
+(Assembly._⊩_ terminalAsm) a tt* = Unit*
+Assembly.isSetX terminalAsm = isSetUnit*
+(Assembly.⊩isPropValued terminalAsm) a tt* = isPropUnit*
+Assembly.⊩surjective terminalAsm tt* =  k , tt* ∣₁
+
+isTerminalTerminalAsm : isTerminal ASM (Unit* , terminalAsm)
+isTerminalTerminalAsm (X , asmX) =
+  inhProp→isContr
+    (makeAssemblyMorphism
+       x  tt*)
+      (return
+        (k ,  x r r⊩x  tt*))))
+     f g 
+      AssemblyMorphism≡ _ _ (funExt λ x  refl))
+
+TerminalASM : Terminal ASM
+fst TerminalASM = Unit* , terminalAsm
+snd TerminalASM = isTerminalTerminalAsm
+
+-- global element
+module _ {X : Type } (asmX : Assembly X) (x : X) (r : A) (r⊩x : r ⊩[ asmX ] x) where
+
+  globalElement : AssemblyMorphism terminalAsm asmX
+  AssemblyMorphism.map globalElement tt* = x
+  AssemblyMorphism.tracker globalElement =
+    return
+      ((k  r) ,
+       { tt* a tt*  subst  r'  r' ⊩[ asmX ] x) (sym (kab≡a _ _)) r⊩x }))
+
\ No newline at end of file diff --git a/docs/Realizability.CombinatoryAlgebra.html b/docs/Realizability.CombinatoryAlgebra.html index 1cb4a61..df9b188 100644 --- a/docs/Realizability.CombinatoryAlgebra.html +++ b/docs/Realizability.CombinatoryAlgebra.html @@ -12,63 +12,63 @@ record CombinatoryAlgebra {} (A : Type ) : Type where field - as : ApplicativeStructure A - fefermanStructure : Feferman as - open Feferman fefermanStructure public - open ApplicativeStructure as public - open ComputationRules as fefermanStructure public + as : ApplicativeStructure A + fefermanStructure : Feferman as + open Feferman fefermanStructure public + open ApplicativeStructure as public + open ComputationRules as fefermanStructure public module Combinators {} {A : Type } (ca : CombinatoryAlgebra A) where open CombinatoryAlgebra ca i : A - i = s k k + i = s k k k' : A - k' = k i + k' = k i - ia≡a : a i a a - ia≡a a = (cong x x a) refl) (sabc≡ac_bc k k a) (kab≡a a (k a)) + ia≡a : a i a a + ia≡a a = (cong x x a) refl) (sabc≡ac_bc k k a) (kab≡a a (k a)) - k'ab≡b : a b k' a b b - k'ab≡b a b = k' a b + k'ab≡b : a b k' a b b + k'ab≡b a b = k' a b ≡⟨ refl - (k i a b) - ≡⟨ cong x x b) (kab≡a i a) - (i b) + (k i a b) + ≡⟨ cong x x b) (kab≡a i a) + (i b) ≡⟨ ia≡a b b true : A - true = k + true = k false : A false = k' if_then_else_ : c t e A - if c then t else e = i c t e + if c then t else e = i c t e ifTrueThen : t e if true then t else e t ifTrueThen t e = if true then t else e ≡⟨ refl - i true t e - ≡⟨ cong x i x t e) refl - i k t e - ≡⟨ cong x x t e) (ia≡a k) - k t e - ≡⟨ kab≡a t e + i true t e + ≡⟨ cong x i x t e) refl + i k t e + ≡⟨ cong x x t e) (ia≡a k) + k t e + ≡⟨ kab≡a t e t ifFalseElse : t e if false then t else e e ifFalseElse t e = if false then t else e ≡⟨ refl - i false t e - ≡⟨ cong x i x t e) refl - i k' t e - ≡⟨ cong x x t e) (ia≡a k') - k' t e + i false t e + ≡⟨ cong x i x t e) refl + i k' t e + ≡⟨ cong x x t e) (ia≡a k') + k' t e ≡⟨ k'ab≡b t e e @@ -76,124 +76,124 @@ -- I used a Scheme script to generate this opaque pair : A - pair = s (s (k (s)) (s (s (k (s)) (s (k (k)) (k (s)))) - (s (s (k (s)) (s (s (k (s)) (s (k (k)) (k (s)))) - (s (s (k (s)) (s (s (k (s)) (s (k (k)) (k (s)))) - (s (k (k)) (k (k))))) (s (k (k)) (k (k)))))) (s - (s (k (s)) (s (k (k)) (k (k)))) (s (k (k)) (s (k) (k))))))) - (s (s (k (s)) (s (k (k)) (k (k)))) (s (s (k (s)) (k (k))) (k (k)))) + pair = s (s (k (s)) (s (s (k (s)) (s (k (k)) (k (s)))) + (s (s (k (s)) (s (s (k (s)) (s (k (k)) (k (s)))) + (s (s (k (s)) (s (s (k (s)) (s (k (k)) (k (s)))) + (s (k (k)) (k (k))))) (s (k (k)) (k (k)))))) (s + (s (k (s)) (s (k (k)) (k (k)))) (s (k (k)) (s (k) (k))))))) + (s (s (k (s)) (s (k (k)) (k (k)))) (s (s (k (s)) (k (k))) (k (k)))) opaque pr₁ : A - pr₁ = s (s k k) (k k) + pr₁ = s (s k k) (k k) pr₂ : A - pr₂ = s (s k k) (k k') + pr₂ = s (s k k) (k k') -- TODO : Prove computation rules - postulate pr₁pxy≡x : x y pr₁ (pair x y) x - postulate pr₂pxy≡y : x y pr₂ (pair x y) y + postulate pr₁pxy≡x : x y pr₁ (pair x y) x + postulate pr₂pxy≡y : x y pr₂ (pair x y) y -- Curry numbers ℕ→curry : A ℕ→curry zero = i - ℕ→curry (suc n) = pair k' (ℕ→curry n) + ℕ→curry (suc n) = pair k' (ℕ→curry n) Z : A Z = pr₁ opaque unfolding pr₁ - Zzero≡true : Z (ℕ→curry zero) true - Zzero≡true = Z (ℕ→curry zero) - ≡⟨ cong x Z x) refl - Z i - ≡⟨ cong x x i) refl - s (s k k) (k k) i - ≡⟨ sabc≡ac_bc (s k k) (k k) i - ((s k k) i) (k k i) - ≡⟨ cong x (x i) (k k i)) refl - (i i) (k k i) - ≡⟨ cong x x (k k i)) (ia≡a i) - i (k k i) - ≡⟨ cong x i x) (kab≡a k i) - i k - ≡⟨ ia≡a k - k + Zzero≡true : Z (ℕ→curry zero) true + Zzero≡true = Z (ℕ→curry zero) + ≡⟨ cong x Z x) refl + Z i + ≡⟨ cong x x i) refl + s (s k k) (k k) i + ≡⟨ sabc≡ac_bc (s k k) (k k) i + ((s k k) i) (k k i) + ≡⟨ cong x (x i) (k k i)) refl + (i i) (k k i) + ≡⟨ cong x x (k k i)) (ia≡a i) + i (k k i) + ≡⟨ cong x i x) (kab≡a k i) + i k + ≡⟨ ia≡a k + k - Zsuc≡false : n Z (ℕ→curry (suc n)) false - Zsuc≡false n = Z (ℕ→curry (suc n)) - ≡⟨ cong x Z x) refl - Z (pair k' (ℕ→curry n)) - ≡⟨ cong x x (pair k' (ℕ→curry n))) refl - pr₁ (pair k' (ℕ→curry n)) + Zsuc≡false : n Z (ℕ→curry (suc n)) false + Zsuc≡false n = Z (ℕ→curry (suc n)) + ≡⟨ cong x Z x) refl + Z (pair k' (ℕ→curry n)) + ≡⟨ cong x x (pair k' (ℕ→curry n))) refl + pr₁ (pair k' (ℕ→curry n)) ≡⟨ pr₁pxy≡x k' (ℕ→curry n) false S : A - S = pair k' + S = pair k' - Sn≡sucn : n S (ℕ→curry n) ℕ→curry (suc n) - Sn≡sucn n = S (ℕ→curry n) - ≡⟨ cong x x (ℕ→curry n)) refl - pair k' (ℕ→curry n) + Sn≡sucn : n S (ℕ→curry n) ℕ→curry (suc n) + Sn≡sucn n = S (ℕ→curry n) + ≡⟨ cong x x (ℕ→curry n)) refl + pair k' (ℕ→curry n) P : A - P = s (s (s (k pr₁) i) (k (ℕ→curry zero))) (s (k (pr₂)) i) + P = s (s (s (k pr₁) i) (k (ℕ→curry zero))) (s (k (pr₂)) i) - postulate Pzero≡zero : P (ℕ→curry zero) ℕ→curry zero - postulate Psucn≡n : n P (ℕ→curry (suc n)) ℕ→curry n + postulate Pzero≡zero : P (ℕ→curry zero) ℕ→curry zero + postulate Psucn≡n : n P (ℕ→curry (suc n)) ℕ→curry n B : g f A - B g f = s (k g) (s (k f) i) + B g f = s (k g) (s (k f) i) - Ba≡gfa : g f a B g f a g (f a) + Ba≡gfa : g f a B g f a g (f a) Ba≡gfa g f a = - s (k g) (s (k f) i) a - ≡⟨ sabc≡ac_bc (k g) (s (k f) i) a - (k g a) (s (k f) i a) - ≡⟨ cong x x (s (k f) i a)) (kab≡a g a) - g (s (k f) i a) - ≡⟨ cong x g x) (sabc≡ac_bc (k f) i a) - g ((k f a) (i a)) - ≡⟨ cong x g (x (i a))) (kab≡a f a) - g (f (i a)) - ≡⟨ cong x g (f x)) (ia≡a a) - g (f a) + s (k g) (s (k f) i) a + ≡⟨ sabc≡ac_bc (k g) (s (k f) i) a + (k g a) (s (k f) i a) + ≡⟨ cong x x (s (k f) i a)) (kab≡a g a) + g (s (k f) i a) + ≡⟨ cong x g x) (sabc≡ac_bc (k f) i a) + g ((k f a) (i a)) + ≡⟨ cong x g (x (i a))) (kab≡a f a) + g (f (i a)) + ≡⟨ cong x g (f x)) (ia≡a a) + g (f a) module Trivial {} {A : Type } (ca : CombinatoryAlgebra A) where open CombinatoryAlgebra ca open Combinators ca - module _ (isNonTrivial : s k ) where + module _ (isNonTrivial : s k ) where - k≠k' : k k' + k≠k' : k k' k≠k' k≡k' = isNonTrivial s≡k where - cond = if true then s else k - cond' = if false then s else k + cond = if true then s else k + cond' = if false then s else k condEq : cond cond' - condEq = cong x if x then s else k) k≡k' + condEq = cong x if x then s else k) k≡k' - cond≡s : cond s + cond≡s : cond s cond≡s = ifTrueThen _ _ - cond'≡k : cond' k + cond'≡k : cond' k cond'≡k = ifFalseElse _ _ - cond≡k : cond k - cond≡k = subst x x k) (sym condEq) cond'≡k + cond≡k : cond k + cond≡k = subst x x k) (sym condEq) cond'≡k - s≡k : s k + s≡k : s k s≡k = - s + s ≡⟨ sym cond≡s cond ≡⟨ cond≡k - k + k diff --git a/docs/Realizability.Modest.Base.html b/docs/Realizability.Modest.Base.html new file mode 100644 index 0000000..4065995 --- /dev/null +++ b/docs/Realizability.Modest.Base.html @@ -0,0 +1,87 @@ + +Realizability.Modest.Base
open import Cubical.Foundations.Prelude
+open import Cubical.Foundations.HLevels
+open import Cubical.Foundations.Isomorphism
+open import Cubical.Foundations.Function
+open import Cubical.Foundations.Equiv
+open import Cubical.Foundations.Powerset
+open import Cubical.Foundations.Structure using (⟨_⟩; str)
+open import Cubical.Data.Sigma
+open import Cubical.Data.FinData
+open import Cubical.HITs.PropositionalTruncation hiding (map)
+open import Cubical.HITs.PropositionalTruncation.Monad
+open import Cubical.Reflection.RecordEquiv
+open import Cubical.Categories.Category
+open import Realizability.CombinatoryAlgebra
+open import Realizability.ApplicativeStructure
+open import Realizability.PropResizing
+
+module Realizability.Modest.Base {} {A : Type } (ca : CombinatoryAlgebra A)  where
+
+open import Realizability.Assembly.Base ca
+open import Realizability.Assembly.Morphism ca
+
+open Assembly
+open CombinatoryAlgebra ca
+open Realizability.CombinatoryAlgebra.Combinators ca renaming (i to Id; ia≡a to Ida≡a)
+
+module _ {X : Type } (asmX : Assembly X) where
+
+  isModest : Type _
+  isModest =  (x y : X) (a : A)  a ⊩[ asmX ] x  a ⊩[ asmX ] y  x  y
+
+  isPropIsModest : isProp isModest
+  isPropIsModest = isPropΠ3 λ x y a  isProp→ (isProp→ (asmX .isSetX x y))
+
+  isUniqueRealized : isModest   (a : A)  isProp (Σ[ x  X ] (a ⊩[ asmX ] x))
+  isUniqueRealized isMod a (x , a⊩x) (y , a⊩y) = Σ≡Prop  x'  asmX .⊩isPropValued a x') (isMod x y a a⊩x a⊩y)
+
+ModestSet : Type   Type (ℓ-suc )
+ModestSet X = Σ[ xs  Assembly X ] isModest xs
+
+MOD : Category (ℓ-suc ) 
+Category.ob MOD = Σ[ X  Type  ] Σ[ asmX  Assembly X ] isModest asmX
+Category.Hom[_,_] MOD (X , asmX , isModestAsmX) (Y , asmY , isModestAsmY) = AssemblyMorphism asmX asmY
+Category.id MOD {X , asmX , isModestAsmX} = identityMorphism asmX
+Category._⋆_ MOD {X , asmX , isModestAsmX} {Y , asmY , isModestAsmY} {Z , asmZ , isModestAsmZ} f g = compositeMorphism f g
+Category.⋆IdL MOD {X , asmX , isModestAsmX} {Y , asmY , isModestAsmY} f = ⊚idL asmX asmY f
+Category.⋆IdR MOD {X , asmX , isModestAsmX} {Y , asmY , isModestAsmY} f = ⊚idR asmY asmX f
+Category.⋆Assoc MOD {X , asmX , isModestAsmX} {Y , asmY , isModestAsmY} {Z , asmZ , isModestAsmZ} {W , asmW , isModestAsmW} f g h = ⊚assoc asmX asmY asmZ asmW f g h
+Category.isSetHom MOD {X , asmX , idModestAsmX} {Y , asmY , isModestAsmY} = isSetAssemblyMorphism asmX asmY
+
+-- Every modest set is isomorphic to a canonically modest set
+module Canonical (X : Type ) (asmX : Assembly X) (isModestAsmX : isModest asmX) (resizing : hPropResizing ) where
+  open ResizedPowerset resizing
+  -- Replace every term of X by it's set of realisers
+  realisersOf : X   A
+  realisersOf x a = (a ⊩[ asmX ] x) , (asmX .⊩isPropValued a x)
+
+  resizedRealisersOf : X  𝓟 A
+  resizedRealisersOf x = ℙ→𝓟 A (realisersOf x)
+
+  realiserSet : Type 
+  realiserSet = Σ[ P  𝓟 A ] ∃[ x  X ] P  resizedRealisersOf x
+
+  canonicalModestSet : Assembly realiserSet
+  Assembly._⊩_ canonicalModestSet r (P , ∃x) = r ϵ P
+  Assembly.isSetX canonicalModestSet = isSetΣ (isSet𝓟 A)  P  isProp→isSet isPropPropTrunc)
+  Assembly.⊩isPropValued canonicalModestSet r (P , ∃x) = isPropϵ r P
+  Assembly.⊩surjective canonicalModestSet (P , ∃x) =
+    do
+      (x , P≡⊩x)  ∃x
+      (a , a⊩x)  asmX .⊩surjective x
+      return
+        (a ,
+        (subst
+           P  a ϵ P)
+          (sym P≡⊩x)
+          (subst  P  a  P) (sym (compIsIdFunc (realisersOf x))) a⊩x)))
+  {-
+  isModestCanonicalModestSet : isModest canonicalModestSet
+  isModestCanonicalModestSet x y a a⊩x a⊩y =
+    Σ≡Prop
+      (λ _ → isPropPropTrunc)
+      (𝓟≡ (x .fst) (y .fst) (⊆-extensionality (𝓟→ℙ A (x .fst)) (𝓟→ℙ A (y .fst)) ((λ b b⊩x → {!!}) , {!!}))) -}
+   
+  
+
\ No newline at end of file diff --git a/docs/Realizability.Modest.CanonicalPER.html b/docs/Realizability.Modest.CanonicalPER.html new file mode 100644 index 0000000..309af56 --- /dev/null +++ b/docs/Realizability.Modest.CanonicalPER.html @@ -0,0 +1,62 @@ + +Realizability.Modest.CanonicalPER
open import Cubical.Foundations.Prelude
+open import Cubical.Foundations.HLevels
+open import Cubical.Foundations.Isomorphism
+open import Cubical.Foundations.Function
+open import Cubical.Foundations.Equiv
+open import Cubical.Foundations.Powerset
+open import Cubical.Foundations.Path
+open import Cubical.Foundations.Structure using (⟨_⟩; str)
+open import Cubical.Data.Sigma
+open import Cubical.Data.FinData
+open import Cubical.Data.Unit
+open import Cubical.HITs.PropositionalTruncation as PT hiding (map)
+open import Cubical.HITs.PropositionalTruncation.Monad
+open import Cubical.Reflection.RecordEquiv
+open import Cubical.Categories.Category
+open import Cubical.Categories.Displayed.Base
+open import Cubical.Categories.Displayed.Reasoning
+open import Cubical.Categories.Limits.Pullback
+open import Cubical.Categories.Functor hiding (Id)
+open import Cubical.Categories.Constructions.Slice
+open import Categories.CartesianMorphism
+open import Categories.GenericObject
+open import Realizability.CombinatoryAlgebra
+open import Realizability.ApplicativeStructure
+open import Realizability.PropResizing
+
+module Realizability.Modest.CanonicalPER {} {A : Type } (ca : CombinatoryAlgebra A) where
+
+open import Realizability.Assembly.Base ca
+open import Realizability.Assembly.Morphism ca
+open import Realizability.Assembly.Terminal ca
+open import Realizability.Assembly.SetsReflectiveSubcategory ca
+open import Realizability.Modest.Base ca
+open import Realizability.Modest.UniformFamily ca
+open import Realizability.PERs.PER ca
+open import Realizability.PERs.SubQuotient ca
+
+open Assembly
+open CombinatoryAlgebra ca
+open Realizability.CombinatoryAlgebra.Combinators ca renaming (i to Id; ia≡a to Ida≡a)
+open Contravariant UNIMOD
+open UniformFamily
+open DisplayedUFamMap
+
+module _
+  {X : Type }
+  (asmX : Assembly X)
+  (isModestAsmX : isModest asmX) where
+
+  canonicalPER : PER
+  PER.relation canonicalPER a b = Σ[ x  X ] a ⊩[ asmX ] x × b ⊩[ asmX ] x
+  PER.isPropValued canonicalPER a b (x , a⊩x , b⊩x) (x' , a⊩x' , b⊩x') =
+    Σ≡Prop
+       x  isProp× (asmX .⊩isPropValued a x) (asmX .⊩isPropValued b x))
+      (isModestAsmX x x' a a⊩x a⊩x')
+  fst (PER.isPER canonicalPER) a b (x , a⊩x , b⊩x) = x , b⊩x , a⊩x
+  snd (PER.isPER canonicalPER) a b c (x , a⊩x , b⊩x) (x' , b⊩x' , c⊩x') =
+    x' , subst (a ⊩[ asmX ]_) (isModestAsmX x x' b b⊩x b⊩x') a⊩x , c⊩x'
+    
+  
+
\ No newline at end of file diff --git a/docs/Realizability.Modest.Everything.html b/docs/Realizability.Modest.Everything.html new file mode 100644 index 0000000..301899e --- /dev/null +++ b/docs/Realizability.Modest.Everything.html @@ -0,0 +1,11 @@ + +Realizability.Modest.Everything
module Realizability.Modest.Everything where
+
+open import Realizability.Modest.Base
+open import Realizability.Modest.CanonicalPER
+open import Realizability.Modest.UniformFamily
+open import Realizability.Modest.UniformFamilyCleavage
+open import Realizability.Modest.PartialSurjection
+-- open import Realizability.Modest.GenericUniformFamily
+open import Realizability.Modest.SubQuotientCanonicalPERIso
+
\ No newline at end of file diff --git a/docs/Realizability.Modest.PartialSurjection.html b/docs/Realizability.Modest.PartialSurjection.html new file mode 100644 index 0000000..1eb27cb --- /dev/null +++ b/docs/Realizability.Modest.PartialSurjection.html @@ -0,0 +1,390 @@ + +Realizability.Modest.PartialSurjection
open import Cubical.Foundations.Prelude
+open import Cubical.Foundations.HLevels
+open import Cubical.Foundations.Isomorphism
+open import Cubical.Foundations.Function
+open import Cubical.Foundations.Equiv
+open import Cubical.Foundations.Powerset
+open import Cubical.Foundations.Structure using (⟨_⟩; str)
+open import Cubical.Foundations.Univalence
+open import Cubical.Functions.Surjection
+open import Cubical.Functions.FunExtEquiv
+open import Cubical.Data.Sigma
+open import Cubical.Data.FinData
+open import Cubical.HITs.PropositionalTruncation as PT hiding (map)
+open import Cubical.HITs.PropositionalTruncation.Monad
+open import Cubical.Reflection.RecordEquiv
+open import Cubical.Categories.Category
+open import Cubical.Categories.Functor.Base hiding (Id)
+open import Realizability.CombinatoryAlgebra
+open import Realizability.ApplicativeStructure
+open import Realizability.PropResizing
+
+module Realizability.Modest.PartialSurjection {} {A : Type } (ca : CombinatoryAlgebra A) (resizing : hPropResizing ) where
+
+open import Realizability.Assembly.Base ca
+open import Realizability.Assembly.Morphism ca
+open import Realizability.Assembly.SIP ca
+open import Realizability.Modest.Base ca
+
+open Assembly
+open CombinatoryAlgebra ca
+open Realizability.CombinatoryAlgebra.Combinators ca renaming (i to Id; ia≡a to Ida≡a)
+open ResizedPowerset resizing
+
+record PartialSurjection (X : Type ) : Type (ℓ-suc ) where
+  no-eta-equality
+  constructor makePartialSurjection
+  field
+    support : A  Type 
+    enumeration : Σ[ a  A ] (support a)  X
+    isPropSupport :  a  isProp (support a)
+    isSurjectionEnumeration : isSurjection enumeration
+    isSetX : isSet X -- potentially redundant?
+open PartialSurjection
+
+module _ (X : Type ) (isCorrectHLevel : isSet X) where
+  -- first we need a Σ type equivalent to partial surjections
+  -- we could use RecordEquiv but this does not give hProps and hSets and
+  -- that causes problems when trying to compute the hlevel
+
+  PartialSurjectionΣ : Type (ℓ-suc )
+  PartialSurjectionΣ = Σ[ support  (A  hProp ) ] Σ[ enumeration  ((Σ[ a  A ]  support a )  X) ] isSurjection enumeration × isSet X
+
+  isSetPartialSurjectionΣ : isSet PartialSurjectionΣ
+  isSetPartialSurjectionΣ = isSetΣ (isSet→ isSetHProp)  support  isSetΣ (isSet→ isCorrectHLevel)  enum  isSet× (isProp→isSet isPropIsSurjection) (isProp→isSet isPropIsSet)))
+
+  PartialSurjectionIsoΣ : Iso (PartialSurjection X) PartialSurjectionΣ
+  Iso.fun PartialSurjectionIsoΣ surj =
+     a  (surj .support a) , (surj .isPropSupport a)) ,
+     { (a , suppA)  surj .enumeration (a , suppA) }) ,
+    surj .isSurjectionEnumeration ,
+    PartialSurjection.isSetX surj
+  Iso.inv PartialSurjectionIsoΣ (support , enumeration , isSurjectionEnumeration , isSetX) =
+    makePartialSurjection  a   support a ) enumeration  a  str (support a)) isSurjectionEnumeration isSetX
+  Iso.rightInv PartialSurjectionIsoΣ (support , enumeration , isSurjectionEnumeration , isSetX) = refl
+  support (Iso.leftInv PartialSurjectionIsoΣ surj i) a = surj .support a
+  enumeration (Iso.leftInv PartialSurjectionIsoΣ surj i) (a , suppA) = surj .enumeration (a , suppA)
+  isPropSupport (Iso.leftInv PartialSurjectionIsoΣ surj i) a = surj .isPropSupport a
+  isSurjectionEnumeration (Iso.leftInv PartialSurjectionIsoΣ surj i) = surj .isSurjectionEnumeration
+  isSetX (Iso.leftInv PartialSurjectionIsoΣ surj i) = surj .isSetX
+
+  PartialSurjection≡Σ : PartialSurjection X  PartialSurjectionΣ
+  PartialSurjection≡Σ = isoToPath PartialSurjectionIsoΣ
+
+  isSetPartialSurjection : isSet (PartialSurjection X)
+  isSetPartialSurjection = subst isSet (sym PartialSurjection≡Σ) isSetPartialSurjectionΣ
+
+-- let us derive a structure of identity principle for partial surjections
+module SIP (X : Type ) (isCorrectHLevel : isSet X) where
+
+  PartialSurjection≡Iso :
+     (p q : PartialSurjection X)
+     Iso
+      (Σ[ suppPath  p .support  q .support ]
+      PathP  i  Σ[ a  A ] (suppPath i a)  X) (p .enumeration) (q .enumeration))
+      (p  q)
+  support (Iso.fun (PartialSurjection≡Iso p q) (suppPath , enumPath) i) z = suppPath i z
+  enumeration (Iso.fun (PartialSurjection≡Iso p q) (suppPath , enumPath) i) (a , enum) = enumPath i (a , enum)
+  isPropSupport (Iso.fun (PartialSurjection≡Iso p q) (suppPath , enumPath) i) z =
+    isProp→PathP {B = λ j  isProp (suppPath j z)}  j  isPropIsProp) (p .isPropSupport z) (q .isPropSupport z) i
+  isSurjectionEnumeration (Iso.fun (PartialSurjection≡Iso p q) (suppPath , enumPath) i) b =
+    isProp→PathP
+      {B = λ j   fiber (enumeration (Iso.fun (PartialSurjection≡Iso p q) (suppPath , enumPath) j)) b ∥₁}
+       j  isPropPropTrunc)
+      (p .isSurjectionEnumeration b) (q .isSurjectionEnumeration b) i
+  isSetX (Iso.fun (PartialSurjection≡Iso p q) (suppPath , enumPath) i) = isPropIsSet (p .isSetX) (q .isSetX) i
+  Iso.inv (PartialSurjection≡Iso p q) p≡q =  i  p≡q i .support) ,  i  p≡q i .enumeration)
+  Iso.rightInv (PartialSurjection≡Iso p q) p≡q = isSetPartialSurjection X isCorrectHLevel _ _ _ _ 
+  Iso.leftInv (PartialSurjection≡Iso p q) (suppPath , enumPath) = ΣPathP (refl , refl)
+
+  PartialSurjection≡ :  (p q : PartialSurjection X)  Σ[ suppPath  p .support  q .support ] PathP  i  Σ[ a  A ] (suppPath i a)  X) (p .enumeration) (q .enumeration)  p  q
+  PartialSurjection≡ p q (suppPath , enumPath) = Iso.fun (PartialSurjection≡Iso p q) (suppPath , enumPath)
+
+-- the type of partial surjections is equivalent to the type of modest assemblies on X
+module ModestSetIso (X : Type ) (isCorrectHLevel : isSet X) where
+
+  open SIP X isCorrectHLevel
+
+  {-# TERMINATING #-}
+  ModestSet→PartialSurjection : ModestSet X  PartialSurjection X
+  support (ModestSet→PartialSurjection (xs , isModestXs)) r = ∃[ x  X ] (r ⊩[ xs ] x)
+  enumeration (ModestSet→PartialSurjection (xs , isModestXs)) (r , ∃x) =
+    let
+      answer : Σ[ x  X ] (r ⊩[ xs ] x)
+      answer = PT.rec (isUniqueRealized xs isModestXs r)  t  t) ∃x
+    in fst answer
+  isPropSupport (ModestSet→PartialSurjection (xs , isModestXs)) r = isPropPropTrunc
+  isSurjectionEnumeration (ModestSet→PartialSurjection (xs , isModestXs)) x =
+    do
+      (a , a⊩x)  xs .⊩surjective x
+      return ((a ,  x , a⊩x ∣₁) , refl)
+  isSetX (ModestSet→PartialSurjection (xs , isModestXs)) = xs .isSetX
+
+  PartialSurjection→ModestSet : PartialSurjection X  ModestSet X
+  Assembly._⊩_ (fst (PartialSurjection→ModestSet surj)) r x =
+    Σ[ s  surj .support r ] surj .enumeration (r , s)  x
+  Assembly.isSetX (fst (PartialSurjection→ModestSet surj)) = surj .isSetX
+  Assembly.⊩isPropValued (fst (PartialSurjection→ModestSet surj)) a x (s , ≡x) (t , ≡x') =
+    Σ≡Prop  u  surj .isSetX (surj .enumeration (a , u)) x) (surj .isPropSupport a s t)
+  Assembly.⊩surjective (fst (PartialSurjection→ModestSet surj)) x =
+    do
+      ((a , s) , ≡x)  surj .isSurjectionEnumeration x
+      return (a , (s , ≡x))
+  snd (PartialSurjection→ModestSet surj) x y r (s , ≡x) (t , ≡x') =
+    x
+      ≡⟨ sym ≡x 
+    surj .enumeration (r , s)
+      ≡⟨ cong  s  surj .enumeration (r , s)) (surj .isPropSupport r s t) 
+    surj .enumeration (r , t)
+      ≡⟨ ≡x' 
+    y
+      
+
+  opaque
+    rightInv :  surj  ModestSet→PartialSurjection (PartialSurjection→ModestSet surj)  surj
+    rightInv surj =
+      PartialSurjection≡
+        (ModestSet→PartialSurjection (PartialSurjection→ModestSet surj)) surj
+        (funExt supportEq ,
+        funExtDep
+          {A = λ i  Σ-syntax A (funExt supportEq i)}
+          {B = λ _ _  X}
+          {f = ModestSet→PartialSurjection (PartialSurjection→ModestSet surj) .enumeration}
+          {g = surj .enumeration}
+          λ { {r , ∃x} {s , supp} p 
+            PT.elim
+              {P = λ ∃x  fst
+                             (PT.rec
+                              (isUniqueRealized (fst (PartialSurjection→ModestSet surj))
+                               (snd (PartialSurjection→ModestSet surj)) r)
+                               t  t) ∃x)
+                           surj .enumeration (s , supp)}
+              ∃x  surj .isSetX _ _)
+              { (x , suppR , ≡x) 
+               let
+                 ∃x' = transport (sym (supportEq s)) supp
+                 r≡s : r  s
+                 r≡s = PathPΣ p .fst
+               in
+               equivFun
+                 (propTruncIdempotent≃ (surj .isSetX x (surj .enumeration (s , supp))))
+                 (do
+                   (x' , suppS , ≡x')  ∃x'
+                   return
+                     (x
+                       ≡⟨ sym ≡x 
+                     surj .enumeration (r , suppR)
+                       ≡⟨ cong (surj .enumeration) (ΣPathP (r≡s , (isProp→PathP  i  surj .isPropSupport (PathPΣ p .fst i)) suppR supp))) 
+                     surj .enumeration (s , supp)
+                       )) })
+             ∃x }) where
+          supportEq :  r  (∃[ x  X ] (Σ[ supp  surj .support r ] (surj .enumeration (r , supp)  x)))  support surj r
+          supportEq =
+               r 
+                hPropExt
+                isPropPropTrunc
+                (surj .isPropSupport r)
+                 ∃x  PT.rec (surj .isPropSupport r)  { (x , supp , ≡x)  supp }) ∃x)
+                 supp  return (surj .enumeration (r , supp) , supp , refl)))
+
+  leftInv :  mod  PartialSurjection→ModestSet (ModestSet→PartialSurjection mod)  mod
+  leftInv (asmX , isModestAsmX) =
+    Σ≡Prop
+      isPropIsModest
+      (Assembly≡ _ _
+        λ r x 
+          hPropExt
+            (isPropΣ isPropPropTrunc  ∃x  asmX .isSetX _ _))
+            (asmX .⊩isPropValued r x)
+             { (∃x , ≡x) 
+              let
+                (x' , r⊩x') = PT.rec (isUniqueRealized asmX isModestAsmX r)  t  t) ∃x
+              in subst  x'  r ⊩[ asmX ] x') ≡x r⊩x'})
+            λ r⊩x   x , r⊩x ∣₁ , refl)
+
+  IsoModestSetPartialSurjection : Iso (ModestSet X) (PartialSurjection X)
+  Iso.fun IsoModestSetPartialSurjection = ModestSet→PartialSurjection
+  Iso.inv IsoModestSetPartialSurjection = PartialSurjection→ModestSet
+  Iso.rightInv IsoModestSetPartialSurjection = rightInv 
+  Iso.leftInv IsoModestSetPartialSurjection = leftInv
+
+  ModestSet≡PartialSurjection : ModestSet X  PartialSurjection X
+  ModestSet≡PartialSurjection = isoToPath IsoModestSetPartialSurjection
+
+record PartialSurjectionMorphism {X Y : Type } (psX : PartialSurjection X) (psY : PartialSurjection Y) : Type  where
+  no-eta-equality
+  constructor makePartialSurjectionMorphism
+  field
+    map : X  Y
+    {-
+      The following "diagram" commutes
+                              
+      Xˢ -----------> X
+      |              |
+      |              |
+      |              |
+      |              |
+      |              |
+      ↓              ↓
+      Yˢ -----------> Y
+    -}
+    isTracked : ∃[ t  A ] (∀ (a : A) (sᵃ : psX .support a)  Σ[ sᵇ  (psY .support (t  a)) ] map (psX .enumeration (a , sᵃ))  psY .enumeration ((t  a) , sᵇ))
+open PartialSurjectionMorphism
+
+unquoteDecl PartialSurjectionMorphismIsoΣ = declareRecordIsoΣ PartialSurjectionMorphismIsoΣ (quote PartialSurjectionMorphism)
+
+PartialSurjectionMorphismΣ : {X Y : Type } (psX : PartialSurjection X) (psY : PartialSurjection Y)  Type 
+PartialSurjectionMorphismΣ {X} {Y} psX psY =
+  Σ[ f  (X  Y) ] ∃[ t  A ] ((∀ (a : A) (sᵃ : psX .support a)  Σ[ sᵇ  (psY .support (t  a)) ] f (psX .enumeration (a , sᵃ))  psY .enumeration ((t  a) , sᵇ)))
+
+isSetPartialSurjectionMorphismΣ : {X Y : Type } (psX : PartialSurjection X) (psY : PartialSurjection Y)  isSet (PartialSurjectionMorphismΣ psX psY)
+isSetPartialSurjectionMorphismΣ {X} {Y} psX psY = isSetΣ (isSet→ (psY .isSetX))  f  isProp→isSet isPropPropTrunc)
+
+PartialSurjectionMorphismΣ≡ : {X Y : Type } (psX : PartialSurjection X) (psY : PartialSurjection Y)  PartialSurjectionMorphism psX psY  PartialSurjectionMorphismΣ psX psY
+PartialSurjectionMorphismΣ≡ {X} {Y} psX psY = isoToPath PartialSurjectionMorphismIsoΣ
+
+isSetPartialSurjectionMorphism : {X Y : Type } (psX : PartialSurjection X) (psY : PartialSurjection Y)  isSet (PartialSurjectionMorphism psX psY)
+isSetPartialSurjectionMorphism {X} {Y} psX psY = subst isSet (sym (PartialSurjectionMorphismΣ≡ psX psY)) (isSetPartialSurjectionMorphismΣ psX psY)
+
+-- SIP
+module MorphismSIP {X Y : Type } (psX : PartialSurjection X) (psY : PartialSurjection Y) where
+  open PartialSurjectionMorphism
+  PartialSurjectionMorphism≡Iso :  (f g : PartialSurjectionMorphism psX psY)  Iso (f  g) (f .map  g .map)
+  Iso.fun (PartialSurjectionMorphism≡Iso f g) f≡g i = f≡g i .map
+  map (Iso.inv (PartialSurjectionMorphism≡Iso f g) fMap≡gMap i) = fMap≡gMap i
+  isTracked (Iso.inv (PartialSurjectionMorphism≡Iso f g) fMap≡gMap i) =
+    isProp→PathP
+      -- Agda can't infer the type B
+      {B = λ j  ∃-syntax A
+       t 
+         (a : A) (sᵃ : psX .support a) 
+         Σ-syntax (psY .support (t  a))
+          sᵇ 
+            fMap≡gMap j (psX .enumeration (a , sᵃ)) 
+            psY .enumeration (t  a , sᵇ)))}
+       j  isPropPropTrunc)
+      (f .isTracked) (g .isTracked) i
+  Iso.rightInv (PartialSurjectionMorphism≡Iso f g) fMap≡gMap = refl
+  Iso.leftInv (PartialSurjectionMorphism≡Iso f g) f≡g = isSetPartialSurjectionMorphism psX psY f g _ _
+
+  PartialSurjectionMorphism≡ :  {f g : PartialSurjectionMorphism psX psY}  (f .map  g .map)  f  g
+  PartialSurjectionMorphism≡ {f} {g} fMap≡gMap = Iso.inv (PartialSurjectionMorphism≡Iso f g) fMap≡gMap
+
+-- morphisms between partial surjections are equivalent to assembly morphisms between corresponding modest assemblies
+module
+  _
+  {X Y : Type }
+  (psX : PartialSurjection X)
+  (psY : PartialSurjection Y) where
+  open ModestSetIso 
+  open MorphismSIP psX psY
+
+  asmX = PartialSurjection→ModestSet X (psX .isSetX) psX .fst
+  isModestAsmX = PartialSurjection→ModestSet X (psX .isSetX) psX .snd
+
+  asmY = PartialSurjection→ModestSet Y (psY .isSetX) psY .fst
+  isModestAsmY = PartialSurjection→ModestSet Y (psY .isSetX) psY .snd
+
+  PartialSurjectionHomModestSetHomIso : Iso (AssemblyMorphism asmX asmY) (PartialSurjectionMorphism psX psY)
+  map (Iso.fun PartialSurjectionHomModestSetHomIso asmHom) = asmHom .map
+  isTracked (Iso.fun PartialSurjectionHomModestSetHomIso asmHom) =
+    do
+      (map~ , isTrackedMap)  asmHom .tracker
+      return
+        (map~ ,
+         λ a aSuppX 
+           let
+             worker : (map~  a) ⊩[ asmY ] (asmHom .map (psX .enumeration (a , aSuppX)))
+             worker = isTrackedMap (psX .enumeration (a , aSuppX)) a (aSuppX , refl)
+           in
+           (worker .fst) ,
+           (sym (worker .snd)))
+  AssemblyMorphism.map (Iso.inv PartialSurjectionHomModestSetHomIso surjHom) = surjHom .map
+  AssemblyMorphism.tracker (Iso.inv PartialSurjectionHomModestSetHomIso surjHom) =
+    do
+      (t , isTrackedMap)  surjHom .isTracked
+      return
+        (t ,
+         { x a (aSuppX , ≡x) 
+          (isTrackedMap a aSuppX .fst) ,
+          (sym (cong (surjHom .map) (sym ≡x)  isTrackedMap a aSuppX .snd)) }))
+  Iso.rightInv PartialSurjectionHomModestSetHomIso surjHom = PartialSurjectionMorphism≡ refl
+  Iso.leftInv PartialSurjectionHomModestSetHomIso asmHom = AssemblyMorphism≡ _ _ refl
+
+  PartialSurjectionHom≡ModestSetHom : AssemblyMorphism asmX asmY  PartialSurjectionMorphism psX psY
+  PartialSurjectionHom≡ModestSetHom = isoToPath PartialSurjectionHomModestSetHomIso
+
+-- the category of partial surjections
+
+idPartSurjMorphism :  {X : Type }  (psX : PartialSurjection X)  PartialSurjectionMorphism psX psX
+map (idPartSurjMorphism {X} psX) x = x
+isTracked (idPartSurjMorphism {X} psX) =
+  return (Id ,  a aSuppX  (subst  r  psX .support r) (sym (Ida≡a a)) aSuppX) , (cong (psX .enumeration) (Σ≡Prop  b  psX .isPropSupport b) (sym (Ida≡a a))))))
+
+composePartSurjMorphism :
+   {X Y Z : Type } {psX : PartialSurjection X} {psY : PartialSurjection Y} {psZ : PartialSurjection Z}
+   (f : PartialSurjectionMorphism psX psY)
+   (g : PartialSurjectionMorphism psY psZ)
+   PartialSurjectionMorphism psX psZ
+map (composePartSurjMorphism {X} {Y} {Z} {psX} {psY} {psZ} f g) x = g .map (f .map x)
+isTracked (composePartSurjMorphism {X} {Y} {Z} {psX} {psY} {psZ} f g) =
+  do
+    (f~ , isTrackedF)  f .isTracked
+    (g~ , isTrackedG)  g .isTracked
+    let
+      realizer : Term as 1
+      realizer = ` g~ ̇ (` f~ ̇ # zero)
+    return
+      (λ* realizer ,
+       a aSuppX 
+        subst  r'  psZ .support r') (sym (λ*ComputationRule realizer a)) (isTrackedG (f~  a) (isTrackedF a aSuppX .fst) .fst) ,
+       (g .map (f .map (psX .enumeration (a , aSuppX)))
+          ≡⟨ cong (g .map) (isTrackedF a aSuppX .snd) 
+        g .map (psY .enumeration (f~  a , fst (isTrackedF a aSuppX)))
+          ≡⟨ isTrackedG (f~  a) (fst (isTrackedF a aSuppX)) .snd 
+        psZ .enumeration (g~  (f~  a) , fst (isTrackedG (f~  a) (fst (isTrackedF a aSuppX))))
+          ≡⟨ cong (psZ .enumeration) (Σ≡Prop  z  psZ .isPropSupport z) (sym (λ*ComputationRule realizer a))) 
+        psZ .enumeration
+          (λ* realizer  a ,
+           subst  r'  psZ .support r') (sym (λ*ComputationRule realizer a)) (isTrackedG (f~  a) (isTrackedF a aSuppX .fst) .fst))
+          )))
+
+idLPartSurjMorphism :
+   {X Y : Type }
+   {psX : PartialSurjection X}
+   {psY : PartialSurjection Y}
+   (f : PartialSurjectionMorphism psX psY)
+   composePartSurjMorphism (idPartSurjMorphism psX) f  f
+idLPartSurjMorphism {X} {Y} {psX} {psY} f = MorphismSIP.PartialSurjectionMorphism≡ psX psY refl
+
+idRPartSurjMorphism :
+   {X Y : Type }
+   {psX : PartialSurjection X}
+   {psY : PartialSurjection Y}
+   (f : PartialSurjectionMorphism psX psY)
+   composePartSurjMorphism f (idPartSurjMorphism psY)  f
+idRPartSurjMorphism {X} {Y} {psX} {psY} f = MorphismSIP.PartialSurjectionMorphism≡ psX psY refl
+
+assocComposePartSurjMorphism :
+   {X Y Z W : Type }
+   {psX : PartialSurjection X}
+   {psY : PartialSurjection Y}
+   {psZ : PartialSurjection Z}
+   {psW : PartialSurjection W}
+   (f : PartialSurjectionMorphism psX psY)
+   (g : PartialSurjectionMorphism psY psZ)
+   (h : PartialSurjectionMorphism psZ psW)
+   composePartSurjMorphism (composePartSurjMorphism f g) h  composePartSurjMorphism f (composePartSurjMorphism g h)
+assocComposePartSurjMorphism {X} {Y} {Z} {W} {psX} {psY} {psZ} {psW} f g h = MorphismSIP.PartialSurjectionMorphism≡ psX psW refl
+
+PARTSURJ : Category (ℓ-suc ) 
+Category.ob PARTSURJ = Σ[ X  Type  ] PartialSurjection X
+Category.Hom[_,_] PARTSURJ (X , surjX) (Y , surjY) = PartialSurjectionMorphism surjX surjY
+Category.id PARTSURJ {X , surjX} = idPartSurjMorphism surjX
+Category._⋆_ PARTSURJ {X , surjX} {Y , surjY} {Z , surjZ} f g = composePartSurjMorphism f g
+Category.⋆IdL PARTSURJ {X , surjX} {Y , surjY} f = idLPartSurjMorphism f
+Category.⋆IdR PARTSURJ {X , surjX} {Y , surjY} f = idRPartSurjMorphism f
+Category.⋆Assoc PARTSURJ {X , surjX} {Y , surjY} {Z , surjZ} {W , surjW} f g h = assocComposePartSurjMorphism f g h
+Category.isSetHom PARTSURJ {X , surjX} {Y , surjY} = isSetPartialSurjectionMorphism surjX surjY
+
\ No newline at end of file diff --git a/docs/Realizability.Modest.SubQuotientCanonicalPERIso.html b/docs/Realizability.Modest.SubQuotientCanonicalPERIso.html new file mode 100644 index 0000000..428ead4 --- /dev/null +++ b/docs/Realizability.Modest.SubQuotientCanonicalPERIso.html @@ -0,0 +1,149 @@ + +Realizability.Modest.SubQuotientCanonicalPERIso
open import Cubical.Foundations.Prelude
+open import Cubical.Foundations.HLevels
+open import Cubical.Foundations.Isomorphism
+open import Cubical.Foundations.Function
+open import Cubical.Foundations.Equiv
+open import Cubical.Foundations.Powerset
+open import Cubical.Foundations.Path
+open import Cubical.Foundations.Structure using (⟨_⟩; str)
+open import Cubical.Data.Sigma
+open import Cubical.Data.FinData
+open import Cubical.Data.Unit
+open import Cubical.HITs.PropositionalTruncation as PT hiding (map)
+open import Cubical.HITs.PropositionalTruncation.Monad
+open import Cubical.HITs.SetQuotients as SQ
+open import Cubical.Reflection.RecordEquiv
+open import Cubical.Categories.Category
+open import Cubical.Categories.Displayed.Base
+open import Cubical.Categories.Displayed.Reasoning
+open import Cubical.Categories.Limits.Pullback
+open import Cubical.Categories.Functor hiding (Id)
+open import Cubical.Categories.Constructions.Slice
+open import Categories.CartesianMorphism
+open import Categories.GenericObject
+open import Realizability.CombinatoryAlgebra
+open import Realizability.ApplicativeStructure
+open import Realizability.PropResizing
+
+module Realizability.Modest.SubQuotientCanonicalPERIso {} {A : Type } (ca : CombinatoryAlgebra A) where
+
+open import Realizability.Assembly.Base ca
+open import Realizability.Assembly.Morphism ca
+open import Realizability.Assembly.Terminal ca
+open import Realizability.Assembly.SetsReflectiveSubcategory ca
+open import Realizability.Modest.Base ca
+open import Realizability.Modest.UniformFamily ca
+open import Realizability.Modest.CanonicalPER ca
+open import Realizability.PERs.PER ca
+open import Realizability.PERs.SubQuotient ca
+
+open Assembly
+open CombinatoryAlgebra ca
+open Realizability.CombinatoryAlgebra.Combinators ca renaming (i to Id; ia≡a to Ida≡a)
+open Contravariant UNIMOD
+open UniformFamily
+open DisplayedUFamMap
+
+module
+  _ {X : Type }
+  (asmX : Assembly X)
+  (isModestAsmX : isModest asmX) where
+
+  theCanonicalPER : PER
+  theCanonicalPER = canonicalPER asmX isModestAsmX
+
+  theSubQuotient : Assembly (subQuotient theCanonicalPER)
+  theSubQuotient = subQuotientAssembly theCanonicalPER
+
+  invert : AssemblyMorphism theSubQuotient asmX
+  AssemblyMorphism.map invert sq = SQ.rec (asmX .isSetX) reprAction reprActionCoh sq module Invert where
+
+    reprAction : Σ[ a  A ] (a ~[ theCanonicalPER ] a)  X
+    reprAction (a , x , a⊩x , _) = x
+
+    reprActionCoh :  a b a~b  reprAction a  reprAction b
+    reprActionCoh (a , x , a⊩x , _) (b , x' , b⊩x' , _) (x'' , a⊩x'' , b⊩x'') =
+      x
+        ≡⟨ isModestAsmX x x'' a a⊩x a⊩x'' 
+      x''
+        ≡⟨ isModestAsmX x'' x' b b⊩x'' b⊩x' 
+      x'
+        
+  AssemblyMorphism.tracker invert = return (Id ,  sq a a⊩sq  goal sq a a⊩sq)) where
+    realizability : (sq : subQuotient theCanonicalPER)  (a : A)  a ⊩[ theSubQuotient ] sq  a ⊩[ asmX ] (invert .map sq)
+    realizability sq a a⊩sq =
+      SQ.elimProp
+        {P = motive}
+        isPropMotive
+        elemMotive
+        sq a a⊩sq where
+
+      motive : (sq : subQuotient theCanonicalPER)  Type _
+      motive sq =  (a : A)  a ⊩[ theSubQuotient ] sq  a ⊩[ asmX ] (invert .map sq)
+
+      isPropMotive :  sq  isProp (motive sq)
+      isPropMotive sq = isPropΠ2 λ a a⊩sq  asmX .⊩isPropValued _ _
+
+      elemMotive : (x : domain theCanonicalPER)  motive [ x ]
+      elemMotive (r , x , r⊩x , _) a (x' , a⊩x' , r⊩x') = subst (a ⊩[ asmX ]_) (isModestAsmX x' x r r⊩x' r⊩x) a⊩x'
+
+    goal : (sq : subQuotient theCanonicalPER)  (a : A)  a ⊩[ theSubQuotient ] sq  (Id  a) ⊩[ asmX ] (invert .map sq)
+    goal sq a a⊩sq = subst (_⊩[ asmX ] _) (sym (Ida≡a a)) (realizability sq a a⊩sq)
+
+  forward : AssemblyMorphism asmX theSubQuotient
+  AssemblyMorphism.map forward x = subquot module Forward where
+    mainMap : Σ[ a  A ] (a ⊩[ asmX ] x)  subQuotient theCanonicalPER
+    mainMap (a , a⊩x) = [ a , x , a⊩x , a⊩x ]
+ 
+    mainMap2Constant : 2-Constant mainMap
+    mainMap2Constant (a , a⊩x) (b , b⊩x) = eq/ _ _ (x , a⊩x , b⊩x)
+
+    subquot : subQuotient theCanonicalPER
+    subquot = PT.rec→Set squash/ mainMap mainMap2Constant (asmX .⊩surjective x)
+  AssemblyMorphism.tracker forward =
+    return
+      (Id ,
+       x a a⊩x 
+        PT.elim
+          {P = λ surj  (Id  a) ⊩[ theSubQuotient ] (PT.rec→Set squash/ (Forward.mainMap x) (Forward.mainMap2Constant x) surj)}
+           surj  theSubQuotient .⊩isPropValued (Id  a) (PT.rec→Set squash/ (Forward.mainMap x) (Forward.mainMap2Constant x) surj))
+           { (b , b⊩x)  x , subst (_⊩[ asmX ] x) (sym (Ida≡a a)) a⊩x , b⊩x })
+          (asmX .⊩surjective x)))
+
+  subQuotientCanonicalIso : CatIso MOD (X , asmX , isModestAsmX) (subQuotient theCanonicalPER , theSubQuotient , isModestSubQuotientAssembly theCanonicalPER)
+  fst subQuotientCanonicalIso = forward
+  isIso.inv (snd subQuotientCanonicalIso) = invert
+  isIso.sec (snd subQuotientCanonicalIso) = goal where
+    opaque
+      pointwise :  sq  (invert  forward) .map sq  sq
+      pointwise sq =
+        SQ.elimProp
+           sq  squash/ (forward .map (invert .map sq)) sq)
+           { d@(a , x , a⊩x , a⊩'x) 
+            PT.elim
+              {P = λ surj  PT.rec→Set squash/ (Forward.mainMap (Invert.reprAction [ d ] d)) (Forward.mainMap2Constant (Invert.reprAction [ d ] d)) surj  [ d ]}
+               surj  squash/ _ _)
+               { (b , b⊩x)  eq/ _ _ (x , b⊩x , a⊩x) })
+              (asmX .⊩surjective x) })
+          sq
+
+    goal : invert  forward  identityMorphism theSubQuotient
+    goal = AssemblyMorphism≡ _ _ (funExt pointwise)
+  isIso.ret (snd subQuotientCanonicalIso) = goal where
+    opaque
+      pointwise :  x  (forward  invert) .map x  x
+      pointwise x =
+        PT.elim
+          {P =
+            λ surj 
+              invert .map
+                (PT.rec→Set squash/ (Forward.mainMap x) (Forward.mainMap2Constant x) surj)
+               x}
+           surj  asmX .isSetX _ _)
+           { (a , a⊩x)  refl })
+          (asmX .⊩surjective x)
+
+    goal : forward  invert  identityMorphism asmX
+    goal = AssemblyMorphism≡ _ _ (funExt pointwise)
+
\ No newline at end of file diff --git a/docs/Realizability.Modest.UniformFamily.html b/docs/Realizability.Modest.UniformFamily.html new file mode 100644 index 0000000..f91aa3a --- /dev/null +++ b/docs/Realizability.Modest.UniformFamily.html @@ -0,0 +1,219 @@ + +Realizability.Modest.UniformFamily
open import Cubical.Foundations.Prelude
+open import Cubical.Foundations.HLevels
+open import Cubical.Foundations.Isomorphism
+open import Cubical.Foundations.Function
+open import Cubical.Foundations.Equiv
+open import Cubical.Foundations.Powerset
+open import Cubical.Foundations.Path
+open import Cubical.Foundations.Structure using (⟨_⟩; str)
+open import Cubical.Data.Sigma
+open import Cubical.Data.FinData
+open import Cubical.Data.Unit
+open import Cubical.HITs.PropositionalTruncation hiding (map)
+open import Cubical.HITs.PropositionalTruncation.Monad
+open import Cubical.Reflection.RecordEquiv
+open import Cubical.Categories.Category
+open import Cubical.Categories.Displayed.Base
+open import Cubical.Categories.Displayed.Reasoning
+open import Cubical.Categories.Limits.Pullback
+open import Cubical.Categories.Functor hiding (Id)
+open import Cubical.Categories.Constructions.Slice
+open import Realizability.CombinatoryAlgebra
+open import Realizability.ApplicativeStructure
+open import Realizability.PropResizing
+
+module Realizability.Modest.UniformFamily {} {A : Type } (ca : CombinatoryAlgebra A) where
+
+open import Realizability.Assembly.Base ca
+open import Realizability.Assembly.Morphism ca
+open import Realizability.Assembly.Terminal ca
+open import Realizability.Modest.Base ca
+
+open Assembly
+open CombinatoryAlgebra ca
+open Realizability.CombinatoryAlgebra.Combinators ca renaming (i to Id; ia≡a to Ida≡a)
+
+record UniformFamily {I : Type } (asmI : Assembly I) : Type (ℓ-suc ) where
+  no-eta-equality
+  field
+    carriers : I  Type 
+    assemblies :  i  Assembly (carriers i)
+    isModestFamily :  i  isModest (assemblies i)
+open UniformFamily
+record DisplayedUFamMap {I J : Type } (asmI : Assembly I) (asmJ : Assembly J) (u : AssemblyMorphism asmI asmJ) (X : UniformFamily asmI) (Y : UniformFamily asmJ) : Type  where
+  no-eta-equality
+  field
+    fibrewiseMap :  i  X .carriers i  Y .carriers (u .map i)
+    isTracked : ∃[ e  A ] (∀ (i : I) (a : A) (a⊩i : a ⊩[ asmI ] i) (x : X .carriers i) (b : A) (b⊩x : b ⊩[ X .assemblies i ] x)  (e  a  b) ⊩[ Y .assemblies (u .map i) ] (fibrewiseMap i x))
+
+open DisplayedUFamMap
+
+DisplayedUFamMapPathP :
+   {I J} (asmI : Assembly I) (asmJ : Assembly J) 
+   u v X Y
+   (uᴰ : DisplayedUFamMap asmI asmJ u X Y)
+   (vᴰ : DisplayedUFamMap asmI asmJ v X Y)
+   (p : u  v)
+   (∀ (i : I) (x : X .carriers i)  PathP  j  Y .carriers (p j .map i)) (uᴰ .fibrewiseMap i x) (vᴰ .fibrewiseMap i x))
+  -----------------------------------------------------------------------------------------------------------------------
+   PathP  i  DisplayedUFamMap asmI asmJ (p i) X Y) uᴰ vᴰ
+fibrewiseMap (DisplayedUFamMapPathP {I} {J} asmI asmJ u v X Y uᴰ vᴰ p pᴰ dimI) i x = pᴰ i x dimI
+isTracked (DisplayedUFamMapPathP {I} {J} asmI asmJ u v X Y uᴰ vᴰ p pᴰ dimI) =
+  isProp→PathP
+    {B = λ dimJ  ∃[ e  A ] ((i : I) (a : A)  a ⊩[ asmI ] i  (x : X .carriers i) (b : A)  b ⊩[ X .assemblies i ] x  (e  a  b) ⊩[ Y .assemblies (p dimJ .map i) ] pᴰ i x dimJ)}
+     dimJ  isPropPropTrunc)
+    (uᴰ .isTracked)
+    (vᴰ .isTracked)
+    dimI
+
+isSetDisplayedUFamMap :  {I J} (asmI : Assembly I) (asmJ : Assembly J)   u X Y  isSet (DisplayedUFamMap asmI asmJ u X Y)
+fibrewiseMap (isSetDisplayedUFamMap {I} {J} asmI asmJ u X Y f g p q dimI dimJ) i x =
+  isSet→isSet'
+    (Y .assemblies (u .map i) .isSetX)
+    {a₀₀ = fibrewiseMap f i x}
+    {a₀₁ = fibrewiseMap f i x}
+    refl
+    {a₁₀ = fibrewiseMap g i x}
+    {a₁₁ = fibrewiseMap g i x}
+    refl
+     dimK  fibrewiseMap (p dimK) i x)
+     dimK  fibrewiseMap (q dimK) i x)
+    dimJ dimI
+isTracked (isSetDisplayedUFamMap {I} {J} asmI asmJ u X Y f g p q dimI dimJ) =
+  isProp→SquareP
+    {B = λ dimI dimJ 
+      ∃[ e  A ]
+        ((i : I) (a : A) 
+         a ⊩[ asmI ] i 
+         (x : X .carriers i) (b : A) 
+         b ⊩[ X .assemblies i ] x 
+         (e  a  b) ⊩[ Y .assemblies (u .map i) ]
+         isSet→isSet'
+         (Y .assemblies
+          (u .map i)
+          .isSetX)
+          _  fibrewiseMap f i x)  _  fibrewiseMap g i x)
+          dimK  fibrewiseMap (p dimK) i x)
+          dimK  fibrewiseMap (q dimK) i x) dimJ dimI)}
+       dimI dimJ  isPropPropTrunc)
+      {a = isTracked f}
+      {b = isTracked g}
+      {c = isTracked f}
+      {d = isTracked g}
+      refl
+      refl
+       dimK  isTracked (p dimK))
+       dimK  isTracked (q dimK))
+      dimI dimJ
+
+DisplayedUFamMapPathPIso :
+   {I J} (asmI : Assembly I) (asmJ : Assembly J) 
+   u v X Y
+   (uᴰ : DisplayedUFamMap asmI asmJ u X Y)
+   (vᴰ : DisplayedUFamMap asmI asmJ v X Y)
+   (p : u  v)
+   Iso
+    (∀ (i : I) (x : X .carriers i)  PathP  dimI  Y .carriers (p dimI .map i)) (uᴰ .fibrewiseMap i x) (vᴰ .fibrewiseMap i x))
+    (PathP  dimI  DisplayedUFamMap asmI asmJ (p dimI) X Y) uᴰ vᴰ)
+Iso.fun (DisplayedUFamMapPathPIso {I} {J} asmI asmJ u v X Y uᴰ vᴰ p) pᴰ = DisplayedUFamMapPathP asmI asmJ u v X Y uᴰ vᴰ p pᴰ
+Iso.inv (DisplayedUFamMapPathPIso {I} {J} asmI asmJ u v X Y uᴰ vᴰ p) uᴰ≡vᴰ i x dimI = (uᴰ≡vᴰ dimI) .fibrewiseMap i x
+Iso.rightInv (DisplayedUFamMapPathPIso {I} {J} asmI asmJ u v X Y uᴰ vᴰ p) uᴰ≡vᴰ dimI dimJ =
+  isSet→SquareP
+    {A = λ dimK dimL  DisplayedUFamMap asmI asmJ (p dimL) X Y}
+     dimI dimJ  isSetDisplayedUFamMap asmI asmJ (p dimJ) X Y)
+    {a₀₀ = uᴰ}
+    {a₀₁ = vᴰ}
+     dimK  DisplayedUFamMapPathP asmI asmJ u v X Y uᴰ vᴰ p  i x dimL  uᴰ≡vᴰ dimL .fibrewiseMap i x) dimK)
+    {a₁₀ = uᴰ}
+    {a₁₁ = vᴰ}
+    uᴰ≡vᴰ
+    refl
+    refl dimI dimJ
+Iso.leftInv (DisplayedUFamMapPathPIso {I} {J} asmI asmJ u v X Y uᴰ vᴰ p) pᴰ = refl
+
+idDisplayedUFamMap :  {I} (asmI : Assembly I) (p : UniformFamily asmI)  DisplayedUFamMap asmI asmI (identityMorphism asmI) p p
+DisplayedUFamMap.fibrewiseMap (idDisplayedUFamMap {I} asmI p) i pi = pi
+DisplayedUFamMap.isTracked (idDisplayedUFamMap {I} asmI p) =
+  return
+    (λ*2 realizer ,
+     λ i a a⊩i x b b⊩x 
+       subst
+          r  r ⊩[ p .assemblies i ] x)
+         (sym (λ*2ComputationRule realizer a b))
+         b⊩x) where
+  realizer : Term as 2
+  realizer = # zero
+
+module _
+  {I J K : Type }
+  (asmI : Assembly I)
+  (asmJ : Assembly J)
+  (asmK : Assembly K)
+  (f : AssemblyMorphism asmI asmJ)
+  (g : AssemblyMorphism asmJ asmK)
+  (X : UniformFamily asmI)
+  (Y : UniformFamily asmJ)
+  (Z : UniformFamily asmK)
+  (fᴰ : DisplayedUFamMap asmI asmJ f X Y)
+  (gᴰ : DisplayedUFamMap asmJ asmK g Y Z) where
+
+  composeDisplayedUFamMap : DisplayedUFamMap asmI asmK (f  g) X Z
+  DisplayedUFamMap.fibrewiseMap composeDisplayedUFamMap i Xi = gᴰ .fibrewiseMap (f .map i) (fᴰ .fibrewiseMap i Xi)
+  DisplayedUFamMap.isTracked composeDisplayedUFamMap =
+    do
+      (gᴰ~ , isTrackedGᴰ)  gᴰ .isTracked
+      (fᴰ~ , isTrackedFᴰ)  fᴰ .isTracked
+      (f~ , isTrackedF)  f .tracker
+      let
+        realizer : Term as 2
+        realizer = ` gᴰ~ ̇ (` f~ ̇ # one) ̇ (` fᴰ~ ̇ # one ̇ # zero)
+      return
+        (λ*2 realizer ,
+         i a a⊩i x b b⊩x 
+          subst
+            (_⊩[ Z .assemblies (g .map (f .map i)) ] _)
+            (sym (λ*2ComputationRule realizer a b))
+            (isTrackedGᴰ (f .map i) (f~  a) (isTrackedF i a a⊩i) (fᴰ .fibrewiseMap i x) (fᴰ~  a  b) (isTrackedFᴰ i a a⊩i x b b⊩x))))
+
+UNIMOD : Categoryᴰ ASM (ℓ-suc ) 
+Categoryᴰ.ob[ UNIMOD ] (I , asmI) = UniformFamily asmI
+Categoryᴰ.Hom[_][_,_] UNIMOD {I , asmI} {J , asmJ} u X Y = DisplayedUFamMap asmI asmJ u X Y
+Categoryᴰ.idᴰ UNIMOD {I , asmI} {X} = idDisplayedUFamMap asmI X
+Categoryᴰ._⋆ᴰ_ UNIMOD {I , asmI} {J , asmJ} {K , asmK} {f} {g} {X} {Y} {Z} fᴰ gᴰ = composeDisplayedUFamMap asmI asmJ asmK f g X Y Z fᴰ gᴰ
+Categoryᴰ.⋆IdLᴰ UNIMOD {I , asmI} {J , asmJ} {f} {X} {Y} fᴰ =
+  DisplayedUFamMapPathP
+    asmI asmJ
+    (identityMorphism asmI  f) f
+    X Y
+    (composeDisplayedUFamMap asmI asmI asmJ (Category.id ASM) f X X Y (idDisplayedUFamMap asmI X) fᴰ)
+    fᴰ
+    (Category.⋆IdL ASM f)
+     i x  refl)
+Categoryᴰ.⋆IdRᴰ UNIMOD {I , asmI} {J , asmJ} {f} {X} {Y} fᴰ =
+  DisplayedUFamMapPathP
+    asmI asmJ
+    (f  identityMorphism asmJ) f
+    X Y
+    (composeDisplayedUFamMap asmI asmJ asmJ f (Category.id ASM) X Y Y fᴰ (idDisplayedUFamMap asmJ Y))
+    fᴰ
+    (Category.⋆IdR ASM f)
+    λ i x  refl
+Categoryᴰ.⋆Assocᴰ UNIMOD {I , asmI} {J , asmJ} {K , asmK} {L , asmL} {f} {g} {h} {X} {Y} {Z} {W} fᴰ gᴰ hᴰ =
+  DisplayedUFamMapPathP
+    asmI asmL
+    ((f  g)  h) (f  (g  h))
+    X W
+    (composeDisplayedUFamMap
+      asmI asmK asmL
+      (f  g) h X Z W
+      (composeDisplayedUFamMap asmI asmJ asmK f g X Y Z fᴰ gᴰ)
+      hᴰ)
+    (composeDisplayedUFamMap
+      asmI asmJ asmL
+      f (g  h) X Y W
+      fᴰ (composeDisplayedUFamMap asmJ asmK asmL g h Y Z W gᴰ hᴰ))
+    (Category.⋆Assoc ASM f g h)
+    λ i x  refl
+Categoryᴰ.isSetHomᴰ UNIMOD {I , asmI} {J , asmJ} {f} {X} {Y} = isSetDisplayedUFamMap asmI asmJ f X Y
+
\ No newline at end of file diff --git a/docs/Realizability.Modest.UniformFamilyCleavage.html b/docs/Realizability.Modest.UniformFamilyCleavage.html new file mode 100644 index 0000000..5bd01ed --- /dev/null +++ b/docs/Realizability.Modest.UniformFamilyCleavage.html @@ -0,0 +1,102 @@ + +Realizability.Modest.UniformFamilyCleavage
open import Cubical.Foundations.Prelude
+open import Cubical.Foundations.HLevels
+open import Cubical.Foundations.Isomorphism
+open import Cubical.Foundations.Function
+open import Cubical.Foundations.Equiv
+open import Cubical.Foundations.Powerset
+open import Cubical.Foundations.Path
+open import Cubical.Foundations.Structure using (⟨_⟩; str)
+open import Cubical.Data.Sigma
+open import Cubical.Data.FinData
+open import Cubical.Data.Unit
+open import Cubical.HITs.PropositionalTruncation as PT hiding (map)
+open import Cubical.HITs.PropositionalTruncation.Monad
+open import Cubical.HITs.SetQuotients as SQ
+open import Cubical.Reflection.RecordEquiv
+open import Cubical.Categories.Category
+open import Cubical.Categories.Displayed.Base
+open import Cubical.Categories.Displayed.Reasoning
+open import Cubical.Categories.Limits.Pullback
+open import Cubical.Categories.Functor hiding (Id)
+open import Cubical.Categories.Constructions.Slice
+open import Categories.CartesianMorphism
+open import Categories.GenericObject
+open import Realizability.CombinatoryAlgebra
+open import Realizability.ApplicativeStructure
+open import Realizability.PropResizing
+
+module Realizability.Modest.UniformFamilyCleavage {} {A : Type } (ca : CombinatoryAlgebra A) where
+
+open import Realizability.Assembly.Base ca
+open import Realizability.Assembly.Morphism ca
+open import Realizability.Assembly.Terminal ca
+open import Realizability.Assembly.SetsReflectiveSubcategory ca
+open import Realizability.Modest.Base ca
+open import Realizability.Modest.UniformFamily ca
+open import Realizability.Modest.CanonicalPER ca
+open import Realizability.Modest.UnresizedGeneric ca
+open import Realizability.PERs.PER ca
+open import Realizability.PERs.SubQuotient ca
+
+open Assembly
+open CombinatoryAlgebra ca
+open Realizability.CombinatoryAlgebra.Combinators ca renaming (i to Id; ia≡a to Ida≡a)
+open Contravariant UNIMOD
+open UniformFamily
+open DisplayedUFamMap
+
+uniformFamilyCleavage : cleavage
+uniformFamilyCleavage {X , asmX} {Y , asmY} f N =
+  N' , fᴰ , cartfᴰ where
+    N' : UniformFamily asmX
+    UniformFamily.carriers N' x = N .carriers (f .map x)
+    UniformFamily.assemblies N' x = N .assemblies (f .map x)
+    UniformFamily.isModestFamily N' x = N .isModestFamily (f .map x)
+
+    fᴰ : DisplayedUFamMap asmX asmY f N' N
+    DisplayedUFamMap.fibrewiseMap fᴰ x Nfx = Nfx
+    DisplayedUFamMap.isTracked fᴰ =
+      do
+        let
+          realizer : Term as 2
+          realizer = # zero
+        return
+          (λ*2 realizer ,
+           x a a⊩x Nfx b b⊩Nfx 
+            subst
+              (_⊩[ N .assemblies (f .map x) ] Nfx)
+              (sym (λ*2ComputationRule realizer a b))
+              b⊩Nfx))
+
+    opaque
+      unfolding isCartesian'
+      cart'fᴰ : isCartesian' f fᴰ
+      cart'fᴰ {Z , asmZ} {M} g hᴰ =
+        (! , !⋆fᴰ≡hᴰ) ,
+        λ { (!' , !'comm) 
+          Σ≡Prop
+             !  UNIMOD .Categoryᴰ.isSetHomᴰ _ _)
+            (DisplayedUFamMapPathP
+              _ _ _ _ _ _ _ _ _
+              λ z Mz 
+                sym
+                  (!' .fibrewiseMap z Mz
+                    ≡[ i ]⟨ !'comm i .fibrewiseMap z Mz 
+                  hᴰ .fibrewiseMap z Mz
+                    )) } where
+          ! : DisplayedUFamMap asmZ asmX g M N'
+          DisplayedUFamMap.fibrewiseMap ! z Mz = hᴰ .fibrewiseMap z Mz
+          DisplayedUFamMap.isTracked ! = hᴰ .isTracked
+
+          !⋆fᴰ≡hᴰ : composeDisplayedUFamMap asmZ asmX asmY g f M N' N ! fᴰ  hᴰ
+          !⋆fᴰ≡hᴰ =
+            DisplayedUFamMapPathP
+              asmZ asmY _ _
+              M N
+              (composeDisplayedUFamMap asmZ asmX asmY g f M N' N ! fᴰ) hᴰ refl
+              λ z Mz  refl
+
+    cartfᴰ : isCartesian f fᴰ
+    cartfᴰ = isCartesian'→isCartesian f fᴰ cart'fᴰ
+
\ No newline at end of file diff --git a/docs/Realizability.Modest.UnresizedGeneric.html b/docs/Realizability.Modest.UnresizedGeneric.html new file mode 100644 index 0000000..4fef522 --- /dev/null +++ b/docs/Realizability.Modest.UnresizedGeneric.html @@ -0,0 +1,94 @@ + +Realizability.Modest.UnresizedGeneric
open import Cubical.Foundations.Prelude
+open import Cubical.Foundations.HLevels
+open import Cubical.Foundations.Isomorphism
+open import Cubical.Foundations.Function
+open import Cubical.Foundations.Equiv
+open import Cubical.Foundations.Powerset
+open import Cubical.Foundations.Path
+open import Cubical.Foundations.Structure using (⟨_⟩; str)
+open import Cubical.Data.Sigma
+open import Cubical.Data.FinData
+open import Cubical.Data.Unit
+open import Cubical.HITs.PropositionalTruncation as PT hiding (map)
+open import Cubical.HITs.PropositionalTruncation.Monad
+open import Cubical.HITs.SetQuotients as SQ
+open import Cubical.Reflection.RecordEquiv
+open import Cubical.Categories.Category
+open import Cubical.Categories.Displayed.Base
+open import Cubical.Categories.Displayed.Reasoning
+open import Cubical.Categories.Limits.Pullback
+open import Cubical.Categories.Functor hiding (Id)
+open import Cubical.Categories.Constructions.Slice
+open import Categories.CartesianMorphism
+open import Categories.GenericObject
+open import Realizability.CombinatoryAlgebra
+open import Realizability.ApplicativeStructure
+open import Realizability.PropResizing
+
+module Realizability.Modest.UnresizedGeneric {} {A : Type } (ca : CombinatoryAlgebra A) (resizing : hPropResizing ) where
+
+open import Realizability.Assembly.Base ca
+open import Realizability.Assembly.Morphism ca
+open import Realizability.Assembly.Terminal ca
+open import Realizability.Assembly.SetsReflectiveSubcategory ca
+open import Realizability.Modest.Base ca
+open import Realizability.Modest.UniformFamily ca
+open import Realizability.Modest.CanonicalPER ca
+open import Realizability.PERs.PER ca
+open import Realizability.PERs.ResizedPER ca resizing
+open import Realizability.PERs.SubQuotient ca
+
+open Assembly
+open CombinatoryAlgebra ca
+open Realizability.CombinatoryAlgebra.Combinators ca renaming (i to Id; ia≡a to Ida≡a)
+open Contravariant UNIMOD
+open UniformFamily
+open DisplayedUFamMap
+
+module Unresized
+  {X : Type }
+  (asmX : Assembly X)
+  (M : UniformFamily asmX) where
+
+  theCanonicalPER :  x  PER
+  theCanonicalPER x = canonicalPER (M . assemblies x) (M .isModestFamily x)
+
+  elimRealizerForMx :  (x : X) (Mx : M .carriers x)  Σ[ a  A ] (a ⊩[ M .assemblies x ] Mx)  subQuotient (canonicalPER (M .assemblies x) (M .isModestFamily x))
+  elimRealizerForMx x Mx (a , a⊩Mx) = [ a , Mx , a⊩Mx , a⊩Mx ]
+
+  opaque
+    elimRealizerForMx2Constant :  x Mx  2-Constant (elimRealizerForMx x Mx)
+    elimRealizerForMx2Constant x Mx (a , a⊩Mx) (b , b⊩Mx) =
+      eq/
+        (a , Mx , a⊩Mx , a⊩Mx)
+        (b , Mx , b⊩Mx , b⊩Mx)
+        (Mx , a⊩Mx , b⊩Mx)
+
+  mainMapType : Type _
+  mainMapType =
+     (x : X) (Mx : M .carriers x) 
+    Σ[ out  (subQuotient (canonicalPER (M .assemblies x) (M .isModestFamily x))) ]
+    (∀ (a : A)  a ⊩[ asmX ] x  (b : A)  b ⊩[ M .assemblies x ] Mx  (λ*2 (# zero)  a  b) ⊩[ subQuotientAssembly (theCanonicalPER x) ] out)
+
+  opaque
+    mainMap : mainMapType
+    mainMap x Mx =
+      PT.rec→Set
+        (isSetΣ
+            squash/
+             out 
+              isSetΠ3
+                λ a a⊩x b 
+                  isSet→
+                    (isProp→isSet
+                      (str
+                        (subQuotientRealizability (theCanonicalPER x) (λ*2 (# zero)  a  b) out)))))
+        ((λ { (c , c⊩Mx) 
+          (elimRealizerForMx x Mx (c , c⊩Mx)) ,
+           a a⊩x b b⊩Mx 
+            subst (_⊩[ subQuotientAssembly (theCanonicalPER x) ] (elimRealizerForMx x Mx (c , c⊩Mx))) (sym (λ*2ComputationRule (# zero) a b)) (Mx , b⊩Mx , c⊩Mx)) }))
+         { (a , a⊩Mx) (b , b⊩Mx) 
+          Σ≡Prop  out  isPropΠ4 λ a a⊩x b b⊩Mx  str (subQuotientRealizability (theCanonicalPER x) (λ*2 (# zero)  a  b) out)) (elimRealizerForMx2Constant x Mx (a , a⊩Mx) (b , b⊩Mx)) })
+        (M .assemblies x .⊩surjective Mx)
+
\ No newline at end of file diff --git a/docs/Realizability.PERs.Everything.html b/docs/Realizability.PERs.Everything.html new file mode 100644 index 0000000..72d56c1 --- /dev/null +++ b/docs/Realizability.PERs.Everything.html @@ -0,0 +1,7 @@ + +Realizability.PERs.Everything
module Realizability.PERs.Everything where
+
+open import Realizability.PERs.PER
+open import Realizability.PERs.ResizedPER
+open import Realizability.PERs.SubQuotient
+
\ No newline at end of file diff --git a/docs/Realizability.PERs.PER.html b/docs/Realizability.PERs.PER.html new file mode 100644 index 0000000..afe7afe --- /dev/null +++ b/docs/Realizability.PERs.PER.html @@ -0,0 +1,226 @@ + +Realizability.PERs.PER
open import Realizability.ApplicativeStructure
+open import Realizability.CombinatoryAlgebra
+open import Cubical.Foundations.Prelude
+open import Cubical.Foundations.HLevels
+open import Cubical.Foundations.Structure using (⟨_⟩; str)
+open import Cubical.Foundations.Isomorphism
+open import Cubical.Foundations.Equiv
+open import Cubical.Foundations.Univalence
+open import Cubical.Foundations.Powerset
+open import Cubical.Functions.FunExtEquiv
+open import Cubical.Relation.Binary
+open import Cubical.Data.Sigma
+open import Cubical.Data.FinData
+open import Cubical.Data.Vec
+open import Cubical.Reflection.RecordEquiv
+open import Cubical.HITs.PropositionalTruncation as PT hiding (map)
+open import Cubical.HITs.PropositionalTruncation.Monad
+open import Cubical.HITs.SetQuotients as SQ
+open import Cubical.Categories.Category
+open import Cubical.Categories.Functor hiding (Id)
+
+module Realizability.PERs.PER
+  {} {A : Type } (ca : CombinatoryAlgebra A) where
+
+open import Realizability.Assembly.Base ca
+open import Realizability.Assembly.Morphism ca
+
+open CombinatoryAlgebra ca
+open Combinators ca renaming (i to Id; ia≡a to Ida≡a)
+
+module BR = BinaryRelation
+
+isPartialEquivalenceRelation : (A  A  Type )  Type _
+isPartialEquivalenceRelation rel = BR.isSym rel × BR.isTrans rel
+
+isPropIsPartialEquivalenceRelation :  r  (∀ a b  isProp (r a b))  isProp (isPartialEquivalenceRelation r)
+isPropIsPartialEquivalenceRelation rel isPropValuedRel =
+  isProp×
+    (isPropΠ  x  isPropΠ λ y  isProp→ (isPropValuedRel y x)))
+    (isPropΠ λ x  isPropΠ λ y  isPropΠ λ z  isProp→ (isProp→ (isPropValuedRel x z)))
+
+record PER : Type (ℓ-suc ) where
+  no-eta-equality
+  constructor makePER
+  field
+    relation : A  A  Type 
+    isPropValued :  a b  isProp (relation a b)
+    isPER : isPartialEquivalenceRelation relation
+  isSymmetric = isPER .fst
+  isTransitive = isPER .snd
+
+open PER
+
+PERΣ : Type (ℓ-suc )
+PERΣ = Σ[ relation  (A  A  hProp ) ] isPartialEquivalenceRelation λ a b   relation a b 
+
+isSetPERΣ : isSet PERΣ
+isSetPERΣ =
+  isSetΣ
+    (isSet→ (isSet→ isSetHProp))
+     relation 
+      isProp→isSet
+        (isPropIsPartialEquivalenceRelation
+           a b   relation a b )
+           a b  str (relation a b))))
+
+PER≡ :  (R S : PER)  (R .relation  S .relation)  R  S
+relation (PER≡ R S rel≡ i) = rel≡ i
+isPropValued (PER≡ R S rel≡ i) a b =
+  isProp→PathP
+    {B = λ j  isProp (rel≡ j a b)}
+     j  isPropIsProp)
+    (R .isPropValued a b)
+    (S .isPropValued a b) i
+isPER (PER≡ R S rel≡ i) =
+  isProp→PathP
+    {B = λ j  isPartialEquivalenceRelation (rel≡ j)}
+     j  isPropIsPartialEquivalenceRelation (rel≡ j) λ a b  isPropRelJ a b j)
+    (R .isPER)
+    (S .isPER) i where
+      isPropRelJ :  a b j  isProp (rel≡ j a b)
+      isPropRelJ a b j = isProp→PathP {B = λ k  isProp (rel≡ k a b)}  k  isPropIsProp) (R .isPropValued a b) (S .isPropValued a b) j
+
+PERIsoΣ : Iso PER PERΣ
+Iso.fun PERIsoΣ per =  a b  per .relation a b , per .isPropValued a b) , per .isPER
+relation (Iso.inv PERIsoΣ perΣ) a b =  perΣ .fst a b 
+isPropValued (Iso.inv PERIsoΣ perΣ) a b = str (perΣ .fst a b)
+isPER (Iso.inv PERIsoΣ perΣ) = perΣ .snd
+Iso.rightInv PERIsoΣ perΣ = refl
+Iso.leftInv PERIsoΣ per = PER≡ _ _ refl
+
+isSetPER : isSet PER
+isSetPER = isOfHLevelRetractFromIso 2 PERIsoΣ isSetPERΣ
+
+PER≡Iso :  (R S : PER)  Iso (R  S) (R .relation  S .relation)
+Iso.fun (PER≡Iso R S) R≡S i = R≡S i .relation
+Iso.inv (PER≡Iso R S) rel≡ = PER≡ R S rel≡
+Iso.rightInv (PER≡Iso R S) rel≡ = refl
+Iso.leftInv (PER≡Iso R S) R≡S = isSetPER R S _ _
+
+_~[_]_ : A  PER  A  Type 
+a ~[ R ] b = R .relation a b
+
+isProp~ :  a R b  isProp (a ~[ R ] b)
+isProp~ a R b = R .isPropValued a b
+
+isTracker : (R S : PER)  A  Type 
+isTracker R S a =  r r'  r ~[ R ] r'  (a  r) ~[ S ] (a  r')
+
+perTracker : (R S : PER)  Type 
+perTracker R S = Σ[ a  A ] isTracker R S a
+
+isEquivTracker : (R S : PER)  perTracker R S  perTracker R S  Type 
+isEquivTracker R S (a , _) (b , _) = (∀ r  r ~[ R ] r  (a  r) ~[ S ] (b  r))
+
+isEquivRelIsEquivTracker : (R S : PER)  BR.isEquivRel (isEquivTracker R S)
+BinaryRelation.isEquivRel.reflexive (isEquivRelIsEquivTracker R S) (a , isTrackerA) r r~r = isTrackerA r r r~r
+BinaryRelation.isEquivRel.symmetric (isEquivRelIsEquivTracker R S) (a , isTrackerA) (b , isTrackerB) a~b r r~r =
+  isSymmetric S (a  r) (b  r) (a~b r r~r)
+BinaryRelation.isEquivRel.transitive (isEquivRelIsEquivTracker R S) (a , isTrackerA) (b , isTrackerB) (c , isTrackerC) a~b b~c r r~r =
+  isTransitive S (a  r) (b  r) (c  r) (a~b r r~r) (b~c r r~r)
+
+isPropIsEquivTracker :  R S a b  isProp (isEquivTracker R S a b)
+isPropIsEquivTracker R S (a , isTrackerA) (b , isTrackerB) = isPropΠ2 λ r r~r  isPropValued S (a  r) (b  r)
+
+isEffectiveIsEquivTracker :  R S  BR.isEffective (isEquivTracker R S)
+isEffectiveIsEquivTracker R S = isEquivRel→isEffective (isPropIsEquivTracker R S) (isEquivRelIsEquivTracker R S)
+
+perMorphism : (R S : PER)  Type 
+perMorphism R S = perTracker R S / (isEquivTracker R S)
+
+effectiveIsEquivTracker :  R S a b  [ a ]  [ b ]  isEquivTracker R S a b
+effectiveIsEquivTracker R S a b eq' = effective (isPropIsEquivTracker R S) (isEquivRelIsEquivTracker R S) a b eq'
+
+isSetPerMorphism :  R S  isSet (perMorphism R S)
+isSetPerMorphism R S = squash/
+
+idPerMorphism : (R : PER)  perMorphism R R
+idPerMorphism R = [ Id ,  r r' r~r'  subst2  r r'  r ~[ R ] r') (sym (Ida≡a r)) (sym (Ida≡a r')) r~r') ]
+
+composePerTracker : (R S T : PER)  perTracker R S  perTracker S T  perTracker R T
+composePerTracker R S T (a , a⊩f) (b , b⊩g) =
+  let
+    realizer : Term as 1
+    realizer = ` b ̇ (` a ̇ # zero)
+  in
+  λ* realizer ,
+  λ r r' r~r' 
+    subst2
+      _~[ T ]_
+      (sym (λ*ComputationRule realizer r))
+      (sym (λ*ComputationRule realizer r'))
+      (b⊩g (a  r) (a  r') (a⊩f r r' r~r'))
+
+composePerMorphism : (R S T : PER)  perMorphism R S  perMorphism S T  perMorphism R T
+composePerMorphism R S T f g =
+  SQ.rec2
+    squash/
+     { (a , a⊩f) (b , b⊩g) 
+      [ composePerTracker R S T (a , a⊩f) (b , b⊩g) ] })
+     { (a , a⊩f) (b , b⊩f) (c , c⊩g) a~b 
+      eq/ _ _
+        λ r r~r 
+          subst2
+             car cbr  car ~[ T ] cbr)
+            (sym (λ*ComputationRule (` c ̇ (` a ̇ # zero)) r))
+            (sym (λ*ComputationRule (` c ̇ (` b ̇ # zero)) r))
+            (c⊩g (a  r) (b  r) (a~b r r~r)) })
+     { (a , a⊩f) (b , b⊩g) (c , c⊩g) b~c 
+      eq/ _ _
+        λ r r~r 
+          subst2
+             bar car  bar ~[ T ] car)
+            (sym (λ*ComputationRule (` b ̇ (` a ̇ # zero)) r))
+            (sym (λ*ComputationRule (` c ̇ (` a ̇ # zero)) r))
+            (b~c (a  r) (a⊩f r r r~r)) })
+    f g
+
+idLPerMorphism :  R S f  composePerMorphism R R S (idPerMorphism R) f  f
+idLPerMorphism R S f =
+  SQ.elimProp
+     f  squash/ (composePerMorphism R R S (idPerMorphism R) f) f)
+     { (a , a⊩f) 
+      eq/ _ _
+      λ r r~r 
+        subst
+           ar  ar ~[ S ] (a  r))
+          (sym (λ*ComputationRule (` a ̇ (` Id ̇ # zero)) r  cong  x  a  x) (Ida≡a r)))
+          (a⊩f r r r~r) })
+    f
+
+idRPerMorphism :  R S f  composePerMorphism R S S f (idPerMorphism S)  f
+idRPerMorphism R S f =
+  SQ.elimProp
+     f  squash/ (composePerMorphism R S S f (idPerMorphism S)) f)
+     { (a , a⊩f) 
+      eq/ _ _
+        λ r r~r 
+          subst  ar  ar ~[ S ] (a  r)) (sym (λ*ComputationRule (` Id ̇ (` a ̇ # zero)) r  Ida≡a (a  r))) (a⊩f r r r~r) })
+    f
+
+assocPerMorphism :  R S T U f g h  composePerMorphism R T U (composePerMorphism R S T f g) h  composePerMorphism R S U f (composePerMorphism S T U g h)
+assocPerMorphism R S T U f g h =
+  SQ.elimProp3
+     f g h  squash/ (composePerMorphism R T U (composePerMorphism R S T f g) h) (composePerMorphism R S U f (composePerMorphism S T U g h)))
+     { (a , a⊩f) (b , b⊩g) (c , c⊩h) 
+      eq/ _ _
+        λ r r~r 
+          subst2
+             cba cba'  cba ~[ U ] cba')
+            (sym (λ*ComputationRule (` c ̇ (`  as  (λ*abst (` b ̇ (` a ̇ # zero))) []  ̇ # zero)) r  cong  bar  c  bar) (λ*ComputationRule (` b ̇ (` a ̇ # zero)) r)))
+            (sym (λ*ComputationRule (`  as  (λ*abst (` c ̇ (` b ̇ # zero))) [] ̇ (` a ̇ # zero)) r  λ*ComputationRule (` c ̇ (` b ̇ # zero)) (a  r)))
+            (c⊩h (b  (a  r)) (b  (a  r)) (b⊩g (a  r) (a  r) (a⊩f r r r~r)) ) })
+    f g h
+
+PERCat : Category (ℓ-suc ) 
+Category.ob PERCat = PER
+Category.Hom[_,_] PERCat R S = perMorphism R S
+Category.id PERCat {R} = idPerMorphism R
+Category._⋆_ PERCat {R} {S} {T} f g = composePerMorphism R S T f g
+Category.⋆IdL PERCat {R} {S} f = idLPerMorphism R S f
+Category.⋆IdR PERCat {R} {S} f = idRPerMorphism R S f
+Category.⋆Assoc PERCat {R} {S} {T} {U} f g h = assocPerMorphism R S T U f g h
+Category.isSetHom PERCat {R} {S} = isSetPerMorphism R S
+
\ No newline at end of file diff --git a/docs/Realizability.PERs.ResizedPER.html b/docs/Realizability.PERs.ResizedPER.html new file mode 100644 index 0000000..7b8bf8c --- /dev/null +++ b/docs/Realizability.PERs.ResizedPER.html @@ -0,0 +1,197 @@ + +Realizability.PERs.ResizedPER
open import Realizability.ApplicativeStructure
+open import Realizability.CombinatoryAlgebra
+open import Realizability.PropResizing
+open import Cubical.Foundations.Prelude
+open import Cubical.Foundations.Structure using (⟨_⟩; str)
+open import Cubical.Foundations.Isomorphism
+open import Cubical.Foundations.Equiv
+open import Cubical.Foundations.Univalence
+open import Cubical.Foundations.Powerset
+open import Cubical.Foundations.HLevels
+open import Cubical.Foundations.Path
+open import Cubical.Functions.FunExtEquiv
+open import Cubical.Relation.Binary
+open import Cubical.Data.Sigma
+open import Cubical.Data.FinData
+open import Cubical.Data.Vec
+open import Cubical.Reflection.RecordEquiv
+open import Cubical.HITs.PropositionalTruncation as PT hiding (map)
+open import Cubical.HITs.PropositionalTruncation.Monad
+open import Cubical.HITs.SetQuotients as SQ
+open import Cubical.Categories.Category
+open import Cubical.Categories.Functor hiding (Id)
+
+module Realizability.PERs.ResizedPER
+  {} {A : Type } (ca : CombinatoryAlgebra A) (resizing : hPropResizing ) where
+
+open import Realizability.Assembly.Base ca
+open import Realizability.Assembly.Morphism ca
+open import Realizability.PERs.PER ca
+open import Realizability.Modest.Base ca
+
+open CombinatoryAlgebra ca
+open Combinators ca renaming (i to Id; ia≡a to Ida≡a)
+
+smallHProp = resizing .fst
+hProp≃smallHProp = resizing .snd
+smallHProp≃hProp = invEquiv hProp≃smallHProp
+
+isSetSmallHProp : isSet smallHProp
+isSetSmallHProp = isOfHLevelRespectEquiv 2 hProp≃smallHProp isSetHProp
+
+hPropIsoSmallHProp : Iso (hProp ) smallHProp
+hPropIsoSmallHProp = equivToIso hProp≃smallHProp
+
+shrink : hProp   smallHProp
+shrink = Iso.fun hPropIsoSmallHProp
+
+enlarge : smallHProp  hProp 
+enlarge = Iso.inv hPropIsoSmallHProp
+
+enlarge⋆shrink≡id : section shrink enlarge
+enlarge⋆shrink≡id = Iso.rightInv hPropIsoSmallHProp
+
+shrink⋆enlarge≡id : retract shrink enlarge
+shrink⋆enlarge≡id = Iso.leftInv hPropIsoSmallHProp
+
+extractType : smallHProp  Type 
+extractType p =  enlarge p 
+
+isPropExtractType :  p  isProp (extractType p)
+isPropExtractType p = str (enlarge p)
+
+extractFromShrunk :  p isPropP  extractType (shrink (p , isPropP))  p
+extractFromShrunk p isPropP =
+  extractType (shrink (p , isPropP))
+    ≡⟨ refl 
+   enlarge (shrink (p , isPropP)) 
+    ≡⟨ cong ⟨_⟩ (shrink⋆enlarge≡id (p , isPropP)) 
+  p
+    
+
+shrinkFromExtracted :  p  shrink (extractType p , isPropExtractType p)  p
+shrinkFromExtracted p =
+  shrink (extractType p , isPropExtractType p)
+    ≡⟨ refl 
+  shrink (enlarge p)
+    ≡⟨ enlarge⋆shrink≡id p 
+  p
+    
+
+record ResizedPER : Type  where
+  no-eta-equality
+  constructor makeResizedPER
+  field
+    relation : A  A  smallHProp
+    isSymmetric :  a b  extractType (relation a b)  extractType (relation b a)
+    isTransitive :  a b c  extractType (relation a b)  extractType (relation b c)  extractType (relation a c)
+
+open ResizedPER
+
+unquoteDecl ResizedPERIsoΣ = declareRecordIsoΣ ResizedPERIsoΣ (quote ResizedPER)
+
+ResizedPERΣ : Type 
+ResizedPERΣ =
+  Σ[ relation  (A  A  smallHProp) ]
+  (∀ a b  extractType (relation a b)  extractType (relation b a)) ×
+  (∀ a b c  extractType (relation a b)  extractType (relation b c)  extractType (relation a c))
+
+isSetResizedPERΣ : isSet ResizedPERΣ
+isSetResizedPERΣ =
+  isSetΣ
+    (isSet→ (isSet→ isSetSmallHProp))
+     relation  isProp→isSet (isProp× (isPropΠ3 λ _ _ _  isPropExtractType _) (isPropΠ5 λ _ _ _ _ _  isPropExtractType _)))
+
+isSetResizedPER : isSet ResizedPER
+isSetResizedPER = isOfHLevelRetractFromIso 2 ResizedPERIsoΣ isSetResizedPERΣ
+
+ResizedPER≡Iso :  (R S : ResizedPER)  Iso (R  S) (∀ a b  R .relation a b  S .relation a b)
+Iso.fun (ResizedPER≡Iso R S) R≡S a b i = (R≡S i) .relation a b
+relation (Iso.inv (ResizedPER≡Iso R S) pointwise i) a b = pointwise a b i
+isSymmetric (Iso.inv (ResizedPER≡Iso R S) pointwise i) =
+  isProp→PathP
+    {B = λ j  (a b : A)  extractType (pointwise a b j)  extractType (pointwise b a j)}
+     j  isPropΠ3 λ _ _ _  isPropExtractType _)
+    (isSymmetric R)
+    (isSymmetric S) i
+isTransitive (Iso.inv (ResizedPER≡Iso R S) pointwise i) =
+  isProp→PathP
+    {B = λ j  (a b c : A)  extractType (pointwise a b j)  extractType (pointwise b c j)  extractType (pointwise a c j)}
+     j  isPropΠ5 λ _ _ _ _ _  isPropExtractType _)
+    (R .isTransitive)
+    (S .isTransitive)
+    i
+Iso.rightInv (ResizedPER≡Iso R S) pointwise = refl
+Iso.leftInv (ResizedPER≡Iso R S) R≡S = isSetResizedPER R S _ _
+
+ResizedPER≡ :  (R S : ResizedPER)  (∀ a b  R .relation a b  S .relation a b)  R  S
+ResizedPER≡ R S pointwise = Iso.inv (ResizedPER≡Iso R S) pointwise
+
+ResizedPERIsoPER : Iso ResizedPER PER
+PER.relation (Iso.fun ResizedPERIsoPER resized) a b = extractType (resized .relation a b)
+PER.isPropValued (Iso.fun ResizedPERIsoPER resized) a b = isPropExtractType _
+fst (PER.isPER (Iso.fun ResizedPERIsoPER resized)) a b a~b = resized .isSymmetric a b a~b
+snd (PER.isPER (Iso.fun ResizedPERIsoPER resized)) a b c a~b b~c = resized .isTransitive a b c a~b b~c
+relation (Iso.inv ResizedPERIsoPER per) a b = shrink (per .PER.relation a b , per .PER.isPropValued a b)
+isSymmetric (Iso.inv ResizedPERIsoPER per) a b a~[resized]b = b~[resized]a where
+  a~b : per .PER.relation a b
+  a~b = transport (extractFromShrunk _ _) a~[resized]b
+
+  b~a : per .PER.relation b a
+  b~a = per .PER.isPER .fst a b a~b
+
+  b~[resized]a : extractType (shrink (per .PER.relation b a , per .PER.isPropValued b a))
+  b~[resized]a = transport (sym (extractFromShrunk _ _)) b~a
+isTransitive (Iso.inv ResizedPERIsoPER per) a b c a~[resized]b b~[resized]c = a~[resized]c where
+  a~b : per .PER.relation a b
+  a~b = transport (extractFromShrunk _ _) a~[resized]b
+
+  b~c : per .PER.relation b c
+  b~c = transport (extractFromShrunk _ _) b~[resized]c
+
+  a~c : per .PER.relation a c
+  a~c = per .PER.isPER .snd a b c a~b b~c
+
+  a~[resized]c : extractType (shrink (per .PER.relation a c , per .PER.isPropValued a c))
+  a~[resized]c = transport (sym (extractFromShrunk _ _)) a~c
+Iso.rightInv ResizedPERIsoPER per =
+  PER≡ _ _
+    (funExt₂
+      λ a b 
+        extractFromShrunk (per .PER.relation a b) (per .PER.isPropValued a b))
+Iso.leftInv ResizedPERIsoPER resizedPer =
+  ResizedPER≡ _ _
+    λ a b  shrinkFromExtracted (resizedPer .relation a b)
+
+opaque
+  shrinkPER : PER  ResizedPER
+  shrinkPER = ResizedPERIsoPER .Iso.inv
+
+opaque
+  enlargePER : ResizedPER  PER
+  enlargePER = ResizedPERIsoPER .Iso.fun
+
+opaque
+  unfolding shrinkPER
+  unfolding enlargePER
+  shrinkPER⋆enlargePER≡id :  resized  shrinkPER (enlargePER resized)  resized
+  shrinkPER⋆enlargePER≡id resized = ResizedPERIsoPER .Iso.leftInv resized
+
+opaque
+  unfolding shrinkPER
+  unfolding enlargePER
+  enlargePER⋆shrinkPER≡id :  per  enlargePER (shrinkPER per)  per
+  enlargePER⋆shrinkPER≡id per = ResizedPERIsoPER .Iso.rightInv per
+
+ResizedPER≃PER : ResizedPER  PER
+ResizedPER≃PER = isoToEquiv ResizedPERIsoPER
+
+opaque
+  transportFromSmall :  {ℓ'} {P : ResizedPER  Type ℓ'}  (∀ per  P (shrinkPER per))   resized  P resized
+  transportFromSmall {ℓ'} {P} small resized = subst P (shrinkPER⋆enlargePER≡id resized) (small (enlargePER resized))
+
+opaque
+  transportFromLarge :  {ℓ'} {P : PER  Type ℓ'}  (∀ resized  P (enlargePER resized))   per  P per
+  transportFromLarge {ℓ'} {P} large per = subst P (enlargePER⋆shrinkPER≡id per) (large (shrinkPER per))
+
\ No newline at end of file diff --git a/docs/Realizability.PERs.SubQuotient.html b/docs/Realizability.PERs.SubQuotient.html new file mode 100644 index 0000000..e244cc6 --- /dev/null +++ b/docs/Realizability.PERs.SubQuotient.html @@ -0,0 +1,271 @@ + +Realizability.PERs.SubQuotient
open import Realizability.ApplicativeStructure
+open import Realizability.CombinatoryAlgebra
+open import Realizability.PropResizing
+open import Cubical.Foundations.Prelude
+open import Cubical.Foundations.Structure using (⟨_⟩; str)
+open import Cubical.Foundations.Isomorphism
+open import Cubical.Foundations.Equiv
+open import Cubical.Foundations.Univalence
+open import Cubical.Foundations.Powerset
+open import Cubical.Foundations.HLevels
+open import Cubical.Foundations.Path
+open import Cubical.Foundations.Function
+open import Cubical.Functions.FunExtEquiv
+open import Cubical.Functions.Embedding
+open import Cubical.Functions.Surjection
+open import Cubical.Relation.Binary
+open import Cubical.Data.Sigma
+open import Cubical.Data.FinData
+open import Cubical.Data.Vec
+open import Cubical.Reflection.RecordEquiv
+open import Cubical.HITs.PropositionalTruncation as PT hiding (map)
+open import Cubical.HITs.PropositionalTruncation.Monad
+open import Cubical.HITs.SetQuotients as SQ
+open import Cubical.Categories.Category
+open import Cubical.Categories.Functor hiding (Id)
+
+module Realizability.PERs.SubQuotient
+  {} {A : Type } (ca : CombinatoryAlgebra A) where
+
+open import Realizability.Assembly.Base ca
+open import Realizability.Assembly.Morphism ca
+open import Realizability.PERs.PER ca
+open import Realizability.Modest.Base ca
+
+open CombinatoryAlgebra ca
+open Combinators ca renaming (i to Id; ia≡a to Ida≡a)
+
+module _
+  (per : PER) where
+
+  domain : Type 
+  domain = Σ[ a  A ] (per .PER.relation a a)
+
+  subQuotient : Type 
+  subQuotient = domain / λ { (a , _) (b , _)  per .PER.relation a b }
+
+  subQuotientRealizability : A  subQuotient  hProp 
+  subQuotientRealizability r [a] =
+    SQ.rec
+      isSetHProp
+       { (a , a~a)  r ~[ per ] a , isProp~ r per a })
+       { (a , a~a) (b , b~b) a~b 
+        Σ≡Prop
+           x  isPropIsProp)
+          (hPropExt
+            (isProp~ r per a)
+            (isProp~ r per b)
+             r~a  PER.isTransitive per r a b r~a a~b)
+             r~b  PER.isTransitive per r b a r~b (PER.isSymmetric per a b a~b))) })
+      [a]
+      
+  
+  subQuotientAssembly : Assembly subQuotient
+  Assembly._⊩_ subQuotientAssembly r [a] =  subQuotientRealizability r [a] 
+  Assembly.isSetX subQuotientAssembly = squash/
+  Assembly.⊩isPropValued subQuotientAssembly r [a] = str (subQuotientRealizability r [a])
+  Assembly.⊩surjective subQuotientAssembly [a] =
+    SQ.elimProp
+      {P = λ [a]  ∃[ r  A ]  subQuotientRealizability r [a] }
+       [a]  isPropPropTrunc)
+       { (a , a~a)  return (a , a~a) })
+      [a]
+      
+  isModestSubQuotientAssembly : isModest subQuotientAssembly
+  isModestSubQuotientAssembly x y a a⊩x a⊩y =
+    SQ.elimProp2
+      {P = λ x y  motive x y}
+      isPropMotive
+       { (x , x~x) (y , y~y) a a~x a~y 
+        eq/ (x , x~x) (y , y~y) (PER.isTransitive per x a y (PER.isSymmetric per a x a~x) a~y) })
+      x y
+      a a⊩x a⊩y where
+        motive :  (x y : subQuotient)  Type 
+        motive x y =  (a : A) (a⊩x : a ⊩[ subQuotientAssembly ] x) (a⊩y : a ⊩[ subQuotientAssembly ] y)  x  y
+
+        isPropMotive :  x y  isProp (motive x y)
+        isPropMotive x y = isPropΠ3 λ _ _ _  squash/ x y
+
+module _ (R S : PER) (f : perMorphism R S) where
+  
+  subQuotientAssemblyMorphism : AssemblyMorphism (subQuotientAssembly R) (subQuotientAssembly S)
+  subQuotientAssemblyMorphism =
+    SQ.rec
+      (isSetAssemblyMorphism (subQuotientAssembly R) (subQuotientAssembly S))
+      mainMap
+      mainMapCoherence
+      f where
+
+      mainMap : perTracker R S  AssemblyMorphism (subQuotientAssembly R) (subQuotientAssembly S)
+      AssemblyMorphism.map (mainMap (f , fIsTracker)) sqR =
+        SQ.rec
+          squash/
+          mainMapRepr
+          mainMapReprCoherence
+          sqR module MainMapDefn where
+            mainMapRepr : domain R  subQuotient S
+            mainMapRepr (r , r~r) = [ f  r , fIsTracker r r r~r ]
+
+            mainMapReprCoherence : (a b : domain R)  R .PER.relation (a .fst) (b .fst)  mainMapRepr a  mainMapRepr b
+            mainMapReprCoherence (a , a~a) (b , b~b) a~b = eq/ _ _ (fIsTracker a b a~b)
+ 
+      AssemblyMorphism.tracker (mainMap (f , fIsTracker)) =
+        do
+          return
+            (f ,
+             sqR s s⊩sqR 
+              SQ.elimProp
+                {P =
+                  λ sqR
+                    (s : A)
+                   s ⊩[ subQuotientAssembly R ] sqR
+                    subQuotientRealizability S (f  s) (SQ.rec squash/ (MainMapDefn.mainMapRepr f fIsTracker sqR) (MainMapDefn.mainMapReprCoherence f fIsTracker sqR) sqR) }
+                 sqR  isPropΠ2 λ s s⊩sqR  str (subQuotientRealizability S (f  s) (SQ.rec squash/ (MainMapDefn.mainMapRepr f fIsTracker sqR) (MainMapDefn.mainMapReprCoherence f fIsTracker sqR) sqR)))
+                 { (a , a~a) s s~a  fIsTracker s a s~a })
+                sqR s s⊩sqR))
+
+      mainMapCoherence : (a b : perTracker R S)  isEquivTracker R S a b  mainMap a  mainMap b
+      mainMapCoherence (a , a~a) (b , b~b) a~b =
+        AssemblyMorphism≡ _ _
+          (funExt
+            λ sq 
+              SQ.elimProp
+                {P =
+                  λ sq 
+                    SQ.rec
+                      squash/
+                      (MainMapDefn.mainMapRepr a a~a sq)
+                      (MainMapDefn.mainMapReprCoherence a a~a sq) sq
+                    
+                    SQ.rec
+                      squash/
+                      (MainMapDefn.mainMapRepr b b~b sq)
+                      (MainMapDefn.mainMapReprCoherence b b~b sq) sq}
+                 sq  squash/ _ _)
+                 { (r , r~r)  eq/ _ _ (a~b r r~r) })
+                sq)
+    
+module _ (R S : PER) (f : AssemblyMorphism (subQuotientAssembly R) (subQuotientAssembly S)) where
+  subQuotientAssemblyMorphism→perMorphism : perMorphism R S
+  subQuotientAssemblyMorphism→perMorphism =
+    PT.rec→Set squash/ mainMap mainMap2Constant (f .tracker) module InverseDefinition where
+      isSQTracker : A  Type 
+      isSQTracker t =  (q : subQuotient R) (a : A)  a ⊩[ subQuotientAssembly R ] q   subQuotientRealizability S (t  a) (f .AssemblyMorphism.map q) 
+      -- 🤢🤮
+      mainMap : Σ[ t  A ] (isSQTracker t)  perMorphism R S
+      mainMap (t , t⊩f) =
+        [ t ,
+           r r' r~r' 
+            let
+              r~r : r ~[ R ] r
+              r~r = PER.isTransitive R r r' r r~r' (PER.isSymmetric R r r' r~r')
+
+              r'~r' : r' ~[ R ] r'
+              r'~r' = PER.isTransitive R r' r r' (PER.isSymmetric R r r' r~r') r~r'
+            in
+            SQ.elimProp
+              {P = λ q   (t : A)   subQuotientRealizability S (t  r) q    subQuotientRealizability S (t  r') q   (t  r) ~[ S ] (t  r')}
+               q  isPropΠ3 λ t _ _  isProp~ (t  r) S (t  r'))
+               { (s , s~s) t tr~s tr'~s  PER.isTransitive S (t  r) s (t  r') tr~s (PER.isSymmetric S (t  r') s tr'~s) })
+              (f .AssemblyMorphism.map [ (r , r~r) ])
+              t
+              (t⊩f [ (r , r~r) ] r r~r)
+              (subst  eq   subQuotientRealizability S (t  r') (f .AssemblyMorphism.map eq) ) (eq/ _ _ (PER.isSymmetric R r r' r~r')) (t⊩f [ (r' , r'~r') ] r' r'~r'))) ]
+
+      mainMap2Constant : 2-Constant mainMap
+      mainMap2Constant (t , t⊩f) (t' , t'⊩f) =
+        eq/ _ _
+          λ r r~r 
+            SQ.elimProp
+              {P = λ q   subQuotientRealizability S (t  r) q    subQuotientRealizability S (t'  r) q   (t  r) ~[ S ] (t'  r)}
+               q  isPropΠ2 λ _ _  isProp~ (t  r) S (t'  r))
+               { (s , s~s) tr~s t'r~s  PER.isTransitive S (t  r) s (t'  r) tr~s (PER.isSymmetric S (t'  r) s t'r~s) })
+              (f .AssemblyMorphism.map [ (r , r~r) ])
+              (t⊩f [ (r , r~r) ] r r~r)
+              (t'⊩f [ (r , r~r) ] r r~r)
+
+subQuotientModestSet : PER  MOD .Category.ob
+subQuotientModestSet R = subQuotient R , subQuotientAssembly R , isModestSubQuotientAssembly R
+
+subQuotientFunctor : Functor PERCat MOD
+Functor.F-ob subQuotientFunctor R = subQuotientModestSet R
+Functor.F-hom subQuotientFunctor {R} {S} f = subQuotientAssemblyMorphism R S f
+Functor.F-id subQuotientFunctor {R} =
+  AssemblyMorphism≡ _ _
+    (funExt
+      λ sqR 
+        SQ.elimProp
+          {P = λ sqR  subQuotientAssemblyMorphism R R (PERCat .Category.id {R}) .AssemblyMorphism.map sqR  identityMorphism (subQuotientAssembly R) .AssemblyMorphism.map sqR}
+           sqR  squash/ _ _)
+           { (a , a~a) 
+            eq/ _ _
+              (subst (_~[ R ] a) (sym (Ida≡a a)) a~a) })
+          sqR)
+Functor.F-seq subQuotientFunctor {R} {S} {T} f g =
+  AssemblyMorphism≡ _ _
+    (funExt
+      λ sq 
+        SQ.elimProp3
+          {P = λ sqR f g 
+            subQuotientAssemblyMorphism R T (seq' PERCat {R} {S} {T} f g) .AssemblyMorphism.map sqR 
+            seq' MOD
+              {x = subQuotientModestSet R}
+              {y = subQuotientModestSet S}
+              {z = subQuotientModestSet T}
+              (subQuotientAssemblyMorphism R S f) (subQuotientAssemblyMorphism S T g) .AssemblyMorphism.map sqR}
+           sq f g  squash/ _ _)
+           { (a , a~a) (b , bIsTracker) (c , cIsTracker) 
+            eq/ _ _ (subst (_~[ T ] (c  (b  a))) (sym (λ*ComputationRule (` c ̇ (` b ̇ # zero)) a)) (cIsTracker (b  a) (b  a) (bIsTracker a a a~a))) })
+          sq f g)
+
+hasPropFibersSubQuotientFunctor :  R S  hasPropFibers (subQuotientAssemblyMorphism R S)
+hasPropFibersSubQuotientFunctor R S f (x , sqX≡f) (y , sqY≡f) =
+  Σ≡Prop
+       perMap  isSetAssemblyMorphism (subQuotientAssembly R) (subQuotientAssembly S) _ _)
+      (SQ.elimProp2
+        {P = λ x y  subQuotientAssemblyMorphism R S x  f  subQuotientAssemblyMorphism R S y  f  x  y}
+         x y  isPropΠ2 λ _ _  squash/ _ _)
+         { (x , x⊩f) (y , y⊩f) sqX≡f sqY≡f 
+          eq/ _ _
+            λ r r~r 
+              SQ.elimProp
+                {P = λ f[r]   subQuotientRealizability S (x  r) f[r]     subQuotientRealizability S (y  r) f[r]   (x  r) ~[ S ] (y  r)}
+                 f[r]  isPropΠ2 λ _ _  isProp~ (x  r) S (y  r))
+                 { (s , s~s) xr~s yr~s  PER.isTransitive S (x  r) s (y  r) xr~s (PER.isSymmetric S (y  r) s yr~s) })
+                (f .AssemblyMorphism.map [ (r , r~r) ])
+                (subst  f[r]   subQuotientRealizability S (x  r) f[r] ) (cong  m  m .AssemblyMorphism.map [ (r , r~r) ]) sqX≡f) (x⊩f r r r~r))
+                (subst  f[r]   subQuotientRealizability S (y  r) f[r] ) (cong  m  m .AssemblyMorphism.map [ (r , r~r) ]) sqY≡f) (y⊩f r r r~r)) })
+        x y sqX≡f sqY≡f)
+
+fiberSubQuotientFunctor :  R S f  fiber (subQuotientAssemblyMorphism R S) f
+fiberSubQuotientFunctor R S f =
+  (subQuotientAssemblyMorphism→perMorphism R S f) ,
+  (AssemblyMorphism≡ _ _
+      (funExt
+         qR 
+          SQ.elimProp
+            {P = λ qR  subQuotientAssemblyMorphism R S (subQuotientAssemblyMorphism→perMorphism R S f) .AssemblyMorphism.map qR  f .AssemblyMorphism.map qR}
+             qR  squash/ _ _)
+             { (r , r~r) 
+              PT.elim
+                {P =
+                  λ fTracker 
+                    subQuotientAssemblyMorphism R S (PT.rec→Set squash/ (InverseDefinition.mainMap R S f) (InverseDefinition.mainMap2Constant R S f) fTracker) .AssemblyMorphism.map [ (r , r~r) ]
+                     f .AssemblyMorphism.map [ (r , r~r) ]}
+                 fTracker  squash/ _ _)
+                 { (t , tIsTracker) 
+                  SQ.elimProp
+                    {P =
+                      λ fqR   subQuotientRealizability S (t  r) fqR  
+                        subQuotientAssemblyMorphism R S (InverseDefinition.mainMap R S f (t , tIsTracker)) .AssemblyMorphism.map [ (r , r~r) ]  fqR}
+                     fqR  isProp→ (squash/ _ _))
+                     { (s , s~s) tr~s  eq/ _ _ tr~s })
+                    (f .AssemblyMorphism.map [ (r , r~r) ])
+                    (tIsTracker [ (r , r~r) ] r r~r) })
+                (f .tracker) })
+            qR)))
+
+isFullyFaithfulSubQuotientFunctor : Functor.isFullyFaithful subQuotientFunctor
+equiv-proof (isFullyFaithfulSubQuotientFunctor R S) f = inhProp→isContr (fiberSubQuotientFunctor R S f) (hasPropFibersSubQuotientFunctor R S f)
+
\ No newline at end of file diff --git a/docs/Realizability.PropResizing.html b/docs/Realizability.PropResizing.html index 5c3006b..3582d77 100644 --- a/docs/Realizability.PropResizing.html +++ b/docs/Realizability.PropResizing.html @@ -1,25 +1,79 @@ Realizability.PropResizing
open import Cubical.Foundations.Prelude
 open import Cubical.Foundations.Equiv
-open import Cubical.Foundations.HLevels
-open import Cubical.Foundations.Structure
-open import Cubical.Data.Sigma
+open import Cubical.Foundations.Equiv.Properties
+open import Cubical.Foundations.HLevels
+open import Cubical.Foundations.Structure
+open import Cubical.Foundations.Powerset
+open import Cubical.Data.Sigma
 
-module Realizability.PropResizing where
+module Realizability.PropResizing where
 
--- Formulation of propositional resizing inspired by the corresponding formulation
--- in TypeTopology
--- https://www.cs.bham.ac.uk/~mhe/TypeTopology/UF.Size.html
+-- Formulation of propositional resizing inspired by the corresponding formulation
+-- in TypeTopology
+-- https://www.cs.bham.ac.uk/~mhe/TypeTopology/UF.Size.html
 
-copyOf :  {}  Type   (ℓ' : Level)  Type _
-copyOf {} X ℓ' = Σ[ copy  Type ℓ' ] X  copy
+copyOf :  {}  Type   (ℓ' : Level)  Type _
+copyOf {} X ℓ' = Σ[ copy  Type ℓ' ] X  copy
 
-copy = fst
-copyEquiv = snd
+copy = fst
+copyEquiv = snd
 
--- We need the principle that TypeTopology calls Ω resizing
--- that the universe of props in a universe 𝓤 has a copy in 𝓤
--- This we call hPropResizing
-hPropResizing :    Type _
-hPropResizing  = copyOf (hProp ) 
+-- We need the principle that TypeTopology calls Ω resizing
+-- that the universe of props in a universe 𝓤 has a copy in 𝓤
+-- This we call hPropResizing
+hPropResizing :    Type _
+hPropResizing  = copyOf (hProp ) 
+
+-- We obtain a copy of the powerset using hPropResizing
+module ResizedPowerset {} (resizing : hPropResizing ) where
+
+  smallHProp = resizing .fst
+  hProp≃smallHProp = resizing .snd
+  smallHProp≃hProp = invEquiv hProp≃smallHProp
+
+  𝓟 : Type   Type 
+  𝓟 X = X  smallHProp
+
+  ℙ≃𝓟 :  X   X  𝓟 X
+  ℙ≃𝓟 X =
+     X
+      ≃⟨ idEquiv ( X) 
+    (X  hProp )
+      ≃⟨ equiv→ (idEquiv X) hProp≃smallHProp 
+    (X  smallHProp)
+      ≃⟨ idEquiv (𝓟 X) 
+    𝓟 X
+      
+
+  𝓟≃ℙ :  X  𝓟 X   X
+  𝓟≃ℙ X = invEquiv (ℙ≃𝓟 X)
+
+  ℙ→𝓟 :  X   X  𝓟 X
+  ℙ→𝓟 X = equivFun (ℙ≃𝓟 X)
+
+  𝓟→ℙ :  X  𝓟 X   X
+  𝓟→ℙ X = equivFun (invEquiv (ℙ≃𝓟 X))
+
+  compIsIdEquiv :  X  compEquiv (ℙ≃𝓟 X) (invEquiv (ℙ≃𝓟 X))  idEquiv ( X)
+  compIsIdEquiv X = invEquiv-is-rinv (ℙ≃𝓟 X)
+
+  compIsIdFunc :  {X} (p :  X)  𝓟→ℙ X (ℙ→𝓟 X p)  p
+  compIsIdFunc {X} p i = equivFun (compIsIdEquiv X i) p
+
+  _ϵ_ :  {X}  X  𝓟 X  Type 
+  _ϵ_ {X} x P = x  𝓟→ℙ X P
+
+  isPropϵ :  {X} (x : X) P  isProp (x ϵ P)
+  isPropϵ {X} x P = ∈-isProp (𝓟→ℙ X P) x
+
+  isSet𝓟 :  X  isSet (𝓟 X)
+  isSet𝓟 X = isOfHLevelRespectEquiv 2 (ℙ≃𝓟 X) isSetℙ
+
+  𝓟≡Equiv :  {X} (P Q : 𝓟 X)  (P  Q)  (𝓟→ℙ X P  𝓟→ℙ X Q)
+  𝓟≡Equiv {X} P Q = congEquiv {x = P} {y = Q} (𝓟≃ℙ X)
+
+  𝓟≡ :  {X} (P Q : 𝓟 X)  𝓟→ℙ X P  𝓟→ℙ X Q  P  Q
+  𝓟≡ {X} P Q equ = equivFun (invEquiv (𝓟≡Equiv P Q)) equ
+  
 
\ No newline at end of file diff --git a/docs/Realizability.Topos.BinProducts.html b/docs/Realizability.Topos.BinProducts.html index aa2db2e..fac2dcc 100644 --- a/docs/Realizability.Topos.BinProducts.html +++ b/docs/Realizability.Topos.BinProducts.html @@ -1,5 +1,5 @@ -Realizability.Topos.BinProducts
open import Realizability.ApplicativeStructure renaming (Term to ApplStrTerm)
+Realizability.Topos.BinProducts
open import Realizability.ApplicativeStructure renaming (Term to ApplStrTerm)
 open import Realizability.CombinatoryAlgebra
 open import Cubical.Foundations.Prelude
 open import Cubical.Foundations.HLevels
@@ -17,7 +17,7 @@
 module Realizability.Topos.BinProducts
   { ℓ' ℓ''} {A : Type }
   (ca : CombinatoryAlgebra A)
-  (isNonTrivial : CombinatoryAlgebra.s ca  CombinatoryAlgebra.k ca  ) where
+  (isNonTrivial : CombinatoryAlgebra.s ca  CombinatoryAlgebra.k ca  ) where
 
 open import Realizability.Tripos.Prealgebra.Predicate {ℓ' = ℓ'} {ℓ'' = ℓ''} ca
 open import Realizability.Topos.Object { = } {ℓ' = ℓ'} {ℓ'' = ℓ''} ca isNonTrivial 
@@ -49,7 +49,7 @@
     Predicate.isSetX (PartialEquivalenceRelation.equality binProdObRT) =
       isSet× (isSet× isSetX isSetY) (isSet× isSetX isSetY)
     Predicate.∣ PartialEquivalenceRelation.equality binProdObRT  ((x , y) , x' , y') r =
-      (pr₁  r)   perX .equality  (x , x') × (pr₂  r)   perY .equality  (y , y')
+      (pr₁  r)   perX .equality  (x , x') × (pr₂  r)   perY .equality  (y , y')
     Predicate.isPropValued (PartialEquivalenceRelation.equality binProdObRT) ((x , y) , x' , y') r =
       isProp× (perX .equality .isPropValued _ _) (perY .equality .isPropValued _ _)
     isPartialEquivalenceRelation.isSetX (PartialEquivalenceRelation.isPerEquality binProdObRT) = isSet× isSetX isSetY
@@ -59,36 +59,36 @@
         (sY , sY⊩isSymmetricY)  perY .isSymmetric
         let
           prover : ApplStrTerm as 1
-          prover = ` pair ̇ (` sX ̇ (` pr₁ ̇ # zero)) ̇ (` sY ̇ (` pr₂ ̇ # zero))
+          prover = ` pair ̇ (` sX ̇ (` pr₁ ̇ # zero)) ̇ (` sY ̇ (` pr₂ ̇ # zero))
         return
-          (λ* prover ,
+          (λ* prover ,
            { (x , y) (x' , y') r (pr₁r⊩x~x' , pr₂r⊩y~y') 
             subst
                r'  r'   perX .equality  (x' , x))
-              (sym (cong  x  pr₁  x) (λ*ComputationRule prover r)  pr₁pxy≡x _ _))
-              (sX⊩isSymmetricX x x' (pr₁  r) pr₁r⊩x~x') ,
+              (sym (cong  x  pr₁  x) (λ*ComputationRule prover r)  pr₁pxy≡x _ _))
+              (sX⊩isSymmetricX x x' (pr₁  r) pr₁r⊩x~x') ,
             subst
                r'  r'   perY .equality  (y' , y))
-              (sym (cong  x  pr₂  x) (λ*ComputationRule prover r)  pr₂pxy≡y _ _))
-              (sY⊩isSymmetricY y y' (pr₂  r) pr₂r⊩y~y') }))
+              (sym (cong  x  pr₂  x) (λ*ComputationRule prover r)  pr₂pxy≡y _ _))
+              (sY⊩isSymmetricY y y' (pr₂  r) pr₂r⊩y~y') }))
     isPartialEquivalenceRelation.isTransitive (PartialEquivalenceRelation.isPerEquality binProdObRT) =
       do
         (tX , tX⊩isTransitiveX)  perX .isTransitive
         (tY , tY⊩isTransitiveY)  perY .isTransitive
         let
           prover : ApplStrTerm as 2
-          prover = ` pair ̇ (` tX ̇ (` pr₁ ̇ # one) ̇ (` pr₁ ̇ # zero)) ̇ (` tY ̇ (` pr₂ ̇ # one) ̇ (` pr₂ ̇ # zero))
+          prover = ` pair ̇ (` tX ̇ (` pr₁ ̇ # one) ̇ (` pr₁ ̇ # zero)) ̇ (` tY ̇ (` pr₂ ̇ # one) ̇ (` pr₂ ̇ # zero))
         return
-          (λ*2 prover ,
+          (λ*2 prover ,
            { (x , y) (x' , y') (x'' , y'') a b (pr₁a⊩x~x' , pr₂a⊩y~y') (pr₁b⊩x'~x'' , pr₂b⊩y'~y'') 
             subst
                r'  r'   perX .equality  (x , x''))
-              (sym (cong  x  pr₁  x) (λ*2ComputationRule prover a b)  pr₁pxy≡x _ _))
-              (tX⊩isTransitiveX x x' x'' (pr₁  a) (pr₁  b) pr₁a⊩x~x' pr₁b⊩x'~x'') ,
+              (sym (cong  x  pr₁  x) (λ*2ComputationRule prover a b)  pr₁pxy≡x _ _))
+              (tX⊩isTransitiveX x x' x'' (pr₁  a) (pr₁  b) pr₁a⊩x~x' pr₁b⊩x'~x'') ,
             subst
                r'  r'   perY .equality  (y , y''))
-              (sym (cong  x  pr₂  x) (λ*2ComputationRule prover a b)  pr₂pxy≡y _ _))
-              (tY⊩isTransitiveY y y' y'' (pr₂  a) (pr₂  b) pr₂a⊩y~y' pr₂b⊩y'~y'') }))
+              (sym (cong  x  pr₂  x) (λ*2ComputationRule prover a b)  pr₂pxy≡y _ _))
+              (tY⊩isTransitiveY y y' y'' (pr₂  a) (pr₂  b) pr₂a⊩y~y' pr₂b⊩y'~y'') }))
 
   opaque
     unfolding binProdObRT
@@ -97,7 +97,7 @@
     FunctionalRelation.relation binProdPr₁FuncRel =
       record
         { isSetX = isSet× (isSet× isSetX isSetY) isSetX
-        ; ∣_∣ = λ { ((x , y) , x') r  (pr₁  r)   perX .equality  (x , x') × (pr₂  r)   perY .equality  (y , y) }
+        ; ∣_∣ = λ { ((x , y) , x') r  (pr₁  r)   perX .equality  (x , x') × (pr₂  r)   perY .equality  (y , y) }
         ; isPropValued =  { ((x , y) , x') r  isProp× (perX .equality .isPropValued _ _) (perY .equality .isPropValued _ _) }) }
     FunctionalRelation.isFuncRel binProdPr₁FuncRel =
       record
@@ -106,31 +106,31 @@
            (stD , stD⊩isStrictDomainEqX)  idFuncRel perX .isStrictDomain
            let
              prover : ApplStrTerm as 1
-             prover = ` pair ̇ (` stD ̇ (` pr₁ ̇ # zero)) ̇ (` pr₂ ̇ (# zero))
+             prover = ` pair ̇ (` stD ̇ (` pr₁ ̇ # zero)) ̇ (` pr₂ ̇ (# zero))
            return
-             (λ* prover ,
+             (λ* prover ,
               { (x , y) x' r (pr₁r⊩x~x' , pr₂r⊩y~y) 
                subst
                   r'  r'   perX .equality  (x , x))
-                 (sym (cong  x  pr₁  x) (λ*ComputationRule prover r)  pr₁pxy≡x _ _))
-                 (stD⊩isStrictDomainEqX x x' (pr₁  r) pr₁r⊩x~x') ,
+                 (sym (cong  x  pr₁  x) (λ*ComputationRule prover r)  pr₁pxy≡x _ _))
+                 (stD⊩isStrictDomainEqX x x' (pr₁  r) pr₁r⊩x~x') ,
                subst
                   r'  r'   perY .equality  (y , y))
-                 (sym (cong  x  pr₂  x) (λ*ComputationRule prover r)  pr₂pxy≡y _ _))
+                 (sym (cong  x  pr₂  x) (λ*ComputationRule prover r)  pr₂pxy≡y _ _))
                  pr₂r⊩y~y }))
        ; isStrictCodomain =
          do
            (stC , stC⊩isStrictCodomainEqX)  idFuncRel perX .isStrictCodomain
            let
              prover : ApplStrTerm as 1
-             prover = ` stC ̇ (` pr₁ ̇ # zero)
+             prover = ` stC ̇ (` pr₁ ̇ # zero)
            return
-             (λ* prover ,
+             (λ* prover ,
               λ { (x , y) x' r (pr₁r⊩x~x' , pr₂r⊩y~y) 
                 subst
                    r'  r'   perX .equality  (x' , x'))
-                  (sym (λ*ComputationRule prover r))
-                  (stC⊩isStrictCodomainEqX x x' (pr₁  r) pr₁r⊩x~x') })
+                  (sym (λ*ComputationRule prover r))
+                  (stC⊩isStrictCodomainEqX x x' (pr₁  r) pr₁r⊩x~x') })
        ; isRelational =
          do
            (stC , stC⊩isStrictCodomainEqY)  idFuncRel perY .isStrictCodomain
@@ -138,36 +138,36 @@
            (s , s⊩isSymmetricX)  perX .isSymmetric
            let
              prover : ApplStrTerm as 3
-             prover = ` pair ̇ (` t ̇ (` s ̇ (` pr₁ ̇ # two)) ̇ (` t ̇ (` pr₁ ̇ # one) ̇ # zero)) ̇ (` stC ̇ (` pr₂ ̇ # two))
+             prover = ` pair ̇ (` t ̇ (` s ̇ (` pr₁ ̇ # two)) ̇ (` t ̇ (` pr₁ ̇ # one) ̇ # zero)) ̇ (` stC ̇ (` pr₂ ̇ # two))
            return
-             (λ*3 prover ,
+             (λ*3 prover ,
               ((λ { (x , y) (x' , y') x'' x''' a b c (pr₁a⊩x~x' , pr₂a⊩y~y') (pr₁b⊩x~x'' , pr₂b⊩y~y) c⊩x''~x''' 
                 subst
                    r'  r'   perX .equality  (x' , x'''))
-                  (sym (cong  x  pr₁  x) (λ*3ComputationRule prover a b c)  pr₁pxy≡x _ _))
+                  (sym (cong  x  pr₁  x) (λ*3ComputationRule prover a b c)  pr₁pxy≡x _ _))
                   (t⊩isTransitiveX
                     x' x x'''
-                    (s  (pr₁  a)) (t  (pr₁  b)  c)
-                    (s⊩isSymmetricX x x' (pr₁  a) pr₁a⊩x~x')
-                    (t⊩isTransitiveX x x'' x''' (pr₁  b) c pr₁b⊩x~x'' c⊩x''~x''')) ,
+                    (s  (pr₁  a)) (t  (pr₁  b)  c)
+                    (s⊩isSymmetricX x x' (pr₁  a) pr₁a⊩x~x')
+                    (t⊩isTransitiveX x x'' x''' (pr₁  b) c pr₁b⊩x~x'' c⊩x''~x''')) ,
                 subst
                    r'  r'   perY .equality  (y' , y'))
-                  (sym (cong  x  pr₂  x) (λ*3ComputationRule prover a b c)  pr₂pxy≡y _ _))
-                  (stC⊩isStrictCodomainEqY y y' (pr₂  a) pr₂a⊩y~y') })))
+                  (sym (cong  x  pr₂  x) (λ*3ComputationRule prover a b c)  pr₂pxy≡y _ _))
+                  (stC⊩isStrictCodomainEqY y y' (pr₂  a) pr₂a⊩y~y') })))
        ; isSingleValued =
          do
            (t , t⊩isTransitive)  perX .isTransitive
            (s , s⊩isSymmetric)  perX .isSymmetric
            let
              prover : ApplStrTerm as 2
-             prover = ` t ̇ (` s ̇ (` pr₁ ̇ # one)) ̇ (` pr₁ ̇ # zero)
+             prover = ` t ̇ (` s ̇ (` pr₁ ̇ # one)) ̇ (` pr₁ ̇ # zero)
            return
-             (λ*2 prover ,
+             (λ*2 prover ,
                { (x , y) x' x'' r₁ r₂ (pr₁r₁⊩x~x' , pr₂r₁⊩y~y) (pr₁r₂⊩x~x'' , pr₂r₂⊩y~y) 
                 subst
                    r'  r'   perX .equality  (x' , x''))
-                  (sym (λ*2ComputationRule prover r₁ r₂))
-                  (t⊩isTransitive x' x x'' (s  (pr₁  r₁)) (pr₁  r₂) (s⊩isSymmetric x x' (pr₁  r₁) pr₁r₁⊩x~x') pr₁r₂⊩x~x'')}))
+                  (sym (λ*2ComputationRule prover r₁ r₂))
+                  (t⊩isTransitive x' x x'' (s  (pr₁  r₁)) (pr₁  r₂) (s⊩isSymmetric x x' (pr₁  r₁) pr₁r₁⊩x~x') pr₁r₂⊩x~x'')}))
        ; isTotal =
          do
            return
@@ -175,8 +175,8 @@
                { (x , y) r (pr₁r⊩x~x , pr₂r⊩y~y) 
                 return
                   (x ,
-                  ((subst  r'  r'   perX .equality  (x , x)) (cong  x  pr₁  x) (sym (Ida≡a _))) pr₁r⊩x~x) ,
-                   (subst  r'  r'   perY .equality  (y , y)) (cong  x  pr₂  x) (sym (Ida≡a _))) pr₂r⊩y~y))) }))
+                  ((subst  r'  r'   perX .equality  (x , x)) (cong  x  pr₁  x) (sym (Ida≡a _))) pr₁r⊩x~x) ,
+                   (subst  r'  r'   perY .equality  (y , y)) (cong  x  pr₂  x) (sym (Ida≡a _))) pr₂r⊩y~y))) }))
        }
 
   opaque
@@ -192,7 +192,7 @@
     FunctionalRelation.relation binProdPr₂FuncRel =
       record
         { isSetX = isSet× (isSet× isSetX isSetY) isSetY
-        ; ∣_∣ = λ { ((x , y) , y') r  (pr₁  r)   perY .equality  (y , y') × (pr₂  r)   perX .equality  (x , x) }
+        ; ∣_∣ = λ { ((x , y) , y') r  (pr₁  r)   perY .equality  (y , y') × (pr₂  r)   perX .equality  (x , x) }
         ; isPropValued = λ { ((x , y) , y') r  isProp× (perY .equality .isPropValued _ _) (perX .equality .isPropValued _ _) } }
     FunctionalRelation.isFuncRel binProdPr₂FuncRel =
       record
@@ -201,79 +201,79 @@
            (stD , stD⊩isStrictDomainEqY)  idFuncRel perY .isStrictDomain
            let
              prover : ApplStrTerm as 1
-             prover = ` pair ̇ (` pr₂ ̇ (# zero)) ̇ (` stD ̇ (` pr₁ ̇ # zero))
+             prover = ` pair ̇ (` pr₂ ̇ (# zero)) ̇ (` stD ̇ (` pr₁ ̇ # zero))
            return
-             (λ* prover ,
+             (λ* prover ,
               { (x , y) y' r (pr₁r⊩y~y' , pr₂r⊩x~x) 
                 subst
                    r'  r'   perX .equality  (x , x))
-                  (sym (cong  x  pr₁  x) (λ*ComputationRule prover r)  pr₁pxy≡x _ _))
+                  (sym (cong  x  pr₁  x) (λ*ComputationRule prover r)  pr₁pxy≡x _ _))
                   pr₂r⊩x~x ,
                 subst
                    r'  r'   perY .equality  (y , y))
-                  (sym (cong  x  pr₂  x) (λ*ComputationRule prover r)  pr₂pxy≡y _ _))
-                  (stD⊩isStrictDomainEqY y y' (pr₁  r) pr₁r⊩y~y') }))
+                  (sym (cong  x  pr₂  x) (λ*ComputationRule prover r)  pr₂pxy≡y _ _))
+                  (stD⊩isStrictDomainEqY y y' (pr₁  r) pr₁r⊩y~y') }))
        ; isStrictCodomain =
          do
            (stC , stC⊩isStrictCodomainEqY)  idFuncRel perY .isStrictCodomain
            let
              prover : ApplStrTerm as 1
-             prover = ` stC ̇ (` pr₁ ̇ # zero)
+             prover = ` stC ̇ (` pr₁ ̇ # zero)
            return
-             (λ* prover ,
+             (λ* prover ,
               { (x , y) y' r (pr₁r⊩y~y' , pr₂r⊩x~x) 
                subst
                   r'  r'   perY .equality  (y' , y'))
-                 (sym (λ*ComputationRule prover r))
-                 (stC⊩isStrictCodomainEqY y y' (pr₁  r) pr₁r⊩y~y') }))
+                 (sym (λ*ComputationRule prover r))
+                 (stC⊩isStrictCodomainEqY y y' (pr₁  r) pr₁r⊩y~y') }))
        ; isRelational =
          do
            (stC , stC⊩isStrictCodomainEqX)  idFuncRel perX .isStrictCodomain
            (relY , relY⊩isRelationalEqY)  idFuncRel perY .isRelational
            let
              prover : ApplStrTerm as 3
-             prover = ` pair ̇ (` relY ̇ (` pr₂ ̇ # two) ̇ (` pr₁ ̇ # one) ̇ # zero) ̇ (` stC ̇ (` pr₁ ̇ # two))
+             prover = ` pair ̇ (` relY ̇ (` pr₂ ̇ # two) ̇ (` pr₁ ̇ # one) ̇ # zero) ̇ (` stC ̇ (` pr₁ ̇ # two))
            return
-             (λ*3 prover ,
+             (λ*3 prover ,
               { (x , y₁) (x' , y₂) y₃ y₄ a b c (pr₁a⊩x~x' , pr₂a⊩y₁~y₂) (pr₁b⊩y₁~y₃ , pr₂b⊩x~x) c⊩y₃~y₄ 
                subst
                   r'  r'   perY .equality  (y₂ , y₄))
-                 (sym (cong  x  pr₁  x) (λ*3ComputationRule prover a b c)  pr₁pxy≡x _ _))
-                 (relY⊩isRelationalEqY y₁ y₂ y₃ y₄ (pr₂  a) (pr₁  b) c pr₂a⊩y₁~y₂ pr₁b⊩y₁~y₃ c⊩y₃~y₄) ,
+                 (sym (cong  x  pr₁  x) (λ*3ComputationRule prover a b c)  pr₁pxy≡x _ _))
+                 (relY⊩isRelationalEqY y₁ y₂ y₃ y₄ (pr₂  a) (pr₁  b) c pr₂a⊩y₁~y₂ pr₁b⊩y₁~y₃ c⊩y₃~y₄) ,
                subst
                   r'  r'   perX .equality  (x' , x'))
-                 (sym (cong  x  pr₂  x) (λ*3ComputationRule prover a b c)  pr₂pxy≡y _ _))
-                 (stC⊩isStrictCodomainEqX x x' (pr₁  a) pr₁a⊩x~x') }))
+                 (sym (cong  x  pr₂  x) (λ*3ComputationRule prover a b c)  pr₂pxy≡y _ _))
+                 (stC⊩isStrictCodomainEqX x x' (pr₁  a) pr₁a⊩x~x') }))
        ; isSingleValued =
          do
            (svY , svY⊩isSingleValuedY)  idFuncRel perY .isSingleValued
            let
              prover : ApplStrTerm as 2
-             prover = ` svY ̇ (` pr₁ ̇ # one) ̇ (` pr₁ ̇ # zero)
+             prover = ` svY ̇ (` pr₁ ̇ # one) ̇ (` pr₁ ̇ # zero)
            return
-             (λ*2 prover ,
+             (λ*2 prover ,
               { (x , y) y' y'' r₁ r₂ (pr₁r₁⊩y~y' , pr₂r₁⊩x~x) (pr₁r₂⊩y~y'' , pr₂r₂⊩) 
                subst
                   r'  r'   perY .equality  (y' , y''))
-                 (sym (λ*2ComputationRule prover r₁ r₂))
-                 (svY⊩isSingleValuedY y y' y'' (pr₁  r₁) (pr₁  r₂) pr₁r₁⊩y~y' pr₁r₂⊩y~y'') }))
+                 (sym (λ*2ComputationRule prover r₁ r₂))
+                 (svY⊩isSingleValuedY y y' y'' (pr₁  r₁) (pr₁  r₂) pr₁r₁⊩y~y' pr₁r₂⊩y~y'') }))
        ; isTotal =
          do
            let
              prover : ApplStrTerm as 1
-             prover = ` pair ̇ (` pr₂ ̇ # zero) ̇ (` pr₁ ̇ # zero)
+             prover = ` pair ̇ (` pr₂ ̇ # zero) ̇ (` pr₁ ̇ # zero)
            return
-             (λ* prover ,
+             (λ* prover ,
               { (x , y) r (pr₁r⊩x~x , pr₂r⊩y~y) 
                return
                  (y ,
                    (subst
                       r'  r'   perY .equality  (y , y))
-                     (sym (cong  x  pr₁  x) (λ*ComputationRule prover r)  pr₁pxy≡x _ _))
+                     (sym (cong  x  pr₁  x) (λ*ComputationRule prover r)  pr₁pxy≡x _ _))
                      pr₂r⊩y~y ,
                     subst
                       r'  r'   perX .equality  (x , x))
-                     (sym (cong  x  pr₂  x) (λ*ComputationRule prover r)  pr₂pxy≡y _ _))
+                     (sym (cong  x  pr₂  x) (λ*ComputationRule prover r)  pr₂pxy≡y _ _))
                      pr₁r⊩x~x)) }))
        }
 
@@ -296,7 +296,7 @@
               { relation =
                 record
                   { isSetX = isSet× isSetZ (isSet× isSetX isSetY)
-                  ; ∣_∣ = λ { (z , x , y) r  (pr₁  r)   F .relation  (z , x) × (pr₂  r)   G .relation  (z , y) }
+                  ; ∣_∣ = λ { (z , x , y) r  (pr₁  r)   F .relation  (z , x) × (pr₂  r)   G .relation  (z , y) }
                 ; isPropValued = λ { (z , x , y) r  isProp× (F .relation .isPropValued _ _) (G .relation .isPropValued _ _) } }
               ; isFuncRel =
                 record
@@ -305,71 +305,71 @@
                      (stFD , stFD⊩isStrictDomain)  F .isStrictDomain
                      let
                        prover : ApplStrTerm as 1
-                       prover = ` stFD ̇ (` pr₁ ̇ # zero)
+                       prover = ` stFD ̇ (` pr₁ ̇ # zero)
                      return
-                       (λ* prover ,
+                       (λ* prover ,
                          { z (x , y) r (pr₁r⊩Fzx , pr₂r⊩Gzy) 
                           subst
                              r'  r'   perZ .equality  (z , z))
-                            (sym (λ*ComputationRule prover r))
-                            (stFD⊩isStrictDomain z x (pr₁  r) pr₁r⊩Fzx) }))
+                            (sym (λ*ComputationRule prover r))
+                            (stFD⊩isStrictDomain z x (pr₁  r) pr₁r⊩Fzx) }))
                  ; isStrictCodomain =
                    do
                      (stFC , stFC⊩isStrictCodomainF)  F .isStrictCodomain
                      (stGC , stGC⊩isStrictCodomainG)  G .isStrictCodomain
                      let
                        prover : ApplStrTerm as 1
-                       prover = ` pair ̇ (` stFC ̇ (` pr₁ ̇ # zero)) ̇ (` stGC ̇ (` pr₂ ̇ # zero))
+                       prover = ` pair ̇ (` stFC ̇ (` pr₁ ̇ # zero)) ̇ (` stGC ̇ (` pr₂ ̇ # zero))
                      return
-                       (λ* prover ,
+                       (λ* prover ,
                         { z (x , y) r (pr₁r⊩Fzx , pr₂r⊩Gzy) 
                          subst
                             r'  r'   perX .equality  (x , x))
-                           (sym (cong  x  pr₁  x) (λ*ComputationRule prover r)  pr₁pxy≡x _ _))
-                           (stFC⊩isStrictCodomainF z x (pr₁  r) pr₁r⊩Fzx) ,
+                           (sym (cong  x  pr₁  x) (λ*ComputationRule prover r)  pr₁pxy≡x _ _))
+                           (stFC⊩isStrictCodomainF z x (pr₁  r) pr₁r⊩Fzx) ,
                          subst
                             r'  r'   perY .equality  (y , y))
-                           (sym (cong  x  pr₂  x) (λ*ComputationRule prover r)  pr₂pxy≡y _ _))
-                           (stGC⊩isStrictCodomainG z y (pr₂  r) pr₂r⊩Gzy) }))
+                           (sym (cong  x  pr₂  x) (λ*ComputationRule prover r)  pr₂pxy≡y _ _))
+                           (stGC⊩isStrictCodomainG z y (pr₂  r) pr₂r⊩Gzy) }))
                  ; isRelational =
                    do
                      (relF , relF⊩isRelationalF)  F .isRelational
                      (relG , relG⊩isRelationalG)  G .isRelational
                      let
                        prover : ApplStrTerm as 3
-                       prover = ` pair ̇ (` relF ̇ # two ̇ (` pr₁ ̇ # one) ̇ (` pr₁ ̇ # zero)) ̇ (` relG ̇ # two ̇ (` pr₂ ̇ # one) ̇ (` pr₂ ̇ # zero))
+                       prover = ` pair ̇ (` relF ̇ # two ̇ (` pr₁ ̇ # one) ̇ (` pr₁ ̇ # zero)) ̇ (` relG ̇ # two ̇ (` pr₂ ̇ # one) ̇ (` pr₂ ̇ # zero))
                      return
-                       (λ*3 prover ,
+                       (λ*3 prover ,
                         { z z' (x , y) (x' , y') a b c a⊩z~z' (pr₁b⊩Fzx , pr₂b⊩Gzy) (pr₁c⊩x~x' , pr₂c⊩y~y') 
-                         (subst  r'  r'   F .relation  (z' , x')) (sym (cong  x  pr₁  x) (λ*3ComputationRule prover a b c)  pr₁pxy≡x _ _)) (relF⊩isRelationalF z z' x x' _ _ _ a⊩z~z' pr₁b⊩Fzx pr₁c⊩x~x')) ,
-                         subst  r'  r'   G .relation  (z' , y')) (sym (cong  x  pr₂  x) (λ*3ComputationRule prover a b c)  pr₂pxy≡y _ _)) (relG⊩isRelationalG z z' y y' _ _ _ a⊩z~z' pr₂b⊩Gzy pr₂c⊩y~y') }))
+                         (subst  r'  r'   F .relation  (z' , x')) (sym (cong  x  pr₁  x) (λ*3ComputationRule prover a b c)  pr₁pxy≡x _ _)) (relF⊩isRelationalF z z' x x' _ _ _ a⊩z~z' pr₁b⊩Fzx pr₁c⊩x~x')) ,
+                         subst  r'  r'   G .relation  (z' , y')) (sym (cong  x  pr₂  x) (λ*3ComputationRule prover a b c)  pr₂pxy≡y _ _)) (relG⊩isRelationalG z z' y y' _ _ _ a⊩z~z' pr₂b⊩Gzy pr₂c⊩y~y') }))
                  ; isSingleValued =
                    do
                      (svF , svF⊩isSingleValuedF)  F .isSingleValued
                      (svG , svG⊩isSingleValuedG)  G .isSingleValued
                      let
                        prover : ApplStrTerm as 2
-                       prover = ` pair ̇ (` svF ̇ (` pr₁ ̇ # one) ̇ (` pr₁ ̇ # zero)) ̇ (` svG ̇ (` pr₂ ̇ # one) ̇ (` pr₂ ̇ # zero))
+                       prover = ` pair ̇ (` svF ̇ (` pr₁ ̇ # one) ̇ (` pr₁ ̇ # zero)) ̇ (` svG ̇ (` pr₂ ̇ # one) ̇ (` pr₂ ̇ # zero))
                      return
-                       (λ*2 prover ,
+                       (λ*2 prover ,
                         { z (x , y) (x' , y') r₁ r₂ (pr₁r₁⊩Fzx , pr₂r₁⊩Gzy) (pr₁r₂⊩Fzx' , pr₂r₂⊩Gzy') 
                          subst
                             r'  r'   perX .equality  (x , x'))
-                           (sym (cong  x  pr₁  x) (λ*2ComputationRule prover r₁ r₂)  pr₁pxy≡x _ _))
-                           (svF⊩isSingleValuedF z x x' (pr₁  r₁) (pr₁  r₂) pr₁r₁⊩Fzx pr₁r₂⊩Fzx') ,
+                           (sym (cong  x  pr₁  x) (λ*2ComputationRule prover r₁ r₂)  pr₁pxy≡x _ _))
+                           (svF⊩isSingleValuedF z x x' (pr₁  r₁) (pr₁  r₂) pr₁r₁⊩Fzx pr₁r₂⊩Fzx') ,
                          subst
                             r'  r'   perY .equality  (y , y'))
-                           (sym (cong  x  pr₂  x) (λ*2ComputationRule prover r₁ r₂)  pr₂pxy≡y _ _))
-                           (svG⊩isSingleValuedG z y y' (pr₂  r₁) (pr₂  r₂) pr₂r₁⊩Gzy pr₂r₂⊩Gzy') }))
+                           (sym (cong  x  pr₂  x) (λ*2ComputationRule prover r₁ r₂)  pr₂pxy≡y _ _))
+                           (svG⊩isSingleValuedG z y y' (pr₂  r₁) (pr₂  r₂) pr₂r₁⊩Gzy pr₂r₂⊩Gzy') }))
                  ; isTotal =
                    do
                      (tlF , tlF⊩isTotalF)  F .isTotal
                      (tlG , tlG⊩isTotalG)  G .isTotal
                      let
                        prover : ApplStrTerm as 1
-                       prover = ` pair ̇ (` tlF ̇ # zero) ̇ (` tlG ̇ # zero)
+                       prover = ` pair ̇ (` tlF ̇ # zero) ̇ (` tlG ̇ # zero)
                      return
-                       (λ* prover ,
+                       (λ* prover ,
                         { z r r⊩z~z 
                          do
                            (x , tlFr⊩Fzx)  tlF⊩isTotalF z r r⊩z~z
@@ -378,11 +378,11 @@
                              ((x , y) ,
                               (subst
                                  r'  r'   F .relation  (z , x))
-                                (sym (cong  x  pr₁  x) (λ*ComputationRule prover r)  pr₁pxy≡x _ _))
+                                (sym (cong  x  pr₁  x) (λ*ComputationRule prover r)  pr₁pxy≡x _ _))
                                 tlFr⊩Fzx ,
                                subst
                                  r'  r'   G .relation  (z , y))
-                                (sym (cong  x  pr₂  x) (λ*ComputationRule prover r)  pr₂pxy≡y _ _))
+                                (sym (cong  x  pr₂  x) (λ*ComputationRule prover r)  pr₂pxy≡y _ _))
                                 tlGr⊩Gzy)) }))
                  }}
 
@@ -402,17 +402,17 @@
                   (s , s⊩F≤F')  F≤F'
                   let
                     prover : ApplStrTerm as 1
-                    prover = ` pair ̇ (` s ̇ (` pr₁ ̇ # zero)) ̇ (` pr₂ ̇ # zero)
+                    prover = ` pair ̇ (` s ̇ (` pr₁ ̇ # zero)) ̇ (` pr₂ ̇ # zero)
                   return
-                    (λ* prover ,
+                    (λ* prover ,
                       { z (x , y) r (pr₁r⊩Fzx , pr₂r⊩Gzy) 
                        subst
                           r'  r'   F' .relation  (z , x))
-                         (sym (cong  x  pr₁  x) (λ*ComputationRule prover r)  pr₁pxy≡x _ _))
-                         (s⊩F≤F' z x (pr₁  r) pr₁r⊩Fzx) ,
+                         (sym (cong  x  pr₁  x) (λ*ComputationRule prover r)  pr₁pxy≡x _ _))
+                         (s⊩F≤F' z x (pr₁  r) pr₁r⊩Fzx) ,
                        subst
                           r'  r'   G .relation  (z , y))
-                         (sym (cong  x  pr₂  x) (λ*ComputationRule prover r)  pr₂pxy≡y _ _))
+                         (sym (cong  x  pr₂  x) (λ*ComputationRule prover r)  pr₂pxy≡y _ _))
                          pr₂r⊩Gzy }))
             in
             eq/ _ _ (answer , F≤G→G≤F perZ binProdObRT (theFuncRel F G) (theFuncRel F' G) answer) })
@@ -423,18 +423,18 @@
                   (s , s⊩G≤G')  G≤G'
                   let
                     prover : ApplStrTerm as 1
-                    prover = ` pair ̇ (` pr₁ ̇ # zero) ̇ (` s ̇ (` pr₂ ̇ # zero))
+                    prover = ` pair ̇ (` pr₁ ̇ # zero) ̇ (` s ̇ (` pr₂ ̇ # zero))
                   return
-                    (λ* prover ,
+                    (λ* prover ,
                      { z (x , y) r (pr₁r⊩Fzx , pr₂r⊩Gzy) 
                       (subst
                          r'  r'   F .relation  (z , x))
-                        (sym (cong  x  pr₁  x) (λ*ComputationRule prover r)  pr₁pxy≡x _ _))
+                        (sym (cong  x  pr₁  x) (λ*ComputationRule prover r)  pr₁pxy≡x _ _))
                         pr₁r⊩Fzx) ,
                       (subst
                          r'  r'   G' .relation  (z , y))
-                        (sym (cong  x  pr₂  x) (λ*ComputationRule prover r)  pr₂pxy≡y _ _))
-                        (s⊩G≤G' z y (pr₂  r) pr₂r⊩Gzy)) }))
+                        (sym (cong  x  pr₂  x) (λ*ComputationRule prover r)  pr₂pxy≡y _ _))
+                        (s⊩G≤G' z y (pr₂  r) pr₂r⊩Gzy)) }))
             in eq/ _ _ (answer , (F≤G→G≤F perZ binProdObRT (theFuncRel F G) (theFuncRel F G') answer)) })
           f g
   opaque
@@ -473,9 +473,9 @@
                   (stD , stD⊩isStrictDomain)  theFuncRel' .isStrictDomain
                   let
                     prover : ApplStrTerm as 1
-                    prover = ` relF ̇ (` stD ̇ (` pr₁ ̇ # zero)) ̇ (` pr₁ ̇ (` p ̇ (` pr₁ ̇ # zero))) ̇ (` pr₁ ̇ (` pr₂ ̇ # zero))
+                    prover = ` relF ̇ (` stD ̇ (` pr₁ ̇ # zero)) ̇ (` pr₁ ̇ (` p ̇ (` pr₁ ̇ # zero))) ̇ (` pr₁ ̇ (` pr₂ ̇ # zero))
                   return
-                    (λ* prover ,
+                    (λ* prover ,
                     λ z x r r⊩∃ 
                       transport
                         (propTruncIdempotent (F .relation .isPropValued _ _))
@@ -484,12 +484,12 @@
                           return
                             (subst
                                r'  r'   F .relation  (z , x))
-                              (sym (λ*ComputationRule prover r))
+                              (sym (λ*ComputationRule prover r))
                               (relF⊩isRelationalF
                                 z z x' x
-                                (stD  (pr₁  r)) (pr₁  (p  (pr₁  r))) (pr₁  (pr₂  r))
-                                (stD⊩isStrictDomain z (x' , y) (pr₁  r) pr₁r⊩theFuncRel'zx'y )
-                                (p⊩theFuncRel'≤theFuncRel z (x' , y) (pr₁  r) pr₁r⊩theFuncRel'zx'y .fst)
+                                (stD  (pr₁  r)) (pr₁  (p  (pr₁  r))) (pr₁  (pr₂  r))
+                                (stD⊩isStrictDomain z (x' , y) (pr₁  r) pr₁r⊩theFuncRel'zx'y )
+                                (p⊩theFuncRel'≤theFuncRel z (x' , y) (pr₁  r) pr₁r⊩theFuncRel'zx'y .fst)
                                  pr₁pr₂r⊩x~x'))))
             in
             eq/ _ _ (answer , F≤G→G≤F perZ perX (composeFuncRel _ _ _ theFuncRel' binProdPr₁FuncRel) F answer))
@@ -517,9 +517,9 @@
                   (st , st⊩isStrictDomainTheFuncRel')  theFuncRel' .isStrictDomain
                   let
                     prover : ApplStrTerm as 1
-                    prover = ` relG ̇ (` st ̇ (` pr₁ ̇ # zero)) ̇ (` pr₂ ̇ (` p ̇ (` pr₁ ̇ # zero))) ̇ (` pr₁ ̇ (` pr₂ ̇ # zero))
+                    prover = ` relG ̇ (` st ̇ (` pr₁ ̇ # zero)) ̇ (` pr₂ ̇ (` p ̇ (` pr₁ ̇ # zero))) ̇ (` pr₁ ̇ (` pr₂ ̇ # zero))
                   return
-                    (λ* prover ,
+                    (λ* prover ,
                      z y r r⊩∃ 
                       transport
                         (propTruncIdempotent (G .relation .isPropValued _ _))
@@ -528,12 +528,12 @@
                           return
                             (subst
                                r'  r'   G .relation  (z , y))
-                              (sym (λ*ComputationRule prover r)) 
+                              (sym (λ*ComputationRule prover r)) 
                               (relG⊩isRelationalG
                                 z z y' y
-                                (st  (pr₁  r)) (pr₂  (p  (pr₁  r))) (pr₁  (pr₂  r))
-                                (st⊩isStrictDomainTheFuncRel' z (x , y') (pr₁  r) pr₁r⊩theFuncRel'zxy')
-                                (p⊩theFuncRel'≤theFuncRel z (x , y') (pr₁  r) pr₁r⊩theFuncRel'zxy' .snd)
+                                (st  (pr₁  r)) (pr₂  (p  (pr₁  r))) (pr₁  (pr₂  r))
+                                (st⊩isStrictDomainTheFuncRel' z (x , y') (pr₁  r) pr₁r⊩theFuncRel'zxy')
+                                (p⊩theFuncRel'≤theFuncRel z (x , y') (pr₁  r) pr₁r⊩theFuncRel'zxy' .snd)
                                 pr₁pr₂r⊩y'~y)))))
             in
             eq/ _ _ (answer , F≤G→G≤F perZ perY (composeFuncRel _ _ _ theFuncRel' binProdPr₂FuncRel) G answer))
@@ -562,17 +562,17 @@
                     let
                       realizer : ApplStrTerm as 1 -- cursed
                       realizer =
-                        ` rel!' ̇ (` stD!' ̇ (` pr₁ ̇ (` q ̇ (` pr₁ ̇ # zero)))) ̇
-                          (` pr₁ ̇ (` q' ̇ (` pr₂ ̇ # zero))) ̇
-                          (` pair ̇
-                           (` tX ̇
-                            (` sX ̇
-                             (` pr₁ ̇
-                              (` sv!' ̇ (` pr₁ ̇ (` q ̇ (` pr₁ ̇ # zero))) ̇ (` pr₁ ̇ (` q' ̇ (` pr₂ ̇ # zero)))))) ̇
-                            (` pr₁ ̇ (` pr₂ ̇ (` q ̇ (` pr₁ ̇ # zero))))) ̇
-                           (` pr₁ ̇ (` pr₂ ̇ (` q' ̇ (` pr₂ ̇ # zero)))))
+                        ` rel!' ̇ (` stD!' ̇ (` pr₁ ̇ (` q ̇ (` pr₁ ̇ # zero)))) ̇
+                          (` pr₁ ̇ (` q' ̇ (` pr₂ ̇ # zero))) ̇
+                          (` pair ̇
+                           (` tX ̇
+                            (` sX ̇
+                             (` pr₁ ̇
+                              (` sv!' ̇ (` pr₁ ̇ (` q ̇ (` pr₁ ̇ # zero))) ̇ (` pr₁ ̇ (` q' ̇ (` pr₂ ̇ # zero)))))) ̇
+                            (` pr₁ ̇ (` pr₂ ̇ (` q ̇ (` pr₁ ̇ # zero))))) ̇
+                           (` pr₁ ̇ (` pr₂ ̇ (` q' ̇ (` pr₂ ̇ # zero)))))
                     return
-                      (λ* realizer ,
+                      (λ* realizer ,
                        { z (x , y) r (pr₁r⊩Fzx , pr₂r⊩Gzy) 
                         transport
                           (propTruncIdempotent (!' .relation .isPropValued _ _))
@@ -585,7 +585,7 @@
                             return
                               (subst
                                  r'  r'   !' .relation  (z , x , y))
-                                (sym (λ*ComputationRule realizer r))
+                                (sym (λ*ComputationRule realizer r))
                                 (rel!'⊩isRelational!'
                                   z z
                                   (x'' , y'')
diff --git a/docs/Realizability.Topos.Equalizer.html b/docs/Realizability.Topos.Equalizer.html
index 916a1e2..f5ada32 100644
--- a/docs/Realizability.Topos.Equalizer.html
+++ b/docs/Realizability.Topos.Equalizer.html
@@ -36,7 +36,7 @@
 There is additional bureacracy because we have to deal with eliminators of set quotients. This makes things a little more complicated.
 
 -}
-open import Realizability.ApplicativeStructure renaming (Term to ApplStrTerm)
+open import Realizability.ApplicativeStructure renaming (Term to ApplStrTerm)
 open import Realizability.CombinatoryAlgebra
 open import Cubical.Foundations.Prelude
 open import Cubical.Foundations.HLevels
@@ -56,7 +56,7 @@
 module Realizability.Topos.Equalizer
   { ℓ' ℓ''} {A : Type }
   (ca : CombinatoryAlgebra A)
-  (isNonTrivial : CombinatoryAlgebra.s ca  CombinatoryAlgebra.k ca  ) where
+  (isNonTrivial : CombinatoryAlgebra.s ca  CombinatoryAlgebra.k ca  ) where
 
 open import Realizability.Tripos.Prealgebra.Predicate {ℓ' = ℓ'} {ℓ'' = ℓ''} ca
 open import Realizability.Topos.Object { = } {ℓ' = ℓ'} {ℓ'' = ℓ''} ca isNonTrivial 
@@ -101,8 +101,8 @@
                 record
                   { isSetX = isSet× (perX .isSetX) (perX .isSetX)
                   ; ∣_∣ = λ { (x , x') r 
-                    ((pr₁  r)   perX .equality  (x , x')) ×
-                    (∃[ y  Y ] (pr₁  (pr₂  r))   F .relation  (x , y) × (pr₂  (pr₂  r))   G .relation  (x , y)) }
+                    ((pr₁  r)   perX .equality  (x , x')) ×
+                    (∃[ y  Y ] (pr₁  (pr₂  r))   F .relation  (x , y) × (pr₂  (pr₂  r))   G .relation  (x , y)) }
                   ; isPropValued = λ { (x , x') r  isProp× (perX .equality .isPropValued _ _) isPropPropTrunc } }
               ; isPerEquality =
                 record
@@ -116,40 +116,40 @@
                       let
                         prover : ApplStrTerm as 1
                         prover =
-                          ` pair ̇
-                            (` s ̇ (` pr₁ ̇ # zero)) ̇
-                            (` pair ̇
-                              (` relF ̇ (` pr₁ ̇ # zero) ̇ (` pr₁ ̇ (` pr₂ ̇ # zero)) ̇ (` stFC ̇ (` pr₁ ̇ (` pr₂ ̇ # zero)))) ̇
-                              (` relG ̇ (` pr₁ ̇ # zero) ̇ (` pr₂ ̇ (` pr₂ ̇ # zero)) ̇ (` stFC ̇ (` pr₁ ̇ (` pr₂ ̇ # zero)))))
+                          ` pair ̇
+                            (` s ̇ (` pr₁ ̇ # zero)) ̇
+                            (` pair ̇
+                              (` relF ̇ (` pr₁ ̇ # zero) ̇ (` pr₁ ̇ (` pr₂ ̇ # zero)) ̇ (` stFC ̇ (` pr₁ ̇ (` pr₂ ̇ # zero)))) ̇
+                              (` relG ̇ (` pr₁ ̇ # zero) ̇ (` pr₂ ̇ (` pr₂ ̇ # zero)) ̇ (` stFC ̇ (` pr₁ ̇ (` pr₂ ̇ # zero)))))
                       return
-                        (λ* prover ,
+                        (λ* prover ,
                          { x x' r (pr₁r⊩x~x' , pr₂r⊩∃) 
                           subst
                              r'  r'   perX .equality  (x' , x))
-                            (sym (cong  x  pr₁  x) (λ*ComputationRule prover r)  pr₁pxy≡x _ _))
-                            (s⊩isSymmetricX x x' (pr₁  r) pr₁r⊩x~x') ,
+                            (sym (cong  x  pr₁  x) (λ*ComputationRule prover r)  pr₁pxy≡x _ _))
+                            (s⊩isSymmetricX x x' (pr₁  r) pr₁r⊩x~x') ,
                           do
                             (y , pr₁pr₂r⊩Fxy , pr₂pr₂r⊩Gxy)  pr₂r⊩∃
                             return
                               (y ,
                               subst
                                  r'  r'   F .relation  (x' , y))
-                                (sym (cong  x  pr₁  (pr₂  x)) (λ*ComputationRule prover r)  cong  x  pr₁  x) (pr₂pxy≡y _ _)  pr₁pxy≡x _ _))
+                                (sym (cong  x  pr₁  (pr₂  x)) (λ*ComputationRule prover r)  cong  x  pr₁  x) (pr₂pxy≡y _ _)  pr₁pxy≡x _ _))
                                 (relF⊩isRelationalF
                                   x x' y y
-                                  (pr₁  r) (pr₁  (pr₂  r)) (stFC  (pr₁  (pr₂  r)))
+                                  (pr₁  r) (pr₁  (pr₂  r)) (stFC  (pr₁  (pr₂  r)))
                                   pr₁r⊩x~x'
                                   pr₁pr₂r⊩Fxy
-                                  (stFC⊩isStrictCodomainF x y (pr₁  (pr₂  r)) pr₁pr₂r⊩Fxy)) ,
+                                  (stFC⊩isStrictCodomainF x y (pr₁  (pr₂  r)) pr₁pr₂r⊩Fxy)) ,
                               subst
                                  r'  r'   G .relation  (x' , y))
-                                (sym (cong  x  pr₂  (pr₂  x)) (λ*ComputationRule prover r)  cong  x  pr₂  x) (pr₂pxy≡y _ _)  pr₂pxy≡y _ _))
+                                (sym (cong  x  pr₂  (pr₂  x)) (λ*ComputationRule prover r)  cong  x  pr₂  x) (pr₂pxy≡y _ _)  pr₂pxy≡y _ _))
                                 (relG⊩isRelationalG
                                   x x' y y
-                                  (pr₁  r) (pr₂  (pr₂  r)) (stFC  (pr₁  (pr₂  r)))
+                                  (pr₁  r) (pr₂  (pr₂  r)) (stFC  (pr₁  (pr₂  r)))
                                   pr₁r⊩x~x'
                                   pr₂pr₂r⊩Gxy
-                                  (stFC⊩isStrictCodomainF x y (pr₁  (pr₂  r)) pr₁pr₂r⊩Fxy))) }))
+                                  (stFC⊩isStrictCodomainF x y (pr₁  (pr₂  r)) pr₁pr₂r⊩Fxy))) }))
                   ; isTransitive =
                     do
                       (t , t⊩isTransitiveX)  perX .isTransitive
@@ -157,14 +157,14 @@
                       (relG , relG⊩isRelationalG)  G .isRelational
                       let
                         prover : ApplStrTerm as 2
-                        prover = ` pair ̇ (` t ̇ (` pr₁ ̇ # one) ̇ (` pr₁ ̇ # zero)) ̇ (` pair ̇ (` pr₁ ̇ (` pr₂ ̇ # one)) ̇ (` pr₂ ̇ (` pr₂ ̇ # one)))
+                        prover = ` pair ̇ (` t ̇ (` pr₁ ̇ # one) ̇ (` pr₁ ̇ # zero)) ̇ (` pair ̇ (` pr₁ ̇ (` pr₂ ̇ # one)) ̇ (` pr₂ ̇ (` pr₂ ̇ # one)))
                       return
-                        (λ*2 prover ,
+                        (λ*2 prover ,
                         λ { x₁ x₂ x₃ a b (pr₁a⊩x₁~x₂ , pr₂a⊩∃) (pr₁b⊩x₂~x₃ , pr₂b⊩∃) 
                           subst
                              r'  r'   perX .equality  (x₁ , x₃))
-                            (sym (cong  x  pr₁  x) (λ*2ComputationRule prover a b)  pr₁pxy≡x _ _))
-                            (t⊩isTransitiveX x₁ x₂ x₃ (pr₁  a) (pr₁  b) pr₁a⊩x₁~x₂ pr₁b⊩x₂~x₃) ,
+                            (sym (cong  x  pr₁  x) (λ*2ComputationRule prover a b)  pr₁pxy≡x _ _))
+                            (t⊩isTransitiveX x₁ x₂ x₃ (pr₁  a) (pr₁  b) pr₁a⊩x₁~x₂ pr₁b⊩x₂~x₃) ,
                           do
                             (y , (pr₁pr₂a⊩Fx₁y , pr₂pr₂a⊩Gx₁y))  pr₂a⊩∃
                             (y' , (pr₁pr₂a⊩Fx₂y' , pr₂pr₂a⊩Gx₂y'))  pr₂b⊩∃
@@ -172,11 +172,11 @@
                               (y ,
                               subst
                                  r'  r'   F .relation  (x₁ , y))
-                                (sym (cong  x  pr₁  (pr₂  x)) (λ*2ComputationRule prover a b)  cong  x  pr₁  x) (pr₂pxy≡y _ _)  pr₁pxy≡x _ _))
+                                (sym (cong  x  pr₁  (pr₂  x)) (λ*2ComputationRule prover a b)  cong  x  pr₁  x) (pr₂pxy≡y _ _)  pr₁pxy≡x _ _))
                                 pr₁pr₂a⊩Fx₁y ,
                               subst
                                  r'  r'   G .relation  (x₁ , y))
-                                (sym (cong  x  pr₂  (pr₂  x)) (λ*2ComputationRule prover a b)  cong  x  pr₂  x) (pr₂pxy≡y _ _)  pr₂pxy≡y _ _))
+                                (sym (cong  x  pr₂  (pr₂  x)) (λ*2ComputationRule prover a b)  cong  x  pr₂  x) (pr₂pxy≡y _ _)  pr₂pxy≡y _ _))
                                 pr₂pr₂a⊩Gx₁y) }) } }
 
   opaque
@@ -194,11 +194,11 @@
                (stC , stC⊩isStrictCodomain)  idFuncRel perX .isStrictCodomain
                let
                  prover : ApplStrTerm as 1
-                 prover = ` stC ̇ (` pr₁ ̇ # zero)
+                 prover = ` stC ̇ (` pr₁ ̇ # zero)
                return
-                 (λ* prover ,
+                 (λ* prover ,
                   { x x' r (pr₁r⊩x~x' , pr₂r⊩∃) 
-                   subst  r'  r'   perX .equality  (x' , x')) (sym (λ*ComputationRule prover r)) (stC⊩isStrictCodomain x x' (pr₁  r) pr₁r⊩x~x') }))
+                   subst  r'  r'   perX .equality  (x' , x')) (sym (λ*ComputationRule prover r)) (stC⊩isStrictCodomain x x' (pr₁  r) pr₁r⊩x~x') }))
            ; isRelational =
              do
                (relEqX , relEqX⊩isRelationalEqX)  idFuncRel perX .isRelational
@@ -208,52 +208,52 @@
                let
                  prover : ApplStrTerm as 3
                  prover =
-                   ` pair ̇
-                     (` relEqX ̇ (` pr₁ ̇ # two) ̇ (` pr₁ ̇ # one) ̇ # zero) ̇
-                     (` pair ̇
-                       (` relF ̇ (` pr₁ ̇ # two) ̇ (` pr₁ ̇ (` pr₂ ̇ # two)) ̇ (` svF ̇ (` pr₁ ̇ (` pr₂ ̇ # two)) ̇ (` pr₁ ̇ (` pr₂ ̇ # one)))) ̇
-                       (` relG ̇ (` pr₁ ̇ # two) ̇ (` pr₂ ̇ (` pr₂ ̇ # two)) ̇ (` svF ̇ (` pr₁ ̇ (` pr₂ ̇ # two)) ̇ (` pr₁ ̇ (` pr₂ ̇ # one)))))
+                   ` pair ̇
+                     (` relEqX ̇ (` pr₁ ̇ # two) ̇ (` pr₁ ̇ # one) ̇ # zero) ̇
+                     (` pair ̇
+                       (` relF ̇ (` pr₁ ̇ # two) ̇ (` pr₁ ̇ (` pr₂ ̇ # two)) ̇ (` svF ̇ (` pr₁ ̇ (` pr₂ ̇ # two)) ̇ (` pr₁ ̇ (` pr₂ ̇ # one)))) ̇
+                       (` relG ̇ (` pr₁ ̇ # two) ̇ (` pr₂ ̇ (` pr₂ ̇ # two)) ̇ (` svF ̇ (` pr₁ ̇ (` pr₂ ̇ # two)) ̇ (` pr₁ ̇ (` pr₂ ̇ # one)))))
                return
-                 (λ*3 prover ,
+                 (λ*3 prover ,
                   x₁ x₂ x₃ x₄ a b c (pr₁a⊩x₁~x₂ , pr₂a⊩) (pr₁b⊩x₁~x₃ , pr₂b⊩) c⊩x₃~x₄ 
                    subst
                       r'  r'   perX .equality  (x₂ , x₄))
-                     (sym (cong  x  pr₁  x) (λ*3ComputationRule prover a b c)  pr₁pxy≡x _ _))
-                     (relEqX⊩isRelationalEqX x₁ x₂ x₃ x₄ (pr₁  a) (pr₁  b) c pr₁a⊩x₁~x₂ pr₁b⊩x₁~x₃ c⊩x₃~x₄) ,
+                     (sym (cong  x  pr₁  x) (λ*3ComputationRule prover a b c)  pr₁pxy≡x _ _))
+                     (relEqX⊩isRelationalEqX x₁ x₂ x₃ x₄ (pr₁  a) (pr₁  b) c pr₁a⊩x₁~x₂ pr₁b⊩x₁~x₃ c⊩x₃~x₄) ,
                    do
                      (y , pr₁pr₂a⊩Fx₁y , pr₂pr₂a⊩Gx₁y)  pr₂a⊩
                      (y' , pr₁pr₂b⊩Fx₁y' , pr₂pr₂b⊩Gx₁y')  pr₂b⊩
                      let
-                       y~y' = svF⊩isSingleValuedF x₁ y y' (pr₁  (pr₂  a)) (pr₁  (pr₂  b)) pr₁pr₂a⊩Fx₁y pr₁pr₂b⊩Fx₁y'
+                       y~y' = svF⊩isSingleValuedF x₁ y y' (pr₁  (pr₂  a)) (pr₁  (pr₂  b)) pr₁pr₂a⊩Fx₁y pr₁pr₂b⊩Fx₁y'
                      return
                        (y' ,
                        subst
                           r'  r'   F .relation  (x₂ , y'))
-                         (sym (cong  x  pr₁  (pr₂  x)) (λ*3ComputationRule prover a b c)  cong  x  pr₁  x) (pr₂pxy≡y _ _)  pr₁pxy≡x _ _))
+                         (sym (cong  x  pr₁  (pr₂  x)) (λ*3ComputationRule prover a b c)  cong  x  pr₁  x) (pr₂pxy≡y _ _)  pr₁pxy≡x _ _))
                          (relF⊩isRelationalF
                            x₁ x₂ y y'
-                           (pr₁  a) (pr₁  (pr₂  a)) (svF  (pr₁  (pr₂  a))  (pr₁  (pr₂  b)))
+                           (pr₁  a) (pr₁  (pr₂  a)) (svF  (pr₁  (pr₂  a))  (pr₁  (pr₂  b)))
                            pr₁a⊩x₁~x₂ pr₁pr₂a⊩Fx₁y y~y') ,
                        subst
                           r'  r'   G .relation  (x₂ , y'))
-                         (sym (cong  x  pr₂  (pr₂  x)) (λ*3ComputationRule prover a b c)  cong  x  pr₂  x) (pr₂pxy≡y _ _)  pr₂pxy≡y _ _))
+                         (sym (cong  x  pr₂  (pr₂  x)) (λ*3ComputationRule prover a b c)  cong  x  pr₂  x) (pr₂pxy≡y _ _)  pr₂pxy≡y _ _))
                          (relG⊩isRelationalG
                            x₁ x₂ y y'
-                           (pr₁  a) (pr₂  (pr₂  a)) (svF  (pr₁  (pr₂  a))  (pr₁  (pr₂  b)))
+                           (pr₁  a) (pr₂  (pr₂  a)) (svF  (pr₁  (pr₂  a))  (pr₁  (pr₂  b)))
                            pr₁a⊩x₁~x₂ pr₂pr₂a⊩Gx₁y y~y'))))
            ; isSingleValued =
              do
                (svEqX , svEqX⊩isSingleValuedEqX)  idFuncRel perX .isSingleValued
                let
                  prover : ApplStrTerm as 2
-                 prover = ` svEqX ̇ (` pr₁ ̇ # one) ̇ (` pr₁ ̇ # zero)
+                 prover = ` svEqX ̇ (` pr₁ ̇ # one) ̇ (` pr₁ ̇ # zero)
                return
-                 (λ*2 prover ,
+                 (λ*2 prover ,
                   x₁ x₂ x₃ r₁ r₂ (pr₁r₁⊩x₁~x₂ , pr₁r₁⊩) (pr₁r₂⊩x₁~x₃ , pr₂r₂⊩) 
                    subst
                       r'  r'   perX .equality  (x₂ , x₃))
-                     (sym (λ*2ComputationRule prover r₁ r₂))
-                     (svEqX⊩isSingleValuedEqX x₁ x₂ x₃ (pr₁  r₁) (pr₁  r₂) pr₁r₁⊩x₁~x₂ pr₁r₂⊩x₁~x₃)))
+                     (sym (λ*2ComputationRule prover r₁ r₂))
+                     (svEqX⊩isSingleValuedEqX x₁ x₂ x₃ (pr₁  r₁) (pr₁  r₂) pr₁r₁⊩x₁~x₂ pr₁r₂⊩x₁~x₃)))
            ; isTotal = idFuncRel (equalizerPer F G) .isTotal
            } }
 
@@ -278,13 +278,13 @@
             let
               realizer : ApplStrTerm as 1
               realizer =
-                ` pair ̇
-                  (` pair ̇ (` pr₁ ̇ (` pr₁ ̇ # zero)) ̇ (` pair ̇ (` pr₁ ̇ (` pr₂ ̇ (` pr₁ ̇ # zero))) ̇ (` pr₂ ̇ (` pr₂ ̇ (` pr₁ ̇ # zero))))) ̇
-                  (` relG ̇ (` pr₁ ̇ (` pr₁ ̇ # zero)) ̇ (` pr₂ ̇ (` pr₂ ̇ (` pr₁ ̇ # zero))) ̇
-                     (` svF ̇ (` pr₁ ̇ (` pr₂ ̇ (` pr₁ ̇ # zero))) ̇
-                     (` relF ̇ (` sX ̇ (` pr₁ ̇ (` pr₁ ̇ # zero))) ̇ (` pr₂ ̇ # zero) ̇ (` stCF ̇ (` pr₂ ̇ # zero)))))
+                ` pair ̇
+                  (` pair ̇ (` pr₁ ̇ (` pr₁ ̇ # zero)) ̇ (` pair ̇ (` pr₁ ̇ (` pr₂ ̇ (` pr₁ ̇ # zero))) ̇ (` pr₂ ̇ (` pr₂ ̇ (` pr₁ ̇ # zero))))) ̇
+                  (` relG ̇ (` pr₁ ̇ (` pr₁ ̇ # zero)) ̇ (` pr₂ ̇ (` pr₂ ̇ (` pr₁ ̇ # zero))) ̇
+                     (` svF ̇ (` pr₁ ̇ (` pr₂ ̇ (` pr₁ ̇ # zero))) ̇
+                     (` relF ̇ (` sX ̇ (` pr₁ ̇ (` pr₁ ̇ # zero))) ̇ (` pr₂ ̇ # zero) ̇ (` stCF ̇ (` pr₂ ̇ # zero)))))
             return
-              (λ* realizer ,
+              (λ* realizer ,
               -- unfold everything and bring it back in together
                x y r r⊩∃ 
                 do
@@ -297,7 +297,7 @@
                     (x' ,
                     (subst
                        r'  r'   perX .equality  (x , x'))
-                      (sym (cong  x  pr₁  (pr₁  x)) (λ*ComputationRule realizer r)  cong  x  pr₁  x) (pr₁pxy≡x _ _)  pr₁pxy≡x _ _))
+                      (sym (cong  x  pr₁  (pr₁  x)) (λ*ComputationRule realizer r)  cong  x  pr₁  x) (pr₁pxy≡x _ _)  pr₁pxy≡x _ _))
                       ⊩x~x' ,
                     do
                       return
@@ -305,22 +305,22 @@
                         subst
                            r'  r'   F .relation  (x , y'))
                           (sym
-                            (cong  x  pr₁  (pr₂  (pr₁  x))) (λ*ComputationRule realizer r) 
-                             cong  x  pr₁  (pr₂  x)) (pr₁pxy≡x _ _) 
-                             cong  x  pr₁  x) (pr₂pxy≡y _ _) 
+                            (cong  x  pr₁  (pr₂  (pr₁  x))) (λ*ComputationRule realizer r) 
+                             cong  x  pr₁  (pr₂  x)) (pr₁pxy≡x _ _) 
+                             cong  x  pr₁  x) (pr₂pxy≡y _ _) 
                              pr₁pxy≡x _ _))
                           ⊩Fxy' ,
                         subst
                            r'  r'   G .relation  (x , y'))
                           (sym
-                            (cong  x  pr₂  (pr₂  (pr₁  x))) (λ*ComputationRule realizer r) 
-                             cong  x  pr₂  (pr₂  x)) (pr₁pxy≡x _ _) 
-                             cong  x  pr₂  x) (pr₂pxy≡y _ _) 
+                            (cong  x  pr₂  (pr₂  (pr₁  x))) (λ*ComputationRule realizer r) 
+                             cong  x  pr₂  (pr₂  x)) (pr₁pxy≡x _ _) 
+                             cong  x  pr₂  x) (pr₂pxy≡y _ _) 
                              pr₂pxy≡y _ _))
                           ⊩Gxy')) ,
                     subst
                        r'  r'   G .relation  (x' , y))
-                      (sym (cong  x  pr₂  x) (λ*ComputationRule realizer r)  pr₂pxy≡y _ _))
+                      (sym (cong  x  pr₂  x) (λ*ComputationRule realizer r)  pr₂pxy≡y _ _))
                       (relG⊩isRelationalG x x' y' y _ _ _ ⊩x~x' ⊩Gxy' y'~y))))
       in
       eq/ _ _
@@ -367,26 +367,26 @@
                        -- possibly the ugliest realizer out there
                        prover : ApplStrTerm as 1
                        prover =
-                         ` pair ̇
-                           (` stCH ̇ # zero) ̇
-                           (` pair ̇
-                             (` tlF ̇ (` stCH ̇ # zero)) ̇
-                             (` relG ̇ (` svH ̇ (` pr₁ ̇ (` p ̇ (` pair ̇ # zero ̇ (` tlF ̇ (` stCH ̇ # zero))))) ̇ # zero) ̇
-                             (` pr₂ ̇ (` p ̇ (` pair ̇ # zero ̇ (` tlF ̇ (` stCH ̇ # zero))))) ̇
-                              (` stCF ̇ (` tlF ̇ (` stCH ̇ # zero)))))
+                         ` pair ̇
+                           (` stCH ̇ # zero) ̇
+                           (` pair ̇
+                             (` tlF ̇ (` stCH ̇ # zero)) ̇
+                             (` relG ̇ (` svH ̇ (` pr₁ ̇ (` p ̇ (` pair ̇ # zero ̇ (` tlF ̇ (` stCH ̇ # zero))))) ̇ # zero) ̇
+                             (` pr₂ ̇ (` p ̇ (` pair ̇ # zero ̇ (` tlF ̇ (` stCH ̇ # zero))))) ̇
+                              (` stCF ̇ (` tlF ̇ (` stCH ̇ # zero)))))
                      return
-                       (λ* prover ,
+                       (λ* prover ,
                         z x r r⊩Hzx 
                          let
                              x~x = stCH⊩isStrictCodomainH z x r r⊩Hzx
                          in
-                         subst  r  r   perX .equality  (x , x)) (sym (cong  x  pr₁  x) (λ*ComputationRule prover r)  pr₁pxy≡x _ _)) x~x ,
+                         subst  r  r   perX .equality  (x , x)) (sym (cong  x  pr₁  x) (λ*ComputationRule prover r)  pr₁pxy≡x _ _)) x~x ,
                          (do
-                           (y , ⊩Fxy)  tlF⊩isTotalF x (stCH  r) x~x
+                           (y , ⊩Fxy)  tlF⊩isTotalF x (stCH  r) x~x
                            let
                              hope =
                                p⊩H⋆F≤H⋆G
-                                 z y (pair  r  (tlF  (stCH  r)))
+                                 z y (pair  r  (tlF  (stCH  r)))
                                  (return
                                    (x ,
                                     subst  r'  r'   H .relation  (z , x)) (sym (pr₁pxy≡x _ _)) r⊩Hzx ,
@@ -396,8 +396,8 @@
                              subst
                                 r'  r'   F .relation  (x , y))
                                (sym
-                                 (cong  x  pr₁  (pr₂  x)) (λ*ComputationRule prover r) 
-                                  cong  x  pr₁  x) (pr₂pxy≡y _ _) 
+                                 (cong  x  pr₁  (pr₂  x)) (λ*ComputationRule prover r) 
+                                  cong  x  pr₁  x) (pr₂pxy≡y _ _) 
                                   pr₁pxy≡x _ _))
                                ⊩Fxy ,
                              -- god I wish there was a better way to do this :(
@@ -409,8 +409,8 @@
                                    (subst
                                       r'  r'   G .relation  (x , y))
                                      (sym
-                                       (cong  x  pr₂  (pr₂  x)) (λ*ComputationRule prover r) 
-                                        cong  x  pr₂  x) (pr₂pxy≡y _ _) 
+                                       (cong  x  pr₂  (pr₂  x)) (λ*ComputationRule prover r) 
+                                        cong  x  pr₂  x) (pr₂pxy≡y _ _) 
                                         pr₂pxy≡y _ _))
                                      (relG⊩isRelationalG x' x y y _ _ _ (svH⊩isSingleValuedH z x' x _ _ ⊩Hzx' r⊩Hzx) ⊩Gx'y (stCF⊩isStrictCodomainF x y _ ⊩Fxy))))))))
                  ; isRelational =
@@ -418,14 +418,14 @@
                      (relH , relH⊩isRelationalH)  H .isRelational
                      let
                        prover : ApplStrTerm as 3
-                       prover = ` relH ̇ # two ̇ # one ̇ (` pr₁ ̇ # zero)
+                       prover = ` relH ̇ # two ̇ # one ̇ (` pr₁ ̇ # zero)
                      return
-                       (λ*3 prover ,
+                       (λ*3 prover ,
                         z z' x x' a b c a⊩z~z' b⊩Hzx (pr₁c⊩x~x' , pr₂c⊩∃) 
                          subst
                             r'  r'   H .relation  (z' , x'))
-                           (sym (λ*3ComputationRule prover a b c))
-                           (relH⊩isRelationalH z z' x x' a b (pr₁  c) a⊩z~z' b⊩Hzx pr₁c⊩x~x')))
+                           (sym (λ*3ComputationRule prover a b c))
+                           (relH⊩isRelationalH z z' x x' a b (pr₁  c) a⊩z~z' b⊩Hzx pr₁c⊩x~x')))
                  ; isSingleValued =
                    do
                      (svH , svH⊩isSingleValuedH)  H .isSingleValued
@@ -438,15 +438,15 @@
                      let
                        prover : ApplStrTerm as 2
                        prover =
-                         ` pair ̇
-                           (` svH ̇ # one ̇ # zero) ̇
-                           (` pair ̇
-                             (` tlF ̇ (` stCH ̇ # one)) ̇
-                             (` relG ̇ (` svH ̇ (` pr₁ ̇ (` p ̇ (` pair ̇ # one ̇ (` tlF ̇ (` stCH ̇ # one))))) ̇ # one) ̇
-                               (` pr₂ ̇ (` p ̇ (` pair ̇ # one ̇ (` tlF ̇ (` stCH ̇ # one))))) ̇
-                               (` stCF ̇(` tlF ̇ (` stCH ̇ # one)))))
+                         ` pair ̇
+                           (` svH ̇ # one ̇ # zero) ̇
+                           (` pair ̇
+                             (` tlF ̇ (` stCH ̇ # one)) ̇
+                             (` relG ̇ (` svH ̇ (` pr₁ ̇ (` p ̇ (` pair ̇ # one ̇ (` tlF ̇ (` stCH ̇ # one))))) ̇ # one) ̇
+                               (` pr₂ ̇ (` p ̇ (` pair ̇ # one ̇ (` tlF ̇ (` stCH ̇ # one))))) ̇
+                               (` stCF ̇(` tlF ̇ (` stCH ̇ # one)))))
                      return
-                       (λ*2 prover ,
+                       (λ*2 prover ,
                         z x x' r₁ r₂ r₁⊩Hzx r₂⊩Hzx' 
                          let
                            x~x' = svH⊩isSingleValuedH z x x' r₁ r₂ r₁⊩Hzx r₂⊩Hzx'
@@ -454,7 +454,7 @@
                          in
                          subst
                             r'  r'   perX .equality  (x , x'))
-                           (sym (cong  x  pr₁  x) (λ*2ComputationRule prover r₁ r₂)  pr₁pxy≡x _ _))
+                           (sym (cong  x  pr₁  x) (λ*2ComputationRule prover r₁ r₂)  pr₁pxy≡x _ _))
                            x~x' ,
                          do
                            (y , ⊩Fxy)  tlF⊩isTotalF x _ x~x
@@ -462,7 +462,7 @@
                              y~y = stCF⊩isStrictCodomainF x y _ ⊩Fxy
                              hope =
                                p⊩H⋆F≤H⋆G z y
-                               (pair  r₁  (tlF  (stCH  r₁)))
+                               (pair  r₁  (tlF  (stCH  r₁)))
                                (do
                                  return
                                    (x ,
@@ -477,14 +477,14 @@
                              subst
                                 r'  r'   F .relation  (x , y))
                                (sym
-                                 (cong  x  pr₁  (pr₂  x)) (λ*2ComputationRule prover r₁ r₂) 
-                                  cong  x  pr₁  x) (pr₂pxy≡y _ _) 
+                                 (cong  x  pr₁  (pr₂  x)) (λ*2ComputationRule prover r₁ r₂) 
+                                  cong  x  pr₁  x) (pr₂pxy≡y _ _) 
                                   pr₁pxy≡x _ _)) ⊩Fxy ,
                              subst
                                 r'  r'   G .relation  (x , y))
                                (sym
-                                 (cong  x  pr₂  (pr₂  x)) (λ*2ComputationRule prover r₁ r₂) 
-                                  cong  x  pr₂  x) (pr₂pxy≡y _ _) 
+                                 (cong  x  pr₂  (pr₂  x)) (λ*2ComputationRule prover r₁ r₂) 
+                                  cong  x  pr₂  x) (pr₂pxy≡y _ _) 
                                   pr₂pxy≡y _ _))
                                (relG⊩isRelationalG x'' x y y _ _ _ x''~x ⊩Gx''y y~y))))
                  ; isTotal = H .isTotal
@@ -511,9 +511,9 @@
                 (stDH , stDH⊩isStrictDomainH)  H .isStrictDomain
                 let
                   prover : ApplStrTerm as 1
-                  prover = ` relH ̇ (` stDH ̇ (` pr₁ ̇ # zero)) ̇ (` pr₁ ̇ # zero) ̇ (` pr₁ ̇ (` pr₂ ̇ # zero))
+                  prover = ` relH ̇ (` stDH ̇ (` pr₁ ̇ # zero)) ̇ (` pr₁ ̇ # zero) ̇ (` pr₁ ̇ (` pr₂ ̇ # zero))
                 return
-                  (λ* prover ,
+                  (λ* prover ,
                    z x r r⊩∃x' 
                     transport
                       (propTruncIdempotent (H .relation .isPropValued _ _))
@@ -522,8 +522,8 @@
                         return
                           (subst
                              r'  r'   H .relation  (z , x))
-                            (sym (λ*ComputationRule prover r))
-                            (relH⊩isRelationalH z z x' x _ _ _ (stDH⊩isStrictDomainH z x' (pr₁  r) pr₁r⊩Hzx') pr₁r⊩Hzx' pr₁pr₂r⊩x'~x)))))
+                            (sym (λ*ComputationRule prover r))
+                            (relH⊩isRelationalH z z x' x _ _ _ (stDH⊩isStrictDomainH z x' (pr₁  r) pr₁r⊩Hzx') pr₁r⊩Hzx' pr₁pr₂r⊩x'~x)))))
             !funcRel⋆inc≡H = eq/ _ _ (answer , F≤G→G≤F _ _ (composeFuncRel _ _ _ (!funcRel H H⋆F≡H⋆G) (equalizerFuncRel F G)) H answer)
           in !funcRel⋆inc≡H ,
           λ !' !'⋆inc≡H 
@@ -544,9 +544,9 @@
                       (stDH , stDH⊩isStrictDomainH)  H .isStrictDomain
                       let
                         prover : ApplStrTerm as 1
-                        prover = ` rel!' ̇ (` stDH ̇ # zero) ̇ (` pr₁ ̇ (` q ̇ # zero)) ̇ (` pr₂ ̇ (` q ̇ # zero))
+                        prover = ` rel!' ̇ (` stDH ̇ # zero) ̇ (` pr₁ ̇ (` q ̇ # zero)) ̇ (` pr₂ ̇ (` q ̇ # zero))
                       return
-                        (λ* prover ,
+                        (λ* prover ,
                          z x r r⊩Hzx 
                           transport
                             (propTruncIdempotent (!'funcRel .relation .isPropValued _ _))
@@ -555,7 +555,7 @@
                               return
                                 (subst
                                    r'  r'   !'funcRel .relation  (z , x))
-                                  (sym (λ*ComputationRule prover r))
+                                  (sym (λ*ComputationRule prover r))
                                   (rel!'⊩isRelational!'FuncRel
                                     z z x' x _ _ _
                                     (stDH⊩isStrictDomainH z x r r⊩Hzx)
diff --git a/docs/Realizability.Topos.Everything.html b/docs/Realizability.Topos.Everything.html
index 4ec7be1..0e760ab 100644
--- a/docs/Realizability.Topos.Everything.html
+++ b/docs/Realizability.Topos.Everything.html
@@ -1,13 +1,14 @@
 
-Realizability.Topos.Everything
module Realizability.Topos.Everything where
+Realizability.Topos.Everything
{-# OPTIONS --allow-unsolved-metas #-}
+module Realizability.Topos.Everything where
 
-open import Realizability.Topos.Object
-open import Realizability.Topos.FunctionalRelation
-open import Realizability.Topos.TerminalObject
-open import Realizability.Topos.BinProducts
-open import Realizability.Topos.Equalizer
-open import Realizability.Topos.MonicReprFuncRel
-open import Realizability.Topos.StrictRelation
-open import Realizability.Topos.ResizedPredicate
-open import Realizability.Topos.SubobjectClassifier
+open import Realizability.Topos.Object
+open import Realizability.Topos.FunctionalRelation
+open import Realizability.Topos.TerminalObject
+open import Realizability.Topos.BinProducts
+open import Realizability.Topos.Equalizer
+open import Realizability.Topos.MonicReprFuncRel
+open import Realizability.Topos.StrictRelation
+open import Realizability.Topos.ResizedPredicate
+open import Realizability.Topos.SubobjectClassifier
 
\ No newline at end of file diff --git a/docs/Realizability.Topos.FunctionalRelation.html b/docs/Realizability.Topos.FunctionalRelation.html index dcc7b73..bdd8871 100644 --- a/docs/Realizability.Topos.FunctionalRelation.html +++ b/docs/Realizability.Topos.FunctionalRelation.html @@ -1,5 +1,5 @@ -Realizability.Topos.FunctionalRelation
open import Realizability.ApplicativeStructure renaming (Term to ApplStrTerm)
+Realizability.Topos.FunctionalRelation
open import Realizability.ApplicativeStructure renaming (Term to ApplStrTerm)
 open import Realizability.CombinatoryAlgebra
 open import Cubical.Foundations.Prelude
 open import Cubical.Foundations.Structure
@@ -21,7 +21,7 @@
   { ℓ' ℓ''}
   {A : Type }
   (ca : CombinatoryAlgebra A)
-  (isNonTrivial : CombinatoryAlgebra.s ca  CombinatoryAlgebra.k ca  )
+  (isNonTrivial : CombinatoryAlgebra.s ca  CombinatoryAlgebra.k ca  )
   where
 
 open import Realizability.Tripos.Prealgebra.Predicate {ℓ' = ℓ'} {ℓ'' = ℓ''} ca
@@ -45,10 +45,10 @@
   equalityY = perY .equality
   
   realizesStrictDomain : A  Type _
-  realizesStrictDomain stD = (∀ x y r  r   relation  (x , y)  (stD  r)   equalityX  (x , x))
+  realizesStrictDomain stD = (∀ x y r  r   relation  (x , y)  (stD  r)   equalityX  (x , x))
 
   realizesStrictCodomain : A  Type _
-  realizesStrictCodomain stC = (∀ x y r  r   relation  (x , y)  (stC  r)   equalityY  (y , y))
+  realizesStrictCodomain stC = (∀ x y r  r   relation  (x , y)  (stC  r)   equalityY  (y , y))
 
   realizesRelational : A  Type _
   realizesRelational rel =
@@ -57,7 +57,7 @@
          b   relation  (x , y)
          c   equalityY  (y , y')
         ------------------------------------------
-         (rel  a  b  c)   relation  (x' , y'))
+         (rel  a  b  c)   relation  (x' , y'))
 
   realizesSingleValued : A  Type _
   realizesSingleValued sv =
@@ -65,11 +65,11 @@
          r₁   relation  (x , y)
          r₂   relation  (x , y')
         -----------------------------------
-         (sv  r₁  r₂)   equalityY  (y , y'))
+         (sv  r₁  r₂)   equalityY  (y , y'))
 
   realizesTotal : A  Type _
   realizesTotal tl =
-        (∀ x r  r   equalityX  (x , x)  ∃[ y  Y ] (tl  r)   relation  (x , y))
+        (∀ x r  r   equalityX  (x , x)  ∃[ y  Y ] (tl  r)   relation  (x , y))
     
   record isFunctionalRelation : Type (ℓ-max (ℓ-max (ℓ-suc ) (ℓ-suc ℓ')) (ℓ-suc ℓ'')) where
     constructor makeIsFunctionalRelation
@@ -90,7 +90,7 @@
 open FunctionalRelation
 
 pointwiseEntailment :  {X Y : Type ℓ'}  (perX : PartialEquivalenceRelation X)  (perY : PartialEquivalenceRelation Y)  (F G : FunctionalRelation perX perY)  Type (ℓ-max (ℓ-max  ℓ') ℓ'')
-pointwiseEntailment {X} {Y} perX perY F G = ∃[ pe  A ] (∀ x y r  r   F .relation  (x , y)  (pe  r)   G .relation  (x , y))
+pointwiseEntailment {X} {Y} perX perY F G = ∃[ pe  A ] (∀ x y r  r   F .relation  (x , y)  (pe  r)   G .relation  (x , y))
 
 -- Directly taken from "Realizability with Scott's Graph Model" by Tom de Jong
 -- Lemma 4.3.5
@@ -111,24 +111,24 @@
       (stGD , stGD⊩isStrictDomainG)  G .isStrictDomain
       let
         prover : ApplStrTerm as 1
-        prover = ` rlF ̇ (` stGD ̇ # zero) ̇ (` tlF ̇ (` stGD ̇ # zero)) ̇ (` svG ̇ (` r ̇ (` tlF ̇ (` stGD ̇ # zero))) ̇ # zero)
+        prover = ` rlF ̇ (` stGD ̇ # zero) ̇ (` tlF ̇ (` stGD ̇ # zero)) ̇ (` svG ̇ (` r ̇ (` tlF ̇ (` stGD ̇ # zero))) ̇ # zero)
       return
-        (λ* prover ,
+        (λ* prover ,
          x y s s⊩Gxy 
           subst
              r'  r'   F .relation  (x , y))
-            (sym (λ*ComputationRule prover s))
+            (sym (λ*ComputationRule prover s))
             (transport
               (propTruncIdempotent (F .relation .isPropValued _ _))
               (do
-                (y' , tlF⨾stGDs⊩Fxy')  tlF⊩isTotalF x (stGD  s) (stGD⊩isStrictDomainG x y s s⊩Gxy)
+                (y' , tlF⨾stGDs⊩Fxy')  tlF⊩isTotalF x (stGD  s) (stGD⊩isStrictDomainG x y s s⊩Gxy)
                 return
                   (rlF⊩isRelationalF
                     x x y' y
-                    (stGD  s) (tlF  (stGD  s)) (svG  (r  (tlF  (stGD  s)))  s)
+                    (stGD  s) (tlF  (stGD  s)) (svG  (r  (tlF  (stGD  s)))  s)
                     (stGD⊩isStrictDomainG x y s s⊩Gxy)
                     tlF⨾stGDs⊩Fxy'
-                    (svG⊩isSingleValuedG x y' y (r  (tlF  (stGD  s))) s (r⊩F≤G x y' (tlF  (stGD  s)) tlF⨾stGDs⊩Fxy') s⊩Gxy))))))
+                    (svG⊩isSingleValuedG x y' y (r  (tlF  (stGD  s))) s (r⊩F≤G x y' (tlF  (stGD  s)) tlF⨾stGDs⊩Fxy') s⊩Gxy))))))
 
 bientailment :  {X Y : Type ℓ'}  (perX : PartialEquivalenceRelation X)  (perY : PartialEquivalenceRelation Y)  FunctionalRelation perX perY  FunctionalRelation perX perY  Type _
 bientailment {X} {Y} perX perY F G = pointwiseEntailment perX perY F G × pointwiseEntailment perX perY G F
@@ -153,10 +153,10 @@
         (p , p⊩G≤H)  G≤H
         let
           prover : ApplStrTerm as 1
-          prover = ` p ̇ (` s ̇ # zero)
+          prover = ` p ̇ (` s ̇ # zero)
         return
-          (λ* prover ,
-           x y r r⊩Fxy  subst  r'  r'   H .relation  (x , y)) (sym (λ*ComputationRule prover r)) (p⊩G≤H x y (s  r) (s⊩F≤G x y r r⊩Fxy))))
+          (λ* prover ,
+           x y r r⊩Fxy  subst  r'  r'   H .relation  (x , y)) (sym (λ*ComputationRule prover r)) (p⊩G≤H x y (s  r) (s⊩F≤G x y r r⊩Fxy))))
   in
   answer , F≤G→G≤F perX perY F H answer
 
@@ -169,56 +169,56 @@
       (t , t⊩isTransitive)  perX .isTransitive
       let
         prover : ApplStrTerm as 1
-        prover = ` t ̇ # zero ̇ (` s ̇ # zero)
+        prover = ` t ̇ # zero ̇ (` s ̇ # zero)
       return
-        (λ* prover ,
+        (λ* prover ,
          λ x x' r r⊩x~x' 
            subst
               r'  r'   perX .equality  (x , x))
-             (sym (λ*ComputationRule prover r))
-             (t⊩isTransitive x x' x r (s  r) r⊩x~x' (s⊩isSymmetric x x' r r⊩x~x')))
+             (sym (λ*ComputationRule prover r))
+             (t⊩isTransitive x x' x r (s  r) r⊩x~x' (s⊩isSymmetric x x' r r⊩x~x')))
   isFunctionalRelation.isStrictCodomain (isFuncRel (idFuncRel {X} perX)) =
     do
       (s , s⊩isSymmetric)  perX .isSymmetric
       (t , t⊩isTransitive)  perX .isTransitive
       let
         prover : ApplStrTerm as 1
-        prover = ` t ̇ (` s ̇ # zero) ̇ # zero
+        prover = ` t ̇ (` s ̇ # zero) ̇ # zero
       return
-        (λ* prover ,
+        (λ* prover ,
          x x' r r⊩x~x' 
           subst
              r'  r'   perX .equality  (x' , x'))
-            (sym (λ*ComputationRule prover r))
-            (t⊩isTransitive x' x x' (s  r) r (s⊩isSymmetric x x' r r⊩x~x') r⊩x~x')))
+            (sym (λ*ComputationRule prover r))
+            (t⊩isTransitive x' x x' (s  r) r (s⊩isSymmetric x x' r r⊩x~x') r⊩x~x')))
   isFunctionalRelation.isRelational (isFuncRel (idFuncRel {X} perX)) =
     do
       (s , s⊩isSymmetric)  perX .isSymmetric
       (t , t⊩isTransitive)  perX .isTransitive
       let
         prover : ApplStrTerm as 3
-        prover = ` t ̇ (` t ̇ (` s ̇ # two) ̇ # one) ̇ # zero
+        prover = ` t ̇ (` t ̇ (` s ̇ # two) ̇ # one) ̇ # zero
       return
-        (λ*3 prover ,
+        (λ*3 prover ,
          x₁ x₂ x₃ x₄ a b c a⊩x₁~x₂ b⊩x₁~x₃ c⊩x₃~x₄ 
           subst
              r'  r'   perX .equality  (x₂ , x₄))
-            (sym (λ*3ComputationRule prover a b c))
-            (t⊩isTransitive x₂ x₃ x₄ (t  (s  a)  b) c (t⊩isTransitive x₂ x₁ x₃ (s  a) b (s⊩isSymmetric x₁ x₂ a a⊩x₁~x₂) b⊩x₁~x₃) c⊩x₃~x₄)))
+            (sym (λ*3ComputationRule prover a b c))
+            (t⊩isTransitive x₂ x₃ x₄ (t  (s  a)  b) c (t⊩isTransitive x₂ x₁ x₃ (s  a) b (s⊩isSymmetric x₁ x₂ a a⊩x₁~x₂) b⊩x₁~x₃) c⊩x₃~x₄)))
   isFunctionalRelation.isSingleValued (isFuncRel (idFuncRel {X} perX)) =
     do
       (s , s⊩isSymmetric)  perX .isSymmetric
       (t , t⊩isTransitive)  perX .isTransitive
       let
         prover : ApplStrTerm as 2
-        prover = ` t ̇ (` s ̇ # one) ̇ # zero
+        prover = ` t ̇ (` s ̇ # one) ̇ # zero
       return
-        (λ*2 prover ,
+        (λ*2 prover ,
          x₁ x₂ x₃ r₁ r₂ r₁⊩x₁~x₂ r₂⊩x₁~x₃ 
           subst
              r'  r'   perX .equality  (x₂ , x₃))
-            (sym (λ*2ComputationRule prover r₁ r₂))
-            (t⊩isTransitive x₂ x₁ x₃ (s  r₁) r₂ (s⊩isSymmetric x₁ x₂ r₁ r₁⊩x₁~x₂) r₂⊩x₁~x₃)))
+            (sym (λ*2ComputationRule prover r₁ r₂))
+            (t⊩isTransitive x₂ x₁ x₃ (s  r₁) r₂ (s⊩isSymmetric x₁ x₂ r₁ r₁⊩x₁~x₂) r₂⊩x₁~x₃)))
   isFunctionalRelation.isTotal (isFuncRel (idFuncRel {X} perX)) =
     do
       (s , s⊩isSymmetric)  perX .isSymmetric
@@ -242,42 +242,42 @@
      FunctionalRelation perX perZ
   isSetPredicateBase (relation (composeFuncRel {X} {Y} {Z} perX perY perZ F G)) = isSet× (perX .isSetX) (perZ .isSetX)
    relation (composeFuncRel {X} {Y} {Z} perX perY perZ F G)  (x , z) r =
-    ∃[ y  Y ] (pr₁  r)   F .relation  (x , y) × (pr₂  r)   G .relation  (y , z)
+    ∃[ y  Y ] (pr₁  r)   F .relation  (x , y) × (pr₂  r)   G .relation  (y , z)
   isPropValued (relation (composeFuncRel {X} {Y} {Z} perX perY perZ F G)) (x , z) r = isPropPropTrunc
   isFunctionalRelation.isStrictDomain (isFuncRel (composeFuncRel {X} {Y} {Z} perX perY perZ F G)) =
     do
       (stFD , stFD⊩isStrictDomainF)  F .isStrictDomain
       let
         prover : ApplStrTerm as 1
-        prover = ` stFD ̇ (` pr₁ ̇ # zero)
+        prover = ` stFD ̇ (` pr₁ ̇ # zero)
       return
-        (λ* prover ,
+        (λ* prover ,
          x z r r⊩∃y 
           subst
              r'  r'   perX .equality  (x , x))
-            (sym (λ*ComputationRule prover r))
+            (sym (λ*ComputationRule prover r))
             (transport
               (propTruncIdempotent (perX .equality .isPropValued _ _))
               (do
                 (y , pr₁r⊩Fxy , pr₂r⊩Gyz)  r⊩∃y
-                return (stFD⊩isStrictDomainF x y (pr₁  r) pr₁r⊩Fxy)))))
+                return (stFD⊩isStrictDomainF x y (pr₁  r) pr₁r⊩Fxy)))))
   isFunctionalRelation.isStrictCodomain (isFuncRel (composeFuncRel {X} {Y} {Z} perX perY perZ F G)) =
     do
       (stGC , stGC⊩isStrictCodomainG)  G .isStrictCodomain
       let
         prover : ApplStrTerm as 1
-        prover = ` stGC ̇ (` pr₂ ̇ # zero)
+        prover = ` stGC ̇ (` pr₂ ̇ # zero)
       return
-        (λ* prover ,
+        (λ* prover ,
          λ x z r r⊩∃y 
            subst
               r'  r'   perZ .equality  (z , z))
-             (sym (λ*ComputationRule prover r))
+             (sym (λ*ComputationRule prover r))
              (transport
                (propTruncIdempotent (perZ .equality .isPropValued _ _))
                (do
                  (y , pr₁r⊩Fxy , pr₂r⊩Gyz)  r⊩∃y
-                 return (stGC⊩isStrictCodomainG y z (pr₂  r) pr₂r⊩Gyz))))
+                 return (stGC⊩isStrictCodomainG y z (pr₂  r) pr₂r⊩Gyz))))
   isFunctionalRelation.isRelational (isFuncRel (composeFuncRel {X} {Y} {Z} perX perY perZ F G)) =
     do
       (rlF , rlF⊩isRelationalF)  F .isRelational
@@ -285,28 +285,28 @@
       (stFC , stFC⊩isStrictCodomainF)  F .isStrictCodomain
       let
         prover : ApplStrTerm as 3
-        prover = ` pair ̇ (` rlF ̇ # two ̇ (` pr₁ ̇ # one) ̇ (` stFC ̇ (` pr₁ ̇ # one))) ̇ (` rlG ̇ (` stFC ̇ (` pr₁ ̇ # one)) ̇ (` pr₂ ̇ # one) ̇ # zero)
+        prover = ` pair ̇ (` rlF ̇ # two ̇ (` pr₁ ̇ # one) ̇ (` stFC ̇ (` pr₁ ̇ # one))) ̇ (` rlG ̇ (` stFC ̇ (` pr₁ ̇ # one)) ̇ (` pr₂ ̇ # one) ̇ # zero)
       return
-        (λ*3 prover ,
+        (λ*3 prover ,
          x x' z z' a b c a⊩x~x' b⊩∃y c⊩z~z' 
           do
             (y , pr₁b⊩Fxy , pr₂b⊩Gyz)  b⊩∃y
             let
-              pr₁proofEq : pr₁  (λ*3 prover  a  b  c)  rlF  a  (pr₁  b)  (stFC  (pr₁  b))
-              pr₁proofEq = cong  x  pr₁  x) (λ*3ComputationRule prover a b c)  pr₁pxy≡x _ _
+              pr₁proofEq : pr₁  (λ*3 prover  a  b  c)  rlF  a  (pr₁  b)  (stFC  (pr₁  b))
+              pr₁proofEq = cong  x  pr₁  x) (λ*3ComputationRule prover a b c)  pr₁pxy≡x _ _
 
-              pr₂proofEq : pr₂  (λ*3 prover  a  b  c)  rlG  (stFC  (pr₁  b))  (pr₂  b)  c
-              pr₂proofEq = cong  x  pr₂  x) (λ*3ComputationRule prover a b c)  pr₂pxy≡y _ _
+              pr₂proofEq : pr₂  (λ*3 prover  a  b  c)  rlG  (stFC  (pr₁  b))  (pr₂  b)  c
+              pr₂proofEq = cong  x  pr₂  x) (λ*3ComputationRule prover a b c)  pr₂pxy≡y _ _
             return
               (y ,
                subst
                   r'  r'   F .relation  (x' , y))
                  (sym pr₁proofEq)
-                 (rlF⊩isRelationalF x x' y y a (pr₁  b) (stFC  (pr₁  b)) a⊩x~x' pr₁b⊩Fxy (stFC⊩isStrictCodomainF x y (pr₁  b) pr₁b⊩Fxy)) ,
+                 (rlF⊩isRelationalF x x' y y a (pr₁  b) (stFC  (pr₁  b)) a⊩x~x' pr₁b⊩Fxy (stFC⊩isStrictCodomainF x y (pr₁  b) pr₁b⊩Fxy)) ,
                subst
                   r'  r'   G .relation  (y , z'))
                  (sym pr₂proofEq)
-                 (rlG⊩isRelationalG y y z z' (stFC  (pr₁  b)) (pr₂  b) c (stFC⊩isStrictCodomainF x y (pr₁  b) pr₁b⊩Fxy) pr₂b⊩Gyz c⊩z~z'))))
+                 (rlG⊩isRelationalG y y z z' (stFC  (pr₁  b)) (pr₂  b) c (stFC⊩isStrictCodomainF x y (pr₁  b) pr₁b⊩Fxy) pr₂b⊩Gyz c⊩z~z'))))
   isFunctionalRelation.isSingleValued (isFuncRel (composeFuncRel {X} {Y} {Z} perX perY perZ F G)) =
     do
       (svF , svF⊩isSingleValuedF)  F .isSingleValued
@@ -315,9 +315,9 @@
       (stGC , stGC⊩isStrictCodomainG)  G .isStrictCodomain
       let
         prover : ApplStrTerm as 2
-        prover = ` svG ̇ (` pr₂ ̇ # one) ̇ (` relG ̇ (` svF ̇ (` pr₁ ̇ # zero) ̇ (` pr₁ ̇ # one)) ̇ (` pr₂ ̇ # zero) ̇ (` stGC ̇ (` pr₂ ̇ # zero)))
+        prover = ` svG ̇ (` pr₂ ̇ # one) ̇ (` relG ̇ (` svF ̇ (` pr₁ ̇ # zero) ̇ (` pr₁ ̇ # one)) ̇ (` pr₂ ̇ # zero) ̇ (` stGC ̇ (` pr₂ ̇ # zero)))
       return
-        (λ*2 prover ,
+        (λ*2 prover ,
          x z z' r₁ r₂ r₁⊩∃y r₂⊩∃y 
           transport
             (propTruncIdempotent (perZ .equality .isPropValued _ _))
@@ -327,20 +327,20 @@
               return
                 (subst
                    r'  r'   perZ .equality  (z , z'))
-                  (sym (λ*2ComputationRule prover r₁ r₂))
+                  (sym (λ*2ComputationRule prover r₁ r₂))
                   (svG⊩isSingleValuedG
                     y z z'
-                    (pr₂  r₁)
-                    (relG  (svF  (pr₁  r₂)  (pr₁  r₁))  (pr₂  r₂)  (stGC  (pr₂  r₂)))
+                    (pr₂  r₁)
+                    (relG  (svF  (pr₁  r₂)  (pr₁  r₁))  (pr₂  r₂)  (stGC  (pr₂  r₂)))
                     pr₂r₁⊩Gyz
                     (relG⊩isRelationalG
                       y' y z' z'
-                      (svF  (pr₁  r₂)  (pr₁  r₁))
-                      (pr₂  r₂)
-                      (stGC  (pr₂  r₂))
-                      (svF⊩isSingleValuedF x y' y (pr₁  r₂) (pr₁  r₁) pr₁r₂⊩Fxy' pr₁r₁⊩Fxy)
+                      (svF  (pr₁  r₂)  (pr₁  r₁))
+                      (pr₂  r₂)
+                      (stGC  (pr₂  r₂))
+                      (svF⊩isSingleValuedF x y' y (pr₁  r₂) (pr₁  r₁) pr₁r₂⊩Fxy' pr₁r₁⊩Fxy)
                       pr₂r₂⊩Gy'z'
-                      (stGC⊩isStrictCodomainG y' z' (pr₂  r₂) pr₂r₂⊩Gy'z')))))))
+                      (stGC⊩isStrictCodomainG y' z' (pr₂  r₂) pr₂r₂⊩Gy'z')))))))
   isFunctionalRelation.isTotal (isFuncRel (composeFuncRel {X} {Y} {Z} perX perY perZ F G)) =
     do
       (tlF , tlF⊩isTotalF)  F .isTotal
@@ -348,19 +348,19 @@
       (stFC , stFC⊩isStrictCodomainF)  F .isStrictCodomain
       let
         prover : ApplStrTerm as 1
-        prover = ` pair ̇ (` tlF ̇ # zero) ̇ (` tlG ̇ (` stFC ̇ (` tlF ̇ # zero)))
+        prover = ` pair ̇ (` tlF ̇ # zero) ̇ (` tlG ̇ (` stFC ̇ (` tlF ̇ # zero)))
       return
-        (λ* prover ,
+        (λ* prover ,
          x r r⊩x~x 
           do
             (y , ⊩Fxy)  tlF⊩isTotalF x r r⊩x~x
-            (z , ⊩Gyz)  tlG⊩isTotalG y (stFC  (tlF  r)) (stFC⊩isStrictCodomainF x y (tlF  r) ⊩Fxy)
+            (z , ⊩Gyz)  tlG⊩isTotalG y (stFC  (tlF  r)) (stFC⊩isStrictCodomainF x y (tlF  r) ⊩Fxy)
             return
               (z ,
               return
                 (y ,
-                ((subst  r'  r'   F .relation  (x , y)) (sym (cong  x  pr₁  x) (λ*ComputationRule prover r)  pr₁pxy≡x _ _)) ⊩Fxy) ,
-                 (subst  r'  r'   G .relation  (y , z)) (sym (cong  x  pr₂  x) (λ*ComputationRule prover r)  pr₂pxy≡y _ _)) ⊩Gyz))))))
+                ((subst  r'  r'   F .relation  (x , y)) (sym (cong  x  pr₁  x) (λ*ComputationRule prover r)  pr₁pxy≡x _ _)) ⊩Fxy) ,
+                 (subst  r'  r'   G .relation  (y , z)) (sym (cong  x  pr₂  x) (λ*ComputationRule prover r)  pr₂pxy≡y _ _)) ⊩Gyz))))))
 
 opaque
   unfolding composeFuncRel
@@ -383,9 +383,9 @@
               (s , s⊩F≤F')  F≤F'
               let
                 prover : ApplStrTerm as 1
-                prover = ` pair ̇ (` s ̇ (` pr₁ ̇ # zero)) ̇ (` pr₂ ̇ # zero)
+                prover = ` pair ̇ (` s ̇ (` pr₁ ̇ # zero)) ̇ (` pr₂ ̇ # zero)
               return
-                (λ* prover ,
+                (λ* prover ,
                  x z r r⊩∃y 
                   do
                     (y , pr₁r⊩Fxy , pr₂r⊩Gyz)  r⊩∃y
@@ -393,11 +393,11 @@
                       (y ,
                        subst
                           r'  r'   F' .relation  (x , y))
-                         (sym (cong  x  pr₁  x) (λ*ComputationRule prover r)  pr₁pxy≡x _ _))
-                         (s⊩F≤F' x y (pr₁  r) pr₁r⊩Fxy) ,
+                         (sym (cong  x  pr₁  x) (λ*ComputationRule prover r)  pr₁pxy≡x _ _))
+                         (s⊩F≤F' x y (pr₁  r) pr₁r⊩Fxy) ,
                        subst
                           r'  r'   G .relation  (y , z))
-                         (sym (cong  x  pr₂  x) (λ*ComputationRule prover r)  pr₂pxy≡y _ _))
+                         (sym (cong  x  pr₂  x) (λ*ComputationRule prover r)  pr₂pxy≡y _ _))
                          pr₂r⊩Gyz))))
           in
         (answer , F≤G→G≤F perX perZ (composeFuncRel perX perY perZ F G) (composeFuncRel perX perY perZ F' G) answer) })
@@ -407,17 +407,17 @@
             (s , s⊩G≤G')  G≤G'
             let
               prover : ApplStrTerm as 1
-              prover = ` pair ̇ (` pr₁ ̇ # zero) ̇ (` s ̇ (` pr₂ ̇ # zero))
+              prover = ` pair ̇ (` pr₁ ̇ # zero) ̇ (` s ̇ (` pr₂ ̇ # zero))
             return
-              (λ* prover ,
+              (λ* prover ,
                x z r r⊩∃y 
                  do
                    (y , pr₁r⊩Fxy , pr₂r⊩Gyz)  r⊩∃y
 
                    return
                      (y ,
-                      subst  r'  r'   F .relation  (x , y)) (sym (cong  x  pr₁  x) (λ*ComputationRule prover r)  pr₁pxy≡x _ _)) pr₁r⊩Fxy ,
-                      subst  r'  r'   G' .relation  (y , z)) (sym (cong  x  pr₂  x) (λ*ComputationRule prover r)  pr₂pxy≡y _ _)) (s⊩G≤G' y z (pr₂  r) pr₂r⊩Gyz)))))
+                      subst  r'  r'   F .relation  (x , y)) (sym (cong  x  pr₁  x) (λ*ComputationRule prover r)  pr₁pxy≡x _ _)) pr₁r⊩Fxy ,
+                      subst  r'  r'   G' .relation  (y , z)) (sym (cong  x  pr₂  x) (λ*ComputationRule prover r)  pr₂pxy≡y _ _)) (s⊩G≤G' y z (pr₂  r) pr₂r⊩Gyz)))))
           in
         (answer , F≤G→G≤F perX perZ (composeFuncRel perX perY perZ F G) (composeFuncRel perX perY perZ F G') answer) })
       f g
@@ -444,9 +444,9 @@
               (sX , sX⊩isSymmetricX)  perX .isSymmetric
               let
                 prover : ApplStrTerm as 1
-                prover = ` relF ̇ (` sX ̇ (` pr₁ ̇ # zero)) ̇ (` pr₂ ̇ # zero) ̇ (` stFC ̇ (` pr₂ ̇ # zero))
+                prover = ` relF ̇ (` sX ̇ (` pr₁ ̇ # zero)) ̇ (` pr₂ ̇ # zero) ̇ (` stFC ̇ (` pr₂ ̇ # zero))
               return
-                (λ* prover ,
+                (λ* prover ,
                   x y r r⊩∃x' 
                    transport
                      (propTruncIdempotent (F .relation .isPropValued _ _))
@@ -455,13 +455,13 @@
                        return
                          (subst
                             r'  r'   F .relation  (x , y))
-                           (sym (λ*ComputationRule prover r))
+                           (sym (λ*ComputationRule prover r))
                            (relF⊩isRelationalF
                              x' x y y
-                             (sX  (pr₁  r)) (pr₂  r) (stFC  (pr₂  r))
-                             (sX⊩isSymmetricX x x' (pr₁  r) pr₁r⊩x~x')
+                             (sX  (pr₁  r)) (pr₂  r) (stFC  (pr₂  r))
+                             (sX⊩isSymmetricX x x' (pr₁  r) pr₁r⊩x~x')
                              pr₂r⊩Fx'y
-                             (stFC⊩isStrictCodomainF x' y (pr₂  r) pr₂r⊩Fx'y))))))
+                             (stFC⊩isStrictCodomainF x' y (pr₂  r) pr₂r⊩Fx'y))))))
         in
         eq/ _ _ (answer , F≤G→G≤F perX perY (composeFuncRel perX perX perY (idFuncRel perX) F) F answer))
       f
@@ -487,9 +487,9 @@
               (stFD , stFD⊩isStrictDomainF)  F .isStrictDomain
               let
                 prover : ApplStrTerm as 1
-                prover = ` relF ̇ (` stFD ̇ (` pr₁ ̇ # zero)) ̇ (` pr₁ ̇ # zero) ̇ (` pr₂ ̇ # zero)
+                prover = ` relF ̇ (` stFD ̇ (` pr₁ ̇ # zero)) ̇ (` pr₁ ̇ # zero) ̇ (` pr₂ ̇ # zero)
               return
-                (λ* prover ,
+                (λ* prover ,
                  x y r r⊩∃y' 
                   transport
                     (propTruncIdempotent (F .relation .isPropValued _ _))
@@ -498,8 +498,8 @@
                       return
                         (subst
                            r'  r'   F .relation  (x , y))
-                          (sym (λ*ComputationRule prover r))
-                          (relF⊩isRelationalF x x y' y (stFD  (pr₁  r)) (pr₁  r) (pr₂  r) (stFD⊩isStrictDomainF x y' (pr₁  r) pr₁r⊩Fxy') pr₁r⊩Fxy' pr₂r⊩y'~y)))))
+                          (sym (λ*ComputationRule prover r))
+                          (relF⊩isRelationalF x x y' y (stFD  (pr₁  r)) (pr₁  r) (pr₂  r) (stFD⊩isStrictDomainF x y' (pr₁  r) pr₁r⊩Fxy') pr₁r⊩Fxy' pr₂r⊩y'~y)))))
         in
         eq/ _ _ (answer , F≤G→G≤F perX perY (composeFuncRel perX perY perY F (idFuncRel perY)) F answer))
       f
@@ -528,9 +528,9 @@
             do
               let
                 prover : ApplStrTerm as 1
-                prover = ` pair ̇ (` pr₁ ̇ (` pr₁ ̇ # zero)) ̇ (` pair ̇ (` pr₂ ̇ (` pr₁ ̇ # zero)) ̇ (` pr₂ ̇ # zero))
+                prover = ` pair ̇ (` pr₁ ̇ (` pr₁ ̇ # zero)) ̇ (` pair ̇ (` pr₂ ̇ (` pr₁ ̇ # zero)) ̇ (` pr₂ ̇ # zero))
               return
-                (λ* prover ,
+                (λ* prover ,
                  x w r r⊩∃z 
                   transport
                     (propTruncIdempotent isPropPropTrunc)
@@ -542,21 +542,21 @@
                           (y ,
                             (subst
                                r'  r'   F .relation  (x , y))
-                              (sym (cong  x  pr₁  x) (λ*ComputationRule prover r)  pr₁pxy≡x _ _))
+                              (sym (cong  x  pr₁  x) (λ*ComputationRule prover r)  pr₁pxy≡x _ _))
                               pr₁pr₁r⊩Fxy ,
                             return
                               (z ,
                                 ((subst
                                    r'  r'   G .relation  (y , z))
                                   (sym
-                                    (cong  x  pr₁  (pr₂  x)) (λ*ComputationRule prover r) 
-                                     cong  x  pr₁  x) (pr₂pxy≡y _ _)  pr₁pxy≡x _ _))
+                                    (cong  x  pr₁  (pr₂  x)) (λ*ComputationRule prover r) 
+                                     cong  x  pr₁  x) (pr₂pxy≡y _ _)  pr₁pxy≡x _ _))
                                   pr₂pr₁r⊩Gyz) ,
                                  (subst
                                    r'  r'   H .relation  (z , w))
                                   (sym
-                                    (cong  x  pr₂  (pr₂  x)) (λ*ComputationRule prover r) 
-                                     cong  x  pr₂  x) (pr₂pxy≡y _ _)  pr₂pxy≡y _ _))
+                                    (cong  x  pr₂  (pr₂  x)) (λ*ComputationRule prover r) 
+                                     cong  x  pr₂  x) (pr₂pxy≡y _ _)  pr₂pxy≡y _ _))
                                   pr₂r⊩Hzw)))))))))
         in
         eq/ _ _
diff --git a/docs/Realizability.Topos.MonicReprFuncRel.html b/docs/Realizability.Topos.MonicReprFuncRel.html
index 5c0622c..6768c8a 100644
--- a/docs/Realizability.Topos.MonicReprFuncRel.html
+++ b/docs/Realizability.Topos.MonicReprFuncRel.html
@@ -1,5 +1,5 @@
 
-Realizability.Topos.MonicReprFuncRel
open import Realizability.ApplicativeStructure renaming (Term to ApplStrTerm)
+Realizability.Topos.MonicReprFuncRel
open import Realizability.ApplicativeStructure renaming (Term to ApplStrTerm)
 open import Realizability.CombinatoryAlgebra
 open import Cubical.Foundations.Prelude
 open import Cubical.Foundations.Structure
@@ -23,7 +23,7 @@
   { ℓ' ℓ''}
   {A : Type }
   (ca : CombinatoryAlgebra A)
-  (isNonTrivial : CombinatoryAlgebra.s ca  CombinatoryAlgebra.k ca  )
+  (isNonTrivial : CombinatoryAlgebra.s ca  CombinatoryAlgebra.k ca  )
   where
 
 open import Realizability.Tripos.Prealgebra.Predicate {ℓ' = ℓ'} {ℓ'' = ℓ''} ca
@@ -47,7 +47,7 @@
   opaque
     isInjectiveFuncRel : Type (ℓ-max  (ℓ-max ℓ' ℓ''))
     isInjectiveFuncRel =
-      ∃[ inj  A ] (∀ x x' y r₁ r₂  r₁   F .relation  (x , y)  r₂   F .relation  (x' , y)  (inj  r₁  r₂)   perX .equality  (x , x'))
+      ∃[ inj  A ] (∀ x x' y r₁ r₂  r₁   F .relation  (x , y)  r₂   F .relation  (x' , y)  (inj  r₁  r₂)   perX .equality  (x , x'))
 
   opaque
     unfolding isInjectiveFuncRel
@@ -79,11 +79,11 @@
                 let
                   realizer : ApplStrTerm as 1
                   realizer =
-                    ` relB ̇ (` stDA ̇ # zero) ̇ (` pr₁ ̇ (` p ̇ (` pair ̇ # zero ̇ (` tlF ̇ (` stCA ̇ # zero))))) ̇
-                      (` injF ̇ (` pr₂ ̇ (` p ̇ (` pair ̇ # zero ̇ (` tlF ̇ (` stCA ̇ # zero))))) ̇
-                      (` tlF ̇ (` stCA ̇ # zero)))
+                    ` relB ̇ (` stDA ̇ # zero) ̇ (` pr₁ ̇ (` p ̇ (` pair ̇ # zero ̇ (` tlF ̇ (` stCA ̇ # zero))))) ̇
+                      (` injF ̇ (` pr₂ ̇ (` p ̇ (` pair ̇ # zero ̇ (` tlF ̇ (` stCA ̇ # zero))))) ̇
+                      (` tlF ̇ (` stCA ̇ # zero)))
                 return
-                  (λ* realizer ,
+                  (λ* realizer ,
                    z x r r⊩Azx 
                     transport
                       (propTruncIdempotent (B .relation .isPropValued _ _))
@@ -95,7 +95,7 @@
                         (x' , ⊩Bzx' , ⊩Fx'y)  
                           p⊩A⋆F≤B⋆F
                             z y
-                            (pair  r  (tlF  (stCA  r)))
+                            (pair  r  (tlF  (stCA  r)))
                             (return
                               (x ,
                               subst  r'  r'   A .relation  (z , x)) (sym (pr₁pxy≡x _ _)) r⊩Azx ,
@@ -105,7 +105,7 @@
                         return
                           (subst
                              r'  r'   B .relation  (z , x))
-                            (sym (λ*ComputationRule realizer r))
+                            (sym (λ*ComputationRule realizer r))
                             (relB⊩isRelationalB z z x' x _ _ _ z~z ⊩Bzx' x'~x)))))
           in
           eq/ A B (answer , F≤G→G≤F perZ perX A B answer))
@@ -185,83 +185,83 @@
         let
           cursed : ApplStrTerm as 2
           cursed =
-             (` pair ̇
-                  (` pair ̇
-                    (` pair ̇ (` stDF ̇ # one) ̇ (` stDF ̇ # zero)) ̇
-                    (` pair ̇ (` pair ̇ (` pair ̇ (` stDF ̇ # one) ̇ (` stDF ̇ # zero)) ̇ # one) ̇ (` pair ̇ (` pair ̇ (` stDF ̇ # zero) ̇ (` stDF ̇ # one)) ̇ # zero))) ̇
-                  (` pair ̇ (` stDF ̇ # one) ̇ (` stDF ̇ # zero)))
+             (` pair ̇
+                  (` pair ̇
+                    (` pair ̇ (` stDF ̇ # one) ̇ (` stDF ̇ # zero)) ̇
+                    (` pair ̇ (` pair ̇ (` pair ̇ (` stDF ̇ # one) ̇ (` stDF ̇ # zero)) ̇ # one) ̇ (` pair ̇ (` pair ̇ (` stDF ̇ # zero) ̇ (` stDF ̇ # one)) ̇ # zero))) ̇
+                  (` pair ̇ (` stDF ̇ # one) ̇ (` stDF ̇ # zero)))
           realizer : ApplStrTerm as 2
-          realizer = ` t ̇ (` s ̇ (` pr₁ ̇ (` pr₂ ̇ (` p ̇ cursed)))) ̇ (` s ̇ (` pr₂ ̇ (` pr₁ ̇ (` pr₁ ̇ (` p ̇ cursed)))))
+          realizer = ` t ̇ (` s ̇ (` pr₁ ̇ (` pr₂ ̇ (` p ̇ cursed)))) ̇ (` s ̇ (` pr₂ ̇ (` pr₁ ̇ (` pr₁ ̇ (` p ̇ cursed)))))
         return
-          (λ*2 realizer ,
+          (λ*2 realizer ,
            x₁ x₂ y r₁ r₂ r₁⊩Fx₁y r₂⊩Fx₂y 
             let
               x₁~x₁ = stDF⊩isStrictDomainF x₁ y r₁ r₁⊩Fx₁y
               x₂~x₂ = stDF⊩isStrictDomainF x₂ y r₂ r₂⊩Fx₂y
               foo =
                 p⊩kπ₁≤kπ₂ (x₁ , x₂) x₁
-                (pair 
-                  (pair 
-                    (pair  (stDF  r₁)  (stDF  r₂)) 
-                    (pair  (pair  (pair  (stDF  r₁)  (stDF  r₂))  r₁)  (pair  (pair  (stDF  r₂)  (stDF  r₁))  r₂))) 
-                  (pair  (stDF  r₁)  (stDF  r₂)))
+                (pair 
+                  (pair 
+                    (pair  (stDF  r₁)  (stDF  r₂)) 
+                    (pair  (pair  (pair  (stDF  r₁)  (stDF  r₂))  r₁)  (pair  (pair  (stDF  r₂)  (stDF  r₁))  r₂))) 
+                  (pair  (stDF  r₁)  (stDF  r₂)))
                 (return
                   (((x₁ , x₂)) ,
-                  ((subst  r'  r'   perX .equality  (x₁ , x₁)) (sym (cong  x  pr₁  (pr₁  x)) (pr₁pxy≡x _ _)  cong  x  pr₁  x) (pr₁pxy≡x _ _)  pr₁pxy≡x _ _)) x₁~x₁ ,
-                    subst  r'  r'   perX .equality  (x₂ , x₂)) (sym (cong  x  pr₂  (pr₁  x)) (pr₁pxy≡x _ _)  cong  x  pr₂  x) (pr₁pxy≡x _ _)  pr₂pxy≡y _ _)) x₂~x₂) ,
+                  ((subst  r'  r'   perX .equality  (x₁ , x₁)) (sym (cong  x  pr₁  (pr₁  x)) (pr₁pxy≡x _ _)  cong  x  pr₁  x) (pr₁pxy≡x _ _)  pr₁pxy≡x _ _)) x₁~x₁ ,
+                    subst  r'  r'   perX .equality  (x₂ , x₂)) (sym (cong  x  pr₂  (pr₁  x)) (pr₁pxy≡x _ _)  cong  x  pr₂  x) (pr₁pxy≡x _ _)  pr₂pxy≡y _ _)) x₂~x₂) ,
                  return
                   (y ,
                     return
                       (x₁ ,
                         (subst  r'  r'   perX .equality  (x₁ , x₁))
                           (sym
-                            (cong  x  pr₁  (pr₁  (pr₁  (pr₂  x)))) (pr₁pxy≡x _ _) 
-                             cong  x  pr₁  (pr₁  (pr₁  x))) (pr₂pxy≡y _ _) 
-                             cong  x  pr₁  (pr₁  x)) (pr₁pxy≡x _ _) 
-                             cong  x  pr₁  x) (pr₁pxy≡x _ _) 
+                            (cong  x  pr₁  (pr₁  (pr₁  (pr₂  x)))) (pr₁pxy≡x _ _) 
+                             cong  x  pr₁  (pr₁  (pr₁  x))) (pr₂pxy≡y _ _) 
+                             cong  x  pr₁  (pr₁  x)) (pr₁pxy≡x _ _) 
+                             cong  x  pr₁  x) (pr₁pxy≡x _ _) 
                              pr₁pxy≡x _ _))
                           x₁~x₁ ,
                          subst  r'  r'   perX .equality  (x₂ , x₂))
                            (sym
-                             (cong  x  pr₂  (pr₁  (pr₁  (pr₂  x)))) (pr₁pxy≡x _ _) 
-                              cong  x  pr₂  (pr₁  (pr₁  x))) (pr₂pxy≡y _ _) 
-                              cong  x  pr₂  (pr₁  x)) (pr₁pxy≡x _ _) 
-                              cong  x  pr₂  x) (pr₁pxy≡x _ _) 
+                             (cong  x  pr₂  (pr₁  (pr₁  (pr₂  x)))) (pr₁pxy≡x _ _) 
+                              cong  x  pr₂  (pr₁  (pr₁  x))) (pr₂pxy≡y _ _) 
+                              cong  x  pr₂  (pr₁  x)) (pr₁pxy≡x _ _) 
+                              cong  x  pr₂  x) (pr₁pxy≡x _ _) 
                               pr₂pxy≡y _ _))
                            x₂~x₂) ,
                          subst  r'  r'   F .relation  (x₁ , y))
                            (sym
-                             (cong  x  pr₂  (pr₁  (pr₂  x))) (pr₁pxy≡x _ _) 
-                              cong  x  pr₂  (pr₁  x)) (pr₂pxy≡y _ _) 
-                              cong  x  pr₂  x) (pr₁pxy≡x _ _) 
+                             (cong  x  pr₂  (pr₁  (pr₂  x))) (pr₁pxy≡x _ _) 
+                              cong  x  pr₂  (pr₁  x)) (pr₂pxy≡y _ _) 
+                              cong  x  pr₂  x) (pr₁pxy≡x _ _) 
                               pr₂pxy≡y _ _))
                            r₁⊩Fx₁y) ,
                     return
                       (x₂ ,
                         (subst  r'  r'   perX .equality  (x₂ , x₂))
                           (sym
-                            (cong  x  pr₁  (pr₁  (pr₂  (pr₂  x)))) (pr₁pxy≡x _ _) 
-                             cong  x  pr₁  (pr₁  (pr₂  x))) (pr₂pxy≡y _ _) 
-                             cong  x  pr₁  (pr₁  x)) (pr₂pxy≡y _ _) 
-                             cong  x  pr₁  x) (pr₁pxy≡x _ _) 
+                            (cong  x  pr₁  (pr₁  (pr₂  (pr₂  x)))) (pr₁pxy≡x _ _) 
+                             cong  x  pr₁  (pr₁  (pr₂  x))) (pr₂pxy≡y _ _) 
+                             cong  x  pr₁  (pr₁  x)) (pr₂pxy≡y _ _) 
+                             cong  x  pr₁  x) (pr₁pxy≡x _ _) 
                              pr₁pxy≡x _ _))
                           x₂~x₂ ,
                          subst  r'  r'   perX .equality  (x₁ , x₁))
                            (sym
-                             (cong  x  pr₂  (pr₁  (pr₂  (pr₂  x)))) (pr₁pxy≡x _ _) 
-                              cong  x  pr₂  (pr₁  (pr₂  x))) (pr₂pxy≡y _ _) 
-                              cong  x  pr₂  (pr₁  x)) (pr₂pxy≡y _ _) 
-                              cong  x  pr₂  x) (pr₁pxy≡x _ _) 
+                             (cong  x  pr₂  (pr₁  (pr₂  (pr₂  x)))) (pr₁pxy≡x _ _) 
+                              cong  x  pr₂  (pr₁  (pr₂  x))) (pr₂pxy≡y _ _) 
+                              cong  x  pr₂  (pr₁  x)) (pr₂pxy≡y _ _) 
+                              cong  x  pr₂  x) (pr₁pxy≡x _ _) 
                               pr₂pxy≡y _ _))
                            x₁~x₁) ,
                          subst  r'  r'   F .relation  (x₂ , y))
                            (sym
-                             (cong  x  pr₂  (pr₂  (pr₂  x))) (pr₁pxy≡x _ _) 
-                              cong  x  pr₂  (pr₂  x)) (pr₂pxy≡y _ _) 
-                              cong  x  pr₂  x) (pr₂pxy≡y _ _) 
+                             (cong  x  pr₂  (pr₂  (pr₂  x))) (pr₁pxy≡x _ _) 
+                              cong  x  pr₂  (pr₂  x)) (pr₂pxy≡y _ _) 
+                              cong  x  pr₂  x) (pr₂pxy≡y _ _) 
                               pr₂pxy≡y _ _)) r₂⊩Fx₂y))) ,
-                         subst  r'  r'   perX .equality  (x₁ , x₁)) (sym (cong  x  pr₁  x) (pr₂pxy≡y _ _)  pr₁pxy≡x _ _)) x₁~x₁ ,
-                         subst  r'  r'   perX .equality  (x₂ , x₂)) (sym (cong  x  pr₂  x) (pr₂pxy≡y _ _)  pr₂pxy≡y _ _)) x₂~x₂))
+                         subst  r'  r'   perX .equality  (x₁ , x₁)) (sym (cong  x  pr₁  x) (pr₂pxy≡y _ _)  pr₁pxy≡x _ _)) x₁~x₁ ,
+                         subst  r'  r'   perX .equality  (x₂ , x₂)) (sym (cong  x  pr₂  x) (pr₂pxy≡y _ _)  pr₂pxy≡y _ _)) x₂~x₂))
             in
             transport
               (propTruncIdempotent (perX .equality .isPropValued _ _))
@@ -275,6 +275,6 @@
                 return
                   (subst
                      r'  r'   perX .equality  (x₁ , x₂))
-                    (sym (λ*2ComputationRule realizer r₁ r₂))
+                    (sym (λ*2ComputationRule realizer r₁ r₂))
                     (t⊩isTransitiveEqX x₁ x₂' x₂ _ _ (s⊩isSymmetricEqX x₂' x₁ _ x₂'~x₁) (s⊩isSymmetricEqX x₂ x₂' _ x₂~x₂'))))))
 
\ No newline at end of file diff --git a/docs/Realizability.Topos.Object.html b/docs/Realizability.Topos.Object.html index 1737fdc..c8af074 100644 --- a/docs/Realizability.Topos.Object.html +++ b/docs/Realizability.Topos.Object.html @@ -1,5 +1,5 @@ -Realizability.Topos.Object
open import Realizability.ApplicativeStructure renaming (Term to ApplStrTerm)
+Realizability.Topos.Object
open import Realizability.ApplicativeStructure renaming (Term to ApplStrTerm)
 open import Realizability.CombinatoryAlgebra
 open import Cubical.Foundations.Prelude
 open import Cubical.Foundations.Structure
@@ -18,7 +18,7 @@
   { ℓ' ℓ''}
   {A : Type }
   (ca : CombinatoryAlgebra A)
-  (isNonTrivial : CombinatoryAlgebra.s ca  CombinatoryAlgebra.k ca  )
+  (isNonTrivial : CombinatoryAlgebra.s ca  CombinatoryAlgebra.k ca  )
   where
   
 open import Realizability.Tripos.Prealgebra.Predicate {ℓ' = ℓ'} {ℓ'' = ℓ''} ca
@@ -31,8 +31,8 @@
 record isPartialEquivalenceRelation (X : Type ℓ') (equality : Predicate (X × X)) : Type (ℓ-max (ℓ-max (ℓ-suc ) (ℓ-suc ℓ')) (ℓ-suc ℓ'')) where
   field
     isSetX : isSet X
-    isSymmetric : ∃[ s  A ] (∀ x y r  r   equality  (x , y)  (s  r)   equality  (y , x))
-    isTransitive : ∃[ t  A ] (∀ x y z a b  a   equality  (x , y)  b   equality  (y , z)  (t  a  b)   equality  (x , z))
+    isSymmetric : ∃[ s  A ] (∀ x y r  r   equality  (x , y)  (s  r)   equality  (y , x))
+    isTransitive : ∃[ t  A ] (∀ x y z a b  a   equality  (x , y)  b   equality  (y , z)  (t  a  b)   equality  (x , z))
 
 open isPartialEquivalenceRelation
 isPropIsPartialEquivalenceRelation :  {X : Type ℓ'}  (equality : Predicate (X × X))  isProp (isPartialEquivalenceRelation X equality)
diff --git a/docs/Realizability.Topos.ResizedPredicate.html b/docs/Realizability.Topos.ResizedPredicate.html
index 0a56df2..c7deb1b 100644
--- a/docs/Realizability.Topos.ResizedPredicate.html
+++ b/docs/Realizability.Topos.ResizedPredicate.html
@@ -15,8 +15,8 @@
   {}
   {A : Type }
   (ca : CombinatoryAlgebra A)
-  (isNonTrivial : CombinatoryAlgebra.s ca  CombinatoryAlgebra.k ca  )
-  (resizing : hPropResizing )
+  (isNonTrivial : CombinatoryAlgebra.s ca  CombinatoryAlgebra.k ca  )
+  (resizing : hPropResizing )
   where
 
 open import Realizability.Tripos.Prealgebra.Predicate {ℓ' = } {ℓ'' = } ca
@@ -71,14 +71,14 @@
   open PartialEquivalenceRelation
 
   entailmentResizedPredicate :  (ϕ ψ : ResizedPredicate X)  A  Type 
-  entailmentResizedPredicate ϕ ψ r =  (x : X) (a : A) (⊩ϕx : a   toPredicate ϕ  x)  (r  a)   toPredicate ψ  x
+  entailmentResizedPredicate ϕ ψ r =  (x : X) (a : A) (⊩ϕx : a   toPredicate ϕ  x)  (r  a)   toPredicate ψ  x
 
   isPropEntailmentResizedPredicate :  ϕ ψ a  isProp (entailmentResizedPredicate ϕ ψ a)
   isPropEntailmentResizedPredicate ϕ ψ a =
     isPropΠ λ x  isPropΠ λ b  isPropΠ λ _  (toPredicate ψ) .isPropValued _ _
 
   isStrictResizedPredicate :  (ϕ : ResizedPredicate X)  A  Type 
-  isStrictResizedPredicate ϕ r =  (x : X) (a : A) (⊩ϕx : a   toPredicate ϕ  x)  (r  a)   perX .equality  (x , x)
+  isStrictResizedPredicate ϕ r =  (x : X) (a : A) (⊩ϕx : a   toPredicate ϕ  x)  (r  a)   perX .equality  (x , x)
 
   isPropIsStrictResizedPredicate :  ϕ r  isProp (isStrictResizedPredicate ϕ r)
   isPropIsStrictResizedPredicate ϕ r =
@@ -86,7 +86,7 @@
 
   isRelationalResizedPredicate :  (ϕ : ResizedPredicate X)  A  Type 
   isRelationalResizedPredicate ϕ r =
-     (x x' : X) (a b : A) (⊩x~x' : a   perX .equality  (x , x')) (⊩ϕx : b   toPredicate ϕ  x)  (r  a  b)   toPredicate ϕ  x'
+     (x x' : X) (a b : A) (⊩x~x' : a   perX .equality  (x , x')) (⊩ϕx : b   toPredicate ϕ  x)  (r  a  b)   toPredicate ϕ  x'
 
   isPropIsRelationalResizedPredicate :  ϕ r  isProp (isRelationalResizedPredicate ϕ r)
   isPropIsRelationalResizedPredicate ϕ r =
diff --git a/docs/Realizability.Topos.StrictRelation.html b/docs/Realizability.Topos.StrictRelation.html
index 5594652..d509d03 100644
--- a/docs/Realizability.Topos.StrictRelation.html
+++ b/docs/Realizability.Topos.StrictRelation.html
@@ -1,5 +1,5 @@
 
-Realizability.Topos.StrictRelation
open import Realizability.ApplicativeStructure renaming (Term to ApplStrTerm)
+Realizability.Topos.StrictRelation
open import Realizability.ApplicativeStructure renaming (Term to ApplStrTerm)
 open import Realizability.CombinatoryAlgebra
 open import Cubical.Foundations.Prelude
 open import Cubical.Foundations.Structure
@@ -26,7 +26,7 @@
   { ℓ' ℓ''}
   {A : Type }
   (ca : CombinatoryAlgebra A)
-  (isNonTrivial : CombinatoryAlgebra.s ca  CombinatoryAlgebra.k ca  )
+  (isNonTrivial : CombinatoryAlgebra.s ca  CombinatoryAlgebra.k ca  )
   where
 
 open import Realizability.Tripos.Prealgebra.Predicate {ℓ' = ℓ'} {ℓ'' = ℓ''} ca
@@ -47,8 +47,8 @@
 
 record isStrictRelation {X : Type ℓ'} (perX : PartialEquivalenceRelation X) (ϕ : Predicate X) : Type (ℓ-max  (ℓ-max ℓ' ℓ'')) where
   field
-    isStrict : ∃[ st  A ] (∀ x r  r   ϕ  x  (st  r)   perX .equality  (x , x))
-    isRelational : ∃[ rel  A ] (∀ x x' r s  r   ϕ  x  s   perX .equality  (x , x')  (rel  r  s)   ϕ  x')
+    isStrict : ∃[ st  A ] (∀ x r  r   ϕ  x  (st  r)   perX .equality  (x , x))
+    isRelational : ∃[ rel  A ] (∀ x x' r s  r   ϕ  x  s   perX .equality  (x , x')  (rel  r  s)   ϕ  x')
 
 record StrictRelation {X : Type ℓ'} (perX : PartialEquivalenceRelation X) : Type (ℓ-max (ℓ-suc ) (ℓ-max (ℓ-suc ℓ') (ℓ-suc ℓ''))) where
   field
@@ -63,7 +63,7 @@
   {-# TERMINATING #-}
   subPer : PartialEquivalenceRelation X
   Predicate.isSetX (equality subPer) = isSet× (perX .isSetX) (perX .isSetX)
-   equality subPer  (x , x') r = (pr₁  r)   perX .equality  (x , x') × (pr₂  r)   ϕ .predicate  x
+   equality subPer  (x , x') r = (pr₁  r)   perX .equality  (x , x') × (pr₂  r)   ϕ .predicate  x
   isPropValued (equality subPer) (x , x') r = isProp× (perX .equality .isPropValued _ _) (ϕ .predicate .isPropValued _ _)
   isPartialEquivalenceRelation.isSetX (isPerEquality subPer) = perX .isSetX
   isPartialEquivalenceRelation.isSymmetric (isPerEquality subPer) =
@@ -73,17 +73,17 @@
       (relϕ , relϕ⊩isRelationalϕ)  ϕ .isRelational
       let
         realizer : ApplStrTerm as 1
-        realizer = ` pair ̇ (` s ̇ (` pr₁ ̇ # zero)) ̇ (` relϕ ̇ (` pr₂ ̇ # zero) ̇ (` pr₁ ̇ # zero))
+        realizer = ` pair ̇ (` s ̇ (` pr₁ ̇ # zero)) ̇ (` relϕ ̇ (` pr₂ ̇ # zero) ̇ (` pr₁ ̇ # zero))
       return
-        (λ* realizer ,
+        (λ* realizer ,
          { x x' r (pr₁r⊩x~x' , pr₂r⊩ϕx) 
           subst
              r'  r'   perX .equality  (x' , x))
-            (sym (cong  x  pr₁  x) (λ*ComputationRule realizer r)  pr₁pxy≡x _ _))
+            (sym (cong  x  pr₁  x) (λ*ComputationRule realizer r)  pr₁pxy≡x _ _))
             (s⊩isSymmetricX x x' _ pr₁r⊩x~x') ,
           subst
              r'  r'   ϕ .predicate  x')
-            (sym (cong  x  pr₂  x) (λ*ComputationRule realizer r)  pr₂pxy≡y _ _))
+            (sym (cong  x  pr₂  x) (λ*ComputationRule realizer r)  pr₂pxy≡y _ _))
             (relϕ⊩isRelationalϕ x x' _ _ pr₂r⊩ϕx pr₁r⊩x~x') }))
   isPartialEquivalenceRelation.isTransitive (isPerEquality subPer) =
     do
@@ -91,17 +91,17 @@
       (relϕ , relϕ⊩isRelationalϕ)  ϕ .isRelational
       let
         realizer : ApplStrTerm as 2
-        realizer = ` pair ̇ (` t ̇ (` pr₁ ̇ # one) ̇ (` pr₁ ̇ # zero)) ̇ (` pr₂ ̇ # one)
+        realizer = ` pair ̇ (` t ̇ (` pr₁ ̇ # one) ̇ (` pr₁ ̇ # zero)) ̇ (` pr₂ ̇ # one)
       return
-        (λ*2 realizer ,
+        (λ*2 realizer ,
          { x₁ x₂ x₃ a b (⊩x₁~x₂ , ⊩ϕx₁) (⊩x₂~x₃ , ⊩ϕx₂) 
           subst
              r'  r'   perX .equality  (x₁ , x₃))
-            (sym (cong  x  pr₁  x) (λ*2ComputationRule realizer a b)  pr₁pxy≡x _ _))
+            (sym (cong  x  pr₁  x) (λ*2ComputationRule realizer a b)  pr₁pxy≡x _ _))
             (t⊩isTransitiveX x₁ x₂ x₃ _ _ ⊩x₁~x₂ ⊩x₂~x₃) ,
           subst
              r'  r'   ϕ .predicate  x₁)
-            (sym (cong  x  pr₂  x) (λ*2ComputationRule realizer a b)  pr₂pxy≡y _ _))
+            (sym (cong  x  pr₂  x) (λ*2ComputationRule realizer a b)  pr₂pxy≡y _ _))
             ⊩ϕx₁ }))
 
   opaque
@@ -109,56 +109,56 @@
     {-# TERMINATING #-}
     incFuncRel : FunctionalRelation subPer perX
     Predicate.isSetX (relation incFuncRel) = isSet× (perX .isSetX) (perX .isSetX)
-    Predicate.∣ relation incFuncRel  (x , x') r = (pr₁  r)   perX .equality  (x , x') × (pr₂  r)   ϕ .predicate  x
+    Predicate.∣ relation incFuncRel  (x , x') r = (pr₁  r)   perX .equality  (x , x') × (pr₂  r)   ϕ .predicate  x
     Predicate.isPropValued (relation incFuncRel) (x , x') r = isProp× (perX .equality .isPropValued _ _) (ϕ .predicate .isPropValued _ _)
     isFunctionalRelation.isStrictDomain (isFuncRel incFuncRel) =
       do
         (stD , stD⊩isStrictDomain)  idFuncRel perX .isStrictDomain
         let
           realizer : ApplStrTerm as 1
-          realizer = ` pair ̇ (` stD ̇ (` pr₁ ̇ # zero)) ̇ (` pr₂ ̇ # zero)
+          realizer = ` pair ̇ (` stD ̇ (` pr₁ ̇ # zero)) ̇ (` pr₂ ̇ # zero)
         return
-          (λ* realizer ,
+          (λ* realizer ,
            { x x' r (⊩x~x' , ⊩ϕx) 
-            (subst  r'  r'   perX .equality  (x , x)) (sym (cong  x  pr₁  x) (λ*ComputationRule realizer r)  pr₁pxy≡x _ _)) (stD⊩isStrictDomain x x' _ ⊩x~x')) ,
-            (subst  r'  r'   ϕ .predicate  x) (sym (cong  x  pr₂  x) (λ*ComputationRule realizer r)  pr₂pxy≡y _ _)) ⊩ϕx) }))
+            (subst  r'  r'   perX .equality  (x , x)) (sym (cong  x  pr₁  x) (λ*ComputationRule realizer r)  pr₁pxy≡x _ _)) (stD⊩isStrictDomain x x' _ ⊩x~x')) ,
+            (subst  r'  r'   ϕ .predicate  x) (sym (cong  x  pr₂  x) (λ*ComputationRule realizer r)  pr₂pxy≡y _ _)) ⊩ϕx) }))
     isFunctionalRelation.isStrictCodomain (isFuncRel incFuncRel) =
       do
         (stC , stC⊩isStrictCodomain)  idFuncRel perX .isStrictCodomain
         let
           realizer : ApplStrTerm as 1
-          realizer = ` stC ̇ (` pr₁ ̇ # zero)
+          realizer = ` stC ̇ (` pr₁ ̇ # zero)
         return
-          (λ* realizer ,
-           { x x' r (⊩x~x' , ⊩ϕx)  subst  r'  r'   perX .equality  (x' , x')) (sym (λ*ComputationRule realizer r)) (stC⊩isStrictCodomain x x' _ ⊩x~x')}))
+          (λ* realizer ,
+           { x x' r (⊩x~x' , ⊩ϕx)  subst  r'  r'   perX .equality  (x' , x')) (sym (λ*ComputationRule realizer r)) (stC⊩isStrictCodomain x x' _ ⊩x~x')}))
     isFunctionalRelation.isRelational (isFuncRel incFuncRel) =
       do
         (relX , relX⊩isRelationalX)  idFuncRel perX .isRelational
         (relϕ , relϕ⊩isRelationalϕ)  ϕ .isRelational
         let
           realizer : ApplStrTerm as 3
-          realizer = ` pair ̇ (` relX ̇ (` pr₁ ̇ # two) ̇ (` pr₁ ̇ # one) ̇ # zero) ̇ (` relϕ ̇ (` pr₂ ̇ # two) ̇ (` pr₁ ̇ # two))
+          realizer = ` pair ̇ (` relX ̇ (` pr₁ ̇ # two) ̇ (` pr₁ ̇ # one) ̇ # zero) ̇ (` relϕ ̇ (` pr₂ ̇ # two) ̇ (` pr₁ ̇ # two))
         return
-          (λ*3 realizer ,
+          (λ*3 realizer ,
            { x₁ x₂ x₃ x₄ a b c (⊩x₁~x₂ , ⊩ϕx₁) (⊩x₁~x₃ , ⊩ϕx₁') c⊩x₃~x₄ 
             subst
                r'  r'   perX .equality  (x₂ , x₄))
-              (sym (cong  x  pr₁  x) (λ*3ComputationRule realizer a b c)  pr₁pxy≡x _ _))
+              (sym (cong  x  pr₁  x) (λ*3ComputationRule realizer a b c)  pr₁pxy≡x _ _))
               (relX⊩isRelationalX x₁ x₂ x₃ x₄ _ _ _ ⊩x₁~x₂ ⊩x₁~x₃ c⊩x₃~x₄) ,
             subst
                r'  r'   ϕ .predicate  x₂)
-              (sym (cong  x  pr₂  x) (λ*3ComputationRule realizer a b c)  pr₂pxy≡y _ _))
+              (sym (cong  x  pr₂  x) (λ*3ComputationRule realizer a b c)  pr₂pxy≡y _ _))
               (relϕ⊩isRelationalϕ x₁ x₂ _ _ ⊩ϕx₁ ⊩x₁~x₂) }))
     isFunctionalRelation.isSingleValued (isFuncRel incFuncRel) =
       do
         (sv , sv⊩isSingleValuedX)  idFuncRel perX .isSingleValued
         let
           realizer : ApplStrTerm as 2
-          realizer = ` sv ̇ (` pr₁ ̇ # one) ̇ (` pr₁ ̇ # zero)
+          realizer = ` sv ̇ (` pr₁ ̇ # one) ̇ (` pr₁ ̇ # zero)
         return
-          (λ*2 realizer ,
+          (λ*2 realizer ,
            { x x' x'' r₁ r₂ (⊩x~x' , ⊩ϕx) (⊩x~x'' , ⊩ϕx') 
-            subst  r'  r'   perX .equality  (x' , x'')) (sym (λ*2ComputationRule realizer r₁ r₂)) (sv⊩isSingleValuedX x x' x'' _ _ ⊩x~x' ⊩x~x'') }))
+            subst  r'  r'   perX .equality  (x' , x'')) (sym (λ*2ComputationRule realizer r₁ r₂)) (sv⊩isSingleValuedX x x' x'' _ _ ⊩x~x' ⊩x~x'') }))
     isFunctionalRelation.isTotal (isFuncRel incFuncRel) =
       do
         return
@@ -166,8 +166,8 @@
            { x r (pr₁r⊩x~x , pr₂r⊩ϕx) 
             return
               (x ,
-              subst  r'  r'   perX .equality  (x , x)) (cong  x  pr₁  x) (sym (Ida≡a _))) pr₁r⊩x~x ,
-              subst  r'  r'   ϕ .predicate  x) (cong  x  pr₂  x) (sym (Ida≡a _))) pr₂r⊩ϕx) }))
+              subst  r'  r'   perX .equality  (x , x)) (cong  x  pr₁  x) (sym (Ida≡a _))) pr₁r⊩x~x ,
+              subst  r'  r'   ϕ .predicate  x) (cong  x  pr₂  x) (sym (Ida≡a _))) pr₂r⊩ϕx) }))
 
   opaque
     unfolding isInjectiveFuncRel
@@ -179,17 +179,17 @@
         (s , s⊩isSymmetricX)  perX .isSymmetric
         let
           realizer : ApplStrTerm as 2
-          realizer = ` pair ̇ (` t ̇ (` pr₁ ̇ # one) ̇ (` s ̇ (` pr₁ ̇ # zero))) ̇ (` pr₂ ̇ # one)
+          realizer = ` pair ̇ (` t ̇ (` pr₁ ̇ # one) ̇ (` s ̇ (` pr₁ ̇ # zero))) ̇ (` pr₂ ̇ # one)
         return
-          (λ*2 realizer ,
+          (λ*2 realizer ,
            x₁ x₂ x₃ r₁ r₂ (⊩x₁~x₃ , ⊩ϕx₁) (⊩x₂~x₃ , ⊩ϕx₂) 
             subst
                r'  r'   perX .equality  (x₁ , x₂))
-              (sym (cong  x  pr₁  x) (λ*2ComputationRule realizer r₁ r₂)  pr₁pxy≡x _ _))
+              (sym (cong  x  pr₁  x) (λ*2ComputationRule realizer r₁ r₂)  pr₁pxy≡x _ _))
               (t⊩isTransitiveX x₁ x₃ x₂ _ _ ⊩x₁~x₃ (s⊩isSymmetricX x₂ x₃ _ ⊩x₂~x₃)) ,
             subst
                r'  r'   ϕ .predicate  x₁)
-              (sym (cong  x  pr₂  x) (λ*2ComputationRule realizer r₁  r₂)  pr₂pxy≡y _ _))
+              (sym (cong  x  pr₂  x) (λ*2ComputationRule realizer r₁  r₂)  pr₂pxy≡y _ _))
               ⊩ϕx₁))
 
   isMonicInc : isMonic RT [ incFuncRel ]
@@ -225,9 +225,9 @@
       (stDF , stDF⊩isStrictDomainF)  F .isStrictDomain
       let
         realizer : ApplStrTerm as 2
-        realizer = ` relF ̇ (` stDF ̇ # one) ̇ # one ̇ # zero
+        realizer = ` relF ̇ (` stDF ̇ # one) ̇ # one ̇ # zero
       return
-        (λ*2 realizer ,
+        (λ*2 realizer ,
          x x' r s r⊩∃y s⊩x~x' 
           do
             (y , ⊩Fyx)  r⊩∃y
@@ -235,7 +235,7 @@
               (y ,
               subst
                  r'  r'   F .relation  (y , x'))
-                (sym (λ*2ComputationRule realizer r s))
+                (sym (λ*2ComputationRule realizer r s))
                 (relF⊩isRelationalF y y x x' _ _ _ (stDF⊩isStrictDomainF y x _ ⊩Fyx) ⊩Fyx s⊩x~x'))))
 
   perψ : PartialEquivalenceRelation X
@@ -255,46 +255,46 @@
       (stCF , stCF⊩isStrictCodomain)  F .isStrictCodomain
       let
         realizer : ApplStrTerm as 1
-        realizer = ` pair ̇ (` stCF ̇ # zero) ̇ # zero
+        realizer = ` pair ̇ (` stCF ̇ # zero) ̇ # zero
       return
-        (λ* realizer ,
+        (λ* realizer ,
          y x r ⊩Fyx 
           subst
              r'  r'   perX .equality  (x , x))
-            (sym (cong  x  pr₁  x) (λ*ComputationRule realizer r)  pr₁pxy≡x _ _))
+            (sym (cong  x  pr₁  x) (λ*ComputationRule realizer r)  pr₁pxy≡x _ _))
             (stCF⊩isStrictCodomain y x _ ⊩Fyx) ,
            y ,
             subst
                r'  r'   F .relation  (y , x))
-              (sym (cong  x  pr₂  x) (λ*ComputationRule realizer r)  pr₂pxy≡y _ _))
+              (sym (cong  x  pr₂  x) (λ*ComputationRule realizer r)  pr₂pxy≡y _ _))
               ⊩Fyx ∣₁))
   isFunctionalRelation.isRelational (isFuncRel perY≤perψFuncRel) =
     do
       (relF , relF⊩isRelationalF)  F .isRelational
       let
         realizer : ApplStrTerm as 3
-        realizer = ` relF ̇ # two ̇ # one ̇ (` pr₁ ̇ # zero)
+        realizer = ` relF ̇ # two ̇ # one ̇ (` pr₁ ̇ # zero)
       return
-        (λ*3 realizer ,
+        (λ*3 realizer ,
          { y y' x x' a b c ⊩y~y' ⊩Fyx (⊩x~x' , ⊩Fy''x) 
-          subst  r'  r'   F .relation  (y' , x')) (sym (λ*3ComputationRule realizer a b c)) (relF⊩isRelationalF y y' x x' _ _ _ ⊩y~y' ⊩Fyx ⊩x~x') }))
+          subst  r'  r'   F .relation  (y' , x')) (sym (λ*3ComputationRule realizer a b c)) (relF⊩isRelationalF y y' x x' _ _ _ ⊩y~y' ⊩Fyx ⊩x~x') }))
   isFunctionalRelation.isSingleValued (isFuncRel perY≤perψFuncRel) =
     do
       (svF , svF⊩isSingleValuedF)  F .isSingleValued
       let
         realizer : ApplStrTerm as 2
-        realizer = ` pair ̇ (` svF ̇ # one ̇ # zero) ̇ # one
+        realizer = ` pair ̇ (` svF ̇ # one ̇ # zero) ̇ # one
       return
-        (λ*2 realizer ,
+        (λ*2 realizer ,
          y x x' r₁ r₂ ⊩Fyx ⊩Fyx' 
           subst
              r'  r'   perX .equality  (x , x'))
-            (sym (cong  x  pr₁  x) (λ*2ComputationRule realizer r₁ r₂)  pr₁pxy≡x _ _))
+            (sym (cong  x  pr₁  x) (λ*2ComputationRule realizer r₁ r₂)  pr₁pxy≡x _ _))
             (svF⊩isSingleValuedF y x x' _ _ ⊩Fyx ⊩Fyx') ,
            y ,
             (subst
                r'  r'   F .relation  (y , x))
-              (sym (cong  x  pr₂  x) (λ*2ComputationRule realizer r₁ r₂)  pr₂pxy≡y _ _))
+              (sym (cong  x  pr₂  x) (λ*2ComputationRule realizer r₁ r₂)  pr₂pxy≡y _ _))
               ⊩Fyx) ∣₁))
   isFunctionalRelation.isTotal (isFuncRel perY≤perψFuncRel) =
     do
@@ -319,9 +319,9 @@
             (relF , relF⊩isRelationalF)  F .isRelational
             let
               realizer : ApplStrTerm as 1
-              realizer = ` relF ̇ (` stDF ̇ (` pr₁ ̇ # zero)) ̇ (` pr₁ ̇ # zero) ̇ (` pr₁ ̇ (` pr₂ ̇ # zero))
+              realizer = ` relF ̇ (` stDF ̇ (` pr₁ ̇ # zero)) ̇ (` pr₁ ̇ # zero) ̇ (` pr₁ ̇ (` pr₂ ̇ # zero))
             return
-              (λ* realizer ,
+              (λ* realizer ,
                y x r r⊩∃x' 
                 transport
                   (propTruncIdempotent (F .relation .isPropValued _ _))
@@ -330,7 +330,7 @@
                     return
                       (subst
                          r  r   F .relation  (y , x))
-                        (sym (λ*ComputationRule realizer r))
+                        (sym (λ*ComputationRule realizer r))
                         (relF⊩isRelationalF y y x' x _ _ _ (stDF⊩isStrictDomainF y x' _ ⊩Fyx') ⊩Fyx' ⊩x'~x)))))
       in
       eq/ _ _ (answer , F≤G→G≤F perY perX (composeFuncRel _ _ _ perY≤perψFuncRel (InducedSubobject.incFuncRel perX ψ)) F answer)
@@ -347,19 +347,19 @@
         (stCF , stCF⊩isStrictCodomainF)  F .isStrictCodomain
         let
           realizer : ApplStrTerm as 1
-          realizer = ` pair ̇ (` stCF ̇ # zero) ̇ # zero
+          realizer = ` pair ̇ (` stCF ̇ # zero) ̇ # zero
         return
-          (λ* realizer ,
+          (λ* realizer ,
            x y r ⊩Fyx 
             (subst
                r'  r'   perX .equality  (x , x))
-              (sym (cong  x  pr₁  x) (λ*ComputationRule realizer r)  pr₁pxy≡x _ _))
+              (sym (cong  x  pr₁  x) (λ*ComputationRule realizer r)  pr₁pxy≡x _ _))
               (stCF⊩isStrictCodomainF y x _ ⊩Fyx)) ,
             (return
               (y ,
               (subst
                  r'  r'   F .relation  (y , x))
-                (sym (cong  x  pr₂  x) (λ*ComputationRule realizer r)  pr₂pxy≡y _ _))
+                (sym (cong  x  pr₂  x) (λ*ComputationRule realizer r)  pr₂pxy≡y _ _))
                 ⊩Fyx)))))
     isFunctionalRelation.isStrictCodomain (isFuncRel perψ≤perYFuncRel) =
       do
@@ -372,11 +372,11 @@
         (relF , relF⊩isRelationalF)  F .isRelational
         let
           realizer : ApplStrTerm as 3
-          realizer = ` relF ̇ # zero ̇ # one ̇ (` pr₁ ̇ # two)
+          realizer = ` relF ̇ # zero ̇ # one ̇ (` pr₁ ̇ # two)
         return
-          (λ*3 realizer ,
+          (λ*3 realizer ,
            { x x' y y' a b c (⊩x~x' , ⊩ψx) ⊩Fyx ⊩y~y' 
-            subst  r'  r'   F .relation  (y' , x')) (sym (λ*3ComputationRule realizer a b c)) (relF⊩isRelationalF y y' x x' _ _ _ ⊩y~y' ⊩Fyx ⊩x~x') }))
+            subst  r'  r'   F .relation  (y' , x')) (sym (λ*3ComputationRule realizer a b c)) (relF⊩isRelationalF y y' x x' _ _ _ ⊩y~y' ⊩Fyx ⊩x~x') }))
     isFunctionalRelation.isSingleValued (isFuncRel perψ≤perYFuncRel) =
       let
         isInjectiveFuncRelF = isMonic→isInjectiveFuncRel perY perX F isMonicF
@@ -405,9 +405,9 @@
             (svF , svF⊩isSingleValuedF)  F .isSingleValued
             let
               realizer : ApplStrTerm as 1
-              realizer = ` pair ̇ (` svF ̇ (` pr₁ ̇ # zero) ̇ (` pr₂ ̇ # zero)) ̇ (` pr₁ ̇ # zero)
+              realizer = ` pair ̇ (` svF ̇ (` pr₁ ̇ # zero) ̇ (` pr₂ ̇ # zero)) ̇ (` pr₁ ̇ # zero)
             return
-              (λ* realizer ,
+              (λ* realizer ,
                x x' r r⊩∃y 
                 transport
                   (propTruncIdempotent (isProp× (perX .equality .isPropValued _ _) isPropPropTrunc))
@@ -416,13 +416,13 @@
                     return
                       (subst
                          r'  r'   perX .equality  (x , x'))
-                        (sym (cong  x  pr₁  x) (λ*ComputationRule realizer r)  pr₁pxy≡x _ _))
+                        (sym (cong  x  pr₁  x) (λ*ComputationRule realizer r)  pr₁pxy≡x _ _))
                         (svF⊩isSingleValuedF y x x' _ _ ⊩Fyx ⊩Fyx') ,
                       return
                         (y ,
                         (subst
                            r'  r'   F .relation  (y , x))
-                          (sym (cong  x  pr₂  x) (λ*ComputationRule realizer r)  pr₂pxy≡y _ _))
+                          (sym (cong  x  pr₂  x) (λ*ComputationRule realizer r)  pr₂pxy≡y _ _))
                           ⊩Fyx))))))
       in
       eq/ _ _ (answer , F≤G→G≤F perψ perX (composeFuncRel _ _ _ perψ≤perYFuncRel F) (InducedSubobject.incFuncRel perX ψ) answer)
@@ -474,9 +474,9 @@
             (q , q⊩incϕ≤F⋆incψ)  q
             let
               realizer : ApplStrTerm as 1
-              realizer = ` relψ ̇ (` pr₂ ̇ (` pr₂ ̇ (` q ̇ (` pair ̇ (` stϕ ̇ # zero) ̇ # zero)))) ̇ (` pr₁ ̇ (` pr₂ ̇ (` q ̇ (` pair ̇ (` stϕ ̇ # zero) ̇ # zero))))
+              realizer = ` relψ ̇ (` pr₂ ̇ (` pr₂ ̇ (` q ̇ (` pair ̇ (` stϕ ̇ # zero) ̇ # zero)))) ̇ (` pr₁ ̇ (` pr₂ ̇ (` q ̇ (` pair ̇ (` stϕ ̇ # zero) ̇ # zero))))
             return
-              (λ* realizer ,
+              (λ* realizer ,
                x a a⊩ϕx 
                 transport
                   (propTruncIdempotent (ψ .predicate .isPropValued _ _))
@@ -484,10 +484,10 @@
                     (x' , ⊩Fxx' , ⊩x'~x , ⊩ψx') 
                       q⊩incϕ≤F⋆incψ
                         x x
-                        (pair  (stϕ  a)  a)
+                        (pair  (stϕ  a)  a)
                         ((subst  r'  r'   perX .equality  (x , x)) (sym (pr₁pxy≡x _ _)) (stϕ⊩isStrictϕ x a a⊩ϕx)) ,
                          (subst  r'  r'   ϕ .predicate  x) (sym (pr₂pxy≡y _ _)) a⊩ϕx))
-                    return (subst  r'  r'   ψ .predicate  x) (sym (λ*ComputationRule realizer a)) (relψ⊩isRelationalψ x' x _ _ ⊩ψx' ⊩x'~x))))))
+                    return (subst  r'  r'   ψ .predicate  x) (sym (λ*ComputationRule realizer a)) (relψ⊩isRelationalψ x' x _ _ ⊩ψx' ⊩x'~x))))))
         f
         f⋆incψ≡incϕ
 
@@ -500,36 +500,36 @@
     {-# TERMINATING #-}
     funcRel : FunctionalRelation perϕ perψ
     Predicate.isSetX (relation funcRel) = isSet× (perX .isSetX) (perX .isSetX)
-    Predicate.∣ relation funcRel  (x , x') r = (pr₁  r)   perX .equality  (x , x') × ((pr₁  (pr₂  r))   ϕ .predicate  x) × ((pr₂  (pr₂  r))   ψ .predicate  x)
+    Predicate.∣ relation funcRel  (x , x') r = (pr₁  r)   perX .equality  (x , x') × ((pr₁  (pr₂  r))   ϕ .predicate  x) × ((pr₂  (pr₂  r))   ψ .predicate  x)
     Predicate.isPropValued (relation funcRel) (x , x') r = isProp× (perX .equality .isPropValued _ _) (isProp× (ϕ .predicate .isPropValued _ _) (ψ .predicate .isPropValued _ _))
     isFunctionalRelation.isStrictDomain (isFuncRel funcRel) =
       do
         (stϕ , stϕ⊩isStrictϕ)  ϕ .isStrict
         let
           realizer : ApplStrTerm as 1
-          realizer = ` pair ̇ (` stϕ ̇ (` pr₁ ̇ (` pr₂ ̇ # zero))) ̇ (` pr₁ ̇ (` pr₂ ̇ # zero))
+          realizer = ` pair ̇ (` stϕ ̇ (` pr₁ ̇ (` pr₂ ̇ # zero))) ̇ (` pr₁ ̇ (` pr₂ ̇ # zero))
         return
-          (λ* realizer ,
+          (λ* realizer ,
            { x x' r (⊩x~x' , ⊩ϕx , ⊩ψx) 
-            subst  r'  r'   perX .equality  (x , x)) (sym (cong  x  pr₁  x) (λ*ComputationRule realizer r)  pr₁pxy≡x _ _)) (stϕ⊩isStrictϕ x _ ⊩ϕx) ,
-            subst  r'  r'   ϕ .predicate  x) (sym (cong  x  pr₂  x) (λ*ComputationRule realizer r)  pr₂pxy≡y _ _)) ⊩ϕx}))
+            subst  r'  r'   perX .equality  (x , x)) (sym (cong  x  pr₁  x) (λ*ComputationRule realizer r)  pr₁pxy≡x _ _)) (stϕ⊩isStrictϕ x _ ⊩ϕx) ,
+            subst  r'  r'   ϕ .predicate  x) (sym (cong  x  pr₂  x) (λ*ComputationRule realizer r)  pr₂pxy≡y _ _)) ⊩ϕx}))
     isFunctionalRelation.isStrictCodomain (isFuncRel funcRel) =
       do
         (stCX , stCX⊩isStrictCodomainX)  idFuncRel perX .isStrictCodomain
         (relψ , relψ⊩isRelationalψ)  ψ .isRelational
         let
           realizer : ApplStrTerm as 1
-          realizer = ` pair ̇ (` stCX ̇ (` pr₁ ̇ # zero)) ̇ (` relψ ̇ (` pr₂ ̇ (` pr₂ ̇ # zero)) ̇ (` pr₁ ̇ # zero))
+          realizer = ` pair ̇ (` stCX ̇ (` pr₁ ̇ # zero)) ̇ (` relψ ̇ (` pr₂ ̇ (` pr₂ ̇ # zero)) ̇ (` pr₁ ̇ # zero))
         return
-          (λ* realizer ,
+          (λ* realizer ,
            { x x' r (⊩x~x' , ⊩ϕx , ⊩ψx) 
             subst
                r'  r'   perX .equality  (x' , x'))
-              (sym (cong  x  pr₁  x) (λ*ComputationRule realizer r)  pr₁pxy≡x _ _))
+              (sym (cong  x  pr₁  x) (λ*ComputationRule realizer r)  pr₁pxy≡x _ _))
               (stCX⊩isStrictCodomainX x x' _ ⊩x~x') ,
             subst
                r'  r'   ψ .predicate  x')
-              (sym (cong  x  pr₂  x) (λ*ComputationRule realizer r)  pr₂pxy≡y _ _))
+              (sym (cong  x  pr₂  x) (λ*ComputationRule realizer r)  pr₂pxy≡y _ _))
               (relψ⊩isRelationalψ x x' _ _ ⊩ψx ⊩x~x')}))
     isFunctionalRelation.isRelational (isFuncRel funcRel) =
       do
@@ -539,21 +539,21 @@
         let
           realizer : ApplStrTerm as 3
           realizer =
-            ` pair ̇ (` relX ̇ (` pr₁ ̇ # two) ̇ (` pr₁ ̇ # one) ̇ (` pr₁ ̇ # zero)) ̇ (` pair ̇ (` relϕ ̇ (` pr₂ ̇ # two) ̇ (` pr₁ ̇ # two)) ̇ (` relψ ̇ (` pr₂ ̇ (` pr₂ ̇ # one)) ̇ (` pr₁ ̇ # two)))
+            ` pair ̇ (` relX ̇ (` pr₁ ̇ # two) ̇ (` pr₁ ̇ # one) ̇ (` pr₁ ̇ # zero)) ̇ (` pair ̇ (` relϕ ̇ (` pr₂ ̇ # two) ̇ (` pr₁ ̇ # two)) ̇ (` relψ ̇ (` pr₂ ̇ (` pr₂ ̇ # one)) ̇ (` pr₁ ̇ # two)))
         return
-          (λ*3 realizer ,
+          (λ*3 realizer ,
           λ { x₁ x₂ x₃ x₄ a b c (⊩x₁~x₂ , ⊩ϕx₁) (⊩x₁~x₃ , ⊩'ϕx₁ , ⊩ψx₁) (⊩x₃~x₄ , ⊩ψx₃) 
             subst
                r'  r'   perX .equality  (x₂ , x₄))
-              (sym (cong  x  pr₁  x) (λ*3ComputationRule realizer a b c)  pr₁pxy≡x _ _))
+              (sym (cong  x  pr₁  x) (λ*3ComputationRule realizer a b c)  pr₁pxy≡x _ _))
               (relX⊩isRelationalX x₁ x₂ x₃ x₄ _ _ _ ⊩x₁~x₂ ⊩x₁~x₃ ⊩x₃~x₄) ,
             subst
                r'  r'   ϕ .predicate  x₂)
-              (sym (cong  x  pr₁  (pr₂  x)) (λ*3ComputationRule realizer a b c)  cong  x  pr₁  x) (pr₂pxy≡y _ _)  pr₁pxy≡x _ _))
+              (sym (cong  x  pr₁  (pr₂  x)) (λ*3ComputationRule realizer a b c)  cong  x  pr₁  x) (pr₂pxy≡y _ _)  pr₁pxy≡x _ _))
               (relϕ⊩isRelationalϕ x₁ x₂ _ _ ⊩ϕx₁ ⊩x₁~x₂) ,
             subst
                r'  r'   ψ .predicate  x₂)
-              (sym (cong  x  pr₂  (pr₂  x)) (λ*3ComputationRule realizer a b c)  cong  x  pr₂  x) (pr₂pxy≡y _ _)  pr₂pxy≡y _ _))
+              (sym (cong  x  pr₂  (pr₂  x)) (λ*3ComputationRule realizer a b c)  cong  x  pr₂  x) (pr₂pxy≡y _ _)  pr₂pxy≡y _ _))
               (relψ⊩isRelationalψ x₁ x₂ _ _ ⊩ψx₁ ⊩x₁~x₂)})
     isFunctionalRelation.isSingleValued (isFuncRel funcRel) =
       do
@@ -561,35 +561,35 @@
         (relψ , relψ⊩isRelationalψ)  ψ .isRelational
         let
           realizer : ApplStrTerm as 2
-          realizer = ` pair ̇ (` svX ̇ (` pr₁ ̇ # one) ̇ (` pr₁ ̇ # zero)) ̇ (` relψ ̇ (` pr₂ ̇ (` pr₂ ̇ # one)) ̇ (` pr₁ ̇ # one))
+          realizer = ` pair ̇ (` svX ̇ (` pr₁ ̇ # one) ̇ (` pr₁ ̇ # zero)) ̇ (` relψ ̇ (` pr₂ ̇ (` pr₂ ̇ # one)) ̇ (` pr₁ ̇ # one))
         return
-          (λ*2 realizer ,
+          (λ*2 realizer ,
            { x₁ x₂ x₃ r₁ r₂ (⊩x₁~x₂ , ⊩ϕx , ⊩ψx) (⊩x₁~x₃ , ⊩'ϕx , ⊩'ψx) 
-            (subst  r'  r'   perX .equality  (x₂ , x₃)) (sym (cong  x  pr₁  x) (λ*2ComputationRule realizer r₁ r₂)  pr₁pxy≡x _ _)) (svX⊩isSingleValuedX x₁ x₂ x₃ _ _ ⊩x₁~x₂ ⊩x₁~x₃)) ,
-             subst  r'  r'   ψ .predicate  x₂) (sym (cong  x  pr₂  x) (λ*2ComputationRule realizer r₁ r₂)  pr₂pxy≡y _ _)) (relψ⊩isRelationalψ x₁ x₂ _ _ ⊩ψx ⊩x₁~x₂)}))
+            (subst  r'  r'   perX .equality  (x₂ , x₃)) (sym (cong  x  pr₁  x) (λ*2ComputationRule realizer r₁ r₂)  pr₁pxy≡x _ _)) (svX⊩isSingleValuedX x₁ x₂ x₃ _ _ ⊩x₁~x₂ ⊩x₁~x₃)) ,
+             subst  r'  r'   ψ .predicate  x₂) (sym (cong  x  pr₂  x) (λ*2ComputationRule realizer r₁ r₂)  pr₂pxy≡y _ _)) (relψ⊩isRelationalψ x₁ x₂ _ _ ⊩ψx ⊩x₁~x₂)}))
     isFunctionalRelation.isTotal (isFuncRel funcRel) =
       do
         (tl , tl⊩isTotalIncψ)  incψ .isTotal
         (s , s⊩ϕ≤ψ)  ϕ≤ψ
         let
           realizer : ApplStrTerm as 1
-          realizer = ` pair ̇ (` pr₁ ̇ # zero) ̇ (` pair ̇ (` pr₂ ̇ # zero) ̇ (` s ̇ (` pr₂ ̇ # zero)))
+          realizer = ` pair ̇ (` pr₁ ̇ # zero) ̇ (` pair ̇ (` pr₂ ̇ # zero) ̇ (` s ̇ (` pr₂ ̇ # zero)))
         return
-          (λ* realizer ,
+          (λ* realizer ,
            { x r (⊩x~x , ⊩ϕx) 
             return
               (x ,
               subst
                  r'  r'   perX .equality  (x , x))
-                (sym (cong  x  pr₁  x) (λ*ComputationRule realizer r)  pr₁pxy≡x _ _))
+                (sym (cong  x  pr₁  x) (λ*ComputationRule realizer r)  pr₁pxy≡x _ _))
                 ⊩x~x ,
               subst
                  r'  r'   ϕ .predicate  x)
-                (sym (cong  x  pr₁  (pr₂  x)) (λ*ComputationRule realizer r)  cong  x  pr₁  x) (pr₂pxy≡y _ _)  pr₁pxy≡x _ _))
+                (sym (cong  x  pr₁  (pr₂  x)) (λ*ComputationRule realizer r)  cong  x  pr₁  x) (pr₂pxy≡y _ _)  pr₁pxy≡x _ _))
                 ⊩ϕx ,
               subst
                  r'  r'   ψ .predicate  x)
-                (sym (cong  x  pr₂  (pr₂  x)) (λ*ComputationRule realizer r)  cong  x  pr₂  x) (pr₂pxy≡y _ _)  pr₂pxy≡y _ _))
+                (sym (cong  x  pr₂  (pr₂  x)) (λ*ComputationRule realizer r)  cong  x  pr₂  x) (pr₂pxy≡y _ _)  pr₂pxy≡y _ _))
                 (s⊩ϕ≤ψ x _ ⊩ϕx))}))
     
     funcRel⋆incψ≡incϕ : [ funcRel ]  [ incψ ]  [ incϕ ]
@@ -600,9 +600,9 @@
             (t , t⊩isTransitiveX)  perX .isTransitive
             let
               realizer : ApplStrTerm as 1
-              realizer = ` pair ̇ (` t ̇ (` pr₁ ̇ (` pr₁ ̇ # zero)) ̇ (` pr₁ ̇ (` pr₂ ̇ # zero))) ̇ (` pr₁ ̇ (` pr₂ ̇ (` pr₁ ̇ # zero)))
+              realizer = ` pair ̇ (` t ̇ (` pr₁ ̇ (` pr₁ ̇ # zero)) ̇ (` pr₁ ̇ (` pr₂ ̇ # zero))) ̇ (` pr₁ ̇ (` pr₂ ̇ (` pr₁ ̇ # zero)))
             return
-              (λ* realizer ,
+              (λ* realizer ,
                { x x' r ⊩∃x'' 
                 transport
                   (propTruncIdempotent (isPropΣ (perX .equality .isPropValued _ _) λ _  ϕ .predicate .isPropValued _ _))
@@ -611,11 +611,11 @@
                     return
                       ((subst
                          r'  r'   perX .equality  (x , x'))
-                        (sym (cong  x  pr₁  x) (λ*ComputationRule realizer r)  pr₁pxy≡x _ _))
+                        (sym (cong  x  pr₁  x) (λ*ComputationRule realizer r)  pr₁pxy≡x _ _))
                         (t⊩isTransitiveX x x'' x' _ _ ⊩x~x'' ⊩x''~x')) ,
                        (subst
                           r'  r'   ϕ .predicate  x)
-                         (sym (cong  x  pr₂  x) (λ*ComputationRule realizer r)  pr₂pxy≡y _ _))
+                         (sym (cong  x  pr₂  x) (λ*ComputationRule realizer r)  pr₂pxy≡y _ _))
                          ⊩ϕx)))}))
       in
       eq/ _ _ (answer , F≤G→G≤F perϕ perX (composeFuncRel _ _ _ funcRel incψ) incϕ answer)
diff --git a/docs/Realizability.Topos.SubobjectClassifier.html b/docs/Realizability.Topos.SubobjectClassifier.html
index 4d86d16..3d028fc 100644
--- a/docs/Realizability.Topos.SubobjectClassifier.html
+++ b/docs/Realizability.Topos.SubobjectClassifier.html
@@ -1,5 +1,5 @@
 
-Realizability.Topos.SubobjectClassifier
open import Realizability.ApplicativeStructure renaming (Term to ApplStrTerm; ⟦_⟧ to pre⟦_⟧)
+Realizability.Topos.SubobjectClassifier
open import Realizability.ApplicativeStructure renaming (Term to ApplStrTerm; ⟦_⟧ to pre⟦_⟧)
 open import Cubical.Foundations.Prelude
 open import Cubical.Foundations.HLevels
 open import Cubical.Foundations.Equiv
@@ -21,8 +21,8 @@
   {}
   {A : Type }
   (ca : CombinatoryAlgebra A)
-  (isNonTrivial : CombinatoryAlgebra.s ca  CombinatoryAlgebra.k ca  )
-  (resizing : hPropResizing )
+  (isNonTrivial : CombinatoryAlgebra.s ca  CombinatoryAlgebra.k ca  )
+  (resizing : hPropResizing )
   where
   
 open import Realizability.Tripos.Prealgebra.Predicate {ℓ' = } {ℓ'' = } ca
@@ -49,8 +49,8 @@
 Ωper : PartialEquivalenceRelation (ResizedPredicate Unit*)
 Predicate.isSetX (equality Ωper) = isSet× isSetResizedPredicate isSetResizedPredicate
 Predicate.∣ equality Ωper  (α , β) r =
-  (∀ (a : A) (⊩α : a   toPredicate α  tt*)  ((pr₁  r)  a)   toPredicate β  tt*) ×
-  (∀ (a : A) (⊩β : a   toPredicate β  tt*)  ((pr₂  r)  a)   toPredicate α  tt*)
+  (∀ (a : A) (⊩α : a   toPredicate α  tt*)  ((pr₁  r)  a)   toPredicate β  tt*) ×
+  (∀ (a : A) (⊩β : a   toPredicate β  tt*)  ((pr₂  r)  a)   toPredicate α  tt*)
 Predicate.isPropValued (equality Ωper) (α , β) r =
   isProp×
     (isPropΠ  _  isPropΠ λ _  (toPredicate β) .isPropValued _ _))
@@ -60,41 +60,41 @@
   do
     let
       ent₁ : ApplStrTerm as 2
-      ent₁ = ` pr₂ ̇ # one ̇ # zero
+      ent₁ = ` pr₂ ̇ # one ̇ # zero
 
       ent₂ : ApplStrTerm as 2
-      ent₂ = ` pr₁ ̇ # one ̇ # zero
+      ent₂ = ` pr₁ ̇ # one ̇ # zero
 
       realizer : ApplStrTerm as 1
-      realizer = ` pair ̇ (λ*abst ent₁) ̇ (λ*abst ent₂)
+      realizer = ` pair ̇ (λ*abst ent₁) ̇ (λ*abst ent₂)
     return
-      (λ* realizer ,
+      (λ* realizer ,
       λ { α β r (pr₁r⊩α≤β , pr₂r⊩β≤α) 
          a a⊩β 
           let
-            eq : pr₁  (λ* realizer  r)  a  pr₂  r  a
+            eq : pr₁  (λ* realizer  r)  a  pr₂  r  a
             eq =
-              pr₁  (λ* realizer  r)  a
-                ≡⟨ cong  x  pr₁  x  a) (λ*ComputationRule realizer r) 
-              pr₁  (pair  _  _)  a
-                ≡⟨ cong  x  x  a) (pr₁pxy≡x _ _) 
-               (λ*abst ent₁)  (r  [])  a
-                ≡⟨ βreduction ent₁ a (r  []) 
-              pr₂  r  a
+              pr₁  (λ* realizer  r)  a
+                ≡⟨ cong  x  pr₁  x  a) (λ*ComputationRule realizer r) 
+              pr₁  (pair  _  _)  a
+                ≡⟨ cong  x  x  a) (pr₁pxy≡x _ _) 
+               (λ*abst ent₁)  (r  [])  a
+                ≡⟨ βreduction ent₁ a (r  []) 
+              pr₂  r  a
                 
           in
           subst  r'  r'   toPredicate α  tt*) (sym eq) (pr₂r⊩β≤α a a⊩β)) ,
          a a⊩α 
           let
-            eq : pr₂  (λ* realizer  r)  a  pr₁  r  a
+            eq : pr₂  (λ* realizer  r)  a  pr₁  r  a
             eq =
-              pr₂  (λ* realizer  r)  a
-                ≡⟨ cong  x  pr₂  x  a) (λ*ComputationRule realizer r) 
-              pr₂  (pair  _  _)  a
-                ≡⟨ cong  x  x  a) (pr₂pxy≡y _ _) 
-               λ*abst ent₂  (r  [])  a
-                ≡⟨ βreduction ent₂ a (r  []) 
-              pr₁  r  a
+              pr₂  (λ* realizer  r)  a
+                ≡⟨ cong  x  pr₂  x  a) (λ*ComputationRule realizer r) 
+              pr₂  (pair  _  _)  a
+                ≡⟨ cong  x  x  a) (pr₂pxy≡y _ _) 
+               λ*abst ent₂  (r  [])  a
+                ≡⟨ βreduction ent₂ a (r  []) 
+              pr₁  r  a
                 
           in
           subst  r'  r'   toPredicate β  tt*) (sym eq) (pr₁r⊩α≤β a a⊩α)) })
@@ -102,115 +102,115 @@
   do
     let
       closure1 : ApplStrTerm as 3
-      closure1 = ` pr₁ ̇ # one ̇ (` pr₁ ̇ # two ̇ # zero)
+      closure1 = ` pr₁ ̇ # one ̇ (` pr₁ ̇ # two ̇ # zero)
 
       closure2 : ApplStrTerm as 3
-      closure2 = ` pr₂ ̇ # two ̇ (` pr₂ ̇ # one ̇ # zero)
+      closure2 = ` pr₂ ̇ # two ̇ (` pr₂ ̇ # one ̇ # zero)
 
-      realizer = ` pair ̇ (λ*abst closure1) ̇ (λ*abst closure2)
+      realizer = ` pair ̇ (λ*abst closure1) ̇ (λ*abst closure2)
     return
-      (λ*2 realizer ,
+      (λ*2 realizer ,
        { x y z a b (⊩x≤y , ⊩y≤x) (⊩y≤z , ⊩z≤y) 
          r r⊩x 
           subst
              r'  r'   toPredicate z  tt*)
             (sym
-              (cong  x  pr₁  x  r) (λ*2ComputationRule realizer a b) 
-               cong  x  x  r) (pr₁pxy≡x _ _) 
-               βreduction closure1 r (b  a  [])))
+              (cong  x  pr₁  x  r) (λ*2ComputationRule realizer a b) 
+               cong  x  x  r) (pr₁pxy≡x _ _) 
+               βreduction closure1 r (b  a  [])))
             (⊩y≤z _ (⊩x≤y r r⊩x))) ,
          r r⊩z 
           subst
              r'  r'   toPredicate x  tt*)
             (sym
-              (cong  x  pr₂  x  r) (λ*2ComputationRule realizer a b) 
-               cong  x  x  r) (pr₂pxy≡y _ _) 
-               βreduction closure2 r (b  a  [])))
+              (cong  x  pr₂  x  r) (λ*2ComputationRule realizer a b) 
+               cong  x  x  r) (pr₂pxy≡y _ _) 
+               βreduction closure2 r (b  a  [])))
             (⊩y≤x _ (⊩z≤y r r⊩z))) }))
 
 opaque
   unfolding terminalPer
   trueFuncRel : FunctionalRelation terminalPer Ωper
   Predicate.isSetX (relation trueFuncRel) = isSet× isSetUnit* isSetResizedPredicate
-  Predicate.∣ relation trueFuncRel  (tt* , p) r =  (a : A)  (r  a)   toPredicate p  tt*
+  Predicate.∣ relation trueFuncRel  (tt* , p) r =  (a : A)  (r  a)   toPredicate p  tt*
   Predicate.isPropValued (relation trueFuncRel) (tt* , p) r = isPropΠ λ a  (toPredicate p) .isPropValued _ _
   isFunctionalRelation.isStrictDomain (isFuncRel trueFuncRel) =
     do
       return
-        (k ,
+        (k ,
          { tt* y r r⊩⊤≤y  tt*}))
   isFunctionalRelation.isStrictCodomain (isFuncRel trueFuncRel) =
     do
       let
         idClosure : ApplStrTerm as 2
-        idClosure = # zero
+        idClosure = # zero
         realizer : ApplStrTerm as 1
-        realizer = ` pair ̇ (λ*abst idClosure) ̇ (λ*abst idClosure)
+        realizer = ` pair ̇ (λ*abst idClosure) ̇ (λ*abst idClosure)
       return
-        (λ* realizer ,
+        (λ* realizer ,
          { tt* y r r⊩⊤≤y 
            a a⊩y 
             subst
                r'  r'   toPredicate y  tt*)
               (sym
-                (cong  x  pr₁  x  a) (λ*ComputationRule realizer r) 
-                 cong  x  x  a) (pr₁pxy≡x _ _) 
-                 βreduction idClosure a (r  [])))
+                (cong  x  pr₁  x  a) (λ*ComputationRule realizer r) 
+                 cong  x  x  a) (pr₁pxy≡x _ _) 
+                 βreduction idClosure a (r  [])))
               a⊩y) ,
            a a⊩y 
             subst
                r'  r'   toPredicate y  tt*)
               (sym
-                (cong  x  pr₂  x  a) (λ*ComputationRule realizer r) 
-                 cong  x  x  a) (pr₂pxy≡y _ _) 
-                 βreduction idClosure a (r  [])))
+                (cong  x  pr₂  x  a) (λ*ComputationRule realizer r) 
+                 cong  x  x  a) (pr₂pxy≡y _ _) 
+                 βreduction idClosure a (r  [])))
               a⊩y)}))
   isFunctionalRelation.isRelational (isFuncRel trueFuncRel) =
     do
       let
         realizer : ApplStrTerm as 4
-        realizer = ` pr₁ ̇ # one ̇ (# two  ̇ ` k)
+        realizer = ` pr₁ ̇ # one ̇ (# two  ̇ ` k)
       return
-        (λ*4 realizer ,
+        (λ*4 realizer ,
          { tt* tt* x y a b c tt* b⊩⊤≤x (pr₁c⊩x≤y , pr₂c⊩y≤x) r 
           subst
              r'  r'   toPredicate y  tt*)
-            (sym (λ*4ComputationRule realizer a b c r))
-            (pr₁c⊩x≤y (b  k) (b⊩⊤≤x k))}))
+            (sym (λ*4ComputationRule realizer a b c r))
+            (pr₁c⊩x≤y (b  k) (b⊩⊤≤x k))}))
   isFunctionalRelation.isSingleValued (isFuncRel trueFuncRel) =
     do
       let
         closure1 : ApplStrTerm as 3
-        closure1 = # one ̇ ` k
+        closure1 = # one ̇ ` k
 
         closure2 : ApplStrTerm as 3
-        closure2 = # two ̇ ` k
+        closure2 = # two ̇ ` k
         
         realizer : ApplStrTerm as 2
-        realizer = ` pair ̇ (λ*abst closure1) ̇ (λ*abst closure2)
+        realizer = ` pair ̇ (λ*abst closure1) ̇ (λ*abst closure2)
       return
-        (λ*2 realizer ,
+        (λ*2 realizer ,
          { tt* x y r₁ r₂ r₁⊩⊤≤x r₂⊩⊤≤y 
            a a⊩x 
             subst
                r'  r'   toPredicate y  tt*)
               (sym
-                (cong  x  pr₁  x  a) (λ*2ComputationRule realizer r₁ r₂) 
-                 cong  x  x  a) (pr₁pxy≡x _ _) 
-                 βreduction closure1 a (r₂  r₁  [])))
-              (r₂⊩⊤≤y k)) ,
+                (cong  x  pr₁  x  a) (λ*2ComputationRule realizer r₁ r₂) 
+                 cong  x  x  a) (pr₁pxy≡x _ _) 
+                 βreduction closure1 a (r₂  r₁  [])))
+              (r₂⊩⊤≤y k)) ,
            a a⊩y 
             subst
                r'  r'   toPredicate x  tt*)
               (sym
-                (cong  x  pr₂  x  a) (λ*2ComputationRule realizer r₁ r₂) 
-                 cong  x  x  a) (pr₂pxy≡y _ _) 
-                 βreduction closure2 a (r₂  r₁  [])))
-              (r₁⊩⊤≤x k))}))
+                (cong  x  pr₂  x  a) (λ*2ComputationRule realizer r₁ r₂) 
+                 cong  x  x  a) (pr₂pxy≡y _ _) 
+                 βreduction closure2 a (r₂  r₁  [])))
+              (r₁⊩⊤≤x k))}))
   isFunctionalRelation.isTotal (isFuncRel trueFuncRel) =
     do
       return
-        (k ,
+        (k ,
          { tt* r tt* 
           let
              = pre1 Unit* isSetUnit* isNonTrivial
@@ -218,7 +218,7 @@
           
             fromPredicate  ,
              a 
-              subst  p  (k  r  a)   p  tt*) (sym (compIsIdFunc )) tt*)
+              subst  p  (k  r  a)   p  tt*) (sym (compIsIdFunc )) tt*)
           ∣₁ }))
 
 opaque
@@ -228,7 +228,7 @@
   isInjectiveTrueFuncRel =
     do
       return
-        (k ,
+        (k ,
          { tt* tt* p r₁ r₂ r₁⊩⊤≤p r₂⊩⊤≤p  tt* }))
 
 truePredicate : Predicate Unit*
@@ -253,15 +253,15 @@
   charFuncRel : FunctionalRelation perX Ωper
   Predicate.isSetX (relation charFuncRel) = isSet× (perX .isSetX) isSetResizedPredicate
   Predicate.∣ relation charFuncRel  (x , p) r =
-    (pr₁  r)   perX .equality  (x , x) ×
-    (∀ (b : A) (b⊩ϕx : b   ϕ .predicate  x)  (pr₁  (pr₂  r)  b)   toPredicate p  tt*) ×
-    (∀ (b : A) (b⊩px : b   toPredicate p  tt*)  (pr₂  (pr₂  r)  b)   ϕ .predicate  x)
+    (pr₁  r)   perX .equality  (x , x) ×
+    (∀ (b : A) (b⊩ϕx : b   ϕ .predicate  x)  (pr₁  (pr₂  r)  b)   toPredicate p  tt*) ×
+    (∀ (b : A) (b⊩px : b   toPredicate p  tt*)  (pr₂  (pr₂  r)  b)   ϕ .predicate  x)
   Predicate.isPropValued (relation charFuncRel) (x , p) r =
     isProp×
       (perX .equality .isPropValued _ _)
       (isProp×
-        (isPropΠ  _  isPropΠ λ _  (toPredicate p) .isPropValued _ _))
-        (isPropΠ λ _  isPropΠ λ _  ϕ .predicate .isPropValued _ _))
+        (isPropΠ  _  isPropΠ λ _  (toPredicate p) .isPropValued _ _))
+        (isPropΠ λ _  isPropΠ λ _  ϕ .predicate .isPropValued _ _))
   isFunctionalRelation.isStrictDomain (isFuncRel charFuncRel) =
     do
       return
@@ -271,27 +271,27 @@
     do
       let
         idClosure : ApplStrTerm as 2
-        idClosure = # zero
+        idClosure = # zero
         realizer : ApplStrTerm as 1
-        realizer = ` pair ̇ (λ*abst idClosure) ̇ (λ*abst idClosure)
+        realizer = ` pair ̇ (λ*abst idClosure) ̇ (λ*abst idClosure)
       return
-        (λ* realizer ,
+        (λ* realizer ,
          x y r x₁ 
            a a⊩y 
             subst
                r'  r'   toPredicate y  tt*)
               (sym
-                (cong  x  pr₁  x  a) (λ*ComputationRule realizer r) 
-                 cong  x  x  a) (pr₁pxy≡x _ _) 
-                 βreduction idClosure a (r  [])))
+                (cong  x  pr₁  x  a) (λ*ComputationRule realizer r) 
+                 cong  x  x  a) (pr₁pxy≡x _ _) 
+                 βreduction idClosure a (r  [])))
               a⊩y) ,
            a a⊩y 
             subst
                r'  r'   toPredicate y  tt*)
               (sym
-                (cong  x  pr₂  x  a) (λ*ComputationRule realizer r) 
-                 cong  x  x  a) (pr₂pxy≡y _ _) 
-                 βreduction idClosure a (r  [])))
+                (cong  x  pr₂  x  a) (λ*ComputationRule realizer r) 
+                 cong  x  x  a) (pr₂pxy≡y _ _) 
+                 βreduction idClosure a (r  [])))
               a⊩y)))
   isFunctionalRelation.isRelational (isFuncRel charFuncRel) =
     do
@@ -300,15 +300,15 @@
       (relϕ , relϕ⊩isRelationalϕ)  isStrictRelation.isRelational (ϕ .isStrictRelationPredicate)
       let
         closure1 : ApplStrTerm as 4
-        closure1 = ` pr₁ ̇ # one ̇ (` pr₁ ̇ (` pr₂ ̇ # two) ̇ (` relϕ ̇ # zero ̇ (` sX ̇ # three)))
+        closure1 = ` pr₁ ̇ # one ̇ (` pr₁ ̇ (` pr₂ ̇ # two) ̇ (` relϕ ̇ # zero ̇ (` sX ̇ # three)))
 
         closure2 : ApplStrTerm as 4
-        closure2 = ` relϕ ̇ (` pr₂ ̇ (` pr₂ ̇ # two) ̇ (` pr₂ ̇ # one ̇ # zero)) ̇ # three
+        closure2 = ` relϕ ̇ (` pr₂ ̇ (` pr₂ ̇ # two) ̇ (` pr₂ ̇ # one ̇ # zero)) ̇ # three
 
         realizer : ApplStrTerm as 3
-        realizer = ` pair ̇ (` tX ̇ (` sX ̇ # two) ̇ # two) ̇ (` pair ̇ (λ*abst closure1) ̇ (λ*abst closure2))
+        realizer = ` pair ̇ (` tX ̇ (` sX ̇ # two) ̇ # two) ̇ (` pair ̇ (λ*abst closure1) ̇ (λ*abst closure2))
       return
-        (λ*3 realizer ,
+        (λ*3 realizer ,
          { x x' p p' a b c a⊩x~x' (⊩x~x , ⊩ϕx≤p , ⊩p≤ϕx) (⊩p≤p' , ⊩p'≤p) 
           let
             ⊩x'~x = sX⊩isSymmetricX x x' a a⊩x~x'
@@ -316,60 +316,60 @@
           in
           subst
              r'  r'   perX .equality  (x' , x'))
-            (sym (cong  x  pr₁  x) (λ*3ComputationRule realizer a b c)  pr₁pxy≡x _ _))
+            (sym (cong  x  pr₁  x) (λ*3ComputationRule realizer a b c)  pr₁pxy≡x _ _))
             ⊩x'~x' ,
            r r⊩ϕx' 
             subst
                r'  r'   toPredicate p'  tt*)
               (sym
-                (cong  x  pr₁  (pr₂  x)  r) (λ*3ComputationRule realizer a b c) 
-                 cong  x  pr₁  x  r) (pr₂pxy≡y _ _) 
-                 cong  x  x  r) (pr₁pxy≡x _ _) 
-                 βreduction closure1 r (c  b  a  [])))
+                (cong  x  pr₁  (pr₂  x)  r) (λ*3ComputationRule realizer a b c) 
+                 cong  x  pr₁  x  r) (pr₂pxy≡y _ _) 
+                 cong  x  x  r) (pr₁pxy≡x _ _) 
+                 βreduction closure1 r (c  b  a  [])))
               (⊩p≤p' _ (⊩ϕx≤p _ (relϕ⊩isRelationalϕ x' x _ _ r⊩ϕx' ⊩x'~x)))) ,
           λ r r⊩p' 
             subst
                r'  r'   ϕ .predicate  x')
               (sym
-                (cong  x  pr₂  (pr₂  x)  r) (λ*3ComputationRule realizer a b c) 
-                 cong  x  pr₂  x  r) (pr₂pxy≡y _ _) 
-                 cong  x  x  r) (pr₂pxy≡y _ _) 
-                 βreduction closure2 r (c  b  a  [])))
+                (cong  x  pr₂  (pr₂  x)  r) (λ*3ComputationRule realizer a b c) 
+                 cong  x  pr₂  x  r) (pr₂pxy≡y _ _) 
+                 cong  x  x  r) (pr₂pxy≡y _ _) 
+                 βreduction closure2 r (c  b  a  [])))
               (relϕ⊩isRelationalϕ x x' _ _ (⊩p≤ϕx _ (⊩p'≤p r r⊩p')) a⊩x~x') }))
   isFunctionalRelation.isSingleValued (isFuncRel charFuncRel) =
     do
       let
         closure1 : ApplStrTerm as 3
-        closure1 = ` pr₁ ̇ (` pr₂ ̇ # one) ̇ (` pr₂ ̇ (` pr₂ ̇ # two) ̇ # zero)
+        closure1 = ` pr₁ ̇ (` pr₂ ̇ # one) ̇ (` pr₂ ̇ (` pr₂ ̇ # two) ̇ # zero)
 
         closure2 : ApplStrTerm as 3
-        closure2 = ` pr₁ ̇ (` pr₂ ̇ # two) ̇ (` pr₂ ̇ (` pr₂ ̇ # one) ̇ # zero)
+        closure2 = ` pr₁ ̇ (` pr₂ ̇ # two) ̇ (` pr₂ ̇ (` pr₂ ̇ # one) ̇ # zero)
 
         realizer : ApplStrTerm as 2
-        realizer = ` pair ̇ λ*abst closure1 ̇ λ*abst closure2
+        realizer = ` pair ̇ λ*abst closure1 ̇ λ*abst closure2
       return
-        (λ*2 realizer ,
+        (λ*2 realizer ,
          { x y y' r₁ r₂ (⊩x~x , ⊩ϕx≤y , ⊩y≤ϕx) (⊩'x~x , ⊩ϕx≤y' , ⊩y'≤ϕx) 
            a a⊩y 
             subst
                r'  r'   toPredicate y'  tt*)
-              (sym (cong  x  pr₁  x  a) (λ*2ComputationRule realizer r₁ r₂)  cong  x  x  a) (pr₁pxy≡x _ _)  βreduction closure1 a (r₂  r₁  [])))
+              (sym (cong  x  pr₁  x  a) (λ*2ComputationRule realizer r₁ r₂)  cong  x  x  a) (pr₁pxy≡x _ _)  βreduction closure1 a (r₂  r₁  [])))
               (⊩ϕx≤y' _ (⊩y≤ϕx a a⊩y))) ,
            a a⊩y' 
             subst
                r'  r'   toPredicate y  tt*)
-              (sym (cong  x  pr₂  x  a) (λ*2ComputationRule realizer r₁ r₂)  cong  x  x  a) (pr₂pxy≡y _ _)  βreduction closure2 a (r₂  r₁  [])))
+              (sym (cong  x  pr₂  x  a) (λ*2ComputationRule realizer r₁ r₂)  cong  x  x  a) (pr₂pxy≡y _ _)  βreduction closure2 a (r₂  r₁  [])))
               (⊩ϕx≤y _ (⊩y'≤ϕx a a⊩y'))) }))
   isFunctionalRelation.isTotal (isFuncRel charFuncRel) =
     do
       let
         idClosure : ApplStrTerm as 2
-        idClosure = # zero
+        idClosure = # zero
 
         realizer : ApplStrTerm as 1
-        realizer = ` pair ̇ # zero ̇ (` pair ̇ λ*abst idClosure ̇ λ*abst idClosure)
+        realizer = ` pair ̇ # zero ̇ (` pair ̇ λ*abst idClosure ̇ λ*abst idClosure)
       return
-        (λ* realizer ,
+        (λ* realizer ,
          x r r⊩x~x 
           let
             resultPredicate : Predicate Unit*
@@ -383,25 +383,25 @@
             (fromPredicate resultPredicate ,
             subst
                r'  r'   perX .equality  (x , x))
-              (sym (cong  x  pr₁  x) (λ*ComputationRule realizer r)  pr₁pxy≡x _ _))
+              (sym (cong  x  pr₁  x) (λ*ComputationRule realizer r)  pr₁pxy≡x _ _))
               r⊩x~x ,
              b b⊩ϕx 
               subst
                  r  r   toPredicate (fromPredicate resultPredicate)  tt*)
                 (sym
-                  (cong  x  pr₁  (pr₂  x)  b) (λ*ComputationRule realizer r) 
-                   cong  x  pr₁  x  b) (pr₂pxy≡y _ _) 
-                   cong  x  x  b) (pr₁pxy≡x _ _) 
-                   βreduction idClosure b (r  [])))
+                  (cong  x  pr₁  (pr₂  x)  b) (λ*ComputationRule realizer r) 
+                   cong  x  pr₁  x  b) (pr₂pxy≡y _ _) 
+                   cong  x  x  b) (pr₁pxy≡x _ _) 
+                   βreduction idClosure b (r  [])))
                 (subst  p  b   p  tt*) (sym (compIsIdFunc resultPredicate)) b⊩ϕx)) ,
              b b⊩'ϕx 
               subst
                  r  r   ϕ .predicate  x)
                 (sym
-                  (cong  x  pr₂  (pr₂  x)  b) (λ*ComputationRule realizer r) 
-                   cong  x  pr₂  x  b) (pr₂pxy≡y _ _) 
-                   cong  x  x  b) (pr₂pxy≡y _ _) 
-                   βreduction idClosure b (r  [])))
+                  (cong  x  pr₂  (pr₂  x)  b) (λ*ComputationRule realizer r) 
+                   cong  x  pr₂  x  b) (pr₂pxy≡y _ _) 
+                   cong  x  x  b) (pr₂pxy≡y _ _) 
+                   βreduction idClosure b (r  [])))
                 let foo = subst  p  b   p  tt*) (compIsIdFunc resultPredicate) b⊩'ϕx in foo))))
 
   subobjectCospan :  char  Cospan RT
@@ -426,14 +426,14 @@
             (relϕ , relϕ⊩isRelationalϕ)  StrictRelation.isRelational ϕ
             let
               closure : ApplStrTerm as 2
-              closure = (` pr₁ ̇ (` pr₂ ̇ (` pr₂ ̇ # one)) ̇ (` relϕ ̇ (` pr₂ ̇ (` pr₁ ̇ # one)) ̇ (` pr₁ ̇ (` pr₁ ̇ # one))))
+              closure = (` pr₁ ̇ (` pr₂ ̇ (` pr₂ ̇ # one)) ̇ (` relϕ ̇ (` pr₂ ̇ (` pr₁ ̇ # one)) ̇ (` pr₁ ̇ (` pr₁ ̇ # one))))
               realizer : ApplStrTerm as 1
               realizer =
-                ` pair ̇
-                  (` pair ̇ (` stX ̇ (` pr₁ ̇ (` pr₁ ̇ # zero))) ̇ (` pr₂ ̇ (` pr₁ ̇ # zero))) ̇
-                  λ*abst closure
+                ` pair ̇
+                  (` pair ̇ (` stX ̇ (` pr₁ ̇ (` pr₁ ̇ # zero))) ̇ (` pr₂ ̇ (` pr₁ ̇ # zero))) ̇
+                  λ*abst closure
             return
-              (λ* realizer ,
+              (λ* realizer ,
                { x p r r⊩∃x' 
                 do
                   (x' , (⊩x~x' , ⊩ϕx) , ⊩x'~x' , ⊩ϕx'≤p , ⊩p≤ϕx')  r⊩∃x'
@@ -441,19 +441,19 @@
                     (tt* ,
                     ((subst
                        r'  r'   perX .equality  (x , x))
-                      (sym (cong  x  pr₁  (pr₁  x)) (λ*ComputationRule realizer r)  cong  x  pr₁  x) (pr₁pxy≡x _ _)  pr₁pxy≡x _ _))
+                      (sym (cong  x  pr₁  (pr₁  x)) (λ*ComputationRule realizer r)  cong  x  pr₁  x) (pr₁pxy≡x _ _)  pr₁pxy≡x _ _))
                       (stX⊩isStrictDomainX x x' _ ⊩x~x')) ,
                      (subst
                         r'  r'   ϕ .predicate  x)
-                       (sym (cong  x  pr₂  (pr₁  x)) (λ*ComputationRule realizer r)  cong  x  pr₂  x) (pr₁pxy≡x _ _)  pr₂pxy≡y _ _))
+                       (sym (cong  x  pr₂  (pr₁  x)) (λ*ComputationRule realizer r)  cong  x  pr₂  x) (pr₁pxy≡x _ _)  pr₂pxy≡y _ _))
                        ⊩ϕx)) ,
                     λ r' 
                       let
-                        eq : pr₂  (λ* realizer  r)  r'  pr₁  (pr₂  (pr₂  r))  (relϕ  (pr₂  (pr₁  r))  (pr₁  (pr₁  r)))
+                        eq : pr₂  (λ* realizer  r)  r'  pr₁  (pr₂  (pr₂  r))  (relϕ  (pr₂  (pr₁  r))  (pr₁  (pr₁  r)))
                         eq =
-                          cong  x  pr₂  x  r') (λ*ComputationRule realizer r) 
-                          cong  x  x  r') (pr₂pxy≡y _ _) 
-                          βreduction closure r' (r  [])
+                          cong  x  pr₂  x  r') (λ*ComputationRule realizer r) 
+                          cong  x  x  r') (pr₂pxy≡y _ _) 
+                          βreduction closure r' (r  [])
                       in
                       subst
                          r'  r'   toPredicate p  tt*)
@@ -487,7 +487,7 @@
     opaque
       unfolding trueFuncRel
       trueFuncRelTruePredicate :  a  (a   trueFuncRel .relation  (tt* , fromPredicate truePredicate))
-      trueFuncRelTruePredicate a = λ b  subst  p  (a  b)   p  tt*) (sym (compIsIdFunc truePredicate)) tt*
+      trueFuncRelTruePredicate a = λ b  subst  p  (a  b)   p  tt*) (sym (compIsIdFunc truePredicate)) tt*
 
     opaque
       unfolding composeFuncRel
@@ -514,17 +514,17 @@
           let
             realizer : ApplStrTerm as 1
             realizer =
-              ` pair ̇
-                (` stFC ̇ # zero) ̇
-                (` relϕ ̇
-                  (` pr₂ ̇ (` pr₂ ̇ (` pr₂ ̇ (` ent ̇ (` pair ̇ (` a ̇ (` stFD ̇ # zero)) ̇ ` k)))) ̇ ` k) ̇
-                  (` svF ̇ (` pr₁ ̇ (` ent ̇ (` pair ̇ (` a ̇ (` stFD ̇ # zero)) ̇ ` k))) ̇ # zero))
+              ` pair ̇
+                (` stFC ̇ # zero) ̇
+                (` relϕ ̇
+                  (` pr₂ ̇ (` pr₂ ̇ (` pr₂ ̇ (` ent ̇ (` pair ̇ (` a ̇ (` stFD ̇ # zero)) ̇ ` k)))) ̇ ` k) ̇
+                  (` svF ̇ (` pr₁ ̇ (` ent ̇ (` pair ̇ (` a ̇ (` stFD ̇ # zero)) ̇ ` k))) ̇ # zero))
           return
-            (λ* realizer ,
+            (λ* realizer ,
               y x r r⊩Hyx 
                subst
                   r'  r'   perX .equality  (x , x))
-                 (sym (cong  x  pr₁  x) (λ*ComputationRule realizer r)  pr₁pxy≡x _ _))
+                 (sym (cong  x  pr₁  x) (λ*ComputationRule realizer r)  pr₁pxy≡x _ _))
                  (stFC⊩isStrictCodomainF y x _ r⊩Hyx) ,
                (equivFun
                  (propTruncIdempotent≃ (ϕ .predicate .isPropValued _ _))
@@ -533,30 +533,30 @@
                      ent⊩entailment
                      y
                      (fromPredicate truePredicate)
-                     (pair  (a  (stFD  r))  k)
+                     (pair  (a  (stFD  r))  k)
                      (return
                        (tt* ,
                         subst
                            r  r   G .relation  (y , tt*))
                           (sym (pr₁pxy≡x _ _))
-                          (a⊩idY≤G y tt* (stFD  r) (stFD⊩isStrictDomainF y x _ r⊩Hyx))  ,
+                          (a⊩idY≤G y tt* (stFD  r) (stFD⊩isStrictDomainF y x _ r⊩Hyx))  ,
                         trueFuncRelTruePredicate _))
                    let
                      ⊩x'~x = svF⊩isSingleValuedF y x' x _ _ ⊩Fyx' r⊩Hyx
-                     ⊩ϕx = relϕ⊩isRelationalϕ x' x _ _ (⊩⊤≤ϕx' k (subst  p  k   p  tt*) (sym (compIsIdFunc truePredicate)) tt*)) ⊩x'~x
-                   return (subst  r'  r'   ϕ .predicate  x) (sym (cong  x  pr₂  x) (λ*ComputationRule realizer r)  pr₂pxy≡y _ _)) ⊩ϕx)))))
+                     ⊩ϕx = relϕ⊩isRelationalϕ x' x _ _ (⊩⊤≤ϕx' k (subst  p  k   p  tt*) (sym (compIsIdFunc truePredicate)) tt*)) ⊩x'~x
+                   return (subst  r'  r'   ϕ .predicate  x) (sym (cong  x  pr₂  x) (λ*ComputationRule realizer r)  pr₂pxy≡y _ _)) ⊩ϕx)))))
       isFunctionalRelation.isRelational (isFuncRel H) =
         do
           (relF , relF⊩isRelationalF)  isFunctionalRelation.isRelational (F .isFuncRel)
           let
             realizer : ApplStrTerm as 3
-            realizer = ` relF ̇ # two ̇ # one ̇ (` pr₁ ̇ # zero)
+            realizer = ` relF ̇ # two ̇ # one ̇ (` pr₁ ̇ # zero)
           return
-            (λ*3 realizer ,
+            (λ*3 realizer ,
               y y' x x' a b c ⊩y~y' ⊩Fyx (⊩x~x' , ⊩ϕx) 
                subst
                   r'  r'   F .relation  (y' , x'))
-                 (sym (λ*3ComputationRule realizer a b c))
+                 (sym (λ*3ComputationRule realizer a b c))
                  (relF⊩isRelationalF y y' x x' _ _ _ ⊩y~y' ⊩Fyx ⊩x~x')))
       isFunctionalRelation.isSingleValued (isFuncRel H) =
         do
@@ -568,15 +568,15 @@
           let
             realizer : ApplStrTerm as 2
             realizer =
-              ` pair ̇
-                (` svF ̇ # one ̇ # zero) ̇
-                (` relϕ ̇ (` pr₂ ̇ (` pr₂ ̇ (` pr₂ ̇ (` ent ̇ (` pair ̇ (` a ̇ (` stFD  ̇ # one)) ̇ ` k)))) ̇ ` k) ̇ (` svF ̇ (` pr₁ ̇ (` ent ̇ (` pair ̇ (` a ̇ (` stFD ̇ # one)) ̇ ` k))) ̇ # one))
+              ` pair ̇
+                (` svF ̇ # one ̇ # zero) ̇
+                (` relϕ ̇ (` pr₂ ̇ (` pr₂ ̇ (` pr₂ ̇ (` ent ̇ (` pair ̇ (` a ̇ (` stFD  ̇ # one)) ̇ ` k)))) ̇ ` k) ̇ (` svF ̇ (` pr₁ ̇ (` ent ̇ (` pair ̇ (` a ̇ (` stFD ̇ # one)) ̇ ` k))) ̇ # one))
           return
-            (λ*2 realizer ,
+            (λ*2 realizer ,
               y x x' r₁ r₂ ⊩Fyx ⊩Fyx' 
                subst
                   r'  r'   perX .equality  (x , x'))
-                 (sym (cong  x  pr₁  x) (λ*2ComputationRule realizer r₁ r₂)  pr₁pxy≡x _ _))
+                 (sym (cong  x  pr₁  x) (λ*2ComputationRule realizer r₁ r₂)  pr₁pxy≡x _ _))
                  (svF⊩isSingleValuedF y x x' _ _ ⊩Fyx ⊩Fyx') ,
                (equivFun
                  (propTruncIdempotent≃ (ϕ .predicate .isPropValued _ _))
@@ -585,18 +585,18 @@
                      ent⊩entailment
                      y
                      (fromPredicate truePredicate)
-                     (pair  (a  (stFD  r₁))  k)
+                     (pair  (a  (stFD  r₁))  k)
                      (return
                        (tt* ,
                         subst  r  r   G .relation  (y , tt*)) (sym (pr₁pxy≡x _ _)) (a⊩idY≤G y tt* _ (stFD⊩isStrictDomainF y x _ ⊩Fyx))  ,
                         trueFuncRelTruePredicate _))
                    let
                      ⊩x''~x = svF⊩isSingleValuedF y x'' x _ _ ⊩Fyx'' ⊩Fyx
-                     ⊩ϕx = relϕ⊩isRelationalϕ x'' x _ _ (⊩⊤≤ϕx'' k (subst  p  k   p  tt*) (sym (compIsIdFunc truePredicate)) tt*)) ⊩x''~x
+                     ⊩ϕx = relϕ⊩isRelationalϕ x'' x _ _ (⊩⊤≤ϕx'' k (subst  p  k   p  tt*) (sym (compIsIdFunc truePredicate)) tt*)) ⊩x''~x
                    return
                      (subst
                         r'  r'   ϕ .predicate  x)
-                       (sym (cong  x  pr₂  x) (λ*2ComputationRule realizer r₁ r₂)  pr₂pxy≡y _ _))
+                       (sym (cong  x  pr₂  x) (λ*2ComputationRule realizer r₁ r₂)  pr₂pxy≡y _ _))
                        ⊩ϕx)))))
       isFunctionalRelation.isTotal (isFuncRel H) =
         do
@@ -604,21 +604,21 @@
           (a , a⊩idY≤G)  idY≤G
           let
             realizer : ApplStrTerm as 1
-            realizer = ` pr₁ ̇ (` ent ̇ (` pair ̇ (` a ̇ # zero) ̇ ` k))
+            realizer = ` pr₁ ̇ (` ent ̇ (` pair ̇ (` a ̇ # zero) ̇ ` k))
           return
-            (λ* realizer ,
+            (λ* realizer ,
              { y r r⊩y~y 
               do
                 (x , ⊩Fyx , ⊩x~x , ⊩ϕx≤⊤ , ⊩⊤≤ϕx) 
                   ent⊩entailment
                     y
                     (fromPredicate truePredicate)
-                    (pair  (a  r)  k)
+                    (pair  (a  r)  k)
                     (return
                       (tt* ,
                        subst  r  r   G .relation  (y , tt*)) (sym (pr₁pxy≡x _ _)) (a⊩idY≤G y tt* r r⊩y~y)  ,
                        trueFuncRelTruePredicate _))
-                return (x , subst  r'  r'   F .relation  (y , x)) (sym (λ*ComputationRule realizer r)) ⊩Fyx) }))
+                return (x , subst  r'  r'   F .relation  (y , x)) (sym (λ*ComputationRule realizer r)) ⊩Fyx) }))
 
     opaque
       unfolding composeRTMorphism
@@ -633,9 +633,9 @@
               (stFD , stFD⊩isStrictDomainF)  F .isStrictDomain
               let
                 realizer : ApplStrTerm as 1
-                realizer = ` relF ̇ (` stFD ̇ (` pr₁ ̇ # zero)) ̇ (` pr₁ ̇ # zero) ̇ (` pr₁ ̇ (` pr₂ ̇ # zero))
+                realizer = ` relF ̇ (` stFD ̇ (` pr₁ ̇ # zero)) ̇ (` pr₁ ̇ # zero) ̇ (` pr₁ ̇ (` pr₂ ̇ # zero))
               return
-                 (λ* realizer ,
+                 (λ* realizer ,
                   y x r ⊩∃x' 
                    equivFun
                      (propTruncIdempotent≃ (F .relation .isPropValued _ _))
@@ -644,7 +644,7 @@
                        return
                          (subst
                             r'  r'   F .relation  (y , x))
-                           (sym (λ*ComputationRule realizer r))
+                           (sym (λ*ComputationRule realizer r))
                            (relF⊩isRelationalF y y x' x _ _ _ (stFD⊩isStrictDomainF y x' _ ⊩Hyx') ⊩Hyx' ⊩x'~x)))))
         in eq/ _ _ (F≤G→G≤F perY perX (composeFuncRel _ _ _ H incFuncRel) F answer , answer)
 
@@ -660,15 +660,15 @@
               (a , a⊩idY≤G)  idY≤G
               let
                 realizer : ApplStrTerm as 1
-                realizer = ` a ̇ (` stHD ̇ (` pr₁ ̇ # zero))
+                realizer = ` a ̇ (` stHD ̇ (` pr₁ ̇ # zero))
               return
-                (λ* realizer ,
+                (λ* realizer ,
                   { y tt* r r⊩∃x 
                    equivFun
                      (propTruncIdempotent≃ (G .relation .isPropValued _ _))
                      (do
                        (x , ⊩Hyx , ⊩x~x , ⊩ϕx)  r⊩∃x
-                       return (subst  r'  r'   G .relation  (y , tt*)) (sym (λ*ComputationRule realizer r)) (a⊩idY≤G y tt* _ (stHD⊩isStrictDomainH y x _ ⊩Hyx)))) }))
+                       return (subst  r'  r'   G .relation  (y , tt*)) (sym (λ*ComputationRule realizer r)) (a⊩idY≤G y tt* _ (stHD⊩isStrictDomainH y x _ ⊩Hyx)))) }))
         in eq/ _ _ (F≤G→G≤F perY terminalPer (composeFuncRel _ _ _ H (terminalFuncRel subPer)) G answer , answer)
 
     opaque
@@ -687,9 +687,9 @@
               (stDH , stDH⊩isStrictDomainH)  H .isStrictDomain
               let
                 realizer : ApplStrTerm as 1
-                realizer = ` relH' ̇ (` stDH ̇ # zero) ̇ (` pr₁ ̇ (` a ̇ # zero)) ̇ (` pr₂ ̇ (` a ̇ # zero))
+                realizer = ` relH' ̇ (` stDH ̇ # zero) ̇ (` pr₁ ̇ (` a ̇ # zero)) ̇ (` pr₂ ̇ (` a ̇ # zero))
               return
-                (λ* realizer ,
+                (λ* realizer ,
                   y x r r⊩Hyx 
                    equivFun
                      (propTruncIdempotent≃ (H' .relation .isPropValued _ _))
@@ -698,7 +698,7 @@
                        return
                          (subst
                             r'  r'   H' .relation  (y , x))
-                           (sym (λ*ComputationRule realizer r))
+                           (sym (λ*ComputationRule realizer r))
                            (relH'⊩isRelationalH y y x' x _ _ _ (stDH⊩isStrictDomainH y x r r⊩Hyx) ⊩H'yx' (⊩x'~x , ⊩ϕx'))))))
         in
         eq/ _ _ (answer , (F≤G→G≤F _ _ H H' answer))
@@ -708,7 +708,7 @@
     classifies {Y , perY} f g f⋆char≡g⋆true =
       SQ.elimProp2
         {P = λ f g   (commutes : f  [ charFuncRel ]  g  [ trueFuncRel ])  ∃![ hk  RTMorphism perY subPer ] (f  hk  [ incFuncRel ]) × (g  hk  [ terminalFuncRel subPer ])}
-         f g  isPropΠ λ _  isPropIsContr)
+         f g  isPropΠ λ _  isPropIsContr)
          F G F⋆char≡G⋆true 
            let
              entailment = [F]⋆[G]≡[H]⋆[I]→H⋆I≤F⋆G F charFuncRel G trueFuncRel F⋆char≡G⋆true
@@ -722,7 +722,7 @@
              λ { h' (f≡h'⋆inc , g≡h'⋆term) 
                SQ.elimProp
                  {P = λ h'   (comm1 : [ F ]  h'  [ incFuncRel ]) (comm2 : [ G ]  h'  [ terminalFuncRel subPer ])  [ UnivPropWithRepr.H perY F G entailment ]  h'}
-                  h'  isPropΠ λ _  isPropΠ λ _  squash/ _ _)
+                  h'  isPropΠ λ _  isPropΠ λ _  squash/ _ _)
                   H' F≡H'⋆inc G≡H'⋆term 
                    UnivPropWithRepr.isUniqueH perY F G entailment H' F≡H'⋆inc G≡H'⋆term)
                  h'
@@ -753,11 +753,11 @@
         (stCC , stCC⊩isStrictCodomainC)  C .isStrictCodomain
         let
           realizer : ApplStrTerm as 2
-          realizer = ` relC ̇ # zero ̇ # one ̇ (` stCC ̇ # one)
+          realizer = ` relC ̇ # zero ̇ # one ̇ (` stCC ̇ # one)
         return
-          (λ*2 realizer ,
+          (λ*2 realizer ,
            λ x x' a b a⊩Cx⊤ b⊩x~x' 
-             subst  r'  r'   C .relation  (x' , )) (sym (λ*2ComputationRule realizer a b)) (relC⊩isRelationalC x x'   _ _ _ b⊩x~x' a⊩Cx⊤ (stCC⊩isStrictCodomainC x  a a⊩Cx⊤)))
+             subst  r'  r'   C .relation  (x' , )) (sym (λ*2ComputationRule realizer a b)) (relC⊩isRelationalC x x'   _ _ _ b⊩x~x' a⊩Cx⊤ (stCC⊩isStrictCodomainC x  a a⊩Cx⊤)))
 
     perψ = InducedSubobject.subPer perX ψ
     incFuncRelψ = InducedSubobject.incFuncRel perX ψ
@@ -779,12 +779,12 @@
               (sX , sX⊩isSymmetricX)  perX .isSymmetric
               let
                 closure : ApplStrTerm as 2
-                closure = ` pr₁ ̇ (` svC ̇ (` pr₂ ̇ (` pr₁ ̇ # one)) ̇ (` relC ̇ (` sX ̇ (` pr₁ ̇ (` pr₁ ̇ # one))) ̇ (` pr₂ ̇ # one) ̇ (` stCC ̇ (` pr₂ ̇ # one)))) ̇ ` k
+                closure = ` pr₁ ̇ (` svC ̇ (` pr₂ ̇ (` pr₁ ̇ # one)) ̇ (` relC ̇ (` sX ̇ (` pr₁ ̇ (` pr₁ ̇ # one))) ̇ (` pr₂ ̇ # one) ̇ (` stCC ̇ (` pr₂ ̇ # one)))) ̇ ` k
 
                 realizer : ApplStrTerm as 1
-                realizer = ` pair ̇ (` pair ̇ (` stDC ̇ (` pr₂ ̇ (` pr₁ ̇ # zero))) ̇ (` pr₂ ̇ (` pr₁ ̇ # zero))) ̇ (λ*abst closure)
+                realizer = ` pair ̇ (` pair ̇ (` stDC ̇ (` pr₂ ̇ (` pr₁ ̇ # zero))) ̇ (` pr₂ ̇ (` pr₁ ̇ # zero))) ̇ (λ*abst closure)
               return
-                (λ* realizer ,
+                (λ* realizer ,
                  λ { x p r r⊩∃x' 
                    do
                      (x' , (⊩x~x' , ⊩Cx⊤) , ⊩Cx'p)  r⊩∃x'
@@ -796,37 +796,37 @@
                        (subst
                           r'  r'   perX .equality  (x , x))
                          (sym
-                           (cong  x  pr₁  (pr₁  x)) (λ*ComputationRule realizer r) 
-                            cong  x  pr₁  x) (pr₁pxy≡x _ _) 
+                           (cong  x  pr₁  (pr₁  x)) (λ*ComputationRule realizer r) 
+                            cong  x  pr₁  x) (pr₁pxy≡x _ _) 
                             pr₁pxy≡x _ _ ))
                          (stDC⊩isStrictDomainC x  _ ⊩Cx⊤) ,
                         subst
                            r'  r'   C .relation  (x , ))
                           (sym
-                            (cong  x  pr₂  (pr₁  x)) (λ*ComputationRule realizer r) 
-                             cong  x  pr₂  x) (pr₁pxy≡x _ _) 
+                            (cong  x  pr₂  (pr₁  x)) (λ*ComputationRule realizer r) 
+                             cong  x  pr₂  x) (pr₁pxy≡x _ _) 
                              pr₂pxy≡y _ _))
                           ⊩Cx⊤) ,
                         λ a 
                           subst
                              r'  r'   toPredicate p  tt*)
                             (sym
-                              (cong  x  pr₂  x  a) (λ*ComputationRule realizer r) 
-                               cong  x  x  a) (pr₂pxy≡y _ _) 
-                               βreduction closure a (r  [])))
-                            (⊩⊤≤p k (subst  q  k   q  tt*) (sym (compIsIdFunc truePredicate)) tt*))) })
+                              (cong  x  pr₂  x  a) (λ*ComputationRule realizer r) 
+                               cong  x  x  a) (pr₂pxy≡y _ _) 
+                               βreduction closure a (r  [])))
+                            (⊩⊤≤p k (subst  q  k   q  tt*) (sym (compIsIdFunc truePredicate)) tt*))) })
         in eq/ _ _ (answer , F≤G→G≤F _ _ (composeFuncRel _ _ _ incFuncRelψ C) (composeFuncRel _ _ _ (terminalFuncRel perψ) trueFuncRel) answer)
 
     opaque
       unfolding InducedSubobject.incFuncRel
       unfolding composeFuncRel
-      ⊩Cx⊤≤ϕx : ∃[ ent  A ] (∀ (x : X) (r : A)  r   C .relation  (x , )  (ent  r)   ϕ .predicate  x)
+      ⊩Cx⊤≤ϕx : ∃[ ent  A ] (∀ (x : X) (r : A)  r   C .relation  (x , )  (ent  r)   ϕ .predicate  x)
       ⊩Cx⊤≤ϕx =
         let
           ((h , incψ≡h⋆incϕ , termψ≡h⋆termϕ) , isUniqueH) = classifies [ incFuncRelψ ] [ terminalFuncRel perψ ] pbSqCommutes
         in
         SQ.elimProp
-          {P = λ h   (incψ≡h⋆incϕ : [ incFuncRelψ ]  h  [ incFuncRel ])  ∃[ ent  A ] (∀ (x : X) (r : A)  r   C .relation  (x , )  (ent  r)   ϕ .predicate  x)}
+          {P = λ h   (incψ≡h⋆incϕ : [ incFuncRelψ ]  h  [ incFuncRel ])  ∃[ ent  A ] (∀ (x : X) (r : A)  r   C .relation  (x , )  (ent  r)   ϕ .predicate  x)}
            h  isPropΠ λ _  isPropPropTrunc)
            H incψ≡H⋆incϕ 
             do
@@ -834,9 +834,9 @@
               (stDC , stDC⊩isStrictDomainC)  C .isStrictDomain
               (relϕ , relϕ⊩isRelationalϕ)  isStrictRelation.isRelational (ϕ .isStrictRelationPredicate)
               let
-                realizer = ` relϕ ̇ (` pr₂ ̇ (` pr₂ ̇ (` a ̇ (` pair ̇ (` stDC ̇ # zero) ̇ # zero)))) ̇ (` pr₁ ̇ (` pr₂ ̇ (` a ̇ (` pair ̇ (` stDC ̇ # zero) ̇ # zero)))) 
+                realizer = ` relϕ ̇ (` pr₂ ̇ (` pr₂ ̇ (` a ̇ (` pair ̇ (` stDC ̇ # zero) ̇ # zero)))) ̇ (` pr₁ ̇ (` pr₂ ̇ (` a ̇ (` pair ̇ (` stDC ̇ # zero) ̇ # zero)))) 
               return
-                (λ* realizer ,
+                (λ* realizer ,
                   x r r⊩Cx⊤ 
                    equivFun
                      (propTruncIdempotent≃ (ϕ .predicate .isPropValued _ _))
@@ -844,11 +844,11 @@
                        (x' , ⊩Hxx' , ⊩x'~x , ⊩ϕx') 
                            a⊩incψ≤H⋆incϕ
                            x x
-                           (pair  (stDC  r)  r)
+                           (pair  (stDC  r)  r)
                            (subst  r'  r'   perX .equality  (x , x)) (sym (pr₁pxy≡x _ _)) (stDC⊩isStrictDomainC x  r r⊩Cx⊤) ,
                             subst  r'  r'   C .relation  (x , )) (sym (pr₂pxy≡y _ _)) r⊩Cx⊤)
                        return
-                         (subst  r'  r'   ϕ .predicate  x) (sym (λ*ComputationRule realizer r)) (relϕ⊩isRelationalϕ x' x _ _ ⊩ϕx' ⊩x'~x))))))
+                         (subst  r'  r'   ϕ .predicate  x) (sym (λ*ComputationRule realizer r)) (relϕ⊩isRelationalϕ x' x _ _ ⊩ϕx' ⊩x'~x))))))
           h
           incψ≡h⋆incϕ
 
@@ -881,53 +881,53 @@
                 (d , d⊩X'x⊤≤ϕx)  PullbackHelper.⊩Cx⊤≤ϕx charFuncRel' commutes classifies
                 let
                   closure1 : ApplStrTerm as 2
-                  closure1 = ` pr₂ ̇ (` a ̇ (` pair ̇ (` pair ̇ (` stDX'  ̇ # one) ̇ # zero) ̇ # one)) ̇ ` k
+                  closure1 = ` pr₂ ̇ (` a ̇ (` pair ̇ (` pair ̇ (` stDX'  ̇ # one) ̇ # zero) ̇ # one)) ̇ ` k
                   closure2 : ApplStrTerm as 2
-                  closure2 = ` d ̇ (` relX' ̇ (` stDX' ̇ # one) ̇ # one ̇ (` pair ̇ ` k ̇ (` k ̇ # zero)))
+                  closure2 = ` d ̇ (` relX' ̇ (` stDX' ̇ # one) ̇ # one ̇ (` pair ̇ ` k ̇ (` k ̇ # zero)))
                   realizer : ApplStrTerm as 1
-                  realizer = ` pair ̇ (` stDX' ̇ # zero) ̇ (` pair ̇ λ*abst closure1 ̇ λ*abst closure2)
+                  realizer = ` pair ̇ (` stDX' ̇ # zero) ̇ (` pair ̇ λ*abst closure1 ̇ λ*abst closure2)
                 return
-                  (λ* realizer ,
+                  (λ* realizer ,
                     { x p r r⊩X'xp 
                      let
                        ⊩x~x = stDX'⊩isStrictDomainX' x p r r⊩X'xp
                      in
-                     subst  r'  r'   perX .equality  (x , x)) (sym (cong  x  pr₁  x) (λ*ComputationRule realizer r)  pr₁pxy≡x  _ _)) ⊩x~x ,
+                     subst  r'  r'   perX .equality  (x , x)) (sym (cong  x  pr₁  x) (λ*ComputationRule realizer r)  pr₁pxy≡x  _ _)) ⊩x~x ,
                       b b⊩ϕx 
                        let
                          goal =
                            a⊩inc⋆X'≤term⋆true
-                             x p (pair  (pair  (stDX'  r)  b)  r)
+                             x p (pair  (pair  (stDX'  r)  b)  r)
                              (return
-                               (x , (subst  r'  r'   perX .equality  (x , x)) (sym (cong  x  pr₁  x) (pr₁pxy≡x _ _)  pr₁pxy≡x _ _)) ⊩x~x ,
-                               subst  r'  r'   ϕ .predicate  x) (sym (cong  x  pr₂  x) (pr₁pxy≡x _ _)  pr₂pxy≡y _ _)) b⊩ϕx) ,
+                               (x , (subst  r'  r'   perX .equality  (x , x)) (sym (cong  x  pr₁  x) (pr₁pxy≡x _ _)  pr₁pxy≡x _ _)) ⊩x~x ,
+                               subst  r'  r'   ϕ .predicate  x) (sym (cong  x  pr₂  x) (pr₁pxy≡x _ _)  pr₂pxy≡y _ _)) b⊩ϕx) ,
                                subst  r'  r'   charFuncRel' .relation  (x , p)) (sym (pr₂pxy≡y _ _)) r⊩X'xp))
 
-                         eq : pr₁  (pr₂  (λ* realizer  r))  b  pr₂  (a  (pair  (pair  (stDX'  r)  b)  r))  k
+                         eq : pr₁  (pr₂  (λ* realizer  r))  b  pr₂  (a  (pair  (pair  (stDX'  r)  b)  r))  k
                          eq =
-                           cong  x  pr₁  (pr₂  x)  b) (λ*ComputationRule realizer r)  cong  x  pr₁  x  b) (pr₂pxy≡y _ _)  cong  x  x  b) (pr₁pxy≡x _ _)  βreduction closure1 b (r  [])
+                           cong  x  pr₁  (pr₂  x)  b) (λ*ComputationRule realizer r)  cong  x  pr₁  x  b) (pr₂pxy≡y _ _)  cong  x  x  b) (pr₁pxy≡x _ _)  βreduction closure1 b (r  [])
                        in
                        equivFun
                          (propTruncIdempotent≃ (toPredicate p .isPropValued _ _))
                          (do
                            (tt* , ⊩'x~x , ⊩⊤≤p)  goal
-                           return (subst  r'  r'   toPredicate p  tt*) (sym eq) (⊩⊤≤p k)))) ,
+                           return (subst  r'  r'   toPredicate p  tt*) (sym eq) (⊩⊤≤p k)))) ,
                       c c⊩p 
                        let
                          ⊩X'x⊤ =
                            relX'⊩isRelationalX'
                              x x p  _ _
-                             (pair  k  (k  c))
+                             (pair  k  (k  c))
                              ⊩x~x r⊩X'xp
-                             ((λ b b⊩p  subst  q  (pr₁  (pair  k  (k  c)))   q  tt*) (sym (compIsIdFunc truePredicate)) tt*) ,
-                               b b⊩⊤  subst  r'  r'   toPredicate p  tt*) (sym (cong  x  x  b) (pr₂pxy≡y _ _)  kab≡a _ _)) c⊩p))
+                             ((λ b b⊩p  subst  q  (pr₁  (pair  k  (k  c)))   q  tt*) (sym (compIsIdFunc truePredicate)) tt*) ,
+                               b b⊩⊤  subst  r'  r'   toPredicate p  tt*) (sym (cong  x  x  b) (pr₂pxy≡y _ _)  kab≡a _ _)) c⊩p))
 
-                         eq : pr₂  (pr₂  (λ* realizer  r))  c  d  (relX'  (stDX'  r)  r  (pair  k  (k  c)))
+                         eq : pr₂  (pr₂  (λ* realizer  r))  c  d  (relX'  (stDX'  r)  r  (pair  k  (k  c)))
                          eq =
-                           cong  x  pr₂  (pr₂  x)  c) (λ*ComputationRule realizer r) 
-                           cong  x  pr₂  x  c) (pr₂pxy≡y _ _) 
-                           cong  x  x  c) (pr₂pxy≡y _ _) 
-                           βreduction closure2 c (r  [])
+                           cong  x  pr₂  (pr₂  x)  c) (λ*ComputationRule realizer r) 
+                           cong  x  pr₂  x  c) (pr₂pxy≡y _ _) 
+                           cong  x  x  c) (pr₂pxy≡y _ _) 
+                           βreduction closure2 c (r  [])
                        in
                        subst
                           r'  r'   ϕ .predicate  x)
diff --git a/docs/Realizability.Topos.TerminalObject.html b/docs/Realizability.Topos.TerminalObject.html
index 0eb2b9f..77abc3d 100644
--- a/docs/Realizability.Topos.TerminalObject.html
+++ b/docs/Realizability.Topos.TerminalObject.html
@@ -1,5 +1,5 @@
 
-Realizability.Topos.TerminalObject
open import Realizability.ApplicativeStructure renaming (Term to ApplStrTerm)
+Realizability.Topos.TerminalObject
open import Realizability.ApplicativeStructure renaming (Term to ApplStrTerm)
 open import Realizability.CombinatoryAlgebra
 open import Cubical.Foundations.Prelude
 open import Cubical.Foundations.HLevels
@@ -17,7 +17,7 @@
   { ℓ' ℓ''}
   {A : Type }
   (ca : CombinatoryAlgebra A)
-  (isNonTrivial : CombinatoryAlgebra.s ca  CombinatoryAlgebra.k ca  ) where
+  (isNonTrivial : CombinatoryAlgebra.s ca  CombinatoryAlgebra.k ca  ) where
 
 open CombinatoryAlgebra ca
 open import Realizability.Tripos.Prealgebra.Predicate {ℓ' = ℓ'} {ℓ'' = ℓ''} ca
@@ -35,9 +35,9 @@
   isPropValued (equality terminalPer) _ _ = isPropUnit*
   isPartialEquivalenceRelation.isSetX (isPerEquality terminalPer) = isSetUnit*
   isPartialEquivalenceRelation.isSymmetric (isPerEquality terminalPer) =
-    return (k ,  { tt* tt* r tt*  tt* }))
+    return (k ,  { tt* tt* r tt*  tt* }))
   isPartialEquivalenceRelation.isTransitive (isPerEquality terminalPer) =
-    return (k ,  { tt* tt* tt* _ _ tt* tt*  tt* }))
+    return (k ,  { tt* tt* tt* _ _ tt* tt*  tt* }))
 
 open FunctionalRelation
 
@@ -54,22 +54,22 @@
       ; isFuncRel =
         record
           { isStrictDomain = return (Id ,  { y tt* r r⊩y~y  subst  r'  r'   perY .equality  (y , y)) (sym (Ida≡a _)) r⊩y~y }))
-          ; isStrictCodomain = return (k ,  { y tt* r r⊩y~y  tt* }))
+          ; isStrictCodomain = return (k ,  { y tt* r r⊩y~y  tt* }))
           ; isRelational =
             (do
             (t , t⊩isTransitive)  perY .isTransitive
             (s , s⊩isSymmetric)  perY .isSymmetric
             let
               prover : ApplStrTerm as 3
-              prover = ` t ̇ (` s ̇ # two) ̇ # two
+              prover = ` t ̇ (` s ̇ # two) ̇ # two
             return
-              (λ*3 prover ,
+              (λ*3 prover ,
                { y y' tt* tt* a b c a⊩y~y' b⊩y~y tt* 
                 subst
                    r'  r'   perY .equality  (y' , y'))
-                  (sym (λ*3ComputationRule prover a b c))
-                  (t⊩isTransitive y' y y' (s  a) a (s⊩isSymmetric y y' a a⊩y~y') a⊩y~y') })))
-          ; isSingleValued = (return (k ,  { y tt* tt* r₁ r₂ r₁⊩y~y r₂⊩y~y  tt* })))
+                  (sym (λ*3ComputationRule prover a b c))
+                  (t⊩isTransitive y' y y' (s  a) a (s⊩isSymmetric y y' a a⊩y~y') a⊩y~y') })))
+          ; isSingleValued = (return (k ,  { y tt* tt* r₁ r₂ r₁⊩y~y r₂⊩y~y  tt* })))
           ; isTotal = return
                       (Id ,
                        y r r⊩y~y 
@@ -93,15 +93,15 @@
                   (stFD , stFD⊩isStrictDomainF)  F .isStrictDomain
                   let
                     prover : ApplStrTerm as 1
-                    prover = ` tlG ̇ (` stFD ̇ # zero)
+                    prover = ` tlG ̇ (` stFD ̇ # zero)
                   return
-                    (λ* prover ,
+                    (λ* prover ,
                      { y tt* r r⊩Fy 
                       transport
                         (propTruncIdempotent (G .relation .isPropValued _ _))
                         (do
-                          (tt* , tlGstFD⊩Gy)  tlG⊩isTotalG y (stFD  r) (stFD⊩isStrictDomainF y tt* r r⊩Fy)
-                          return (subst  r'  r'   G .relation  (y , tt*)) (sym (λ*ComputationRule prover r)) tlGstFD⊩Gy)) }))
+                          (tt* , tlGstFD⊩Gy)  tlG⊩isTotalG y (stFD  r) (stFD⊩isStrictDomainF y tt* r r⊩Fy)
+                          return (subst  r'  r'   G .relation  (y , tt*)) (sym (λ*ComputationRule prover r)) tlGstFD⊩Gy)) }))
             in
             eq/ _ _ (answer , F≤G→G≤F perY terminalPer F G answer))
           f g
diff --git a/docs/Realizability.Tripos.Prealgebra.Meets.Commutativity.html b/docs/Realizability.Tripos.Prealgebra.Meets.Commutativity.html
index f96528d..49a3f10 100644
--- a/docs/Realizability.Tripos.Prealgebra.Meets.Commutativity.html
+++ b/docs/Realizability.Tripos.Prealgebra.Meets.Commutativity.html
@@ -28,14 +28,14 @@
   x⊓y≤y⊓x x y =
     do
       let
-        proof : Term as 1
-        proof = ` pair ̇ (` pr₂ ̇ # zero) ̇ (` pr₁ ̇ # zero)
+        proof : Term as 1
+        proof = ` pair ̇ (` pr₂ ̇ # zero) ̇ (` pr₁ ̇ # zero)
       return
-        (λ* proof ,
+        (λ* proof ,
            x' a a⊩x⊓y 
             subst
                r  r   y  x  x')
-              (sym (λ*ComputationRule proof a))
+              (sym (λ*ComputationRule proof a))
               ((subst  r  r   y  x') (sym (pr₁pxy≡x _ _)) (a⊩x⊓y .snd)) ,
                (subst  r  r   x  x') (sym (pr₂pxy≡y _ _)) (a⊩x⊓y .fst)))))
 
@@ -45,15 +45,15 @@
       (f , f⊩x≤y)  x≤y
       (g , g⊩y≤x)  y≤x
       let
-        proof : Term as 1
-        proof = ` pair ̇ (` f ̇ (` pr₁ ̇ # zero)) ̇ (` pr₂ ̇ # zero)
+        proof : Term as 1
+        proof = ` pair ̇ (` f ̇ (` pr₁ ̇ # zero)) ̇ (` pr₂ ̇ # zero)
       return
-        ((λ* proof) ,
+        ((λ* proof) ,
            x' a a⊩x⊓z 
             subst
                r  r   y  z  x')
-              (sym (λ*ComputationRule proof a))
-              ((subst  r  r   y  x') (sym (pr₁pxy≡x _ _)) (f⊩x≤y x' (pr₁  a) (a⊩x⊓z .fst))) ,
+              (sym (λ*ComputationRule proof a))
+              ((subst  r  r   y  x') (sym (pr₁pxy≡x _ _)) (f⊩x≤y x' (pr₁  a) (a⊩x⊓z .fst))) ,
                (subst  r  r   z  x') (sym (pr₂pxy≡y _ _)) (a⊩x⊓z .snd)))))
 
 
@@ -63,14 +63,14 @@
       (f , f⊩y≤z)  y≤z
       (g , g⊩z≤y)  z≤y
       let
-        proof : Term as 1
-        proof = ` pair ̇ (`  pr₁ ̇ # zero) ̇ (` f ̇ (` pr₂ ̇ # zero))
+        proof : Term as 1
+        proof = ` pair ̇ (`  pr₁ ̇ # zero) ̇ (` f ̇ (` pr₂ ̇ # zero))
       return
-        ((λ* proof) ,
+        ((λ* proof) ,
            { x' a (pr₁a⊩x , pr₂a⊩y) 
             subst
                r  r   x  z  x')
-              (sym (λ*ComputationRule proof a))
+              (sym (λ*ComputationRule proof a))
               ((subst  r  r   x  x') (sym (pr₁pxy≡x _ _)) pr₁a⊩x) ,
-               (subst  r  r   z  x') (sym (pr₂pxy≡y _ _)) (f⊩y≤z x' (pr₂  a) pr₂a⊩y))) }))
+               (subst  r  r   z  x') (sym (pr₂pxy≡y _ _)) (f⊩y≤z x' (pr₂  a) pr₂a⊩y))) }))
 
\ No newline at end of file diff --git a/docs/Realizability.Tripos.Prealgebra.Meets.Identity.html b/docs/Realizability.Tripos.Prealgebra.Meets.Identity.html index 90b9965..08a4f58 100644 --- a/docs/Realizability.Tripos.Prealgebra.Meets.Identity.html +++ b/docs/Realizability.Tripos.Prealgebra.Meets.Identity.html @@ -18,7 +18,7 @@ open CombinatoryAlgebra ca open Realizability.CombinatoryAlgebra.Combinators ca renaming (i to Id; ia≡a to Ida≡a) -module _ (X : Type ℓ') (isSetX' : isSet X) (isNonTrivial : s k ) where +module _ (X : Type ℓ') (isSetX' : isSet X) (isNonTrivial : s k ) where private PredicateX = Predicate X open Predicate open PredicateProperties X @@ -36,14 +36,14 @@ x≤x⊓1 x = do let - proof : Term as 1 - proof = ` pair ̇ # zero ̇ ` true + proof : Term as 1 + proof = ` pair ̇ # zero ̇ ` true return - ((λ* proof) , + ((λ* proof) , x' a a⊩x subst r x pre1 x' r) - (sym (λ*ComputationRule proof a)) + (sym (λ*ComputationRule proof a)) (subst r r x x') (sym (pr₁pxy≡x _ _)) @@ -56,14 +56,14 @@ x≤1⊓x x = do let - proof : Term as 1 - proof = ` pair ̇ ` false ̇ # zero + proof : Term as 1 + proof = ` pair ̇ ` false ̇ # zero return - ((λ* proof) , + ((λ* proof) , x' a a⊩x subst r r pre1 x x') - (sym (λ*ComputationRule proof a)) + (sym (λ*ComputationRule proof a)) (tt* , (subst r r x x') diff --git a/docs/Realizability.Tripos.Prealgebra.Predicate.Properties.html b/docs/Realizability.Tripos.Prealgebra.Predicate.Properties.html index 50a1a61..939904d 100644 --- a/docs/Realizability.Tripos.Prealgebra.Predicate.Properties.html +++ b/docs/Realizability.Tripos.Prealgebra.Predicate.Properties.html @@ -1,6 +1,6 @@ Realizability.Tripos.Prealgebra.Predicate.Properties
open import Realizability.CombinatoryAlgebra
-open import Realizability.ApplicativeStructure renaming (Term to ApplStrTerm)
+open import Realizability.ApplicativeStructure renaming (Term to ApplStrTerm)
 open import Cubical.Foundations.Prelude as P
 open import Cubical.Foundations.HLevels
 open import Cubical.Foundations.Equiv
@@ -31,7 +31,7 @@
   private PredicateX = Predicate X
   open Predicate
   _≤_ : Predicate  X  Predicate  X  Type (ℓ-max (ℓ-max  ℓ') ℓ'')
-  ϕ  ψ = ∃[ b  A ] (∀ (x : X) (a : A)  a  ( ϕ  x)  (b  a)   ψ  x)
+  ϕ  ψ = ∃[ b  A ] (∀ (x : X) (a : A)  a  ( ϕ  x)  (b  a)   ψ  x)
 
   isProp≤ :  ϕ ψ  isProp (ϕ  ψ)
   isProp≤ ϕ ψ = isPropPropTrunc
@@ -49,7 +49,7 @@
                                subst
                                   r  r   ξ  x)
                                  (sym (Ba≡gfa b a a'))
-                                 (ψ≤[b]ξ x (a  a')
+                                 (ψ≤[b]ξ x (a  a')
                                  (ϕ≤[a]ψ x a' a'⊩ϕx))))
     
 
@@ -71,19 +71,19 @@
   infix 25 _⊔_
   _⊔_ : PredicateX  PredicateX  PredicateX
   (ϕ  ψ) .isSetX = ϕ .isSetX
-   ϕ  ψ  x a =  ((pr₁  a  k) × ((pr₂  a)   ϕ  x))  ((pr₁  a  k') × ((pr₂  a)   ψ  x)) ∥₁
+   ϕ  ψ  x a =  ((pr₁  a  k) × ((pr₂  a)   ϕ  x))  ((pr₁  a  k') × ((pr₂  a)   ψ  x)) ∥₁
   (ϕ  ψ) .isPropValued x a = isPropPropTrunc
 
   infix 25 _⊓_
   _⊓_ : PredicateX  PredicateX  PredicateX
   (ϕ  ψ) .isSetX = ϕ .isSetX
-   ϕ  ψ  x a = ((pr₁  a)   ϕ  x) × ((pr₂  a)   ψ  x)
-  (ϕ  ψ) .isPropValued x a = isProp× (ϕ .isPropValued x (pr₁  a)) (ψ .isPropValued x (pr₂  a))
+   ϕ  ψ  x a = ((pr₁  a)   ϕ  x) × ((pr₂  a)   ψ  x)
+  (ϕ  ψ) .isPropValued x a = isProp× (ϕ .isPropValued x (pr₁  a)) (ψ .isPropValued x (pr₂  a))
 
   infix 25 _⇒_
   _⇒_ : PredicateX  PredicateX  PredicateX
   (ϕ  ψ) .isSetX = ϕ .isSetX
-   ϕ  ψ  x a =  b  (b   ϕ  x)  (a  b)   ψ  x
+   ϕ  ψ  x a =  b  (b   ϕ  x)  (a  b)   ψ  x
   (ϕ  ψ) .isPropValued x a = isPropΠ λ a  isPropΠ λ a⊩ϕx  ψ .isPropValued _ _
 
 module _ where
@@ -94,37 +94,37 @@
     Lift' = Lift {i = } {j = (ℓ-max ℓ' ℓ'')}
 
     kRealized : Predicate' Unit*
-    kRealized = record { isSetX = isSetUnit* ; ∣_∣ = λ x a  Lift' (a  k) ; isPropValued = λ x a  isOfHLevelRespectEquiv 1 LiftEquiv (isSetA a k) }
+    kRealized = record { isSetX = isSetUnit* ; ∣_∣ = λ x a  Lift' (a  k) ; isPropValued = λ x a  isOfHLevelRespectEquiv 1 LiftEquiv (isSetA a k) }
 
     k'Realized : Predicate' Unit*
-    k'Realized = record { isSetX = isSetUnit* ; ∣_∣ = λ x a  Lift' (a  k') ; isPropValued = λ x a  isOfHLevelRespectEquiv 1 LiftEquiv (isSetA a k') }
+    k'Realized = record { isSetX = isSetUnit* ; ∣_∣ = λ x a  Lift' (a  k') ; isPropValued = λ x a  isOfHLevelRespectEquiv 1 LiftEquiv (isSetA a k') }
 
     kRealized≤k'Realized : kRealized  k'Realized
     kRealized≤k'Realized =
       do
         let
           prover : ApplStrTerm as 1
-          prover = ` k'
-        return (λ* prover , λ { x a (lift a≡k)  lift (λ*ComputationRule prover a) })
+          prover = ` k'
+        return (λ* prover , λ { x a (lift a≡k)  lift (λ*ComputationRule prover a) })
 
     k'Realized≤kRealized : k'Realized  kRealized
     k'Realized≤kRealized =
       do
         let
           prover : ApplStrTerm as 1
-          prover = ` k
-        return (λ* prover , λ { x a (lift a≡k')  lift (λ*ComputationRule prover a) })
+          prover = ` k
+        return (λ* prover , λ { x a (lift a≡k')  lift (λ*ComputationRule prover a) })
 
     kRealized≡k'Realized : kRealized  k'Realized
     kRealized≡k'Realized = antiSym kRealized k'Realized kRealized≤k'Realized k'Realized≤kRealized
 
-    Lift≡ : Lift' (k  k)  Lift' (k  k')
-    Lift≡ i =  kRealized≡k'Realized i  tt* k
+    Lift≡ : Lift' (k  k)  Lift' (k  k')
+    Lift≡ i =  kRealized≡k'Realized i  tt* k
 
-    Liftk≡k' : Lift' (k  k')
+    Liftk≡k' : Lift' (k  k')
     Liftk≡k' = transport Lift≡ (lift refl)
 
-    k≡k' : k  k'
+    k≡k' : k  k'
     k≡k' = Liftk≡k' .lower
 
 module Morphism {X Y : Type ℓ'} (isSetX : isSet X) (isSetY : isSet Y)  where
@@ -149,8 +149,8 @@
     λ ϕ 
       record
         { isSetX = isSetY
-        ; ∣_∣ = λ y a  (∀ b x  f x  y  (a  b)   ϕ  x)
-        ; isPropValued = λ y a  isPropΠ λ a'  isPropΠ λ x  isPropΠ λ fx≡y  ϕ .isPropValued x (a  a') }
+        ; ∣_∣ = λ y a  (∀ b x  f x  y  (a  b)   ϕ  x)
+        ; isPropValued = λ y a  isPropΠ λ a'  isPropΠ λ x  isPropΠ λ fx≡y  ϕ .isPropValued x (a  a') }
 
   `∃[_] : (X  Y)  (PredicateX  PredicateY)
   `∃[ f ] =
@@ -178,10 +178,10 @@
          y b b⊩∃fϕ 
           equivFun
             (propTruncIdempotent≃
-              (ψ .isPropValued y (a~  b)))
+              (ψ .isPropValued y (a~  b)))
               (do
                 (x , fx≡y , b⊩ϕx)  b⊩∃fϕ
-                return (subst  y'  (a~  b)   ψ  y') fx≡y (a~proves x b b⊩ϕx)))))
+                return (subst  y'  (a~  b)   ψ  y') fx≡y (a~proves x b b⊩ϕx)))))
 
   `∃isLeftAdjoint :  ϕ ψ f  `∃[ f ] ϕ ≤Y ψ  ϕ ≤X ( f) ψ
   `∃isLeftAdjoint ϕ ψ f =
@@ -195,73 +195,73 @@
   `∀isRightAdjoint→ ϕ ψ f p =
     do
       (a~ , a~proves)  p
-      let realizer = (s  (s  (k  a~)  Id)  (k  k))
+      let realizer = (s  (s  (k  a~)  Id)  (k  k))
       return
         (realizer ,
          x a a⊩ψfx 
           equivFun
             (propTruncIdempotent≃
-              (ϕ .isPropValued x (realizer  a) ))
+              (ϕ .isPropValued x (realizer  a) ))
               (do
                 let ∀prover = a~proves (f x) a a⊩ψfx
                 return
                   (subst
                      ϕ~  ϕ~   ϕ  x)
                     (sym
-                      (realizer  a
+                      (realizer  a
                         ≡⟨ refl 
-                       s  (s  (k  a~)  Id)  (k  k)  a
-                        ≡⟨ sabc≡ac_bc _ _ _ 
-                       s  (k  a~)  Id  a  (k  k  a)
-                        ≡⟨ cong  x  x  (k  k  a)) (sabc≡ac_bc _ _ _) 
-                       k  a~  a  (Id  a)  (k  k  a)
-                        ≡⟨ cong  x  k  a~  a  x  (k  k  a)) (Ida≡a a) 
-                       k  a~  a  a  (k  k  a)
-                        ≡⟨ cong  x  k  a~  a  a  x) (kab≡a _ _) 
-                       (k  a~  a)  a  k
-                        ≡⟨ cong  x  x  a  k) (kab≡a _ _) 
-                       a~  a  k
+                       s  (s  (k  a~)  Id)  (k  k)  a
+                        ≡⟨ sabc≡ac_bc _ _ _ 
+                       s  (k  a~)  Id  a  (k  k  a)
+                        ≡⟨ cong  x  x  (k  k  a)) (sabc≡ac_bc _ _ _) 
+                       k  a~  a  (Id  a)  (k  k  a)
+                        ≡⟨ cong  x  k  a~  a  x  (k  k  a)) (Ida≡a a) 
+                       k  a~  a  a  (k  k  a)
+                        ≡⟨ cong  x  k  a~  a  a  x) (kab≡a _ _) 
+                       (k  a~  a)  a  k
+                        ≡⟨ cong  x  x  a  k) (kab≡a _ _) 
+                       a~  a  k
                          ))
-                    (∀prover k x refl)))))
+                    (∀prover k x refl)))))
 
   `∀isRightAdjoint← :  ϕ ψ f  ( f) ψ ≤X ϕ  ψ ≤Y `∀[ f ] ϕ
   `∀isRightAdjoint← ϕ ψ f p =
     do
       (a~ , a~proves)  p
-      let realizer = (s  (s  (k  s)  (s  (k  k)  (k  a~)))  (s  (k  k)  Id))
+      let realizer = (s  (s  (k  s)  (s  (k  k)  (k  a~)))  (s  (k  k)  Id))
       return
         (realizer ,
          y b b⊩ψy a x fx≡y 
           subst
              r  r   ϕ  x)
             (sym
-              (realizer  b  a
+              (realizer  b  a
                  ≡⟨ refl 
-               s  (s  (k  s)  (s  (k  k)  (k  a~)))  (s  (k  k)  Id)  b  a
-                 ≡⟨ cong  x  x  a) (sabc≡ac_bc _ _ _) 
-               s  (k  s)  (s  (k  k)  (k  a~))  b  (s  (k  k)  Id  b)  a
-                 ≡⟨ cong  x  s  (k  s)  (s  (k  k)  (k  a~))  b  x  a) (sabc≡ac_bc (k  k) Id b) 
-               s  (k  s)  (s  (k  k)  (k  a~))  b  ((k  k  b)  (Id  b))  a
-                 ≡⟨ cong  x  s  (k  s)  (s  (k  k)  (k  a~))  b  (x  (Id  b))  a) (kab≡a _ _) 
-               s  (k  s)  (s  (k  k)  (k  a~))  b  (k  (Id  b))  a
-                 ≡⟨ cong  x  s  (k  s)  (s  (k  k)  (k  a~))  b  (k  x)  a) (Ida≡a b) 
-               s  (k  s)  (s  (k  k)  (k  a~))  b  (k  b)  a
-                 ≡⟨ cong  x  x  (k  b)  a) (sabc≡ac_bc _ _ _) 
-               k  s  b  (s  (k  k)  (k  a~)  b)  (k  b)  a
-                 ≡⟨ cong  x  x  (s  (k  k)  (k  a~)  b)  (k  b)  a) (kab≡a _ _) 
-               s  (s  (k  k)  (k  a~)  b)  (k  b)  a
-                 ≡⟨ sabc≡ac_bc _ _ _ 
-               s  (k  k)  (k  a~)  b  a  (k  b  a)
-                 ≡⟨ cong  x  s  (k  k)  (k  a~)  b  a  x) (kab≡a b a) 
-               s  (k  k)  (k  a~)  b  a  b
-                 ≡⟨ cong  x  x  a  b) (sabc≡ac_bc (k  k) (k  a~) b) 
-               k  k  b  (k  a~  b)  a  b
-                 ≡⟨ cong  x  x  (k  a~  b)  a  b) (kab≡a _ _) 
-               k  (k  a~  b)  a  b
-                 ≡⟨ cong  x  k  x  a  b) (kab≡a _ _) 
-               k  a~  a  b
-                 ≡⟨ cong  x  x  b) (kab≡a _ _) 
-               a~  b
+               s  (s  (k  s)  (s  (k  k)  (k  a~)))  (s  (k  k)  Id)  b  a
+                 ≡⟨ cong  x  x  a) (sabc≡ac_bc _ _ _) 
+               s  (k  s)  (s  (k  k)  (k  a~))  b  (s  (k  k)  Id  b)  a
+                 ≡⟨ cong  x  s  (k  s)  (s  (k  k)  (k  a~))  b  x  a) (sabc≡ac_bc (k  k) Id b) 
+               s  (k  s)  (s  (k  k)  (k  a~))  b  ((k  k  b)  (Id  b))  a
+                 ≡⟨ cong  x  s  (k  s)  (s  (k  k)  (k  a~))  b  (x  (Id  b))  a) (kab≡a _ _) 
+               s  (k  s)  (s  (k  k)  (k  a~))  b  (k  (Id  b))  a
+                 ≡⟨ cong  x  s  (k  s)  (s  (k  k)  (k  a~))  b  (k  x)  a) (Ida≡a b) 
+               s  (k  s)  (s  (k  k)  (k  a~))  b  (k  b)  a
+                 ≡⟨ cong  x  x  (k  b)  a) (sabc≡ac_bc _ _ _) 
+               k  s  b  (s  (k  k)  (k  a~)  b)  (k  b)  a
+                 ≡⟨ cong  x  x  (s  (k  k)  (k  a~)  b)  (k  b)  a) (kab≡a _ _) 
+               s  (s  (k  k)  (k  a~)  b)  (k  b)  a
+                 ≡⟨ sabc≡ac_bc _ _ _ 
+               s  (k  k)  (k  a~)  b  a  (k  b  a)
+                 ≡⟨ cong  x  s  (k  k)  (k  a~)  b  a  x) (kab≡a b a) 
+               s  (k  k)  (k  a~)  b  a  b
+                 ≡⟨ cong  x  x  a  b) (sabc≡ac_bc (k  k) (k  a~) b) 
+               k  k  b  (k  a~  b)  a  b
+                 ≡⟨ cong  x  x  (k  a~  b)  a  b) (kab≡a _ _) 
+               k  (k  a~  b)  a  b
+                 ≡⟨ cong  x  k  x  a  b) (kab≡a _ _) 
+               k  a~  a  b
+                 ≡⟨ cong  x  x  b) (kab≡a _ _) 
+               a~  b
                    ))
             (a~proves x b (subst  x'  b   ψ  x') (sym fx≡y) b⊩ψy))))
 
diff --git a/docs/index.html b/docs/index.html
index b05e2a9..b173d19 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -5,5 +5,8 @@
 open import Realizability.CombinatoryAlgebra
 open import Realizability.ApplicativeStructure
 open import Realizability.Topos.Everything
-open import Realizability.Choice
+open import Realizability.Assembly.Everything
+open import Realizability.PERs.Everything
+open import Realizability.Modest.Everything
+open import Realizability.Choice
 
\ No newline at end of file diff --git a/src/Realizability/Modest/Everything.agda b/src/Realizability/Modest/Everything.agda new file mode 100644 index 0000000..44d8ce4 --- /dev/null +++ b/src/Realizability/Modest/Everything.agda @@ -0,0 +1,9 @@ +module Realizability.Modest.Everything where + +open import Realizability.Modest.Base +open import Realizability.Modest.CanonicalPER +open import Realizability.Modest.UniformFamily +open import Realizability.Modest.UniformFamilyCleavage +open import Realizability.Modest.PartialSurjection +-- open import Realizability.Modest.GenericUniformFamily +open import Realizability.Modest.SubQuotientCanonicalPERIso diff --git a/src/Realizability/Modest/PartialSurjection.agda b/src/Realizability/Modest/PartialSurjection.agda index a475d78..155b73b 100644 --- a/src/Realizability/Modest/PartialSurjection.agda +++ b/src/Realizability/Modest/PartialSurjection.agda @@ -386,12 +386,3 @@ Category.⋆IdL PARTSURJ {X , surjX} {Y , surjY} f = idLPartSurjMorphism f Category.⋆IdR PARTSURJ {X , surjX} {Y , surjY} f = idRPartSurjMorphism f Category.⋆Assoc PARTSURJ {X , surjX} {Y , surjY} {Z , surjZ} {W , surjW} f g h = assocComposePartSurjMorphism f g h Category.isSetHom PARTSURJ {X , surjX} {Y , surjY} = isSetPartialSurjectionMorphism surjX surjY - -open Category -open ModestSetIso - -L : Functor MOD PARTSURJ -Functor.F-ob L (X , modX) = X , (ModestSet→PartialSurjection X (modX .fst .isSetX) modX) -Functor.F-hom L {X , asmX , isModestAsmX} {Y , asmY , isModestAsmY} f = {!!} -Functor.F-id L = {!!} -Functor.F-seq L = {!!} diff --git a/src/Realizability/PERs/Everything.agda b/src/Realizability/PERs/Everything.agda new file mode 100644 index 0000000..31455f2 --- /dev/null +++ b/src/Realizability/PERs/Everything.agda @@ -0,0 +1,5 @@ +module Realizability.PERs.Everything where + +open import Realizability.PERs.PER +open import Realizability.PERs.ResizedPER +open import Realizability.PERs.SubQuotient diff --git a/src/Realizability/PERs/SubQuotient.agda b/src/Realizability/PERs/SubQuotient.agda index ae9720f..c515dd8 100644 --- a/src/Realizability/PERs/SubQuotient.agda +++ b/src/Realizability/PERs/SubQuotient.agda @@ -9,7 +9,10 @@ open import Cubical.Foundations.Univalence open import Cubical.Foundations.Powerset open import Cubical.Foundations.HLevels open import Cubical.Foundations.Path +open import Cubical.Foundations.Function open import Cubical.Functions.FunExtEquiv +open import Cubical.Functions.Embedding +open import Cubical.Functions.Surjection open import Cubical.Relation.Binary open import Cubical.Data.Sigma open import Cubical.Data.FinData @@ -84,7 +87,7 @@ module _ isPropMotive x y = isPropΠ3 λ _ _ _ → squash/ x y module _ (R S : PER) (f : perMorphism R S) where - + subQuotientAssemblyMorphism : AssemblyMorphism (subQuotientAssembly R) (subQuotientAssembly S) subQuotientAssemblyMorphism = SQ.rec @@ -142,6 +145,44 @@ module _ (R S : PER) (f : perMorphism R S) where (λ { (r , r~r) → eq/ _ _ (a~b r r~r) }) sq) +module _ (R S : PER) (f : AssemblyMorphism (subQuotientAssembly R) (subQuotientAssembly S)) where + subQuotientAssemblyMorphism→perMorphism : perMorphism R S + subQuotientAssemblyMorphism→perMorphism = + PT.rec→Set squash/ mainMap mainMap2Constant (f .tracker) module InverseDefinition where + isSQTracker : A → Type ℓ + isSQTracker t = ∀ (q : subQuotient R) (a : A) → a ⊩[ subQuotientAssembly R ] q → ⟨ subQuotientRealizability S (t ⨾ a) (f .AssemblyMorphism.map q) ⟩ + -- 🤢🤮 + mainMap : Σ[ t ∈ A ] (isSQTracker t) → perMorphism R S + mainMap (t , t⊩f) = + [ t , + (λ r r' r~r' → + let + r~r : r ~[ R ] r + r~r = PER.isTransitive R r r' r r~r' (PER.isSymmetric R r r' r~r') + + r'~r' : r' ~[ R ] r' + r'~r' = PER.isTransitive R r' r r' (PER.isSymmetric R r r' r~r') r~r' + in + SQ.elimProp + {P = λ q → ∀ (t : A) → ⟨ subQuotientRealizability S (t ⨾ r) q ⟩ → ⟨ subQuotientRealizability S (t ⨾ r') q ⟩ → (t ⨾ r) ~[ S ] (t ⨾ r')} + (λ q → isPropΠ3 λ t _ _ → isProp~ (t ⨾ r) S (t ⨾ r')) + (λ { (s , s~s) t tr~s tr'~s → PER.isTransitive S (t ⨾ r) s (t ⨾ r') tr~s (PER.isSymmetric S (t ⨾ r') s tr'~s) }) + (f .AssemblyMorphism.map [ (r , r~r) ]) + t + (t⊩f [ (r , r~r) ] r r~r) + (subst (λ eq → ⟨ subQuotientRealizability S (t ⨾ r') (f .AssemblyMorphism.map eq) ⟩) (eq/ _ _ (PER.isSymmetric R r r' r~r')) (t⊩f [ (r' , r'~r') ] r' r'~r'))) ] + + mainMap2Constant : 2-Constant mainMap + mainMap2Constant (t , t⊩f) (t' , t'⊩f) = + eq/ _ _ + λ r r~r → + SQ.elimProp + {P = λ q → ⟨ subQuotientRealizability S (t ⨾ r) q ⟩ → ⟨ subQuotientRealizability S (t' ⨾ r) q ⟩ → (t ⨾ r) ~[ S ] (t' ⨾ r)} + (λ q → isPropΠ2 λ _ _ → isProp~ (t ⨾ r) S (t' ⨾ r)) + (λ { (s , s~s) tr~s t'r~s → PER.isTransitive S (t ⨾ r) s (t' ⨾ r) tr~s (PER.isSymmetric S (t' ⨾ r) s t'r~s) }) + (f .AssemblyMorphism.map [ (r , r~r) ]) + (t⊩f [ (r , r~r) ] r r~r) + (t'⊩f [ (r , r~r) ] r r~r) subQuotientModestSet : PER → MOD .Category.ob subQuotientModestSet R = subQuotient R , subQuotientAssembly R , isModestSubQuotientAssembly R @@ -176,3 +217,53 @@ Functor.F-seq subQuotientFunctor {R} {S} {T} f g = (λ { (a , a~a) (b , bIsTracker) (c , cIsTracker) → eq/ _ _ (subst (_~[ T ] (c ⨾ (b ⨾ a))) (sym (λ*ComputationRule (` c ̇ (` b ̇ # zero)) a)) (cIsTracker (b ⨾ a) (b ⨾ a) (bIsTracker a a a~a))) }) sq f g) + +hasPropFibersSubQuotientFunctor : ∀ R S → hasPropFibers (subQuotientAssemblyMorphism R S) +hasPropFibersSubQuotientFunctor R S f (x , sqX≡f) (y , sqY≡f) = + Σ≡Prop + (λ perMap → isSetAssemblyMorphism (subQuotientAssembly R) (subQuotientAssembly S) _ _) + (SQ.elimProp2 + {P = λ x y → subQuotientAssemblyMorphism R S x ≡ f → subQuotientAssemblyMorphism R S y ≡ f → x ≡ y} + (λ x y → isPropΠ2 λ _ _ → squash/ _ _) + (λ { (x , x⊩f) (y , y⊩f) sqX≡f sqY≡f → + eq/ _ _ + λ r r~r → + SQ.elimProp + {P = λ f[r] → ⟨ subQuotientRealizability S (x ⨾ r) f[r] ⟩ → ⟨ subQuotientRealizability S (y ⨾ r) f[r] ⟩ → (x ⨾ r) ~[ S ] (y ⨾ r)} + (λ f[r] → isPropΠ2 λ _ _ → isProp~ (x ⨾ r) S (y ⨾ r)) + (λ { (s , s~s) xr~s yr~s → PER.isTransitive S (x ⨾ r) s (y ⨾ r) xr~s (PER.isSymmetric S (y ⨾ r) s yr~s) }) + (f .AssemblyMorphism.map [ (r , r~r) ]) + (subst (λ f[r] → ⟨ subQuotientRealizability S (x ⨾ r) f[r] ⟩) (cong (λ m → m .AssemblyMorphism.map [ (r , r~r) ]) sqX≡f) (x⊩f r r r~r)) + (subst (λ f[r] → ⟨ subQuotientRealizability S (y ⨾ r) f[r] ⟩) (cong (λ m → m .AssemblyMorphism.map [ (r , r~r) ]) sqY≡f) (y⊩f r r r~r)) }) + x y sqX≡f sqY≡f) + +fiberSubQuotientFunctor : ∀ R S f → fiber (subQuotientAssemblyMorphism R S) f +fiberSubQuotientFunctor R S f = + (subQuotientAssemblyMorphism→perMorphism R S f) , + (AssemblyMorphism≡ _ _ + (funExt + (λ qR → + SQ.elimProp + {P = λ qR → subQuotientAssemblyMorphism R S (subQuotientAssemblyMorphism→perMorphism R S f) .AssemblyMorphism.map qR ≡ f .AssemblyMorphism.map qR} + (λ qR → squash/ _ _) + (λ { (r , r~r) → + PT.elim + {P = + λ fTracker → + subQuotientAssemblyMorphism R S (PT.rec→Set squash/ (InverseDefinition.mainMap R S f) (InverseDefinition.mainMap2Constant R S f) fTracker) .AssemblyMorphism.map [ (r , r~r) ] + ≡ f .AssemblyMorphism.map [ (r , r~r) ]} + (λ fTracker → squash/ _ _) + (λ { (t , tIsTracker) → + SQ.elimProp + {P = + λ fqR → ⟨ subQuotientRealizability S (t ⨾ r) fqR ⟩ → + subQuotientAssemblyMorphism R S (InverseDefinition.mainMap R S f (t , tIsTracker)) .AssemblyMorphism.map [ (r , r~r) ] ≡ fqR} + (λ fqR → isProp→ (squash/ _ _)) + (λ { (s , s~s) tr~s → eq/ _ _ tr~s }) + (f .AssemblyMorphism.map [ (r , r~r) ]) + (tIsTracker [ (r , r~r) ] r r~r) }) + (f .tracker) }) + qR))) + +isFullyFaithfulSubQuotientFunctor : Functor.isFullyFaithful subQuotientFunctor +equiv-proof (isFullyFaithfulSubQuotientFunctor R S) f = inhProp→isContr (fiberSubQuotientFunctor R S f) (hasPropFibersSubQuotientFunctor R S f) diff --git a/src/Realizability/Topos/SubobjectClassifier.agda b/src/Realizability/Topos/SubobjectClassifier.agda index 5cc8c95..d1d9a56 100644 --- a/src/Realizability/Topos/SubobjectClassifier.agda +++ b/src/Realizability/Topos/SubobjectClassifier.agda @@ -936,33 +936,3 @@ module ClassifiesStrictRelations char commutes classifies - -module ClassifiesSubobjects where - - subobjectClassifierUnivProp : Type _ - subobjectClassifierUnivProp = - ∀ {X Y : Type ℓ} - {perX : PartialEquivalenceRelation X} - {perY : PartialEquivalenceRelation Y} - → (f : RTMorphism perX perY) - → isMonic RT f - → ∃![ char ∈ RTMorphism perY Ωper ] - Σ[ commutes ∈ f ⋆ char ≡ [ terminalFuncRel perX ] ⋆ [ trueFuncRel ] ] - isPullback RT (cospan (Y , perY) ((ResizedPredicate Unit*) , Ωper) (Unit* , terminalPer) char [ trueFuncRel ]) f [ terminalFuncRel perX ] commutes - - isSubobjectClassifier : subobjectClassifierUnivProp - isSubobjectClassifier {X} {Y} {perX} {perY} f isMonicF = - SQ.elimProp - {P = λ f → ∀ (isMonic : isMonic RT f) → ∃![ char ∈ RTMorphism perY Ωper ] (Σ[ commutes ∈ f ⋆ char ≡ [ terminalFuncRel perX ] ⋆ [ trueFuncRel ] ] isPullback RT (cospan (Y , perY) ((ResizedPredicate Unit*) , Ωper) (Unit* , terminalPer) char [ trueFuncRel ]) f [ terminalFuncRel perX ] commutes) } - (λ f → isPropΠ λ isMonicF → isPropIsContr) - (λ F isMonicF → - let - ϕ = SubobjectIsoMonicFuncRel.ψ perY perX F isMonicF - in - uniqueExists - [ ClassifiesStrictRelations.charFuncRel Y perY ϕ ] - ({!ClassifiesStrictRelations.subobjectSquareCommutes Y perY ϕ!} , {!!}) - {!!} - {!!}) - f - isMonicF diff --git a/src/index.agda b/src/index.agda index c30a8cb..0ad3713 100644 --- a/src/index.agda +++ b/src/index.agda @@ -4,4 +4,7 @@ module index where open import Realizability.CombinatoryAlgebra open import Realizability.ApplicativeStructure open import Realizability.Topos.Everything +open import Realizability.Assembly.Everything +open import Realizability.PERs.Everything +open import Realizability.Modest.Everything open import Realizability.Choice