rewrite > H2.simplify.apply le_n.
qed.
+
definition max_spec \def \lambda f:nat \to bool.\lambda n: nat.
-ex nat (\lambda i:nat. (le i n) \land (f i = true)) \to
+\exists i. (le i n) \land (f i = true) \to
(f n) = true \land (\forall i. i < n \to (f i = false)).
theorem f_max_true : \forall f:nat \to bool. \forall n:nat.
-ex nat (\lambda i:nat. (le i n) \land (f i = true)) \to f (max n f) = true.
+(\exists i:nat. le i n \land f i = true) \to f (max n f) = true.
intros 2.
elim n.elim H.elim H1.generalize in match H3.
apply le_n_O_elim a H2.intro.simplify.rewrite > H4.
cut O < m.apply lt_O_n_elim m Hcut.exact not_le_Sn_O.
rewrite < max_O_f f.assumption.
generalize in match H1.
-(* ?? non posso generalizzare su un goal implicativo ?? *)
elim max_S_max f n1.
elim H3.
absurd m \le S n1.assumption.
qed.
theorem f_min_aux_true: \forall f:nat \to bool. \forall off,m:nat.
-ex nat (\lambda i:nat. (le (m-off) i) \land (le i m) \land (f i = true)) \to
+(\exists i. le (m-off) i \land le i m \land f i = true) \to
f (min_aux off m f) = true.
intros 2.
elim off.elim H.elim H1.elim H2.