15 | import Syntax.PreorderReasoning
17 | %hide Prelude.Ops.infixl.(*>)
20 | namespace Containers
21 | namespace Definition1
24 | Container = Σ Type (\req => req -> Type)
26 | namespace Definition2
35 | namespace Definition3
37 | (⨾) : a =>> b -> b =>> c -> a =>> c
38 | (⨾) (q1 <| r1) (q2 <| r2) = q2 . q1 <| r1 . r2
43 | namespace Definition4
48 | namespace Definition5
53 | namespace Proposition6
55 | maybeMapId : forall t. (v : Maybe t) -> maybeMap (\x => x) v === v
56 | maybeMapId Nothing = Refl
57 | maybeMapId (Just x) = Refl
59 | maybeMapComp : forall a, b, c. (v : Maybe a) -> {f : b -> c} -> {g : a -> b} ->
61 | maybeMapComp Nothing = Refl
62 | maybeMapComp (Just x) = Refl
72 | maybeMapId' (Just x) (Aye y) = Refl
73 | maybeMapId' (Nothing) Nah = Refl
76 | MaybeAllIdrisPresComp : forall a, b, c. (f : a =%> b) -> (g : b =%> c) ->
81 | (\case Nothing => \Nah => Refl
92 | namespace Proposition7
103 | (\case (Just (Just x)) => Refl ;
Just Nothing => Refl ;
Nothing => Refl )
104 | (\case (Just (Just x)) => \(Aye x) => Refl
105 | ;
Nothing => (\x => Refl)
106 | ;
Just Nothing => (\x => Refl)))
108 | %unbound_implicits off
110 | joinMapJoin Nothing = Refl
111 | joinMapJoin (Just Nothing) = Refl
112 | joinMapJoin (Just (Just Nothing)) = Refl
113 | joinMapJoin (Just (Just (Just x))) = Refl
120 | bwdJoinMapJoin (Just Nothing) Nah = Refl
121 | bwdJoinMapJoin (Just (Just Nothing)) Nah = Refl
122 | bwdJoinMapJoin (Just (Just (Just z))) (Aye y) = Refl
133 | maybeJoinJust : forall a. (v : Maybe a) -> maybeJoin (Just v) = v
134 | maybeJoinJust Nothing = Refl
135 | maybeJoinJust (Just x) = Refl
140 | bwdMaybeJoinJust Nothing Nah = Refl
141 | bwdMaybeJoinJust (Just z) (Aye y) = Refl
148 | maybeJoinMapJust Nothing = Refl
149 | maybeJoinMapJust (Just x) = Refl
151 | bwdMaybeJoinMapJust : forall x. (v : Maybe (x .req)) ->
155 | bwdMaybeJoinMapJust Nothing Nah = Refl
156 | bwdMaybeJoinMapJust (Just z) (Aye y) = Refl
162 | %unbound_implicits on
174 | namespace Definition8
179 | namespace Proposition9
182 | maybeCoprod : Maybe x -> () + x
184 | maybeCoprod (Just p2) = +> p2
186 | coprodMaybe : () + x -> Maybe x
191 | coprodMaybeCoprod (<+ ()) = Refl
192 | coprodMaybeCoprod (+> y) = Refl
195 | maybeCoprodMaybe Nothing = Refl
196 | maybeCoprodMaybe (Just y) = Refl
198 | maybeCoprodIso : {0 x : Type} -> Iso (Prelude.Maybe x) (() + x)
202 | bwd_maybeToCoprod : (x : Maybe v.req) ->
205 | bwd_maybeToCoprod (Just x) y = Aye y
208 | bwd_coprodMaybe (<+ x) y = ()
219 | %unbound_implicits off
233 | %unbound_implicits on
234 | namespace Definition10
239 | namespace Definition11
244 | namespace Definition12
251 | namespace Definition13
255 | compLUnit = (\x => x.π2 ()) <| (\x, y => () ## y)
261 | namespace Definition14
265 | Done : forall c. StarShp c
266 | More : forall c. Ex c (StarShp c) -> StarShp c
277 | %unbound_implicits on
278 | namespace Proposition15
305 | kleene_pres_id_rhs :
316 | kleene_pres_comp : forall a, b, c. (f : a =%> b) -> (g : b =%> c) ->
350 | namespace StateCostateContext
351 | namespace Definition16
363 | state x = const x <| (\_, _ => ())
365 | namespace Definition17
373 | costate f = const () <| (\x, _ => f x)
379 | namespace Definition18
390 | namespace Definition19
396 | %unbound_implicits off
397 | namespace Proposition20
423 | namespace Proposition21
428 |
472 | %unbound_implicits on
473 | namespace Definition22
476 | distrib_plus = id <| \case (<+ x) => id ;
(+> x) => id
478 | namespace Definition23
481 | distrib_maybeAll = id <| \case Nothing => \x => pure Nah
484 | namespace Definition24