{-# OPTIONS --safe #-}
module Cubical.Data.FinSequence.Properties where

open import Cubical.Foundations.Prelude
open import Cubical.Data.Nat
open import Cubical.Data.Fin.Inductive.Base
open import Cubical.Data.FinSequence.Base
open import Cubical.Data.Sequence


private
  variable
     ℓ' ℓ'' : Level

open Sequence
open FinSequence
open FinSequenceMap

idFinSequenceMap : (m : ) (C : FinSequence m )  FinSequenceMap C C
fmap (idFinSequenceMap m C) p x = x
fcomm (idFinSequenceMap m C) p _ = refl

composeFinSequenceMap : (m : ) {C : FinSequence m } {D : FinSequence m ℓ'}
  {E : FinSequence m ℓ''}
  (g : FinSequenceMap D E) (f : FinSequenceMap C D)  FinSequenceMap C E
fmap (composeFinSequenceMap m g f) n x = fmap g n (fmap f n x)
fcomm (composeFinSequenceMap m g f) n x =
    fcomm g n _
   cong (fmap g (fsuc n)) (fcomm f n x)

Sequence→FinSequence : (m : )  Sequence   FinSequence m 
fobj (Sequence→FinSequence m C) x = obj C (fst x)
fmap (Sequence→FinSequence m C) x = map C x

SequenceMap→FinSequenceMap : (m : ) (C D : Sequence )
   SequenceMap C D
   FinSequenceMap (Sequence→FinSequence m C) (Sequence→FinSequence m D)
fmap (SequenceMap→FinSequenceMap m C D ϕ) t = SequenceMap.map ϕ  (fst t)
fcomm (SequenceMap→FinSequenceMap m C D ϕ) t = SequenceMap.comm ϕ (fst t)