{-# OPTIONS --safe --cubical-compatible --guardedness --exact-split --double-check #-}
module ALMA.SecondPass.FinCatNInnerObstruction where
open import Agda.Builtin.Equality using (_≡_; refl)
open import Level using (lower)
open import Relation.Nullary using (¬_)
open import Relation.Binary.PropositionalEquality.Properties using (module ≡-Reasoning)
open ≡-Reasoning
open import Data.Nat using (ℕ; suc)
open import Data.Product.Base using (proj₁)
open import Categories.Category.Core using (Category)
open import ALMA.Cosmos.ContCategoryLemmas using (ShapeOf; PosOf)
open import ALMA.SecondPass.Cosmos using (Cosmos; out)
open import ALMA.SecondPass.Terminal using (_≈C_; ≈C-refl)
open import ALMA.SecondPass.Unfolding using (Unfolding)
open import ALMA.SecondPass.CumulativeHierarchy using (UniformEmbeddingFamily; EmbeddingData)
open import ALMA.SecondPass.StrictLift
using (StrictLayer; EmbedFamily; strictStep-suc; strictEmbed)
open import ALMA.SecondPass.CumulativeHierarchyLimit
using (Tower; LiftedLimitStructure; LimitLayer; EnrichedTower)
open import ALMA.SecondPass.FinCatNWitness
open import ALMA.SecondPass.FinCatNInnerSewing
open import ALMA.SecondPass.FinCatNColimit
open import ALMA.SecondPass.FinCatNDefaultUnif
open import ALMA.SecondPass.FinCatNFunctorial
open import ALMA.SecondPass.FinCatNProjectiveObstruction
module FinCatNInnerObstruction (m : ℕ) where
open FinCatN m
open FinCatNColimit m using (colimitLayer)
open FinCatNDefaultUnif m using (default-unif)
open FinCatNFunctorial m using (default-strictEmbed-resp-≈C)
open FinCatNProjectiveObstruction m
private
strictEmbed-inner-pos-to-shape≡strictEmbed
: ∀ {o h e s p} (L : StrictLayer o h e s p)
(x : Cosmos (StrictLayer.C L) (StrictLayer.FC L))
(ed : EmbeddingData x)
(A : Category.Obj (StrictLayer.C (strictStep-suc L)))
(s : ShapeOf (StrictLayer.FC (strictStep-suc L)) A)
(p : PosOf (StrictLayer.FC (strictStep-suc L)) {A = A} s)
→ Unfolding.pos-to-shape (out (strictEmbed-inner L x ed)) {A = A} s p
≡ Unfolding.pos-to-shape (out (strictEmbed L x ed)) {A = A} s p
strictEmbed-inner-pos-to-shape≡strictEmbed L x ed A s p = refl
default-strictEmbed-inner-resp-≈C
: ∀ k {x y : Cosmos (StrictLayer.C (Tower.layer nTower k))
(StrictLayer.FC (Tower.layer nTower k))}
→ _≈C_ {C = StrictLayer.C (Tower.layer nTower k)}
{FC = StrictLayer.FC (Tower.layer nTower k)} x y
→ _≈C_ {C = StrictLayer.C (Tower.layer nTower (suc k))}
{FC = StrictLayer.FC (Tower.layer nTower (suc k))}
(strictEmbed-inner (Tower.layer nTower k) x
(UniformEmbeddingFamily.getData (default-unif k) x))
(strictEmbed-inner (Tower.layer nTower k) y
(UniformEmbeddingFamily.getData (default-unif k) y))
default-strictEmbed-inner-resp-≈C k {x} {y} = go x y
where
L = Tower.layer nTower k
CN = StrictLayer.C L
FCN = StrictLayer.FC L
go : (x y : Cosmos CN FCN)
→ _≈C_ {C = CN} {FC = FCN} x y
→ _≈C_ {C = StrictLayer.C (strictStep-suc L)}
{FC = StrictLayer.FC (strictStep-suc L)}
(strictEmbed-inner L x
(UniformEmbeddingFamily.getData (default-unif k) x))
(strictEmbed-inner L y
(UniformEmbeddingFamily.getData (default-unif k) y))
go x y x≈y ._≈C_.unfoldFunctor₀-eq {A} s = refl
go x y x≈y ._≈C_.pos-to-shape-eq {A} s p =
begin
Unfolding.pos-to-shape (out (strictEmbed-inner L x ed-x)) {A = A} s p
≡⟨ strictEmbed-inner-pos-to-shape≡strictEmbed L x ed-x A s p ⟩
Unfolding.pos-to-shape (out (strictEmbed L x ed-x)) {A = A} s p
≡⟨ default-strictEmbed-resp-≈C k x≈y ._≈C_.pos-to-shape-eq {A = A} s p ⟩
Unfolding.pos-to-shape (out (strictEmbed L y ed-y)) {A = A} s p
≡˘⟨ strictEmbed-inner-pos-to-shape≡strictEmbed L y ed-y A s p ⟩
Unfolding.pos-to-shape (out (strictEmbed-inner L y ed-y)) {A = A} s p
∎
where
ed-x = UniformEmbeddingFamily.getData (default-unif k) x
ed-y = UniformEmbeddingFamily.getData (default-unif k) y
go x y x≈y ._≈C_.unfold-next-eq {A} s =
go (Unfolding.unfold-next (out x) {A = proj₁ A} (lower s))
(Unfolding.unfold-next (out y) {A = proj₁ A} (lower s))
(_≈C_.unfold-next-eq x≈y {A = proj₁ A} (lower s))
fams-inner : ∀ k → EmbedFamily inner-rule (Tower.layer nTower k)
fams-inner k = record
{ uniform = default-unif k
; resp-≈C = λ {x} {y} x≈y → default-strictEmbed-inner-resp-≈C k x≈y
}
enriched-inner : EnrichedTower inner-rule nIdx
enriched-inner = record
{ tower = nTower
; fams = fams-inner
}
private
strictEmbed-inner-id≈const0
: _≈C_ {C = StrictLayer.C (Tower.layer nTower 1)}
{FC = StrictLayer.FC (Tower.layer nTower 1)}
(strictEmbed-inner nLayer cosmos-idN
(UniformEmbeddingFamily.getData (default-unif 0) cosmos-idN))
(strictEmbed-inner nLayer cosmos-const0N
(UniformEmbeddingFamily.getData (default-unif 0) cosmos-const0N))
strictEmbed-inner-id≈const0 ._≈C_.unfoldFunctor₀-eq {A} s = refl
strictEmbed-inner-id≈const0 ._≈C_.pos-to-shape-eq {A} s p = refl
strictEmbed-inner-id≈const0 ._≈C_.unfold-next-eq {A} s =
strictEmbed-inner-id≈const0
liftAt-0-collapses-inner
: (LLS : LiftedLimitStructure inner-rule nIdx enriched-inner)
→ _≈C_ {C = StrictLayer.C (LimitLayer.layer∞ (LiftedLimitStructure.limit LLS))}
{FC = StrictLayer.FC (LimitLayer.layer∞ (LiftedLimitStructure.limit LLS))}
(LiftedLimitStructure.liftAt LLS 0 cosmos-idN)
(LiftedLimitStructure.liftAt LLS 0 cosmos-const0N)
liftAt-0-collapses-inner =
liftAt-0-collapses-general enriched-inner
cosmos-idN cosmos-const0N strictEmbed-inner-id≈const0
no-injective-liftAt-inner
: (LLS : LiftedLimitStructure inner-rule nIdx enriched-inner)
→ ¬ (∀ {x y : Cosmos (StrictLayer.C (Tower.layer nTower 0))
(StrictLayer.FC (Tower.layer nTower 0))}
→ _≈C_ {C = StrictLayer.C (LimitLayer.layer∞
(LiftedLimitStructure.limit LLS))}
{FC = StrictLayer.FC (LimitLayer.layer∞
(LiftedLimitStructure.limit LLS))}
(LiftedLimitStructure.liftAt LLS 0 x)
(LiftedLimitStructure.liftAt LLS 0 y)
→ x ≈C y)
no-injective-liftAt-inner =
no-injective-liftAt-general enriched-inner
cosmos-idN cosmos-const0N strictEmbed-inner-id≈const0 cosmos-idN≉cosmos-const0N
trivial-liftAt-inner
: ∀ k
→ Cosmos (StrictLayer.C (Tower.layer nTower k))
(StrictLayer.FC (Tower.layer nTower k))
→ Cosmos (StrictLayer.C (LimitLayer.layer∞ colimitLayer))
(StrictLayer.FC (LimitLayer.layer∞ colimitLayer))
trivial-liftAt-inner k _ = cosmos-idN
trivial-lifted-inner : LiftedLimitStructure inner-rule nIdx enriched-inner
trivial-lifted-inner = record
{ limit = colimitLayer
; liftAt = trivial-liftAt-inner
; liftAt-resp-≈C = λ k {x} {y} x≈y → ≈C-refl
; liftAt-step = λ k x → ≈C-refl
}