\def \lambda A,B.\lambda f.
\forall x,y:A.f x = f y \to x=y.
-(* we have still to attach exists *)
definition surjective: \forall A,B:Type.\forall f:A \to B.Prop
\def \lambda A,B.\lambda f.
\forall z:B. \exists x:A.z=f x.
apply le_plus_n.
rewrite < sym_times.
rewrite > distr_times_minus.
-(* ATTENZIONE ALL' ORDINAMENTO DEI GOALS *)
rewrite > plus_minus.
rewrite > sym_times.
rewrite < H5.
apply le_to_or_lt_eq.apply le_O_n.
qed.
-(* esempio di sfarfallalmento !!! *)
-(*
-theorem bad: \forall n,p,q:nat.prime n \to divides n (p*q) \to
-divides n p \lor divides n q.
-intros.
-cut divides n p \lor \not (divides n p).
-elim Hcut.left.assumption.
-right.
-cut \exists a,b. a*n - b*p = (S O) \lor b*p - a*n = (S O).
-elim Hcut1.elim H3.*)
-
theorem divides_times_to_divides: \forall n,p,q:nat.prime n \to divides n (p*q) \to
divides n p \lor divides n q.
intros.
intros.
change with (\lnot (mod n1 m = O)).
rewrite > H4.
-(* META NOT FOUND !!!
+(* Andrea: META NOT FOUND !!!
rewrite > sym_eq. *)
simplify.intro.
apply not_eq_O_S m1.
theorem lt_times_to_lt_l:
\forall n,p,q:nat. lt (times p (S n)) (times q (S n)) \to lt p q.
intros.
-(* convertibility problem here *)
cut Or (lt p q) (Not (lt p q)).
elim Hcut.
assumption.
apply nat_elim2 (\lambda n,m.n \leq m \to n-m = O).
intros.simplify.reflexivity.
intros.apply False_ind.
-(* ancora problemi con il not *)
-apply not_le_Sn_O n1 H.
+apply not_le_Sn_O.
+goal 13.apply H.
intros.
simplify.apply H.apply le_S_S_to_le. apply H1.
qed.
split.split.
apply smallest_factor_fact.
apply le_smallest_factor_n.
-(* ancora hint non lo trova *)
+(* Andrea: ancora hint non lo trova *)
apply prime_smallest_factor_n.
change with (S(S O)) \le S (fact (S n1)).
apply le_S.apply le_SSO_fact.
change with prime (S(S O)).
apply primeb_to_Prop (S(S O)).
intro.
-(* ammirare la resa del letin !! *)
change with
let previous_prime \def (nth_prime m) in
let upper_bound \def S (fact previous_prime) in
simplify.apply eq_f.assumption.
qed.
-(* some problem here: confusion between relations/symmetric
-and functions/symmetric; functions symmetric is not in
-functions.moo why?
-theorem symmetric_plus: symmetric nat plus. *)
-
theorem sym_plus: \forall n,m:nat. n+m = m+n.
intros.elim n.
simplify.apply plus_n_O.
theorem injective_plus_l: \forall m:nat.injective nat nat (\lambda n.n+m).
intro.simplify.intros.
-(* qui vorrei applicare injective_plus_r *)
-apply inj_plus_r m.
+apply injective_plus_r m.
rewrite < sym_plus.
rewrite < sym_plus y.
assumption.
rewrite > plus_n_O (n*div m n).
rewrite < H1.
rewrite < sym_times.
-(* perche' hint non lo trova ?*)
+(* Andrea: perche' hint non lo trova ?*)
apply div_mod.
assumption.
qed.