From 8e24e39aed25a2c31fb7073308ee3f0b80c206e6 Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Thu, 24 May 2007 15:54:36 +0000 Subject: [PATCH] auto and autogui... some work --- matita/applyTransformation.ml | 11 +- matita/applyTransformation.mli | 4 +- matita/library/Fsub/defn.ma | 14 +- matita/library/Fsub/part1a.ma | 2 +- matita/library/Fsub/util.ma | 6 +- matita/library/Z/dirichlet_product.ma | 2 +- matita/library/Z/moebius.ma | 4 +- matita/library/Z/sigma_p.ma | 6 +- matita/library/algebra/CoRN/SemiGroups.ma | 4 +- matita/library/algebra/CoRN/SetoidFun.ma | 20 +- matita/library/algebra/CoRN/Setoids.ma | 28 +- matita/library/decidable_kit/decidable.ma | 12 +- matita/library/decidable_kit/fintype.ma | 6 +- matita/library/demo/power_derivative.ma | 24 +- matita/library/logic/coimplication.ma | 6 +- matita/library/logic/connectives2.ma | 2 +- matita/library/nat/congruence.ma | 2 +- matita/library/nat/div_and_mod_new.ma | 8 +- matita/library/nat/euler_theorem.ma | 12 +- matita/library/nat/factorization.ma | 12 +- matita/library/nat/iteration2.ma | 6 +- matita/library/nat/map_iter_p.ma | 26 +- matita/library/nat/minus.ma | 6 +- matita/library/nat/ord.ma | 10 +- matita/library/nat/permutation.ma | 2 +- matita/library/technicalities/setoids.ma | 24 +- matita/library_auto/auto/Q/q.ma | 78 ++--- matita/library_auto/auto/Z/compare.ma | 38 +-- matita/library_auto/auto/Z/orders.ma | 40 +-- matita/library_auto/auto/Z/plus.ma | 108 +++---- matita/library_auto/auto/Z/times.ma | 68 ++-- matita/library_auto/auto/Z/z.ma | 42 +-- .../library_auto/auto/nat/chinese_reminder.ma | 60 ++-- matita/library_auto/auto/nat/compare.ma | 64 ++-- matita/library_auto/auto/nat/congruence.ma | 40 +-- matita/library_auto/auto/nat/count.ma | 56 ++-- matita/library_auto/auto/nat/div_and_mod.ma | 60 ++-- matita/library_auto/auto/nat/euler_theorem.ma | 82 ++--- matita/library_auto/auto/nat/exp.ma | 30 +- matita/library_auto/auto/nat/factorial.ma | 20 +- matita/library_auto/auto/nat/factorization.ma | 160 +++++----- .../auto/nat/fermat_little_theorem.ma | 92 +++--- matita/library_auto/auto/nat/gcd.ma | 176 +++++------ matita/library_auto/auto/nat/le_arith.ma | 22 +- matita/library_auto/auto/nat/lt_arith.ma | 60 ++-- matita/library_auto/auto/nat/map_iter_p.ma | 242 +++++++------- matita/library_auto/auto/nat/minimization.ma | 70 ++-- matita/library_auto/auto/nat/minus.ma | 94 +++--- matita/library_auto/auto/nat/nat.ma | 24 +- matita/library_auto/auto/nat/nth_prime.ma | 46 +-- matita/library_auto/auto/nat/ord.ma | 52 +-- matita/library_auto/auto/nat/orders.ma | 112 +++---- matita/library_auto/auto/nat/permutation.ma | 298 +++++++++--------- matita/library_auto/auto/nat/plus.ma | 24 +- matita/library_auto/auto/nat/primes.ma | 154 ++++----- .../auto/nat/relevant_equations.ma | 8 +- matita/library_auto/auto/nat/sigma_and_pi.ma | 26 +- matita/library_auto/auto/nat/times.ma | 28 +- matita/library_auto/auto/nat/totient.ma | 32 +- matita/matita.glade | 10 +- matita/matitaAutoGui.ml | 93 ++++-- matita/matitaGui.ml | 2 +- matita/matitaScript.ml | 293 ++++++++++++++++- 63 files changed, 1751 insertions(+), 1412 deletions(-) diff --git a/matita/applyTransformation.ml b/matita/applyTransformation.ml index 4ef0a5573..0b8bbd1bc 100644 --- a/matita/applyTransformation.ml +++ b/matita/applyTransformation.ml @@ -158,7 +158,9 @@ let term2pres ?map_unicode_to_tex n ids_to_inner_sorts annterm = let s = BoxPp.render_to_string ?map_unicode_to_tex render n mpres in remove_closed_substs s -let txt_of_cic_object ?map_unicode_to_tex n style prefix obj = +let txt_of_cic_object + ?map_unicode_to_tex ?skip_thm_and_qed ?skip_initial_lambdas n style prefix obj += let get_aobj obj = try let aobj,_,_,ids_to_inner_sorts,ids_to_inner_types,_,_ = @@ -186,8 +188,11 @@ let txt_of_cic_object ?map_unicode_to_tex n style prefix obj = let lazy_term_pp = term_pp in let obj_pp = CicNotationPp.pp_obj term_pp in let aux = GrafiteAstPp.pp_statement ~term_pp ~lazy_term_pp ~obj_pp in - let script = Acic2Procedural.acic2procedural - ~ids_to_inner_sorts ~ids_to_inner_types ?depth prefix aobj in + let script = + Acic2Procedural.acic2procedural + ~ids_to_inner_sorts ~ids_to_inner_types ?depth ?skip_thm_and_qed + ?skip_initial_lambdas prefix aobj + in String.concat "" (List.map aux script) ^ "\n\n" let txt_of_inline_macro style suri prefix = diff --git a/matita/applyTransformation.mli b/matita/applyTransformation.mli index 2718d6401..63c3beedf 100644 --- a/matita/applyTransformation.mli +++ b/matita/applyTransformation.mli @@ -67,7 +67,9 @@ val txt_of_cic_sequent_conclusion: (* columns, rendering style, name prefix, object *) val txt_of_cic_object: - ?map_unicode_to_tex:bool -> int -> GrafiteAst.presentation_style -> string -> + ?map_unicode_to_tex:bool -> + ?skip_thm_and_qed:bool -> ?skip_initial_lambdas:bool -> + int -> GrafiteAst.presentation_style -> string -> Cic.obj -> string diff --git a/matita/library/Fsub/defn.ma b/matita/library/Fsub/defn.ma index 97e161967..550f8271e 100644 --- a/matita/library/Fsub/defn.ma +++ b/matita/library/Fsub/defn.ma @@ -542,8 +542,8 @@ intros 3;elim T 0 [1,3:elim Hcut;elim H4;elim H5;clear Hcut H4 H5;rewrite > (H H6 H8); rewrite > (H1 H7 H9);reflexivity |*:split - [1,3:split;unfold;intro;apply H2;apply natinG_or_inH_to_natinGH;auto - |*:split;unfold;intro;apply H3;apply natinG_or_inH_to_natinGH;auto]]] + [1,3:split;unfold;intro;apply H2;apply natinG_or_inH_to_natinGH;autobatch + |*:split;unfold;intro;apply H3;apply natinG_or_inH_to_natinGH;autobatch]]] qed. lemma subst_type_nat_swap : \forall u,v,T,X,m. @@ -693,7 +693,7 @@ cut (\forall l:(list nat).\exists n.\forall m. |intros;lapply (inj_tail ? ? ? ? ? H9); rewrite < Hletin3 in H6;rewrite < H8 in H6; apply (H1 ? H4 H6)]]] - |elim (leb a t);auto]]]] + |elim (leb a t);autobatch]]]] qed. (*** lemmas on well-formedness ***) @@ -858,7 +858,7 @@ cut ((max (t_len T1) (t_len T2)) = match (leb (t_len T1) (t_len T2)) with [rewrite > H;rewrite > H in Hletin;simplify;constructor 1 |rewrite > H;rewrite > H in Hletin;simplify;simplify in Hletin; unfold;apply le_S_S;assumption] - |elim (leb (t_len T1) (t_len T2));auto] + |elim (leb (t_len T1) (t_len T2));autobatch] |elim T1;simplify;reflexivity] qed. @@ -875,7 +875,7 @@ cut ((max (t_len T1) (t_len T2)) = match (leb (t_len T1) (t_len T2)) with lapply (not_le_to_lt ? ? Hletin);unfold in Hletin1;unfold; constructor 2;assumption |rewrite > H;simplify;unfold;constructor 1] - |elim (leb (t_len T1) (t_len T2));auto] + |elim (leb (t_len T1) (t_len T2));autobatch] |elim T1;simplify;reflexivity] qed. @@ -891,7 +891,7 @@ cut ((max (t_len T1) (t_len T2)) = match (leb (t_len T1) (t_len T2)) with [rewrite > H;rewrite > H in Hletin;simplify;constructor 1 |rewrite > H;rewrite > H in Hletin;simplify;simplify in Hletin; unfold;apply le_S_S;assumption] - |elim (leb (t_len T1) (t_len T2));auto] + |elim (leb (t_len T1) (t_len T2));autobatch] |elim T1;simplify;reflexivity] qed. @@ -908,7 +908,7 @@ cut ((max (t_len T1) (t_len T2)) = match (leb (t_len T1) (t_len T2)) with lapply (not_le_to_lt ? ? Hletin);unfold in Hletin1;unfold; constructor 2;assumption |rewrite > H;simplify;unfold;constructor 1] - |elim (leb (t_len T1) (t_len T2));auto] + |elim (leb (t_len T1) (t_len T2));autobatch] |elim T1;simplify;reflexivity] qed. diff --git a/matita/library/Fsub/part1a.ma b/matita/library/Fsub/part1a.ma index 795546299..55d97c266 100644 --- a/matita/library/Fsub/part1a.ma +++ b/matita/library/Fsub/part1a.ma @@ -71,7 +71,7 @@ apply Typ_len_ind;intro;elim U |intros;destruct H10 |intros;destruct H14 |intros;destruct H14;rewrite > Hcut1;assumption]] - |split;unfold;intro;apply H5;apply natinG_or_inH_to_natinGH;auto]] + |split;unfold;intro;apply H5;apply natinG_or_inH_to_natinGH;autobatch]] qed. (* diff --git a/matita/library/Fsub/util.ma b/matita/library/Fsub/util.ma index 582114c69..2e50ed5c0 100644 --- a/matita/library/Fsub/util.ma +++ b/matita/library/Fsub/util.ma @@ -20,14 +20,14 @@ include "list/list.ma". (*** useful definitions and lemmas not really related to Fsub ***) lemma eqb_case : \forall x,y.(eqb x y) = true \lor (eqb x y) = false. -intros;elim (eqb x y);auto; +intros;elim (eqb x y);autobatch; qed. lemma eq_eqb_case : \forall x,y.((x = y) \land (eqb x y) = true) \lor ((x \neq y) \land (eqb x y) = false). intros;lapply (eqb_to_Prop x y);elim (eqb_case x y) - [rewrite > H in Hletin;simplify in Hletin;left;auto - |rewrite > H in Hletin;simplify in Hletin;right;auto] + [rewrite > H in Hletin;simplify in Hletin;left;autobatch + |rewrite > H in Hletin;simplify in Hletin;right;autobatch] qed. let rec max m n \def diff --git a/matita/library/Z/dirichlet_product.ma b/matita/library/Z/dirichlet_product.ma index c4706378c..a1cc3d18e 100644 --- a/matita/library/Z/dirichlet_product.ma +++ b/matita/library/Z/dirichlet_product.ma @@ -162,7 +162,7 @@ apply (trans_eq ? ? [apply sym_eq. apply div_plus_times. assumption - |auto + |autobatch ] |apply lt_mod_m_m. assumption diff --git a/matita/library/Z/moebius.ma b/matita/library/Z/moebius.ma index 98ffccd40..33c9ad4be 100644 --- a/matita/library/Z/moebius.ma +++ b/matita/library/Z/moebius.ma @@ -64,7 +64,7 @@ intros. apply p_ord_exp1 [apply lt_O_nth_prime_n |assumption - |auto + |autobatch ] qed. @@ -514,7 +514,7 @@ lapply (exp_ord (nth_prime (max_prime_factor n)) n) (ord_rem n (nth_prime (max_prime_factor n)))) [apply lt_to_le.assumption |apply le_n - |auto + |autobatch |assumption ] |left.apply sym_eq.assumption diff --git a/matita/library/Z/sigma_p.ma b/matita/library/Z/sigma_p.ma index 73b29a38c..24cb89395 100644 --- a/matita/library/Z/sigma_p.ma +++ b/matita/library/Z/sigma_p.ma @@ -436,7 +436,7 @@ elim n absurd (j = (h n1)) [rewrite < H10. rewrite > H5 - [reflexivity|assumption|auto] + [reflexivity|assumption|autobatch] |apply eqb_false_to_not_eq. generalize in match H11. elim (eqb j (h n1)) @@ -637,7 +637,7 @@ cut (O < p) apply eq_f. rewrite > sym_plus. apply plus_minus_m_m. - auto + autobatch ] ] |intros. @@ -663,7 +663,7 @@ cut (O < p) change with ((i/S m) < S n). apply (lt_times_to_lt_l m). apply (le_to_lt_to_lt ? i) - [auto|assumption] + [autobatch|assumption] |apply le_exp [assumption |apply le_S_S_to_le. diff --git a/matita/library/algebra/CoRN/SemiGroups.ma b/matita/library/algebra/CoRN/SemiGroups.ma index 3d209099b..f57e7c41a 100644 --- a/matita/library/algebra/CoRN/SemiGroups.ma +++ b/matita/library/algebra/CoRN/SemiGroups.ma @@ -136,7 +136,7 @@ intros (H2 H3). elim (H1 e) 0. clear H1. intros (H4 H5). -auto new. +autobatch new. qed. (* astepr (e[+]f). @@ -155,7 +155,7 @@ We can also define a similar addition operator, which will be denoted by [{+}], %\begin{convention}% Whenever possible, we will denote the functional construction corresponding to an algebraic operation by the same symbol enclosed in curly braces. %\end{convention}% -At this stage, we will always consider automorphisms; we %{\em %could%}% treat this in a more general setting, but we feel that it wouldn't really be a useful effort. +At this stage, we will always consider autobatchmorphisms; we %{\em %could%}% treat this in a more general setting, but we feel that it wouldn't really be a useful effort. %\begin{convention}% Let [G:CSemiGroup] and [F,F':(PartFunct G)] and denote by [P] and [Q], respectively, the predicates characterizing their domains. %\end{convention}% diff --git a/matita/library/algebra/CoRN/SetoidFun.ma b/matita/library/algebra/CoRN/SetoidFun.ma index 00e75ab1d..d78aac70e 100644 --- a/matita/library/algebra/CoRN/SetoidFun.ma +++ b/matita/library/algebra/CoRN/SetoidFun.ma @@ -196,7 +196,7 @@ exact H0. qed. -(* Questa coercion composta non e' stata generata automaticamente *) +(* Questa coercion composta non e' stata generata autobatchmaticamente *) lemma mycor: ∀S. CSetoid_bin_op S → (S → S → S). intros; unfold in c; @@ -235,7 +235,7 @@ unfold in H10. letin H40 \def (csf_strext A B g). unfold in H40. elim (H10 (csf_fun ? ? g x1) (csf_fun ? ? g x2) (csf_fun ? ? g y1) (csf_fun ? ? g y2) H0); -[left | right]; auto. +[left | right]; autobatch. qed. definition compose_CSetoid_bin_fun: \forall A, B, C : CSetoid. @@ -473,7 +473,7 @@ simplify. right. apply I|intros (a at).simplify. left. apply I]] simplify. left. -auto new|intros 2 (c l). +autobatch new|intros 2 (c l). intros 2 (Hy). elim y 0[ intros 2 (H z). @@ -509,15 +509,15 @@ unfold Not. elim x 0[ intro y. elim y 0[ - split[simplify.intro.auto new|simplify.intros.exact H1]| + split[simplify.intro.autobatch new|simplify.intros.exact H1]| intros (a at). simplify. -split[intro.auto new|intros. exact H1] +split[intro.autobatch new|intros. exact H1] ] | intros (a at IHx). elim y 0[simplify. - split[intro.auto new|intros.exact H] + split[intro.autobatch new|intros.exact H] | intros 2 (c l). generalize in match (IHx l). @@ -874,7 +874,7 @@ generalize in match (bpfstrx ? ? ? ? ? ? ? H0). exact (eq_imp_not_ap ? ? ? H). qed. -(* Similar for automorphisms. *) +(* Similar for autobatchmorphisms. *) record PartFunct (S : CSetoid) : Type \def {pfdom : S -> Type; @@ -1247,7 +1247,7 @@ a = b \to b \neq c \to a \neq c. intros. generalize in match (ap_cotransitive_unfolded ? ? ? H1 a). intro.elim H2.apply False_ind.apply (eq_imp_not_ap ? ? ? H). -auto.assumption. +autobatch.assumption. qed. lemma Dir_bij : \forall A, B:CSetoid. @@ -1262,7 +1262,7 @@ lemma Dir_bij : \forall A, B:CSetoid. apply (eq_to_ap_to_ap ? ? ? ? (H1 ?)). apply ap_symmetric_unfolded.assumption |unfold surjective.intros. - elim f.auto. + elim f.autobatch. ] qed. @@ -1282,7 +1282,7 @@ lemma Inv_bij : \forall A, B:CSetoid. apply ap_symmetric_unfolded. apply (eq_to_ap_to_ap ? ? ? ? (H3 ?)). apply ap_symmetric_unfolded.assumption| - intros.auto] + intros.autobatch] qed. (* End bijections.*) diff --git a/matita/library/algebra/CoRN/Setoids.ma b/matita/library/algebra/CoRN/Setoids.ma index cfc6f524e..a48d1a522 100644 --- a/matita/library/algebra/CoRN/Setoids.ma +++ b/matita/library/algebra/CoRN/Setoids.ma @@ -101,7 +101,7 @@ generalize in match (ap_tight S y x). intro. generalize in match (ap_symmetric S y x). intro. elim H1. clear H1. elim H2. clear H2. -apply H1. unfold. intro. auto. +apply H1. unfold. intro. autobatch. qed. *) lemma eq_transitive : \forall S : CSetoid. transitive S (cs_eq S). @@ -135,7 +135,7 @@ qed. lemma eq_wdl : \forall S:CSetoid. \forall x,y,z:S. x = y \to x = z \to z = y. intros. -(* perche' auto non arriva in fondo ??? *) +(* perche' autobatch non arriva in fondo ??? *) apply (eq_transitive_unfolded ? ? x). apply eq_symmetric_unfolded. exact H1. @@ -361,7 +361,7 @@ intro P. intro x; intros y H H0. elim (csp'_strext P x y H). -auto. +autobatch. intro H1. elimtype False. @@ -503,12 +503,12 @@ generalize (H x1 x2 y y). intro H1. elim (H1 H0). -auto. +autobatch. intro H3. elim H3; intro H4. -auto. +autobatch. elim (ap_irreflexive _ _ H4). Qed. @@ -517,22 +517,22 @@ unfold Crel_strext, Crel_strext_rht in |- *; intros H x y1 y2 H0. generalize (H x x y1 y2 H0); intro H1. elim H1; intro H2. -auto. +autobatch. elim H2; intro H3. elim (ap_irreflexive _ _ H3). -auto. +autobatch. Qed. Lemma Crel_strextarg_imp_strext : Crel_strext_rht -> Crel_strext_lft -> Crel_strext. unfold Crel_strext, Crel_strext_lft, Crel_strext_rht in |- *; intros H H0 x1 x2 y1 y2 H1. -elim (H x1 y1 y2 H1); auto. +elim (H x1 y1 y2 H1); autobatch. intro H2. -elim (H0 x1 x2 y2 H2); auto. +elim (H0 x1 x2 y2 H2); autobatch. Qed. *) @@ -553,7 +553,7 @@ intro R. red in |- *; intros x y z H H0. elim (Ccsr_strext R x x y z H). -auto. +autobatch. intro H1; elimtype False. elim H1; intro H2. @@ -569,7 +569,7 @@ intro R. red in |- *; intros x y z H H0. elim (Ccsr_strext R x z y y H). -auto. +autobatch. intro H1; elimtype False. elim H1; intro H2. @@ -614,11 +614,11 @@ Lemma ap_strext : Crel_strext (cs_ap (c:=S)). red in |- *; intros x1 x2 y1 y2 H. case (ap_cotransitive_unfolded _ _ _ H x2); intro H0. -auto. +autobatch. case (ap_cotransitive_unfolded _ _ _ H0 y2); intro H1. -auto. +autobatch. right; right. apply ap_symmetric_unfolded. @@ -1263,7 +1263,7 @@ apply f. apply n1. apply m1. apply eq_symmetric_unfolded.assumption. apply eq_symmetric_unfolded.assumption. apply H. -auto new. +autobatch new. qed. (* diff --git a/matita/library/decidable_kit/decidable.ma b/matita/library/decidable_kit/decidable.ma index d58996de3..1b2b1fc42 100644 --- a/matita/library/decidable_kit/decidable.ma +++ b/matita/library/decidable_kit/decidable.ma @@ -58,7 +58,7 @@ qed. lemma prove_reflect : ∀P:Prop.∀b:bool. (b = true → P) → (b = false → ¬P) → reflect P b. -intros 2 (P b); cases b; intros; [left|right] auto. +intros 2 (P b); cases b; intros; [left|right] autobatch. qed. (* ### standard connectives/relations with reflection predicate ### *) @@ -96,7 +96,7 @@ intros (a b); cases a; cases b; simplify; qed. lemma orbC : ∀a,b. orb a b = orb b a. -intros (a b); cases a; cases b; auto. qed. +intros (a b); cases a; cases b; autobatch. qed. lemma lebP: ∀x,y. reflect (x ≤ y) (leb x y). intros (x y); generalize in match (leb_to_Prop x y); @@ -119,7 +119,7 @@ intros (x y); apply (lebP (S x) y); qed. lemma ltb_refl : ∀n.ltb n n = false. -intros (n); apply (p2bF ? ? (ltbP ? ?)); auto; +intros (n); apply (p2bF ? ? (ltbP ? ?)); autobatch; qed. (* ### = between booleans as <-> in Prop ### *) @@ -139,8 +139,8 @@ qed. lemma leb_eqb : ∀n,m. orb (eqb n m) (leb (S n) m) = leb n m. intros (n m); apply bool_to_eq; split; intros (H); -[1:cases (b2pT ? ? (orbP ? ?) H); [2: auto] - rewrite > (eqb_true_to_eq ? ? H1); auto +[1:cases (b2pT ? ? (orbP ? ?) H); [2: autobatch] + rewrite > (eqb_true_to_eq ? ? H1); autobatch |2:cases (b2pT ? ? (lebP ? ?) H); [ elim n; [reflexivity|assumption] | simplify; rewrite > (p2bT ? ? (lebP ? ?) H1); rewrite > orbC ] @@ -150,7 +150,7 @@ qed. (* OUT OF PLACE *) lemma ltW : ∀n,m. n < m → n < (S m). -intros; unfold lt; unfold lt in H; auto. qed. +intros; unfold lt; unfold lt in H; autobatch. qed. lemma ltbW : ∀n,m. ltb n m = true → ltb n (S m) = true. intros (n m H); letin H1 ≝ (b2pT ? ? (ltbP ? ?) H); clearbody H1; diff --git a/matita/library/decidable_kit/fintype.ma b/matita/library/decidable_kit/fintype.ma index 8f5de6e0a..9b2dbadb9 100644 --- a/matita/library/decidable_kit/fintype.ma +++ b/matita/library/decidable_kit/fintype.ma @@ -80,8 +80,8 @@ cases b; simplify; [2:intros (Hpt); apply H; intros; apply H1; simplify; generalize in match (refl_eq ? (cmp d x t)); generalize in match (cmp d x t) in ⊢ (? ? ? % → %); intros 1 (b1); - cases b1; simplify; intros; [2:rewrite > H2] auto. -|1:intros (H2); lapply (H1 t); [2:simplify; rewrite > cmp_refl; simplify; auto] + cases b1; simplify; intros; [2:rewrite > H2] autobatch. +|1:intros (H2); lapply (H1 t); [2:simplify; rewrite > cmp_refl; simplify; autobatch] rewrite > H2 in Hletin; simplify in Hletin; destruct Hletin] qed. @@ -103,7 +103,7 @@ cut (∀x:fsort. count fsort (cmp fsort x) enum = (S O)); generalize in match (refl_eq ? (eqb n p)); generalize in match (eqb n p) in ⊢ (? ? ? % → %); intros 1(b); cases b; clear b; intros (Enp); simplify; - [2:rewrite > IH; [1,3: auto] + [2:rewrite > IH; [1,3: autobatch] rewrite < ltb_n_Sm in Hm; rewrite > Enp in Hm; generalize in match Hm; cases (ltb n p); intros; [reflexivity] simplify in H1; destruct H1; diff --git a/matita/library/demo/power_derivative.ma b/matita/library/demo/power_derivative.ma index 07e658e0b..9e59079bd 100644 --- a/matita/library/demo/power_derivative.ma +++ b/matita/library/demo/power_derivative.ma @@ -121,7 +121,7 @@ lemma Fmult_one_f: ∀f:R→R.1·f=f. simplify; apply f_eq_extensional; intro; - auto. + autobatch. qed. lemma Fmult_zero_f: ∀f:R→R.0·f=0. @@ -130,7 +130,7 @@ lemma Fmult_zero_f: ∀f:R→R.0·f=0. simplify; apply f_eq_extensional; intro; - auto. + autobatch. qed. lemma Fmult_commutative: symmetric ? Fmult. @@ -139,7 +139,7 @@ lemma Fmult_commutative: symmetric ? Fmult. unfold Fmult; apply f_eq_extensional; intros; - auto. + autobatch. qed. lemma Fmult_associative: associative ? Fmult. @@ -149,7 +149,7 @@ lemma Fmult_associative: associative ? Fmult. unfold Fmult; apply f_eq_extensional; intros; - auto. + autobatch. qed. lemma Fmult_Fplus_distr: distributive ? Fmult Fplus. @@ -160,7 +160,7 @@ lemma Fmult_Fplus_distr: distributive ? Fmult Fplus. apply f_eq_extensional; intros; simplify; - auto. + autobatch. qed. lemma monomio_product: @@ -173,13 +173,13 @@ lemma monomio_product: [ simplify; apply f_eq_extensional; intro; - auto + autobatch | simplify; apply f_eq_extensional; intro; cut (x\sup (n1+m) = x \sup n1 · x \sup m); [ rewrite > Hcut; - auto + autobatch | change in ⊢ (? ? % ?) with ((λx:R.x\sup(n1+m)) x); rewrite > H; reflexivity @@ -196,7 +196,7 @@ lemma costante_sum: intros; elim n; [ simplify; - auto + autobatch | simplify; clear x; clear H; @@ -205,19 +205,19 @@ lemma costante_sum: [ simplify; elim m; [ simplify; - auto + autobatch | simplify; rewrite < H; - auto + autobatch ] | simplify; rewrite < H; clear H; elim n; [ simplify; - auto + autobatch | simplify; - auto + autobatch ] ] ]. diff --git a/matita/library/logic/coimplication.ma b/matita/library/logic/coimplication.ma index 24965d72c..a963846f0 100644 --- a/matita/library/logic/coimplication.ma +++ b/matita/library/logic/coimplication.ma @@ -31,11 +31,11 @@ notation < "hvbox(a break \leftrightarrow b)" for @{ 'iff $a $b }. theorem iff_intro: \forall A,B. (A \to B) \to (B \to A) \to (A \liff B). - unfold Iff. intros. split; intros; auto. + unfold Iff. intros. split; intros; autobatch. qed. theorem iff_refl: \forall A. A \liff A. - intros. apply iff_intro; intros; auto. + intros. apply iff_intro; intros; autobatch. qed. theorem iff_sym: \forall A,B. A \liff B \to B \liff A. @@ -43,5 +43,5 @@ theorem iff_sym: \forall A,B. A \liff B \to B \liff A. qed. theorem iff_trans: \forall A,B,C. A \liff B \to B \liff C \to A \liff C. - intros. elim H. elim H1. apply iff_intro;intros;auto. + intros. elim H. elim H1. apply iff_intro;intros;autobatch. qed. diff --git a/matita/library/logic/connectives2.ma b/matita/library/logic/connectives2.ma index fcc29e81a..bc577a5f4 100644 --- a/matita/library/logic/connectives2.ma +++ b/matita/library/logic/connectives2.ma @@ -39,6 +39,6 @@ theorem transitive_iff: transitive ? iff. elim H1; split; intro; - auto. + autobatch. qed. diff --git a/matita/library/nat/congruence.ma b/matita/library/nat/congruence.ma index 86f7b9814..f418c1b85 100644 --- a/matita/library/nat/congruence.ma +++ b/matita/library/nat/congruence.ma @@ -103,7 +103,7 @@ rewrite > distr_times_plus. (*rewrite > (sym_times p (m/p)).*) (*rewrite > sym_times.*) rewrite > assoc_plus. -auto paramodulation. +autobatch paramodulation. rewrite < div_mod. assumption. assumption. diff --git a/matita/library/nat/div_and_mod_new.ma b/matita/library/nat/div_and_mod_new.ma index 325244f7a..2f881b155 100644 --- a/matita/library/nat/div_and_mod_new.ma +++ b/matita/library/nat/div_and_mod_new.ma @@ -151,7 +151,7 @@ qed. theorem div_mod_spec_div_mod: \forall n,m. O < m \to (div_mod_spec n m (n / m) (n \mod m)). -intros.auto. +intros.autobatch. (* apply div_mod_spec_intro. apply lt_mod_m_m.assumption. @@ -170,7 +170,7 @@ apply (nat_compare_elim q q1);intro [apply (lt_to_not_le r b H2 Hcut2) |elim Hcut.assumption ] - |auto depth=4. apply (trans_le ? ((q1-q)*b)) + |autobatch depth=4. apply (trans_le ? ((q1-q)*b)) [apply le_times_n. apply le_SO_minus.exact H6 |rewrite < sym_plus. @@ -180,7 +180,7 @@ apply (nat_compare_elim q q1);intro |rewrite < sym_times. rewrite > distr_times_minus. rewrite > plus_minus - [auto. + [autobatch. (* rewrite > sym_times. rewrite < H5. @@ -188,7 +188,7 @@ apply (nat_compare_elim q q1);intro apply plus_to_minus. apply H3 *) - |auto. + |autobatch. (* apply le_times_r. apply lt_to_le. diff --git a/matita/library/nat/euler_theorem.ma b/matita/library/nat/euler_theorem.ma index 43638fca6..d45c15dc3 100644 --- a/matita/library/nat/euler_theorem.ma +++ b/matita/library/nat/euler_theorem.ma @@ -77,8 +77,8 @@ intros 3.elim H [rewrite > pi_p_S. cut (eqb (gcd (S O) n) (S O) = true) [rewrite > Hcut. - change with ((gcd n (S O)) = (S O)).auto - |apply eq_to_eqb_true.auto + change with ((gcd n (S O)) = (S O)).autobatch + |apply eq_to_eqb_true.autobatch ] |rewrite > pi_p_S. apply eqb_elim @@ -189,11 +189,11 @@ split |apply mod_O_to_divides [assumption |rewrite > distr_times_minus. - auto + autobatch ] ] ] - |auto + |autobatch ] ] |intro.assumption @@ -214,11 +214,11 @@ split |apply mod_O_to_divides [assumption |rewrite > distr_times_minus. - auto + autobatch ] ] ] - |auto + |autobatch ] ] ] diff --git a/matita/library/nat/factorization.ma b/matita/library/nat/factorization.ma index f5b147005..0bd8e2478 100644 --- a/matita/library/nat/factorization.ma +++ b/matita/library/nat/factorization.ma @@ -46,13 +46,13 @@ cut (\exists i. nth_prime i = smallest_factor n); [ apply (trans_lt ? (S O)); [ unfold lt; apply le_n; | apply lt_SO_smallest_factor; assumption; ] - | letin x \def le.auto new. + | letin x \def le.autobatch new. (* apply divides_smallest_factor_n; apply (trans_lt ? (S O)); [ unfold lt; apply le_n; | assumption; ] *) ] ] - | auto. + | autobatch. (* apply prime_to_nth_prime; apply prime_smallest_factor_n; @@ -70,8 +70,8 @@ apply divides_to_divides_b_true. cut (prime (nth_prime (max_prime_factor n))). apply lt_O_nth_prime_n.apply prime_nth_prime. cut (nth_prime (max_prime_factor n) \divides n). -auto. -auto. +autobatch. +autobatch. (* [ apply (transitive_divides ? n); [ apply divides_max_prime_factor_n. @@ -116,7 +116,7 @@ apply divides_max_prime_factor_n. assumption.unfold Not. intro. cut (r \mod (nth_prime (max_prime_factor n)) \neq O); - [unfold Not in Hcut1.auto new. + [unfold Not in Hcut1.autobatch new. (* apply Hcut1.apply divides_to_mod_O; [ apply lt_O_nth_prime_n. @@ -125,7 +125,7 @@ cut (r \mod (nth_prime (max_prime_factor n)) \neq O); *) |letin z \def le. cut(pair nat nat q r=p_ord_aux n n (nth_prime (max_prime_factor n))); - [2: rewrite < H1.assumption.|letin x \def le.auto width = 4 depth = 2] + [2: rewrite < H1.assumption.|letin x \def le.autobatch width = 4 depth = 2] (* CERCA COME MAI le_n non lo applica se lo trova come Const e non Rel *) ]. (* diff --git a/matita/library/nat/iteration2.ma b/matita/library/nat/iteration2.ma index 0c3091d30..14e14b263 100644 --- a/matita/library/nat/iteration2.ma +++ b/matita/library/nat/iteration2.ma @@ -335,7 +335,7 @@ elim n absurd (j = (h n1)) [rewrite < H10. rewrite > H5 - [reflexivity|assumption|auto] + [reflexivity|assumption|autobatch] |apply eqb_false_to_not_eq. generalize in match H11. elim (eqb j (h n1)) @@ -448,7 +448,7 @@ cut (O < p) apply eq_f. rewrite > sym_plus. apply plus_minus_m_m. - auto + autobatch ] ] |intros. @@ -474,7 +474,7 @@ cut (O < p) change with ((i/S m) < S n). apply (lt_times_to_lt_l m). apply (le_to_lt_to_lt ? i) - [auto|assumption] + [autobatch|assumption] |apply le_exp [assumption |apply le_S_S_to_le. diff --git a/matita/library/nat/map_iter_p.ma b/matita/library/nat/map_iter_p.ma index c263076aa..ca5031f22 100644 --- a/matita/library/nat/map_iter_p.ma +++ b/matita/library/nat/map_iter_p.ma @@ -126,7 +126,7 @@ intros.elim n (a*exp a (card n1 p) * ((S n1) * (pi_p p n1)) = a*(S n1)*map_iter_p n1 p (\lambda n.a*n) (S O) times). rewrite < H. - auto + autobatch |intro.assumption ] ] @@ -269,7 +269,7 @@ elim k 3 apply le_S. assumption ] - |apply H2[auto|apply le_n] + |apply H2[autobatch|apply le_n] ] ] ] @@ -327,13 +327,13 @@ apply (nat_case n) apply lt_to_not_eq. apply (le_to_lt_to_lt ? m) [apply (trans_le ? (m-k)) - [assumption|auto] + [assumption|autobatch] |apply le_S.apply le_n ] ] |apply not_eq_to_eqb_false. apply lt_to_not_eq. - unfold.auto + unfold.autobatch ] ] |apply le_S_S_to_le.assumption @@ -356,15 +356,15 @@ elim n 2 cut (k1 = n1 - (n1 -k1)) [rewrite > Hcut. apply (eq_map_iter_p_transpose p f H H1 g a (n1-k1)) - [cut (k1 \le n1)[auto|auto] + [cut (k1 \le n1)[autobatch|autobatch] |assumption |rewrite < Hcut.assumption |rewrite < Hcut.intros. - apply (H9 i H10).unfold.auto + apply (H9 i H10).unfold.autobatch ] |apply sym_eq. apply plus_to_minus. - auto. + autobatch. ] |intros. cut ((S n1) \neq k1) @@ -377,7 +377,7 @@ elim n 2 apply eq_f. apply (H3 H5) [elim (le_to_or_lt_eq ? ? H6) - [auto + [autobatch |absurd (S n1=k2)[apply sym_eq.assumption|assumption] ] |assumption @@ -398,7 +398,7 @@ elim n 2 [rewrite > map_iter_p_S_false [apply (H3 H5) [elim (le_to_or_lt_eq ? ? H6) - [auto + [autobatch |absurd (S n1=k2)[apply sym_eq.assumption|assumption] ] |assumption @@ -583,13 +583,13 @@ theorem lt_minus_to_lt_plus: \forall n,m,p. n - m < p \to n < m + p. intros 2. apply (nat_elim2 ? ? ? ? n m) - [simplify.intros.auto. + [simplify.intros.autobatch. |intros 2.rewrite < minus_n_O. intro.assumption |intros. simplify. cut (n1 < m1+p) - [auto + [autobatch |apply H. apply H1 ] @@ -617,7 +617,7 @@ theorem minus_m_minus_mn: \forall n,m. n\le m \to n=m-(m-n). intros. apply sym_eq. apply plus_to_minus. -auto. +autobatch. qed. theorem eq_map_iter_p_transpose2: \forall p.\forall f.associative nat f \to @@ -639,7 +639,7 @@ cut (k = (S n)-(S n -k)) elim (decidable_n2 p n (S n -m) H4 H6) [apply (eq_map_iter_p_transpose1 p f H H1 f1 a) [assumption. - |unfold.auto. + |unfold.autobatch. |apply le_n |assumption |assumption diff --git a/matita/library/nat/minus.ma b/matita/library/nat/minus.ma index 063ab636e..f1178107a 100644 --- a/matita/library/nat/minus.ma +++ b/matita/library/nat/minus.ma @@ -60,7 +60,7 @@ qed. theorem eq_minus_S_pred: \forall n,m. n - (S m) = pred(n -m). apply nat_elim2 [intro.reflexivity - |intro.simplify.auto + |intro.simplify.autobatch |intros.simplify.assumption ] qed. @@ -239,7 +239,7 @@ theorem lt_minus_l: \forall m,l,n:nat. apply nat_elim2 [intros.apply False_ind.apply (not_le_Sn_O ? H) |intros.rewrite < minus_n_O. - auto + autobatch |intros. generalize in match H2. apply (nat_case n1) @@ -263,7 +263,7 @@ intro.elim n rewrite > eq_minus_S_pred. apply lt_pred [unfold lt.apply le_plus_to_minus_r.applyS H1 - |apply H[auto|assumption] + |apply H[autobatch|assumption] ] ] qed. diff --git a/matita/library/nat/ord.ma b/matita/library/nat/ord.ma index c45bfe701..4fd2fd282 100644 --- a/matita/library/nat/ord.ma +++ b/matita/library/nat/ord.ma @@ -17,7 +17,7 @@ set "baseuri" "cic:/matita/nat/ord". include "datatypes/constructors.ma". include "nat/exp.ma". include "nat/gcd.ma". -include "nat/relevant_equations.ma". (* required by auto paramod *) +include "nat/relevant_equations.ma". (* required by autobatch paramod *) let rec p_ord_aux p n m \def match n \mod m with @@ -213,7 +213,7 @@ apply (absurd ? ? H10 H5). apply (absurd ? ? H10 H7). (* rewrite > H6. rewrite > H8. *) -auto paramodulation. +autobatch paramodulation. unfold prime in H. elim H. assumption. qed. @@ -259,7 +259,7 @@ cut (S O < p) apply (lt_to_not_eq O ? H). rewrite > H7. rewrite < H10. - auto + autobatch ] |elim c [rewrite > sym_gcd. @@ -270,7 +270,7 @@ cut (S O < p) |apply lt_O_exp.apply lt_to_le.assumption |rewrite > sym_gcd. (* hint non trova prime_to_gcd_SO e - auto non chiude il goal *) + autobatch non chiude il goal *) apply prime_to_gcd_SO [assumption|assumption] |assumption @@ -297,7 +297,7 @@ cut (S O < p) |apply lt_O_exp.apply lt_to_le.assumption |rewrite > sym_gcd. (* hint non trova prime_to_gcd_SO e - auto non chiude il goal *) + autobatch non chiude il goal *) apply prime_to_gcd_SO [assumption|assumption] |rewrite > sym_gcd. assumption diff --git a/matita/library/nat/permutation.ma b/matita/library/nat/permutation.ma index 209c0c12e..5d6e5cf1e 100644 --- a/matita/library/nat/permutation.ma +++ b/matita/library/nat/permutation.ma @@ -620,7 +620,7 @@ 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))). -unfold lt.apply le_S_S.apply le_O_n. +unfold lt.apply le_S_S.apply le_O_n.id. apply (trans_le ? i).assumption. change with (i \le (S m1)+i).apply le_plus_n. exact H4. diff --git a/matita/library/technicalities/setoids.ma b/matita/library/technicalities/setoids.ma index 362b9fb5b..bb8aacac6 100644 --- a/matita/library/technicalities/setoids.ma +++ b/matita/library/technicalities/setoids.ma @@ -209,7 +209,7 @@ definition equality_morphism_of_symmetric_areflexive_transitive_relation: unfold transitive in H; unfold symmetric in sym; intro; - auto new + autobatch new ]. qed. @@ -227,7 +227,7 @@ definition equality_morphism_of_symmetric_reflexive_transitive_relation: intro; unfold transitive in H; unfold symmetric in sym; - auto depth=4. + autobatch depth=4. ] qed. @@ -244,7 +244,7 @@ definition equality_morphism_of_asymmetric_areflexive_transitive_relation: intros; whd; intros; - auto + autobatch ]. qed. @@ -261,7 +261,7 @@ definition equality_morphism_of_asymmetric_reflexive_transitive_relation: intros; whd; intro; - auto + autobatch ]. qed. @@ -301,7 +301,7 @@ theorem impl_trans: transitive ? impl. whd; unfold impl; intros; - auto. + autobatch. qed. (*DA PORTARE: Add Relation Prop impl @@ -970,39 +970,39 @@ Qed. (* impl IS A MORPHISM *) Add Morphism impl with signature iff ==> iff ==> iff as Impl_Morphism. -unfold impl; tauto. +unfold impl; tautobatch. Qed. (* and IS A MORPHISM *) Add Morphism and with signature iff ==> iff ==> iff as And_Morphism. - tauto. + tautobatch. Qed. (* or IS A MORPHISM *) Add Morphism or with signature iff ==> iff ==> iff as Or_Morphism. - tauto. + tautobatch. Qed. (* not IS A MORPHISM *) Add Morphism not with signature iff ==> iff as Not_Morphism. - tauto. + tautobatch. Qed. (* THE SAME EXAMPLES ON impl *) Add Morphism and with signature impl ++> impl ++> impl as And_Morphism2. - unfold impl; tauto. + unfold impl; tautobatch. Qed. Add Morphism or with signature impl ++> impl ++> impl as Or_Morphism2. - unfold impl; tauto. + unfold impl; tautobatch. Qed. Add Morphism not with signature impl -→ impl as Not_Morphism2. - unfold impl; tauto. + unfold impl; tautobatch. Qed. *) diff --git a/matita/library_auto/auto/Q/q.ma b/matita/library_auto/auto/Q/q.ma index 225d68b4e..eee29ace2 100644 --- a/matita/library_auto/auto/Q/q.ma +++ b/matita/library_auto/auto/Q/q.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -set "baseuri" "cic:/matita/library_auto/Q/q". +set "baseuri" "cic:/matita/library_autobatch/Q/q". include "auto/Z/compare.ma". include "auto/Z/plus.ma". @@ -51,7 +51,7 @@ elim f | elim g [ apply H2 | apply H3 - | auto + | autobatch (*apply H4. apply H5*) ] @@ -100,7 +100,7 @@ theorem injective_pp : injective nat fraction pp. unfold injective. intros. change with ((aux(pp x)) = (aux (pp y))). -auto. +autobatch. (*apply eq_f. assumption.*) qed. @@ -109,7 +109,7 @@ theorem injective_nn : injective nat fraction nn. unfold injective. intros. change with ((aux (nn x)) = (aux (nn y))). -auto. +autobatch. (*apply eq_f. assumption.*) qed. @@ -118,7 +118,7 @@ theorem eq_cons_to_eq1: \forall f,g:fraction.\forall x,y:Z. (cons x f) = (cons y g) \to x = y. intros. change with ((fhd (cons x f)) = (fhd (cons y g))). -auto. +autobatch. (*apply eq_f.assumption.*) qed. @@ -126,7 +126,7 @@ theorem eq_cons_to_eq2: \forall x,y:Z.\forall f,g:fraction. (cons x f) = (cons y g) \to f = g. intros. change with ((ftl (cons x f)) = (ftl (cons y g))). -auto. +autobatch. (*apply eq_f.assumption.*) qed. @@ -181,21 +181,21 @@ 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)) - [ auto + [ autobatch (*left. apply eq_f. assumption*) | right. intro. - auto + autobatch (*apply H. apply injective_pp. assumption*) ] - | auto + | autobatch (*right. apply not_eq_pp_nn*) - | auto + | autobatch (*right. apply not_eq_pp_cons*) ] @@ -204,22 +204,22 @@ apply (fraction_elim2 (\lambda f,g. f=g \lor (f=g \to False))) [ right. intro. apply (not_eq_pp_nn n1 n). - auto + autobatch (*apply sym_eq. assumption*) | elim ((decidable_eq_nat n n1) : n=n1 \lor (n=n1 \to False)) - [ auto + [ autobatch (*left. apply eq_f. assumption*) | right. intro. - auto + autobatch (*apply H. apply injective_nn. assumption*) ] - | auto + | autobatch (*right. apply not_eq_nn_cons*) ] @@ -227,33 +227,33 @@ apply (fraction_elim2 (\lambda f,g. f=g \lor (f=g \to False))) right. intro. apply (not_eq_pp_cons m x f1). - auto + autobatch (*apply sym_eq. assumption*) | intros. right. intro. apply (not_eq_nn_cons m x f1). - auto + autobatch (*apply sym_eq. assumption*) | intros. elim H [ elim ((decidable_eq_Z x y) : x=y \lor (x=y \to False)) - [ auto + [ autobatch (*left. apply eq_f2; assumption*) | right. intro. - auto + autobatch (*apply H2. apply (eq_cons_to_eq1 f1 g1). assumption*) ] | right. intro. - auto + autobatch (*apply H1. apply (eq_cons_to_eq2 x y f1 g1). assumption*) @@ -276,14 +276,14 @@ apply (fraction_elim2 apply eqb_elim [ intro. simplify. - auto + autobatch (*apply eq_f. assumption*) | intro. simplify. unfold Not. intro. - auto + autobatch (*apply H. apply injective_pp. assumption*) @@ -299,21 +299,21 @@ apply (fraction_elim2 unfold Not. intro. apply (not_eq_pp_nn n1 n). - auto + autobatch (*apply sym_eq. assumption*) | simplify. apply eqb_elim [ intro. simplify. - auto + autobatch (*apply eq_f. assumption*) | intro. simplify. unfold Not. intro. - auto + autobatch (*apply H. apply injective_nn. assumption*) @@ -326,7 +326,7 @@ apply (fraction_elim2 unfold Not. intro. apply (not_eq_pp_cons m x f1). - auto + autobatch (*apply sym_eq. assumption*) | intros. @@ -334,7 +334,7 @@ apply (fraction_elim2 unfold Not. intro. apply (not_eq_nn_cons m x f1). - auto + autobatch (*apply sym_eq. assumption*) | intros. @@ -346,14 +346,14 @@ apply (fraction_elim2 [ simplify. apply eq_f2 [ assumption - | (*qui auto non chiude il goal*) + | (*qui autobatch non chiude il goal*) apply H2 ] | simplify. unfold Not. intro. apply H2. - auto + autobatch (*apply (eq_cons_to_eq2 x y). assumption*) ] @@ -361,7 +361,7 @@ apply (fraction_elim2 simplify. unfold Not. intro. - auto + autobatch (*apply H1. apply (eq_cons_to_eq1 f1 g1). assumption*) @@ -409,41 +409,41 @@ 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)). - auto + autobatch (*apply eq_f. apply sym_Zplus*) | change with (Z_to_ratio (pos n + neg n1) = Z_to_ratio (neg n1 + pos n)). - auto + autobatch (*apply eq_f. apply sym_Zplus*) | change with (frac (cons (pos n + z) f) = frac (cons (z + pos n) f)). - auto + autobatch (*rewrite < sym_Zplus. reflexivity*) ] | intros. elim g [ change with (Z_to_ratio (neg n + pos n1) = Z_to_ratio (pos n1 + neg n)). - auto + autobatch (*apply eq_f. apply sym_Zplus*) | change with (Z_to_ratio (neg n + neg n1) = Z_to_ratio (neg n1 + neg n)). - auto + autobatch (*apply eq_f. apply sym_Zplus*) | change with (frac (cons (neg n + z) f) = frac (cons (z + neg n) f)). - auto + autobatch (*rewrite < sym_Zplus. reflexivity*) ] | intros. change with (frac (cons (x1 + pos m) f) = frac (cons (pos m + x1) f)). - auto + autobatch (*rewrite < sym_Zplus. reflexivity*) | intros. change with (frac (cons (x1 + neg m) f) = frac (cons (neg m + x1) f)). - auto + autobatch (*rewrite < sym_Zplus. reflexivity*) | intros. @@ -465,11 +465,11 @@ theorem ftimes_finv : \forall f:fraction. ftimes f (finv f) = one. intro. elim f [ change with (Z_to_ratio (pos n + - (pos n)) = one). - auto + autobatch (*rewrite > Zplus_Zopp. reflexivity*) | change with (Z_to_ratio (neg n + - (neg n)) = one). - auto + autobatch (*rewrite > Zplus_Zopp. reflexivity*) | diff --git a/matita/library_auto/auto/Z/compare.ma b/matita/library_auto/auto/Z/compare.ma index f3bf12cb2..4096af1ee 100644 --- a/matita/library_auto/auto/Z/compare.ma +++ b/matita/library_auto/auto/Z/compare.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -set "baseuri" "cic:/matita/library_auto/Z/compare". +set "baseuri" "cic:/matita/library_autobatch/Z/compare". include "auto/Z/orders.ma". include "auto/nat/compare.ma". @@ -57,21 +57,21 @@ elim x unfold Not. intro. apply (not_eq_OZ_pos n). - auto + autobatch (*apply sym_eq. assumption*) | simplify. apply eqb_elim [ intro. simplify. - auto + autobatch (*apply eq_f. assumption*) | intro. simplify. unfold Not. intro. - auto + autobatch (*apply H. apply inj_pos. assumption*) @@ -84,28 +84,28 @@ elim x unfold Not. intro. apply (not_eq_OZ_neg n). - auto + autobatch (*apply sym_eq. assumption*) | simplify. unfold Not. intro. apply (not_eq_pos_neg n1 n). - auto + autobatch (*apply sym_eq. assumption*) | simplify. apply eqb_elim [ intro. simplify. - auto + autobatch (*apply eq_f. assumption*) | intro. simplify. unfold Not. intro. - auto + autobatch (*apply H. apply inj_neg. assumption*) @@ -122,12 +122,12 @@ cut [ true \Rightarrow x=y | false \Rightarrow x \neq y] \to P (eqZb x y)) [ apply Hcut. - (*NB qui auto non chiude il goal*) + (*NB qui autobatch non chiude il goal*) apply eqZb_to_Prop | elim (eqZb) - [ (*NB qui auto non chiude il goal*) + [ (*NB qui autobatch non chiude il goal*) apply (H H2) - | (*NB qui auto non chiude il goal*) + | (*NB qui autobatch non chiude il goal*) apply (H1 H2) ] ] @@ -180,18 +180,18 @@ elim x | EQ \Rightarrow pos n = pos n1 | GT \Rightarrow (S n1) \leq n]) [ apply Hcut. - (*NB qui auto non chiude il goal*) + (*NB qui autobatch non chiude il goal*) apply nat_compare_to_Prop | elim (nat_compare n n1) [ simplify. - (*NB qui auto non chiude il goal*) + (*NB qui autobatch non chiude il goal*) exact H | simplify. apply eq_f. - (*NB qui auto non chiude il goal*) + (*NB qui autobatch non chiude il goal*) exact H | simplify. - (*NB qui auto non chiude il goal*) + (*NB qui autobatch non chiude il goal*) exact H ] ] @@ -213,19 +213,19 @@ elim x | EQ \Rightarrow neg n = neg n1 | GT \Rightarrow (S n) \leq n1]) [ apply Hcut. - (*NB qui auto non chiude il goal*) + (*NB qui autobatch non chiude il goal*) apply nat_compare_to_Prop | elim (nat_compare n1 n) [ simplify. - (*NB qui auto non chiude il goal*) + (*NB qui autobatch non chiude il goal*) exact H | simplify. apply eq_f. apply sym_eq. - (*NB qui auto non chiude il goal*) + (*NB qui autobatch non chiude il goal*) exact H | simplify. - (*NB qui auto non chiude il goal*) + (*NB qui autobatch non chiude il goal*) exact H ] ] diff --git a/matita/library_auto/auto/Z/orders.ma b/matita/library_auto/auto/Z/orders.ma index c6710e97e..a90ceadce 100644 --- a/matita/library_auto/auto/Z/orders.ma +++ b/matita/library_auto/auto/Z/orders.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -set "baseuri" "cic:/matita/library_auto/Z/orders". +set "baseuri" "cic:/matita/library_autobatch/Z/orders". include "auto/Z/z.ma". include "auto/nat/orders.ma". @@ -37,10 +37,10 @@ definition Zle : Z \to Z \to Prop \def | (neg m) \Rightarrow m \leq n ]]. (*CSC: the URI must disappear: there is a bug now *) -interpretation "integer 'less or equal to'" 'leq x y = (cic:/matita/library_auto/Z/orders/Zle.con x y). +interpretation "integer 'less or equal to'" 'leq x y = (cic:/matita/library_autobatch/Z/orders/Zle.con x y). (*CSC: the URI must disappear: there is a bug now *) interpretation "integer 'neither less nor equal to'" 'nleq x y = - (cic:/matita/logic/connectives/Not.con (cic:/matita/library_auto/Z/orders/Zle.con x y)). + (cic:/matita/logic/connectives/Not.con (cic:/matita/library_autobatch/Z/orders/Zle.con x y)). definition Zlt : Z \to Z \to Prop \def \lambda x,y:Z. @@ -62,32 +62,32 @@ definition Zlt : Z \to Z \to Prop \def | (neg m) \Rightarrow m Zplus_z_OZ. reflexivity*) | elim y - [ auto + [ autobatch (*simplify. reflexivity*) | simplify. - auto + autobatch (*rewrite < plus_n_Sm. rewrite < plus_n_Sm. rewrite < sym_plus. @@ -70,7 +70,7 @@ elim x | simplify. rewrite > nat_compare_n_m_m_n. simplify. - elim nat_compare;auto + elim nat_compare;autobatch (*[ simplify. reflexivity | simplify. @@ -80,13 +80,13 @@ elim x ]*) ] | elim y - [ auto + [ autobatch (*simplify. reflexivity*) | simplify. rewrite > nat_compare_n_m_m_n. simplify. - elim nat_compare;auto + elim nat_compare;autobatch (*[ simplify. reflexivity | simplify. @@ -95,7 +95,7 @@ elim x reflexivity ]*) | simplify. - auto + autobatch (*rewrite < plus_n_Sm. rewrite < plus_n_Sm. rewrite < sym_plus. @@ -107,10 +107,10 @@ qed. theorem Zpred_Zplus_neg_O : \forall z:Z. Zpred z = (neg O)+z. intros. elim z -[ auto +[ autobatch (*simplify. reflexivity*) -| elim n;auto +| elim n;autobatch (*[ simplify. reflexivity | simplify. @@ -124,13 +124,13 @@ qed. theorem Zsucc_Zplus_pos_O : \forall z:Z. Zsucc z = (pos O)+z. intros. elim z -[ auto +[ autobatch (*simplify. reflexivity*) -| auto +| autobatch (*simplify. reflexivity*) -| elim n;auto +| elim n;autobatch (*[ simplify. reflexivity | simplify. @@ -143,20 +143,20 @@ theorem Zplus_pos_pos: \forall n,m. (pos n)+(pos m) = (Zsucc (pos n))+(Zpred (pos m)). intros. elim n -[ elim m;auto +[ elim m;autobatch (*[ simplify. reflexivity | simplify. reflexivity ]*) | elim m - [ auto + [ autobatch (*simplify. rewrite < plus_n_Sm. rewrite < plus_n_O. reflexivity*) | simplify. - auto + autobatch (*rewrite < plus_n_Sm. rewrite < plus_n_Sm. reflexivity*) @@ -174,13 +174,13 @@ theorem Zplus_neg_pos : \forall n,m. (neg n)+(pos m) = (Zsucc (neg n))+(Zpred (pos m)). intros. elim n -[ elim m;auto +[ elim m;autobatch (*[ simplify. reflexivity | simplify. reflexivity ]*) -| elim m;auto +| elim m;autobatch (*[ simplify. reflexivity | simplify. @@ -193,7 +193,7 @@ theorem Zplus_neg_neg: \forall n,m. (neg n)+(neg m) = (Zsucc (neg n))+(Zpred (neg m)). intros. elim n -[ auto +[ autobatch (*elim m [ simplify. reflexivity @@ -201,12 +201,12 @@ elim n reflexivity ]*) | elim m - [ auto + [ autobatch (*simplify. rewrite > plus_n_Sm. reflexivity*) | simplify. - auto + autobatch (*rewrite > plus_n_Sm. reflexivity*) ] @@ -217,7 +217,7 @@ theorem Zplus_Zsucc_Zpred: \forall x,y. x+y = (Zsucc x)+(Zpred y). intros. elim x -[ auto +[ autobatch (*elim y [ simplify. reflexivity @@ -227,13 +227,13 @@ elim x | simplify. reflexivity ]*) -| elim y;auto +| elim y;autobatch (*[ simplify. reflexivity | apply Zplus_pos_pos | apply Zplus_pos_neg ]*) -| elim y;auto +| elim y;autobatch (*[ rewrite < sym_Zplus. rewrite < (sym_Zplus (Zpred OZ)). rewrite < Zpred_Zplus_neg_O. @@ -259,13 +259,13 @@ intros. apply (nat_elim2 (\lambda n,m. (Zsucc (pos n))+(neg m) = (Zsucc ((pos n)+(neg m))))) [ intro. - elim n1;auto + elim n1;autobatch (*[ simplify. reflexivity | elim n2; simplify; reflexivity ]*) | intros. - auto + autobatch (*elim n1;simplify;reflexivity*) | intros. rewrite < (Zplus_pos_neg ? m1). @@ -280,17 +280,17 @@ intros. apply (nat_elim2 (\lambda n,m. Zsucc (neg n) + neg m = Zsucc (neg n + neg m))) [ intros. - auto + autobatch (*elim n1 [ simplify. reflexivity | elim n2;simplify;reflexivity ]*) | intros. - auto + autobatch (*elim n1;simplify;reflexivity*) | intros. - auto. + autobatch. (*rewrite < (Zplus_neg_neg ? m1). reflexivity*) ] @@ -302,17 +302,17 @@ intros. apply (nat_elim2 (\lambda n,m. Zsucc (neg n) + (pos m) = Zsucc (neg n + pos m))) [ intros. - auto + autobatch (*elim n1 [ simplify. reflexivity | elim n2;simplify;reflexivity ]*) | intros. - auto + autobatch (*elim n1;simplify;reflexivity*) | intros. - auto + autobatch (*rewrite < H. rewrite < (Zplus_neg_pos ? (S m1)). reflexivity*) @@ -322,7 +322,7 @@ qed. theorem Zplus_Zsucc : \forall x,y:Z. (Zsucc x)+y = Zsucc (x+y). intros. elim x -[ auto +[ autobatch (*elim y [ simplify. reflexivity @@ -331,13 +331,13 @@ elim x | rewrite < Zsucc_Zplus_pos_O. reflexivity ]*) -| elim y;auto +| elim y;autobatch (*[ rewrite < (sym_Zplus OZ). reflexivity | apply Zplus_Zsucc_pos_pos | apply Zplus_Zsucc_pos_neg ]*) -| elim y;auto +| elim y;autobatch (*[ rewrite < sym_Zplus. rewrite < (sym_Zplus OZ). simplify. @@ -350,7 +350,7 @@ qed. theorem Zplus_Zpred: \forall x,y:Z. (Zpred x)+y = Zpred (x+y). intros. -cut (Zpred (x+y) = Zpred ((Zsucc (Zpred x))+y));auto. +cut (Zpred (x+y) = Zpred ((Zsucc (Zpred x))+y));autobatch. (*[ rewrite > Hcut. rewrite > Zplus_Zsucc. rewrite > Zpred_Zsucc. @@ -366,31 +366,31 @@ change with (\forall x,y,z:Z. (x + y) + z = x + (y + z)). (* simplify. *) intros. elim x -[ auto +[ autobatch (*simplify. reflexivity*) | elim n [ rewrite < Zsucc_Zplus_pos_O. - auto + autobatch (*rewrite < Zsucc_Zplus_pos_O. rewrite > Zplus_Zsucc. reflexivity*) | rewrite > (Zplus_Zsucc (pos n1)). rewrite > (Zplus_Zsucc (pos n1)). - auto + autobatch (*rewrite > (Zplus_Zsucc ((pos n1)+y)). apply eq_f. assumption*) ] | elim n [ rewrite < (Zpred_Zplus_neg_O (y+z)). - auto + autobatch (*rewrite < (Zpred_Zplus_neg_O y). rewrite < Zplus_Zpred. reflexivity*) | rewrite > (Zplus_Zpred (neg n1)). rewrite > (Zplus_Zpred (neg n1)). - auto + autobatch (*rewrite > (Zplus_Zpred ((neg n1)+y)). apply eq_f. assumption*) @@ -409,33 +409,33 @@ definition Zopp : Z \to Z \def | (neg n) \Rightarrow (pos n) ]. (*CSC: the URI must disappear: there is a bug now *) -interpretation "integer unary minus" 'uminus x = (cic:/matita/library_auto/Z/plus/Zopp.con x). +interpretation "integer unary minus" 'uminus x = (cic:/matita/library_autobatch/Z/plus/Zopp.con x). theorem Zopp_Zplus: \forall x,y:Z. -(x+y) = -x + -y. intros. elim x -[ elim y;auto +[ elim y;autobatch (*simplify;reflexivity*) | elim y - [ auto + [ autobatch (*simplify. reflexivity*) - | auto + | autobatch (*simplify. reflexivity*) | simplify. apply nat_compare_elim; - intro;auto (*simplify;reflexivity*) + intro;autobatch (*simplify;reflexivity*) ] | elim y - [ auto + [ autobatch (*simplify. reflexivity*) | simplify. apply nat_compare_elim; - intro;auto + intro;autobatch (*simplify;reflexivity*) - | auto + | autobatch (*simplify. reflexivity*) ] @@ -453,12 +453,12 @@ elim x [ apply refl_eq | simplify. rewrite > nat_compare_n_n. - auto + autobatch (*simplify. apply refl_eq*) | simplify. rewrite > nat_compare_n_n. - auto + autobatch (*simplify. apply refl_eq*) ] @@ -467,4 +467,4 @@ qed. (* minus *) definition Zminus : Z \to Z \to Z \def \lambda x,y:Z. x + (-y). -interpretation "integer minus" 'minus x y = (cic:/matita/library_auto/Z/plus/Zminus.con x y). +interpretation "integer minus" 'minus x y = (cic:/matita/library_autobatch/Z/plus/Zminus.con x y). diff --git a/matita/library_auto/auto/Z/times.ma b/matita/library_auto/auto/Z/times.ma index 49e8a199e..1fa633d9f 100644 --- a/matita/library_auto/auto/Z/times.ma +++ b/matita/library_auto/auto/Z/times.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -set "baseuri" "cic:/matita/library_auto/Z/times". +set "baseuri" "cic:/matita/library_autobatch/Z/times". include "auto/nat/lt_arith.ma". include "auto/Z/plus.ma". @@ -33,18 +33,18 @@ definition Ztimes :Z \to Z \to Z \def | (neg n) \Rightarrow (pos (pred ((S m) * (S n))))]]. (*CSC: the URI must disappear: there is a bug now *) -interpretation "integer times" 'times x y = (cic:/matita/library_auto/Z/times/Ztimes.con x y). +interpretation "integer times" 'times x y = (cic:/matita/library_autobatch/Z/times/Ztimes.con x y). theorem Ztimes_z_OZ: \forall z:Z. z*OZ = OZ. intro. -elim z;auto. +elim z;autobatch. (*simplify;reflexivity.*) qed. theorem Ztimes_neg_Zopp: \forall n:nat.\forall x:Z. neg n * x = - (pos n * x). intros. -elim x;auto. +elim x;autobatch. (*simplify;reflexivity.*) qed. @@ -52,32 +52,32 @@ theorem symmetric_Ztimes : symmetric Z Ztimes. change with (\forall x,y:Z. x*y = y*x). intros. elim x -[ auto +[ autobatch (*rewrite > Ztimes_z_OZ. reflexivity*) | elim y - [ auto + [ autobatch (*simplify. reflexivity*) | change with (pos (pred ((S n) * (S n1))) = pos (pred ((S n1) * (S n)))). - auto + autobatch (*rewrite < sym_times. reflexivity*) | change with (neg (pred ((S n) * (S n1))) = neg (pred ((S n1) * (S n)))). - auto + autobatch (*rewrite < sym_times. reflexivity*) ] | elim y - [ auto + [ autobatch (*simplify. reflexivity*) | change with (neg (pred ((S n) * (S n1))) = neg (pred ((S n1) * (S n)))). - auto + autobatch (*rewrite < sym_times. reflexivity*) | change with (pos (pred ((S n) * (S n1))) = pos (pred ((S n1) * (S n)))). - auto + autobatch (*rewrite < sym_times. reflexivity*) ] @@ -91,22 +91,22 @@ theorem associative_Ztimes: associative Z Ztimes. unfold associative. intros. elim x -[ auto +[ autobatch (*simplify. reflexivity*) | elim y - [ auto + [ autobatch (*simplify. reflexivity*) | elim z - [ auto + [ autobatch (*simplify. reflexivity*) | change with (pos (pred ((S (pred ((S n) * (S n1)))) * (S n2))) = pos (pred ((S n) * (S (pred ((S n1) * (S n2))))))). rewrite < S_pred - [ rewrite < S_pred;auto + [ rewrite < S_pred;autobatch (*[ rewrite < assoc_times. reflexivity | apply lt_O_times_S_S @@ -117,7 +117,7 @@ elim x (neg (pred ((S (pred ((S n) * (S n1)))) * (S n2))) = neg (pred ((S n) * (S (pred ((S n1) * (S n2))))))). rewrite < S_pred - [ rewrite < S_pred;auto + [ rewrite < S_pred;autobatch (*[ rewrite < assoc_times. reflexivity | apply lt_O_times_S_S @@ -126,14 +126,14 @@ elim x ] ] | elim z - [ auto + [ autobatch (*simplify. reflexivity*) | change with (neg (pred ((S (pred ((S n) * (S n1)))) * (S n2))) = neg (pred ((S n) * (S (pred ((S n1) * (S n2))))))). rewrite < S_pred - [ rewrite < S_pred;auto + [ rewrite < S_pred;autobatch (*[ rewrite < assoc_times. reflexivity | apply lt_O_times_S_S @@ -144,7 +144,7 @@ elim x (pos (pred ((S (pred ((S n) * (S n1)))) * (S n2))) = pos(pred ((S n) * (S (pred ((S n1) * (S n2))))))). rewrite < S_pred - [ rewrite < S_pred;auto + [ rewrite < S_pred;autobatch (*[ rewrite < assoc_times. reflexivity | apply lt_O_times_S_S @@ -154,18 +154,18 @@ elim x ] ] | elim y - [ auto + [ autobatch (*simplify. reflexivity*) | elim z - [ auto + [ autobatch (*simplify. reflexivity*) | change with (neg (pred ((S (pred ((S n) * (S n1)))) * (S n2))) = neg (pred ((S n) * (S (pred ((S n1) * (S n2))))))). rewrite < S_pred - [ rewrite < S_pred;auto + [ rewrite < S_pred;autobatch (*[ rewrite < assoc_times. reflexivity | apply lt_O_times_S_S @@ -176,7 +176,7 @@ elim x (pos (pred ((S (pred ((S n) * (S n1)))) * (S n2))) = pos (pred ((S n) * (S (pred ((S n1) * (S n2))))))). rewrite < S_pred - [ rewrite < S_pred;auto + [ rewrite < S_pred;autobatch (*[ rewrite < assoc_times. reflexivity | apply lt_O_times_S_S @@ -185,14 +185,14 @@ elim x ] ] | elim z - [ auto + [ autobatch (*simplify. reflexivity*) | change with (pos (pred ((S (pred ((S n) * (S n1)))) * (S n2))) = pos (pred ((S n) * (S (pred ((S n1) * (S n2))))))). rewrite < S_pred - [ rewrite < S_pred;auto + [ rewrite < S_pred;autobatch (*[ rewrite < assoc_times. reflexivity | apply lt_O_times_S_S @@ -203,7 +203,7 @@ elim x (neg (pred ((S (pred ((S n) * (S n1)))) * (S n2))) = neg(pred ((S n) * (S (pred ((S n1) * (S n2))))))). rewrite < S_pred - [ rewrite < S_pred;auto + [ rewrite < S_pred;autobatch (*[ rewrite < assoc_times. reflexivity | apply lt_O_times_S_S @@ -225,7 +225,7 @@ pred ((S n) * (S p)) - pred ((S n) * (S q)). intros. rewrite < S_pred [ rewrite > minus_pred_pred - [ auto + [ autobatch (*rewrite < distr_times_minus. reflexivity*) @@ -233,7 +233,7 @@ rewrite < S_pred | apply lt_O_times_S_S | apply lt_O_times_S_S ] -| unfold lt.auto +| unfold lt.autobatch (*simplify. unfold lt. apply le_SO_minus. @@ -258,7 +258,7 @@ rewrite < nat_compare_pred_pred rewrite < (times_minus1 n q p H). reflexivity | intro. - auto + autobatch (*rewrite < H. simplify. reflexivity*) @@ -278,7 +278,7 @@ qed. lemma Ztimes_Zplus_pos_pos_neg: \forall n,p,q:nat. (pos n)*((pos p)+(neg q)) = (pos n)*(pos p)+ (pos n)*(neg q). intros. -auto. +autobatch. (*rewrite < sym_Zplus. rewrite > Ztimes_Zplus_pos_neg_pos. apply sym_Zplus.*) @@ -296,7 +296,7 @@ elim y | change with (pos (pred ((S n) * ((S n1) + (S n2)))) = pos (pred ((S n) * (S n1) + (S n) * (S n2)))). - auto + autobatch (*rewrite < distr_times_plus. reflexivity*) | apply Ztimes_Zplus_pos_pos_neg @@ -307,7 +307,7 @@ elim y | change with (neg (pred ((S n) * ((S n1) + (S n2)))) = neg (pred ((S n) * (S n1) + (S n) * (S n2)))). - auto + autobatch (*rewrite < distr_times_plus. reflexivity*) ] @@ -325,7 +325,7 @@ change with (\forall n,y,z. intros. rewrite > Ztimes_neg_Zopp. rewrite > distr_Ztimes_Zplus_pos. -auto. +autobatch. (*rewrite > Zopp_Zplus. rewrite < Ztimes_neg_Zopp. rewrite < Ztimes_neg_Zopp. @@ -339,7 +339,7 @@ distributive2_Ztimes_neg_Zplus. theorem distributive_Ztimes_Zplus: distributive Z Ztimes Zplus. change with (\forall x,y,z:Z. x * (y + z) = x*y + x*z). intros. -elim x;auto. +elim x;autobatch. (*[ simplify. reflexivity | apply distr_Ztimes_Zplus_pos diff --git a/matita/library_auto/auto/Z/z.ma b/matita/library_auto/auto/Z/z.ma index a66f3c5dc..079d5701b 100644 --- a/matita/library_auto/auto/Z/z.ma +++ b/matita/library_auto/auto/Z/z.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -set "baseuri" "cic:/matita/library_auto/Z/z". +set "baseuri" "cic:/matita/library_autobatch/Z/z". include "datatypes/bool.ma". include "auto/nat/nat.ma". @@ -27,7 +27,7 @@ definition Z_of_nat \def [ O \Rightarrow OZ | (S n)\Rightarrow pos n]. -coercion cic:/matita/library_auto/Z/z/Z_of_nat.con. +coercion cic:/matita/library_autobatch/Z/z/Z_of_nat.con. definition neg_Z_of_nat \def \lambda n. match n with @@ -54,18 +54,18 @@ match OZ_test z with |false \Rightarrow z \neq OZ]. intros. elim z -[ (*qui auto non chiude il goal*) +[ (*qui autobatch non chiude il goal*) simplify. reflexivity | simplify. unfold Not. intros (H). - (*qui auto non chiude il goal*) + (*qui autobatch non chiude il goal*) destruct H | simplify. unfold Not. intros (H). - (*qui auto non chiude il goal*) + (*qui autobatch non chiude il goal*) destruct H ] qed. @@ -76,7 +76,7 @@ unfold injective. intros. apply inj_S. change with (abs (pos x) = abs (pos y)). -auto. +autobatch. (*apply eq_f. assumption.*) qed. @@ -89,7 +89,7 @@ unfold injective. intros. apply inj_S. change with (abs (neg x) = abs (neg y)). -auto. +autobatch. (*apply eq_f. assumption.*) qed. @@ -100,21 +100,21 @@ variant inj_neg : \forall n,m:nat. neg n = neg m \to n = m theorem not_eq_OZ_pos: \forall n:nat. OZ \neq pos n. unfold Not. intros (n H). -(*qui auto non chiude il goal*) +(*qui autobatch non chiude il goal*) destruct H. qed. theorem not_eq_OZ_neg :\forall n:nat. OZ \neq neg n. unfold Not. intros (n H). -(*qui auto non chiude il goal*) +(*qui autobatch non chiude il goal*) destruct H. qed. theorem not_eq_pos_neg :\forall n,m:nat. pos n \neq neg m. unfold Not. intros (n m H). -(*qui auto non chiude il goal*) +(*qui autobatch non chiude il goal*) destruct H. qed. @@ -125,15 +125,15 @@ elim x [ (* goal: x=OZ *) elim y [ (* goal: x=OZ y=OZ *) - auto + autobatch (*left. reflexivity*) | (* goal: x=OZ 2=2 *) - auto + autobatch (*right. apply not_eq_OZ_pos*) | (* goal: x=OZ 2=3 *) - auto + autobatch (*right. apply not_eq_OZ_neg*) ] @@ -144,25 +144,25 @@ elim x unfold Not. intro. apply (not_eq_OZ_pos n). - auto + autobatch (*symmetry. assumption*) | (* goal: x=pos y=pos *) elim (decidable_eq_nat n n1:((n=n1) \lor ((n=n1) \to False))) - [ auto + [ autobatch (*left. apply eq_f. assumption*) | right. unfold Not. intros (H_inj). - auto + autobatch (*apply H. destruct H_inj. assumption*) ] | (* goal: x=pos y=neg *) - auto + autobatch (*right. unfold Not. intro. @@ -176,7 +176,7 @@ elim x unfold Not. intro. apply (not_eq_OZ_neg n). - auto + autobatch (*symmetry. assumption*) | (* goal: x=neg y=pos *) @@ -184,19 +184,19 @@ elim x unfold Not. intro. apply (not_eq_pos_neg n1 n). - auto + autobatch (*symmetry. assumption*) | (* goal: x=neg y=neg *) elim (decidable_eq_nat n n1:((n=n1) \lor ((n=n1) \to False))) - [ auto + [ autobatch (*left. apply eq_f. assumption*) | right. unfold Not. intro. - auto + autobatch (*apply H. apply injective_neg. assumption*) diff --git a/matita/library_auto/auto/nat/chinese_reminder.ma b/matita/library_auto/auto/nat/chinese_reminder.ma index 844d949d4..809881034 100644 --- a/matita/library_auto/auto/nat/chinese_reminder.ma +++ b/matita/library_auto/auto/nat/chinese_reminder.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -set "baseuri" "cic:/matita/library_auto/nat/chinese_reminder". +set "baseuri" "cic:/matita/library_autobatch/nat/chinese_reminder". include "auto/nat/exp.ma". include "auto/nat/gcd.ma". @@ -40,7 +40,7 @@ cut (\exists c,d.c*n - d*m = (S O) \lor d*m - c*n = (S O)) rewrite < assoc_times. rewrite < times_plus_l. rewrite > eq_minus_plus_plus_minus - [ auto + [ autobatch (*rewrite < times_minus_l. rewrite > sym_plus. apply (eq_times_plus_to_congruent ? ? ? ((b+(a+b*m)*a2)-b*a2)) @@ -50,7 +50,7 @@ cut (\exists c,d.c*n - d*m = (S O) \lor d*m - c*n = (S O)) | apply le_times_l. apply (trans_le ? ((a+b*m)*a2)) [ apply le_times_l. - apply (trans_le ? (b*m));auto + apply (trans_le ? (b*m));autobatch (*[ rewrite > times_n_SO in \vdash (? % ?). apply le_times_r. assumption @@ -63,7 +63,7 @@ cut (\exists c,d.c*n - d*m = (S O) \lor d*m - c*n = (S O)) [ apply lt_to_le. change with (O + a2*m < a1*n). apply lt_minus_to_plus. - auto + autobatch (*rewrite > H5. unfold lt. apply le_n*) @@ -77,7 +77,7 @@ cut (\exists c,d.c*n - d*m = (S O) \lor d*m - c*n = (S O)) rewrite > distr_times_minus. rewrite < assoc_times. rewrite < eq_plus_minus_minus_minus - [ auto + [ autobatch (*rewrite < times_n_SO. rewrite < times_minus_l. rewrite < sym_plus. @@ -87,15 +87,15 @@ cut (\exists c,d.c*n - d*m = (S O) \lor d*m - c*n = (S O)) ]*) | rewrite > assoc_times. apply le_times_r. - (*auto genera un'esecuzione troppo lunga*) - apply (trans_le ? (a1*n - a2*m));auto + (*autobatch genera un'esecuzione troppo lunga*) + apply (trans_le ? (a1*n - a2*m));autobatch (*[ rewrite > H5. apply le_n | apply (le_minus_m ? (a2*m)) ]*) | apply le_times_l. apply le_times_l. - auto + autobatch (*apply (trans_le ? (b*m)) [ rewrite > times_n_SO in \vdash (? % ?). apply le_times_r. @@ -110,7 +110,7 @@ cut (\exists c,d.c*n - d*m = (S O) \lor d*m - c*n = (S O)) [ apply lt_to_le. change with (O + a2*m < a1*n). apply lt_minus_to_plus. - auto + autobatch (*rewrite > H5. unfold lt. apply le_n*) @@ -129,7 +129,7 @@ cut (\exists c,d.c*n - d*m = (S O) \lor d*m - c*n = (S O)) rewrite > distr_times_minus. rewrite < assoc_times. rewrite < eq_plus_minus_minus_minus - [ auto + [ autobatch (*rewrite < times_n_SO. rewrite < times_minus_l. rewrite < sym_plus. @@ -139,7 +139,7 @@ cut (\exists c,d.c*n - d*m = (S O) \lor d*m - c*n = (S O)) ]*) | rewrite > assoc_times. apply le_times_r. - apply (trans_le ? (a2*m - a1*n));auto + apply (trans_le ? (a2*m - a1*n));autobatch (*[ rewrite > H5. apply le_n | apply (le_minus_m ? (a1*n)) @@ -147,7 +147,7 @@ cut (\exists c,d.c*n - d*m = (S O) \lor d*m - c*n = (S O)) | rewrite > assoc_times. rewrite > assoc_times. apply le_times_l. - auto + autobatch (*apply (trans_le ? (a*n)) [ rewrite > times_n_SO in \vdash (? % ?). apply le_times_r. @@ -162,7 +162,7 @@ cut (\exists c,d.c*n - d*m = (S O) \lor d*m - c*n = (S O)) [ apply lt_to_le. change with (O + a1*n < a2*m). apply lt_minus_to_plus. - auto + autobatch (*rewrite > H5. unfold lt. apply le_n*) @@ -180,7 +180,7 @@ cut (\exists c,d.c*n - d*m = (S O) \lor d*m - c*n = (S O)) rewrite > assoc_plus. rewrite < times_plus_l. rewrite > eq_minus_plus_plus_minus - [ auto + [ autobatch (*rewrite < times_minus_l. rewrite > sym_plus. apply (eq_times_plus_to_congruent ? ? ? ((a+(b+a*n)*a1)-a*a1)) @@ -190,7 +190,7 @@ cut (\exists c,d.c*n - d*m = (S O) \lor d*m - c*n = (S O)) | apply le_times_l. apply (trans_le ? ((b+a*n)*a1)) [ apply le_times_l. - auto + autobatch (*apply (trans_le ? (a*n)) [ rewrite > times_n_SO in \vdash (? % ?). apply le_times_r. @@ -204,7 +204,7 @@ cut (\exists c,d.c*n - d*m = (S O) \lor d*m - c*n = (S O)) [ apply lt_to_le. change with (O + a1*n < a2*m). apply lt_minus_to_plus. - auto + autobatch (*rewrite > H5. unfold lt. apply le_n*) @@ -214,7 +214,7 @@ cut (\exists c,d.c*n - d*m = (S O) \lor d*m - c*n = (S O)) ] ] (* proof of the cut *) -| (* qui auto non conclude il goal *) +| (* qui autobatch non conclude il goal *) rewrite < H2. apply eq_minus_gcd ] @@ -235,7 +235,7 @@ elim (and_congruent_congruent m n a b) apply sym_eq. change with (congruent a1 (a1 \mod (m*n)) m). rewrite < sym_times. - auto + autobatch (*apply congruent_n_mod_times;assumption*) | assumption ] @@ -243,13 +243,13 @@ elim (and_congruent_congruent m n a b) [ unfold congruent. apply sym_eq. change with (congruent a1 (a1 \mod (m*n)) n). - auto + autobatch (*apply congruent_n_mod_times;assumption*) | assumption ] ] | apply lt_mod_m_m. - auto + autobatch (*rewrite > (times_n_O O). apply lt_times;assumption*) ] @@ -268,7 +268,7 @@ reflexivity. qed. theorem cr_pair2: cr_pair (S(S O)) (S(S(S O))) (S O) O = (S(S(S O))). -auto. +autobatch. (*simplify. reflexivity.*) qed. @@ -294,7 +294,7 @@ cut (andb (eqb ((cr_pair m n a b) \mod m) a) [ rewrite > H3. simplify. intro. - auto + autobatch (*split [ reflexivity | apply eqb_true_to_eq. @@ -302,11 +302,11 @@ cut (andb (eqb ((cr_pair m n a b) \mod m) a) ]*) | simplify. intro. - (* l'invocazione di auto qui genera segmentation fault *) + (* l'invocazione di autobatch qui genera segmentation fault *) apply False_ind. - (* l'invocazione di auto qui genera segmentation fault *) + (* l'invocazione di autobatch qui genera segmentation fault *) apply not_eq_true_false. - (* l'invocazione di auto qui genera segmentation fault *) + (* l'invocazione di autobatch qui genera segmentation fault *) apply sym_eq. assumption ] @@ -316,7 +316,7 @@ cut (andb (eqb ((cr_pair m n a b) \mod m) a) [ apply (ex_intro ? ? a1). split [ split - [ auto + [ autobatch (*rewrite < minus_n_n. apply le_O_n*) | elim H3. @@ -326,7 +326,7 @@ cut (andb (eqb ((cr_pair m n a b) \mod m) a) | apply (nat_case (m*n)) [ apply le_O_n | intro. - auto + autobatch (*rewrite < pred_Sn. apply le_n*) ] @@ -339,7 +339,7 @@ cut (andb (eqb ((cr_pair m n a b) \mod m) a) [ cut (a1 \mod n = b) [ rewrite > (eq_to_eqb_true ? ? Hcut). rewrite > (eq_to_eqb_true ? ? Hcut1). - (* l'invocazione di auto qui non chiude il goal *) + (* l'invocazione di autobatch qui non chiude il goal *) simplify. reflexivity | rewrite < (lt_to_eq_mod b n); @@ -348,12 +348,12 @@ cut (andb (eqb ((cr_pair m n a b) \mod m) a) | rewrite < (lt_to_eq_mod a m);assumption ] ] - | auto + | autobatch (*apply (le_to_lt_to_lt ? b) [ apply le_O_n | assumption ]*) - | auto + | autobatch (*apply (le_to_lt_to_lt ? a) [ apply le_O_n | assumption diff --git a/matita/library_auto/auto/nat/compare.ma b/matita/library_auto/auto/nat/compare.ma index bf43ef6a9..dca43d1ec 100644 --- a/matita/library_auto/auto/nat/compare.ma +++ b/matita/library_auto/auto/nat/compare.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -set "baseuri" "cic:/matita/library_auto/nat/compare". +set "baseuri" "cic:/matita/library_autobatch/nat/compare". include "datatypes/bool.ma". include "datatypes/compare.ma". @@ -39,7 +39,7 @@ apply (nat_elim2 [ true \Rightarrow n = m | false \Rightarrow n \neq m])) [ intro. - elim n1;simplify;auto + elim n1;simplify;autobatch (*[ simplify reflexivity | simplify. @@ -50,7 +50,7 @@ apply (nat_elim2 unfold Not. intro. apply (not_eq_O_S n1). - auto + autobatch (*apply sym_eq. assumption*) | intros. @@ -62,7 +62,7 @@ apply (nat_elim2 | unfold Not. intro. apply H1. - auto + autobatch (*apply inj_S. assumption*) ] @@ -77,12 +77,12 @@ cut [ true \Rightarrow n = m | false \Rightarrow n \neq m] \to (P (eqb n m))) [ apply Hcut. - (* qui auto non conclude il goal*) + (* qui autobatch non conclude il goal*) apply eqb_to_Prop | elim (eqb n m) - [ (*qui auto non conclude il goal*) + [ (*qui autobatch non conclude il goal*) apply ((H H2)) - | (*qui auto non conclude il goal*) + | (*qui autobatch non conclude il goal*) apply ((H1 H2)) ] ] @@ -90,7 +90,7 @@ qed. theorem eqb_n_n: \forall n. eqb n n = true. intro. -elim n;simplify;auto. +elim n;simplify;autobatch. (*[ simplify.reflexivity | simplify.assumption. ]*) @@ -104,7 +104,7 @@ match true with [ true \Rightarrow n = m | false \Rightarrow n \neq m]. rewrite < H. -(*qui auto non conclude il goal*) +(*qui autobatch non conclude il goal*) apply eqb_to_Prop. qed. @@ -116,14 +116,14 @@ match false with [ true \Rightarrow n = m | false \Rightarrow n \neq m]. rewrite < H. -(*qui auto non conclude il goal*) +(*qui autobatch non conclude il goal*) apply eqb_to_Prop. qed. theorem eq_to_eqb_true: \forall n,m:nat. n = m \to eqb n m = true. intros. -auto. +autobatch. (*apply (eqb_elim n m) [ intros. reflexivity | intros.apply False_ind.apply (H1 H) @@ -164,12 +164,12 @@ apply (nat_elim2 simplify. elim ((leb n1 m1));simplify [ apply le_S_S. - (*qui auto non conclude il goal*) + (*qui autobatch non conclude il goal*) apply H | unfold Not. intros. apply H. - auto + autobatch (*apply le_S_S_to_le. assumption*) ] @@ -185,12 +185,12 @@ cut [ true \Rightarrow n \leq m | false \Rightarrow n \nleq m] \to (P (leb n m))) [ apply Hcut. - (*qui auto non conclude il goal*) + (*qui autobatch non conclude il goal*) apply leb_to_Prop | elim (leb n m) - [ (*qui auto non conclude il goal*) + [ (*qui autobatch non conclude il goal*) apply ((H H2)) - | (*qui auto non conclude il goal*) + | (*qui autobatch non conclude il goal*) apply ((H1 H2)) ] ] @@ -209,7 +209,7 @@ match n with (**********) theorem nat_compare_n_n: \forall n:nat. nat_compare n n = EQ. intro.elim n -[ auto +[ autobatch (*simplify. reflexivity*) | simplify. @@ -219,13 +219,13 @@ qed. theorem nat_compare_S_S: \forall n,m:nat. nat_compare n m = nat_compare (S n) (S m). -intros.auto. +intros.autobatch. (*simplify.reflexivity.*) qed. theorem S_pred: \forall n:nat.lt O n \to eq nat n (S (pred n)). intro. -elim n;auto. +elim n;autobatch. (*[ apply False_ind. exact (not_le_Sn_O O H) | apply eq_f. @@ -240,7 +240,7 @@ intros. apply (lt_O_n_elim n H). apply (lt_O_n_elim m H1). intros. -auto. +autobatch. (*simplify.reflexivity.*) qed. @@ -255,7 +255,7 @@ apply (nat_elim2 (\lambda n,m.match (nat_compare n m) with | EQ \Rightarrow n=m | GT \Rightarrow m < n ])) [ intro. - elim n1;simplify;auto + elim n1;simplify;autobatch (*[ reflexivity | unfold lt. apply le_S_S. @@ -263,7 +263,7 @@ apply (nat_elim2 (\lambda n,m.match (nat_compare n m) with ]*) | intro. simplify. - auto + autobatch (*unfold lt. apply le_S_S. apply le_O_n*) @@ -272,14 +272,14 @@ apply (nat_elim2 (\lambda n,m.match (nat_compare n m) with elim ((nat_compare n1 m1));simplify [ unfold lt. apply le_S_S. - (*qui auto non chiude il goal*) + (*qui autobatch non chiude il goal*) apply H | apply eq_f. - (*qui auto non chiude il goal*) + (*qui autobatch non chiude il goal*) apply H | unfold lt. apply le_S_S. - (*qui auto non chiude il goal*) + (*qui autobatch non chiude il goal*) apply H ] ] @@ -289,9 +289,9 @@ theorem nat_compare_n_m_m_n: \forall n,m:nat. nat_compare n m = compare_invert (nat_compare m n). intros. apply (nat_elim2 (\lambda n,m. nat_compare n m = compare_invert (nat_compare m n)));intros -[ elim n1;auto(*;simplify;reflexivity*) -| elim n1;auto(*;simplify;reflexivity*) -| auto +[ elim n1;autobatch(*;simplify;reflexivity*) +| elim n1;autobatch(*;simplify;reflexivity*) +| autobatch (*simplify.elim H.reflexivity*) ] qed. @@ -306,14 +306,14 @@ cut (match (nat_compare n m) with | GT \Rightarrow m < n] \to (P (nat_compare n m))) [ apply Hcut. - (*auto non chiude il goal*) + (*autobatch non chiude il goal*) apply nat_compare_to_Prop | elim ((nat_compare n m)) - [ (*auto non chiude il goal*) + [ (*autobatch non chiude il goal*) apply ((H H3)) - | (*auto non chiude il goal*) + | (*autobatch non chiude il goal*) apply ((H1 H3)) - | (*auto non chiude il goal*) + | (*autobatch non chiude il goal*) apply ((H2 H3)) ] ] diff --git a/matita/library_auto/auto/nat/congruence.ma b/matita/library_auto/auto/nat/congruence.ma index 9683869c1..305778bf8 100644 --- a/matita/library_auto/auto/nat/congruence.ma +++ b/matita/library_auto/auto/nat/congruence.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -set "baseuri" "cic:/matita/library_auto/nat/congruence". +set "baseuri" "cic:/matita/library_autobatch/nat/congruence". include "auto/nat/relevant_equations.ma". include "auto/nat/primes.ma". @@ -24,7 +24,7 @@ definition congruent: nat \to nat \to nat \to Prop \def \lambda n,m,p:nat. mod n p = mod m p. interpretation "congruent" 'congruent n m p = - (cic:/matita/library_auto/nat/congruence/congruent.con n m p). + (cic:/matita/library_autobatch/nat/congruence/congruent.con n m p). notation < "hvbox(n break \cong\sub p m)" (*non associative*) with precedence 45 @@ -43,16 +43,16 @@ unfold congruent. intros. whd. apply (trans_eq ? ? (y \mod p)) -[ (*qui auto non chiude il goal*) +[ (*qui autobatch non chiude il goal*) apply H -| (*qui auto non chiude il goal*) +| (*qui autobatch non chiude il goal*) apply H1 ] qed. theorem le_to_mod: \forall n,m:nat. n \lt m \to n = n \mod m. intros. -auto. +autobatch. (*apply (div_mod_spec_to_eq2 n m O n (n/m) (n \mod m)) [ constructor 1 [ assumption @@ -69,7 +69,7 @@ qed. theorem mod_mod : \forall n,p:nat. O

(div_mod (n \mod p) p) in \vdash (? ? % ?) [ rewrite > (eq_div_O ? p) [ reflexivity @@ -84,18 +84,18 @@ theorem mod_times_mod : \forall n,m,p:nat. O

times_plus_l. rewrite > assoc_plus. rewrite < div_mod [ rewrite > assoc_times. - rewrite < div_mod;auto + rewrite < div_mod;autobatch (*[ reflexivity | rewrite > (times_n_O O). apply lt_times;assumption @@ -110,7 +110,7 @@ theorem congruent_n_mod_n : \forall n,p:nat. O < p \to congruent n (n \mod p) p. intros. unfold congruent. -auto. +autobatch. (*apply mod_mod. assumption.*) qed. @@ -126,11 +126,11 @@ n = r*p+m \to congruent n m p. intros. unfold congruent. apply (div_mod_spec_to_eq2 n p (div n p) (mod n p) (r +(div m p)) (mod m p)) -[ auto +[ autobatch (*apply div_mod_spec_div_mod. assumption*) | constructor 1 - [ auto + [ autobatch (*apply lt_mod_m_m. assumption*) | @@ -141,7 +141,7 @@ rewrite > distr_times_plus. (*rewrite > (sym_times p (m/p)).*) (*rewrite > sym_times.*) rewrite > assoc_plus. - auto paramodulation. + autobatch paramodulation. rewrite < div_mod. assumption. assumption. @@ -163,7 +163,7 @@ elim H2. apply (eq_times_plus_to_congruent n m p n2) [ assumption | rewrite < sym_plus. - apply minus_to_plus;auto + apply minus_to_plus;autobatch (*[ assumption | rewrite > sym_times. assumption ]*) @@ -179,7 +179,7 @@ rewrite > sym_times. rewrite > (div_mod n p) in \vdash (? ? % ?) [ rewrite > (div_mod m p) in \vdash (? ? % ?) [ rewrite < (sym_plus (m \mod p)). - auto + autobatch (*rewrite < H1. rewrite < (eq_minus_minus_minus_plus ? (n \mod p)). rewrite < minus_plus_m_m. @@ -199,13 +199,13 @@ apply (eq_times_plus_to_congruent ? ? p ((n / p)*p*(m / p) + (n / p)*(m \mod p) + (n \mod p)*(m / p))) [ assumption | apply (trans_eq ? ? (((n/p)*p+(n \mod p))*((m/p)*p+(m \mod p)))) - [ apply eq_f2;auto(*;apply div_mod.assumption.*) + [ apply eq_f2;autobatch(*;apply div_mod.assumption.*) | apply (trans_eq ? ? (((n/p)*p)*((m/p)*p) + (n/p)*p*(m \mod p) + (n \mod p)*((m / p)*p) + (n \mod p)*(m \mod p))) [ apply times_plus_plus | apply eq_f2 [ rewrite < assoc_times. - auto + autobatch (*rewrite > (assoc_times (n/p) p (m \mod p)). rewrite > (sym_times p (m \mod p)). rewrite < (assoc_times (n/p) (m \mod p) p). @@ -233,7 +233,7 @@ intros. rewrite > (mod_times n m p H). rewrite > H1. rewrite > H2. -auto. +autobatch. (* apply sym_eq. apply mod_times. @@ -244,12 +244,12 @@ theorem congruent_pi: \forall f:nat \to nat. \forall n,m,p:nat.O < p \to congruent (pi n f m) (pi n (\lambda m. mod (f m) p) m) p. intros. elim n;simplify -[ auto +[ autobatch (*apply congruent_n_mod_n. assumption*) | apply congruent_times [ assumption - | auto + | autobatch (*apply congruent_n_mod_n. assumption*) | (*NB: QUI AUTO NON RIESCE A CHIUDERE IL GOAL*) diff --git a/matita/library_auto/auto/nat/count.ma b/matita/library_auto/auto/nat/count.ma index e7c0ac619..de2e52807 100644 --- a/matita/library_auto/auto/nat/count.ma +++ b/matita/library_auto/auto/nat/count.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -set "baseuri" "cic:/matita/library_auto/nat/count". +set "baseuri" "cic:/matita/library_autobatch/nat/count". include "auto/nat/relevant_equations.ma". include "auto/nat/sigma_and_pi.ma". @@ -24,7 +24,7 @@ intros. elim n;simplify [ reflexivity | rewrite > H. - auto + autobatch (*rewrite > assoc_plus. rewrite < (assoc_plus (g (S (n1+m)))). rewrite > (sym_plus (g (S (n1+m)))). @@ -38,12 +38,12 @@ theorem sigma_plus: \forall n,p,m:nat.\forall f:nat \to nat. sigma (S (p+n)) f m = sigma p (\lambda x.(f ((S n) + x))) m + sigma n f m. intros. elim p;simplify -[ auto +[ autobatch (*rewrite < (sym_plus n m). reflexivity*) | rewrite > assoc_plus in \vdash (? ? ? %). rewrite < H. - auto + autobatch (*simplify. rewrite < plus_n_Sm. rewrite > (sym_plus n). @@ -62,7 +62,7 @@ elim p;simplify | rewrite > assoc_plus in \vdash (? ? ? %). rewrite < H. rewrite < plus_n_Sm. - auto + autobatch (*rewrite < plus_n_Sm.simplify. rewrite < (sym_plus n). rewrite > assoc_plus. @@ -84,7 +84,7 @@ elim n;simplify | rewrite > sigma_f_g. rewrite < plus_n_O. rewrite < H. - auto + autobatch (*rewrite > (S_pred ((S n1)*(S m))) [ apply sigma_plus1 @@ -122,7 +122,7 @@ definition bool_to_nat: bool \to nat \def theorem bool_to_nat_andb: \forall a,b:bool. bool_to_nat (andb a b) = (bool_to_nat a)*(bool_to_nat b). intros. -elim a;auto. +elim a;autobatch. (*[elim b [ simplify. reflexivity @@ -159,7 +159,7 @@ rewrite > (permut_to_eq_map_iter_i plus assoc_plus sym_plus ? ? ? ((i1*(S n) + i) \mod (S n)) i1 i) [ rewrite > (div_mod_spec_to_eq2 (i1*(S n) + i) (S n) ((i1*(S n) + i)/(S n)) ((i1*(S n) + i) \mod (S n)) i1 i) - [ rewrite > H3;auto (*qui auto impiega parecchio tempo*) + [ rewrite > H3;autobatch (*qui autobatch impiega parecchio tempo*) (*[ apply bool_to_nat_andb | unfold lt. apply le_S_S. @@ -168,24 +168,24 @@ rewrite > (permut_to_eq_map_iter_i plus assoc_plus sym_plus ? ? ? apply le_S_S. assumption ]*) - | auto + | autobatch (*apply div_mod_spec_div_mod. unfold lt. apply le_S_S. apply le_O_n*) - | constructor 1;auto + | constructor 1;autobatch (*[ unfold lt. apply le_S_S. assumption | reflexivity ]*) ] - | auto + | autobatch (*apply div_mod_spec_div_mod. unfold lt. apply le_S_S. apply le_O_n*) - | constructor 1;auto + | constructor 1;autobatch (*[ unfold lt. apply le_S_S. assumption @@ -197,7 +197,7 @@ rewrite > (permut_to_eq_map_iter_i plus assoc_plus sym_plus ? ? ? (sigma m (\lambda n.bool_to_nat (f2 n)) O))) O)) [ apply eq_sigma. intros. - auto + autobatch (*rewrite > sym_times. apply (trans_eq ? ? (sigma m (\lambda n.(bool_to_nat (f2 n))*(bool_to_nat (f1 i))) O)) @@ -205,7 +205,7 @@ rewrite > (permut_to_eq_map_iter_i plus assoc_plus sym_plus ? ? ? | apply sym_eq. apply sigma_times ]*) - | auto + | autobatch (*simplify. apply sym_eq. apply sigma_times*) @@ -219,14 +219,14 @@ rewrite > (permut_to_eq_map_iter_i plus assoc_plus sym_plus ? ? ? rewrite < S_pred in \vdash (? ? %) [ change with ((g (i/(S n)) (i \mod (S n))) \lt (S n)*(S m)). apply H - [ auto + [ autobatch (*apply lt_mod_m_m. unfold lt. apply le_S_S. apply le_O_n*) | apply (lt_times_to_lt_l n). apply (le_to_lt_to_lt ? i) - [ auto + [ autobatch (*rewrite > (div_mod i (S n)) in \vdash (? ? %) [ rewrite > sym_plus. apply le_plus_n @@ -237,18 +237,18 @@ rewrite > (permut_to_eq_map_iter_i plus assoc_plus sym_plus ? ? ? | unfold lt. rewrite > S_pred in \vdash (? ? %) [ apply le_S_S. - auto + autobatch (*rewrite > plus_n_O in \vdash (? ? %). rewrite > sym_times. assumption*) - | auto + | autobatch (*rewrite > (times_n_O O). apply lt_times; unfold lt;apply le_S_S;apply le_O_n*) ] ] ] - | auto + | autobatch (*rewrite > (times_n_O O). apply lt_times; unfold lt;apply le_S_S;apply le_O_n *) @@ -268,22 +268,22 @@ rewrite > (permut_to_eq_map_iter_i plus assoc_plus sym_plus ? ? ? rewrite < (H2 (i \mod (S n)) (i/(S n)) Hcut2 Hcut3) in \vdash (? ? (? % ?) ?). rewrite < (H1 (j \mod (S n)) (j/(S n)) Hcut4 Hcut5). rewrite < (H2 (j \mod (S n)) (j/(S n)) Hcut4 Hcut5) in \vdash (? ? ? (? % ?)). - auto + autobatch (*rewrite > H6. reflexivity*) - | auto + | autobatch (*unfold lt. apply le_S_S. apply le_O_n*) ] - | auto + | autobatch (*unfold lt. apply le_S_S. apply le_O_n*) ] | apply (lt_times_to_lt_l n). apply (le_to_lt_to_lt ? j) - [ auto. + [ autobatch. (*rewrite > (div_mod j (S n)) in \vdash (? ? %) [ rewrite > sym_plus. apply le_plus_n @@ -295,14 +295,14 @@ rewrite > (permut_to_eq_map_iter_i plus assoc_plus sym_plus ? ? ? assumption ] ] - | auto + | autobatch (*apply lt_mod_m_m. unfold lt. apply le_S_S. apply le_O_n*) ] | apply (lt_times_to_lt_l n). apply (le_to_lt_to_lt ? i) - [ auto + [ autobatch (*rewrite > (div_mod i (S n)) in \vdash (? ? %) [ rewrite > sym_plus. apply le_plus_n @@ -314,13 +314,13 @@ rewrite > (permut_to_eq_map_iter_i plus assoc_plus sym_plus ? ? ? assumption ] ] - | auto + | autobatch (*apply lt_mod_m_m. unfold lt. apply le_S_S. apply le_O_n*) ] | unfold lt. - auto + autobatch (*rewrite > S_pred in \vdash (? ? %) [ apply le_S_S. assumption @@ -330,7 +330,7 @@ rewrite > (permut_to_eq_map_iter_i plus assoc_plus sym_plus ? ? ? ]*) ] | unfold lt. - auto + autobatch (*rewrite > S_pred in \vdash (? ? %) [ apply le_S_S. assumption diff --git a/matita/library_auto/auto/nat/div_and_mod.ma b/matita/library_auto/auto/nat/div_and_mod.ma index 215f387af..bbb3d49b1 100644 --- a/matita/library_auto/auto/nat/div_and_mod.ma +++ b/matita/library_auto/auto/nat/div_and_mod.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -set "baseuri" "cic:/matita/library_auto/nat/div_and_mod". +set "baseuri" "cic:/matita/library_autobatch/nat/div_and_mod". include "datatypes/constructors.ma". include "auto/nat/minus.ma". @@ -32,7 +32,7 @@ match m with | (S p) \Rightarrow mod_aux n n p]. interpretation "natural remainder" 'module x y = - (cic:/matita/library_auto/nat/div_and_mod/mod.con x y). + (cic:/matita/library_autobatch/nat/div_and_mod/mod.con x y). let rec div_aux p m n : nat \def match (leb m n) with @@ -49,14 +49,14 @@ match m with | (S p) \Rightarrow div_aux n n p]. interpretation "natural divide" 'divide x y = - (cic:/matita/library_auto/nat/div_and_mod/div.con x y). + (cic:/matita/library_autobatch/nat/div_and_mod/div.con x y). theorem le_mod_aux_m_m: \forall p,n,m. n \leq p \to (mod_aux p n m) \leq m. intro. elim p [ apply (le_n_O_elim n H (\lambda n.(mod_aux O n m) \leq m)). - auto + autobatch (*simplify. apply le_O_n*) | simplify. @@ -64,10 +64,10 @@ elim p [ assumption | apply H. cut (n1 \leq (S n) \to n1-(S m) \leq n) - [ auto + [ autobatch (*apply Hcut. assumption*) - | elim n1;simplify;auto + | elim n1;simplify;autobatch (*[ apply le_O_n. | apply (trans_le ? n2 n) [ apply le_minus_m @@ -86,7 +86,7 @@ elim m [ apply False_ind. apply (not_le_Sn_O O H) | simplify. - auto + autobatch (*unfold lt. apply le_S_S. apply le_mod_aux_m_m. @@ -98,7 +98,7 @@ theorem div_aux_mod_aux: \forall p,n,m:nat. (n=(div_aux p n m)*(S m) + (mod_aux p n m)). intro. elim p;simplify -[ elim (leb n m);auto +[ elim (leb n m);autobatch (*simplify;apply refl_eq.*) | apply (leb_elim n1 m);simplify;intro [ apply refl_eq @@ -106,7 +106,7 @@ elim p;simplify elim (H (n1-(S m)) m). change with (n1=(S m)+(n1-(S m))). rewrite < sym_plus. - auto + autobatch (*apply plus_minus_m_m. change with (m < n1). apply not_le_to_lt. @@ -137,7 +137,7 @@ intros 4. unfold Not. intros. elim H. -absurd (le (S r) O);auto. +absurd (le (S r) O);autobatch. (*[ rewrite < H1. assumption | exact (not_le_Sn_O r). @@ -147,7 +147,7 @@ qed. theorem div_mod_spec_div_mod: \forall n,m. O < m \to (div_mod_spec n m (n / m) (n \mod m)). intros. -auto. +autobatch. (*apply div_mod_spec_intro [ apply lt_mod_m_m. assumption @@ -172,7 +172,7 @@ apply (nat_compare_elim q q1) | elim Hcut. assumption ] - | apply (trans_le ? ((q1-q)*b));auto + | apply (trans_le ? ((q1-q)*b));autobatch (*[ apply le_times_n. apply le_SO_minus. exact H6 @@ -182,7 +182,7 @@ apply (nat_compare_elim q q1) ] | rewrite < sym_times. rewrite > distr_times_minus. - rewrite > plus_minus;auto + rewrite > plus_minus;autobatch (*[ rewrite > sym_times. rewrite < H5. rewrite < sym_times. @@ -194,7 +194,7 @@ apply (nat_compare_elim q q1) ]*) ] | (* eq case *) - auto + autobatch (*intros. assumption*) | (* the following case is symmetric *) @@ -207,7 +207,7 @@ apply (nat_compare_elim q q1) | elim Hcut. assumption ] - | apply (trans_le ? ((q-q1)*b));auto + | apply (trans_le ? ((q-q1)*b));autobatch (*[ apply le_times_n. apply le_SO_minus. exact H6 @@ -217,7 +217,7 @@ apply (nat_compare_elim q q1) ] | rewrite < sym_times. rewrite > distr_times_minus. - rewrite > plus_minus;auto + rewrite > plus_minus;autobatch (*[ rewrite > sym_times. rewrite < H3. rewrite < sym_times. @@ -245,7 +245,7 @@ qed. theorem div_mod_spec_times : \forall n,m:nat.div_mod_spec ((S n)*m) (S n) m O. intros. -auto. +autobatch. (*constructor 1 [ unfold lt. apply le_S_S. @@ -262,9 +262,9 @@ qed. theorem div_times: \forall n,m:nat. ((S n)*m) / (S n) = m. intros. apply (div_mod_spec_to_eq ((S n)*m) (S n) ? ? ? O); -[2: apply div_mod_spec_div_mod.auto. +[2: apply div_mod_spec_div_mod.autobatch. | skip -| auto +| autobatch ] (*unfold lt.apply le_S_S.apply le_O_n. apply div_mod_spec_times.*) @@ -272,7 +272,7 @@ qed. theorem div_n_n: \forall n:nat. O < n \to n / n = S O. intros. -apply (div_mod_spec_to_eq n n (n / n) (n \mod n) (S O) O);auto. +apply (div_mod_spec_to_eq n n (n / n) (n \mod n) (S O) O);autobatch. (*[ apply div_mod_spec_div_mod. assumption | constructor 1 @@ -287,7 +287,7 @@ qed. theorem eq_div_O: \forall n,m. n < m \to n / m = O. intros. -apply (div_mod_spec_to_eq n m (n/m) (n \mod m) O n);auto. +apply (div_mod_spec_to_eq n m (n/m) (n \mod m) O n);autobatch. (*[ apply div_mod_spec_div_mod. apply (le_to_lt_to_lt O n m) [ apply le_O_n @@ -302,7 +302,7 @@ qed. theorem mod_n_n: \forall n:nat. O < n \to n \mod n = O. intros. -apply (div_mod_spec_to_eq2 n n (n / n) (n \mod n) (S O) O);auto. +apply (div_mod_spec_to_eq2 n n (n / n) (n \mod n) (S O) O);autobatch. (*[ apply div_mod_spec_div_mod. assumption | constructor 1 @@ -319,13 +319,13 @@ theorem mod_S: \forall n,m:nat. O < m \to S (n \mod m) < m \to ((S n) \mod m) = S (n \mod m). intros. apply (div_mod_spec_to_eq2 (S n) m ((S n) / m) ((S n) \mod m) (n / m) (S (n \mod m))) -[ auto +[ autobatch (*apply div_mod_spec_div_mod. assumption*) | constructor 1 [ assumption | rewrite < plus_n_Sm. - auto + autobatch (*apply eq_f. apply div_mod. assumption*) @@ -335,14 +335,14 @@ qed. theorem mod_O_n: \forall n:nat.O \mod n = O. intro. -elim n;auto. +elim n;autobatch. (*simplify;reflexivity*) qed. theorem lt_to_eq_mod:\forall n,m:nat. n < m \to n \mod m = n. intros. -apply (div_mod_spec_to_eq2 n m (n/m) (n \mod m) O n);auto. +apply (div_mod_spec_to_eq2 n m (n/m) (n \mod m) O n);autobatch. (*[ apply div_mod_spec_div_mod. apply (le_to_lt_to_lt O n m) [ apply le_O_n @@ -360,7 +360,7 @@ theorem injective_times_r: \forall n:nat.injective nat nat (\lambda m:nat.(S n)* change with (\forall n,p,q:nat.(S n)*p = (S n)*q \to p=q). intros. rewrite < (div_times n). -auto. +autobatch. (*rewrite < (div_times n q). apply eq_f2 [ assumption @@ -376,7 +376,7 @@ simplify. intros 4. apply (lt_O_n_elim n H). intros. -auto. +autobatch. (*apply (inj_times_r m). assumption.*) qed. @@ -387,7 +387,7 @@ variant inj_times_r1:\forall n. O < n \to \forall p,q:nat.n*p = n*q \to p=q theorem injective_times_l: \forall n:nat.injective nat nat (\lambda m:nat.m*(S n)). simplify. intros. -auto. +autobatch. (*apply (inj_times_r n x y). rewrite < sym_times. rewrite < (sym_times y). @@ -402,7 +402,7 @@ simplify. intros 4. apply (lt_O_n_elim n H). intros. -auto. +autobatch. (*apply (inj_times_l m). assumption.*) qed. diff --git a/matita/library_auto/auto/nat/euler_theorem.ma b/matita/library_auto/auto/nat/euler_theorem.ma index 232ace21f..71c1481d6 100644 --- a/matita/library_auto/auto/nat/euler_theorem.ma +++ b/matita/library_auto/auto/nat/euler_theorem.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -set "baseuri" "cic:/matita/library_auto/nat/euler_theorem". +set "baseuri" "cic:/matita/library_autobatch/nat/euler_theorem". include "auto/nat/map_iter_p.ma". include "auto/nat/totient.ma". @@ -27,9 +27,9 @@ apply (nat_case n) apply (nat_case m) [ reflexivity | intro. - apply count_card1;auto + apply count_card1;autobatch (*[ reflexivity - | auto.rewrite > gcd_n_n. + | autobatch.rewrite > gcd_n_n. reflexivity ]*) ] @@ -43,11 +43,11 @@ elim H [ rewrite > pi_p_S. cut (eqb (gcd (S O) n) (S O) = true) [ rewrite > Hcut. - auto + autobatch (*change with ((gcd n (S O)) = (S O)). - auto*) - | auto - (*apply eq_to_eqb_true.auto*) + autobatch*) + | autobatch + (*apply eq_to_eqb_true.autobatch*) ] | rewrite > pi_p_S. apply eqb_elim @@ -55,16 +55,16 @@ elim H change with ((gcd n ((S n1)*(pi_p (\lambda i.eqb (gcd i n) (S O)) n1))) = (S O)). apply eq_gcd_times_SO - [ auto + [ autobatch (*unfold. apply le_S. assumption*) | apply lt_O_pi_p. - | auto + | autobatch (*rewrite > sym_gcd. assumption.*) | apply H2. - auto + autobatch (*apply (trans_le ? (S n1)) [ apply le_n_Sn | assumption @@ -74,7 +74,7 @@ elim H change with (gcd n (pi_p (\lambda i.eqb (gcd i n) (S O)) n1) = (S O)). apply H2. - auto + autobatch (*apply (trans_le ? (S n1)) [ apply le_n_Sn | assumption @@ -91,7 +91,7 @@ congruent (\lambda x.f x \mod a) (S O) times) a. intros. elim n -[ auto +[ autobatch (*rewrite > map_iter_p_O. apply (congruent_n_n ? a)*) | apply (eqb_elim (gcd (S n1) a) (S O)) @@ -100,30 +100,30 @@ elim n [ rewrite > map_iter_p_S_true [ apply congruent_times [ assumption - | auto + | autobatch (*apply congruent_n_mod_n. assumption*) - | (*NB qui auto non chiude il goal*) + | (*NB qui autobatch non chiude il goal*) assumption ] - | auto + | autobatch (*apply eq_to_eqb_true. assumption*) ] - | auto + | autobatch (*apply eq_to_eqb_true. assumption*) ] | intro. rewrite > map_iter_p_S_false [ rewrite > map_iter_p_S_false - [ (*BN qui auto non chiude il goal*) + [ (*BN qui autobatch non chiude il goal*) assumption - | auto + | autobatch (*apply not_eq_to_eqb_false. assumption*) ] - | auto + | autobatch (*apply not_eq_to_eqb_false. assumption*) ] @@ -140,7 +140,7 @@ simplify. intros. split [ split - [ auto + [ autobatch (*apply lt_to_le. apply lt_mod_m_m. assumption*) @@ -151,13 +151,13 @@ split apply eq_gcd_times_SO [ assumption | apply (gcd_SO_to_lt_O i n H). - auto + autobatch (*apply eqb_true_to_eq. assumption*) - | auto + | autobatch (*rewrite > sym_gcd. assumption*) - | auto + | autobatch (*rewrite > sym_gcd. apply eqb_true_to_eq. assumption*) @@ -181,7 +181,7 @@ split apply (trans_le ? (j -i)) [ apply divides_to_le [(*fattorizzare*) - unfold lt.auto. + unfold lt.autobatch. (*apply (lt_plus_to_lt_l i). simplify. rewrite < (plus_minus_m_m) @@ -191,20 +191,20 @@ split ]*) | apply (gcd_SO_to_divides_times_to_divides a) [ assumption - | auto + | autobatch (*rewrite > sym_gcd. assumption*) | apply mod_O_to_divides [ assumption | rewrite > distr_times_minus. - auto + autobatch ] ] ] - | auto + | autobatch ] ] - | auto + | autobatch (*intro. assumption*) | intro. @@ -214,7 +214,7 @@ split apply (trans_le ? (i -j)) [ apply divides_to_le [(*fattorizzare*) - unfold lt.auto. + unfold lt.autobatch. (*apply (lt_plus_to_lt_l j). simplify. rewrite < (plus_minus_m_m) @@ -224,17 +224,17 @@ split ]*) | apply (gcd_SO_to_divides_times_to_divides a) [ assumption - | auto + | autobatch (*rewrite > sym_gcd. assumption*) | apply mod_O_to_divides [ assumption | rewrite > distr_times_minus. - auto + autobatch ] ] ] - | auto + | autobatch ] ] ] @@ -246,20 +246,20 @@ gcd a n = (S O) \to congruent (exp a (totient n)) (S O) n. intros. cut (O < a) [ apply divides_to_congruent - [ auto + [ autobatch (*apply (trans_lt ? (S O)). apply lt_O_S. assumption*) - | auto + | autobatch (*change with (O < exp a (totient n)). apply lt_O_exp. assumption*) | apply (gcd_SO_to_divides_times_to_divides (pi_p (\lambda i.eqb (gcd i n) (S O)) n)) - [ auto + [ autobatch (*apply (trans_lt ? (S O)). apply lt_O_S. assumption*) - | auto + | autobatch (*apply gcd_pi_p [ apply (trans_lt ? (S O)). apply lt_O_S. @@ -273,13 +273,13 @@ cut (O < a) rewrite > totient_card. rewrite > a_times_pi_p. apply congruent_to_divides - [ auto + [ autobatch (*apply (trans_lt ? (S O)). apply lt_O_S. assumption*) | apply (transitive_congruent n ? (map_iter_p n (\lambda i.eqb (gcd i n) (S O)) (\lambda x.a*x \mod n) (S O) times)) - [ auto + [ autobatch (*apply (congruent_map_iter_p_times ? n n). apply (trans_lt ? (S O)) [ apply lt_O_S @@ -298,7 +298,7 @@ cut (O < a) apply not_eq_to_eqb_false. unfold. intro. - auto + autobatch (*apply (lt_to_not_eq (S O) n) [ assumption | apply sym_eq. @@ -310,9 +310,9 @@ cut (O < a) ] ] ] -| elim (le_to_or_lt_eq O a (le_O_n a));auto +| elim (le_to_or_lt_eq O a (le_O_n a));autobatch (*[ assumption - | auto.absurd (gcd a n = S O) + | autobatch.absurd (gcd a n = S O) [ assumption | rewrite < H2. simplify. diff --git a/matita/library_auto/auto/nat/exp.ma b/matita/library_auto/auto/nat/exp.ma index f7d125541..69667b715 100644 --- a/matita/library_auto/auto/nat/exp.ma +++ b/matita/library_auto/auto/nat/exp.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -set "baseuri" "cic:/matita/library_auto/nat/exp". +set "baseuri" "cic:/matita/library_autobatch/nat/exp". include "auto/nat/div_and_mod.ma". @@ -21,12 +21,12 @@ let rec exp n m on m\def [ O \Rightarrow (S O) | (S p) \Rightarrow (times n (exp n p)) ]. -interpretation "natural exponent" 'exp a b = (cic:/matita/library_auto/nat/exp/exp.con a b). +interpretation "natural exponent" 'exp a b = (cic:/matita/library_autobatch/nat/exp/exp.con a b). theorem exp_plus_times : \forall n,p,q:nat. n \sup (p + q) = (n \sup p) * (n \sup q). intros. -elim p;simplify;auto. +elim p;simplify;autobatch. (*[ rewrite < plus_n_O. reflexivity | rewrite > H. @@ -37,14 +37,14 @@ qed. theorem exp_n_O : \forall n:nat. S O = n \sup O. intro. -auto. +autobatch. (*simplify. reflexivity.*) qed. theorem exp_n_SO : \forall n:nat. n = n \sup (S O). intro. -auto. +autobatch. (*simplify. rewrite < times_n_SO. reflexivity.*) @@ -54,13 +54,13 @@ theorem exp_exp_times : \forall n,p,q:nat. (n \sup p) \sup q = n \sup (p * q). intros. elim q;simplify -[ auto. +[ autobatch. (*rewrite < times_n_O. simplify. reflexivity*) | rewrite > H. rewrite < exp_plus_times. - auto + autobatch (*rewrite < times_n_Sm. reflexivity*) ] @@ -68,7 +68,7 @@ qed. theorem lt_O_exp: \forall n,m:nat. O < n \to O < n \sup m. intros. -elim m;simplify;auto. +elim m;simplify;autobatch. (*unfold lt [ apply le_n | rewrite > times_n_SO. @@ -84,11 +84,11 @@ elim m;simplify;unfold lt; [ simplify. rewrite < plus_n_Sm. apply le_S_S. - auto + autobatch (*apply le_S_S. rewrite < sym_plus. apply le_plus_n*) - | auto + | autobatch (*apply le_times;assumption*) ] ] @@ -100,7 +100,7 @@ intros. apply antisym_le [ apply le_S_S_to_le. rewrite < H1. - auto + autobatch (*change with (m < n \sup m). apply lt_m_exp_nm. assumption*) @@ -114,7 +114,7 @@ simplify. intros 4. apply (nat_elim2 (\lambda x,y.n \sup x = n \sup y \to x = y)) [ intros. - auto + autobatch (*apply sym_eq. apply (exp_to_eq_O n) [ assumption @@ -129,17 +129,17 @@ apply (nat_elim2 (\lambda x,y.n \sup x = n \sup y \to x = y)) (* esprimere inj_times senza S *) cut (\forall a,b:nat.O < n \to n*a=n*b \to a=b) [ apply Hcut - [ auto + [ autobatch (*simplify. unfold lt. apply le_S_S_to_le. apply le_S. assumption*) - | (*NB qui auto non chiude il goal, chiuso invece chiamando solo la tattica assumption*) + | (*NB qui autobatch non chiude il goal, chiuso invece chiamando solo la tattica assumption*) assumption ] | intros 2. - apply (nat_case n);intros;auto + apply (nat_case n);intros;autobatch (*[ apply False_ind. apply (not_le_Sn_O O H3) | apply (inj_times_r m1). diff --git a/matita/library_auto/auto/nat/factorial.ma b/matita/library_auto/auto/nat/factorial.ma index cb0c072ed..a5610aef1 100644 --- a/matita/library_auto/auto/nat/factorial.ma +++ b/matita/library_auto/auto/nat/factorial.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -set "baseuri" "cic:/matita/library_auto/nat/factorial". +set "baseuri" "cic:/matita/library_autobatch/nat/factorial". include "auto/nat/le_arith.ma". @@ -21,16 +21,16 @@ let rec fact n \def [ O \Rightarrow (S O) | (S m) \Rightarrow (S m)*(fact m)]. -interpretation "factorial" 'fact n = (cic:/matita/library_auto/nat/factorial/fact.con n). +interpretation "factorial" 'fact n = (cic:/matita/library_autobatch/nat/factorial/fact.con n). theorem le_SO_fact : \forall n. (S O) \le n!. intro. elim n -[ auto +[ autobatch (*simplify. apply le_n*) | change with ((S O) \le (S n1)*n1!). - auto + autobatch (*apply (trans_le ? ((S n1)*(S O))) [ simplify. apply le_S_S. @@ -45,12 +45,12 @@ theorem le_SSO_fact : \forall n. (S O) < n \to (S(S O)) \le n!. intro. apply (nat_case n) [ intro. - auto + autobatch (*apply False_ind. apply (not_le_Sn_O (S O) H).*) | intros. change with ((S (S O)) \le (S m)*m!). - apply (trans_le ? ((S(S O))*(S O)));auto + apply (trans_le ? ((S(S O))*(S O)));autobatch (*[ apply le_n | apply le_times [ exact H @@ -65,7 +65,7 @@ intro. elim n [ apply le_O_n | change with (S n1 \le (S n1)*n1!). - apply (trans_le ? ((S n1)*(S O)));auto + apply (trans_le ? ((S n1)*(S O)));autobatch (*[ rewrite < times_n_SO. apply le_n | apply le_times. @@ -79,7 +79,7 @@ theorem lt_n_fact_n: \forall n. (S(S O)) < n \to n < n!. intro. apply (nat_case n) [ intro. - auto + autobatch (*apply False_ind. apply (not_le_Sn_O (S(S O)) H)*) | intros. @@ -89,11 +89,11 @@ apply (nat_case n) simplify. unfold lt. apply le_S_S. - auto + autobatch (*rewrite < plus_n_O. apply le_plus_n*) | apply le_times_r. - auto + autobatch (*apply le_SSO_fact. simplify. unfold lt. diff --git a/matita/library_auto/auto/nat/factorization.ma b/matita/library_auto/auto/nat/factorization.ma index 69acf1837..e09a30e13 100644 --- a/matita/library_auto/auto/nat/factorization.ma +++ b/matita/library_auto/auto/nat/factorization.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -set "baseuri" "cic:/matita/library_auto/nat/factorization". +set "baseuri" "cic:/matita/library_autobatch/nat/factorization". include "auto/nat/ord.ma". include "auto/nat/gcd.ma". @@ -36,7 +36,7 @@ apply divides_b_true_to_divides apply (ex_intro nat ? a). split [ apply (trans_le a (nth_prime a)) - [ auto + [ autobatch (*apply le_n_fn. exact lt_nth_prime_n_nth_prime_Sn*) | rewrite > H1. @@ -46,16 +46,16 @@ apply divides_b_true_to_divides (*CSC: simplify here does something nasty! *) change with (divides_b (smallest_factor n) n = true). apply divides_to_divides_b_true - [ auto + [ autobatch (*apply (trans_lt ? (S O)) [ unfold lt. apply le_n | apply lt_SO_smallest_factor. assumption ]*) - | auto + | autobatch (*letin x \def le. - auto new*) + autobatch new*) (* apply divides_smallest_factor_n; apply (trans_lt ? (S O)); @@ -63,7 +63,7 @@ apply divides_b_true_to_divides | assumption; ] *) ] ] - | auto + | autobatch (* apply prime_to_nth_prime; apply prime_smallest_factor_n; @@ -77,22 +77,22 @@ max_prime_factor n \le max_prime_factor m. intros. unfold max_prime_factor. apply f_m_to_le_max -[ auto +[ autobatch (*apply (trans_le ? n) [ apply le_max_n | apply divides_to_le;assumption ]*) | change with (divides_b (nth_prime (max_prime_factor n)) m = true). apply divides_to_divides_b_true - [ auto + [ autobatch (*cut (prime (nth_prime (max_prime_factor n))) [ apply lt_O_nth_prime_n | apply prime_nth_prime ]*) - | auto + | autobatch (*cut (nth_prime (max_prime_factor n) \divides n) - [ auto - | auto + [ autobatch + | autobatch ] *) (* [ apply (transitive_divides ? n); @@ -126,15 +126,15 @@ cut (max_prime_factor r \lt max_prime_factor n \lor [ assumption | absurd (nth_prime (max_prime_factor n) \divides r) [ rewrite < H4. - auto + autobatch (*apply divides_max_prime_factor_n. assumption*) | unfold Not. intro. cut (r \mod (nth_prime (max_prime_factor n)) \neq O) - [ auto + [ autobatch (*unfold Not in Hcut1. - auto new*) + autobatch new*) (* apply Hcut1.apply divides_to_mod_O; [ apply lt_O_nth_prime_n. @@ -146,7 +146,7 @@ cut (max_prime_factor r \lt max_prime_factor n \lor [ 2: rewrite < H1. assumption | letin x \def le. - auto width = 4 new + autobatch width = 4 new ] (* CERCA COME MAI le_n non lo applica se lo trova come Const e non Rel *) ] @@ -188,7 +188,7 @@ cut (max_prime_factor n < p \lor max_prime_factor n = p) | assumption | apply (witness r n ((nth_prime p) \sup q)). rewrite > sym_times. - (*qui auto non chiude il goal*) + (*qui autobatch non chiude il goal*) apply (p_ord_aux_to_exp n n) [ apply lt_O_nth_prime_n. | assumption @@ -196,7 +196,7 @@ cut (max_prime_factor n < p \lor max_prime_factor n = p) ] | assumption ] - | apply (p_ord_to_lt_max_prime_factor n ? q);auto + | apply (p_ord_to_lt_max_prime_factor n ? q);autobatch (*[ assumption | apply sym_eq. assumption @@ -261,7 +261,7 @@ elim f [1,2: simplify; unfold lt; - rewrite > times_n_SO;auto + rewrite > times_n_SO;autobatch (*apply le_times [ change with (O < nth_prime i). apply lt_O_nth_prime_n @@ -282,7 +282,7 @@ elim f [ simplify. unfold lt. rewrite > times_n_SO. - auto + autobatch (*apply le_times [ change with (S O < nth_prime i). apply lt_SO_nth_prime_n @@ -294,7 +294,7 @@ elim f unfold lt. rewrite > times_n_SO. rewrite > sym_times. - auto + autobatch (*apply le_times [ change with (O < exp (nth_prime i) n). apply lt_O_exp. @@ -314,7 +314,7 @@ elim p [ simplify. elim H1 [ elim H2. - auto + autobatch (*rewrite > H3. rewrite > sym_times. apply times_n_SO*) @@ -327,12 +327,12 @@ elim p defactorize_aux match (p_ord_aux n1 n1 (nth_prime n)) with [(pair q r) \Rightarrow (factorize_aux n r (nf_cons q acc))] O = n1*defactorize_aux acc (S n)) - [ (*invocando auto in questo punto, dopo circa 7 minuti l'esecuzione non era ancora terminata + [ (*invocando autobatch in questo punto, dopo circa 7 minuti l'esecuzione non era ancora terminata ne' con un errore ne' chiudendo il goal *) apply (Hcut (fst ? ? (p_ord_aux n1 n1 (nth_prime n))) (snd ? ? (p_ord_aux n1 n1 (nth_prime n)))). - auto + autobatch (*apply sym_eq.apply eq_pair_fst_snd*) | intros. rewrite < H3. @@ -340,11 +340,11 @@ elim p cut (n1 = r * (nth_prime n) \sup q) [ rewrite > H [ simplify. - auto + autobatch (*rewrite < assoc_times. rewrite < Hcut. reflexivity.*) - | auto + | autobatch (*cut (O < r \lor O = r) [ elim Hcut1 [ assumption @@ -371,10 +371,10 @@ elim p [ elim H5. apply False_ind. apply (not_eq_O_S n). - auto + autobatch (*apply sym_eq. assumption*) - | auto + | autobatch (*apply le_S_S_to_le. exact H5*) ] @@ -383,7 +383,7 @@ elim p ] | cut (r=(S O)) [ apply (nat_case n) - [ auto + [ autobatch (*left. split [ assumption @@ -392,7 +392,7 @@ elim p | intro. right. rewrite > Hcut2. - auto + autobatch (*simplify. unfold lt. apply le_S_S. @@ -401,13 +401,13 @@ elim p | cut (r < (S O) ∨ r=(S O)) [ elim Hcut2 [ absurd (O=r) - [ auto + [ autobatch (*apply le_n_O_to_eq. apply le_S_S_to_le. exact H5*) | unfold Not. intro. - auto + autobatch (*cut (O=n1) [ apply (not_le_Sn_O O). rewrite > Hcut3 in ⊢ (? ? %). @@ -419,7 +419,7 @@ elim p ] | assumption ] - | auto + | autobatch (*apply (le_to_or_lt_eq r (S O)). apply not_lt_to_le. assumption*) @@ -458,10 +458,10 @@ apply (nat_case n) defactorize (match p_ord (S(S m1)) (nth_prime p) with [ (pair q r) \Rightarrow nfa_proper (factorize_aux p r (nf_last (pred q)))])=(S(S m1))) - [ (*invocando auto qui, dopo circa 300 secondi non si ottiene alcun risultato*) + [ (*invocando autobatch qui, dopo circa 300 secondi non si ottiene alcun risultato*) apply (Hcut (fst ? ? (p_ord (S(S m1)) (nth_prime p))) (snd ? ? (p_ord (S(S m1)) (nth_prime p)))). - auto + autobatch (*apply sym_eq. apply eq_pair_fst_snd*) | intros. @@ -473,9 +473,9 @@ apply (nat_case n) [ (*CSC: simplify here does something really nasty *) change with (r*(nth_prime p) \sup (S (pred q)) = (S(S m1))). cut ((S (pred q)) = q) - [ (*invocando auto qui, dopo circa 300 secondi non si ottiene ancora alcun risultato*) + [ (*invocando autobatch qui, dopo circa 300 secondi non si ottiene ancora alcun risultato*) rewrite > Hcut2. - auto + autobatch (*rewrite > sym_times. apply sym_eq. apply (p_ord_aux_to_exp (S(S m1))) @@ -490,7 +490,7 @@ apply (nat_case n) [ assumption | absurd (nth_prime p \divides S (S m1)) [ apply (divides_max_prime_factor_n (S (S m1))). - auto + autobatch (*unfold lt. apply le_S_S. apply le_S_S. @@ -501,13 +501,13 @@ apply (nat_case n) 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 - | auto + | autobatch (*unfold lt. apply le_S_S. apply le_O_n*) | apply le_n | assumption - | (*invocando auto qui, dopo circa 300 secondi non si ottiene ancora alcun risultato*) + | (*invocando autobatch qui, dopo circa 300 secondi non si ottiene ancora alcun risultato*) apply divides_to_mod_O [ apply lt_O_nth_prime_n | assumption @@ -521,7 +521,7 @@ apply (nat_case n) ] ] ] - | auto + | autobatch (*apply le_to_or_lt_eq. apply le_O_n*) ] @@ -531,7 +531,7 @@ apply (nat_case n) cut ((S O) < r \lor S O \nlt r) [ elim Hcut2 [ right. - apply (p_ord_to_lt_max_prime_factor1 (S(S m1)) ? q r);auto + apply (p_ord_to_lt_max_prime_factor1 (S(S m1)) ? q r);autobatch (*[ unfold lt. apply le_S_S. apply le_O_n @@ -541,7 +541,7 @@ apply (nat_case n) ]*) | cut (r=(S O)) [ apply (nat_case p) - [ auto + [ autobatch (*left. split [ assumption @@ -550,7 +550,7 @@ apply (nat_case n) | intro. right. rewrite > Hcut3. - auto + autobatch (*simplify. unfold lt. apply le_S_S. @@ -558,7 +558,7 @@ apply (nat_case n) ] | cut (r \lt (S O) \or r=(S O)) [ elim Hcut3 - [ absurd (O=r);auto + [ absurd (O=r);autobatch (*[ apply le_n_O_to_eq. apply le_S_S_to_le. exact H2 @@ -570,7 +570,7 @@ apply (nat_case n) ]*) | assumption ] - | auto + | autobatch (*apply (le_to_or_lt_eq r (S O)). apply not_lt_to_le. assumption*) @@ -588,17 +588,17 @@ apply (nat_case n) apply (not_eq_O_S (S m1)). rewrite > Hcut. rewrite < H1. - auto + autobatch (*rewrite < times_n_O. reflexivity*) ] - | auto + | autobatch (*apply le_to_or_lt_eq. apply le_O_n*) ] ] | (* prova del cut *) - apply (p_ord_aux_to_exp (S(S m1)));auto + apply (p_ord_aux_to_exp (S(S m1)));autobatch (*[ apply lt_O_nth_prime_n | assumption ]*) @@ -624,7 +624,7 @@ nth_prime ((max_p f)+i) \divides defactorize_aux f i. intro. elim f [ simplify. - auto + autobatch (*apply (witness ? ? ((nth_prime i) \sup n)). reflexivity*) | change with @@ -634,7 +634,7 @@ elim f rewrite > H1. rewrite < sym_times. rewrite > assoc_times. - auto + autobatch (*rewrite < plus_n_Sm. apply (witness ? ? (n2* (nth_prime i) \sup n)). reflexivity*) @@ -647,7 +647,7 @@ p \divides n \sup m \to p \divides n. intros 3. elim m [ simplify in H1. - auto + autobatch (*apply (transitive_divides p (S O)) [ assumption | apply divides_SO_n @@ -655,10 +655,10 @@ elim m | cut (p \divides n \lor p \divides n \sup n1) [ elim Hcut [ assumption - | auto + | autobatch (*apply H;assumption*) ] - | auto + | autobatch (*apply divides_times_to_divides [ assumption | exact H2 @@ -675,11 +675,11 @@ unfold prime in H1. elim H1. apply H4 [ apply (divides_exp_to_divides p q m);assumption -| (*invocando auto in questo punto, dopo piu' di 8 minuti la computazione non +| (*invocando autobatch in questo punto, dopo piu' di 8 minuti la computazione non * era ancora terminata. *) unfold prime in H. - (*invocando auto anche in questo punto, dopo piu' di 10 minuti la computazione + (*invocando autobatch anche in questo punto, dopo piu' di 10 minuti la computazione * non era ancora terminata. *) elim H. @@ -695,7 +695,7 @@ elim f (nth_prime i \divides (nth_prime j) \sup (S n) \to False). intro. absurd ((nth_prime i) = (nth_prime j)) - [ apply (divides_exp_to_eq ? ? (S n));auto + [ apply (divides_exp_to_eq ? ? (S n));autobatch (*[ apply prime_nth_prime | apply prime_nth_prime | assumption @@ -716,7 +716,7 @@ elim f \lor nth_prime i \divides defactorize_aux n1 (S j)) [ elim Hcut [ absurd ((nth_prime i) = (nth_prime j)) - [ apply (divides_exp_to_eq ? ? n);auto + [ apply (divides_exp_to_eq ? ? n);autobatch (*[ apply prime_nth_prime | apply prime_nth_prime | assumption @@ -731,7 +731,7 @@ elim f ] ] | apply (H i (S j)) - [ auto + [ autobatch (*apply (trans_lt ? j) [ assumption | unfold lt. @@ -740,7 +740,7 @@ elim f | assumption ] ] - | auto + | autobatch (*apply divides_times_to_divides. apply prime_nth_prime. assumption*) @@ -756,9 +756,9 @@ change with intro. cut (S(max_p g)+i= i) [ apply (not_le_Sn_n i). - rewrite < Hcut in \vdash (? ? %). (*chiamando auto qui da uno strano errore "di tipo"*) + rewrite < Hcut in \vdash (? ? %). (*chiamando autobatch qui da uno strano errore "di tipo"*) simplify. - auto + autobatch (*apply le_S_S. apply le_plus_n*) | apply injective_nth_prime. @@ -781,10 +781,10 @@ unfold Not. rewrite < plus_n_O. intro. apply (not_divides_defactorize_aux f i (S i) ?) -[ auto +[ autobatch (*unfold lt. apply le_n*) -| auto +| autobatch (*rewrite > H. rewrite > assoc_times. apply (witness ? ? ((exp (nth_prime i) n)*(defactorize_aux g (S i)))). @@ -802,18 +802,18 @@ elim f apply inj_S. apply (inj_exp_r (nth_prime i)) [ apply lt_SO_nth_prime_n - | (*qui auto non conclude il goal attivo*) + | (*qui autobatch non conclude il goal attivo*) assumption ] | apply False_ind. - (*auto chiamato qui NON conclude il goal attivo*) + (*autobatch chiamato qui NON conclude il goal attivo*) apply (not_eq_nf_last_nf_cons n2 n n1 i H2) ] | generalize in match H1. elim g [ apply False_ind. apply (not_eq_nf_last_nf_cons n1 n2 n i). - auto + autobatch (*apply sym_eq. assumption*) | simplify in H3. @@ -824,7 +824,7 @@ elim f nf_cons n n1 = nf_cons n2 n3)) [ intro. elim n4 - [ auto + [ autobatch (*apply eq_f. apply (H n3 (S i)) simplify in H4. @@ -833,20 +833,20 @@ elim f assumption*) | apply False_ind. apply (not_eq_nf_cons_O_nf_cons n1 n3 n5 i). - (*auto chiamato qui NON chiude il goal attivo*) + (*autobatch chiamato qui NON chiude il goal attivo*) assumption ] | intros. apply False_ind. apply (not_eq_nf_cons_O_nf_cons n3 n1 n4 i). apply sym_eq. - (*auto chiamato qui non chiude il goal*) + (*autobatch chiamato qui non chiude il goal*) assumption | intros. cut (nf_cons n4 n1 = nf_cons m n3) [ cut (n4=m) [ cut (n1=n3) - [ auto + [ autobatch (*rewrite > Hcut1. rewrite > Hcut2. reflexivity*) @@ -855,7 +855,7 @@ elim f [ (nf_last m) \Rightarrow n1 | (nf_cons m g) \Rightarrow g ] = n3). rewrite > Hcut. - auto + autobatch (*simplify. reflexivity*) ] @@ -863,9 +863,9 @@ elim f (match nf_cons n4 n1 with [ (nf_last m) \Rightarrow m | (nf_cons m g) \Rightarrow m ] = m). - (*invocando auto qui, dopo circa 8 minuti la computazione non era ancora terminata*) + (*invocando autobatch qui, dopo circa 8 minuti la computazione non era ancora terminata*) rewrite > Hcut. - auto + autobatch (*simplify. reflexivity*) ] @@ -909,7 +909,7 @@ elim f apply False_ind. apply (not_le_Sn_n O). rewrite > H1 in \vdash (? ? %). - auto + autobatch (*change with (O < defactorize_aux n O). apply lt_O_defactorize_aux*) ] @@ -918,7 +918,7 @@ elim f [ (* one - zero *) simplify in H1. apply False_ind. - auto + autobatch (*apply (not_eq_O_S O). apply sym_eq. assumption*) @@ -929,7 +929,7 @@ elim f apply False_ind. apply (not_le_Sn_n (S O)). rewrite > H1 in \vdash (? ? %). - auto + autobatch (*change with ((S O) < defactorize_aux n O). apply lt_SO_defactorize_aux*) ] @@ -940,7 +940,7 @@ elim f apply False_ind. apply (not_le_Sn_n O). rewrite < H1 in \vdash (? ? %). - auto + autobatch (*change with (O < defactorize_aux n O). apply lt_O_defactorize_aux.*) | (* proper - one *) @@ -948,13 +948,13 @@ elim f apply False_ind. apply (not_le_Sn_n (S O)). rewrite < H1 in \vdash (? ? %). - auto + autobatch (*change with ((S O) < defactorize_aux n O). apply lt_SO_defactorize_aux.*) | (* proper - proper *) apply eq_f. apply (injective_defactorize_aux O). - (*invocata qui la tattica auto NON chiude il goal, chiuso invece + (*invocata qui la tattica autobatch NON chiude il goal, chiuso invece *da exact H1 *) exact H1 @@ -965,7 +965,7 @@ qed. theorem factorize_defactorize: \forall f,g: nat_fact_all. factorize (defactorize f) = f. intros. -auto. +autobatch. (*apply injective_defactorize. apply defactorize_factorize. *) diff --git a/matita/library_auto/auto/nat/fermat_little_theorem.ma b/matita/library_auto/auto/nat/fermat_little_theorem.ma index 6fc31a7d1..a04adaad8 100644 --- a/matita/library_auto/auto/nat/fermat_little_theorem.ma +++ b/matita/library_auto/auto/nat/fermat_little_theorem.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -set "baseuri" "cic:/matita/library_auto/nat/fermat_little_theorem". +set "baseuri" "cic:/matita/library_autobatch/nat/fermat_little_theorem". include "auto/nat/exp.ma". include "auto/nat/gcd.ma". @@ -25,7 +25,7 @@ unfold permut. split [ intros. unfold S_mod. - auto + autobatch (*apply le_S_S_to_le. change with ((S i) \mod (S n) < S n). apply lt_mod_m_m. @@ -44,26 +44,26 @@ split [ (* i < n, j< n *) rewrite < mod_S [ rewrite < mod_S - [ (*qui auto non chiude il goal, chiuso invece dalla tattica + [ (*qui autobatch non chiude il goal, chiuso invece dalla tattica * apply H2 *) apply H2 - | auto + | autobatch (*unfold lt. apply le_S_S. apply le_O_n*) | rewrite > lt_to_eq_mod; - unfold lt;auto.(*apply le_S_S;assumption*) + unfold lt;autobatch.(*apply le_S_S;assumption*) ] - | auto + | autobatch (*unfold lt. apply le_S_S. apply le_O_n*) | rewrite > lt_to_eq_mod - [ unfold lt.auto + [ unfold lt.autobatch (*apply le_S_S. assumption*) - | unfold lt.auto + | unfold lt.autobatch (*apply le_S_S. assumption*) ] @@ -78,13 +78,13 @@ split [ rewrite < H4 in \vdash (? ? ? (? %?)). rewrite < mod_S [ assumption - | unfold lt.auto + | unfold lt.autobatch (*apply le_S_S. apply le_O_n*) | rewrite > lt_to_eq_mod; - unfold lt;auto;(*apply le_S_S;assumption*) + unfold lt;autobatch;(*apply le_S_S;assumption*) ] - | unfold lt.auto + | unfold lt.autobatch (*apply le_S_S. apply le_O_n*) ] @@ -97,36 +97,36 @@ split [ rewrite < H3 in \vdash (? ? (? %?) ?). rewrite < mod_S [ assumption - | unfold lt.auto + | unfold lt.autobatch (*apply le_S_S. apply le_O_n*) | rewrite > lt_to_eq_mod; - unfold lt;auto(*apply le_S_S;assumption*) + unfold lt;autobatch(*apply le_S_S;assumption*) ] - | unfold lt.auto + | unfold lt.autobatch (*apply le_S_S. apply le_O_n*) ] |(* i = n, j= n*) - auto + autobatch (*rewrite > H3. rewrite > H4. reflexivity*) ] ] - | auto + | autobatch (*apply le_to_or_lt_eq. assumption*) ] - | auto + | autobatch (*apply le_to_or_lt_eq. assumption*) ] - | unfold lt.auto + | unfold lt.autobatch (*apply le_S_S. assumption*) ] - | unfold lt.auto + | unfold lt.autobatch (*apply le_S_S. assumption*) ] @@ -155,7 +155,7 @@ elim n [ unfold prime in H. elim H. assumption - | auto + | autobatch (*apply divides_to_le. unfold lt. apply le_n. @@ -167,7 +167,7 @@ elim n [ elim Hcut [ apply (lt_to_not_le (S n1) p) [ assumption - | auto + | autobatch (*apply divides_to_le [ unfold lt. apply le_S_S. @@ -175,7 +175,7 @@ elim n | assumption ]*) ] - | auto + | autobatch (*apply H1 [ apply (trans_lt ? (S n1)) [ unfold lt. @@ -185,7 +185,7 @@ elim n | assumption ]*) ] - | auto + | autobatch (*apply divides_times_to_divides; assumption*) ] @@ -204,7 +204,7 @@ split apply lt_mod_m_m. unfold prime in H. elim H. - auto + autobatch (*unfold lt. apply (trans_le ? (S (S O))) [ apply le_n_Sn @@ -214,7 +214,7 @@ split [ apply le_n | unfold prime in H. elim H. - auto + autobatch (*apply (trans_lt ? (S O)) [ unfold lt. apply le_n @@ -230,7 +230,7 @@ split absurd (j-i \lt p) [ unfold lt. rewrite > (S_pred p) - [ auto + [ autobatch (*apply le_S_S. apply le_plus_to_minus. apply (trans_le ? (pred p)) @@ -238,7 +238,7 @@ split | rewrite > sym_plus. apply le_plus_n ]*) - | unfold prime in H. elim H. auto. + | unfold prime in H. elim H. autobatch. (* apply (trans_lt ? (S O)) [ unfold lt. @@ -248,13 +248,13 @@ split ] | apply (le_to_not_lt p (j-i)). apply divides_to_le - [ unfold lt.auto + [ unfold lt.autobatch (*apply le_SO_minus. assumption*) | cut (divides p a \lor divides p (j-i)) [ elim Hcut [ apply False_ind. - auto + autobatch (*apply H1. assumption*) | assumption @@ -263,13 +263,13 @@ split [ assumption | rewrite > distr_times_minus. apply eq_mod_to_divides - [ unfold prime in H.elim H.auto + [ unfold prime in H.elim H.autobatch (*apply (trans_lt ? (S O)) [ unfold lt. apply le_n | assumption ]*) - | auto + | autobatch (*apply sym_eq. apply H4*) ] @@ -278,7 +278,7 @@ split ] ] |(* i = j *) - auto + autobatch (*intro. assumption*) | (* j < i *) @@ -286,7 +286,7 @@ split absurd (i-j \lt p) [ unfold lt. rewrite > (S_pred p) - [ auto + [ autobatch (*apply le_S_S. apply le_plus_to_minus. apply (trans_le ? (pred p)) @@ -294,7 +294,7 @@ split | rewrite > sym_plus. apply le_plus_n ]*) - | unfold prime in H.elim H.auto. + | unfold prime in H.elim H.autobatch. (* apply (trans_lt ? (S O)) [ unfold lt. @@ -304,13 +304,13 @@ split ] | apply (le_to_not_lt p (i-j)). apply divides_to_le - [ unfold lt.auto + [ unfold lt.autobatch (*apply le_SO_minus. assumption*) | cut (divides p a \lor divides p (i-j)) [ elim Hcut [ apply False_ind. - auto + autobatch (*apply H1. assumption*) | assumption @@ -319,7 +319,7 @@ split [ assumption | rewrite > distr_times_minus. apply eq_mod_to_divides - [ unfold prime in H.elim H.auto. + [ unfold prime in H.elim H.autobatch. (* apply (trans_lt ? (S O)) [ unfold lt. @@ -344,7 +344,7 @@ cut (O < a) [ cut (O < pred p) [ apply divides_to_congruent [ assumption - | auto + | autobatch (*change with (O < exp a (pred p)). apply lt_O_exp. assumption*) @@ -354,7 +354,7 @@ cut (O < a) | apply False_ind. apply (prime_to_not_divides_fact p H (pred p)) [ unfold lt. - auto + autobatch (*rewrite < (S_pred ? Hcut1). apply le_n*) | assumption @@ -382,25 +382,25 @@ cut (O < a) rewrite < eq_map_iter_i_pi. apply (permut_to_eq_map_iter_i ? ? ? ? ? (λm.m)) [ apply assoc_times - | (*NB qui auto non chiude il goal, chiuso invece dalla sola + | (*NB qui autobatch non chiude il goal, chiuso invece dalla sola ( tattica apply sys_times *) apply sym_times | rewrite < plus_n_Sm. rewrite < plus_n_O. rewrite < (S_pred ? Hcut2). - auto + autobatch (*apply permut_mod [ assumption | assumption ]*) | intros. cut (m=O) - [ auto + [ autobatch (*rewrite > Hcut3. rewrite < times_n_O. apply mod_O_n.*) - | auto + | autobatch (*apply sym_eq. apply le_n_O_to_eq. apply le_S_S_to_le. @@ -422,7 +422,7 @@ cut (O < a) ] | unfold prime in H. elim H. - auto + autobatch (*apply (trans_lt ? (S O)) [ unfold lt. apply le_n @@ -435,11 +435,11 @@ cut (O < a) | apply False_ind. apply H1. rewrite < H2. - auto + autobatch (*apply (witness ? ? O). apply times_n_O*) ] - | auto + | autobatch (*apply le_to_or_lt_eq. apply le_O_n*) ] diff --git a/matita/library_auto/auto/nat/gcd.ma b/matita/library_auto/auto/nat/gcd.ma index 93589d66e..e9c4752d6 100644 --- a/matita/library_auto/auto/nat/gcd.ma +++ b/matita/library_auto/auto/nat/gcd.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -set "baseuri" "cic:/matita/library_auto/nat/gcd". +set "baseuri" "cic:/matita/library_autobatch/nat/gcd". include "auto/nat/primes.ma". @@ -48,7 +48,7 @@ apply (witness ? ? (n2 - n1*(m / n))). apply sym_eq. apply plus_to_minus. rewrite > sym_times. - auto. + autobatch. (*letin x \def div. rewrite < (div_mod ? ? H). reflexivity.*) @@ -66,7 +66,7 @@ rewrite < H3. rewrite < assoc_times. rewrite < H4. rewrite < sym_times. -auto. +autobatch. (*apply div_mod. assumption.*) qed. @@ -76,7 +76,7 @@ theorem divides_gcd_aux_mn: \forall p,m,n. O < n \to n \le m \to n \le p \to gcd_aux p m n \divides m \land gcd_aux p m n \divides n. intro. elim p -[ absurd (O < n);auto +[ absurd (O < n);autobatch (*[ assumption | apply le_to_not_lt. assumption @@ -86,7 +86,7 @@ elim p elim Hcut [ rewrite > divides_to_divides_b_true [ simplify. - auto + autobatch (*split [ assumption | apply (witness n1 n1 (S O)). @@ -100,7 +100,7 @@ elim p cut (gcd_aux n n1 (m \mod n1) \divides n1 \land gcd_aux n n1 (m \mod n1) \divides mod m n1) [ elim Hcut1. - auto width = 4. + autobatch width = 4. (*split [ apply (divides_mod_to_divides ? ? n1);assumption | assumption @@ -110,7 +110,7 @@ elim p [ elim Hcut1 [ assumption | apply False_ind. - auto + autobatch (*apply H4. apply mod_O_to_divides [ assumption @@ -118,17 +118,17 @@ elim p assumption ]*) ] - | auto + | autobatch (*apply le_to_or_lt_eq. apply le_O_n*) ] - | auto + | autobatch (*apply lt_to_le. apply lt_mod_m_m. assumption*) | apply le_S_S_to_le. - apply (trans_le ? n1);auto - (*[ auto.change with (m \mod n1 < n1). + apply (trans_le ? n1);autobatch + (*[ autobatch.change with (m \mod n1 < n1). apply lt_mod_m_m. assumption | assumption @@ -139,7 +139,7 @@ elim p | assumption ] ] - | auto + | autobatch (*apply (decidable_divides n1 m). assumption*) ] @@ -174,7 +174,7 @@ apply (leb_elim n m) [ apply (nat_case1 n) [ simplify. intros. - auto + autobatch (*split [ apply (witness m m (S O)). apply times_n_SO @@ -186,7 +186,7 @@ apply (leb_elim n m) (gcd_aux (S m1) m (S m1) \divides m \land gcd_aux (S m1) m (S m1) \divides (S m1)). - auto + autobatch (*apply divides_gcd_aux_mn [ unfold lt. apply le_S_S. @@ -200,7 +200,7 @@ apply (leb_elim n m) apply (nat_case1 m) [ simplify. intros. - auto + autobatch (*split [ apply (witness n O O). apply times_n_O @@ -216,10 +216,10 @@ apply (leb_elim n m) \land gcd_aux (S m1) n (S m1) \divides S m1) [ elim Hcut. - auto + autobatch (*split;assumption*) | apply divides_gcd_aux_mn - [ auto + [ autobatch (*unfold lt. apply le_S_S. apply le_O_n*) @@ -229,7 +229,7 @@ apply (leb_elim n m) intro. apply H. rewrite > H1. - auto + autobatch (*apply (trans_le ? (S n)) [ apply le_n_Sn | assumption @@ -243,19 +243,19 @@ qed. theorem divides_gcd_n: \forall n,m. gcd n m \divides n. intros. -exact (proj2 ? ? (divides_gcd_nm n m)). (*auto non termina la dimostrazione*) +exact (proj2 ? ? (divides_gcd_nm n m)). (*autobatch non termina la dimostrazione*) qed. theorem divides_gcd_m: \forall n,m. gcd n m \divides m. intros. -exact (proj1 ? ? (divides_gcd_nm n m)). (*auto non termina la dimostrazione*) +exact (proj1 ? ? (divides_gcd_nm n m)). (*autobatch non termina la dimostrazione*) qed. theorem divides_gcd_aux: \forall p,m,n,d. O < n \to n \le m \to n \le p \to d \divides m \to d \divides n \to d \divides gcd_aux p m n. intro. elim p -[ absurd (O < n);auto +[ absurd (O < n);autobatch (*[ assumption | apply le_to_not_lt. assumption @@ -264,7 +264,7 @@ elim p cut (n1 \divides m \lor n1 \ndivides m) [ elim Hcut. rewrite > divides_to_divides_b_true; - simplify; auto. + simplify; autobatch. (*[ simplify. assumption. | assumption. @@ -277,7 +277,7 @@ elim p [ elim Hcut1 [ assumption | - absurd (n1 \divides m);auto + absurd (n1 \divides m);autobatch (*[ apply mod_O_to_divides [ assumption. | apply sym_eq.assumption. @@ -285,16 +285,16 @@ elim p | assumption ]*) ] - | auto + | autobatch (*apply le_to_or_lt_eq. apply le_O_n*) ] - | auto + | autobatch (*apply lt_to_le. apply lt_mod_m_m. assumption*) | apply le_S_S_to_le. - auto + autobatch (*apply (trans_le ? n1) [ change with (m \mod n1 < n1). apply lt_mod_m_m. @@ -302,14 +302,14 @@ elim p | assumption ]*) | assumption - | auto + | autobatch (*apply divides_mod; assumption*) ] | assumption | assumption ] - | auto + | autobatch (*apply (decidable_divides n1 m). assumption*) ] @@ -338,11 +338,11 @@ apply (leb_elim n m) | intros. change with (d \divides gcd_aux (S m1) m (S m1)). apply divides_gcd_aux - [ unfold lt.auto + [ unfold lt.autobatch (*apply le_S_S. apply le_O_n.*) | assumption. - | apply le_n. (*chiude il goal anche con auto*) + | apply le_n. (*chiude il goal anche con autobatch*) | assumption. | rewrite < H2. assumption @@ -355,14 +355,14 @@ apply (leb_elim n m) | intros. change with (d \divides gcd_aux (S m1) n (S m1)). apply divides_gcd_aux - [ unfold lt.auto + [ unfold lt.autobatch (*apply le_S_S. apply le_O_n*) - | auto + | autobatch (*apply lt_to_le. apply not_le_to_lt. assumption*) - | apply le_n (*chiude il goal anche con auto*) + | apply le_n (*chiude il goal anche con autobatch*) | assumption | rewrite < H2. assumption @@ -375,7 +375,7 @@ theorem eq_minus_gcd_aux: \forall p,m,n.O < n \to n \le m \to n \le p \to \exists a,b. a*n - b*m = gcd_aux p m n \lor b*m - a*n = gcd_aux p m n. intro. elim p -[ absurd (O < n);auto +[ absurd (O < n);autobatch (*[ assumption | apply le_to_not_lt assumption. @@ -388,7 +388,7 @@ elim p [ simplify. apply (ex_intro ? ? (S O)). apply (ex_intro ? ? O). - auto + autobatch (*left. simplify. rewrite < plus_n_O. @@ -420,12 +420,12 @@ elim p rewrite > distr_times_plus. rewrite > (sym_times n1). rewrite > (sym_times n1). - rewrite > (div_mod m n1) in \vdash (? ? (? % ?) ?);auto + rewrite > (div_mod m n1) in \vdash (? ? (? % ?) ?);autobatch (*[ rewrite > assoc_times. rewrite < sym_plus. rewrite > distr_times_plus. rewrite < eq_minus_minus_minus_plus. - rewrite < sym_plus.auto. + rewrite < sym_plus.autobatch. rewrite < plus_minus [ rewrite < minus_n_n. reflexivity @@ -447,7 +447,7 @@ elim p [ rewrite > distr_times_plus. rewrite > assoc_times. rewrite < eq_minus_minus_minus_plus. - auto + autobatch (*rewrite < sym_plus. rewrite < plus_minus [ rewrite < minus_n_n. @@ -461,7 +461,7 @@ elim p [ cut (O \lt m \mod n1 \lor O = m \mod n1) [ elim Hcut2 [ assumption - | absurd (n1 \divides m);auto + | absurd (n1 \divides m);autobatch (*[ apply mod_O_to_divides [ assumption | symmetry. @@ -470,16 +470,16 @@ elim p | assumption ]*) ] - | auto + | autobatch (*apply le_to_or_lt_eq. apply le_O_n*) ] - | auto + | autobatch (*apply lt_to_le. apply lt_mod_m_m. assumption*) | apply le_S_S_to_le. - auto + autobatch (*apply (trans_le ? n1) [ change with (m \mod n1 < n1). apply lt_mod_m_m. @@ -492,11 +492,11 @@ elim p | assumption ] ] - | auto + | autobatch (*apply (decidable_divides n1 m). assumption*) ] - | auto + | autobatch (*apply (lt_to_le_to_lt ? n1);assumption *) ] ] @@ -512,7 +512,7 @@ apply (leb_elim n m) intros. apply (ex_intro ? ? O). apply (ex_intro ? ? (S O)). - auto + autobatch (*right.simplify. rewrite < plus_n_O. apply sym_eq. @@ -522,7 +522,7 @@ apply (leb_elim n m) (\exists a,b. 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))). - auto + autobatch (*apply eq_minus_gcd_aux [ unfold lt. apply le_S_S. @@ -536,7 +536,7 @@ apply (leb_elim n m) intros. apply (ex_intro ? ? (S O)). apply (ex_intro ? ? O). - auto + autobatch (*left.simplify. rewrite < plus_n_O. apply sym_eq. @@ -553,7 +553,7 @@ apply (leb_elim n m) b*n - a*(S m1) = (gcd_aux (S m1) n (S m1))) [ elim Hcut. elim H2. - elim H3;apply (ex_intro ? ? a1);auto + elim H3;apply (ex_intro ? ? a1);autobatch (*[ apply (ex_intro ? ? a1). apply (ex_intro ? ? a). right. @@ -563,11 +563,11 @@ apply (leb_elim n m) left. assumption ]*) - | apply eq_minus_gcd_aux;auto + | apply eq_minus_gcd_aux;autobatch (*[ unfold lt. apply le_S_S. apply le_O_n - | auto.apply lt_to_le. + | autobatch.apply lt_to_le. apply not_le_to_lt. assumption | apply le_n. @@ -580,7 +580,7 @@ qed. (* some properties of gcd *) theorem gcd_O_n: \forall n:nat. gcd O n = n. -auto. +autobatch. (*intro.simplify.reflexivity.*) qed. @@ -589,7 +589,7 @@ m = O \land n = O. intros. cut (O \divides n \land O \divides m) [ elim Hcut. - auto size = 7; + autobatch size = 7; (* split; [ apply antisymmetric_divides @@ -608,7 +608,7 @@ qed. theorem lt_O_gcd:\forall m,n:nat. O < n \to O < gcd m n. intros. -auto. +autobatch. (* apply (divides_to_lt_O (gcd m n) n ? ?); [apply (H). @@ -619,7 +619,7 @@ qed. theorem gcd_n_n: \forall n.gcd n n = n. intro. -auto. +autobatch. (* apply (antisymmetric_divides (gcd n n) n ? ?); [apply (divides_gcd_n n n). @@ -643,7 +643,7 @@ elim (le_to_or_lt_eq ? ? (le_O_n i)) unfold. intro. apply (lt_to_not_eq (S O) n H). - auto + autobatch (*apply sym_eq. assumption*) ] @@ -690,7 +690,7 @@ theorem symmetric_gcd: symmetric nat gcd. change with (\forall n,m:nat. gcd n m = gcd m n). intros. -auto size = 7. +autobatch size = 7. (* apply (antisymmetric_divides (gcd n m) (gcd m n) ? ?); [apply (divides_d_gcd n m (gcd n m) ? ?); @@ -715,15 +715,15 @@ apply (nat_case n) | intro. apply divides_to_le [ apply lt_O_gcd. - auto + autobatch (*rewrite > (times_n_O O). apply lt_times - [ auto.unfold lt. + [ autobatch.unfold lt. apply le_S_S. apply le_O_n | assumption ]*) - | apply divides_d_gcd;auto + | apply divides_d_gcd;autobatch (*[ apply (transitive_divides ? (S m1)) [ apply divides_gcd_m | apply (witness ? ? p). @@ -740,10 +740,10 @@ gcd m (n*p) = (S O) \to gcd m n = (S O). intros. apply antisymmetric_le [ rewrite < H2. - auto + autobatch (*apply le_gcd_times. assumption*) -| auto +| autobatch (*change with (O < gcd m n). apply lt_O_gcd. assumption*) @@ -761,8 +761,8 @@ rewrite > H3. intro. cut (O < n2) [ elim (gcd_times_SO_to_gcd_SO n n n2 ? ? H4) - [ cut (gcd n (n*n2) = n);auto - (*[ auto.apply (lt_to_not_eq (S O) n) + [ cut (gcd n (n*n2) = n);autobatch + (*[ autobatch.apply (lt_to_not_eq (S O) n) [ assumption | rewrite < H4. assumption @@ -770,7 +770,7 @@ cut (O < n2) | apply gcd_n_times_nm. assumption ]*) - | auto + | autobatch (*apply (trans_lt ? (S O)) [ apply le_n | assumption @@ -782,7 +782,7 @@ cut (O < n2) | apply False_ind. apply (le_to_not_lt n (S O)) [ rewrite < H4. - apply divides_to_le;auto + apply divides_to_le;autobatch (*[ rewrite > H4. apply lt_O_S | apply divides_d_gcd @@ -799,7 +799,7 @@ qed. theorem gcd_SO_n: \forall n:nat. gcd (S O) n = (S O). intro. -auto. +autobatch. (* apply (symmetric_eq nat (S O) (gcd (S O) n) ?). apply (antisymmetric_divides (S O) (gcd (S O) n) ? ?); @@ -812,7 +812,7 @@ qed. theorem divides_gcd_mod: \forall m,n:nat. O < n \to divides (gcd m n) (gcd n (m \mod n)). intros. -auto width = 4. +autobatch width = 4. (*apply divides_d_gcd [ apply divides_mod [ assumption @@ -826,7 +826,7 @@ qed. theorem divides_mod_gcd: \forall m,n:nat. O < n \to divides (gcd n (m \mod n)) (gcd m n) . intros. -auto. +autobatch. (*apply divides_d_gcd [ apply divides_gcd_n | apply (divides_mod_to_divides ? ? n) @@ -840,7 +840,7 @@ qed. theorem gcd_mod: \forall m,n:nat. O < n \to (gcd n (m \mod n)) = (gcd m n) . intros. -auto. +autobatch. (*apply antisymmetric_divides [ apply divides_mod_gcd. assumption @@ -860,7 +860,7 @@ apply antisym_le intro. apply H1. rewrite < (H3 (gcd n m)); - [auto|auto| unfold lt; auto] + [autobatch|autobatch| unfold lt; autobatch] (*[ apply divides_gcd_m | apply divides_gcd_n | assumption @@ -874,13 +874,13 @@ apply antisym_le [ elim Hcut1. rewrite < H5 in \vdash (? ? %). assumption - | auto + | autobatch (*apply gcd_O_to_eq_O. apply sym_eq. assumption*) ] ] - | auto + | autobatch (*apply le_to_or_lt_eq. apply le_O_n*) ] @@ -921,7 +921,7 @@ cut (n \divides p \lor n \ndivides p) rewrite > (sym_times q (a1*p)). rewrite > (assoc_times a1). elim H1. - auto + autobatch (*rewrite > H6. rewrite < sym_times.rewrite > assoc_times. rewrite < (assoc_times q). @@ -930,7 +930,7 @@ cut (n \divides p \lor n \ndivides p) apply (witness ? ? (n2*a1-q*a)). reflexivity*) ](* end second case *) - | rewrite < (prime_to_gcd_SO n p);auto + | rewrite < (prime_to_gcd_SO n p);autobatch (* [ apply eq_minus_gcd | assumption | assumption @@ -939,7 +939,7 @@ cut (n \divides p \lor n \ndivides p) ] | apply (decidable_divides n p). apply (trans_lt ? (S O)) - [ auto + [ autobatch (*unfold lt. apply le_n*) | unfold prime in H. @@ -962,16 +962,16 @@ apply antisymmetric_le change with ((S O) < (S O)). rewrite < H2 in \vdash (? ? %). apply (lt_to_le_to_lt ? (smallest_factor (gcd m (n*p)))) - [ auto + [ autobatch (*apply lt_SO_smallest_factor. assumption*) | apply divides_to_le; - [ auto | + [ autobatch | apply divides_d_gcd [ assumption | apply (transitive_divides ? (gcd m (n*p))) - [ auto. - | auto. + [ autobatch. + | autobatch. ] ] ] @@ -999,12 +999,12 @@ apply antisymmetric_le [ apply lt_SO_smallest_factor. assumption | apply divides_to_le; - [ auto | + [ autobatch | apply divides_d_gcd [ assumption | apply (transitive_divides ? (gcd m (n*p))) - [ auto. - | auto. + [ autobatch. + | autobatch. ] ] ] @@ -1027,16 +1027,16 @@ apply antisymmetric_le ] ] | apply divides_times_to_divides; - [ auto | + [ autobatch | apply (transitive_divides ? (gcd m (n*p))) - [ auto. - | auto. + [ autobatch. + | autobatch. ] ] ] (*[ apply prime_smallest_factor_n. assumption - | auto.apply (transitive_divides ? (gcd m (n*p))) + | autobatch.apply (transitive_divides ? (gcd m (n*p))) [ apply divides_smallest_factor_n. apply (trans_lt ? (S O)) [ unfold lt. @@ -1046,7 +1046,7 @@ apply antisymmetric_le | apply divides_gcd_m ] ]*) -| auto +| autobatch (*change with (O < gcd m (n*p)). apply lt_O_gcd. rewrite > (times_n_O O). @@ -1081,7 +1081,7 @@ cut (n \divides p \lor n \ndivides p) apply eq_minus_gcd ] ] -| auto +| autobatch (*apply (decidable_divides n p). assumption.*) ] diff --git a/matita/library_auto/auto/nat/le_arith.ma b/matita/library_auto/auto/nat/le_arith.ma index ea50a2476..13b4f3ac4 100644 --- a/matita/library_auto/auto/nat/le_arith.ma +++ b/matita/library_auto/auto/nat/le_arith.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -set "baseuri" "cic:/matita/library_auto/nat/le_arith". +set "baseuri" "cic:/matita/library_autobatch/nat/le_arith". include "auto/nat/times.ma". include "auto/nat/orders.ma". @@ -23,7 +23,7 @@ theorem monotonic_le_plus_r: simplify.intros. elim n;simplify [ assumption -| auto +| autobatch (*apply le_S_S.assumption*) ] qed. @@ -47,7 +47,7 @@ theorem monotonic_le_plus_l: simplify.intros. rewrite < sym_plus. rewrite < (sym_plus m). - auto. + autobatch. qed. *) theorem le_plus_l: \forall p,n,m:nat. n \le m \to n + p \le m + p @@ -56,7 +56,7 @@ theorem le_plus_l: \forall p,n,m:nat. n \le m \to n + p \le m + p theorem le_plus: \forall n1,n2,m1,m2:nat. n1 \le n2 \to m1 \le m2 \to n1 + m1 \le n2 + m2. intros. -auto. +autobatch. (*apply (trans_le ? (n2 + m1)). apply le_plus_l.assumption. apply le_plus_r.assumption.*) @@ -65,7 +65,7 @@ qed. theorem le_plus_n :\forall n,m:nat. m \le n + m. intros. change with (O+m \le n+m). -auto. +autobatch. (*apply le_plus_l. apply le_O_n.*) qed. @@ -74,7 +74,7 @@ theorem eq_plus_to_le: \forall n,m,p:nat.n=m+p \to m \le n. intros. rewrite > H. rewrite < sym_plus. -apply le_plus_n. (* a questo punto funziona anche: auto.*) +apply le_plus_n. (* a questo punto funziona anche: autobatch.*) qed. (* times *) @@ -82,7 +82,7 @@ theorem monotonic_le_times_r: \forall n:nat.monotonic nat le (\lambda m. n * m). simplify.intros.elim n;simplify [ apply le_O_n. -| auto. +| autobatch. (*apply le_plus; assumption. *) (* chiudo entrambi i goal attivi in questo modo*) ] @@ -107,7 +107,7 @@ theorem monotonic_le_times_l: simplify.intros. rewrite < sym_times. rewrite < (sym_times m). -auto. +autobatch. qed. *) @@ -117,7 +117,7 @@ theorem le_times_l: \forall p,n,m:nat. n \le m \to n*p \le m*p theorem le_times: \forall n1,n2,m1,m2:nat. n1 \le n2 \to m1 \le m2 \to n1*m1 \le n2*m2. intros. -auto. +autobatch. (*apply (trans_le ? (n2*m1)). apply le_times_l.assumption. apply le_times_r.assumption.*) @@ -125,10 +125,10 @@ qed. theorem le_times_n: \forall n,m:nat.(S O) \le n \to m \le n*m. intros.elim H;simplify -[ auto +[ autobatch (*elim (plus_n_O ?). apply le_n....*) -| auto +| autobatch (*rewrite < sym_plus. apply le_plus_n.*) ] diff --git a/matita/library_auto/auto/nat/lt_arith.ma b/matita/library_auto/auto/nat/lt_arith.ma index 4c0578623..4c24196ae 100644 --- a/matita/library_auto/auto/nat/lt_arith.ma +++ b/matita/library_auto/auto/nat/lt_arith.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -set "baseuri" "cic:/matita/library_auto/nat/lt_arith". +set "baseuri" "cic:/matita/library_autobatch/nat/lt_arith". include "auto/nat/div_and_mod.ma". @@ -22,7 +22,7 @@ theorem monotonic_lt_plus_r: simplify.intros. elim n;simplify [ assumption -| auto. +| autobatch. (*unfold lt. apply le_S_S. assumption.*) @@ -40,14 +40,14 @@ intros. rewrite < (sym_plus n).*) applyS lt_plus_r.assumption. qed. -(* IN ALTERNATIVA: mantengo le 2 rewrite, e concludo con auto. *) +(* IN ALTERNATIVA: mantengo le 2 rewrite, e concludo con autobatch. *) variant lt_plus_l: \forall n,p,q:nat. p < q \to p + n < q + n \def monotonic_lt_plus_l. theorem lt_plus: \forall n,m,p,q:nat. n < m \to p < q \to n + p < m + q. intros. -auto. +autobatch. (*apply (trans_lt ? (n + q)). apply lt_plus_r.assumption. apply lt_plus_l.assumption.*) @@ -78,7 +78,7 @@ qed. (* times and zero *) theorem lt_O_times_S_S: \forall n,m:nat.O < (S n)*(S m). intros. -auto. +autobatch. (*simplify. unfold lt. apply le_S_S. @@ -90,7 +90,7 @@ theorem monotonic_lt_times_r: \forall n:nat.monotonic nat lt (\lambda m.(S n)*m). simplify. intros.elim n -[ auto +[ autobatch (*simplify. rewrite < plus_n_O. rewrite < plus_n_O. @@ -111,7 +111,7 @@ intros. applyS lt_times_r.assumption. qed. -(* IN ALTERNATIVA: mantengo le 2 rewrite, e concludo con auto. *) +(* IN ALTERNATIVA: mantengo le 2 rewrite, e concludo con autobatch. *) variant lt_times_l: \forall n,p,q:nat. p nat_compare_n_n. reflexivity*) @@ -211,21 +211,21 @@ apply nat_compare_elim apply nat_compare_elim [ intro. absurd (p H2. assumption. -| auto +| autobatch (*unfold lt. apply le_S_S. apply le_O_n.*) @@ -270,21 +270,21 @@ apply (nat_case1 (n / m)) rewrite > H2. simplify. unfold lt. - auto. + autobatch. (*rewrite < plus_n_O. rewrite < plus_n_Sm. apply le_S_S. apply le_S_S. apply le_plus_n*) - | auto + | autobatch (*apply le_times_r. assumption*) ] - | auto + | autobatch (*rewrite < sym_plus. apply le_plus_n*) ] - | auto + | autobatch (*apply (trans_lt ? (S O)). unfold lt. apply le_n. @@ -303,7 +303,7 @@ apply (nat_compare_elim x y) apply (not_le_Sn_n (f x)). rewrite > H1 in \vdash (? ? %). change with (f x < f y). - auto + autobatch (*apply H. apply H2*) | intros. @@ -313,7 +313,7 @@ apply (nat_compare_elim x y) apply (not_le_Sn_n (f y)). rewrite < H1 in \vdash (? ? %). change with (f y < f x). - auto + autobatch (*apply H. apply H2*) ] @@ -322,7 +322,7 @@ qed. theorem increasing_to_injective: \forall f:nat\to nat. increasing f \to injective nat nat f. intros. -auto. +autobatch. (*apply monotonic_to_injective. apply increasing_to_monotonic. assumption.*) diff --git a/matita/library_auto/auto/nat/map_iter_p.ma b/matita/library_auto/auto/nat/map_iter_p.ma index 7ac81c367..d5ab380d1 100644 --- a/matita/library_auto/auto/nat/map_iter_p.ma +++ b/matita/library_auto/auto/nat/map_iter_p.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -set "baseuri" "cic:/matita/library_auto/nat/map_iter_p.ma". +set "baseuri" "cic:/matita/library_autobatch/nat/map_iter_p.ma". include "auto/nat/permutation.ma". include "auto/nat/count.ma". @@ -33,20 +33,20 @@ theorem eq_map_iter_p: \forall g1,g2:nat \to nat. map_iter_p n p g1 a f = map_iter_p n p g2 a f. intros 6. elim n -[ auto +[ autobatch (*simplify. reflexivity*) | simplify. elim (p (S n1)) [ simplify. apply eq_f2 - [ auto + [ autobatch (*apply H1. apply le_n*) | simplify. apply H. intros. - auto + autobatch (*apply H1. apply le_S. assumption*) @@ -54,7 +54,7 @@ elim n | simplify. apply H. intros. - auto + autobatch (*apply H1. apply le_S. assumption*) @@ -67,7 +67,7 @@ qed. theorem map_iter_p_O: \forall p.\forall g.\forall f. \forall a:nat. map_iter_p O p g a f = a. intros. -auto. +autobatch. (*simplify.reflexivity.*) qed. @@ -100,13 +100,13 @@ lemma lt_O_pi_p: \forall n.\forall p. O < pi_p p n. intros. elim n -[ auto +[ autobatch (*simplify. apply le_n*) | rewrite > pi_p_S. elim p (S n1) [ change with (O < (S n1)*(pi_p p n1)). - auto + autobatch (*rewrite >(times_n_O n1). apply lt_times [ apply le_n @@ -128,13 +128,13 @@ p O = false \to count (S n) p = card n p. intros. elim n [ simplify. - auto + autobatch (*rewrite > H. reflexivity*) | simplify. rewrite < plus_n_O. apply eq_f. - (*qui auto non chiude un goal chiuso invece dal solo assumption*) + (*qui autobatch non chiude un goal chiuso invece dal solo assumption*) assumption ] qed. @@ -145,12 +145,12 @@ intros 3. apply (nat_case n) [ intro. simplify. - auto + autobatch (*rewrite > H. reflexivity*) | intros.rewrite > (count_card ? ? H). simplify. - auto + autobatch (*rewrite > H1. reflexivity*) ] @@ -160,7 +160,7 @@ lemma a_times_pi_p: \forall p. \forall a,n. exp a (card n p) * pi_p p n = map_iter_p n p (\lambda n.a*n) (S O) times. intros. elim n -[ auto +[ autobatch (*simplify. reflexivity*) | simplify. @@ -170,9 +170,9 @@ elim n (a*exp a (card n1 p) * ((S n1) * (pi_p p n1)) = a*(S n1)*map_iter_p n1 p (\lambda n.a*n) (S O) times). rewrite < H. - auto + autobatch | intro. - (*la chiamata di auto in questo punto dopo circa 8 minuti non aveva + (*la chiamata di autobatch in questo punto dopo circa 8 minuti non aveva * ancora generato un risultato *) assumption @@ -225,7 +225,7 @@ split [ unfold compose. assumption | unfold compose. - auto + autobatch (*rewrite < H11. reflexivity*) ] @@ -233,7 +233,7 @@ split unfold compose. apply (H9 (f j)) [ elim (H j H13 H12). - auto + autobatch (*elim H15. rewrite < H18. reflexivity*) @@ -256,14 +256,14 @@ split split [ elim H4. elim (le_to_or_lt_eq (f i) (S n)) - [ auto + [ autobatch (*apply le_S_S_to_le. assumption*) | absurd (f i = (S n)) [ assumption | rewrite < H1. apply H5 - [ auto + [ autobatch (*rewrite < H8. assumption*) | apply le_n @@ -274,13 +274,13 @@ split ] | assumption ] - | auto + | autobatch (*elim H4. assumption*) ] | intros. elim (H i (le_S i n H2) H3). - auto + autobatch (*apply H8 [ assumption | apply le_S. @@ -315,11 +315,11 @@ split [ intro. apply (eqb_elim i1 j) [ simplify.intro. - auto + autobatch (*rewrite < H6. assumption*) | simplify.intro. - auto + autobatch (*rewrite < H2. rewrite < H5. assumption*) @@ -327,7 +327,7 @@ split | intro. apply (eqb_elim i1 j) [ simplify.intro. - auto + autobatch (*rewrite > H2. rewrite < H6. assumption*) @@ -339,7 +339,7 @@ split | intros. unfold Not. intro. - auto + autobatch (*apply H7. apply (injective_transpose ? ? ? ? H8)*) ] @@ -351,14 +351,14 @@ p (S n-k) = true \to (\forall i. (S n)-k < i \to i \le (S n) \to (p i) = false) map_iter_p (S n) p g a f = map_iter_p (S n-k) p g a f. intros 5. elim k 3 -[ auto +[ autobatch (*rewrite < minus_n_O. reflexivity*) | apply (nat_case n1) [ intros. rewrite > map_iter_p_S_false [ reflexivity - | auto + | autobatch (*apply H2 [ simplify. apply lt_O_S. @@ -371,13 +371,13 @@ elim k 3 [ reflexivity | intros. apply (H2 i H3). - auto + autobatch (*apply le_S. assumption*) ] - | auto + | autobatch (*apply H2 - [ auto + [ autobatch | apply le_n ]*) ] @@ -391,17 +391,17 @@ theorem eq_map_iter_p_a: \forall p.\forall f.\forall g. \forall a,n:nat. (\forall i.i \le n \to p i = false) \to map_iter_p n p g a f = a. intros 5. elim n -[ auto +[ autobatch (*simplify. reflexivity*) | rewrite > map_iter_p_S_false [ apply H. intros. - auto + autobatch (*apply H1. apply le_S. assumption*) - | auto + | autobatch (*apply H1. apply le_n*) ] @@ -417,7 +417,7 @@ apply (nat_case n) [ intro. absurd (k < O) [ assumption - | auto + | autobatch (*apply le_to_not_lt. apply le_O_n*) ] @@ -438,7 +438,7 @@ apply (nat_case n) [ rewrite < Hcut. rewrite < H. rewrite < H1 in \vdash (? ? (? % ?) ?). - auto + autobatch (*rewrite > H. reflexivity*) | apply eq_map_iter_p. @@ -452,24 +452,24 @@ apply (nat_case n) | apply not_eq_to_eqb_false. apply lt_to_not_eq. apply (le_to_lt_to_lt ? m) - [ auto + [ autobatch (*apply (trans_le ? (m-k)) [ assumption - | auto + | autobatch ]*) - | auto + | autobatch (*apply le_S. apply le_n*) ] ] | apply not_eq_to_eqb_false. apply lt_to_not_eq. - auto + autobatch (*unfold. - auto*) + autobatch*) ] ] - | auto + | autobatch (*apply le_S_S_to_le. assumption*) ] @@ -484,7 +484,7 @@ intros 10. elim n 2 [ absurd (k2 \le O) [ assumption - | auto + | autobatch (*apply lt_to_not_le. apply (trans_lt ? k1 ? H2 H3)*) ] @@ -495,22 +495,22 @@ elim n 2 cut (k1 = n1 - (n1 -k1)) [ rewrite > Hcut. apply (eq_map_iter_p_transpose p f H H1 g a (n1-k1)) - [ cut (k1 \le n1);auto + [ cut (k1 \le n1);autobatch | assumption - | auto + | autobatch (*rewrite < Hcut. assumption*) | rewrite < Hcut. intros. apply (H9 i H10). - auto + autobatch (*unfold. - auto*) + autobatch*) ] | apply sym_eq. - auto + autobatch (*apply plus_to_minus. - auto*) + autobatch*) ] | intros. cut ((S n1) \neq k1) @@ -523,9 +523,9 @@ elim n 2 apply eq_f. apply (H3 H5) [ elim (le_to_or_lt_eq ? ? H6) - [ auto + [ autobatch | absurd (S n1=k2) - [ auto + [ autobatch (*apply sym_eq. assumption*) | assumption @@ -549,10 +549,10 @@ elim n 2 [ rewrite > map_iter_p_S_false [ apply (H3 H5) [ elim (le_to_or_lt_eq ? ? H6) - [ auto - | (*l'invocazione di auto qui genera segmentation fault*) + [ autobatch + | (*l'invocazione di autobatch qui genera segmentation fault*) absurd (S n1=k2) - [ auto + [ autobatch (*apply sym_eq. assumption*) | assumption @@ -591,7 +591,7 @@ elim n right. apply (ex_intro ? ? O). split - [ auto + [ autobatch (*split [ apply le_n | assumption @@ -599,7 +599,7 @@ elim n | intros. absurd (O H4. assumption*) ] @@ -645,7 +645,7 @@ elim n elim H4. apply (ex_intro ? ? a). split - [ auto + [ autobatch (*split [ apply le_S. assumption @@ -653,13 +653,13 @@ elim n ]*) | intros. elim (le_to_or_lt_eq i (S n1) H9) - [ auto + [ autobatch (*apply H5 [ assumption | apply le_S_S_to_le. assumption ]*) - | auto + | autobatch (*rewrite > H10. assumption*) ] @@ -680,7 +680,7 @@ elim (decidable_n p n) | unfold. intro. apply not_eq_true_false. - auto + autobatch (*rewrite < H3. apply H2. assumption*) @@ -694,7 +694,7 @@ elim (decidable_n p n) elim H3.clear H3. elim H4.clear H4. split - [ auto + [ autobatch (*split [ split [ assumption @@ -708,7 +708,7 @@ elim (decidable_n p n) rewrite > H2. left. elim H3 2. - (*qui la tattica auto non conclude il goal, concluso invece con l'invocazione + (*qui la tattica autobatch non conclude il goal, concluso invece con l'invocazione *della sola tattica assumption *) assumption @@ -720,7 +720,7 @@ elim (decidable_n p n) apply not_eq_true_false. rewrite < H4. elim H3. - auto + autobatch (*clear H3. apply (H6 j H2).assumption*) ] @@ -739,7 +739,7 @@ elim n intros. absurd (m \le O) [ assumption - | auto + | autobatch (*apply lt_to_not_le. assumption*) ] @@ -751,7 +751,7 @@ elim n right. apply (ex_intro ? ? (S n1)). split - [ auto + [ autobatch (*split [ split [ assumption @@ -760,7 +760,7 @@ elim n | assumption ]*) | intros. - auto + autobatch (*apply (H4 i H6). apply le_S_S_to_le. assumption*) @@ -769,13 +769,13 @@ elim n left. intros. elim (le_to_or_lt_eq ? ? H7) - [ auto + [ autobatch (*apply H4 [ assumption | apply le_S_S_to_le. assumption ]*) - | auto + | autobatch (*rewrite > H8. assumption*) ] @@ -788,7 +788,7 @@ elim n apply (ex_intro ? ? a). split [ split - [ auto + [ autobatch (*split [ assumption | apply le_S. @@ -796,13 +796,13 @@ elim n ]*) | assumption ] - | (*qui auto non chiude il goal, chiuso invece mediante l'invocazione + | (*qui autobatch non chiude il goal, chiuso invece mediante l'invocazione *della sola tattica assumption *) assumption ] ] - | auto + | autobatch (*apply le_S_S_to_le. assumption*) ] @@ -825,16 +825,16 @@ intros 2. apply (nat_elim2 ? ? ? ? n m) [ simplify. intros. - auto + autobatch | intros 2. - auto + autobatch (*rewrite < minus_n_O. intro. assumption*) | intros. simplify. cut (n1 < m1+p) - [ auto + [ autobatch | apply H. apply H1 ] @@ -848,7 +848,7 @@ apply (nat_elim2 ? ? ? ? n m) [ simplify. intros 3. apply (le_n_O_elim ? H). - auto + autobatch (*simplify. intros. assumption*) @@ -858,7 +858,7 @@ apply (nat_elim2 ? ? ? ? n m) | intros. simplify. apply H - [ auto + [ autobatch (*apply le_S_S_to_le. assumption*) | apply le_S_S_to_le. @@ -870,9 +870,9 @@ qed. theorem minus_m_minus_mn: \forall n,m. n\le m \to n=m-(m-n). intros. apply sym_eq. -auto. +autobatch. (*apply plus_to_minus. -auto.*) +autobatch.*) qed. theorem eq_map_iter_p_transpose2: \forall p.\forall f.associative nat f \to @@ -896,14 +896,14 @@ cut (k = (S n)-(S n -k)) elim (decidable_n2 p n (S n -m) H4 H6) [ apply (eq_map_iter_p_transpose1 p f H H1 f1 a) [ assumption - | auto + | autobatch (*unfold. - auto*) + autobatch*) | apply le_n | assumption | assumption | intros. - auto + autobatch (*apply H7 [ assumption | apply le_S_S_to_le. @@ -923,26 +923,26 @@ cut (k = (S n)-(S n -k)) [ rewrite > Hcut1. apply H2 [ apply lt_plus_to_lt_minus - [ auto + [ autobatch (*apply le_S. assumption*) | rewrite < sym_plus. - auto + autobatch (*apply lt_minus_to_lt_plus. assumption*) ] | rewrite < Hcut1. - auto + autobatch (*apply (trans_lt ? (S n -m)); assumption*) | rewrite < Hcut1. assumption | assumption - | auto + | autobatch (*rewrite < Hcut1. assumption*) ] - | auto + | autobatch (*apply minus_m_minus_mn. apply le_S. assumption*) @@ -950,12 +950,12 @@ cut (k = (S n)-(S n -k)) | apply (eq_map_iter_p_transpose1 p f H H1) [ assumption | assumption - | auto + | autobatch (*apply le_S. assumption*) | assumption | assumption - | (*qui auto non chiude il goal, chiuso dall'invocazione della singola + | (*qui autobatch non chiude il goal, chiuso dall'invocazione della singola * tattica assumption *) assumption @@ -966,16 +966,16 @@ cut (k = (S n)-(S n -k)) [ cut (a1 = (S n) -(S n -a1)) [ apply H2 [ apply lt_plus_to_lt_minus - [ auto + [ autobatch (*apply le_S. assumption*) | rewrite < sym_plus. - auto + autobatch (*apply lt_minus_to_lt_plus. assumption*) ] | rewrite < Hcut1. - auto + autobatch (*apply (trans_lt ? (S n -m)) [ assumption | assumption @@ -983,11 +983,11 @@ cut (k = (S n)-(S n -k)) | rewrite < Hcut1. assumption | assumption - | auto + | autobatch (*rewrite < Hcut1. assumption*) ] - | auto + | autobatch (*apply minus_m_minus_mn. apply le_S. assumption*) @@ -1019,7 +1019,7 @@ cut (k = (S n)-(S n -k)) rewrite < H12 in \vdash (? (? %) ?). assumption ] - | auto + | autobatch (*apply minus_m_minus_mn. apply le_S. assumption*) @@ -1027,7 +1027,7 @@ cut (k = (S n)-(S n -k)) ] ] ] -| auto +| autobatch (*apply minus_m_minus_mn. apply le_S. assumption*) @@ -1040,7 +1040,7 @@ symmetric2 nat nat f \to \forall g. \forall a,k,n:nat. O < k \to k \le (S n) \to \to map_iter_p (S n) p g a f = map_iter_p (S n) p (\lambda m. g (transpose k (S n) m)) a f. intros. elim (le_to_or_lt_eq ? ? H3) -[ apply (eq_map_iter_p_transpose2 p f H H1 g a k n H2);auto +[ apply (eq_map_iter_p_transpose2 p f H H1 g a k n H2);autobatch (*[ apply le_S_S_to_le. assumption | assumption @@ -1049,7 +1049,7 @@ elim (le_to_or_lt_eq ? ? H3) | rewrite > H6. apply eq_map_iter_p. intros. - auto + autobatch (*apply eq_f. apply sym_eq. apply transpose_i_i.*) @@ -1069,13 +1069,13 @@ absurd (p (h (S m)) = true) | apply (le_n_O_elim ? H4). unfold. intro. - (*l'invocazione di auto in questo punto genera segmentation fault*) + (*l'invocazione di autobatch in questo punto genera segmentation fault*) apply not_eq_true_false. - (*l'invocazione di auto in questo punto genera segmentation fault*) + (*l'invocazione di autobatch in questo punto genera segmentation fault*) rewrite < H9. - (*l'invocazione di auto in questo punto genera segmentation fault*) + (*l'invocazione di autobatch in questo punto genera segmentation fault*) rewrite < H1. - (*l'invocazione di auto in questo punto genera segmentation fault*) + (*l'invocazione di autobatch in questo punto genera segmentation fault*) reflexivity ] qed. @@ -1086,7 +1086,7 @@ permut_p h p n \to p O = false \to map_iter_p n p g a f = map_iter_p n p (compose ? ? ? g h) a f . intros 5. elim n -[ auto +[ autobatch (*simplify. reflexivity*) | apply (bool_elim ? (p (S n1))) @@ -1097,7 +1097,7 @@ elim n elim H6. clear H6. apply (eq_map_iter_p_transpose3 p f H H1 g a (h(S n1)) n1) - [ apply (permut_p_O ? ? ? H3 H4);auto + [ apply (permut_p_O ? ? ? H3 H4);autobatch (*[ apply le_n | assumption ]*) @@ -1131,14 +1131,14 @@ elim n cut (h i \neq h (S n1)) [ rewrite > (not_eq_to_eqb_false ? ? Hcut). simplify. - auto + autobatch (*apply le_S_S_to_le. assumption*) | apply H9 [ apply H5 | apply le_n | apply lt_to_not_eq. - auto + autobatch (*unfold. apply le_S_S. assumption*) @@ -1148,14 +1148,14 @@ elim n apply (eqb_elim (S n1) (h (S n1))) [ intro. absurd (h i = h (S n1)) - [ auto + [ autobatch (*rewrite > H8. assumption*) | apply H9 [ assumption | apply le_n | apply lt_to_not_eq. - auto + autobatch (*unfold. apply le_S_S. assumption*) @@ -1169,11 +1169,11 @@ elim n elim (H3 (S n1) (le_n ? ) H5). elim H13.clear H13. elim (le_to_or_lt_eq ? ? H15) - [ auto + [ autobatch (*apply le_S_S_to_le. assumption*) | apply False_ind. - auto + autobatch (*apply H12. apply sym_eq. assumption*) @@ -1188,26 +1188,26 @@ elim n [ intro. apply (eqb_elim (h i) (h (S n1))) [ intro. - (*NB: qui auto non chiude il goal*) + (*NB: qui autobatch non chiude il goal*) simplify. assumption | intro. simplify. elim (H3 (S n1) (le_n ? ) H5). - auto + autobatch (*elim H10. assumption*) ] | intro. apply (eqb_elim (h i) (h (S n1))) [ intro. - (*NB: qui auto non chiude il goal*) + (*NB: qui autobatch non chiude il goal*) simplify. assumption | intro. simplify. elim (H3 i (le_S ? ? H6) H7). - auto + autobatch (*elim H10. assumption*) ] @@ -1227,7 +1227,7 @@ elim n ] | apply eq_map_iter_p. intros. - auto + autobatch (*rewrite > transpose_transpose. reflexivity*) ] @@ -1244,25 +1244,25 @@ elim n split [ split [ elim (le_to_or_lt_eq ? ? H10) - [ auto + [ autobatch (*apply le_S_S_to_le.assumption*) | absurd (p (h i) = true) [ assumption | rewrite > H12. rewrite > H5. unfold.intro. - (*l'invocazione di auto qui genera segmentation fault*) + (*l'invocazione di autobatch qui genera segmentation fault*) apply not_eq_true_false. - (*l'invocazione di auto qui genera segmentation fault*) + (*l'invocazione di autobatch qui genera segmentation fault*) apply sym_eq. - (*l'invocazione di auto qui genera segmentation fault*) + (*l'invocazione di autobatch qui genera segmentation fault*) assumption ] ] | assumption ] | intros. - apply H9;auto + apply H9;autobatch (*[ assumption | apply (le_S ? ? H13) | assumption diff --git a/matita/library_auto/auto/nat/minimization.ma b/matita/library_auto/auto/nat/minimization.ma index 84d6b4181..61cbaf45a 100644 --- a/matita/library_auto/auto/nat/minimization.ma +++ b/matita/library_auto/auto/nat/minimization.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -set "baseuri" "cic:/matita/library_auto/nat/minimization". +set "baseuri" "cic:/matita/library_autobatch/nat/minimization". include "auto/nat/minus.ma". @@ -26,7 +26,7 @@ let rec max i f \def theorem max_O_f : \forall f: nat \to bool. max O f = O. intro. simplify. -elim (f O); auto. +elim (f O); autobatch. (*[ simplify. reflexivity | simplify. @@ -37,7 +37,7 @@ qed. theorem max_S_max : \forall f: nat \to bool. \forall n:nat. (f (S n) = true \land max (S n) f = (S n)) \lor (f (S n) = false \land max (S n) f = max n f). -intros.simplify.elim (f (S n));auto. +intros.simplify.elim (f (S n));autobatch. (*[ simplify. left. split;reflexivity @@ -54,7 +54,7 @@ elim n [ rewrite > max_O_f. apply le_n | simplify. - elim (f (S n1));simplify;auto. + elim (f (S n1));simplify;autobatch. (*[ simplify. apply le_n | simplify. @@ -73,7 +73,7 @@ elim H [ apply H2 | cut ((f (S n1) = true \land max (S n1) f = (S n1)) \lor (f (S n1) = false \land max (S n1) f = max n1 f)) - [ elim Hcut;elim H3;rewrite > H5;auto + [ elim Hcut;elim H3;rewrite > H5;autobatch (*[ elim H3. rewrite > H5. apply le_S. @@ -92,11 +92,11 @@ theorem f_m_to_le_max: \forall f: nat \to bool. \forall n,m:nat. m\le n \to f m = true \to m \le max n f. intros 3. elim n -[ auto. +[ autobatch. (*apply (le_n_O_elim m H). apply le_O_n.*) | apply (le_n_Sm_elim m n1 H1);intro - [ apply (trans_le ? (max n1 f)); auto + [ apply (trans_le ? (max n1 f)); autobatch (*[ apply H [apply le_S_S_to_le. assumption @@ -108,7 +108,7 @@ elim n | simplify. rewrite < H3. rewrite > H2. - auto + autobatch (*simplify. apply le_n.*) ] @@ -128,7 +128,7 @@ elim n elim H1. generalize in match H3. apply (le_n_O_elim a H2). - auto + autobatch (*intro. simplify. rewrite > H4. @@ -140,7 +140,7 @@ elim n [ true \Rightarrow (S n1) | false \Rightarrow (max n1 f)])) = true)) - [ auto + [ autobatch (*simplify. intro. assumption.*) @@ -153,22 +153,22 @@ elim n apply (le_n_Sm_elim a n1 H4) [ intros. apply (ex_intro nat ? a). - auto + autobatch (*split [ apply le_S_S_to_le. assumption. | assumption. ]*) | intros. - (* una chiamata di auto in questo punto genera segmentation fault*) + (* una chiamata di autobatch in questo punto genera segmentation fault*) apply False_ind. - (* una chiamata di auto in questo punto genera segmentation fault*) + (* una chiamata di autobatch in questo punto genera segmentation fault*) apply not_eq_true_false. - (* una chiamata di auto in questo punto genera segmentation fault*) + (* una chiamata di autobatch in questo punto genera segmentation fault*) rewrite < H2. - (* una chiamata di auto in questo punto genera segmentation fault*) + (* una chiamata di autobatch in questo punto genera segmentation fault*) rewrite < H7. - (* una chiamata di auto in questo punto genera segmentation fault*) + (* una chiamata di autobatch in questo punto genera segmentation fault*) rewrite > H6. reflexivity. ] @@ -181,7 +181,7 @@ theorem lt_max_to_false : \forall f:nat \to bool. \forall n,m:nat. (max n f) < m \to m \leq n \to f m = false. intros 2. elim n -[ absurd (le m O);auto +[ absurd (le m O);autobatch (*[ assumption | cut (O < m) [ apply (lt_O_n_elim m Hcut). @@ -202,14 +202,14 @@ elim n | elim H3. apply (le_n_Sm_elim m n1 H2) [ intro. - apply H;auto + apply H;autobatch (*[ rewrite < H6. assumption | apply le_S_S_to_le. assumption ]*) | intro. - auto + autobatch (*rewrite > H7. assumption*) ] @@ -230,14 +230,14 @@ definition min : nat \to (nat \to bool) \to nat \def theorem min_aux_O_f: \forall f:nat \to bool. \forall i :nat. min_aux O i f = i. intros.simplify. -(*una chiamata di auto a questo punto porta ad un'elaborazione molto lunga (forse va +(*una chiamata di autobatch a questo punto porta ad un'elaborazione molto lunga (forse va in loop): dopo circa 3 minuti non era ancora terminata. *) rewrite < minus_n_O. -(*una chiamata di auto a questo punto porta ad un'elaborazione molto lunga (forse va +(*una chiamata di autobatch a questo punto porta ad un'elaborazione molto lunga (forse va in loop): dopo circa 3 minuti non era ancora terminata. *) -elim (f i); auto. +elim (f i); autobatch. (*[ reflexivity. simplify | reflexivity @@ -247,14 +247,14 @@ qed. theorem min_O_f : \forall f:nat \to bool. min O f = O. intro. -(* una chiamata di auto a questo punto NON conclude la dimostrazione*) +(* una chiamata di autobatch a questo punto NON conclude la dimostrazione*) apply (min_aux_O_f f O). qed. theorem min_aux_S : \forall f: nat \to bool. \forall i,n:nat. (f (n -(S i)) = true \land min_aux (S i) n f = (n - (S i))) \lor (f (n -(S i)) = false \land min_aux (S i) n f = min_aux i n f). -intros.simplify.elim (f (n - (S i)));auto. +intros.simplify.elim (f (n - (S i)));autobatch. (*[ simplify. left. split;reflexivity. @@ -273,7 +273,7 @@ elim off elim H1. elim H2. cut (a = m) - [ auto. + [ autobatch. (*rewrite > (min_aux_O_f f). rewrite < Hcut. assumption*) @@ -288,7 +288,7 @@ elim off (f (m-(S n)) = b) \to (f (match b in bool with [ true \Rightarrow m-(S n) | false \Rightarrow (min_aux n m f)])) = true)) - [ auto + [ autobatch (*simplify. intro. assumption.*) @@ -300,8 +300,8 @@ elim off elim H4. elim (le_to_or_lt_eq (m-(S n)) a H6) [ apply (ex_intro nat ? a). - split;auto - (*[ auto.split + split;autobatch + (*[ autobatch.split [ apply lt_minus_S_n_to_le_minus_n. assumption | assumption @@ -309,7 +309,7 @@ elim off | assumption ]*) | absurd (f a = false) - [ (* una chiamata di auto in questo punto genera segmentation fault*) + [ (* una chiamata di autobatch in questo punto genera segmentation fault*) rewrite < H8. assumption. | rewrite > H5. @@ -344,7 +344,7 @@ elim off | elim H3. elim (le_to_or_lt_eq (n -(S n1)) m) [ apply H - [ auto + [ autobatch (*apply lt_minus_S_n_to_le_minus_n. assumption*) | rewrite < H6. @@ -363,17 +363,17 @@ theorem le_min_aux : \forall f:nat \to bool. intros 3. elim off [ rewrite < minus_n_O. - auto + autobatch (*rewrite > (min_aux_O_f f n). apply le_n.*) | elim (min_aux_S f n1 n) [ elim H1. - auto + autobatch (*rewrite > H3. apply le_n.*) | elim H1. rewrite > H3. - auto + autobatch (*apply (trans_le (n-(S n1)) (n-n1)) [ apply monotonic_le_minus_r. apply le_n_Sn. @@ -389,14 +389,14 @@ intros. elim off [ simplify. rewrite < minus_n_O. - elim (f n);auto + elim (f n);autobatch (*[simplify. apply le_n. | simplify. apply le_n. ]*) | simplify. - elim (f (n -(S n1)));simplify;auto + elim (f (n -(S n1)));simplify;autobatch (*[ apply le_plus_to_minus. rewrite < sym_plus. apply le_plus_n diff --git a/matita/library_auto/auto/nat/minus.ma b/matita/library_auto/auto/nat/minus.ma index e7b01f9da..8a3d893f1 100644 --- a/matita/library_auto/auto/nat/minus.ma +++ b/matita/library_auto/auto/nat/minus.ma @@ -13,7 +13,7 @@ (**************************************************************************) -set "baseuri" "cic:/matita/library_auto/nat/minus". +set "baseuri" "cic:/matita/library_autobatch/nat/minus". include "auto/nat/le_arith.ma". include "auto/nat/compare.ma". @@ -27,12 +27,12 @@ let rec minus n m \def | (S q) \Rightarrow minus p q ]]. (*CSC: the URI must disappear: there is a bug now *) -interpretation "natural minus" 'minus x y = (cic:/matita/library_auto/nat/minus/minus.con x y). +interpretation "natural minus" 'minus x y = (cic:/matita/library_autobatch/nat/minus/minus.con x y). theorem minus_n_O: \forall n:nat.n=n-O. intros. elim n; -auto. (* applico auto su entrambi i goal aperti*) +autobatch. (* applico autobatch su entrambi i goal aperti*) (*simplify;reflexivity.*) qed. @@ -47,7 +47,7 @@ qed. theorem minus_Sn_n: \forall n:nat. S O = (S n)-n. intro. elim n -[ auto +[ autobatch (*simplify.reflexivity.*) | elim H. reflexivity @@ -60,15 +60,15 @@ intros 2. apply (nat_elim2 (\lambda n,m.m \leq n \to (S n)-m = S (n-m)));intros [ apply (le_n_O_elim n1 H). - auto + autobatch (*simplify. reflexivity.*) -| auto +| autobatch (*simplify. reflexivity.*) | rewrite < H [ reflexivity - | auto + | autobatch (*apply le_S_S_to_le. assumption.*) ] @@ -81,15 +81,15 @@ intros 2. apply (nat_elim2 (\lambda n,m.\forall p:nat.m \leq n \to (n-m)+p = (n+p)-m));intros [ apply (le_n_O_elim ? H). - auto + autobatch (*simplify. rewrite < minus_n_O. reflexivity.*) -| auto +| autobatch (*simplify. reflexivity.*) | simplify. - auto + autobatch (*apply H. apply le_S_S_to_le. assumption.*) @@ -103,7 +103,7 @@ elim m [ rewrite < minus_n_O. apply plus_n_O. | elim n2 - [ auto + [ autobatch (*simplify. apply minus_n_n.*) | rewrite < plus_n_Sm. @@ -119,7 +119,7 @@ intros 2. apply (nat_elim2 (\lambda n,m.m \leq n \to n = (n-m)+m));intros [ apply (le_n_O_elim n1 H). reflexivity -| auto +| autobatch (*simplify. rewrite < plus_n_O. reflexivity.*) @@ -128,7 +128,7 @@ apply (nat_elim2 (\lambda n,m.m \leq n \to n = (n-m)+m));intros simplify. apply eq_f. rewrite < sym_plus. - auto + autobatch (*apply H. apply le_S_S_to_le. assumption.*) @@ -137,7 +137,7 @@ qed. theorem minus_to_plus :\forall n,m,p:nat.m \leq n \to n-m = p \to n = m+p. -intros.apply (trans_eq ? ? ((n-m)+m));auto. +intros.apply (trans_eq ? ? ((n-m)+m));autobatch. (*[ apply plus_minus_m_m. apply H. | elim H1. @@ -152,7 +152,7 @@ apply (inj_plus_r m). rewrite < H. rewrite < sym_plus. symmetry. -auto. +autobatch. (*apply plus_minus_m_m. rewrite > H. rewrite > sym_plus. @@ -172,7 +172,7 @@ apply (lt_O_n_elim n H). intro. apply (lt_O_n_elim m H1). intro. -auto. +autobatch. (*simplify.reflexivity.*) qed. @@ -180,11 +180,11 @@ theorem eq_minus_n_m_O: \forall n,m:nat. n \leq m \to n-m = O. intros 2. apply (nat_elim2 (\lambda n,m.n \leq m \to n-m = O));intros -[ auto +[ autobatch (*simplify. reflexivity.*) | apply False_ind. - auto + autobatch (*apply not_le_Sn_O. goal 15.*) (*prima goal 13*) (* effettuando un'esecuzione passo-passo, quando si arriva a dover @@ -198,7 +198,7 @@ apply (nat_elim2 (\lambda n,m.n \leq m \to n-m = O));intros *) (*apply H.*) | simplify. - auto + autobatch (*apply H. apply le_S_S_to_le. apply H1.*) @@ -209,7 +209,7 @@ theorem le_SO_minus: \forall n,m:nat.S n \leq m \to S O \leq m-n. intros. elim H [ elim (minus_Sn_n n).apply le_n -| rewrite > minus_Sn_m;auto +| rewrite > minus_Sn_m;autobatch (*apply le_S.assumption. apply lt_to_le.assumption.*) ] @@ -222,7 +222,7 @@ intros.apply (nat_elim2 (\lambda n,m.m-n \leq S (m-(S n))));intros | rewrite < minus_n_O. apply le_n. ] -| auto +| autobatch (*simplify.apply le_n_Sn.*) | simplify.apply H. ] @@ -230,7 +230,7 @@ qed. theorem lt_minus_S_n_to_le_minus_n : \forall n,m,p:nat. m-(S n) < p \to m-n \leq p. intros 3. -auto. +autobatch. (*simplify. intro. apply (trans_le (m-n) (S (m-(S n))) p). @@ -240,14 +240,14 @@ qed. theorem le_minus_m: \forall n,m:nat. n-m \leq n. intros.apply (nat_elim2 (\lambda m,n. n-m \leq n));intros -[ auto +[ autobatch (*rewrite < minus_n_O. apply le_n.*) -| auto +| autobatch (*simplify. apply le_n.*) | simplify. - auto + autobatch (*apply le_S. assumption.*) ] @@ -260,7 +260,7 @@ intro. apply (lt_O_n_elim m H1). intro. simplify. -auto. +autobatch. (*unfold lt. apply le_S_S. apply le_minus_m.*) @@ -276,7 +276,7 @@ apply (nat_elim2 (\lambda n,m:nat.n-m \leq O \to n \leq m)) assumption | simplify. intros. - auto + autobatch (*apply le_S_S. apply H. assumption.*) @@ -295,11 +295,11 @@ apply (nat_elim2 | rewrite < minus_n_O. apply le_minus_m. | elim a - [ auto + [ autobatch (*simplify. apply le_n.*) | simplify. - auto + autobatch (*apply H. apply le_S_S_to_le. assumption.*) @@ -324,12 +324,12 @@ theorem le_plus_to_minus: \forall n,m,p. (le n (p+m)) \to (le (n-m) p). intros 2. apply (nat_elim2 (\lambda n,m.\forall p.(le n (p+m)) \to (le (n-m) p))) [ intros. - auto + autobatch (*simplify. apply le_O_n.*) | intros 2. rewrite < plus_n_O. - auto + autobatch (*intro. simplify. assumption.*) @@ -348,17 +348,17 @@ intros 3. apply (nat_elim2 (\lambda m,p.(le (n+m) p) \to (le n (p-m))));intro [ rewrite < plus_n_O. rewrite < minus_n_O. - auto + autobatch (*intro. assumption.*) | intro. cut (n=O) - [ auto + [ autobatch (*rewrite > Hcut. apply le_O_n.*) | apply sym_eq. apply le_n_O_to_eq. - auto + autobatch (*apply (trans_le ? (n+(S n1))) [ rewrite < sym_plus. apply le_plus_n @@ -381,7 +381,7 @@ apply (nat_elim2 (\lambda m,p.(lt n (p-m)) \to (lt (n+m) p))) [ intro. rewrite < plus_n_O. rewrite < minus_n_O. - auto + autobatch (*intro. assumption.*) | simplify. @@ -393,7 +393,7 @@ apply (nat_elim2 (\lambda m,p.(lt n (p-m)) \to (lt (n+m) p))) unfold lt. apply le_S_S. rewrite < plus_n_Sm. - auto + autobatch (*apply H. apply H1.*) ] @@ -404,15 +404,15 @@ unfold distributive. intros. apply ((leb_elim z y));intro [ cut (x*(y-z)+x*z = (x*y-x*z)+x*z) - [ auto + [ autobatch (*apply (inj_plus_l (x*z)). assumption.*) | apply (trans_eq nat ? (x*y)) [ rewrite < distr_times_plus. - auto + autobatch (*rewrite < (plus_minus_m_m ? ? H). reflexivity.*) - | rewrite < plus_minus_m_m;auto + | rewrite < plus_minus_m_m;autobatch (*[ reflexivity. | apply le_times_r. assumption. @@ -421,17 +421,17 @@ apply ((leb_elim z y));intro ] | rewrite > eq_minus_n_m_O [ rewrite > (eq_minus_n_m_O (x*y)) - [ auto + [ autobatch (*rewrite < sym_times. simplify. reflexivity.*) | apply le_times_r. apply lt_to_le. - auto + autobatch (*apply not_le_to_lt. assumption.*) ] - | auto + | autobatch (*apply lt_to_le. apply not_le_to_lt. assumption.*) @@ -447,7 +447,7 @@ intros. apply plus_to_minus. rewrite > sym_plus in \vdash (? ? ? %). rewrite > assoc_plus. -auto. +autobatch. (*rewrite < plus_minus_m_m. reflexivity. assumption. @@ -464,7 +464,7 @@ cut (m+p \le n \or m+p \nleq n) rewrite > (sym_plus p). rewrite < plus_minus_m_m [ rewrite > sym_plus. - rewrite < plus_minus_m_m ; auto + rewrite < plus_minus_m_m ; autobatch (*[ reflexivity. | apply (trans_le ? (m+p)) [ rewrite < sym_plus. @@ -482,11 +482,11 @@ cut (m+p \le n \or m+p \nleq n) | apply le_plus_to_minus. apply lt_to_le. rewrite < sym_plus. - auto + autobatch (*apply not_le_to_lt. assumption.*) ] - | auto + | autobatch (*apply lt_to_le. apply not_le_to_lt. assumption.*) @@ -504,7 +504,7 @@ apply plus_to_minus. rewrite < assoc_plus. rewrite < plus_minus_m_m; [ rewrite < sym_plus. - auto + autobatch (*rewrite < plus_minus_m_m [ reflexivity | assumption diff --git a/matita/library_auto/auto/nat/nat.ma b/matita/library_auto/auto/nat/nat.ma index b8eacad4e..f915759f7 100644 --- a/matita/library_auto/auto/nat/nat.ma +++ b/matita/library_auto/auto/nat/nat.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -set "baseuri" "cic:/matita/library_auto/nat/nat". +set "baseuri" "cic:/matita/library_autobatch/nat/nat". include "higher_order_defs/functions.ma". @@ -26,7 +26,7 @@ definition pred: nat \to nat \def | (S p) \Rightarrow p ]. theorem pred_Sn : \forall n:nat.n=(pred (S n)). - auto. + autobatch. (*intros. reflexivity.*) qed. @@ -35,7 +35,7 @@ theorem injective_S : injective nat nat S. intros. rewrite > pred_Sn. rewrite > (pred_Sn y). - auto. + autobatch. (*apply eq_f. assumption.*) qed. @@ -48,7 +48,7 @@ theorem not_eq_S : \forall n,m:nat. intros. unfold Not. intros. - auto. + autobatch. (*apply H. apply injective_S. assumption.*) @@ -91,10 +91,10 @@ theorem nat_case1: (n=O \to P O) \to (\forall m:nat. (n=(S m) \to P (S m))) \to P n. intros 2; elim n - [ auto + [ autobatch (*apply H; reflexivity*) - | auto + | autobatch (*apply H2; reflexivity*) ] qed. @@ -111,7 +111,7 @@ theorem nat_elim2 : | apply (nat_case m) [ apply H1 |intro; - auto + autobatch (*apply H2; apply H3*) ] @@ -122,27 +122,27 @@ theorem decidable_eq_nat : \forall n,m:nat.decidable (n=m). intros.unfold decidable. apply (nat_elim2 (\lambda n,m.(Or (n=m) ((n=m) \to False)))) [ intro; elim n1 - [auto + [autobatch (*left; reflexivity*) - |auto + |autobatch (*right; apply not_eq_O_S*) ] | intro; right; intro; apply (not_eq_O_S n1); - auto + autobatch (*apply sym_eq; assumption*) | intros; elim H - [ auto + [ autobatch (*left; apply eq_f; assumption*) | right; intro; - auto + autobatch (*apply H1; apply inj_S; assumption*) diff --git a/matita/library_auto/auto/nat/nth_prime.ma b/matita/library_auto/auto/nat/nth_prime.ma index 8d948a510..88234154b 100644 --- a/matita/library_auto/auto/nat/nth_prime.ma +++ b/matita/library_auto/auto/nat/nth_prime.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -set "baseuri" "cic:/matita/library_auto/nat/nth_prime". +set "baseuri" "cic:/matita/library_autobatch/nat/nth_prime". include "auto/nat/primes.ma". include "auto/nat/lt_arith.ma". @@ -46,11 +46,11 @@ unfold Not. intro. apply (not_divides_S_fact n (smallest_factor(S n!))) [ apply lt_SO_smallest_factor. - unfold lt.auto + unfold lt.autobatch (*apply le_S_S. apply le_SO_fact*) | assumption -| auto +| autobatch (*apply divides_smallest_factor_n. unfold lt. apply le_S_S. @@ -63,7 +63,7 @@ n < m \land m \le S n! \land (prime m). intros. elim H [ apply (ex_intro nat ? (S(S O))). - split;auto + split;autobatch (*[ split [ apply (le_n (S(S O))) | apply (le_n (S(S O))) @@ -72,14 +72,14 @@ elim H ]*) | apply (ex_intro nat ? (smallest_factor (S (S n1)!))). split - [ auto + [ autobatch (*split [ apply smallest_factor_fact | apply le_smallest_factor_n ]*) | (* Andrea: ancora hint non lo trova *) apply prime_smallest_factor_n. - unfold lt.auto + unfold lt.autobatch (*apply le_S. apply le_SSO_fact. unfold lt. @@ -101,17 +101,17 @@ match n with it must compute factorial of 7 ...*) (* theorem example11 : nth_prime (S(S O)) = (S(S(S(S(S O))))). -auto. +autobatch. (*normalize.reflexivity.*) qed. theorem example12: nth_prime (S(S(S O))) = (S(S(S(S(S(S(S O))))))). -auto. +autobatch. (*normalize.reflexivity.*) qed. theorem example13 : nth_prime (S(S(S(S O)))) = (S(S(S(S(S(S(S(S(S(S(S O))))))))))). -auto. +autobatch. (*normalize.reflexivity.*) qed. *) @@ -123,7 +123,7 @@ normalize.reflexivity. theorem prime_nth_prime : \forall n:nat.prime (nth_prime n). intro. apply (nat_case n) -[ auto +[ autobatch (*simplify. apply (primeb_to_Prop (S(S O)))*) | intro. @@ -141,7 +141,7 @@ apply (nat_case n) exact (smallest_factor_fact (nth_prime m)) | (* maybe we could factorize this proof *) apply plus_to_minus. - auto + autobatch (*apply plus_minus_m_m. apply le_S_S. apply le_n_fact_n*) @@ -150,7 +150,7 @@ apply (nat_case n) ] | apply prime_to_primeb_true. apply prime_smallest_factor_n. - unfold lt.auto + unfold lt.autobatch (*apply le_S_S. apply le_SO_fact*) ] @@ -170,7 +170,7 @@ cut (upper_bound - (upper_bound -(S previous_prime)) = (S previous_prime)) [ rewrite < Hcut in \vdash (? % ?). apply le_min_aux | apply plus_to_minus. - auto + autobatch (*apply plus_minus_m_m. apply le_S_S. apply le_n_fact_n*) @@ -181,20 +181,20 @@ variant lt_nth_prime_n_nth_prime_Sn :\forall n:nat. (nth_prime n) < (nth_prime (S n)) \def increasing_nth_prime. theorem injective_nth_prime: injective nat nat nth_prime. -auto. +autobatch. (*apply increasing_to_injective. apply increasing_nth_prime.*) qed. theorem lt_SO_nth_prime_n : \forall n:nat. (S O) \lt nth_prime n. intros. -(*usando la tattica auto qui, dopo svariati minuti la computazione non era +(*usando la tattica autobatch qui, dopo svariati minuti la computazione non era * ancora terminata *) elim n -[ unfold lt.auto +[ unfold lt.autobatch (*apply le_n*) -| auto +| autobatch (*apply (trans_lt ? (nth_prime n1)) [ assumption | apply lt_nth_prime_n_nth_prime_Sn @@ -204,7 +204,7 @@ qed. theorem lt_O_nth_prime_n : \forall n:nat. O \lt nth_prime n. intros. -auto. +autobatch. (*apply (trans_lt O (S O)) [ unfold lt. apply le_n @@ -215,7 +215,7 @@ qed. theorem ex_m_le_n_nth_prime_m: \forall n: nat. nth_prime O \le n \to \exists m. nth_prime m \le n \land n < nth_prime (S m). -auto. +autobatch. (*intros. apply increasing_to_le2 [ exact lt_nth_prime_n_nth_prime_Sn @@ -234,7 +234,7 @@ apply (lt_min_aux_to_false primeb upper_bound (upper_bound - (S previous_prime)) [ rewrite > Hcut. assumption | apply plus_to_minus. - auto + autobatch (*apply plus_minus_m_m. apply le_S_S. apply le_n_fact_n*) @@ -254,14 +254,14 @@ cut (\exists m. nth_prime m \le p \land p < nth_prime (S m)) [ elim Hcut1 [ absurd (prime p) [ assumption - | auto + | autobatch (*apply (lt_nth_prime_to_not_prime a);assumption*) ] - | auto + | autobatch (*apply (ex_intro nat ? a). assumption*) ] - | auto + | autobatch (*apply le_to_or_lt_eq. assumption*) ] diff --git a/matita/library_auto/auto/nat/ord.ma b/matita/library_auto/auto/nat/ord.ma index c51f828ef..8a4de9f1f 100644 --- a/matita/library_auto/auto/nat/ord.ma +++ b/matita/library_auto/auto/nat/ord.ma @@ -12,12 +12,12 @@ (* *) (**************************************************************************) -set "baseuri" "cic:/matita/library_auto/nat/ord". +set "baseuri" "cic:/matita/library_autobatch/nat/ord". include "datatypes/constructors.ma". include "auto/nat/exp.ma". include "auto/nat/gcd.ma". -include "auto/nat/relevant_equations.ma". (* required by auto paramod *) +include "auto/nat/relevant_equations.ma". (* required by autobatch paramod *) (* this definition of log is based on pairs, with a remainder *) @@ -59,7 +59,7 @@ elim p [ rewrite > (plus_n_O (m*(n1 / m))). rewrite < H2. rewrite > sym_times. - auto + autobatch (*rewrite < div_mod [ reflexivity | assumption @@ -93,7 +93,7 @@ elim i rewrite < plus_n_O. apply (nat_case p) [ simplify. - elim (n \mod m);auto + elim (n \mod m);autobatch (*[ simplify. reflexivity | simplify. @@ -104,15 +104,15 @@ elim i cut (O < n \mod m \lor O = n \mod m) [ elim Hcut [ apply (lt_O_n_elim (n \mod m) H3). - intros.auto + intros.autobatch (*simplify. reflexivity*) - | apply False_ind.auto + | apply False_ind.autobatch (*apply H1. apply sym_eq. assumption*) ] - | auto + | autobatch (*apply le_to_or_lt_eq. apply le_O_n*) ] @@ -131,7 +131,7 @@ elim i fold simplify (m \sup (S n1)). cut ((m \sup (S n1) *n) / m = m \sup n1 *n) [ rewrite > Hcut1. - rewrite > (H2 m1);auto + rewrite > (H2 m1);autobatch (*[ simplify. reflexivity | apply le_S_S_to_le. @@ -147,7 +147,7 @@ elim i | (* mod_exp = O *) apply divides_to_mod_O [ assumption - | simplify.auto + | simplify.autobatch (*rewrite > assoc_times. apply (witness ? ? (m \sup n1 *n)). reflexivity*) @@ -162,7 +162,7 @@ theorem p_ord_aux_to_Prop1: \forall p,n,m. (S O) < m \to O < n \to n \le p \to [ (pair q r) \Rightarrow r \mod m \neq O]. intro. elim p -[ absurd (O < n);auto +[ absurd (O < n);autobatch (*[ assumption | apply le_to_not_lt. assumption @@ -174,7 +174,7 @@ elim p elim (p_ord_aux n (n1 / m) m). apply H5 [ assumption - | auto + | autobatch (*apply eq_mod_O_to_lt_O_div [ apply (trans_lt ? (S O)) [ unfold lt. @@ -184,7 +184,7 @@ elim p | assumption | assumption ]*) - | apply le_S_S_to_le.auto + | apply le_S_S_to_le.autobatch (*apply (trans_le ? n1) [ change with (n1 / m < n1). apply lt_div_n_m_n;assumption @@ -192,7 +192,7 @@ elim p ]*) ] | intros. - simplify.auto + simplify.autobatch (*rewrite > H4. unfold Not. intro. @@ -225,7 +225,7 @@ apply p_ord_exp [ assumption | unfold. intro. - auto + autobatch (*apply H1. apply mod_O_to_divides [ assumption @@ -233,7 +233,7 @@ apply p_ord_exp ]*) | apply (trans_le ? (p \sup q)) [ cut ((S O) \lt p) - [ auto + [ autobatch (*elim q [ simplify. apply le_n_Sn @@ -262,7 +262,7 @@ apply p_ord_exp | apply not_eq_to_le_to_lt [ unfold. intro. - auto + autobatch (*apply H1. rewrite < H3. apply (witness ? r r ?). @@ -276,7 +276,7 @@ apply p_ord_exp change with (O \lt r). apply not_eq_to_le_to_lt [ unfold. - intro.auto + intro.autobatch (*apply H1.rewrite < H3. apply (witness ? ? O ?).rewrite < times_n_O. reflexivity*) @@ -292,7 +292,7 @@ intros. unfold p_ord in H2. split [ unfold.intro. - apply (p_ord_aux_to_not_mod_O n n p q r);auto + apply (p_ord_aux_to_not_mod_O n n p q r);autobatch (*[ assumption | assumption | apply le_n @@ -307,7 +307,7 @@ split | assumption ] ]*) -| apply (p_ord_aux_to_exp n);auto +| apply (p_ord_aux_to_exp n);autobatch (*[ apply (trans_lt ? (S O)) [ unfold. apply le_n @@ -329,7 +329,7 @@ cut ((S O) \lt p) [ elim (p_ord_to_exp1 ? ? ? ? Hcut H1 H3). elim (p_ord_to_exp1 ? ? ? ? Hcut H2 H4). apply p_ord_exp1 - [ auto + [ autobatch (*apply (trans_lt ? (S O)) [ unfold. apply le_n @@ -337,13 +337,13 @@ cut ((S O) \lt p) ]*) | unfold. intro. - elim (divides_times_to_divides ? ? ? H H9);auto + elim (divides_times_to_divides ? ? ? H H9);autobatch (*[ apply (absurd ? ? H10 H5) | apply (absurd ? ? H10 H7) ]*) | (* rewrite > H6. rewrite > H8. *) - auto paramodulation + autobatch paramodulation ] | unfold prime in H. elim H. @@ -356,7 +356,7 @@ theorem fst_p_ord_times: \forall p,a,b. prime p \to fst ? ? (p_ord (a*b) p) = (fst ? ? (p_ord a p)) + (fst ? ? (p_ord b p)). intros. rewrite > (p_ord_times p a b (fst ? ? (p_ord a p)) (snd ? ? (p_ord a p)) -(fst ? ? (p_ord b p)) (snd ? ? (p_ord b p)) H H1 H2);auto. +(fst ? ? (p_ord b p)) (snd ? ? (p_ord b p)) H H1 H2);autobatch. (*[ simplify. reflexivity | apply eq_pair_fst_snd @@ -367,7 +367,7 @@ qed. theorem p_ord_p : \forall p:nat. (S O) \lt p \to p_ord p p = pair ? ? (S O) (S O). intros. apply p_ord_exp1 -[ auto +[ autobatch (*apply (trans_lt ? (S O)) [ unfold. apply le_n @@ -375,14 +375,14 @@ apply p_ord_exp1 ]*) | unfold. intro. - apply (absurd ? ? H).auto + apply (absurd ? ? H).autobatch (*apply le_to_not_lt. apply divides_to_le [ unfold. apply le_n | assumption ]*) -| auto +| autobatch (*rewrite < times_n_SO. apply exp_n_SO*) ] diff --git a/matita/library_auto/auto/nat/orders.ma b/matita/library_auto/auto/nat/orders.ma index 0ae30794c..0f99c1a65 100644 --- a/matita/library_auto/auto/nat/orders.ma +++ b/matita/library_auto/auto/nat/orders.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -set "baseuri" "cic:/matita/library_auto/nat/orders". +set "baseuri" "cic:/matita/library_autobatch/nat/orders". include "auto/nat/nat.ma". include "higher_order_defs/ordering.ma". @@ -23,40 +23,40 @@ inductive le (n:nat) : nat \to Prop \def | le_S : \forall m:nat. le n m \to le n (S m). (*CSC: the URI must disappear: there is a bug now *) -interpretation "natural 'less or equal to'" 'leq x y = (cic:/matita/library_auto/nat/orders/le.ind#xpointer(1/1) x y). +interpretation "natural 'less or equal to'" 'leq x y = (cic:/matita/library_autobatch/nat/orders/le.ind#xpointer(1/1) x y). (*CSC: the URI must disappear: there is a bug now *) interpretation "natural 'neither less nor equal to'" 'nleq x y = (cic:/matita/logic/connectives/Not.con - (cic:/matita/library_auto/nat/orders/le.ind#xpointer(1/1) x y)). + (cic:/matita/library_autobatch/nat/orders/le.ind#xpointer(1/1) x y)). definition lt: nat \to nat \to Prop \def \lambda n,m:nat.(S n) \leq m. (*CSC: the URI must disappear: there is a bug now *) -interpretation "natural 'less than'" 'lt x y = (cic:/matita/library_auto/nat/orders/lt.con x y). +interpretation "natural 'less than'" 'lt x y = (cic:/matita/library_autobatch/nat/orders/lt.con x y). (*CSC: the URI must disappear: there is a bug now *) interpretation "natural 'not less than'" 'nless x y = - (cic:/matita/logic/connectives/Not.con (cic:/matita/library_auto/nat/orders/lt.con x y)). + (cic:/matita/logic/connectives/Not.con (cic:/matita/library_autobatch/nat/orders/lt.con x y)). definition ge: nat \to nat \to Prop \def \lambda n,m:nat.m \leq n. (*CSC: the URI must disappear: there is a bug now *) -interpretation "natural 'greater or equal to'" 'geq x y = (cic:/matita/library_auto/nat/orders/ge.con x y). +interpretation "natural 'greater or equal to'" 'geq x y = (cic:/matita/library_autobatch/nat/orders/ge.con x y). definition gt: nat \to nat \to Prop \def \lambda n,m:nat.m H7. apply H*) ] ] - | auto + | autobatch (*apply le_to_or_lt_eq. apply H6*) ] diff --git a/matita/library_auto/auto/nat/permutation.ma b/matita/library_auto/auto/nat/permutation.ma index b3b9dae8d..01e340c6b 100644 --- a/matita/library_auto/auto/nat/permutation.ma +++ b/matita/library_auto/auto/nat/permutation.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -set "baseuri" "cic:/matita/library_auto/nat/permutation". +set "baseuri" "cic:/matita/library_autobatch/nat/permutation". include "auto/nat/compare.ma". include "auto/nat/sigma_and_pi.ma". @@ -25,7 +25,7 @@ theorem injn_Sn_n: \forall f:nat \to nat. \forall n:nat. injn f (S n) \to injn f n. unfold injn. intros. -apply H;auto. +apply H;autobatch. (*[ apply le_S. assumption | apply le_S. @@ -38,7 +38,7 @@ theorem injective_to_injn: \forall f:nat \to nat. \forall n:nat. injective nat nat f \to injn f n. unfold injective. unfold injn. -intros.auto. +intros.autobatch. (*apply H. assumption.*) qed. @@ -52,7 +52,7 @@ permut h O \to (h O) = O. intros. unfold permut in H. elim H. -apply sym_eq.auto. +apply sym_eq.autobatch. (*apply le_n_O_to_eq. apply H1. apply le_n.*) @@ -67,7 +67,7 @@ split [ intros. cut (f i < S m \lor f i = S m) [ elim Hcut - [ auto + [ autobatch (*apply le_S_S_to_le. assumption*) | apply False_ind. @@ -77,17 +77,17 @@ split assumption | apply H3 [ apply le_n - | auto + | autobatch (*apply le_S. assumption*) - | auto + | autobatch (*rewrite > H5. assumption*) ] ] ] | apply le_to_or_lt_eq. - auto + autobatch (*apply H2. apply le_S. assumption*) @@ -116,13 +116,13 @@ notation < "(❲i \atop j❳)n" for @{ 'transposition $i $j $n}. interpretation "natural transposition" 'transposition i j n = - (cic:/matita/library_auto/nat/permutation/transpose.con i j n). + (cic:/matita/library_autobatch/nat/permutation/transpose.con i j n). lemma transpose_i_j_i: \forall i,j:nat. transpose i j i = j. intros. unfold transpose. -(*dopo circa 6 minuti, l'esecuzione di auto in questo punto non era ancora terminata*) -rewrite > (eqb_n_n i).auto. +(*dopo circa 6 minuti, l'esecuzione di autobatch in questo punto non era ancora terminata*) +rewrite > (eqb_n_n i).autobatch. (*simplify. reflexivity.*) qed. @@ -131,7 +131,7 @@ lemma transpose_i_j_j: \forall i,j:nat. transpose i j j = i. intros. unfold transpose. apply (eqb_elim j i) -[ auto +[ autobatch (*simplify. intro. assumption*) @@ -146,13 +146,13 @@ theorem transpose_i_i: \forall i,n:nat. (transpose i i n) = n. intros. unfold transpose. apply (eqb_elim n i) -[ auto +[ autobatch (*intro. simplify. apply sym_eq. assumption*) | intro. - auto + autobatch (*simplify. reflexivity*) ] @@ -165,20 +165,20 @@ unfold transpose. apply (eqb_elim n i) [ apply (eqb_elim n j) [ intros. - (*l'esecuzione di auto in questo punto, dopo circa 300 secondi, non era ancora terminata*) - simplify.auto + (*l'esecuzione di autobatch in questo punto, dopo circa 300 secondi, non era ancora terminata*) + simplify.autobatch (*rewrite < H. rewrite < H1. reflexivity*) | intros. - auto + autobatch (*simplify. reflexivity*) ] | apply (eqb_elim n j) - [ intros.auto + [ intros.autobatch (*simplify.reflexivity *) - | intros.auto + | intros.autobatch (*simplify.reflexivity*) ] ] @@ -195,14 +195,14 @@ apply (eqb_elim n i) apply (eqb_elim j i) [ simplify. intros. - auto + autobatch (*rewrite > H. rewrite > H1. reflexivity*) | rewrite > (eqb_n_n j). simplify. intros. - auto + autobatch (*apply sym_eq. assumption*) ] @@ -210,16 +210,16 @@ apply (eqb_elim n i) [ simplify. rewrite > (eqb_n_n i). intros. - auto + autobatch (*simplify. apply sym_eq. assumption*) | simplify. intros. - (*l'esecuzione di auto in questo punto, dopo piu' di 6 minuti non era ancora terminata*) + (*l'esecuzione di autobatch in questo punto, dopo piu' di 6 minuti non era ancora terminata*) rewrite > (not_eq_to_eqb_false n i H1). - (*l'esecuzione di auto in questo punto, dopo piu' alcuni minuti non era ancora terminata*) - rewrite > (not_eq_to_eqb_false n j H).auto + (*l'esecuzione di autobatch in questo punto, dopo piu' alcuni minuti non era ancora terminata*) + rewrite > (not_eq_to_eqb_false n j H).autobatch (*simplify. reflexivity*) ] @@ -229,7 +229,7 @@ qed. theorem injective_transpose : \forall i,j:nat. injective nat nat (transpose i j). unfold injective. -intros.auto. +intros.autobatch. (*rewrite < (transpose_transpose i j x). rewrite < (transpose_transpose i j y). apply eq_f. @@ -248,19 +248,19 @@ split [ unfold transpose. intros. elim (eqb i1 i) - [ (*qui auto non chiude il goal*) + [ (*qui autobatch non chiude il goal*) simplify. assumption | elim (eqb i1 j) - [ (*aui auto non chiude il goal*) + [ (*aui autobatch non chiude il goal*) simplify. assumption - | (*aui auto non chiude il goal*) + | (*aui autobatch non chiude il goal*) simplify. assumption ] ] -| auto +| autobatch (*apply (injective_to_injn (transpose i j) n). apply injective_transpose*) ] @@ -275,7 +275,7 @@ elim H1. split [ intros. simplify. - auto + autobatch (*apply H2. apply H4. assumption*) @@ -285,10 +285,10 @@ split [ assumption | assumption | apply H3 - [ auto + [ autobatch (*apply H4. assumption*) - | auto + | autobatch (*apply H4. assumption*) | assumption @@ -301,7 +301,7 @@ theorem permut_transpose_l: \forall f:nat \to nat. \forall m,i,j:nat. i \le m \to j \le m \to permut f m \to permut (\lambda n.transpose i j (f n)) m. intros. -auto. +autobatch. (*apply (permut_fg (transpose i j) f m ? ?) [ apply permut_transpose;assumption | assumption @@ -311,7 +311,7 @@ qed. theorem permut_transpose_r: \forall f:nat \to nat. \forall m,i,j:nat. i \le m \to j \le m \to permut f m \to permut (\lambda n.f (transpose i j n)) m. -intros.auto. +intros.autobatch. (*apply (permut_fg f (transpose i j) m ? ?) [ assumption | apply permut_transpose;assumption @@ -345,11 +345,11 @@ apply (eqb_elim n i) simplify. rewrite > (not_eq_to_eqb_false k i) [ rewrite > (eqb_n_n k). - auto + autobatch (*simplify. reflexivity*) | unfold Not. - intro.auto + intro.autobatch (*apply H1. apply sym_eq. assumption*) @@ -357,7 +357,7 @@ apply (eqb_elim n i) | assumption ] | unfold Not. - intro.auto + intro.autobatch (*apply H2. apply (trans_eq ? ? n) [ apply sym_eq. @@ -373,11 +373,11 @@ apply (eqb_elim n i) rewrite > (not_eq_to_eqb_false i j) [ simplify. rewrite > (eqb_n_n i). - auto + autobatch (*simplify. assumption*) | unfold Not. - intro.auto + intro.autobatch (*apply H. apply sym_eq. assumption*) @@ -389,7 +389,7 @@ apply (eqb_elim n i) simplify. rewrite > (not_eq_to_eqb_false n i H3). rewrite > (not_eq_to_eqb_false n k H5). - auto + autobatch (*simplify. reflexivity*) ] @@ -414,7 +414,7 @@ split [ apply (not_le_Sn_n m). rewrite < Hcut. assumption - | apply H2;auto + | apply H2;autobatch (*[ apply le_S. assumption | apply le_n @@ -428,15 +428,15 @@ split cut (f (S m) \lt (S m) \lor f (S m) = (S m)) [ elim Hcut [ apply le_S_S_to_le. - (*NB qui auto non chiude il goal*) + (*NB qui autobatch non chiude il goal*) assumption | apply False_ind. - auto + autobatch (*apply H4. rewrite > H6. assumption*) ] - | auto + | autobatch (*apply le_to_or_lt_eq. apply H1. apply le_n*) @@ -444,16 +444,16 @@ split | intro.simplify. cut (f i \lt (S m) \lor f i = (S m)) [ elim Hcut - [ auto + [ autobatch (*apply le_S_S_to_le. assumption*) | apply False_ind. - auto + autobatch (*apply H5. assumption*) ] | apply le_to_or_lt_eq. - auto + autobatch (*apply H1. apply le_S. assumption*) @@ -462,7 +462,7 @@ split ] | unfold injn. intros. - apply H2;auto + apply H2;autobatch (*[ apply le_S. assumption | apply le_S. @@ -506,7 +506,7 @@ elim (H m) split [ cut (a < S n \lor a = S n) [ elim Hcut - [ auto + [ autobatch (*apply le_S_S_to_le. assumption*) | apply False_ind. @@ -516,13 +516,13 @@ elim (H m) rewrite > H5. assumption ] - | auto + | autobatch (*apply le_to_or_lt_eq. assumption*) ] | assumption ] -| auto +| autobatch (*apply le_S. assumption*) ] @@ -537,17 +537,17 @@ cut (m < S n \lor m = S n) [ elim (H m) [ elim H4. apply (ex_intro ? ? a). - auto + autobatch (*split [ apply le_S. assumption | assumption ]*) - | auto + | autobatch (*apply le_S_S_to_le. assumption*) ] - | auto + | autobatch (*apply (ex_intro ? ? (S n)). split [ apply le_n @@ -555,7 +555,7 @@ cut (m < S n \lor m = S n) assumption ]*) ] -| auto +| autobatch (*apply le_to_or_lt_eq. assumption*) ] @@ -570,7 +570,7 @@ elim (H m) [ elim H3. elim (H1 a) [ elim H6. - auto + autobatch (*apply (ex_intro ? ? a1). split [ assumption @@ -596,16 +596,16 @@ cut (m = i \lor \lnot m = i) [ assumption | apply (eqb_elim j i) [ intro. - (*dopo circa 360 secondi l'esecuzione di auto in questo punto non era ancora terminata*) + (*dopo circa 360 secondi l'esecuzione di autobatch in questo punto non era ancora terminata*) simplify. - auto + autobatch (*rewrite > H3. rewrite > H4. reflexivity*) | rewrite > (eqb_n_n j). simplify. intros. - auto + autobatch (*apply sym_eq. assumption*) ] @@ -615,9 +615,9 @@ cut (m = i \lor \lnot m = i) [ apply (ex_intro ? ? i). split [ assumption - | (*dopo circa 5 minuti, l'esecuzione di auto in questo punto non era ancora terminata*) + | (*dopo circa 5 minuti, l'esecuzione di autobatch in questo punto non era ancora terminata*) rewrite > (eqb_n_n i). - auto + autobatch (*simplify. apply sym_eq. assumption*) @@ -626,9 +626,9 @@ cut (m = i \lor \lnot m = i) split [ assumption | rewrite > (not_eq_to_eqb_false m i) - [ (*dopo circa 5 minuti, l'esecuzione di auto in questo punto non era ancora terminata*) + [ (*dopo circa 5 minuti, l'esecuzione di autobatch in questo punto non era ancora terminata*) rewrite > (not_eq_to_eqb_false m j) - [ auto + [ autobatch (*simplify. reflexivity*) | assumption @@ -646,7 +646,7 @@ qed. theorem bijn_transpose_r: \forall f:nat\to nat.\forall n,i,j. i \le n \to j \le n \to bijn f n \to bijn (\lambda p.f (transpose i j p)) n. -intros.auto. +intros.autobatch. (*apply (bijn_fg f ?) [ assumption | apply (bijn_transpose n i j) @@ -659,7 +659,7 @@ qed. theorem bijn_transpose_l: \forall f:nat\to nat.\forall n,i,j. i \le n \to j \le n \to bijn f n \to bijn (\lambda p.transpose i j (f p)) n. intros. -auto. +autobatch. (*apply (bijn_fg ? f) [ apply (bijn_transpose n i j) [ assumption @@ -683,7 +683,7 @@ elim n | unfold permut in H. elim H. apply sym_eq. - auto + autobatch (*apply le_n_O_to_eq. apply H2. apply le_n*) @@ -696,17 +696,17 @@ elim n | apply (bijn_fg (transpose (f (S n1)) (S n1))) [ apply bijn_transpose [ unfold permut in H1. - elim H1.auto + elim H1.autobatch (*apply H2. apply le_n*) | apply le_n ] | apply bijn_n_Sn [ apply H. - auto + autobatch (*apply permut_S_to_permut_transpose. assumption*) - | auto + | autobatch (*unfold transpose. rewrite > (eqb_n_n (f (S n1))). simplify. @@ -732,30 +732,30 @@ elim H [ apply (nat_case1 m) [ intro. simplify. - (*l'applicazione di auto in questo punto, dopo alcuni minuti, non aveva ancora dato risultati*) + (*l'applicazione di autobatch in questo punto, dopo alcuni minuti, non aveva ancora dato risultati*) rewrite > (eqb_n_n (f O)). - auto + autobatch (*simplify. reflexivity*) | intros.simplify. - (*l'applicazione di auto in questo punto, dopo alcuni minuti, non aveva ancora dato risultati*) + (*l'applicazione di autobatch in questo punto, dopo alcuni minuti, non aveva ancora dato risultati*) rewrite > (eqb_n_n (f (S m1))). - auto + autobatch (*simplify. reflexivity*) ] | simplify. rewrite > (not_eq_to_eqb_false (f m) (f (S n1))) - [ (*l'applicazione di auto in questo punto, dopo parecchi secondi, non aveva ancora prodotto un risultato*) + [ (*l'applicazione di autobatch in questo punto, dopo parecchi secondi, non aveva ancora prodotto un risultato*) simplify. - auto + autobatch (*apply H2. apply injn_Sn_n. assumption*) | unfold Not. intro. absurd (m = S n1) - [ apply H3;auto + [ apply H3;autobatch (*[ apply le_S. assumption | apply le_n @@ -803,7 +803,7 @@ cut (bijn f n) elim H. assumption ] -| auto +| autobatch (*apply permut_to_bijn. assumption*) ] @@ -818,7 +818,7 @@ split simplify. elim n [ simplify. - elim (eqb i (f O));auto + elim (eqb i (f O));autobatch (*[ simplify. apply le_n | simplify. @@ -826,16 +826,16 @@ split ]*) | simplify. elim (eqb i (f (S n1))) - [ auto + [ autobatch (*simplify. apply le_n*) | simplify. - auto + autobatch (*apply le_S. assumption*) ] ] -| auto +| autobatch (*apply injective_invert_permut. assumption.*) ] @@ -850,11 +850,11 @@ apply (injective_invert_permut f n H1) apply H2. cut (permut (invert_permut n f) n) [ unfold permut in Hcut. - elim Hcut.auto + elim Hcut.autobatch (*apply H4. assumption*) | apply permut_invert_permut. - (*NB qui auto non chiude il goal*) + (*NB qui autobatch non chiude il goal*) assumption ] | assumption @@ -862,10 +862,10 @@ apply (injective_invert_permut f n H1) [ cut (permut (invert_permut n f) n) [ unfold permut in Hcut. elim Hcut. - auto + autobatch (*apply H2. assumption*) - | auto + | autobatch (*apply permut_invert_permut. assumption*) ] @@ -886,21 +886,21 @@ cut (invert_permut n h n < n \lor invert_permut n h n = n) [ rewrite < (f_invert_permut h n n) in \vdash (? ? ? %) [ apply eq_f. rewrite < (f_invert_permut h n n) in \vdash (? ? % ?) - [ auto + [ autobatch (*apply H1. assumption*) | apply le_n - | (*qui auto NON chiude il goal*) + | (*qui autobatch NON chiude il goal*) assumption ] | apply le_n - | (*qui auto NON chiude il goal*) + | (*qui autobatch NON chiude il goal*) assumption ] | rewrite < H4 in \vdash (? ? % ?). apply (f_invert_permut h) [ apply le_n - | (*qui auto NON chiude il goal*) + | (*qui autobatch NON chiude il goal*) assumption ] ] @@ -908,11 +908,11 @@ cut (invert_permut n h n < n \lor invert_permut n h n = n) cut (permut (invert_permut n h) n) [ unfold permut in Hcut. elim Hcut. - auto + autobatch (*apply H4. apply le_n*) | apply permut_invert_permut. - (*NB aui auto non chiude il goal*) + (*NB aui autobatch non chiude il goal*) assumption ] ] @@ -932,7 +932,7 @@ cut (h j < k \lor \not(h j < k)) cut (h j = j) [ rewrite < Hcut1. assumption - | apply H6;auto + | apply H6;autobatch (*[ apply H5. assumption | assumption @@ -941,7 +941,7 @@ cut (h j < k \lor \not(h j < k)) ]*) ] ] - | auto + | autobatch (*apply not_lt_to_le. assumption*) ] @@ -963,14 +963,14 @@ map_iter_i n g1 f i = map_iter_i n g2 f i. intros 5. elim n [ simplify. - auto + autobatch (*apply H [ apply le_n | apply le_n ]*) | simplify. apply eq_f2 - [ auto + [ autobatch (*apply H1 [ simplify. apply le_S. @@ -980,7 +980,7 @@ elim n ]*) | apply H. intros. - apply H1;auto + apply H1;autobatch (*[ assumption | simplify. apply le_S. @@ -996,11 +996,11 @@ theorem eq_map_iter_i_sigma: \forall g:nat \to nat. \forall n,m:nat. map_iter_i n g plus m = sigma n g m. intros. elim n -[ auto +[ autobatch (*simplify. reflexivity*) | simplify. - auto + autobatch (*apply eq_f. assumption*) ] @@ -1010,11 +1010,11 @@ theorem eq_map_iter_i_pi: \forall g:nat \to nat. \forall n,m:nat. map_iter_i n g times m = pi n g m. intros. elim n -[ auto +[ autobatch (*simplify. reflexivity*) | simplify. - auto + autobatch (*apply eq_f. assumption*) ] @@ -1024,7 +1024,7 @@ theorem eq_map_iter_i_fact: \forall n:nat. map_iter_i n (\lambda m.m) times (S O) = (S n)!. intros. elim n -[ auto +[ autobatch (*simplify. reflexivity*) | change with @@ -1032,7 +1032,7 @@ elim n rewrite < plus_n_Sm. rewrite < plus_n_O. apply eq_f. - (*NB: qui auto non chiude il goal!!!*) + (*NB: qui autobatch non chiude il goal!!!*) assumption ] qed. @@ -1046,7 +1046,7 @@ apply (nat_case1 k) [ intros. simplify. fold simplify (transpose n (S n) (S n)). - auto + autobatch (*rewrite > transpose_i_j_i. rewrite > transpose_i_j_j. apply H1*) @@ -1068,11 +1068,11 @@ apply (nat_case1 k) unfold transpose. rewrite > (not_eq_to_eqb_false m1 (S m+n)) [ rewrite > (not_eq_to_eqb_false m1 (S (S m)+n)) - [ auto + [ autobatch (*simplify. reflexivity*) | apply (lt_to_not_eq m1 (S ((S m)+n))). - auto + autobatch (*unfold lt. apply le_S_S. change with (m1 \leq S (m+n)). @@ -1080,7 +1080,7 @@ apply (nat_case1 k) assumption*) ] | apply (lt_to_not_eq m1 (S m+n)). - simplify.auto + simplify.autobatch (*unfold lt. apply le_S_S. assumption*) @@ -1095,7 +1095,7 @@ intros 6. elim k [ cut (i=n) [ rewrite > Hcut. - (*qui auto non chiude il goal*) + (*qui autobatch non chiude il goal*) apply (eq_map_iter_i_transpose_l f H H1 g n O) | apply antisymmetric_le [ assumption @@ -1111,7 +1111,7 @@ elim k [ unfold transpose. rewrite > (not_eq_to_eqb_false (S (S n1)+n) i) [ rewrite > (not_eq_to_eqb_false (S (S n1)+n) (S i)) - [ auto + [ autobatch (*simplify. reflexivity*) | simplify. @@ -1119,7 +1119,7 @@ elim k intro. apply (lt_to_not_eq i (S n1+n)) [ assumption - | auto + | autobatch (*apply inj_S. apply sym_eq. assumption*) @@ -1129,27 +1129,27 @@ elim k unfold Not. intro. apply (lt_to_not_eq i (S (S n1+n))) - [ auto + [ autobatch (*simplify. unfold lt. apply le_S_S. assumption*) - | auto + | autobatch (*apply sym_eq. assumption*) ] ] - | apply H2;auto + | apply H2;autobatch (*[ assumption | apply le_S_S_to_le. assumption ]*) ] | rewrite > H5. - (*qui auto non chiude il goal*) + (*qui autobatch non chiude il goal*) apply (eq_map_iter_i_transpose_l f H H1 g n (S n1)). ] - | auto + | autobatch (*apply le_to_or_lt_eq. assumption*) ] @@ -1166,7 +1166,7 @@ apply (nat_elim1 o). intro. apply (nat_case m ?) [ intros. - apply (eq_map_iter_i_transpose_i_Si ? H H1);auto + apply (eq_map_iter_i_transpose_i_Si ? H H1);autobatch (*[ exact H3 | apply le_S_S_to_le. assumption @@ -1174,50 +1174,50 @@ apply (nat_case m ?) | intros. apply (trans_eq ? ? (map_iter_i (S k) (\lambda m. g (transpose i (S(m1 + i)) m)) f n)) [ apply H2 - [ auto + [ autobatch (*unfold lt. apply le_n*) | assumption | apply (trans_le ? (S(S (m1+i)))) - [ auto + [ autobatch (*apply le_S. apply le_n*) - | (*qui auto non chiude il goal, chiuso invece da assumption*) + | (*qui autobatch non chiude il goal, chiuso invece da assumption*) 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)) - [ (*qui auto dopo alcuni minuti non aveva ancora terminato la propria esecuzione*) + [ (*qui autobatch dopo alcuni minuti non aveva ancora terminato la propria esecuzione*) apply (H2 O ? ? (S(m1+i))) - [ auto + [ autobatch (*unfold lt. apply le_S_S. apply le_O_n*) - | auto + | autobatch (*apply (trans_le ? i) [ assumption | change with (i \le (S m1)+i). apply le_plus_n ]*) - | (*qui auto non chiude il goal*) + | (*qui autobatch non chiude il goal*) exact H4 ] | apply (trans_eq ? ? (map_iter_i (S k) (\lambda m. g (transpose i (S(m1 + i)) (transpose (S(m1 + i)) (S(S(m1 + i))) (transpose i (S(m1 + i)) m)))) f n)) - [ (*qui auto dopo alcuni minuti non aveva ancora terminato la propria esecuzione*) + [ (*qui autobatch dopo alcuni minuti non aveva ancora terminato la propria esecuzione*) apply (H2 m1) - [ auto + [ autobatch (*unfold lt. apply le_n*) | assumption | apply (trans_le ? (S(S (m1+i)))) - [ auto + [ autobatch (*apply le_S. apply le_n*) - | (*qui auto NON CHIUDE il goal*) + | (*qui autobatch NON CHIUDE il goal*) assumption ] ] @@ -1230,7 +1230,7 @@ apply (nat_case m ?) intro. apply (not_le_Sn_n i). rewrite < H7 in \vdash (? ? %). - auto + autobatch (*apply le_S_S. apply le_S. apply le_plus_n*) @@ -1238,12 +1238,12 @@ apply (nat_case m ?) intro. apply (not_le_Sn_n i). rewrite > H7 in \vdash (? ? %). - auto + autobatch (*apply le_S_S. apply le_plus_n*) | unfold Not. intro. - auto + autobatch (*apply (not_eq_n_Sn (S m1+i)). apply sym_eq. assumption*) @@ -1270,25 +1270,25 @@ cut ((S i) < j \lor (S i) = j) assumption ] | rewrite > plus_n_Sm. - auto + autobatch (*apply plus_minus_m_m. apply lt_to_le. assumption*) ] | rewrite < H5. apply (eq_map_iter_i_transpose_i_Si f H H1 g) - [ auto + [ autobatch (*simplify. assumption*) | apply le_S_S_to_le. - auto + autobatch (*apply (trans_le ? j) [ assumption | assumption ]*) ] ] -| auto +| autobatch (*apply le_to_or_lt_eq. assumption*) ] @@ -1301,13 +1301,13 @@ map_iter_i (S k) g f n = map_iter_i (S k) (\lambda m. g (transpose i j m)) f n. intros. apply (nat_compare_elim i j) [ intro. - (*qui auto non chiude il goal*) + (*qui autobatch non chiude il goal*) apply (eq_map_iter_i_transpose1 f H H1 n k i j g H2 H6 H5) | intro. rewrite > H6. apply eq_map_iter_i. intros. - auto + autobatch (*rewrite > (transpose_i_i j). reflexivity*) | intro. @@ -1315,7 +1315,7 @@ apply (nat_compare_elim i j) [ apply (eq_map_iter_i_transpose1 f H H1 n k j i g H4 H6 H3) | apply eq_map_iter_i. intros. - auto + autobatch (*apply eq_f. apply transpose_i_j_j_i*) ] @@ -1331,9 +1331,9 @@ elim k [ simplify. rewrite > (permut_n_to_eq_n h) [ reflexivity - | (*qui auto non chiude il goal*) + | (*qui autobatch non chiude il goal*) assumption - | (*qui auto non chiude il goal*) + | (*qui autobatch non chiude il goal*) assumption ] | apply (trans_eq ? ? (map_iter_i (S n) (\lambda m.g ((transpose (h (S n+n1)) (S n+n1)) m)) f n1)) @@ -1342,14 +1342,14 @@ elim k apply (eq_map_iter_i_transpose2 f H H1 n1 n ? ? g) [ apply (permut_n_to_le h n1 (S n+n1)) [ apply le_plus_n - | (*qui auto non chiude il goal*) + | (*qui autobatch non chiude il goal*) assumption - | (*qui auto non chiude il goal*) + | (*qui autobatch non chiude il goal*) assumption | apply le_plus_n | apply le_n ] - | auto + | autobatch (*apply H5. apply le_n*) | apply le_plus_n @@ -1361,7 +1361,7 @@ elim k [ simplify. fold simplify (transpose (h (S n+n1)) (S n+n1) (S n+n1)). apply eq_f2 - [ auto + [ autobatch (*apply eq_f. rewrite > transpose_i_j_j. rewrite > transpose_i_j_i. @@ -1369,18 +1369,18 @@ elim k reflexivity.*) | apply (H2 n1 (\lambda m.(g(transpose (h (S n+n1)) (S n+n1) m)))) [ apply permut_S_to_permut_transpose. - (*qui auto non chiude il goal*) + (*qui autobatch non chiude il goal*) assumption | intros. unfold transpose. rewrite > (not_eq_to_eqb_false (h m) (h (S n+n1))) [ rewrite > (not_eq_to_eqb_false (h m) (S n+n1)) [ simplify. - auto + autobatch (*apply H4. assumption*) | rewrite > H4 - [ auto + [ autobatch (*apply lt_to_not_eq. apply (trans_lt ? n1) [ assumption @@ -1398,7 +1398,7 @@ elim k unfold Not. intro. apply (lt_to_not_eq m (S n+n1)) - [ auto + [ autobatch (*apply (trans_lt ? n1) [ assumption | simplify. @@ -1408,7 +1408,7 @@ elim k ]*) | unfold injn in H7. apply (H7 m (S n+n1)) - [ auto + [ autobatch (*apply (trans_le ? n1) [ apply lt_to_le. assumption @@ -1423,7 +1423,7 @@ elim k ] | apply eq_map_iter_i. intros. - auto + autobatch (*rewrite > transpose_transpose. reflexivity*) ] diff --git a/matita/library_auto/auto/nat/plus.ma b/matita/library_auto/auto/nat/plus.ma index 02b819f46..59259ca68 100644 --- a/matita/library_auto/auto/nat/plus.ma +++ b/matita/library_auto/auto/nat/plus.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -set "baseuri" "cic:/matita/library_auto/nat/plus". +set "baseuri" "cic:/matita/library_autobatch/nat/plus". include "auto/nat/nat.ma". @@ -22,14 +22,14 @@ let rec plus n m \def | (S p) \Rightarrow S (plus p m) ]. (*CSC: the URI must disappear: there is a bug now *) -interpretation "natural plus" 'plus x y = (cic:/matita/library_auto/nat/plus/plus.con x y). +interpretation "natural plus" 'plus x y = (cic:/matita/library_autobatch/nat/plus/plus.con x y). theorem plus_n_O: \forall n:nat. n = n+O. intros.elim n -[ auto +[ autobatch (*simplify. reflexivity*) -| auto +| autobatch (*simplify. apply eq_f. assumption.*) @@ -38,11 +38,11 @@ qed. theorem plus_n_Sm : \forall n,m:nat. S (n+m) = n+(S m). intros.elim n -[ auto +[ autobatch (*simplify. reflexivity.*) | simplify. - auto + autobatch (* apply eq_f. assumption.*)] @@ -50,22 +50,22 @@ qed. theorem sym_plus: \forall n,m:nat. n+m = m+n. intros.elim n -[ auto +[ autobatch (*simplify. apply plus_n_O.*) | simplify. - auto + autobatch (*rewrite > H. apply plus_n_Sm.*)] qed. theorem associative_plus : associative nat plus. unfold associative.intros.elim x -[auto +[autobatch (*simplify. reflexivity.*) |simplify. - auto + autobatch (*apply eq_f. assumption.*) ] @@ -77,7 +77,7 @@ theorem assoc_plus : \forall n,m,p:nat. (n+m)+p = n+(m+p) theorem injective_plus_r: \forall n:nat.injective nat nat (\lambda m.n+m). intro.simplify.intros 2.elim n [ exact H -| auto +| autobatch (*apply H.apply inj_S.apply H1.*) ] qed. @@ -86,7 +86,7 @@ theorem inj_plus_r: \forall p,n,m:nat. p+n = p+m \to n=m \def injective_plus_r. theorem injective_plus_l: \forall m:nat.injective nat nat (\lambda n.n+m). -intro.simplify.intros.auto. +intro.simplify.intros.autobatch. (*apply (injective_plus_r m). rewrite < sym_plus. rewrite < (sym_plus y). diff --git a/matita/library_auto/auto/nat/primes.ma b/matita/library_auto/auto/nat/primes.ma index ee925ed38..21d752f71 100644 --- a/matita/library_auto/auto/nat/primes.ma +++ b/matita/library_auto/auto/nat/primes.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -set "baseuri" "cic:/matita/library_auto/nat/primes". +set "baseuri" "cic:/matita/library_autobatch/nat/primes". include "auto/nat/div_and_mod.ma". include "auto/nat/minimization.ma". @@ -22,9 +22,9 @@ include "auto/nat/factorial.ma". inductive divides (n,m:nat) : Prop \def witness : \forall p:nat.m = times n p \to divides n m. -interpretation "divides" 'divides n m = (cic:/matita/library_auto/nat/primes/divides.ind#xpointer(1/1) n m). +interpretation "divides" 'divides n m = (cic:/matita/library_autobatch/nat/primes/divides.ind#xpointer(1/1) n m). interpretation "not divides" 'ndivides n m = - (cic:/matita/logic/connectives/Not.con (cic:/matita/library_auto/nat/primes/divides.ind#xpointer(1/1) n m)). + (cic:/matita/logic/connectives/Not.con (cic:/matita/library_autobatch/nat/primes/divides.ind#xpointer(1/1) n m)). theorem reflexive_divides : reflexive nat divides. unfold reflexive. @@ -41,7 +41,7 @@ constructor 1 [ assumption | apply (lt_O_n_elim n H). intros. - auto + autobatch (*rewrite < plus_n_O. rewrite > div_times. apply sym_times*) @@ -52,7 +52,7 @@ theorem div_mod_spec_to_divides : \forall n,m,p. div_mod_spec m n p O \to n \divides m. intros. elim H. -auto. +autobatch. (*apply (witness n m p). rewrite < sym_times. rewrite > (plus_n_O (p*n)). @@ -63,10 +63,10 @@ theorem divides_to_mod_O: \forall n,m. O < n \to n \divides m \to (m \mod n) = O. intros. apply (div_mod_spec_to_eq2 m n (m / n) (m \mod n) (m / n) O) -[ auto +[ autobatch (*apply div_mod_spec_div_mod. assumption*) -| auto +| autobatch (*apply divides_to_div_mod_spec;assumption*) ] qed. @@ -78,7 +78,7 @@ apply (witness n m (m / n)). rewrite > (plus_n_O (n * (m / n))). rewrite < H1. rewrite < sym_times. -auto. +autobatch. (* Andrea: perche' hint non lo trova ?*) (*apply div_mod. assumption.*) @@ -86,13 +86,13 @@ qed. theorem divides_n_O: \forall n:nat. n \divides O. intro. -auto. +autobatch. (*apply (witness n O O). apply times_n_O.*) qed. theorem divides_n_n: \forall n:nat. n \divides n. -auto. +autobatch. (*intro. apply (witness n n (S O)). apply times_n_SO.*) @@ -100,7 +100,7 @@ qed. theorem divides_SO_n: \forall n:nat. (S O) \divides n. intro. -auto. +autobatch. (*apply (witness (S O) n n). simplify. apply plus_n_O.*) @@ -112,7 +112,7 @@ intros. elim H. elim H1. apply (witness n (p+q) (n2+n1)). -auto. +autobatch. (*rewrite > H2. rewrite > H3. apply sym_eq. @@ -125,7 +125,7 @@ intros. elim H. elim H1. apply (witness n (p-q) (n2-n1)). -auto. +autobatch. (*rewrite > H2. rewrite > H3. apply sym_eq. @@ -145,14 +145,14 @@ apply (trans_eq nat ? (n*(m*(n2*n1)))) [ apply assoc_times | apply eq_f. apply (trans_eq nat ? ((n2*m)*n1)) - [ auto + [ autobatch (*apply sym_eq. apply assoc_times*) | rewrite > (sym_times n2 m). apply assoc_times ] ] -| auto +| autobatch (*apply sym_eq. apply assoc_times*) ] @@ -164,7 +164,7 @@ intros. elim H. elim H1. apply (witness x z (n2*n)). -auto. +autobatch. (*rewrite > H3. rewrite > H2. apply assoc_times.*) @@ -179,11 +179,11 @@ intros. cut (n \le m \or \not n \le m) [ elim Hcut [ cut (n-m=O) - [ auto + [ autobatch (*rewrite > Hcut1. apply (witness p O O). apply times_n_O*) - | auto + | autobatch (*apply eq_minus_n_m_O. assumption*) ] @@ -196,7 +196,7 @@ cut (n \le m \or \not n \le m) rewrite > eq_minus_minus_minus_plus. rewrite > sym_plus. rewrite > H1. - auto + autobatch (*rewrite < div_mod [ reflexivity | assumption @@ -204,7 +204,7 @@ cut (n \le m \or \not n \le m) | apply sym_eq. apply plus_to_minus. rewrite > sym_plus. - auto + autobatch (*apply div_mod. assumption*) ] @@ -231,7 +231,7 @@ apply (nat_case1 n2) rewrite > H2. rewrite > H3. rewrite > H5. - auto + autobatch (*rewrite < times_n_O. reflexivity*) | intros. @@ -240,14 +240,14 @@ apply (nat_case1 n2) rewrite > times_n_SO in \vdash (? % ?). apply le_times_r. rewrite > H4. - auto + autobatch (*apply le_S_S. apply le_O_n*) | rewrite > H3. rewrite > times_n_SO in \vdash (? % ?). apply le_times_r. rewrite > H5. - auto + autobatch (*apply le_S_S. apply le_O_n*) ] @@ -263,7 +263,7 @@ rewrite > H2. cut (O < n2) [ apply (lt_O_n_elim n2 Hcut). intro. - auto + autobatch (*rewrite < sym_times. simplify. rewrite < sym_plus. @@ -292,7 +292,7 @@ elim (le_to_or_lt_eq O n (le_O_n n)) [ assumption | rewrite > H2. rewrite < H3. - auto + autobatch (*simplify. exact (not_le_Sn_n O)*) ] @@ -313,13 +313,13 @@ unfold divides_b. apply eqb_elim [ intro. simplify. - auto + autobatch (*apply mod_O_to_divides;assumption*) | intro. simplify. unfold Not. intro. - auto + autobatch (*apply H1. apply divides_to_mod_O;assumption*) ] @@ -364,10 +364,10 @@ cut assumption | elim (divides_b n m) [ left. - (*qui auto non chiude il goal, chiuso dalla sola apply H1*) + (*qui autobatch non chiude il goal, chiuso dalla sola apply H1*) apply H1 | right. - (*qui auto non chiude il goal, chiuso dalla sola apply H1*) + (*qui autobatch non chiude il goal, chiuso dalla sola apply H1*) apply H1 ] ] @@ -386,7 +386,7 @@ cut (match (divides_b n m) with [ reflexivity | absurd (n \divides m) [ assumption - | (*qui auto non chiude il goal, chiuso dalla sola applicazione di assumption*) + | (*qui autobatch non chiude il goal, chiuso dalla sola applicazione di assumption*) assumption ] ] @@ -404,7 +404,7 @@ cut (match (divides_b n m) with assumption | elim (divides_b n m) [ absurd (n \divides m) - [ (*qui auto non chiude il goal, chiuso dalla sola tattica assumption*) + [ (*qui autobatch non chiude il goal, chiuso dalla sola tattica assumption*) assumption | assumption ] @@ -420,7 +420,7 @@ intros 5. elim n [ simplify. cut (i = m) - [ auto + [ autobatch (*rewrite < Hcut. apply divides_n_n*) | apply antisymmetric_le @@ -433,19 +433,19 @@ elim n [ elim Hcut [ apply (transitive_divides ? (pi n1 f m)) [ apply H1. - auto + autobatch (*apply le_S_S_to_le. assumption*) - | auto + | autobatch (*apply (witness ? ? (f (S n1+m))). apply sym_times*) ] - | auto + | autobatch (*rewrite > H3. apply (witness ? ? (pi n1 f m)). reflexivity*) ] - | auto + | autobatch (*apply le_to_or_lt_eq. assumption*) ] @@ -471,7 +471,7 @@ intros 3. elim n [ absurd (O H3. apply (witness ? ? n1!). reflexivity*) @@ -502,7 +502,7 @@ intros. cut (n! \mod i = O) [ rewrite < Hcut. apply mod_S - [ auto + [ autobatch (*apply (trans_lt O (S O)) [ apply (le_n (S O)) | assumption @@ -510,7 +510,7 @@ cut (n! \mod i = O) | rewrite > Hcut. assumption ] -| auto(* +| autobatch(* apply divides_to_mod_O [ apply ltn_to_ltO [| apply H] | apply divides_fact @@ -525,13 +525,13 @@ theorem not_divides_S_fact: \forall n,i:nat. (S O) < i \to i \le n \to i \ndivides S n!. intros. apply divides_b_false_to_not_divides -[ auto +[ autobatch (*apply (trans_lt O (S O)) [ apply (le_n (S O)) | assumption ]*) | unfold divides_b. - rewrite > mod_S_fact;auto + rewrite > mod_S_fact;autobatch (*[ simplify. reflexivity | assumption @@ -588,13 +588,13 @@ theorem lt_SO_smallest_factor: \forall n:nat. (S O) < n \to (S O) < (smallest_factor n). intro. apply (nat_case n) -[ auto +[ autobatch (*intro. apply False_ind. apply (not_le_Sn_O (S O) H)*) | intro. apply (nat_case m) - [ auto + [ autobatch (*intro. apply False_ind. apply (not_le_Sn_n (S O) H)*) | intros. @@ -607,7 +607,7 @@ apply (nat_case n) apply le_min_aux | apply sym_eq. apply plus_to_minus. - auto + autobatch (*rewrite < sym_plus. simplify. reflexivity*) @@ -620,24 +620,24 @@ qed. theorem lt_O_smallest_factor: \forall n:nat. O < n \to O < (smallest_factor n). intro. apply (nat_case n) -[ auto +[ autobatch (*intro. apply False_ind. apply (not_le_Sn_n O H)*) | intro. apply (nat_case m) - [ auto + [ autobatch (*intro. simplify. unfold lt. apply le_n*) | intros. apply (trans_lt ? (S O)) - [ auto + [ autobatch (*unfold lt. apply le_n*) | apply lt_SO_smallest_factor. - unfold lt.auto + unfold lt.autobatch (*apply le_S_S. apply le_S_S. apply le_O_n*) @@ -651,13 +651,13 @@ theorem divides_smallest_factor_n : intro. apply (nat_case n) [ intro. - auto + autobatch (*apply False_ind. apply (not_le_Sn_O O H)*) | intro. apply (nat_case m) [ intro. - auto + autobatch (*simplify. apply (witness ? ? (S O)). simplify. @@ -671,12 +671,12 @@ apply (nat_case n) apply f_min_aux_true. apply (ex_intro nat ? (S(S m1))). split - [ auto + [ autobatch (*split [ apply le_minus_m | apply le_n ]*) - | auto + | autobatch (*rewrite > mod_n_n [ reflexivity | apply (trans_lt ? (S O)) @@ -697,11 +697,11 @@ theorem le_smallest_factor_n : \forall n:nat. smallest_factor n \le n. intro. apply (nat_case n) -[ auto +[ autobatch (*simplify. apply le_n*) | intro. - auto + autobatch (*apply (nat_case m) [ simplify. apply le_n @@ -733,7 +733,7 @@ apply (nat_case n) apply (not_le_Sn_n (S O) H) | intros. apply divides_b_false_to_not_divides - [ auto + [ autobatch (*apply (trans_lt O (S O)) [ apply (le_n (S O)) | assumption @@ -746,7 +746,7 @@ apply (nat_case n) exact H1 | apply sym_eq. apply plus_to_minus. - auto + autobatch (*rewrite < sym_plus. simplify. reflexivity*) @@ -774,14 +774,14 @@ split [ apply (transitive_divides m (smallest_factor n)) [ assumption | apply divides_smallest_factor_n. - auto + autobatch (*apply (trans_lt ? (S O)) [ unfold lt. apply le_n | exact H ]*) ] - | apply lt_smallest_factor_to_not_divides;auto + | apply lt_smallest_factor_to_not_divides;autobatch (*[ exact H | assumption | assumption @@ -806,13 +806,13 @@ smallest_factor n = n. intro. apply (nat_case n) [ intro. - auto + autobatch (*apply False_ind. apply (not_prime_O H)*) | intro. apply (nat_case m) [ intro. - auto + autobatch (*apply False_ind. apply (not_prime_SO H)*) | intro. @@ -822,7 +822,7 @@ apply (nat_case n) smallest_factor (S(S m1)) = (S(S m1))). intro. elim H. - auto + autobatch (*apply H2 [ apply divides_smallest_factor_n. apply (trans_lt ? (S O)) @@ -870,7 +870,7 @@ match primeb n with intro. apply (nat_case n) [ simplify. - auto + autobatch (*unfold Not. unfold prime. intro. @@ -879,7 +879,7 @@ apply (nat_case n) | intro. apply (nat_case m) [ simplify. - auto + autobatch (*unfold Not. unfold prime. intro. @@ -895,7 +895,7 @@ apply (nat_case n) simplify. rewrite < H. apply prime_smallest_factor_n. - unfold lt.auto + unfold lt.autobatch (*apply le_S_S. apply le_S_S. apply le_O_n*) @@ -903,7 +903,7 @@ apply (nat_case n) simplify. change with (prime (S(S m1)) \to False). intro. - auto + autobatch (*apply H. apply prime_to_smallest_factor. assumption*) @@ -920,7 +920,7 @@ match true with [ true \Rightarrow prime n | false \Rightarrow \lnot (prime n)]. rewrite < H. -(*qui auto non chiude il goal*) +(*qui autobatch non chiude il goal*) apply primeb_to_Prop. qed. @@ -932,7 +932,7 @@ match false with [ true \Rightarrow prime n | false \Rightarrow \lnot (prime n)]. rewrite < H. -(*qui auto non chiude il goal*) +(*qui autobatch non chiude il goal*) apply primeb_to_Prop. qed. @@ -944,14 +944,14 @@ cut [ true \Rightarrow prime n | false \Rightarrow \lnot (prime n)] \to (prime n) \lor \lnot (prime n)) [ apply Hcut. - (*qui auto non chiude il goal*) + (*qui autobatch non chiude il goal*) apply primeb_to_Prop | elim (primeb n) [ left. - (*qui auto non chiude il goal*) + (*qui autobatch non chiude il goal*) apply H | right. - (*qui auto non chiude il goal*) + (*qui autobatch non chiude il goal*) apply H ] ] @@ -964,13 +964,13 @@ cut (match (primeb n) with [ true \Rightarrow prime n | false \Rightarrow \lnot (prime n)] \to ((primeb n) = true)) [ apply Hcut. - (*qui auto non chiude il goal*) + (*qui autobatch non chiude il goal*) apply primeb_to_Prop | elim (primeb n) [ reflexivity. | absurd (prime n) [ assumption - | (*qui auto non chiude il goal*) + | (*qui autobatch non chiude il goal*) assumption ] ] @@ -984,11 +984,11 @@ cut (match (primeb n) with [ true \Rightarrow prime n | false \Rightarrow \lnot (prime n)] \to ((primeb n) = false)) [ apply Hcut. - (*qui auto non chiude il goal*) + (*qui autobatch non chiude il goal*) apply primeb_to_Prop | elim (primeb n) [ absurd (prime n) - [ (*qui auto non chiude il goal*) + [ (*qui autobatch non chiude il goal*) assumption | assumption ] diff --git a/matita/library_auto/auto/nat/relevant_equations.ma b/matita/library_auto/auto/nat/relevant_equations.ma index e057351b3..8dee78c4f 100644 --- a/matita/library_auto/auto/nat/relevant_equations.ma +++ b/matita/library_auto/auto/nat/relevant_equations.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -set "baseuri" "cic:/matita/library_auto/nat/relevant_equations". +set "baseuri" "cic:/matita/library_autobatch/nat/relevant_equations". include "auto/nat/times.ma". include "auto/nat/minus.ma". @@ -23,7 +23,7 @@ theorem times_plus_l: \forall n,m,p:nat. (n+m)*p = n*p + m*p. intros. apply (trans_eq ? ? (p*(n+m))) [ apply sym_times -| apply (trans_eq ? ? (p*n+p*m));auto +| apply (trans_eq ? ? (p*n+p*m));autobatch (*[ apply distr_times_plus | apply eq_f2; apply sym_times @@ -35,7 +35,7 @@ theorem times_minus_l: \forall n,m,p:nat. (n-m)*p = n*p - m*p. intros. apply (trans_eq ? ? (p*(n-m))) [ apply sym_times -| apply (trans_eq ? ? (p*n-p*m));auto +| apply (trans_eq ? ? (p*n-p*m));autobatch (*[ apply distr_times_minus | apply eq_f2; apply sym_times @@ -46,7 +46,7 @@ qed. theorem times_plus_plus: \forall n,m,p,q:nat. (n + m)*(p + q) = n*p + n*q + m*p + m*q. intros. -auto. +autobatch. (*apply (trans_eq nat ? ((n*(p+q) + m*(p+q)))) [ apply times_plus_l | rewrite > distr_times_plus. diff --git a/matita/library_auto/auto/nat/sigma_and_pi.ma b/matita/library_auto/auto/nat/sigma_and_pi.ma index c571b48e4..2bf73d4c3 100644 --- a/matita/library_auto/auto/nat/sigma_and_pi.ma +++ b/matita/library_auto/auto/nat/sigma_and_pi.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -set "baseuri" "cic:/matita/library_auto/nat/sigma_and_pi". +set "baseuri" "cic:/matita/library_autobatch/nat/sigma_and_pi". include "auto/nat/factorial.ma". include "auto/nat/exp.ma". @@ -35,7 +35,7 @@ theorem eq_sigma: \forall f,g:nat \to nat. intros 3. elim n [ simplify. - auto + autobatch (*apply H [ apply le_n | rewrite < plus_n_O. @@ -44,10 +44,10 @@ elim n | simplify. apply eq_f2 [ apply H1 - [ auto + [ autobatch (*change with (m \le (S n1)+m). apply le_plus_n*) - | auto + | autobatch (*rewrite > (sym_plus m). apply le_n*) ] @@ -55,7 +55,7 @@ elim n intros. apply H1 [ assumption - | auto + | autobatch (*rewrite < plus_n_Sm. apply le_S. assumption*) @@ -71,7 +71,7 @@ theorem eq_pi: \forall f,g:nat \to nat. intros 3. elim n [ simplify. - auto + autobatch (*apply H [ apply le_n | rewrite < plus_n_O. @@ -80,10 +80,10 @@ elim n | simplify. apply eq_f2 [ apply H1 - [ auto + [ autobatch (*change with (m \le (S n1)+m). apply le_plus_n*) - | auto + | autobatch (*rewrite > (sym_plus m). apply le_n*) ] @@ -91,7 +91,7 @@ elim n intros. apply H1 [ assumption - | auto + | autobatch (*rewrite < plus_n_Sm. apply le_S. assumption*) @@ -103,13 +103,13 @@ qed. theorem eq_fact_pi: \forall n. (S n)! = pi n (\lambda m.m) (S O). intro. elim n -[ auto +[ autobatch (*simplify. reflexivity*) | change with ((S(S n1))*(S n1)! = ((S n1)+(S O))*(pi n1 (\lambda m.m) (S O))). rewrite < plus_n_Sm. rewrite < plus_n_O. - auto + autobatch (*apply eq_f. assumption*) ] @@ -119,7 +119,7 @@ theorem exp_pi_l: \forall f:nat\to nat.\forall n,m,a:nat. (exp a (S n))*pi n f m= pi n (\lambda p.a*(f p)) m. intros. elim n -[ auto +[ autobatch (*simplify. rewrite < times_n_SO. reflexivity*) @@ -130,7 +130,7 @@ elim n apply eq_f. rewrite < assoc_times. rewrite < assoc_times. - auto + autobatch (*apply eq_f2 [ apply sym_times | reflexivity diff --git a/matita/library_auto/auto/nat/times.ma b/matita/library_auto/auto/nat/times.ma index 89cfd4b82..c8e2a4066 100644 --- a/matita/library_auto/auto/nat/times.ma +++ b/matita/library_auto/auto/nat/times.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -set "baseuri" "cic:/matita/library_auto/nat/times". +set "baseuri" "cic:/matita/library_autobatch/nat/times". include "auto/nat/plus.ma". @@ -22,14 +22,14 @@ let rec times n m \def | (S p) \Rightarrow m+(times p m) ]. (*CSC: the URI must disappear: there is a bug now *) -interpretation "natural times" 'times x y = (cic:/matita/library_auto/nat/times/times.con x y). +interpretation "natural times" 'times x y = (cic:/matita/library_autobatch/nat/times/times.con x y). theorem times_n_O: \forall n:nat. O = n*O. intros.elim n -[ auto +[ autobatch (*simplify. reflexivity.*) -| simplify. (* qui auto non funziona: Uncaught exception: Invalid_argument ("List.map2")*) +| simplify. (* qui autobatch non funziona: Uncaught exception: Invalid_argument ("List.map2")*) assumption. ] qed. @@ -37,10 +37,10 @@ qed. theorem times_n_Sm : \forall n,m:nat. n+(n*m) = n*(S m). intros.elim n -[ auto. +[ autobatch. (*simplify.reflexivity.*) | simplify. - auto + autobatch (*apply eq_f. rewrite < H. transitivity ((n1+m)+n1*m) @@ -57,8 +57,8 @@ intros.elim n qed. (* NOTA: - se non avessi semplificato con auto tutto il secondo ramo della tattica - elim n, avrei comunque potuto risolvere direttamente con auto entrambi + se non avessi semplificato con autobatch tutto il secondo ramo della tattica + elim n, avrei comunque potuto risolvere direttamente con autobatch entrambi i rami generati dalla prima applicazione della tattica transitivity (precisamente transitivity ((n1+m)+n1*m) *) @@ -66,7 +66,7 @@ qed. theorem times_n_SO : \forall n:nat. n = n * S O. intros. rewrite < times_n_Sm. -auto paramodulation. (*termina la dim anche solo con auto*) +autobatch paramodulation. (*termina la dim anche solo con autobatch*) (*rewrite < times_n_O. rewrite < plus_n_O. reflexivity.*) @@ -75,7 +75,7 @@ qed. theorem times_SSO_n : \forall n:nat. n + n = S (S O) * n. intros. simplify. -auto paramodulation. (* termina la dim anche solo con auto*) +autobatch paramodulation. (* termina la dim anche solo con autobatch*) (*rewrite < plus_n_O. reflexivity.*) qed. @@ -83,10 +83,10 @@ qed. theorem symmetric_times : symmetric nat times. unfold symmetric. intros.elim x -[ auto +[ autobatch (*simplify.apply times_n_O.*) | simplify. - auto + autobatch (*rewrite > H.apply times_n_Sm.*) ] qed. @@ -98,7 +98,7 @@ theorem distributive_times_plus : distributive nat times plus. unfold distributive. intros.elim x;simplify [ reflexivity. -| auto +| autobatch (*rewrite > H. rewrite > assoc_plus. rewrite > assoc_plus. @@ -117,7 +117,7 @@ theorem associative_times: associative nat times. unfold associative.intros. elim x;simplify [ apply refl_eq -| auto +| autobatch (*rewrite < sym_times. rewrite > distr_times_plus. rewrite < sym_times. diff --git a/matita/library_auto/auto/nat/totient.ma b/matita/library_auto/auto/nat/totient.ma index c4e1d5ad9..98b374676 100644 --- a/matita/library_auto/auto/nat/totient.ma +++ b/matita/library_auto/auto/nat/totient.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -set "baseuri" "cic:/matita/library_auto/nat/totient". +set "baseuri" "cic:/matita/library_autobatch/nat/totient". include "auto/nat/count.ma". include "auto/nat/chinese_reminder.ma". @@ -33,7 +33,7 @@ totient (n*m) = (totient n)*(totient m). intro. apply (nat_case n) [ intros. - auto + autobatch (*simplify. reflexivity*) | intros 2. @@ -53,7 +53,7 @@ apply (nat_case n) apply (le_to_lt_to_lt ? (pred ((S m)*(S m2)))) [ unfold min. apply le_min_aux_r - | auto + | autobatch (*unfold lt. apply (nat_case ((S m)*(S m2))) [ apply le_n @@ -84,17 +84,17 @@ apply (nat_case n) rewrite > sym_gcd. rewrite > gcd_mod [ apply (gcd_times_SO_to_gcd_SO ? ? (S m2)) - [ auto + [ autobatch (*unfold lt. apply le_S_S. apply le_O_n*) - | auto + | autobatch (*unfold lt. apply le_S_S. apply le_O_n*) | assumption ] - | auto + | autobatch (*unfold lt. apply le_S_S. apply le_O_n*) @@ -104,19 +104,19 @@ apply (nat_case n) rewrite > sym_gcd. rewrite > gcd_mod [ apply (gcd_times_SO_to_gcd_SO ? ? (S m)) - [ auto + [ autobatch (*unfold lt. apply le_S_S. apply le_O_n*) - | auto + | autobatch (*unfold lt. apply le_S_S. apply le_O_n*) - | auto + | autobatch (*rewrite > sym_times. assumption*) ] - | auto + | autobatch (*unfold lt. apply le_S_S. apply le_O_n*) @@ -130,30 +130,30 @@ apply (nat_case n) apply False_ind. apply H6. apply eq_gcd_times_SO - [ auto + [ autobatch (*unfold lt. apply le_S_S. apply le_O_n*) - | auto + | autobatch (*unfold lt. apply le_S_S. apply le_O_n*) | rewrite < gcd_mod - [ auto + [ autobatch (*rewrite > H4. rewrite > sym_gcd. assumption*) - | auto + | autobatch (*unfold lt. apply le_S_S. apply le_O_n*) ] | rewrite < gcd_mod - [ auto + [ autobatch (*rewrite > H5. rewrite > sym_gcd. assumption*) - | auto + | autobatch (*unfold lt. apply le_S_S. apply le_O_n*) diff --git a/matita/matita.glade b/matita/matita.glade index 9a2f3fd39..81a68b55d 100644 --- a/matita/matita.glade +++ b/matita/matita.glade @@ -4683,15 +4683,15 @@ True Auto GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_CENTER + GTK_WIN_POS_NONE False True False True False False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_SOUTH_EAST True False @@ -4708,7 +4708,7 @@ 2 - + True True GTK_POLICY_ALWAYS @@ -4717,7 +4717,7 @@ GTK_CORNER_TOP_LEFT - + True GTK_SHADOW_IN diff --git a/matita/matitaAutoGui.ml b/matita/matitaAutoGui.ml index e3a5bff18..0436c206d 100644 --- a/matita/matitaAutoGui.ml +++ b/matita/matitaAutoGui.ml @@ -25,7 +25,8 @@ *) type status = - Cic.context * (Cic.term * (int * Cic.term) list) list * Cic.term list * + Cic.context * (int * Cic.term * bool * int * (int * Cic.term) list) list * + (int * Cic.term * int) list * Cic.term list let fake_goal = Cic.Implicit None;; let fake_candidates = [];; @@ -34,13 +35,18 @@ let start = ref 0;; let len = ref 10;; let pp c t = - let names = List.map (function None -> None | Some (n,_) -> Some n) c in + (* let t = ProofEngineReduction.replace ~equality:(fun a b -> match b with Cic.Meta _ -> true | _ -> false) ~what:[Cic.Rel 1] ~with_what:[Cic.Implicit None] ~where:t in - CicPp.pp t names + ApplyTransformation.txt_of_cic_term ~map_unicode_to_tex:false + max_int [] c t + *) + let names = List.map (function None -> None | Some (x,_) -> Some x) c in + let txt_t = CicPp.pp t names in + Pcre.replace ~pat:"\\?(\\d+)\\[[^]]*\\]" ~templ:"?$1" txt_t ;; let pp_goal context x = if x == fake_goal then "" else pp context x @@ -50,7 +56,8 @@ let pp_candidate context x = pp context x let sublist start len l = let rec aux pos len = function | [] when pos < start -> aux (pos+1) len [] - | [] when len > 0 -> (fake_goal, fake_candidates) :: aux (pos+1) (len-1) [] + | [] when len > 0 -> + (0,fake_goal, false, 0, fake_candidates) :: aux (pos+1) (len-1) [] | [] (* when len <= 0 *) -> [] | he::tl when pos < start -> aux (pos+1) len tl | he::tl when pos >= start && len > 0 -> he::aux (pos+1) (len-1) tl @@ -59,12 +66,14 @@ let sublist start len l = aux 0 len l ;; -let cell_of_candidate context ?(active=false) g id c = +let cell_of_candidate height context ?(active=false) g id c = let tooltip = GData.tooltips () in (* should be only one isn't it? *) let button = GButton.button - ~label:(pp_candidate context c(* ^ " - " ^ string_of_int id*)) () + ~label:(pp_candidate context c(* ^ " - " ^ string_of_int id*)) + () in + button#misc#set_size_request ~height (); if active then button#misc#set_sensitive false; let text = @@ -75,43 +84,54 @@ let cell_of_candidate context ?(active=false) g id c = (fun _ -> HLog.warn (string_of_int id); Auto.give_hint id)); button ;; -let cell_of_goal win_width context goal = - GMisc.label ~text:(pp_goal context goal) ~xalign:0.0 () +let cell_of_goal height win_width context goal = + GMisc.label + ~markup:(pp_goal context goal) ~xalign:0.0 + ~width:(min (win_width * 60 / 100) 500) + ~line_wrap:false + ~ellipsize:`END + ~height + () ;; -let cell_of_int n = - GMisc.label ~text:(string_of_int n) - ~line_wrap:true ~justify:`RIGHT () +let cell_of_row_header height n k id = + GMisc.label + ~markup:("" ^ string_of_int n ^ "(" ^ + string_of_int id ^ "|" ^ string_of_int k ^ ")") + ~line_wrap:true ~justify:`LEFT ~height ~width:80 () ;; -let cell_of_candidates context goal cads = +let cell_of_candidates height grey context goal cads = let hbox = GPack.hbox () in match cads with | [] -> hbox | (id,c)::tl -> hbox#pack - (cell_of_candidate ~active:true context goal id c :> GObj.widget); + (cell_of_candidate height ~active:grey + context goal id c :> GObj.widget); List.iter (fun (id,c) -> - hbox#pack (cell_of_candidate context goal id c :> GObj.widget)) tl; + hbox#pack (cell_of_candidate height context goal id c :> GObj.widget)) tl; hbox ;; -let elems_to_rows context win_width (table : GPack.table) (or_list) = +let elems_to_rows height context win_width (table : GPack.table) (or_list) = + let height = height / (List.length or_list) in let _ = List.fold_left - (fun position (goal, candidates) -> + (fun position (goal_id, goal, grey, depth, candidates) -> table#attach ~left:0 ~top:position - (cell_of_int (position + !start) :> GObj.widget); - table#attach ~left:1 ~top:position ~expand:`BOTH ~fill:`BOTH - (cell_of_goal win_width context goal :> GObj.widget); + (cell_of_row_header height (position + !start) + depth goal_id :> GObj.widget); + table#attach ~left:1 ~top:position ~fill:`BOTH + (cell_of_goal height win_width context goal :> GObj.widget); table#attach ~left:2 ~top:position - (cell_of_candidates context goal candidates :> GObj.widget); + (cell_of_candidates height grey context goal candidates :> GObj.widget); position+1) 0 or_list in () ;; -let old_displayed_status = ref ([]);; +let old_displayed_status = ref [];; let old_size = ref 0;; let fill_win (win : MatitaGeneratedGui.autoWin) cb = @@ -121,7 +141,8 @@ let fill_win (win : MatitaGeneratedGui.autoWin) cb = let win_size = win#toplevel#misc#allocation.Gtk.width in let ctx, or_list, and_list, last_moves = status in let displayed_status = - sublist !start !len (or_list @ (List.map (fun x -> x,[]) and_list)) + sublist !start !len + (or_list @ (List.map (fun (id,x,d) -> id,x,false,d,[]) and_list)) in if displayed_status <> !old_displayed_status || !old_size <> win_size then begin @@ -130,7 +151,8 @@ let fill_win (win : MatitaGeneratedGui.autoWin) cb = win#labelLAST#set_text (String.concat ";" (List.map (pp_candidate ctx) last_moves)); List.iter win#table#remove win#table#children; - elems_to_rows ctx win_size win#table displayed_status; + let height = win#viewportAREA#misc#allocation.Gtk.height in + elems_to_rows height ctx win_size win#table displayed_status; Printf.eprintf "REDRAW COST: %2.1f\n%!" (Unix.gettimeofday () -. init); end @@ -139,6 +161,11 @@ let fill_win (win : MatitaGeneratedGui.autoWin) cb = let auto_dialog elems = let win = new MatitaGeneratedGui.autoWin () in + let width = Gdk.Screen.width () in + let height = Gdk.Screen.height () in + let main_w = width * 70 / 100 in + let main_h = height * 60 / 100 in + win#toplevel#resize ~width:main_w ~height:main_h; win#check_widgets (); win#table#set_columns 3; win#table#set_col_spacings 6; @@ -148,15 +175,29 @@ let auto_dialog elems = ignore(win#buttonDOWN#connect#clicked (fun _ -> incr start; fill_win win elems)); ignore(win#buttonCLOSE#connect#clicked - (fun _ -> win#toplevel#destroy ();GMain.Main.quit ())); + (fun _ -> + Auto.pause false; + Auto.step (); + win#toplevel#destroy (); + GMain.Main.quit ())); let redraw_callback _ = fill_win win elems;true in let redraw = GMain.Timeout.add ~ms:400 ~callback:redraw_callback in ignore(win#buttonPAUSE#connect#clicked - (fun _ -> Auto.pause true)); + (fun _ -> + Auto.pause true; + win#buttonPLAY#misc#set_sensitive true; + win#buttonPAUSE#misc#set_sensitive false;)); ignore(win#buttonPLAY#connect#clicked - (fun _ -> Auto.pause false;Auto.step ())); + (fun _ -> + Auto.pause false; + Auto.step (); + win#buttonPLAY#misc#set_sensitive false; + win#buttonPAUSE#misc#set_sensitive true;)); ignore(win#buttonNEXT#connect#clicked (fun _ -> Auto.step ())); + Auto.pause true; + win#buttonPLAY#misc#set_sensitive true; + win#buttonPAUSE#misc#set_sensitive false; fill_win win elems; win#toplevel#show (); GtkThread.main (); diff --git a/matita/matitaGui.ml b/matita/matitaGui.ml index 30d6dbd20..fe56652a7 100644 --- a/matita/matitaGui.ml +++ b/matita/matitaGui.ml @@ -1004,7 +1004,7 @@ class gui () = (tac_w_term (A.Transitivity (loc, hole))); connect_button tbar#assumptionButton (tac (A.Assumption loc)); connect_button tbar#cutButton (tac_w_term (A.Cut (loc, None, hole))); - connect_button tbar#autoButton (tac (A.Auto (loc,[]))); + connect_button tbar#autoButton (tac (A.AutoBatch (loc,[]))); MatitaGtkMisc.toggle_widget_visibility ~widget:(main#tacticsButtonsHandlebox :> GObj.widget) ~check:main#tacticsBarMenuItem; diff --git a/matita/matitaScript.ml b/matita/matitaScript.ml index fe8e69120..f6610911f 100644 --- a/matita/matitaScript.ml +++ b/matita/matitaScript.ml @@ -46,12 +46,17 @@ let heading_nl_RE' = Pcre.regexp "^(\\s*\n\\s*)" let only_dust_RE = Pcre.regexp "^(\\s|\n|%%[^\n]*\n)*$" let multiline_RE = Pcre.regexp "^\n[^\n]+$" let newline_RE = Pcre.regexp "\n" +let comment_RE = Pcre.regexp "\\(\\*(.|\n)*\\*\\)\n?" ~flags:[`UNGREEDY] let comment str = if Pcre.pmatch ~rex:multiline_RE str then "\n(** " ^ (Pcre.replace ~rex:newline_RE str) ^ " *)" else "\n(**\n" ^ str ^ "\n*)" + +let strip_comments str = + Pcre.qreplace ~templ:"\n" ~pat:"\n\n" (Pcre.qreplace ~rex:comment_RE str) +;; let first_line s = let s = Pcre.replace ~rex:heading_nl_RE s in @@ -178,7 +183,239 @@ let eval_with_engine let pp_eager_statement_ast = GrafiteAstPp.pp_statement ~term_pp:CicNotationPp.pp_term ~lazy_term_pp:(fun _ -> assert false) ~obj_pp:(fun _ -> assert false) - + +(* naive implementation of procedural proof script generation, + * starting from an applicatiove *auto generated) proof. + * this is out of place, but I like it :-P *) +let cic2grafite context menv t = + (* indents a proof script in a stupid way, better than nothing *) + let stupid_indenter s = + let next s = + let idx_square_o = try String.index s '[' with Not_found -> -1 in + let idx_square_c = try String.index s ']' with Not_found -> -1 in + let idx_pipe = try String.index s '|' with Not_found -> -1 in + let tok = + List.sort (fun (i,_) (j,_) -> compare i j) + [idx_square_o,'[';idx_square_c,']';idx_pipe,'|'] + in + let tok = List.filter (fun (i,_) -> i <> -1) tok in + match tok with + | (i,c)::_ -> Some (i,c) + | _ -> None + in + let break_apply n s = + let tab = String.make (n+1) ' ' in + Pcre.replace ~templ:(".\n" ^ tab ^ "apply") ~pat:"\\.apply" s + in + let rec ind n s = + match next s with + | None -> + s + | Some (position, char) -> + try + let s1, s2 = + String.sub s 0 position, + String.sub s (position+1) (String.length s - (position+1)) + in + match char with + | '[' -> break_apply n s1 ^ "\n" ^ String.make (n+2) ' ' ^ + "[" ^ ind (n+2) s2 + | '|' -> break_apply n s1 ^ "\n" ^ String.make n ' ' ^ + "|" ^ ind n s2 + | ']' -> break_apply n s1 ^ "\n" ^ String.make n ' ' ^ + "]" ^ ind (n-2) s2 + | _ -> assert false + with + Invalid_argument err -> + prerr_endline err; + s + in + ind 0 s + in + let module PT = CicNotationPt in + let module GA = GrafiteAst in + let pp_t context t = + let names = + List.map (function Some (n,_) -> Some n | None -> None) context + in + CicPp.pp t names + in + let sort_of context t = + try + let ty,_ = + CicTypeChecker.type_of_aux' menv context t + CicUniv.oblivion_ugraph + in + let sort,_ = CicTypeChecker.type_of_aux' menv context ty + CicUniv.oblivion_ugraph + in + match sort with + | Cic.Sort Cic.Prop -> true + | _ -> false + with + CicTypeChecker.TypeCheckerFailure _ -> + HLog.error "auto proof to sript transformation error"; false + in + let floc = HExtlib.dummy_floc in + (* minimalisti cic.term -> pt.term *) + let print_term c t = + let rec aux c = function + | Cic.Rel _ + | Cic.MutConstruct _ + | Cic.MutInd _ + | Cic.Const _ as t -> + PT.Ident (pp_t c t, None) + | Cic.Appl l -> PT.Appl (List.map (aux c) l) + | Cic.Implicit _ -> PT.Implicit + | Cic.Lambda (Cic.Name n, s, t) -> + PT.Binder (`Lambda, (PT.Ident (n,None), Some (aux c s)), + aux (Some (Cic.Name n, Cic.Decl s)::c) t) + | Cic.Prod (Cic.Name n, s, t) -> + PT.Binder (`Forall, (PT.Ident (n,None), Some (aux c s)), + aux (Some (Cic.Name n, Cic.Decl s)::c) t) + | Cic.LetIn (Cic.Name n, s, t) -> + PT.Binder (`Lambda, (PT.Ident (n,None), Some (aux c s)), + aux (Some (Cic.Name n, Cic.Def (s,None))::c) t) + | Cic.Meta _ -> PT.Implicit + | Cic.Sort (Cic.Type u) -> PT.Sort (`Type u) + | Cic.Sort Cic.Set -> PT.Sort `Set + | Cic.Sort Cic.CProp -> PT.Sort `CProp + | Cic.Sort Cic.Prop -> PT.Sort `Prop + | _ as t -> PT.Ident ("ERROR: "^CicPp.ppterm t, None) + in + aux c t + in + (* prints an applicative proof, that is an auto proof. + * don't use in the general case! *) + let rec print_proof context = function + | Cic.Rel _ + | Cic.Const _ as t -> + [GA.Executable (floc, + GA.Tactic (floc, + Some (GA.Apply (floc, print_term context t)), GA.Dot floc))] + | Cic.Appl (he::tl) -> + let tl = List.map (fun t -> t, sort_of context t) tl in + let subgoals = + HExtlib.filter_map (function (t,true) -> Some t | _ -> None) tl + in + let args = + List.map (function | (t,true) -> Cic.Implicit None | (t,_) -> t) tl + in + if List.length subgoals > 1 then + (* branch *) + [GA.Executable (floc, + GA.Tactic (floc, + Some (GA.Apply (floc, print_term context (Cic.Appl (he::args)))), + GA.Semicolon floc))] @ + [GA.Executable (floc, GA.Tactic (floc, None, GA.Branch floc))] @ + (HExtlib.list_concat + ~sep:[GA.Executable (floc, GA.Tactic (floc, None,GA.Shift floc))] + (List.map (print_proof context) subgoals)) @ + [GA.Executable (floc, GA.Tactic (floc, None,GA.Merge floc))] + else + (* simple apply *) + [GA.Executable (floc, + GA.Tactic (floc, + Some (GA.Apply + (floc, print_term context (Cic.Appl (he::args)) )), GA.Dot floc))] + @ + (match subgoals with + | [] -> [] + | [x] -> print_proof context x + | _ -> assert false) + | Cic.Lambda (Cic.Name n, ty, bo) -> + [GA.Executable (floc, + GA.Tactic (floc, + Some (GA.Cut (floc, Some n, (print_term context ty))), + GA.Branch floc))] @ + (print_proof (Some (Cic.Name n, Cic.Decl ty)::context) bo) @ + [GA.Executable (floc, GA.Tactic (floc, None,GA.Shift floc))] @ + [GA.Executable (floc, GA.Tactic (floc, + Some (GA.Assumption floc),GA.Merge floc))] + | _ -> [] + (* + debug_print (lazy (CicPp.ppterm t)); + assert false + *) + in + (* performs a lambda closure of the proof term abstracting metas. + * this is really an approximation of a closure, local subst of metas + * is not kept into account *) + let close_pt menv context t = + let metas = CicUtil.metas_of_term t in + let metas = + HExtlib.list_uniq ~eq:(fun (i,_) (j,_) -> i = j) + (List.sort (fun (i,_) (j,_) -> compare i j) metas) + in + let mk_rels_and_collapse_metas metas = + let rec aux i map acc acc1 = function + | [] -> acc, acc1, map + | (j,_ as m)::tl -> + let _,_,ty = CicUtil.lookup_meta j menv in + try + let n = List.assoc ty map in + aux i map (Cic.Rel n :: acc) (m::acc1) tl + with Not_found -> + let map = (ty, i)::map in + aux (i+1) map (Cic.Rel i :: acc) (m::acc1) tl + in + aux 1 [] [] [] metas + in + let rels, metas, map = mk_rels_and_collapse_metas metas in + let n_lambdas = List.length map in + let t = + if metas = [] then + t + else + let t = + ProofEngineReduction.replace_lifting + ~what:(List.map (fun (x,_) -> Cic.Meta (x,[])) metas) + ~with_what:rels + ~context:context + ~equality:(fun _ x y -> + match x,y with + | Cic.Meta(i,_), Cic.Meta(j,_) when i=j -> true + | _ -> false) + ~where:(CicSubstitution.lift n_lambdas t) + in + let rec mk_lam = function + | [] -> t + | (ty,n)::tl -> + let name = "fresh_"^ string_of_int n in + Cic.Lambda (Cic.Name name, ty, mk_lam tl) + in + mk_lam + (fst (List.fold_left + (fun (l,liftno) (ty,_) -> + (l @ [CicSubstitution.lift liftno ty,liftno] , liftno+1)) + ([],0) map)) + in + t + in + let ast = print_proof context (close_pt menv context t) in + let pp t = + (* ZACK: setting width to 80 will trigger a bug of BoxPp.render_to_string + * which will show up using the following command line: + * ./tptp2grafite -tptppath ~tassi/TPTP-v3.1.1 GRP170-1 *) + let width = max_int in + let term_pp content_term = + let pres_term = TermContentPres.pp_ast content_term in + let dummy_tbl = Hashtbl.create 1 in + let markup = CicNotationPres.render dummy_tbl pres_term in + let s = "(" ^ BoxPp.render_to_string List.hd width markup ^ ")" in + Pcre.substitute + ~pat:"\\\\forall [Ha-z][a-z0-9_]*" ~subst:(fun x -> "\n" ^ x) s + in + CicNotationPp.set_pp_term term_pp; + let lazy_term_pp = fun x -> assert false in + let obj_pp = CicNotationPp.pp_obj CicNotationPp.pp_term in + GrafiteAstPp.pp_statement ~term_pp ~lazy_term_pp ~obj_pp t + in + let script = String.concat "" (List.map pp ast) in + prerr_endline script; + stupid_indenter script +;; + let rec eval_macro include_paths (buffer : GText.buffer) guistuff lexicon_status grafite_status user_goal unparsed_text parsed_text script mac = let module TAPp = GrafiteAstPp in let module MQ = MetadataQuery in @@ -280,6 +517,60 @@ let rec eval_macro include_paths (buffer : GText.buffer) guistuff lexicon_status let t_and_ty = Cic.Cast (term,ty) in guistuff.mathviewer#show_entry (`Cic (t_and_ty,metasenv)); [], "", parsed_text_length + | TA.AutoInteractive (_, params) -> + let user_goal' = + match user_goal with + Some n -> n + | None -> raise NoUnfinishedProof + in + let proof = GrafiteTypes.get_current_proof grafite_status in + let proof_status = proof,user_goal' in + (try + let _,menv,_,_,_,_ = proof in + let i,cc,ty = CicUtil.lookup_meta user_goal' menv in + let timestamp = Unix.gettimeofday () in + let (_,menv,subst,_,_,_), _ = + ProofEngineTypes.apply_tactic + (Auto.auto_tac ~dbd ~params + ~universe:grafite_status.GrafiteTypes.universe) proof_status + in + let proof_term = + let irl = + CicMkImplicit.identity_relocation_list_for_metavariable cc + in + CicMetaSubst.apply_subst subst (Cic.Meta (i,irl)) + in + let time = Unix.gettimeofday () -. timestamp in + let text = + comment parsed_text ^ "\n" ^ + cic2grafite cc menv proof_term ^ + (Printf.sprintf "\n(* end auto proof: %4.2f *)" time) + in + (* alternative using FG stuff + let proof_term = + Auto.lambda_close ~prefix_name:"orrible_hack_" proof_term menv cc + in + let ty,_ = + CicTypeChecker.type_of_aux' menv [] proof_term CicUniv.empty_ugraph + in + let obj = + Cic.Constant ("",Some proof_term, ty, [], [`Flavour `Lemma]) + in + let text = + comment parsed_text ^ + Pcre.qreplace ~templ:"?" ~pat:"orrible_hack_[0-9]+" + (strip_comments + (ApplyTransformation.txt_of_cic_object + ~map_unicode_to_tex:false + ~skip_thm_and_qed:true + ~skip_initial_lambdas:true + 80 (GrafiteAst.Procedural None) "" obj)) ^ + "(* end auto proof *)" + in + *) + [],text,parsed_text_length + with + ProofEngineTypes.Fail _ -> [], comment parsed_text, parsed_text_length) | TA.Inline (_,style,suri,prefix) -> let str = ApplyTransformation.txt_of_inline_macro style suri prefix in [], str, String.length parsed_text -- 2.39.2