{-# OPTIONS --without-K #-}
open import lib.Basics
open import lib.types.Paths
open import lib.types.Pi
open import lib.types.Unit
open import lib.types.Nat
open import lib.types.TLevel
open import lib.types.Pointed
open import lib.types.Sigma
open import lib.NType2
open import lib.types.PathSeq
open import nicolai.pseudotruncations.Liblemmas
open import nicolai.pseudotruncations.SeqColim
open import nicolai.pseudotruncations.wconst-preparation
open import nicolai.pseudotruncations.heptagon
module nicolai.pseudotruncations.wconstSequence where
module _ {i} {C : Sequence {i}} (wc : wconst-chain C) (a₀ : fst C O) where
open wconst-init {i} {C} wc a₀
î : (n : ℕ) → (a : A n) → (ins {C = C} n a) =-= (ins O a₀)
î = î-def
ins-n-O : (n : ℕ) → (a : A n) → ins {C = C} n a == ins O a₀
ins-n-O n a = ↯ (î-def n a)
ĝ : (n : ℕ) → (a : A n)
→ (↯ ((î (S n) (f n a)) ⋯ (‼ (î n a) ⋯ toSeq (glue n a)))) == idp
ĝ n a = ĝ-def wc a₀ n a
postulate
ins-glue-coh : (n : ℕ) (a : A n)
→ ins-n-O (S n) (f n a) ∙ ! (ins-n-O n a) ∙ glue n a == idp
glue-n-O : (n : ℕ) (a : A n)
→ (ins-n-O n a)
==
(ins-n-O (S n) (f n a)) [ (λ w → w == ins O a₀) ↓ glue n a ]
glue-n-O n a = from-transp _ (glue n a)
(transport (λ w → w == ins O a₀) (glue n a) (ins-n-O n a)
=⟨ trans-ap₁ (idf _) (ins O a₀) (glue n a) (ins-n-O n a) ⟩
! (ap (idf _) (glue n a)) ∙ (ins-n-O n a)
=⟨ ap (λ p → (! p) ∙ (ins-n-O n a)) (ap-idf (glue n a)) ⟩
! (glue n a) ∙ (ins-n-O n a)
=⟨ ! (adhoc-lemma (ins-n-O (S n) (f n a)) (ins-n-O n a) (glue n a) (ins-glue-coh n a)) ⟩
ins-n-O (S n) (f n a)
∎)
equal-n-O : (w : SC) → w == ins O a₀
equal-n-O = SeqCo-ind ins-n-O glue-n-O
SC-contr : is-contr SC
SC-contr = ins O a₀ , (λ w → ! (equal-n-O w))
removeFst-preserves-wconst : ∀ {i} → (C : Sequence {i}) → wconst-chain C → wconst-chain (removeFst C)
removeFst-preserves-wconst C wc n = wc (S n)
removeInit-preserves-wconst : ∀ {i} → (C : Sequence {i}) → (n : ℕ) → wconst-chain C → wconst-chain (removeInit C n)
removeInit-preserves-wconst C O wc = wc
removeInit-preserves-wconst C (S n) wc =
removeInit-preserves-wconst (removeFst C) n
(removeFst-preserves-wconst C wc)
wconst-prop : ∀ {i} → (C : Sequence {i}) → wconst-chain C → is-prop (SeqCo C)
wconst-prop C wc = inhab-to-contr-is-prop (SeqCo-rec wc-prp-ins automatic) where
A = fst C
f = snd C
wc-prp-ins : (n : ℕ) → A n → is-contr (SeqCo C)
wc-prp-ins n a = equiv-preserves-level {n = ⟨-2⟩} (ignore-init C n ⁻¹) C'-contr where
C' = removeInit C n
A' = fst C'
f' = snd C'
a₀' : A' O
a₀' = new-initial C n a
wc' : wconst-chain C'
wc' = removeInit-preserves-wconst C n wc
C'-contr : is-contr (SeqCo C')
C'-contr = SC-contr wc' a₀'
automatic : (n : ℕ) (a : fst C n) → wc-prp-ins n a == wc-prp-ins (S n) (snd C n a)
automatic n a = prop-has-all-paths (has-level-is-prop {n = ⟨-2⟩} {A = SeqCo C}) _ _