| (cons x f) \Rightarrow f].
theorem injective_pp : injective nat fraction pp.
-simplify.intros.
+unfold injective.intros.
change with ((aux (pp x)) = (aux (pp y))).
apply eq_f.assumption.
qed.
theorem injective_nn : injective nat fraction nn.
-simplify.intros.
+unfold injective.intros.
change with ((aux (nn x)) = (aux (nn y))).
apply eq_f.assumption.
qed.
qed.
theorem not_eq_pp_nn: \forall n,m:nat. pp n \neq nn m.
-intros.simplify. intro.
+intros.unfold Not. intro.
change with match (pp n) with
[ (pp n) \Rightarrow False
| (nn n) \Rightarrow True
theorem not_eq_pp_cons:
\forall n:nat.\forall x:Z. \forall f:fraction.
pp n \neq cons x f.
-intros.simplify. intro.
+intros.unfold Not. intro.
change with match (pp n) with
[ (pp n) \Rightarrow False
| (nn n) \Rightarrow True
theorem not_eq_nn_cons:
\forall n:nat.\forall x:Z. \forall f:fraction.
nn n \neq cons x f.
-intros.simplify. intro.
+intros.unfold Not. intro.
change with match (nn n) with
[ (pp n) \Rightarrow True
| (nn n) \Rightarrow False
theorem decidable_eq_fraction: \forall f,g:fraction.
decidable (f = g).
-intros.simplify.
+intros.unfold decidable.
apply (fraction_elim2 (\lambda f,g. f=g \lor (f=g \to False))).
intros.elim g1.
elim ((decidable_eq_nat n n1) : n=n1 \lor (n=n1 \to False)).
intros.elim g1.
simplify.apply eqb_elim.
intro.simplify.apply eq_f.assumption.
- intro.simplify.intro.apply H.apply injective_pp.assumption.
+ intro.simplify.unfold Not.intro.apply H.apply injective_pp.assumption.
simplify.apply not_eq_pp_nn.
simplify.apply not_eq_pp_cons.
intros.elim g1.
- simplify.intro.apply (not_eq_pp_nn n1 n).apply sym_eq. assumption.
+ simplify.unfold Not.intro.apply (not_eq_pp_nn n1 n).apply sym_eq. assumption.
simplify.apply eqb_elim.intro.simplify.apply eq_f.assumption.
- intro.simplify.intro.apply H.apply injective_nn.assumption.
+ intro.simplify.unfold Not.intro.apply H.apply injective_nn.assumption.
simplify.apply not_eq_nn_cons.
- intros.simplify.intro.apply (not_eq_pp_cons m x f1).apply sym_eq. assumption.
- intros.simplify.intro.apply (not_eq_nn_cons m x f1).apply sym_eq. assumption.
+ intros.simplify.unfold Not.intro.apply (not_eq_pp_cons m x f1).apply sym_eq. assumption.
+ intros.simplify.unfold Not.intro.apply (not_eq_nn_cons m x f1).apply sym_eq. assumption.
intros.
change in match (eqfb (cons x f1) (cons y g1))
with (andb (eqZb x y) (eqfb f1 g1)).
intro.generalize in match H.elim (eqfb f1 g1).
simplify.apply eq_f2.assumption.
apply H2.
- simplify.intro.apply H2.apply (eq_cons_to_eq2 x y).assumption.
- intro.simplify.intro.apply H1.apply (eq_cons_to_eq1 f1 g1).assumption.
+ simplify.unfold Not.intro.apply H2.apply (eq_cons_to_eq2 x y).assumption.
+ intro.simplify.unfold Not.intro.apply H1.apply (eq_cons_to_eq1 f1 g1).assumption.
qed.
let rec finv f \def
| (frac h) \Rightarrow frac (cons (x + y) h)]]].
theorem symmetric2_ftimes: symmetric2 fraction ratio ftimes.
-simplify. intros.apply (fraction_elim2 (\lambda f,g.ftimes f g = ftimes g f)).
+unfold symmetric2. intros.apply (fraction_elim2 (\lambda f,g.ftimes f g = ftimes g f)).
intros.elim g.
change with (Z_to_ratio (pos n + pos n1) = Z_to_ratio (pos n1 + pos n)).
apply eq_f.apply sym_Zplus.
simplify.apply not_eq_OZ_pos.
simplify.apply not_eq_OZ_neg.
elim y.
- simplify.intro.apply (not_eq_OZ_pos n).apply sym_eq.assumption.
+ simplify.unfold Not.intro.apply (not_eq_OZ_pos n).apply sym_eq.assumption.
simplify.apply eqb_elim.
intro.simplify.apply eq_f.assumption.
- intro.simplify.intro.apply H.apply inj_pos.assumption.
+ intro.simplify.unfold Not.intro.apply H.apply inj_pos.assumption.
simplify.apply not_eq_pos_neg.
elim y.
- simplify.intro.apply (not_eq_OZ_neg n).apply sym_eq.assumption.
- simplify.intro.apply (not_eq_pos_neg n1 n).apply sym_eq.assumption.
+ simplify.unfold Not.intro.apply (not_eq_OZ_neg n).apply sym_eq.assumption.
+ simplify.unfold Not.intro.apply (not_eq_pos_neg n1 n).apply sym_eq.assumption.
simplify.apply eqb_elim.
intro.simplify.apply eq_f.assumption.
- intro.simplify.intro.apply H.apply inj_neg.assumption.
+ intro.simplify.unfold Not.intro.apply H.apply inj_neg.assumption.
qed.
theorem eqZb_elim: \forall x,y:Z.\forall P:bool \to Prop.
change with (\forall x:Z. x < x \to False).
intro.elim x.exact H.
cut (neg n < neg n \to False).
-apply Hcut.apply H.simplify.apply not_le_Sn_n.
+apply Hcut.apply H.simplify.unfold lt.apply not_le_Sn_n.
cut (pos n < pos n \to False).
-apply Hcut.apply H.simplify.apply not_le_Sn_n.
+apply Hcut.apply H.simplify.unfold lt.apply not_le_Sn_n.
qed.
theorem irrefl_Zlt: irreflexive Z Zlt
(* we now close all positivity conditions *)
apply lt_O_times_S_S.
apply lt_O_times_S_S.
-simplify.
+simplify.unfold lt.
apply le_SO_minus. exact H.
qed.
|false \Rightarrow z \neq OZ].
intros.elim z.
simplify.reflexivity.
-simplify.intros (H).
+simplify. unfold Not. intros (H).
discriminate H.
-simplify.intros (H).
+simplify. unfold Not. intros (H).
discriminate H.
qed.
(* discrimination *)
theorem injective_pos: injective nat Z pos.
-simplify.
+unfold injective.
intros.
change with (abs (pos x) = abs (pos y)).
apply eq_f.assumption.
\def injective_pos.
theorem injective_neg: injective nat Z neg.
-simplify.
+unfold injective.
intros.
change with (abs (neg x) = abs (neg y)).
apply eq_f.assumption.
\def injective_neg.
theorem not_eq_OZ_pos: \forall n:nat. OZ \neq pos n.
-simplify.intros (n H).
+unfold Not.intros (n H).
discriminate H.
qed.
theorem not_eq_OZ_neg :\forall n:nat. OZ \neq neg n.
-simplify.intros (n H).
+unfold Not.intros (n H).
discriminate H.
qed.
theorem not_eq_pos_neg :\forall n,m:nat. pos n \neq neg m.
-simplify.intros (n m H).
+unfold Not.intros (n m H).
discriminate H.
qed.
theorem decidable_eq_Z : \forall x,y:Z. decidable (x=y).
-intros.simplify.
+intros.unfold decidable.
elim x.
(* goal: x=OZ *)
elim y.
(* goal: x=pos *)
elim y.
(* goal: x=pos y=OZ *)
- right.intro.
+ right.unfold Not.intro.
apply (not_eq_OZ_pos n). symmetry. assumption.
(* goal: x=pos y=pos *)
elim (decidable_eq_nat n n1:((n=n1) \lor ((n=n1) \to False))).
left.apply eq_f.assumption.
- right.intros (H_inj).apply H. injection H_inj. assumption.
+ right.unfold Not.intros (H_inj).apply H. injection H_inj. assumption.
(* goal: x=pos y=neg *)
- right.intro.apply (not_eq_pos_neg n n1). assumption.
+ right.unfold Not.intro.apply (not_eq_pos_neg n n1). assumption.
(* goal: x=neg *)
elim y.
(* goal: x=neg y=OZ *)
- right.intro.
+ right.unfold Not.intro.
apply (not_eq_OZ_neg n). symmetry. assumption.
(* goal: x=neg y=pos *)
- right. intro. apply (not_eq_pos_neg n1 n). symmetry. assumption.
+ right. unfold Not.intro. apply (not_eq_pos_neg n1 n). symmetry. assumption.
(* goal: x=neg y=neg *)
elim (decidable_eq_nat n n1:((n=n1) \lor ((n=n1) \to False))).
left.apply eq_f.assumption.
- right.intro.apply H.apply injective_neg.assumption.
+ right.unfold Not.intro.apply H.apply injective_neg.assumption.
qed.
(* end discrimination *)
qed.
theorem not_eq_true_false : true \neq false.
-simplify.intro.
+unfold Not.intro.
change with
match true with
[ true \Rightarrow False
[ generalize in match Hcut;
apply andb_elim;
elim (le s s1);
- [ change with (ordered A le (s1::l2) = true \to ordered A le (s1::l2) = true).
+ [ simplify;
+ fold simplify (ordered ? le (s1::l2));
intros; assumption;
| simplify;
intros (Habsurd);
ordered A le l = true \to ordered A le (insert A le x l) = true.
intros 5 (A le H l x).
elim l;
- [ 2: change with (ordered A le (match le x s with
- [ true ⇒ x::(s::l1) | false ⇒ s::(insert A le x l1) ]) = true).
+ [ 2: simplify;
apply (bool_elim ? (le x s));
[ intros;
- change with ((le x s \land ordered A le (s::l1)) = true);
+ simplify;
+ fold simplify (ordered ? le (s::l1));
apply andb_elim;
rewrite > H3;
assumption;
[ simplify;
rewrite > (H x a H2);
reflexivity;
- | change with ((ordered A le (a::match le x s with
- [ true ⇒ x::s::l2 | false ⇒ s::(insert A le x l2) ])) = true).
+ | simplify in \vdash (? ? (? ? ? %) ?);
apply (bool_elim ? (le x s));
[ intros;
- change with ((le a x \land (le x s \land ordered A le (s::l2))) = true).
+ simplify;
+ fold simplify (ordered A le (s::l2));
apply andb_elim;
rewrite > (H x a H3);
- change with ((le x s \land ordered A le (s::l2)) = true).
+ simplify;
+ fold simplify (ordered A le (s::l2));
apply andb_elim;
rewrite > H4;
apply (ordered_injective A le (a::s::l2));
assumption;
| intros;
- change with ((le a s \land ordered A le (s::(insert A le x l2))) = true);
+ simplify;
+ fold simplify (ordered A le (s::(insert A le x l2)));
apply andb_elim;
- change in H2 with ((le a s \land ordered A le (s::l2)) = true);
+ simplify in H2;
+ fold simplify (ordered A le (s::l2)) in H2;
generalize in match H2;
apply (andb_elim (le a s));
elim (le a s);
qed.
theorem symmetric_eq: \forall A:Type. symmetric A (eq A).
-simplify.intros.elim H. apply refl_eq.
+unfold symmetric.intros.elim H. apply refl_eq.
qed.
theorem sym_eq : \forall A:Type.\forall x,y:A. x=y \to y=x
\def symmetric_eq.
theorem transitive_eq : \forall A:Type. transitive A (eq A).
-simplify.intros.elim H1.assumption.
+unfold transitive.intros.elim H1.assumption.
qed.
theorem trans_eq : \forall A:Type.\forall x,y,z:A. x=y \to y=z \to x=z
apply lt_to_le.
change with (O + a2*m < a1*n).
apply lt_minus_to_plus.
-rewrite > H5.simplify.apply le_n.
+rewrite > H5.unfold lt.apply le_n.
assumption.
(* congruent to b *)
cut (a2*m = a1*n - (S O)).
apply lt_to_le.
change with (O + a2*m < a1*n).
apply lt_minus_to_plus.
-rewrite > H5.simplify.apply le_n.
+rewrite > H5.unfold lt.apply le_n.
assumption.
(* and now the symmetric case; the price to pay for working
in nat instead than Z *)
apply lt_to_le.
change with (O + a1*n < a2*m).
apply lt_minus_to_plus.
-rewrite > H5.simplify.apply le_n.
+rewrite > H5.unfold lt.apply le_n.
assumption.
(* congruent to a *)
cut (a2*m = a1*n + (S O)).
apply lt_to_le.
change with (O + a1*n < a2*m).
apply lt_minus_to_plus.
-rewrite > H5.simplify.apply le_n.
+rewrite > H5.unfold lt.apply le_n.
assumption.
(* proof of the cut *)
rewrite < H2.
simplify.reflexivity.
simplify.apply not_eq_O_S.
intro.
-simplify.
+simplify.unfold Not.
intro. apply (not_eq_O_S n1).apply sym_eq.assumption.
intros.simplify.
generalize in match H.
elim ((eqb n1 m1)).
simplify.apply eq_f.apply H1.
-simplify.intro.apply H1.apply inj_S.assumption.
+simplify.unfold Not.intro.apply H1.apply inj_S.assumption.
qed.
theorem eqb_elim : \forall n,m:nat.\forall P:bool \to Prop.
simplify.exact not_le_Sn_O.
intros 2.simplify.elim ((leb n1 m1)).
simplify.apply le_S_S.apply H.
-simplify.intros.apply H.apply le_S_S_to_le.assumption.
+simplify.unfold Not.intros.apply H.apply le_S_S_to_le.assumption.
qed.
theorem leb_elim: \forall n,m:nat. \forall P:bool \to Prop.
| EQ \Rightarrow n=m
| GT \Rightarrow m < n ])).
intro.elim n1.simplify.reflexivity.
-simplify.apply le_S_S.apply le_O_n.
-intro.simplify.apply le_S_S. apply le_O_n.
+simplify.unfold lt.apply le_S_S.apply le_O_n.
+intro.simplify.unfold lt.apply le_S_S. apply le_O_n.
intros 2.simplify.elim ((nat_compare n1 m1)).
-simplify. apply le_S_S.apply H.
+simplify. unfold lt. apply le_S_S.apply H.
simplify. apply eq_f. apply H.
-simplify. apply le_S_S.apply H.
+simplify. unfold lt.apply le_S_S.apply H.
qed.
theorem nat_compare_n_m_m_n: \forall n,m:nat.
rewrite < H.
rewrite > (S_pred ((S n1)*(S m))).
apply sigma_plus1.
-simplify.apply le_S_S.apply le_O_n.
+simplify.unfold lt.apply le_S_S.apply le_O_n.
qed.
theorem eq_sigma_sigma1 : \forall n,m:nat.\forall f:nat \to nat.
((i1*(S n) + i) \mod (S n)) i1 i).
rewrite > H3.
apply bool_to_nat_andb.
-simplify.apply le_S_S.assumption.
-simplify.apply le_S_S.assumption.
+unfold lt.apply le_S_S.assumption.
+unfold lt.apply le_S_S.assumption.
apply div_mod_spec_div_mod.
-simplify.apply le_S_S.apply le_O_n.
-constructor 1.simplify.apply le_S_S.assumption.
+unfold lt.apply le_S_S.apply le_O_n.
+constructor 1.unfold lt.apply le_S_S.assumption.
reflexivity.
apply div_mod_spec_div_mod.
-simplify.apply le_S_S.apply le_O_n.
-constructor 1.simplify.apply le_S_S.assumption.
+unfold lt.apply le_S_S.apply le_O_n.
+constructor 1.unfold lt.apply le_S_S.assumption.
reflexivity.
apply (trans_eq ? ?
(sigma n (\lambda n.((bool_to_nat (f1 n)) *
change with ((g (i/(S n)) (i \mod (S n))) \lt (S n)*(S m)).
apply H.
apply lt_mod_m_m.
-simplify. apply le_S_S.apply le_O_n.
+unfold lt. apply le_S_S.apply le_O_n.
apply (lt_times_to_lt_l n).
apply (le_to_lt_to_lt ? i).
rewrite > (div_mod i (S n)) in \vdash (? ? %).
rewrite > sym_plus.
apply le_plus_n.
-simplify. apply le_S_S.apply le_O_n.
+unfold lt. apply le_S_S.apply le_O_n.
unfold lt.
rewrite > S_pred in \vdash (? ? %).
apply le_S_S.
rewrite > sym_times. assumption.
rewrite > (times_n_O O).
apply lt_times.
-simplify. apply le_S_S.apply le_O_n.
-simplify. apply le_S_S.apply le_O_n.
+unfold lt. apply le_S_S.apply le_O_n.
+unfold lt. apply le_S_S.apply le_O_n.
rewrite > (times_n_O O).
apply lt_times.
-simplify. apply le_S_S.apply le_O_n.
-simplify. apply le_S_S.apply le_O_n.
+unfold lt. apply le_S_S.apply le_O_n.
+unfold lt. apply le_S_S.apply le_O_n.
rewrite < plus_n_O.
unfold injn.
intros.
rewrite < (H1 (j \mod (S n)) (j/(S n)) Hcut4 Hcut5).
rewrite < (H2 (j \mod (S n)) (j/(S n)) Hcut4 Hcut5) in \vdash (? ? ? (? % ?)).
rewrite > H6.reflexivity.
-simplify. apply le_S_S.apply le_O_n.
-simplify. apply le_S_S.apply le_O_n.
+unfold lt. apply le_S_S.apply le_O_n.
+unfold lt. apply le_S_S.apply le_O_n.
apply (lt_times_to_lt_l n).
apply (le_to_lt_to_lt ? j).
rewrite > (div_mod j (S n)) in \vdash (? ? %).
rewrite > sym_plus.
apply le_plus_n.
-simplify. apply le_S_S.apply le_O_n.
+unfold lt. apply le_S_S.apply le_O_n.
rewrite < sym_times. assumption.
apply lt_mod_m_m.
-simplify. apply le_S_S.apply le_O_n.
+unfold lt. apply le_S_S.apply le_O_n.
apply (lt_times_to_lt_l n).
apply (le_to_lt_to_lt ? i).
rewrite > (div_mod i (S n)) in \vdash (? ? %).
rewrite > sym_plus.
apply le_plus_n.
-simplify. apply le_S_S.apply le_O_n.
+unfold lt. apply le_S_S.apply le_O_n.
rewrite < sym_times. assumption.
apply lt_mod_m_m.
-simplify. apply le_S_S.apply le_O_n.
+unfold lt. apply le_S_S.apply le_O_n.
unfold lt.
rewrite > S_pred in \vdash (? ? %).
apply le_S_S.assumption.
rewrite > (times_n_O O).
apply lt_times.
-simplify. apply le_S_S.apply le_O_n.
-simplify. apply le_S_S.apply le_O_n.
+unfold lt. apply le_S_S.apply le_O_n.
+unfold lt. apply le_S_S.apply le_O_n.
unfold lt.
rewrite > S_pred in \vdash (? ? %).
apply le_S_S.assumption.
rewrite > (times_n_O O).
apply lt_times.
-simplify. apply le_S_S.apply le_O_n.
-simplify. apply le_S_S.apply le_O_n.
+unfold lt. apply le_S_S.apply le_O_n.
+unfold lt. apply le_S_S.apply le_O_n.
intros.
apply False_ind.
apply (not_le_Sn_O m1 H4).
theorem lt_mod_m_m: \forall n,m. O < m \to (n \mod m) < m.
intros 2.elim m.apply False_ind.
apply (not_le_Sn_O O H).
-simplify.apply le_S_S.apply le_mod_aux_m_m.
+simplify.unfold lt.apply le_S_S.apply le_mod_aux_m_m.
apply le_n.
qed.
*)
theorem div_mod_spec_to_not_eq_O: \forall n,m,q,r.(div_mod_spec n m q r) \to m \neq O.
-intros 4.simplify.intros.elim H.absurd (le (S r) O).
+intros 4.unfold Not.intros.elim H.absurd (le (S r) O).
rewrite < H1.assumption.
exact (not_le_Sn_O r).
qed.
theorem div_mod_spec_times : \forall n,m:nat.div_mod_spec ((S n)*m) (S n) m O.
intros.constructor 1.
-simplify.apply le_S_S.apply le_O_n.
+unfold lt.apply le_S_S.apply le_O_n.
rewrite < plus_n_O.rewrite < sym_times.reflexivity.
qed.
apply (div_mod_spec_to_eq ((S n)*m) (S n) ? ? ? O).
goal 15. (* ?11 is closed with the following tactics *)
apply div_mod_spec_div_mod.
-simplify.apply le_S_S.apply le_O_n.
+unfold lt.apply le_S_S.apply le_O_n.
apply div_mod_spec_times.
qed.
qed.
theorem lt_O_exp: \forall n,m:nat. O < n \to O < n \sup m.
-intros.elim m.simplify.apply le_n.
-simplify.rewrite > times_n_SO.
+intros.elim m.simplify.unfold lt.apply le_n.
+simplify.unfold lt.rewrite > times_n_SO.
apply le_times.assumption.assumption.
qed.
theorem lt_m_exp_nm: \forall n,m:nat. (S O) < n \to m < n \sup m.
-intros.elim m.simplify.reflexivity.
-simplify.
+intros.elim m.simplify.unfold lt.reflexivity.
+simplify.unfold lt.
apply (trans_le ? ((S(S O))*(S n1))).
simplify.
rewrite < plus_n_Sm.apply le_S_S.apply le_S_S.
apply H1.
(* esprimere inj_times senza S *)
cut (\forall a,b:nat.O < n \to n*a=n*b \to a=b).
-apply Hcut.simplify. apply le_S_S_to_le. apply le_S. assumption.
+apply Hcut.simplify.unfold lt.apply le_S_S_to_le. apply le_S. assumption.
assumption.
intros 2.
apply (nat_case n).
intros.change with ((S m) < (S m)*m!).
apply (lt_to_le_to_lt ? ((S m)*(S (S O)))).
rewrite < sym_times.
-simplify.
+simplify.unfold lt.
apply le_S_S.rewrite < plus_n_O.
apply le_plus_n.
apply le_times_r.apply le_SSO_fact.
-simplify.apply le_S_S_to_le.exact H.
+simplify.unfold lt.apply le_S_S_to_le.exact H.
qed.
rewrite > H1.
change with (divides_b (smallest_factor n) n = true).
apply divides_to_divides_b_true.
-apply (trans_lt ? (S O)).simplify. apply le_n.
+apply (trans_lt ? (S O)).unfold lt. apply le_n.
apply lt_SO_smallest_factor.assumption.
apply divides_smallest_factor_n.
-apply (trans_lt ? (S O)). simplify. apply le_n. assumption.
+apply (trans_lt ? (S O)). unfold lt. apply le_n. assumption.
apply prime_to_nth_prime.
apply prime_smallest_factor_n.assumption.
qed.
theorem lt_O_defactorize_aux: \forall f:nat_fact.\forall i:nat.
O < defactorize_aux f i.
-intro.elim f.simplify.
+intro.elim f.simplify.unfold lt.
rewrite > times_n_SO.
apply le_times.
change with (O < nth_prime i).
change with (O < exp (nth_prime i) n).
apply lt_O_exp.
apply lt_O_nth_prime_n.
-simplify.
+simplify.unfold lt.
rewrite > times_n_SO.
apply le_times.
change with (O < exp (nth_prime i) n).
theorem lt_SO_defactorize_aux: \forall f:nat_fact.\forall i:nat.
S O < defactorize_aux f i.
-intro.elim f.simplify.
+intro.elim f.simplify.unfold lt.
rewrite > times_n_SO.
apply le_times.
change with (S O < nth_prime i).
change with (O < exp (nth_prime i) n).
apply lt_O_exp.
apply lt_O_nth_prime_n.
-simplify.
+simplify.unfold lt.
rewrite > times_n_SO.
rewrite > sym_times.
apply le_times.
cut (O < r \lor O = r).
elim Hcut1.assumption.absurd (n1 = O).
rewrite > Hcut.rewrite < H4.reflexivity.
-simplify. intro.apply (not_le_Sn_O O).
+unfold Not. intro.apply (not_le_Sn_O O).
rewrite < H5 in \vdash (? ? %).assumption.
apply le_to_or_lt_eq.apply le_O_n.
cut ((S O) < r \lor (S O) \nlt r).
apply (nat_case n).
left.split.assumption.reflexivity.
intro.right.rewrite > Hcut2.
-simplify.apply le_S_S.apply le_O_n.
+simplify.unfold lt.apply le_S_S.apply le_O_n.
cut (r \lt (S O) \or r=(S O)).
elim Hcut2.absurd (O=r).
apply le_n_O_to_eq.apply le_S_S_to_le.exact H5.
-simplify.intro.
+unfold Not.intro.
cut (O=n1).
apply (not_le_Sn_O O).
rewrite > Hcut3 in \vdash (? ? %).
elim Hcut2.assumption.
absurd (nth_prime p \divides S (S m1)).
apply (divides_max_prime_factor_n (S (S m1))).
-simplify.apply le_S_S.apply le_S_S. apply le_O_n.
+unfold lt.apply le_S_S.apply le_S_S. apply le_O_n.
cut ((S(S m1)) = r).
rewrite > Hcut3 in \vdash (? (? ? %)).
change with (nth_prime p \divides r \to False).
intro.
apply (p_ord_aux_to_not_mod_O (S(S m1)) (S(S m1)) (nth_prime p) q r).
apply lt_SO_nth_prime_n.
-simplify.apply le_S_S.apply le_O_n.apply le_n.
+unfold lt.apply le_S_S.apply le_O_n.apply le_n.
assumption.
apply divides_to_mod_O.apply lt_O_nth_prime_n.assumption.
rewrite > times_n_SO in \vdash (? ? ? %).
elim Hcut2.
right.
apply (p_ord_to_lt_max_prime_factor1 (S(S m1)) ? q r).
-simplify.apply le_S_S. apply le_O_n.
+unfold lt.apply le_S_S. apply le_O_n.
apply le_n.
assumption.assumption.
cut (r=(S O)).
apply (nat_case p).
left.split.assumption.reflexivity.
intro.right.rewrite > Hcut3.
-simplify.apply le_S_S.apply le_O_n.
+simplify.unfold lt.apply le_S_S.apply le_O_n.
cut (r \lt (S O) \or r=(S O)).
elim Hcut3.absurd (O=r).
apply le_n_O_to_eq.apply le_S_S_to_le.exact H2.
-simplify.intro.
+unfold Not.intro.
apply (not_le_Sn_O O).
rewrite > H3 in \vdash (? ? %).assumption.assumption.
apply (le_to_or_lt_eq r (S O)).
\forall p,q,m:nat. prime p \to prime q \to
p \divides q \sup m \to p = q.
intros.
-simplify in H1.
+unfold prime in H1.
elim H1.apply H4.
apply (divides_exp_to_divides p q m).
assumption.assumption.
-simplify in H.elim H.assumption.
+unfold prime in H.elim H.assumption.
qed.
theorem not_divides_defactorize_aux: \forall f:nat_fact. \forall i,j:nat.
apply (not_le_Sn_n i).rewrite > Hcut1 in \vdash (? ? %).assumption.
apply (injective_nth_prime ? ? H4).
apply (H i (S j)).
-apply (trans_lt ? j).assumption.simplify.apply le_n.
+apply (trans_lt ? j).assumption.unfold lt.apply le_n.
assumption.
apply divides_times_to_divides.
apply prime_nth_prime.assumption.
lemma not_eq_nf_cons_O_nf_cons: \forall f,g:nat_fact.\forall n,i:nat.
\lnot (defactorize_aux (nf_cons O f) i= defactorize_aux (nf_cons (S n) g) i).
intros.
-simplify.rewrite < plus_n_O.
+simplify.unfold Not.rewrite < plus_n_O.
intro.
apply (not_divides_defactorize_aux f i (S i) ?).
-simplify.apply le_n.
+unfold lt.apply le_n.
rewrite > H.
rewrite > assoc_times.
apply (witness ? ? ((exp (nth_prime i) n)*(defactorize_aux g (S i)))).
apply le_S_S_to_le.
change with ((S i) \mod (S n) < S n).
apply lt_mod_m_m.
-simplify.apply le_S_S.apply le_O_n.
+unfold lt.apply le_S_S.apply le_O_n.
unfold injn.intros.
apply inj_S.
rewrite < (lt_to_eq_mod i (S n)).
(* i < n, j< n *)
rewrite < mod_S.
rewrite < mod_S.
-apply H2.simplify.apply le_S_S.apply le_O_n.
+apply H2.unfold lt.apply le_S_S.apply le_O_n.
rewrite > lt_to_eq_mod.
-simplify.apply le_S_S.assumption.
-simplify.apply le_S_S.assumption.
-simplify.apply le_S_S.apply le_O_n.
+unfold lt.apply le_S_S.assumption.
+unfold lt.apply le_S_S.assumption.
+unfold lt.apply le_S_S.apply le_O_n.
rewrite > lt_to_eq_mod.
-simplify.apply le_S_S.assumption.
-simplify.apply le_S_S.assumption.
+unfold lt.apply le_S_S.assumption.
+unfold lt.apply le_S_S.assumption.
(* i < n, j=n *)
unfold S_mod in H2.
simplify.
rewrite < (mod_n_n (S n)).
rewrite < H4 in \vdash (? ? ? (? %?)).
rewrite < mod_S.assumption.
-simplify.apply le_S_S.apply le_O_n.
+unfold lt.apply le_S_S.apply le_O_n.
rewrite > lt_to_eq_mod.
-simplify.apply le_S_S.assumption.
-simplify.apply le_S_S.assumption.
-simplify.apply le_S_S.apply le_O_n.
+unfold lt.apply le_S_S.assumption.
+unfold lt.apply le_S_S.assumption.
+unfold lt.apply le_S_S.apply le_O_n.
(* i = n, j < n *)
elim Hcut1.
apply False_ind.
rewrite < (mod_n_n (S n)).
rewrite < H3 in \vdash (? ? (? %?) ?).
rewrite < mod_S.assumption.
-simplify.apply le_S_S.apply le_O_n.
+unfold lt.apply le_S_S.apply le_O_n.
rewrite > lt_to_eq_mod.
-simplify.apply le_S_S.assumption.
-simplify.apply le_S_S.assumption.
-simplify.apply le_S_S.apply le_O_n.
+unfold lt.apply le_S_S.assumption.
+unfold lt.apply le_S_S.assumption.
+unfold lt.apply le_S_S.apply le_O_n.
(* i = n, j= n*)
rewrite > H3.
rewrite > H4.
reflexivity.
apply le_to_or_lt_eq.assumption.
apply le_to_or_lt_eq.assumption.
-simplify.apply le_S_S.assumption.
-simplify.apply le_S_S.assumption.
+unfold lt.apply le_S_S.assumption.
+unfold lt.apply le_S_S.assumption.
qed.
(*
theorem prime_to_not_divides_fact: \forall p:nat. prime p \to \forall n:nat.
n \lt p \to \not divides p n!.
-intros 3.elim n.simplify.intros.
+intros 3.elim n.unfold Not.intros.
apply (lt_to_not_le (S O) p).
unfold prime in H.elim H.
-assumption.apply divides_to_le.simplify.apply le_n.
+assumption.apply divides_to_le.unfold lt.apply le_n.
assumption.
change with (divides p ((S n1)*n1!) \to False).
intro.
cut (divides p (S n1) \lor divides p n1!).
elim Hcut.apply (lt_to_not_le (S n1) p).
assumption.
-apply divides_to_le.simplify.apply le_S_S.apply le_O_n.
+apply divides_to_le.unfold lt.apply le_S_S.apply le_O_n.
assumption.apply H1.
-apply (trans_lt ? (S n1)).simplify. apply le_n.
+apply (trans_lt ? (S n1)).unfold lt. apply le_n.
assumption.assumption.
apply divides_times_to_divides.
assumption.assumption.
apply (trans_le ? p).
change with (mod (a*i) p < p).
apply lt_mod_m_m.
-simplify in H.elim H.
-simplify.apply (trans_le ? (S (S O))).
+unfold prime in H.elim H.
+unfold lt.apply (trans_le ? (S (S O))).
apply le_n_Sn.assumption.
rewrite < S_pred.apply le_n.
unfold prime in H.
elim H.
-apply (trans_lt ? (S O)).simplify.apply le_n.assumption.
+apply (trans_lt ? (S O)).unfold lt.apply le_n.assumption.
unfold injn.intros.
apply (nat_compare_elim i j).
(* i < j *)
intro.
absurd (j-i \lt p).
-simplify.
+unfold lt.
rewrite > (S_pred p).
apply le_S_S.
apply le_plus_to_minus.
apply le_plus_n.
unfold prime in H.
elim H.
-apply (trans_lt ? (S O)).simplify.apply le_n.assumption.
+apply (trans_lt ? (S O)).unfold lt.apply le_n.assumption.
apply (le_to_not_lt p (j-i)).
-apply divides_to_le.simplify.
+apply divides_to_le.unfold lt.
apply le_SO_minus.assumption.
cut (divides p a \lor divides p (j-i)).
elim Hcut.apply False_ind.apply H1.assumption.assumption.
apply eq_mod_to_divides.
unfold prime in H.
elim H.
-apply (trans_lt ? (S O)).simplify.apply le_n.assumption.
+apply (trans_lt ? (S O)).unfold lt.apply le_n.assumption.
apply sym_eq.
apply H4.
(* i = j *)
(* j < i *)
intro.
absurd (i-j \lt p).
-simplify.
+unfold lt.
rewrite > (S_pred p).
apply le_S_S.
apply le_plus_to_minus.
apply le_plus_n.
unfold prime in H.
elim H.
-apply (trans_lt ? (S O)).simplify.apply le_n.assumption.
+apply (trans_lt ? (S O)).unfold lt.apply le_n.assumption.
apply (le_to_not_lt p (i-j)).
-apply divides_to_le.simplify.
+apply divides_to_le.unfold lt.
apply le_SO_minus.assumption.
cut (divides p a \lor divides p (i-j)).
elim Hcut.apply False_ind.apply H1.assumption.assumption.
apply eq_mod_to_divides.
unfold prime in H.
elim H.
-apply (trans_lt ? (S O)).simplify.apply le_n.assumption.
+apply (trans_lt ? (S O)).unfold lt.apply le_n.assumption.
apply H4.
qed.
apply le_S_S_to_le.rewrite < S_pred.
unfold prime in H.elim H.assumption.assumption.
unfold prime in H.elim H.apply (trans_lt ? (S O)).
-simplify.apply le_n.assumption.
+unfold lt.apply le_n.assumption.
cut (O < a \lor O = a).
elim Hcut.assumption.
apply False_ind.apply H1.
\land
gcd_aux (S m1) m (S m1) \divides (S m1)).
apply divides_gcd_aux_mn.
-simplify.apply le_S_S.apply le_O_n.
+unfold lt.apply le_S_S.apply le_O_n.
assumption.apply le_n.
simplify.intro.
apply (nat_case1 m).
gcd_aux (S m1) n (S m1) \divides S m1).
elim Hcut.split.assumption.assumption.
apply divides_gcd_aux_mn.
-simplify.apply le_S_S.apply le_O_n.
-apply not_lt_to_le.simplify.intro.apply H.
+unfold lt.apply le_S_S.apply le_O_n.
+apply not_lt_to_le.unfold Not. unfold lt.intro.apply H.
rewrite > H1.apply (trans_le ? (S n)).
apply le_n_Sn.assumption.apply le_n.
qed.
intros.
change with (d \divides gcd_aux (S m1) m (S m1)).
apply divides_gcd_aux.
-simplify.apply le_S_S.apply le_O_n.assumption.apply le_n.assumption.
+unfold lt.apply le_S_S.apply le_O_n.assumption.apply le_n.assumption.
rewrite < H2.assumption.
apply (nat_case1 m).simplify.intros.assumption.
intros.
change with (d \divides gcd_aux (S m1) n (S m1)).
apply divides_gcd_aux.
-simplify.apply le_S_S.apply le_O_n.
+unfold lt.apply le_S_S.apply le_O_n.
apply lt_to_le.apply not_le_to_lt.assumption.apply le_n.assumption.
rewrite < H2.assumption.
qed.
a*(S m1) - b*m = (gcd_aux (S m1) m (S m1))
\lor b*m - a*(S m1) = (gcd_aux (S m1) m (S m1))).
apply eq_minus_gcd_aux.
-simplify. apply le_S_S.apply le_O_n.
+unfold lt. apply le_S_S.apply le_O_n.
assumption.apply le_n.
apply (nat_case1 m).
simplify.intros.
apply (ex_intro ? ? a).
left.assumption.
apply eq_minus_gcd_aux.
-simplify. apply le_S_S.apply le_O_n.
+unfold lt. apply le_S_S.apply le_O_n.
apply lt_to_le.apply not_le_to_lt.assumption.
apply le_n.
qed.
generalize in match (gcd_O_to_eq_O m n H1).
intros.elim H2.
rewrite < H4 in \vdash (? ? %).assumption.
-intros.simplify.apply le_S_S.apply le_O_n.
+intros.unfold lt.apply le_S_S.apply le_O_n.
qed.
theorem symmetric_gcd: symmetric nat gcd.
apply divides_to_le.
apply lt_O_gcd.
rewrite > (times_n_O O).
-apply lt_times.simplify.apply le_S_S.apply le_O_n.assumption.
+apply lt_times.unfold lt.apply le_S_S.apply le_O_n.assumption.
apply divides_d_gcd.
apply (transitive_divides ? (S m1)).
apply divides_gcd_m.
theorem gcd_SO_n: \forall n:nat. gcd (S O) n = (S O).
intro.
-apply antisym_le.apply divides_to_le.simplify.apply le_n.
+apply antisym_le.apply divides_to_le.unfold lt.apply le_n.
apply divides_gcd_n.
cut (O < gcd (S O) n \lor O = gcd (S O) n).
elim Hcut.assumption.
theorem prime_to_gcd_SO: \forall n,m:nat. prime n \to n \ndivides m \to
gcd n m = (S O).
-intros.simplify in H.change with (gcd n m = (S O)).
+intros.unfold prime in H.change with (gcd n m = (S O)).
elim H.
apply antisym_le.
apply not_lt_to_le.
apply eq_minus_gcd.
assumption.assumption.
apply (decidable_divides n p).
-apply (trans_lt ? (S O)).simplify.apply le_n.
-simplify in H.elim H. assumption.
+apply (trans_lt ? (S O)).unfold lt.apply le_n.
+unfold prime in H.elim H. assumption.
qed.
theorem eq_gcd_times_SO: \forall m,n,p:nat. O < n \to O < p \to
apply (lt_to_le_to_lt ? (smallest_factor (gcd m (n*p)))).
apply lt_SO_smallest_factor.assumption.
apply divides_to_le.
-rewrite > H2.simplify.apply le_n.
+rewrite > H2.unfold lt.apply le_n.
apply divides_d_gcd.assumption.
apply (transitive_divides ? (gcd m (n*p))).
apply divides_smallest_factor_n.
-apply (trans_lt ? (S O)). simplify. apply le_n. assumption.
+apply (trans_lt ? (S O)). unfold lt. apply le_n. assumption.
apply divides_gcd_n.
apply (not_le_Sn_n (S O)).
change with ((S O) < (S O)).
apply (lt_to_le_to_lt ? (smallest_factor (gcd m (n*p)))).
apply lt_SO_smallest_factor.assumption.
apply divides_to_le.
-rewrite > H3.simplify.apply le_n.
+rewrite > H3.unfold lt.apply le_n.
apply divides_d_gcd.assumption.
apply (transitive_divides ? (gcd m (n*p))).
apply divides_smallest_factor_n.
-apply (trans_lt ? (S O)). simplify. apply le_n. assumption.
+apply (trans_lt ? (S O)). unfold lt. apply le_n. assumption.
apply divides_gcd_n.
apply divides_times_to_divides.
apply prime_smallest_factor_n.
assumption.
apply (transitive_divides ? (gcd m (n*p))).
apply divides_smallest_factor_n.
-apply (trans_lt ? (S O)). simplify. apply le_n. assumption.
+apply (trans_lt ? (S O)).unfold lt. apply le_n. assumption.
apply divides_gcd_m.
change with (O < gcd m (n*p)).
apply lt_O_gcd.
\forall n:nat.monotonic nat lt (\lambda m.n+m).
simplify.intros.
elim n.simplify.assumption.
-simplify.
+simplify.unfold lt.
apply le_S_S.assumption.
qed.
rewrite > plus_n_O.
rewrite > (plus_n_O q).assumption.
apply H.
-simplify.apply le_S_S_to_le.
+unfold lt.apply le_S_S_to_le.
rewrite > plus_n_Sm.
rewrite > (plus_n_Sm q).
exact H1.
(* times and zero *)
theorem lt_O_times_S_S: \forall n,m:nat.O < (S n)*(S m).
-intros.simplify.apply le_S_S.apply le_O_n.
+intros.simplify.unfold lt.apply le_S_S.apply le_O_n.
qed.
(* times *)
rewrite < div_mod.
rewrite > H2.
assumption.
-simplify.apply le_S_S.apply le_O_n.
+unfold lt.apply le_S_S.apply le_O_n.
qed.
theorem lt_div_n_m_n: \forall n,m:nat. (S O) < m \to O < n \to n / m \lt n.
apply (lt_to_le_to_lt ? ((n / m)*(S (S O)))).
rewrite < sym_times.
rewrite > H2.
-simplify.
+simplify.unfold lt.
rewrite < plus_n_O.
rewrite < plus_n_Sm.
apply le_S_S.
rewrite < sym_plus.
apply le_plus_n.
apply (trans_lt ? (S O)).
-simplify. apply le_n.assumption.
+unfold lt. apply le_n.assumption.
qed.
(* general properties of functions *)
theorem monotonic_to_injective: \forall f:nat\to nat.
monotonic nat lt f \to injective nat nat f.
-simplify.intros.
+unfold injective.intros.
apply (nat_compare_elim x y).
intro.apply False_ind.apply (not_le_Sn_n (f x)).
rewrite > H1 in \vdash (? ? %).apply H.apply H2.
theorem lt_minus_m: \forall n,m:nat. O < n \to O < m \to n-m \lt n.
intros.apply (lt_O_n_elim n H).intro.
apply (lt_O_n_elim m H1).intro.
-simplify.apply le_S_S.apply le_minus_m.
+simplify.unfold lt.apply le_S_S.apply le_minus_m.
qed.
theorem minus_le_O_to_le: \forall n,m:nat. n-m \leq O \to n \leq m.
intros 3.apply (nat_elim2 (\lambda m,p.(lt n (p-m)) \to (lt (n+m) p))).
intro.rewrite < plus_n_O.rewrite < minus_n_O.intro.assumption.
simplify.intros.apply False_ind.apply (not_le_Sn_O n H).
-simplify.intros.
+simplify.intros.unfold lt.
apply le_S_S.
rewrite < plus_n_Sm.
apply H.apply H1.
qed.
theorem distributive_times_minus: distributive nat times minus.
-simplify.
+unfold distributive.
intros.
apply ((leb_elim z y)).
intro.cut (x*(y-z)+x*z = (x*y-x*z)+x*z).
qed.
theorem injective_S : injective nat nat S.
-simplify.
+unfold injective.
intros.
rewrite > pred_Sn.
rewrite > (pred_Sn y).
theorem not_eq_S : \forall n,m:nat.
\lnot n=m \to S n \neq S m.
-intros. simplify. intros.
+intros. unfold Not. intros.
apply H. apply injective_S. assumption.
qed.
| (S p) \Rightarrow True ].
theorem not_eq_O_S : \forall n:nat. O \neq S n.
-intros. simplify. intros.
+intros. unfold Not. intros.
cut (not_zero O).
exact Hcut.
rewrite > H.exact I.
qed.
theorem decidable_eq_nat : \forall n,m:nat.decidable (n=m).
-intros.simplify.
+intros.unfold decidable.
apply (nat_elim2 (\lambda n,m.(Or (n=m) ((n=m) \to False)))).
intro.elim n1.
left.reflexivity.
change with (smallest_factor (S n!) \le n \to False).intro.
apply (not_divides_S_fact n (smallest_factor(S n!))).
apply lt_SO_smallest_factor.
-simplify.apply le_S_S.apply le_SO_fact.
+unfold lt.apply le_S_S.apply le_SO_fact.
assumption.
apply divides_smallest_factor_n.
-simplify.apply le_S_S.apply le_O_n.
+unfold lt.apply le_S_S.apply le_O_n.
qed.
theorem ex_prime: \forall n. (S O) \le n \to \exists m.
apply prime_smallest_factor_n.
change with ((S(S O)) \le S (S n1)!).
apply le_S.apply le_SSO_fact.
-simplify.apply le_S_S.assumption.
+unfold lt.apply le_S_S.assumption.
qed.
let rec nth_prime n \def
qed.
theorem lt_SO_nth_prime_n : \forall n:nat. (S O) \lt nth_prime n.
-intros. elim n.simplify.apply le_n.
+intros. elim n.unfold lt.apply le_n.
apply (trans_lt ? (nth_prime n1)).
assumption.apply lt_nth_prime_n_nth_prime_Sn.
qed.
theorem lt_O_nth_prime_n : \forall n:nat. O \lt nth_prime n.
intros.apply (trans_lt O (S O)).
-simplify. apply le_n.apply lt_SO_nth_prime_n.
+unfold lt. apply le_n.apply lt_SO_nth_prime_n.
qed.
theorem ex_m_le_n_nth_prime_m:
apply (ex_intro nat ? a).assumption.
apply le_to_or_lt_eq.assumption.
apply ex_m_le_n_nth_prime_m.
-simplify.simplify in H.elim H.assumption.
+simplify.unfold prime in H.elim H.assumption.
qed.
elim (p_ord_aux n (n1 / m) m).
apply H5.assumption.
apply eq_mod_O_to_lt_O_div.
-apply (trans_lt ? (S O)).simplify.apply le_n.
+apply (trans_lt ? (S O)).unfold lt.apply le_n.
assumption.assumption.assumption.
apply le_S_S_to_le.
apply (trans_le ? n1).change with (n1 / m < n1).
intros.
change with (n1 \mod m \neq O).
rewrite > H4.
-(* Andrea: META NOT FOUND !!!
-rewrite > sym_eq. *)
-simplify.intro.
+unfold Not.intro.
apply (not_eq_O_S m1).
rewrite > H5.reflexivity.
qed.
(cic:/matita/logic/connectives/Not.con (cic:/matita/nat/orders/gt.con x y)).
theorem transitive_le : transitive nat le.
-simplify.intros.elim H1.
+unfold transitive.intros.elim H1.
assumption.
apply le_S.assumption.
qed.
\def transitive_le.
theorem transitive_lt: transitive nat lt.
-simplify.intros.elim H1.
+unfold transitive.unfold lt.intros.elim H1.
apply le_S. assumption.
apply le_S.assumption.
qed.
(* not le *)
theorem not_le_Sn_O: \forall n:nat. S n \nleq O.
-intros.simplify.intros.apply (leS_to_not_zero ? ? H).
+intros.unfold Not.simplify.intros.apply (leS_to_not_zero ? ? H).
qed.
theorem not_le_Sn_n: \forall n:nat. S n \nleq n.
-intros.elim n.apply not_le_Sn_O.simplify.intros.cut (S n1 \leq n1).
+intros.elim n.apply not_le_Sn_O.unfold Not.simplify.intros.cut (S n1 \leq n1).
apply H.assumption.
apply le_S_S_to_le.assumption.
qed.
n \leq m \to n < m \lor n = m.
intros.elim H.
right.reflexivity.
-left.simplify.apply le_S_S.assumption.
+left.unfold lt.apply le_S_S.assumption.
qed.
(* not eq *)
theorem lt_to_not_eq : \forall n,m:nat. n<m \to n \neq m.
-simplify.intros.cut ((le (S n) m) \to False).
+unfold Not.intros.cut ((le (S n) m) \to False).
apply Hcut.assumption.rewrite < H1.
apply not_le_Sn_n.
qed.
(* le vs. lt *)
theorem lt_to_le : \forall n,m:nat. n<m \to n \leq m.
-simplify.intros.elim H.
+simplify.intros.unfold lt in H.elim H.
apply le_S. apply le_n.
apply le_S. assumption.
qed.
intros 2.
apply (nat_elim2 (\lambda n,m.n \nleq m \to m<n)).
intros.apply (absurd (O \leq n1)).apply le_O_n.assumption.
-simplify.intros.apply le_S_S.apply le_O_n.
-simplify.intros.apply le_S_S.apply H.intros.apply H1.apply le_S_S.
+unfold Not.unfold lt.intros.apply le_S_S.apply le_O_n.
+unfold Not.unfold lt.intros.apply le_S_S.apply H.intros.apply H1.apply le_S_S.
assumption.
qed.
theorem lt_to_not_le: \forall n,m:nat. n<m \to m \nleq n.
-simplify.intros 3.elim H.
+unfold Not.unfold lt.intros 3.elim H.
apply (not_le_Sn_n n H1).
apply H2.apply lt_to_le. apply H3.
qed.
theorem le_to_not_lt: \forall n,m:nat. le n m \to Not (lt m n).
intros.
change with (Not (le (S m) n)).
-apply lt_to_not_le.simplify.
+apply lt_to_not_le.unfold lt.
apply le_S_S.assumption.
qed.
(* lt and le trans *)
theorem lt_to_le_to_lt: \forall n,m,p:nat. lt n m \to le m p \to lt n p.
intros.elim H1.
-assumption.simplify.apply le_S.assumption.
+assumption.unfold lt.apply le_S.assumption.
qed.
theorem le_to_lt_to_lt: \forall n,m,p:nat. le n m \to lt m p \to lt n p.
intros 4.elim H.
-assumption.apply H2.simplify.
+assumption.apply H2.unfold lt.
apply lt_to_le.assumption.
qed.
(* other abstract properties *)
theorem antisymmetric_le : antisymmetric nat le.
-simplify.intros 2.
+unfold antisymmetric.intros 2.
apply (nat_elim2 (\lambda n,m.(n \leq m \to m \leq n \to n=m))).
intros.apply le_n_O_to_eq.assumption.
intros.apply False_ind.apply (not_le_Sn_O ? H).
theorem decidable_le: \forall n,m:nat. decidable (n \leq m).
intros.
apply (nat_elim2 (\lambda n,m.decidable (n \leq m))).
-intros.simplify.left.apply le_O_n.
-intros.simplify.right.exact (not_le_Sn_O n1).
-intros 2.simplify.intro.elim H.
+intros.unfold decidable.left.apply le_O_n.
+intros.unfold decidable.right.exact (not_le_Sn_O n1).
+intros 2.unfold decidable.intro.elim H.
left.apply le_S_S.assumption.
-right.intro.apply H1.apply le_S_S_to_le.assumption.
+right.unfold Not.intro.apply H1.apply le_S_S_to_le.assumption.
qed.
theorem decidable_lt: \forall n,m:nat. decidable (n < m).
theorem increasing_to_monotonic: \forall f:nat \to nat.
increasing f \to monotonic nat lt f.
-simplify.intros.elim H1.apply H.
+unfold monotonic.unfold lt.unfold increasing.unfold lt.intros.elim H1.apply H.
apply (trans_le ? (f n1)).
assumption.apply (trans_le ? (S (f n1))).
apply le_n_Sn.
apply le_O_n.
apply (trans_le ? (S (f n1))).
apply le_S_S.apply H1.
-simplify in H. apply H.
+simplify in H. unfold increasing in H.unfold lt in H.apply H.
qed.
theorem increasing_to_le: \forall f:nat \to nat. (increasing f)
apply (ex_intro ? ? (S a)).
apply (trans_le ? (S (f a))).
apply le_S_S.assumption.
-simplify in H.
+simplify in H.unfold increasing in H.unfold lt in H.
apply H.
qed.
i \le n \to j \le n \to f i = f j \to i = j.
theorem injn_Sn_n: \forall f:nat \to nat. \forall n:nat.
-injn f (S n) \to injn f n.simplify.
+injn f (S n) \to injn f n.unfold injn.
intros.apply H.
apply le_S.assumption.
apply le_S.assumption.
theorem injective_to_injn: \forall f:nat \to nat. \forall n:nat.
injective nat nat f \to injn f n.
-simplify.intros.apply H.assumption.
+unfold injective.unfold injn.intros.apply H.assumption.
qed.
definition permut : (nat \to nat) \to nat \to Prop
rewrite > (not_eq_to_eqb_false k i).
rewrite > (eqb_n_n k).
simplify.reflexivity.
-simplify.intro.apply H1.apply sym_eq.assumption.
+unfold Not.intro.apply H1.apply sym_eq.assumption.
assumption.
-simplify.intro.apply H2.apply (trans_eq ? ? n).
+unfold Not.intro.apply H2.apply (trans_eq ? ? n).
apply sym_eq.assumption.assumption.
intro.apply (eqb_elim n k).intro.
simplify.
simplify.
rewrite > (eqb_n_n i).
simplify.assumption.
-simplify.intro.apply H.apply sym_eq.assumption.
+unfold Not.intro.apply H.apply sym_eq.assumption.
intro.simplify.
rewrite > (not_eq_to_eqb_false n k H5).
rewrite > (not_eq_to_eqb_false n j H4).
(f n)) m.
unfold permut.intros.
elim H.
-split.intros.simplify.
+split.intros.simplify.unfold transpose.
apply (eqb_elim (f i) (f (S m))).
intro.apply False_ind.
cut (i = (S m)).
theorem bijn_transpose : \forall n,i,j. i \le n \to j \le n \to
bijn (transpose i j) n.
-intros.simplify.intros.
+intros.unfold bijn.unfold transpose.intros.
cut (m = i \lor \lnot m = i).
elim Hcut.
apply (ex_intro ? ? j).
theorem permut_to_bijn: \forall n:nat.\forall f:nat\to nat.
permut f n \to bijn f n.
intro.
-elim n.simplify.intros.
+elim n.unfold bijn.intros.
apply (ex_intro ? ? m).
split.assumption.
apply (le_n_O_elim m ? (\lambda p. f p = p)).
apply bijn_n_Sn.
apply H.
apply permut_S_to_permut_transpose.
-assumption.simplify.
+assumption.unfold transpose.
rewrite > (eqb_n_n (f (S n1))).simplify.reflexivity.
qed.
rewrite > (not_eq_to_eqb_false (f m) (f (S n1))).
simplify.apply H2.
apply injn_Sn_n. assumption.
-simplify.intro.absurd (m = S n1).
+unfold Not.intro.absurd (m = S n1).
apply H3.apply le_S.assumption.apply le_n.assumption.
-simplify.intro.
+unfold Not.intro.
apply (not_le_Sn_n n1).rewrite < H5.assumption.
qed.
rewrite < (H1 (g (S m + n))).
apply eq_f.
apply eq_map_iter_i.
-intros.unfold transpose.
+intros.simplify.unfold transpose.
rewrite > (not_eq_to_eqb_false m1 (S m+n)).
rewrite > (not_eq_to_eqb_false m1 (S (S m)+n)).
simplify.
reflexivity.
-apply (lt_to_not_eq m1 (S (S m)+n)).
-simplify.apply le_S_S.apply le_S.assumption.
+apply (lt_to_not_eq m1 (S ((S m)+n))).
+unfold lt.apply le_S_S.change with (m1 \leq S (m+n)).apply le_S.assumption.
apply (lt_to_not_eq m1 (S m+n)).
-simplify.apply le_S_S.assumption.
+simplify.unfold lt.apply le_S_S.assumption.
qed.
theorem eq_map_iter_i_transpose_i_Si : \forall f:nat\to nat \to nat.associative nat f \to
rewrite > (not_eq_to_eqb_false (S (S n1)+n) i).
rewrite > (not_eq_to_eqb_false (S (S n1)+n) (S i)).
simplify.reflexivity.
-simplify.intro.
+simplify.unfold Not.intro.
apply (lt_to_not_eq i (S n1+n)).assumption.
apply inj_S.apply sym_eq. assumption.
-simplify.intro.
-apply (lt_to_not_eq i (S (S n1+n))).simplify.
+simplify.unfold Not.intro.
+apply (lt_to_not_eq i (S (S n1+n))).simplify.unfold lt.
apply le_S_S.assumption.
apply sym_eq. assumption.
apply H2.assumption.apply le_S_S_to_le.
intros.
apply (trans_eq ? ? (map_iter_i (S k) (\lambda m. g (transpose i (S(m1 + i)) m)) f n)).
apply H2.
-simplify. apply le_n.assumption.
+unfold lt. apply le_n.assumption.
apply (trans_le ? (S(S (m1+i)))).
apply le_S.apply le_n.assumption.
apply (trans_eq ? ? (map_iter_i (S k) (\lambda m. g
(transpose i (S(m1 + i)) (transpose (S(m1 + i)) (S(S(m1 + i))) m))) f n)).
apply (H2 O ? ? (S(m1+i))).
-simplify.apply le_S_S.apply le_O_n.
+unfold lt.apply le_S_S.apply le_O_n.
apply (trans_le ? i).assumption.
change with (i \le (S m1)+i).apply le_plus_n.
exact H4.
(transpose (S(m1 + i)) (S(S(m1 + i)))
(transpose i (S(m1 + i)) m)))) f n)).
apply (H2 m1).
-simplify. apply le_n.assumption.
+unfold lt. apply le_n.assumption.
apply (trans_le ? (S(S (m1+i)))).
apply le_S.apply le_n.assumption.
apply eq_map_iter_i.
intros.apply eq_f.
apply sym_eq. apply eq_transpose.
-simplify. intro.
+unfold Not. intro.
apply (not_le_Sn_n i).
rewrite < H7 in \vdash (? ? %).
apply le_S_S.apply le_S.
apply le_plus_n.
-simplify. intro.
+unfold Not. intro.
apply (not_le_Sn_n i).
rewrite > H7 in \vdash (? ? %).
apply le_S_S.
apply le_plus_n.
-simplify. intro.
+unfold Not. intro.
apply (not_eq_n_Sn (S m1+i)).
apply sym_eq.assumption.
qed.
simplify.apply H4.assumption.
rewrite > H4.
apply lt_to_not_eq.apply (trans_lt ? n1).assumption.
-simplify.apply le_S_S.apply le_plus_n.assumption.
+simplify.unfold lt.apply le_S_S.apply le_plus_n.assumption.
unfold permut in H3.elim H3.
-simplify.intro.
+simplify.unfold Not.intro.
apply (lt_to_not_eq m (S n+n1)).apply (trans_lt ? n1).assumption.
-simplify.apply le_S_S.apply le_plus_n.
+simplify.unfold lt.apply le_S_S.apply le_plus_n.
unfold injn in H7.
apply (H7 m (S n+n1)).apply (trans_le ? n1).
apply lt_to_le.assumption.apply le_plus_n.apply le_n.
qed.
theorem associative_plus : associative nat plus.
-simplify.intros.elim x.
+unfold associative.intros.elim x.
simplify.reflexivity.
simplify.apply eq_f.assumption.
qed.
(cic:/matita/logic/connectives/Not.con (cic:/matita/nat/primes/divides.ind#xpointer(1/1) n m)).
theorem reflexive_divides : reflexive nat divides.
-simplify.
+unfold reflexive.
intros.
exact (witness x x (S O) (times_n_SO x)).
qed.
qed.
theorem antisymmetric_divides: antisymmetric nat divides.
-simplify.intros.elim H. elim H1.
+unfold antisymmetric.intros.elim H. elim H1.
apply (nat_case1 n2).intro.
rewrite > H3.rewrite > H2.rewrite > H4.
rewrite < times_n_O.reflexivity.
| false \Rightarrow n \ndivides m].
apply eqb_elim.
intro.simplify.apply mod_O_to_divides.assumption.assumption.
-intro.simplify.intro.apply H1.apply divides_to_mod_O.assumption.assumption.
+intro.simplify.unfold Not.intro.apply H1.apply divides_to_mod_O.assumption.assumption.
qed.
theorem divides_b_true_to_divides :
(\forall m:nat. m \divides n \to (S O) < m \to m = n).
theorem not_prime_O: \lnot (prime O).
-simplify.intro.elim H.apply (not_le_Sn_O (S O) H1).
+unfold Not.unfold prime.intro.elim H.apply (not_le_Sn_O (S O) H1).
qed.
theorem not_prime_SO: \lnot (prime (S O)).
-simplify.intro.elim H.apply (not_le_Sn_n (S O) H1).
+unfold Not.unfold prime.intro.elim H.apply (not_le_Sn_n (S O) H1).
qed.
(* smallest factor *)
intro.
apply (nat_case n).intro.apply False_ind.apply (not_le_Sn_n O H).
intro.apply (nat_case m).intro.
-simplify.apply le_n.
+simplify.unfold lt.apply le_n.
intros.apply (trans_lt ? (S O)).
-simplify. apply le_n.
-apply lt_SO_smallest_factor.simplify. apply le_S_S.
+unfold lt.apply le_n.
+apply lt_SO_smallest_factor.unfold lt. apply le_S_S.
apply le_S_S.apply le_O_n.
qed.
split.split.
apply le_minus_m.apply le_n.
rewrite > mod_n_n.reflexivity.
-apply (trans_lt ? (S O)).apply (le_n (S O)).simplify.
+apply (trans_lt ? (S O)).apply (le_n (S O)).unfold lt.
apply le_S_S.apply le_S_S.apply le_O_n.
qed.
intro.apply (nat_case n).simplify.reflexivity.
intro.apply (nat_case m).simplify.reflexivity.
intro.apply divides_to_le.
-simplify.apply le_S_S.apply le_O_n.
+unfold lt.apply le_S_S.apply le_O_n.
apply divides_smallest_factor_n.
-simplify.apply le_S_S.apply le_O_n.
+unfold lt.apply le_S_S.apply le_O_n.
qed.
theorem lt_smallest_factor_to_not_divides: \forall n,i:nat.
apply (transitive_divides m (smallest_factor n)).
assumption.
apply divides_smallest_factor_n.
-apply (trans_lt ? (S O)). simplify. apply le_n. exact H.
+apply (trans_lt ? (S O)). unfold lt. apply le_n. exact H.
apply lt_smallest_factor_to_not_divides.
exact H.assumption.assumption.assumption.
apply divides_to_le.
smallest_factor (S(S m1)) = (S(S m1))).
intro.elim H.apply H2.
apply divides_smallest_factor_n.
-apply (trans_lt ? (S O)).simplify. apply le_n.assumption.
+apply (trans_lt ? (S O)).unfold lt. apply le_n.assumption.
apply lt_SO_smallest_factor.
assumption.
qed.
[ true \Rightarrow prime n
| false \Rightarrow \lnot (prime n)].
intro.
-apply (nat_case n).simplify.intro.elim H.apply (not_le_Sn_O (S O) H1).
-intro.apply (nat_case m).simplify.intro.elim H.apply (not_le_Sn_n (S O) H1).
+apply (nat_case n).simplify.unfold Not.unfold prime.intro.elim H.apply (not_le_Sn_O (S O) H1).
+intro.apply (nat_case m).simplify.unfold Not.unfold prime.intro.elim H.apply (not_le_Sn_n (S O) H1).
intro.
change with
match eqb (smallest_factor (S(S m1))) (S(S m1)) with
intro.change with (prime (S(S m1))).
rewrite < H.
apply prime_smallest_factor_n.
-simplify.apply le_S_S.apply le_S_S.apply le_O_n.
+unfold lt.apply le_S_S.apply le_S_S.apply le_O_n.
intro.change with (\lnot (prime (S(S m1)))).
change with (prime (S(S m1)) \to False).
intro.apply H.
qed.
theorem symmetric_times : symmetric nat times.
-simplify.
+unfold symmetric.
intros.elim x.
simplify.apply times_n_O.
simplify.rewrite > H.apply times_n_Sm.
symmetric_times.
theorem distributive_times_plus : distributive nat times plus.
-simplify.
+unfold distributive.
intros.elim x.
simplify.reflexivity.
simplify.rewrite > H. rewrite > assoc_plus.rewrite > assoc_plus.
\def distributive_times_plus.
theorem associative_times: associative nat times.
-simplify.intros.
+unfold associative.intros.
elim x.simplify.apply refl_eq.
simplify.rewrite < sym_times.
rewrite > distr_times_plus.
rewrite > sym_gcd.
rewrite > gcd_mod.
apply (gcd_times_SO_to_gcd_SO ? ? (S m2)).
-simplify.apply le_S_S.apply le_O_n.
-simplify.apply le_S_S.apply le_O_n.
+unfold lt.apply le_S_S.apply le_O_n.
+unfold lt.apply le_S_S.apply le_O_n.
assumption.
-simplify.apply le_S_S.apply le_O_n.
+unfold lt.apply le_S_S.apply le_O_n.
rewrite < H5.
rewrite > sym_gcd.
rewrite > gcd_mod.
apply (gcd_times_SO_to_gcd_SO ? ? (S m)).
-simplify.apply le_S_S.apply le_O_n.
-simplify.apply le_S_S.apply le_O_n.
+unfold lt.apply le_S_S.apply le_O_n.
+unfold lt.apply le_S_S.apply le_O_n.
rewrite > sym_times.
assumption.
-simplify.apply le_S_S.apply le_O_n.
+unfold lt.apply le_S_S.apply le_O_n.
intro.
apply eqb_elim.
intro.apply eqb_elim.
intro.apply False_ind.
apply H6.
apply eq_gcd_times_SO.
-simplify.apply le_S_S.apply le_O_n.
-simplify.apply le_S_S.apply le_O_n.
+unfold lt.apply le_S_S.apply le_O_n.
+unfold lt.apply le_S_S.apply le_O_n.
rewrite < gcd_mod.
rewrite > H4.
rewrite > sym_gcd.assumption.
-simplify.apply le_S_S.apply le_O_n.
+unfold lt.apply le_S_S.apply le_O_n.
rewrite < gcd_mod.
rewrite > H5.
rewrite > sym_gcd.assumption.
-simplify.apply le_S_S.apply le_O_n.
+unfold lt.apply le_S_S.apply le_O_n.
intro.reflexivity.
intro.reflexivity.
qed.
\ No newline at end of file
\forall x,y : A.
not (x = y) \to not(y = x).
intros.
-simplify.
+unfold not. (* simplify. *)
intro. apply H.
symmetry.
exact H1.