{-# OPTIONS --safe --cubical-compatible --guardedness --exact-split --double-check #-}
module ALMA.SecondPass.StrictLiftShape where
open import Agda.Primitive using (Level; _⊔_; lsuc; Setω)
open import Agda.Builtin.Equality using (_≡_; refl)
open import Level using (Lift; lift; lower)
open import Relation.Binary.PropositionalEquality.Core using (cong; sym; trans)
open import Relation.Nullary using (¬_)
open import Data.Product.Base using (∃; _,_)
open import Categories.Category.Core using (Category)
open import Categories.Functor.Core using (Functor)
open import ALMA.Cosmos.ContCategory using (ContCat)
open import ALMA.Cosmos.ContCategoryLemmas using (ShapeOf)
open import ALMA.SecondPass.StrictLift using (StrictLayer; strictStep-suc; lift-lower)
open StrictLayer
variable
o h e s p : Level
HasDistinctShapes : (C : Category o h e)
→ (FC : Functor C (ContCat s p)) → Set (o ⊔ s)
HasDistinctShapes C FC =
∃ λ (A : Category.Obj C) →
∃ λ (s₁ : ShapeOf FC A) →
∃ λ (s₂ : ShapeOf FC A) → ¬ (s₁ ≡ s₂)
HasSingletonShapes : (C : Category o h e)
→ (Functor C (ContCat s p)) → Set (o ⊔ s)
HasSingletonShapes C FC =
∀ (A : Category.Obj C) (s t : ShapeOf FC A) → s ≡ t
step-shape-reduces
: ∀ {o h e s p} (L : StrictLayer o h e s p)
(A : Category.Obj (C L))
(s₀ : ShapeOf (FC L) A)
→ ShapeOf (FC (strictStep-suc L)) (A , s₀)
≡ Lift (lsuc (s ⊔ p)) (ShapeOf (FC L) A)
step-shape-reduces L A s₀ = refl
singleton-preserved-step
: ∀ {o h e s p} (L : StrictLayer o h e s p)
→ HasSingletonShapes (C L) (FC L)
→ HasSingletonShapes (C (strictStep-suc L)) (FC (strictStep-suc L))
singleton-preserved-step L sing (A , s₀) u v =
trans (sym (lift-lower u))
(trans (cong lift (sing (A) (lower u) (lower v)))
(lift-lower v))
distinct-preserved-step
: ∀ {o h e s p} (L : StrictLayer o h e s p)
→ HasDistinctShapes (C L) (FC L)
→ HasDistinctShapes (C (strictStep-suc L)) (FC (strictStep-suc L))
distinct-preserved-step L (A , s₁ , s₂ , ¬eq) =
(A , s₁) , lift s₁ , lift s₂ , λ eq → ¬eq (cong lower eq)
record ShapeStabilityUnderStep : Setω where
field
singleton-preserved : ∀ {o h e s p} (L : StrictLayer o h e s p)
→ HasSingletonShapes (C L) (FC L)
→ HasSingletonShapes (C (strictStep-suc L))
(FC (strictStep-suc L))
distinct-preserved : ∀ {o h e s p} (L : StrictLayer o h e s p)
→ HasDistinctShapes (C L) (FC L)
→ HasDistinctShapes (C (strictStep-suc L))
(FC (strictStep-suc L))
shape-stability : ShapeStabilityUnderStep
shape-stability = record
{ singleton-preserved = singleton-preserved-step
; distinct-preserved = distinct-preserved-step
}