0 | module Data.Container.Morphism.Eq
2 | import public Proofs.Congruence
3 | import public Proofs.Extensionality
5 | import public Control.Relation
6 | import public Control.Order
8 | import Data.Container.Morphism
11 | public export infix 0 `DepLensEq`
16 | record DepLensEq (a, b : dom =%> cod) where
17 | constructor MkDepLensEq
18 | 0 eqFwd : (v : dom.req) -> a.fwd v === b.fwd v
19 | 0 eqBwd : (v : dom.req) -> (y : cod.res (a.fwd v)) ->
20 | let 0 p1 : dom.res v
23 | p2 = b.bwd v (replace {p = cod.res} (eqFwd v) y)
26 | 0 depLensEqToEq : DepLensEq a b -> a === b
27 | depLensEqToEq {a = (fwd1 <| bwd1)} {b = (fwd2 <| bwd2)} (MkDepLensEq eqFwd eqBwd) =
28 | cong2Dep (<|) (funExt eqFwd) (funExtDep $
\x => funExt $
\y => eqBwd x y)
31 | Transitive (dom =%> cod) DepLensEq where
32 | transitive a b = MkDepLensEq (\v => transitive (a.eqFwd v) (b.eqFwd v))
33 | (\v, w => transitive
35 | (b.eqBwd v (replace {p = cod.res} (a.eqFwd v) w)))
38 | Reflexive (dom =%> cod) DepLensEq where
39 | reflexive = MkDepLensEq (\_ => Refl) (\_, _ => Refl)
42 | Preorder (dom =%> cod) DepLensEq where
46 | ContIso : (x, y : Container) -> Type
47 | ContIso = GenIso Container (=%>) DepLensEq