(* end semImplication *)
Program Instance implicationUnsized
{C} `{Checkable C} b (c : C) `{UnsizedChecker (checker c)} :
UnsizedChecker (b ==> c).
Next Obligation.
move : H0 => [/(_ s1 s2) H0].
rewrite /genChecker in H0 *. rewrite -> !semFmapSize in H0.
rewrite !semFmapSize.
rewrite /implication. case : b; eauto.
apply imset_eq. rewrite !semReturnSize. reflexivity.
Qed.
Program Instance implicationMonotonic
{C} `{Checkable C} b (c : C) `{SizeMonotonicChecker (checker c)} :
SizeMonotonicChecker (b ==> c).
Next Obligation.
move : H0 => [/(_ s1 s2 H1) H0].
rewrite /genChecker in H0 *. rewrite -> !semFmapSize in H0.
rewrite !semFmapSize.
rewrite /implication. case : b; eauto.
apply imset_incl. rewrite !semReturnSize. by move => ? ?; eauto.
Qed.
(* equivalences for other combinators *)

(* Specifications: *)
Lemma semReturnGenSize (qp : QProp) (s: nat) :
semCheckerSize (returnGen qp) s <-> semCheckableSize qp s.
Lemma semReturnGen (qp : QProp) :
semChecker (returnGen qp) <-> semCheckable qp.
Lemma semBindGenSize {A} (gen : G A) (f : A -> Checker) (s: nat):
semCheckerSize (bindGen gen f) s <->
forall a, semGenSize gen s a -> semCheckerSize (f a) s.
Lemma semBindGenUsinzed1 {A} (gen : G A) (f : A -> Checker) `{Unsized _ gen} :
(semChecker (bindGen gen f) <->
forall a, semGen gen a -> semChecker (f a)).
Lemma semBindGenUsinzed2 {A} (gen : G A) (f : A -> Checker)
`{forall a, UnsizedChecker (f a)} :
(semChecker (bindGen gen f) <->
forall a, semGen gen a -> semChecker (f a)).
Lemma semBindGenSizeMonotonic {A} (gen : G A) (f : A -> Checker)
`{SizeMonotonic _ gen}
`{forall a, SizeMonotonicChecker (f a)} :
(semChecker (bindGen gen f) <->
forall a, semGen gen a -> semChecker (f a)).
Lemma semPredQPropSize (c : Checker) (s : nat) :
semCheckableSize c s <-> (semCheckerSize c s).
Lemma semPredQProp (c : Checker) :
semCheckable c <-> semChecker c.