sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
authorwenzelm
Fri Oct 05 21:52:39 2001 +0200 (2001-10-05)
changeset 117013d51fbf81c17
parent 11700 a0e6bda62b7b
child 11702 ebfe5ba905b0
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
"num" syntax (still with "#"), Numeral0, Numeral1;
src/HOL/Algebra/poly/PolyHomo.ML
src/HOL/Auth/KerberosIV.thy
src/HOL/Auth/Kerberos_BAN.thy
src/HOL/Datatype_Universe.ML
src/HOL/Datatype_Universe.thy
src/HOL/Divides.ML
src/HOL/Finite.ML
src/HOL/GroupTheory/Exponent.ML
src/HOL/Hoare/Arith2.ML
src/HOL/Hoare/Examples.ML
src/HOL/Hyperreal/HRealAbs.ML
src/HOL/Hyperreal/HSeries.ML
src/HOL/Hyperreal/HyperArith0.ML
src/HOL/Hyperreal/HyperBin.ML
src/HOL/Hyperreal/HyperDef.ML
src/HOL/Hyperreal/HyperDef.thy
src/HOL/Hyperreal/HyperNat.ML
src/HOL/Hyperreal/HyperOrd.ML
src/HOL/Hyperreal/HyperPow.ML
src/HOL/Hyperreal/Lim.ML
src/HOL/Hyperreal/Lim.thy
src/HOL/Hyperreal/NSA.ML
src/HOL/Hyperreal/NatStar.ML
src/HOL/Hyperreal/SEQ.ML
src/HOL/Hyperreal/SEQ.thy
src/HOL/Hyperreal/Series.ML
src/HOL/Hyperreal/Series.thy
src/HOL/Hyperreal/hypreal_arith0.ML
src/HOL/IMP/Compiler.thy
src/HOL/IMP/Examples.ML
src/HOL/IMPP/EvenOdd.ML
src/HOL/IMPP/EvenOdd.thy
src/HOL/Induct/Com.thy
src/HOL/Induct/Mutil.thy
src/HOL/Integ/Bin.ML
src/HOL/Integ/Int.ML
src/HOL/Integ/IntArith.ML
src/HOL/Integ/IntDef.ML
src/HOL/Integ/IntDef.thy
src/HOL/Integ/IntDiv.ML
src/HOL/Integ/IntDiv.thy
src/HOL/Integ/IntPower.ML
src/HOL/Integ/IntPower.thy
src/HOL/Integ/NatSimprocs.ML
src/HOL/Integ/int_arith1.ML
src/HOL/Integ/int_arith2.ML
src/HOL/Integ/int_factor_simprocs.ML
src/HOL/Integ/nat_bin.ML
src/HOL/Integ/nat_simprocs.ML
src/HOL/Isar_examples/Fibonacci.thy
src/HOL/Isar_examples/HoareEx.thy
src/HOL/Isar_examples/MutilatedCheckerboard.thy
src/HOL/Isar_examples/Summation.thy
src/HOL/Lambda/Type.thy
src/HOL/Library/Multiset.thy
src/HOL/Library/Nat_Infinity.thy
src/HOL/Library/Primes.thy
src/HOL/Library/Rational_Numbers.thy
src/HOL/Library/Ring_and_Field.thy
src/HOL/Library/Ring_and_Field_Example.thy
src/HOL/Library/While_Combinator.thy
src/HOL/List.ML
src/HOL/MicroJava/BV/JVM.thy
src/HOL/MicroJava/BV/Step.thy
src/HOL/MicroJava/J/Example.thy
src/HOL/MicroJava/J/Value.thy
src/HOL/Nat.ML
src/HOL/NatArith.ML
src/HOL/NatDef.ML
src/HOL/NatDef.thy
src/HOL/NumberTheory/Chinese.thy
src/HOL/NumberTheory/EulerFermat.thy
src/HOL/NumberTheory/Factorization.thy
src/HOL/NumberTheory/Fib.thy
src/HOL/NumberTheory/IntFact.thy
src/HOL/NumberTheory/IntPrimes.thy
src/HOL/NumberTheory/WilsonBij.thy
src/HOL/NumberTheory/WilsonRuss.thy
src/HOL/Power.ML
src/HOL/Prolog/Type.ML
src/HOL/Real/HahnBanach/Aux.thy
src/HOL/Real/HahnBanach/FunctionNorm.thy
src/HOL/Real/HahnBanach/HahnBanach.thy
src/HOL/Real/HahnBanach/HahnBanachExtLemmas.thy
src/HOL/Real/HahnBanach/Linearform.thy
src/HOL/Real/HahnBanach/NormedSpace.thy
src/HOL/Real/HahnBanach/Subspace.thy
src/HOL/Real/HahnBanach/VectorSpace.thy
src/HOL/Real/PNat.ML
src/HOL/Real/PNat.thy
src/HOL/Real/PRat.ML
src/HOL/Real/PReal.ML
src/HOL/Real/RComplete.ML
src/HOL/Real/RealAbs.ML
src/HOL/Real/RealAbs.thy
src/HOL/Real/RealArith0.ML
src/HOL/Real/RealBin.ML
src/HOL/Real/RealDef.ML
src/HOL/Real/RealDef.thy
src/HOL/Real/RealOrd.ML
src/HOL/Real/RealPow.ML
src/HOL/Real/RealPow.thy
src/HOL/Real/ex/BinEx.thy
src/HOL/Real/ex/Sqrt_Irrational.thy
src/HOL/Real/real_arith0.ML
src/HOL/Tools/numeral_syntax.ML
src/HOL/UNITY/Comp/Counter.ML
src/HOL/UNITY/Comp/Counter.thy
src/HOL/UNITY/Comp/Counterc.ML
src/HOL/UNITY/Comp/Counterc.thy
src/HOL/UNITY/Comp/Priority.ML
src/HOL/UNITY/Lift_prog.ML
src/HOL/UNITY/Lift_prog.thy
src/HOL/UNITY/Simple/Lift.ML
src/HOL/UNITY/Simple/Lift.thy
src/HOL/UNITY/Simple/Mutex.ML
src/HOL/UNITY/Simple/Mutex.thy
src/HOL/UNITY/Simple/Network.ML
src/HOL/UNITY/Simple/Reachability.ML
src/HOL/UNITY/Simple/Reachability.thy
src/HOL/UNITY/SubstAx.ML
src/HOL/UNITY/Union.ML
src/HOL/arith_data.ML
src/HOL/ex/AVL.thy
src/HOL/ex/BinEx.thy
src/HOL/ex/Group.ML
src/HOL/ex/IntRing.thy
src/HOL/ex/NatSum.thy
src/HOL/ex/Primrec.thy
src/HOL/ex/Recdefs.thy
src/HOL/ex/Records.thy
src/HOL/ex/svc_test.ML
src/HOLCF/FOCUS/Buffer_adm.ML
src/HOLCF/IOA/NTP/Lemmas.ML
src/HOLCF/ex/Stream.ML
     1.1 --- a/src/HOL/Algebra/poly/PolyHomo.ML	Fri Oct 05 21:50:37 2001 +0200
     1.2 +++ b/src/HOL/Algebra/poly/PolyHomo.ML	Fri Oct 05 21:52:39 2001 +0200
     1.3 @@ -112,15 +112,15 @@
     1.4  (* Examples *)
     1.5  
     1.6  Goal
     1.7 -  "EVAL (x::'a::domain) (a*X^2 + b*X^1 + c*X^0) = a * x ^ 2 + b * x ^ 1 + c";
     1.8 +  "EVAL (x::'a::domain) (a*X^# 2 + b*X^1 + c*X^0) = a * x ^ # 2 + b * x ^ 1 + c";
     1.9  by (asm_simp_tac (simpset() delsimps [power_Suc]
    1.10      addsimps [EVAL_homo, EVAL_monom, EVAL_smult]) 1);
    1.11  result();
    1.12  
    1.13  Goal
    1.14    "EVAL (y::'a::domain) \
    1.15 -\    (EVAL (const x) (monom 1 + const (a*X^2 + b*X^1 + c*X^0))) = \
    1.16 -\  x ^ 1 + (a * y ^ 2 + b * y ^ 1 + c)";
    1.17 +\    (EVAL (const x) (monom 1 + const (a*X^# 2 + b*X^1 + c*X^0))) = \
    1.18 +\  x ^ 1 + (a * y ^ # 2 + b * y ^ 1 + c)";
    1.19  by (asm_simp_tac (simpset() delsimps [power_Suc]
    1.20      addsimps [EVAL_homo, EVAL_monom, EVAL_smult, EVAL_const]) 1);
    1.21  result();
     2.1 --- a/src/HOL/Auth/KerberosIV.thy	Fri Oct 05 21:50:37 2001 +0200
     2.2 +++ b/src/HOL/Auth/KerberosIV.thy	Fri Oct 05 21:52:39 2001 +0200
     2.3 @@ -65,10 +65,10 @@
     2.4      RespLife   :: nat 
     2.5  
     2.6  rules
     2.7 -     AuthLife_LB    "#2 <= AuthLife"
     2.8 -     ServLife_LB    "#2 <= ServLife"
     2.9 -     AutcLife_LB    "1' <= AutcLife" 
    2.10 -     RespLife_LB    "1' <= RespLife"
    2.11 +     AuthLife_LB    "# 2 <= AuthLife"
    2.12 +     ServLife_LB    "# 2 <= ServLife"
    2.13 +     AutcLife_LB    "Suc 0 <= AutcLife" 
    2.14 +     RespLife_LB    "Suc 0 <= RespLife"
    2.15  
    2.16  translations
    2.17     "CT" == "length"
     3.1 --- a/src/HOL/Auth/Kerberos_BAN.thy	Fri Oct 05 21:50:37 2001 +0200
     3.2 +++ b/src/HOL/Auth/Kerberos_BAN.thy	Fri Oct 05 21:52:39 2001 +0200
     3.3 @@ -30,10 +30,10 @@
     3.4  
     3.5  rules
     3.6      (*The ticket should remain fresh for two journeys on the network at least*)
     3.7 -    SesKeyLife_LB "#2 <= SesKeyLife"
     3.8 +    SesKeyLife_LB "# 2 <= SesKeyLife"
     3.9  
    3.10      (*The authenticator only for one journey*)
    3.11 -    AutLife_LB    "1' <= AutLife"
    3.12 +    AutLife_LB    "Suc 0 <= AutLife"
    3.13  
    3.14  translations
    3.15     "CT" == "length"
     4.1 --- a/src/HOL/Datatype_Universe.ML	Fri Oct 05 21:50:37 2001 +0200
     4.2 +++ b/src/HOL/Datatype_Universe.ML	Fri Oct 05 21:52:39 2001 +0200
     4.3 @@ -80,7 +80,7 @@
     4.4  
     4.5  (** Scons vs Atom **)
     4.6  
     4.7 -Goalw [Atom_def,Scons_def,Push_Node_def,One_def]
     4.8 +Goalw [Atom_def,Scons_def,Push_Node_def,One_nat_def]
     4.9   "Scons M N ~= Atom(a)";
    4.10  by (rtac notI 1);
    4.11  by (etac (equalityD2 RS subsetD RS UnE) 1);
    4.12 @@ -141,11 +141,11 @@
    4.13  
    4.14  (** Injectiveness of Scons **)
    4.15  
    4.16 -Goalw [Scons_def,One_def] "Scons M N <= Scons M' N' ==> M<=M'";
    4.17 +Goalw [Scons_def,One_nat_def] "Scons M N <= Scons M' N' ==> M<=M'";
    4.18  by (blast_tac (claset() addSDs [Push_Node_inject]) 1);
    4.19  qed "Scons_inject_lemma1";
    4.20  
    4.21 -Goalw [Scons_def,One_def] "Scons M N <= Scons M' N' ==> N<=N'";
    4.22 +Goalw [Scons_def,One_nat_def] "Scons M N <= Scons M' N' ==> N<=N'";
    4.23  by (blast_tac (claset() addSDs [Push_Node_inject]) 1);
    4.24  qed "Scons_inject_lemma2";
    4.25  
    4.26 @@ -252,7 +252,7 @@
    4.27  by (rtac ntrunc_Atom 1);
    4.28  qed "ntrunc_Numb";
    4.29  
    4.30 -Goalw [Scons_def,ntrunc_def,One_def]
    4.31 +Goalw [Scons_def,ntrunc_def,One_nat_def]
    4.32      "ntrunc (Suc k) (Scons M N) = Scons (ntrunc k M) (ntrunc k N)";
    4.33  by (safe_tac (claset() addSIs [imageI]));
    4.34  by (REPEAT (stac ndepth_Push_Node 3 THEN etac Suc_mono 3));
    4.35 @@ -266,7 +266,7 @@
    4.36  
    4.37  (** Injection nodes **)
    4.38  
    4.39 -Goalw [In0_def] "ntrunc 1' (In0 M) = {}";
    4.40 +Goalw [In0_def] "ntrunc (Suc 0) (In0 M) = {}";
    4.41  by (Simp_tac 1);
    4.42  by (rewtac Scons_def);
    4.43  by (Blast_tac 1);
    4.44 @@ -277,7 +277,7 @@
    4.45  by (Simp_tac 1);
    4.46  qed "ntrunc_In0";
    4.47  
    4.48 -Goalw [In1_def] "ntrunc 1' (In1 M) = {}";
    4.49 +Goalw [In1_def] "ntrunc (Suc 0) (In1 M) = {}";
    4.50  by (Simp_tac 1);
    4.51  by (rewtac Scons_def);
    4.52  by (Blast_tac 1);
    4.53 @@ -339,7 +339,7 @@
    4.54  
    4.55  (** Injection **)
    4.56  
    4.57 -Goalw [In0_def,In1_def,One_def] "In0(M) ~= In1(N)";
    4.58 +Goalw [In0_def,In1_def,One_nat_def] "In0(M) ~= In1(N)";
    4.59  by (rtac notI 1);
    4.60  by (etac (Scons_inject1 RS Numb_inject RS Zero_neq_Suc) 1);
    4.61  qed "In0_not_In1";
     5.1 --- a/src/HOL/Datatype_Universe.thy	Fri Oct 05 21:50:37 2001 +0200
     5.2 +++ b/src/HOL/Datatype_Universe.thy	Fri Oct 05 21:52:39 2001 +0200
     5.3 @@ -63,7 +63,7 @@
     5.4  
     5.5    (*S-expression constructors*)
     5.6    Atom_def   "Atom == (%x. {Abs_Node((%k. Inr 0, x))})"
     5.7 -  Scons_def  "Scons M N == (Push_Node (Inr 1) ` M) Un (Push_Node (Inr 2) ` N)"
     5.8 +  Scons_def  "Scons M N == (Push_Node (Inr 1) ` M) Un (Push_Node (Inr (Suc 1)) ` N)"
     5.9  
    5.10    (*Leaf nodes, with arbitrary or nat labels*)
    5.11    Leaf_def   "Leaf == Atom o Inl"
     6.1 --- a/src/HOL/Divides.ML	Fri Oct 05 21:50:37 2001 +0200
     6.2 +++ b/src/HOL/Divides.ML	Fri Oct 05 21:52:39 2001 +0200
     6.3 @@ -65,7 +65,7 @@
     6.4  by (asm_simp_tac (simpset() addsimps [mod_geq]) 1);
     6.5  qed "mod_if";
     6.6  
     6.7 -Goal "m mod 1' = 0";
     6.8 +Goal "m mod Suc 0 = 0";
     6.9  by (induct_tac "m" 1);
    6.10  by (ALLGOALS (asm_simp_tac (simpset() addsimps [mod_geq])));
    6.11  qed "mod_1";
    6.12 @@ -387,7 +387,7 @@
    6.13  
    6.14  (*** Further facts about div and mod ***)
    6.15  
    6.16 -Goal "m div 1' = m";
    6.17 +Goal "m div Suc 0 = m";
    6.18  by (induct_tac "m" 1);
    6.19  by (ALLGOALS (asm_simp_tac (simpset() addsimps [div_geq])));
    6.20  qed "div_1";
    6.21 @@ -529,12 +529,12 @@
    6.22  qed "dvd_0_left_iff";
    6.23  AddIffs [dvd_0_left_iff];
    6.24  
    6.25 -Goalw [dvd_def] "1' dvd k";
    6.26 +Goalw [dvd_def] "Suc 0 dvd k";
    6.27  by (Simp_tac 1);
    6.28  qed "dvd_1_left";
    6.29  AddIffs [dvd_1_left];
    6.30  
    6.31 -Goal "(m dvd 1') = (m = 1')";
    6.32 +Goal "(m dvd Suc 0) = (m = Suc 0)";
    6.33  by (simp_tac (simpset() addsimps [dvd_def]) 1); 
    6.34  qed "dvd_1_iff_1";
    6.35  Addsimps [dvd_1_iff_1];
    6.36 @@ -615,14 +615,14 @@
    6.37  by (asm_full_simp_tac (simpset() addsimps mult_ac) 1);
    6.38  qed "dvd_mult_cancel";
    6.39  
    6.40 -Goal "0<m ==> (m*n dvd m) = (n=1)";
    6.41 +Goal "0<m ==> (m*n dvd m) = (n = (1::nat))";
    6.42  by Auto_tac;  
    6.43  by (subgoal_tac "m*n dvd m*1" 1);
    6.44  by (dtac dvd_mult_cancel 1); 
    6.45  by Auto_tac;  
    6.46  qed "dvd_mult_cancel1";
    6.47  
    6.48 -Goal "0<m ==> (n*m dvd m) = (n=1)";
    6.49 +Goal "0<m ==> (n*m dvd m) = (n = (1::nat))";
    6.50  by (stac mult_commute 1); 
    6.51  by (etac dvd_mult_cancel1 1); 
    6.52  qed "dvd_mult_cancel2";
     7.1 --- a/src/HOL/Finite.ML	Fri Oct 05 21:50:37 2001 +0200
     7.2 +++ b/src/HOL/Finite.ML	Fri Oct 05 21:52:39 2001 +0200
     7.3 @@ -490,7 +490,7 @@
     7.4  
     7.5  (*** Cardinality of the Powerset ***)
     7.6  
     7.7 -Goal "finite A ==> card (Pow A) = 2 ^ card A";
     7.8 +Goal "finite A ==> card (Pow A) = Suc (Suc 0) ^ card A";  (* FIXME numeral 2 (!?) *)
     7.9  by (etac finite_induct 1);
    7.10  by (ALLGOALS (asm_simp_tac (simpset() addsimps [Pow_insert])));
    7.11  by (stac card_Un_disjoint 1);
     8.1 --- a/src/HOL/GroupTheory/Exponent.ML	Fri Oct 05 21:50:37 2001 +0200
     8.2 +++ b/src/HOL/GroupTheory/Exponent.ML	Fri Oct 05 21:52:39 2001 +0200
     8.3 @@ -8,11 +8,11 @@
     8.4  
     8.5  val prime_def = thm "prime_def";
     8.6  
     8.7 -Goalw [prime_def] "p\\<in>prime ==> 1' < p";
     8.8 +Goalw [prime_def] "p\\<in>prime ==> Suc 0 < p";
     8.9  by (force_tac (claset(), simpset() addsimps []) 1); 
    8.10  qed "prime_imp_one_less";
    8.11  
    8.12 -Goal "(p\\<in>prime) = (1'<p & (\\<forall>a b. p dvd a*b --> (p dvd a) | (p dvd b)))";
    8.13 +Goal "(p\\<in>prime) = (Suc 0 < p & (\\<forall>a b. p dvd a*b --> (p dvd a) | (p dvd b)))";
    8.14  by (auto_tac (claset(), simpset() addsimps [prime_imp_one_less]));  
    8.15  by (blast_tac (claset() addSDs [thm "prime_dvd_mult"]) 1);
    8.16  by (auto_tac (claset(), simpset() addsimps [prime_def]));  
    8.17 @@ -201,24 +201,24 @@
    8.18  qed "div_combine";
    8.19  
    8.20  (*Lemma for power_dvd_bound*)
    8.21 -Goal "1' < p ==> Suc n <= p^n";
    8.22 +Goal "Suc 0 < p ==> Suc n <= p^n";
    8.23  by (induct_tac "n" 1);
    8.24  by (Asm_simp_tac 1); 
    8.25  by (Asm_full_simp_tac 1); 
    8.26 -by (subgoal_tac "2*n + #2 <= p * p^n" 1);
    8.27 +by (subgoal_tac "# 2 * n + # 2 <= p * p^n" 1);
    8.28  by (Asm_full_simp_tac 1); 
    8.29 -by (subgoal_tac "#2 * p^n <= p * p^n" 1);
    8.30 +by (subgoal_tac "# 2 * p^n <= p * p^n" 1);
    8.31  (*?arith_tac should handle all of this!*)
    8.32  by (rtac order_trans 1); 
    8.33  by (assume_tac 2); 
    8.34 -by (dres_inst_tac [("k","#2")] mult_le_mono2 1); 
    8.35 +by (dres_inst_tac [("k","# 2")] mult_le_mono2 1); 
    8.36  by (Asm_full_simp_tac 1); 
    8.37  by (rtac mult_le_mono1 1); 
    8.38  by (Asm_full_simp_tac 1); 
    8.39  qed "Suc_le_power";
    8.40  
    8.41  (*An upper bound for the n such that p^n dvd a: needed for GREATEST to exist*)
    8.42 -Goal "[|p^n dvd a;  1' < p;  0 < a|] ==> n < a";
    8.43 +Goal "[|p^n dvd a;  Suc 0 < p;  0 < a|] ==> n < a";
    8.44  by (dtac dvd_imp_le 1); 
    8.45  by (dres_inst_tac [("n","n")] Suc_le_power 2); 
    8.46  by Auto_tac;  
    8.47 @@ -267,7 +267,7 @@
    8.48  Addsimps [exponent_eq_0];
    8.49  
    8.50  
    8.51 -(* exponent_mult_add, easy inclusion.  Could weaken p\\<in>prime to 1'<p *)
    8.52 +(* exponent_mult_add, easy inclusion.  Could weaken p\\<in>prime to Suc 0 < p *)
    8.53  Goal "[| 0 < a; 0 < b |]  \
    8.54  \     ==> (exponent p a) + (exponent p b) <= exponent p (a * b)";
    8.55  by (case_tac "p \\<in> prime" 1);
    8.56 @@ -312,7 +312,7 @@
    8.57  by (auto_tac (claset() addDs [dvd_mult_left], simpset()));  
    8.58  qed "not_divides_exponent_0";
    8.59  
    8.60 -Goal "exponent p 1' = 0";
    8.61 +Goal "exponent p (Suc 0) = 0";
    8.62  by (case_tac "p \\<in> prime" 1);
    8.63  by (auto_tac (claset(), 
    8.64                simpset() addsimps [prime_iff, not_divides_exponent_0]));
    8.65 @@ -357,7 +357,7 @@
    8.66  
    8.67  
    8.68  Goal "[| 0 < (k::nat); k < p^a; 0 < p; (p^r) dvd (p^a) - k |] ==> r <= a";
    8.69 -by (res_inst_tac [("m","1'")] p_fac_forw_lemma 1);
    8.70 +by (res_inst_tac [("m","Suc 0")] p_fac_forw_lemma 1);
    8.71  by Auto_tac;
    8.72  qed "r_le_a_forw";
    8.73  
    8.74 @@ -422,7 +422,7 @@
    8.75  qed "p_not_div_choose";
    8.76  
    8.77  
    8.78 -Goal "0 < m ==> exponent p ((p^a * m - 1') choose (p^a - 1')) = 0";
    8.79 +Goal "0 < m ==> exponent p ((p^a * m - Suc 0) choose (p^a - Suc 0)) = 0";
    8.80  by (case_tac "p \\<in> prime" 1);
    8.81  by (Asm_simp_tac 2);
    8.82  by (forw_inst_tac [("a","a")] zero_less_prime_power 1);
     9.1 --- a/src/HOL/Hoare/Arith2.ML	Fri Oct 05 21:50:37 2001 +0200
     9.2 +++ b/src/HOL/Hoare/Arith2.ML	Fri Oct 05 21:52:39 2001 +0200
     9.3 @@ -63,7 +63,7 @@
     9.4  
     9.5  (*** pow ***)
     9.6  
     9.7 -Goal "m mod #2 = 0 ==> ((n::nat)*n)^(m div #2) = n^m";
     9.8 +Goal "m mod # 2 = 0 ==> ((n::nat)*n)^(m div # 2) = n^m";
     9.9  by (asm_simp_tac (simpset() addsimps [power_two RS sym, power_mult RS sym,
    9.10  				      mult_div_cancel]) 1);
    9.11  qed "sq_pow_div2";
    10.1 --- a/src/HOL/Hoare/Examples.ML	Fri Oct 05 21:50:37 2001 +0200
    10.2 +++ b/src/HOL/Hoare/Examples.ML	Fri Oct 05 21:52:39 2001 +0200
    10.3 @@ -13,7 +13,7 @@
    10.4  \  m := 0; s := 0; \
    10.5  \  WHILE m~=a \
    10.6  \  INV {s=m*b & a=A & b=B} \  
    10.7 -\  DO s := s+b; m := m+1 OD \
    10.8 +\  DO s := s+b; m := m+(1::nat) OD \
    10.9  \  {s = A*B}"; 
   10.10  by (hoare_tac (Asm_full_simp_tac) 1);
   10.11  qed "multiply_by_add";
   10.12 @@ -50,9 +50,9 @@
   10.13  Goal "|- VARS a b x y. \
   10.14  \ {0<A & 0<B & a=A & b=B & x=B & y=A} \
   10.15  \ WHILE  a ~= b  \
   10.16 -\ INV {0<a & 0<b & gcd A B = gcd a b & #2*A*B = a*x + b*y} \
   10.17 +\ INV {0<a & 0<b & gcd A B = gcd a b & # 2*A*B = a*x + b*y} \
   10.18  \ DO IF a<b THEN (b := b-a; x := x+y) ELSE (a := a-b; y := y+x) FI OD \
   10.19 -\ {a = gcd A B & #2*A*B = a*(x+y)}";
   10.20 +\ {a = gcd A B & # 2*A*B = a*(x+y)}";
   10.21  by (hoare_tac (K all_tac) 1);
   10.22  by(Asm_simp_tac 1);
   10.23  by(asm_simp_tac (simpset() addsimps
   10.24 @@ -65,13 +65,13 @@
   10.25  
   10.26  Goal "|- VARS a b c. \
   10.27  \ {a=A & b=B} \
   10.28 -\ c := 1; \
   10.29 +\ c := (1::nat); \
   10.30  \ WHILE b ~= 0 \
   10.31  \ INV {A^B = c * a^b} \
   10.32 -\ DO  WHILE b mod #2 = 0 \
   10.33 +\ DO  WHILE b mod # 2 = 0 \
   10.34  \     INV {A^B = c * a^b} \
   10.35 -\     DO  a := a*a; b := b div #2 OD; \
   10.36 -\     c := c*a; b := b-1 \
   10.37 +\     DO  a := a*a; b := b div # 2 OD; \
   10.38 +\     c := c*a; b := b - 1 \
   10.39  \ OD \
   10.40  \ {c = A^B}";
   10.41  by (hoare_tac (Asm_full_simp_tac) 1);
   10.42 @@ -87,7 +87,7 @@
   10.43  \ b := 1; \
   10.44  \ WHILE a ~= 0 \
   10.45  \ INV {fac A = b * fac a} \
   10.46 -\ DO b := b*a; a := a-1 OD \
   10.47 +\ DO b := b*a; a := a - 1 OD \
   10.48  \ {b = fac A}";
   10.49  by (hoare_tac (asm_full_simp_tac (simpset() addsplits [nat_diff_split])) 1);
   10.50  by Auto_tac;  
   10.51 @@ -99,7 +99,7 @@
   10.52  
   10.53  Goal "|- VARS r x. \
   10.54  \ {True} \
   10.55 -\ x := X; r := 0; \
   10.56 +\ x := X; r := (0::nat); \
   10.57  \ WHILE (r+1)*(r+1) <= x \
   10.58  \ INV {r*r <= x & x=X} \
   10.59  \ DO r := r+1 OD \
   10.60 @@ -111,10 +111,10 @@
   10.61  
   10.62  Goal "|- VARS u w r x. \
   10.63  \ {True} \
   10.64 -\ x := X; u := 1; w := 1; r := 0; \
   10.65 +\ x := X; u := 1; w := 1; r := (0::nat); \
   10.66  \ WHILE w <= x \
   10.67  \ INV {u = r+r+1 & w = (r+1)*(r+1) & r*r <= x & x=X} \
   10.68 -\ DO r := r+1; w := w+u+2; u := u+2 OD \
   10.69 +\ DO r := r + 1; w := w + u + # 2; u := u + # 2 OD \
   10.70  \ {r*r <= X & X < (r+1)*(r+1)}";
   10.71  by (hoare_tac (SELECT_GOAL Auto_tac) 1);
   10.72  qed "sqrt_without_multiplication";
   10.73 @@ -175,7 +175,7 @@
   10.74  Ambiguity warnings of parser are due to := being used
   10.75  both for assignment and list update.
   10.76  *)
   10.77 -Goal "m - 1' < n ==> m < Suc n";
   10.78 +Goal "m - Suc 0 < n ==> m < Suc n";
   10.79  by (arith_tac 1);
   10.80  qed "lemma";
   10.81  
   10.82 @@ -184,7 +184,7 @@
   10.83  \   geq == %A i. !k. i<k & k<length A --> pivot <= A!k |] ==> \
   10.84  \ |- VARS A u l.\
   10.85  \ {0 < length(A::('a::order)list)} \
   10.86 -\ l := 0; u := length A - 1'; \
   10.87 +\ l := 0; u := length A - Suc 0; \
   10.88  \ WHILE l <= u \
   10.89  \  INV {leq A l & geq A u & u<length A & l<=length A} \
   10.90  \  DO WHILE l < length A & A!l <= pivot \
   10.91 @@ -192,7 +192,7 @@
   10.92  \      DO l := l+1 OD; \
   10.93  \     WHILE 0 < u & pivot <= A!u \
   10.94  \      INV {leq A l & geq A u  & u<length A & l<=length A} \
   10.95 -\      DO u := u-1 OD; \
   10.96 +\      DO u := u - 1 OD; \
   10.97  \     IF l <= u THEN A := A[l := A!u, u := A!l] ELSE SKIP FI \
   10.98  \  OD \
   10.99  \ {leq A u & (!k. u<k & k<l --> A!k = pivot) & geq A l}";
    11.1 --- a/src/HOL/Hyperreal/HRealAbs.ML	Fri Oct 05 21:50:37 2001 +0200
    11.2 +++ b/src/HOL/Hyperreal/HRealAbs.ML	Fri Oct 05 21:52:39 2001 +0200
    11.3 @@ -32,28 +32,28 @@
    11.4     (adapted version of previously proved theorems about abs)
    11.5   ------------------------------------------------------------*)
    11.6  
    11.7 -Goal "abs (#0::hypreal) = #0";
    11.8 +Goal "abs (Numeral0::hypreal) = Numeral0";
    11.9  by (simp_tac (simpset() addsimps [hrabs_def]) 1); 
   11.10  qed "hrabs_zero";
   11.11  Addsimps [hrabs_zero];
   11.12  
   11.13 -Goal "(#0::hypreal)<=x ==> abs x = x";
   11.14 +Goal "(Numeral0::hypreal)<=x ==> abs x = x";
   11.15  by (asm_simp_tac (simpset() addsimps [hrabs_def]) 1); 
   11.16  qed "hrabs_eqI1";
   11.17  
   11.18 -Goal "(#0::hypreal)<x ==> abs x = x";
   11.19 +Goal "(Numeral0::hypreal)<x ==> abs x = x";
   11.20  by (asm_simp_tac (simpset() addsimps [order_less_imp_le, hrabs_eqI1]) 1);
   11.21  qed "hrabs_eqI2";
   11.22  
   11.23 -Goal "x<(#0::hypreal) ==> abs x = -x";
   11.24 +Goal "x<(Numeral0::hypreal) ==> abs x = -x";
   11.25  by (asm_simp_tac (simpset() addsimps [hypreal_le_def, hrabs_def]) 1); 
   11.26  qed "hrabs_minus_eqI2";
   11.27  
   11.28 -Goal "x<=(#0::hypreal) ==> abs x = -x";
   11.29 +Goal "x<=(Numeral0::hypreal) ==> abs x = -x";
   11.30  by (auto_tac (claset() addDs [order_antisym], simpset() addsimps [hrabs_def])); 
   11.31  qed "hrabs_minus_eqI1";
   11.32  
   11.33 -Goal "(#0::hypreal)<= abs x";
   11.34 +Goal "(Numeral0::hypreal)<= abs x";
   11.35  by (auto_tac (claset() addDs [hypreal_minus_zero_less_iff RS iffD2, 
   11.36                                hypreal_less_asym], 
   11.37                simpset() addsimps [hypreal_le_def, hrabs_def]));
   11.38 @@ -66,7 +66,7 @@
   11.39  qed "hrabs_idempotent";
   11.40  Addsimps [hrabs_idempotent];
   11.41  
   11.42 -Goalw [hrabs_def] "(abs x = (#0::hypreal)) = (x=#0)";
   11.43 +Goalw [hrabs_def] "(abs x = (Numeral0::hypreal)) = (x=Numeral0)";
   11.44  by (Simp_tac 1);
   11.45  qed "hrabs_zero_iff";
   11.46  AddIffs [hrabs_zero_iff];
   11.47 @@ -90,7 +90,7 @@
   11.48  Addsimps [hrabs_mult];
   11.49  
   11.50  Goal "abs(inverse(x)) = inverse(abs(x::hypreal))";
   11.51 -by (hypreal_div_undefined_case_tac "x=#0" 1);
   11.52 +by (hypreal_div_undefined_case_tac "x=Numeral0" 1);
   11.53  by (simp_tac (simpset() addsimps [HYPREAL_DIVIDE_ZERO]) 1); 
   11.54  by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
   11.55  by (auto_tac (claset(),
   11.56 @@ -128,10 +128,10 @@
   11.57  qed "hrabs_add_less";
   11.58  
   11.59  Goal "[| abs x<r;  abs y<s |] ==> abs x * abs y < r * (s::hypreal)";
   11.60 -by (subgoal_tac "#0 < r" 1);
   11.61 +by (subgoal_tac "Numeral0 < r" 1);
   11.62  by (asm_full_simp_tac (simpset() addsimps [hrabs_def] 
   11.63                                   addsplits [split_if_asm]) 2); 
   11.64 -by (case_tac "y = #0" 1);
   11.65 +by (case_tac "y = Numeral0" 1);
   11.66  by (asm_full_simp_tac (simpset() addsimps [hypreal_0_less_mult_iff]) 1); 
   11.67  by (rtac hypreal_mult_less_mono 1); 
   11.68  by (auto_tac (claset(), 
   11.69 @@ -139,18 +139,18 @@
   11.70                          addsplits [split_if_asm])); 
   11.71  qed "hrabs_mult_less";
   11.72  
   11.73 -Goal "((#0::hypreal) < abs x) = (x ~= 0)";
   11.74 +Goal "((Numeral0::hypreal) < abs x) = (x ~= 0)";
   11.75  by (simp_tac (simpset() addsimps [hrabs_def]) 1);
   11.76  by (arith_tac 1);
   11.77  qed "hypreal_0_less_abs_iff";
   11.78  Addsimps [hypreal_0_less_abs_iff];
   11.79  
   11.80 -Goal "abs x < r ==> (#0::hypreal) < r";
   11.81 +Goal "abs x < r ==> (Numeral0::hypreal) < r";
   11.82  by (blast_tac (claset() addSIs [order_le_less_trans, hrabs_ge_zero]) 1);
   11.83  qed "hrabs_less_gt_zero";
   11.84  
   11.85  Goal "abs x = (x::hypreal) | abs x = -x";
   11.86 -by (cut_inst_tac [("x","#0"),("y","x")] hypreal_linear 1);
   11.87 +by (cut_inst_tac [("x","Numeral0"),("y","x")] hypreal_linear 1);
   11.88  by (fast_tac (claset() addIs [hrabs_eqI2,hrabs_minus_eqI2,
   11.89                              hrabs_zero]) 1);
   11.90  qed "hrabs_disj";
   11.91 @@ -247,13 +247,13 @@
   11.92  
   11.93  (*"neg" is used in rewrite rules for binary comparisons*)
   11.94  Goal "hypreal_of_nat (number_of v :: nat) = \
   11.95 -\        (if neg (number_of v) then #0 \
   11.96 +\        (if neg (number_of v) then Numeral0 \
   11.97  \         else (number_of v :: hypreal))";
   11.98  by (simp_tac (simpset() addsimps [hypreal_of_nat_def]) 1);
   11.99  qed "hypreal_of_nat_number_of";
  11.100  Addsimps [hypreal_of_nat_number_of];
  11.101  
  11.102 -Goal "hypreal_of_nat 0 = #0";
  11.103 +Goal "hypreal_of_nat 0 = Numeral0";
  11.104  by (simp_tac (simpset() delsimps [numeral_0_eq_0]
  11.105  			addsimps [numeral_0_eq_0 RS sym]) 1);
  11.106  qed "hypreal_of_nat_zero";
    12.1 --- a/src/HOL/Hyperreal/HSeries.ML	Fri Oct 05 21:50:37 2001 +0200
    12.2 +++ b/src/HOL/Hyperreal/HSeries.ML	Fri Oct 05 21:52:39 2001 +0200
    12.3 @@ -35,7 +35,7 @@
    12.4  
    12.5  (* Theorem corresponding to base case in def of sumr *)
    12.6  Goalw [hypnat_zero_def]
    12.7 -     "sumhr (m,0,f) = #0";
    12.8 +     "sumhr (m,0,f) = Numeral0";
    12.9  by (res_inst_tac [("z","m")] eq_Abs_hypnat 1);
   12.10  by (auto_tac (claset(), 
   12.11                simpset() addsimps [sumhr, symmetric hypreal_zero_def]));
   12.12 @@ -44,7 +44,7 @@
   12.13  
   12.14  (* Theorem corresponding to recursive case in def of sumr *)
   12.15  Goalw [hypnat_one_def]
   12.16 -     "sumhr(m,n+1hn,f) = (if n + 1hn <= m then #0 \
   12.17 +     "sumhr(m,n+1hn,f) = (if n + 1hn <= m then Numeral0 \
   12.18  \                         else sumhr(m,n,f) + (*fNat* f) n)";
   12.19  by (simp_tac (HOL_ss addsimps
   12.20               [zero_eq_numeral_0 RS sym, hypreal_zero_def]) 1); 
   12.21 @@ -55,7 +55,7 @@
   12.22  by (ALLGOALS(Ultra_tac));
   12.23  qed "sumhr_if";
   12.24  
   12.25 -Goalw [hypnat_one_def] "sumhr (n + 1hn, n, f) = #0";
   12.26 +Goalw [hypnat_one_def] "sumhr (n + 1hn, n, f) = Numeral0";
   12.27  by (simp_tac (HOL_ss addsimps
   12.28               [zero_eq_numeral_0 RS sym, hypreal_zero_def]) 1); 
   12.29  by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
   12.30 @@ -64,7 +64,7 @@
   12.31  qed "sumhr_Suc_zero";
   12.32  Addsimps [sumhr_Suc_zero];
   12.33  
   12.34 -Goal "sumhr (n,n,f) = #0";
   12.35 +Goal "sumhr (n,n,f) = Numeral0";
   12.36  by (simp_tac (HOL_ss addsimps
   12.37               [zero_eq_numeral_0 RS sym, hypreal_zero_def]) 1); 
   12.38  by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
   12.39 @@ -80,7 +80,7 @@
   12.40  qed "sumhr_Suc";
   12.41  Addsimps [sumhr_Suc];
   12.42  
   12.43 -Goal "sumhr(m+k,k,f) = #0";
   12.44 +Goal "sumhr(m+k,k,f) = Numeral0";
   12.45  by (simp_tac (HOL_ss addsimps
   12.46               [zero_eq_numeral_0 RS sym, hypreal_zero_def]) 1); 
   12.47  by (res_inst_tac [("z","m")] eq_Abs_hypnat 1);
   12.48 @@ -156,7 +156,7 @@
   12.49  		    hypreal_minus,sumr_add RS sym]) 1);
   12.50  qed "sumhr_add_mult_const";
   12.51  
   12.52 -Goal "n < m ==> sumhr (m,n,f) = #0";
   12.53 +Goal "n < m ==> sumhr (m,n,f) = Numeral0";
   12.54  by (simp_tac (HOL_ss addsimps
   12.55               [zero_eq_numeral_0 RS sym, hypreal_zero_def]) 1); 
   12.56  by (res_inst_tac [("z","m")] eq_Abs_hypnat 1);
   12.57 @@ -185,13 +185,13 @@
   12.58        by summing to some infinite hypernatural (such as whn)
   12.59   -----------------------------------------------------------------*)
   12.60  Goalw [hypnat_omega_def,hypnat_zero_def] 
   12.61 -      "sumhr(0,whn,%i. #1) = hypreal_of_hypnat whn";
   12.62 +      "sumhr(0,whn,%i. Numeral1) = hypreal_of_hypnat whn";
   12.63  by (auto_tac (claset(),
   12.64                simpset() addsimps [sumhr, hypreal_of_hypnat]));
   12.65  qed "sumhr_hypreal_of_hypnat_omega";
   12.66  
   12.67  Goalw [hypnat_omega_def,hypnat_zero_def,omega_def]  
   12.68 -     "sumhr(0, whn, %i. #1) = omega - #1";
   12.69 +     "sumhr(0, whn, %i. Numeral1) = omega - Numeral1";
   12.70  by (simp_tac (HOL_ss addsimps
   12.71               [one_eq_numeral_1 RS sym, hypreal_one_def]) 1); 
   12.72  by (auto_tac (claset(),
   12.73 @@ -199,7 +199,7 @@
   12.74  qed "sumhr_hypreal_omega_minus_one";
   12.75  
   12.76  Goalw [hypnat_zero_def, hypnat_omega_def]
   12.77 -     "sumhr(0, whn + whn, %i. (-#1) ^ (i+1)) = #0";
   12.78 +     "sumhr(0, whn + whn, %i. (-Numeral1) ^ (i+1)) = Numeral0";
   12.79  by (simp_tac (HOL_ss addsimps
   12.80               [zero_eq_numeral_0 RS sym, hypreal_zero_def]) 1); 
   12.81  by (simp_tac (simpset() addsimps [sumhr,hypnat_add,double_lemma] 
   12.82 @@ -223,7 +223,7 @@
   12.83  qed "starfunNat_sumr";
   12.84  
   12.85  Goal "sumhr (0, M, f) @= sumhr (0, N, f) \
   12.86 -\     ==> abs (sumhr (M, N, f)) @= #0";
   12.87 +\     ==> abs (sumhr (M, N, f)) @= Numeral0";
   12.88  by (cut_inst_tac [("x","M"),("y","N")] hypnat_linear 1);
   12.89  by (auto_tac (claset(), simpset() addsimps [approx_refl]));
   12.90  by (dtac (approx_sym RS (approx_minus_iff RS iffD1)) 1);
   12.91 @@ -265,12 +265,12 @@
   12.92                           sums_unique]) 1);
   12.93  qed "NSsums_unique";
   12.94  
   12.95 -Goal "ALL m. n <= Suc m --> f(m) = #0 ==> f NSsums (sumr 0 n f)";
   12.96 +Goal "ALL m. n <= Suc m --> f(m) = Numeral0 ==> f NSsums (sumr 0 n f)";
   12.97  by (asm_simp_tac (simpset() addsimps [sums_NSsums_iff RS sym, series_zero]) 1);
   12.98  qed "NSseries_zero";
   12.99  
  12.100  Goal "NSsummable f = \
  12.101 -\     (ALL M: HNatInfinite. ALL N: HNatInfinite. abs (sumhr(M,N,f)) @= #0)";
  12.102 +\     (ALL M: HNatInfinite. ALL N: HNatInfinite. abs (sumhr(M,N,f)) @= Numeral0)";
  12.103  by (auto_tac (claset(),
  12.104                simpset() addsimps [summable_NSsummable_iff RS sym,
  12.105                   summable_convergent_sumr_iff, convergent_NSconvergent_iff,
  12.106 @@ -287,7 +287,7 @@
  12.107  (*-------------------------------------------------------------------
  12.108           Terms of a convergent series tend to zero
  12.109   -------------------------------------------------------------------*)
  12.110 -Goalw [NSLIMSEQ_def] "NSsummable f ==> f ----NS> #0";
  12.111 +Goalw [NSLIMSEQ_def] "NSsummable f ==> f ----NS> Numeral0";
  12.112  by (auto_tac (claset(), simpset() addsimps [NSsummable_NSCauchy]));
  12.113  by (dtac bspec 1 THEN Auto_tac);
  12.114  by (dres_inst_tac [("x","N + 1hn")] bspec 1);
  12.115 @@ -297,7 +297,7 @@
  12.116  qed "NSsummable_NSLIMSEQ_zero";
  12.117  
  12.118  (* Easy to prove stsandard case now *)
  12.119 -Goal "summable f ==> f ----> #0";
  12.120 +Goal "summable f ==> f ----> Numeral0";
  12.121  by (auto_tac (claset(),
  12.122          simpset() addsimps [summable_NSsummable_iff,
  12.123                              LIMSEQ_NSLIMSEQ_iff, NSsummable_NSLIMSEQ_zero]));
    13.1 --- a/src/HOL/Hyperreal/HyperArith0.ML	Fri Oct 05 21:50:37 2001 +0200
    13.2 +++ b/src/HOL/Hyperreal/HyperArith0.ML	Fri Oct 05 21:52:39 2001 +0200
    13.3 @@ -8,7 +8,7 @@
    13.4  Also, common factor cancellation
    13.5  *)
    13.6  
    13.7 -Goal "((x * y = #0) = (x = #0 | y = (#0::hypreal)))";
    13.8 +Goal "((x * y = Numeral0) = (x = Numeral0 | y = (Numeral0::hypreal)))";
    13.9  by Auto_tac;  
   13.10  by (cut_inst_tac [("x","x"),("y","y")] hypreal_mult_zero_disj 1);
   13.11  by Auto_tac;  
   13.12 @@ -17,13 +17,13 @@
   13.13  
   13.14  (** Division and inverse **)
   13.15  
   13.16 -Goal "#0/x = (#0::hypreal)";
   13.17 +Goal "Numeral0/x = (Numeral0::hypreal)";
   13.18  by (simp_tac (simpset() addsimps [hypreal_divide_def]) 1); 
   13.19  qed "hypreal_0_divide";
   13.20  Addsimps [hypreal_0_divide];
   13.21  
   13.22 -Goal "((#0::hypreal) < inverse x) = (#0 < x)";
   13.23 -by (case_tac "x=#0" 1);
   13.24 +Goal "((Numeral0::hypreal) < inverse x) = (Numeral0 < x)";
   13.25 +by (case_tac "x=Numeral0" 1);
   13.26  by (asm_simp_tac (HOL_ss addsimps [rename_numerals HYPREAL_INVERSE_ZERO]) 1); 
   13.27  by (auto_tac (claset() addDs [hypreal_inverse_less_0], 
   13.28                simpset() addsimps [linorder_neq_iff, 
   13.29 @@ -31,8 +31,8 @@
   13.30  qed "hypreal_0_less_inverse_iff";
   13.31  Addsimps [hypreal_0_less_inverse_iff];
   13.32  
   13.33 -Goal "(inverse x < (#0::hypreal)) = (x < #0)";
   13.34 -by (case_tac "x=#0" 1);
   13.35 +Goal "(inverse x < (Numeral0::hypreal)) = (x < Numeral0)";
   13.36 +by (case_tac "x=Numeral0" 1);
   13.37  by (asm_simp_tac (HOL_ss addsimps [rename_numerals HYPREAL_INVERSE_ZERO]) 1); 
   13.38  by (auto_tac (claset() addDs [hypreal_inverse_less_0], 
   13.39                simpset() addsimps [linorder_neq_iff, 
   13.40 @@ -40,49 +40,49 @@
   13.41  qed "hypreal_inverse_less_0_iff";
   13.42  Addsimps [hypreal_inverse_less_0_iff];
   13.43  
   13.44 -Goal "((#0::hypreal) <= inverse x) = (#0 <= x)";
   13.45 +Goal "((Numeral0::hypreal) <= inverse x) = (Numeral0 <= x)";
   13.46  by (simp_tac (simpset() addsimps [linorder_not_less RS sym]) 1); 
   13.47  qed "hypreal_0_le_inverse_iff";
   13.48  Addsimps [hypreal_0_le_inverse_iff];
   13.49  
   13.50 -Goal "(inverse x <= (#0::hypreal)) = (x <= #0)";
   13.51 +Goal "(inverse x <= (Numeral0::hypreal)) = (x <= Numeral0)";
   13.52  by (simp_tac (simpset() addsimps [linorder_not_less RS sym]) 1); 
   13.53  qed "hypreal_inverse_le_0_iff";
   13.54  Addsimps [hypreal_inverse_le_0_iff];
   13.55  
   13.56 -Goalw [hypreal_divide_def] "x/(#0::hypreal) = #0";
   13.57 +Goalw [hypreal_divide_def] "x/(Numeral0::hypreal) = Numeral0";
   13.58  by (stac (rename_numerals HYPREAL_INVERSE_ZERO) 1); 
   13.59  by (Simp_tac 1); 
   13.60  qed "HYPREAL_DIVIDE_ZERO";
   13.61  
   13.62 -Goal "inverse (x::hypreal) = #1/x";
   13.63 +Goal "inverse (x::hypreal) = Numeral1/x";
   13.64  by (simp_tac (simpset() addsimps [hypreal_divide_def]) 1); 
   13.65  qed "hypreal_inverse_eq_divide";
   13.66  
   13.67 -Goal "((#0::hypreal) < x/y) = (#0 < x & #0 < y | x < #0 & y < #0)";
   13.68 +Goal "((Numeral0::hypreal) < x/y) = (Numeral0 < x & Numeral0 < y | x < Numeral0 & y < Numeral0)";
   13.69  by (simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_0_less_mult_iff]) 1);
   13.70  qed "hypreal_0_less_divide_iff";
   13.71  Addsimps [inst "x" "number_of ?w" hypreal_0_less_divide_iff];
   13.72  
   13.73 -Goal "(x/y < (#0::hypreal)) = (#0 < x & y < #0 | x < #0 & #0 < y)";
   13.74 +Goal "(x/y < (Numeral0::hypreal)) = (Numeral0 < x & y < Numeral0 | x < Numeral0 & Numeral0 < y)";
   13.75  by (simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_mult_less_0_iff]) 1);
   13.76  qed "hypreal_divide_less_0_iff";
   13.77  Addsimps [inst "x" "number_of ?w" hypreal_divide_less_0_iff];
   13.78  
   13.79 -Goal "((#0::hypreal) <= x/y) = ((x <= #0 | #0 <= y) & (#0 <= x | y <= #0))";
   13.80 +Goal "((Numeral0::hypreal) <= x/y) = ((x <= Numeral0 | Numeral0 <= y) & (Numeral0 <= x | y <= Numeral0))";
   13.81  by (simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_0_le_mult_iff]) 1);
   13.82  by Auto_tac;  
   13.83  qed "hypreal_0_le_divide_iff";
   13.84  Addsimps [inst "x" "number_of ?w" hypreal_0_le_divide_iff];
   13.85  
   13.86 -Goal "(x/y <= (#0::hypreal)) = ((x <= #0 | y <= #0) & (#0 <= x | #0 <= y))";
   13.87 +Goal "(x/y <= (Numeral0::hypreal)) = ((x <= Numeral0 | y <= Numeral0) & (Numeral0 <= x | Numeral0 <= y))";
   13.88  by (simp_tac (simpset() addsimps [hypreal_divide_def, 
   13.89                                    hypreal_mult_le_0_iff]) 1);
   13.90  by Auto_tac;  
   13.91  qed "hypreal_divide_le_0_iff";
   13.92  Addsimps [inst "x" "number_of ?w" hypreal_divide_le_0_iff];
   13.93  
   13.94 -Goal "(inverse(x::hypreal) = #0) = (x = #0)";
   13.95 +Goal "(inverse(x::hypreal) = Numeral0) = (x = Numeral0)";
   13.96  by (auto_tac (claset(), 
   13.97                simpset() addsimps [rename_numerals HYPREAL_INVERSE_ZERO]));  
   13.98  by (rtac ccontr 1); 
   13.99 @@ -90,12 +90,12 @@
  13.100  qed "hypreal_inverse_zero_iff";
  13.101  Addsimps [hypreal_inverse_zero_iff];
  13.102  
  13.103 -Goal "(x/y = #0) = (x=#0 | y=(#0::hypreal))";
  13.104 +Goal "(x/y = Numeral0) = (x=Numeral0 | y=(Numeral0::hypreal))";
  13.105  by (auto_tac (claset(), simpset() addsimps [hypreal_divide_def]));  
  13.106  qed "hypreal_divide_eq_0_iff";
  13.107  Addsimps [hypreal_divide_eq_0_iff];
  13.108  
  13.109 -Goal "h ~= (#0::hypreal) ==> h/h = #1";
  13.110 +Goal "h ~= (Numeral0::hypreal) ==> h/h = Numeral1";
  13.111  by (asm_simp_tac 
  13.112      (simpset() addsimps [hypreal_divide_def, hypreal_mult_inverse_left]) 1);
  13.113  qed "hypreal_divide_self_eq"; 
  13.114 @@ -140,7 +140,7 @@
  13.115  by (ALLGOALS (asm_full_simp_tac (simpset() addsimps [hypreal_mult_commute])));
  13.116  qed "hypreal_mult_le_mono2_neg";
  13.117  
  13.118 -Goal "(m*k < n*k) = (((#0::hypreal) < k & m<n) | (k < #0 & n<m))";
  13.119 +Goal "(m*k < n*k) = (((Numeral0::hypreal) < k & m<n) | (k < Numeral0 & n<m))";
  13.120  by (case_tac "k = (0::hypreal)" 1);
  13.121  by (auto_tac (claset(), 
  13.122            simpset() addsimps [linorder_neq_iff, 
  13.123 @@ -155,32 +155,32 @@
  13.124                                    hypreal_mult_le_mono1_neg]));  
  13.125  qed "hypreal_mult_less_cancel2";
  13.126  
  13.127 -Goal "(m*k <= n*k) = (((#0::hypreal) < k --> m<=n) & (k < #0 --> n<=m))";
  13.128 +Goal "(m*k <= n*k) = (((Numeral0::hypreal) < k --> m<=n) & (k < Numeral0 --> n<=m))";
  13.129  by (simp_tac (simpset() addsimps [linorder_not_less RS sym, 
  13.130                                    hypreal_mult_less_cancel2]) 1);
  13.131  qed "hypreal_mult_le_cancel2";
  13.132  
  13.133 -Goal "(k*m < k*n) = (((#0::hypreal) < k & m<n) | (k < #0 & n<m))";
  13.134 +Goal "(k*m < k*n) = (((Numeral0::hypreal) < k & m<n) | (k < Numeral0 & n<m))";
  13.135  by (simp_tac (simpset() addsimps [inst "z" "k" hypreal_mult_commute, 
  13.136                                    hypreal_mult_less_cancel2]) 1);
  13.137  qed "hypreal_mult_less_cancel1";
  13.138  
  13.139 -Goal "!!k::hypreal. (k*m <= k*n) = ((#0 < k --> m<=n) & (k < #0 --> n<=m))";
  13.140 +Goal "!!k::hypreal. (k*m <= k*n) = ((Numeral0 < k --> m<=n) & (k < Numeral0 --> n<=m))";
  13.141  by (simp_tac (simpset() addsimps [linorder_not_less RS sym, 
  13.142                                    hypreal_mult_less_cancel1]) 1);
  13.143  qed "hypreal_mult_le_cancel1";
  13.144  
  13.145 -Goal "!!k::hypreal. (k*m = k*n) = (k = #0 | m=n)";
  13.146 +Goal "!!k::hypreal. (k*m = k*n) = (k = Numeral0 | m=n)";
  13.147  by (case_tac "k=0" 1);
  13.148  by (auto_tac (claset(), simpset() addsimps [hypreal_mult_left_cancel]));  
  13.149  qed "hypreal_mult_eq_cancel1";
  13.150  
  13.151 -Goal "!!k::hypreal. (m*k = n*k) = (k = #0 | m=n)";
  13.152 +Goal "!!k::hypreal. (m*k = n*k) = (k = Numeral0 | m=n)";
  13.153  by (case_tac "k=0" 1);
  13.154  by (auto_tac (claset(), simpset() addsimps [hypreal_mult_right_cancel]));  
  13.155  qed "hypreal_mult_eq_cancel2";
  13.156  
  13.157 -Goal "!!k::hypreal. k~=#0 ==> (k*m) / (k*n) = (m/n)";
  13.158 +Goal "!!k::hypreal. k~=Numeral0 ==> (k*m) / (k*n) = (m/n)";
  13.159  by (asm_simp_tac
  13.160      (simpset() addsimps [hypreal_divide_def, hypreal_inverse_distrib]) 1); 
  13.161  by (subgoal_tac "k * m * (inverse k * inverse n) = \
  13.162 @@ -190,7 +190,7 @@
  13.163  qed "hypreal_mult_div_cancel1";
  13.164  
  13.165  (*For ExtractCommonTerm*)
  13.166 -Goal "(k*m) / (k*n) = (if k = (#0::hypreal) then #0 else m/n)";
  13.167 +Goal "(k*m) / (k*n) = (if k = (Numeral0::hypreal) then Numeral0 else m/n)";
  13.168  by (simp_tac (simpset() addsimps [hypreal_mult_div_cancel1]) 1); 
  13.169  qed "hypreal_mult_div_cancel_disj";
  13.170  
  13.171 @@ -288,34 +288,34 @@
  13.172  set trace_simp;
  13.173  fun test s = (Goal s; by (Simp_tac 1)); 
  13.174  
  13.175 -test "#0 <= (y::hypreal) * #-2";
  13.176 -test "#9*x = #12 * (y::hypreal)";
  13.177 -test "(#9*x) / (#12 * (y::hypreal)) = z";
  13.178 -test "#9*x < #12 * (y::hypreal)";
  13.179 -test "#9*x <= #12 * (y::hypreal)";
  13.180 +test "Numeral0 <= (y::hypreal) * # -2";
  13.181 +test "# 9*x = # 12 * (y::hypreal)";
  13.182 +test "(# 9*x) / (# 12 * (y::hypreal)) = z";
  13.183 +test "# 9*x < # 12 * (y::hypreal)";
  13.184 +test "# 9*x <= # 12 * (y::hypreal)";
  13.185  
  13.186 -test "#-99*x = #132 * (y::hypreal)";
  13.187 -test "(#-99*x) / (#132 * (y::hypreal)) = z";
  13.188 -test "#-99*x < #132 * (y::hypreal)";
  13.189 -test "#-99*x <= #132 * (y::hypreal)";
  13.190 +test "# -99*x = # 123 * (y::hypreal)";
  13.191 +test "(# -99*x) / (# 123 * (y::hypreal)) = z";
  13.192 +test "# -99*x < # 123 * (y::hypreal)";
  13.193 +test "# -99*x <= # 123 * (y::hypreal)";
  13.194  
  13.195 -test "#999*x = #-396 * (y::hypreal)";
  13.196 -test "(#999*x) / (#-396 * (y::hypreal)) = z";
  13.197 -test "#999*x < #-396 * (y::hypreal)";
  13.198 -test "#999*x <= #-396 * (y::hypreal)";
  13.199 +test "# 999*x = # -396 * (y::hypreal)";
  13.200 +test "(# 999*x) / (# -396 * (y::hypreal)) = z";
  13.201 +test "# 999*x < # -396 * (y::hypreal)";
  13.202 +test "# 999*x <= # -396 * (y::hypreal)";
  13.203  
  13.204 -test "#-99*x = #-81 * (y::hypreal)";
  13.205 -test "(#-99*x) / (#-81 * (y::hypreal)) = z";
  13.206 -test "#-99*x <= #-81 * (y::hypreal)";
  13.207 -test "#-99*x < #-81 * (y::hypreal)";
  13.208 +test "# -99*x = # -81 * (y::hypreal)";
  13.209 +test "(# -99*x) / (# -81 * (y::hypreal)) = z";
  13.210 +test "# -99*x <= # -81 * (y::hypreal)";
  13.211 +test "# -99*x < # -81 * (y::hypreal)";
  13.212  
  13.213 -test "#-2 * x = #-1 * (y::hypreal)";
  13.214 -test "#-2 * x = -(y::hypreal)";
  13.215 -test "(#-2 * x) / (#-1 * (y::hypreal)) = z";
  13.216 -test "#-2 * x < -(y::hypreal)";
  13.217 -test "#-2 * x <= #-1 * (y::hypreal)";
  13.218 -test "-x < #-23 * (y::hypreal)";
  13.219 -test "-x <= #-23 * (y::hypreal)";
  13.220 +test "# -2 * x = # -1 * (y::hypreal)";
  13.221 +test "# -2 * x = -(y::hypreal)";
  13.222 +test "(# -2 * x) / (# -1 * (y::hypreal)) = z";
  13.223 +test "# -2 * x < -(y::hypreal)";
  13.224 +test "# -2 * x <= # -1 * (y::hypreal)";
  13.225 +test "-x < # -23 * (y::hypreal)";
  13.226 +test "-x <= # -23 * (y::hypreal)";
  13.227  *)
  13.228  
  13.229  
  13.230 @@ -391,7 +391,7 @@
  13.231  
  13.232  (*** Simplification of inequalities involving literal divisors ***)
  13.233  
  13.234 -Goal "#0<z ==> ((x::hypreal) <= y/z) = (x*z <= y)";
  13.235 +Goal "Numeral0<z ==> ((x::hypreal) <= y/z) = (x*z <= y)";
  13.236  by (subgoal_tac "(x*z <= y) = (x*z <= (y/z)*z)" 1);
  13.237  by (asm_simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_mult_assoc]) 2); 
  13.238  by (etac ssubst 1);
  13.239 @@ -400,7 +400,7 @@
  13.240  qed "pos_hypreal_le_divide_eq";
  13.241  Addsimps [inst "z" "number_of ?w" pos_hypreal_le_divide_eq];
  13.242  
  13.243 -Goal "z<#0 ==> ((x::hypreal) <= y/z) = (y <= x*z)";
  13.244 +Goal "z<Numeral0 ==> ((x::hypreal) <= y/z) = (y <= x*z)";
  13.245  by (subgoal_tac "(y <= x*z) = ((y/z)*z <= x*z)" 1);
  13.246  by (asm_simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_mult_assoc]) 2); 
  13.247  by (etac ssubst 1);
  13.248 @@ -409,7 +409,7 @@
  13.249  qed "neg_hypreal_le_divide_eq";
  13.250  Addsimps [inst "z" "number_of ?w" neg_hypreal_le_divide_eq];
  13.251  
  13.252 -Goal "#0<z ==> (y/z <= (x::hypreal)) = (y <= x*z)";
  13.253 +Goal "Numeral0<z ==> (y/z <= (x::hypreal)) = (y <= x*z)";
  13.254  by (subgoal_tac "(y <= x*z) = ((y/z)*z <= x*z)" 1);
  13.255  by (asm_simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_mult_assoc]) 2); 
  13.256  by (etac ssubst 1);
  13.257 @@ -418,7 +418,7 @@
  13.258  qed "pos_hypreal_divide_le_eq";
  13.259  Addsimps [inst "z" "number_of ?w" pos_hypreal_divide_le_eq];
  13.260  
  13.261 -Goal "z<#0 ==> (y/z <= (x::hypreal)) = (x*z <= y)";
  13.262 +Goal "z<Numeral0 ==> (y/z <= (x::hypreal)) = (x*z <= y)";
  13.263  by (subgoal_tac "(x*z <= y) = (x*z <= (y/z)*z)" 1);
  13.264  by (asm_simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_mult_assoc]) 2); 
  13.265  by (etac ssubst 1);
  13.266 @@ -427,7 +427,7 @@
  13.267  qed "neg_hypreal_divide_le_eq";
  13.268  Addsimps [inst "z" "number_of ?w" neg_hypreal_divide_le_eq];
  13.269  
  13.270 -Goal "#0<z ==> ((x::hypreal) < y/z) = (x*z < y)";
  13.271 +Goal "Numeral0<z ==> ((x::hypreal) < y/z) = (x*z < y)";
  13.272  by (subgoal_tac "(x*z < y) = (x*z < (y/z)*z)" 1);
  13.273  by (asm_simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_mult_assoc]) 2); 
  13.274  by (etac ssubst 1);
  13.275 @@ -436,7 +436,7 @@
  13.276  qed "pos_hypreal_less_divide_eq";
  13.277  Addsimps [inst "z" "number_of ?w" pos_hypreal_less_divide_eq];
  13.278  
  13.279 -Goal "z<#0 ==> ((x::hypreal) < y/z) = (y < x*z)";
  13.280 +Goal "z<Numeral0 ==> ((x::hypreal) < y/z) = (y < x*z)";
  13.281  by (subgoal_tac "(y < x*z) = ((y/z)*z < x*z)" 1);
  13.282  by (asm_simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_mult_assoc]) 2); 
  13.283  by (etac ssubst 1);
  13.284 @@ -445,7 +445,7 @@
  13.285  qed "neg_hypreal_less_divide_eq";
  13.286  Addsimps [inst "z" "number_of ?w" neg_hypreal_less_divide_eq];
  13.287  
  13.288 -Goal "#0<z ==> (y/z < (x::hypreal)) = (y < x*z)";
  13.289 +Goal "Numeral0<z ==> (y/z < (x::hypreal)) = (y < x*z)";
  13.290  by (subgoal_tac "(y < x*z) = ((y/z)*z < x*z)" 1);
  13.291  by (asm_simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_mult_assoc]) 2); 
  13.292  by (etac ssubst 1);
  13.293 @@ -454,7 +454,7 @@
  13.294  qed "pos_hypreal_divide_less_eq";
  13.295  Addsimps [inst "z" "number_of ?w" pos_hypreal_divide_less_eq];
  13.296  
  13.297 -Goal "z<#0 ==> (y/z < (x::hypreal)) = (x*z < y)";
  13.298 +Goal "z<Numeral0 ==> (y/z < (x::hypreal)) = (x*z < y)";
  13.299  by (subgoal_tac "(x*z < y) = (x*z < (y/z)*z)" 1);
  13.300  by (asm_simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_mult_assoc]) 2); 
  13.301  by (etac ssubst 1);
  13.302 @@ -463,7 +463,7 @@
  13.303  qed "neg_hypreal_divide_less_eq";
  13.304  Addsimps [inst "z" "number_of ?w" neg_hypreal_divide_less_eq];
  13.305  
  13.306 -Goal "z~=#0 ==> ((x::hypreal) = y/z) = (x*z = y)";
  13.307 +Goal "z~=Numeral0 ==> ((x::hypreal) = y/z) = (x*z = y)";
  13.308  by (subgoal_tac "(x*z = y) = (x*z = (y/z)*z)" 1);
  13.309  by (asm_simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_mult_assoc]) 2); 
  13.310  by (etac ssubst 1);
  13.311 @@ -472,7 +472,7 @@
  13.312  qed "hypreal_eq_divide_eq";
  13.313  Addsimps [inst "z" "number_of ?w" hypreal_eq_divide_eq];
  13.314  
  13.315 -Goal "z~=#0 ==> (y/z = (x::hypreal)) = (y = x*z)";
  13.316 +Goal "z~=Numeral0 ==> (y/z = (x::hypreal)) = (y = x*z)";
  13.317  by (subgoal_tac "(y = x*z) = ((y/z)*z = x*z)" 1);
  13.318  by (asm_simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_mult_assoc]) 2); 
  13.319  by (etac ssubst 1);
  13.320 @@ -481,21 +481,21 @@
  13.321  qed "hypreal_divide_eq_eq";
  13.322  Addsimps [inst "z" "number_of ?w" hypreal_divide_eq_eq];
  13.323  
  13.324 -Goal "(m/k = n/k) = (k = #0 | m = (n::hypreal))";
  13.325 -by (case_tac "k=#0" 1);
  13.326 +Goal "(m/k = n/k) = (k = Numeral0 | m = (n::hypreal))";
  13.327 +by (case_tac "k=Numeral0" 1);
  13.328  by (asm_simp_tac (simpset() addsimps [HYPREAL_DIVIDE_ZERO]) 1); 
  13.329  by (asm_simp_tac (simpset() addsimps [hypreal_divide_eq_eq, hypreal_eq_divide_eq, 
  13.330                                        hypreal_mult_eq_cancel2]) 1); 
  13.331  qed "hypreal_divide_eq_cancel2";
  13.332  
  13.333 -Goal "(k/m = k/n) = (k = #0 | m = (n::hypreal))";
  13.334 -by (case_tac "m=#0 | n = #0" 1);
  13.335 +Goal "(k/m = k/n) = (k = Numeral0 | m = (n::hypreal))";
  13.336 +by (case_tac "m=Numeral0 | n = Numeral0" 1);
  13.337  by (auto_tac (claset(), 
  13.338                simpset() addsimps [HYPREAL_DIVIDE_ZERO, hypreal_divide_eq_eq, 
  13.339                                    hypreal_eq_divide_eq, hypreal_mult_eq_cancel1]));  
  13.340  qed "hypreal_divide_eq_cancel1";
  13.341  
  13.342 -Goal "[| #0 < r; #0 < x|] ==> (inverse x < inverse (r::hypreal)) = (r < x)";
  13.343 +Goal "[| Numeral0 < r; Numeral0 < x|] ==> (inverse x < inverse (r::hypreal)) = (r < x)";
  13.344  by (auto_tac (claset() addIs [hypreal_inverse_less_swap], simpset()));
  13.345  by (res_inst_tac [("t","r")] (hypreal_inverse_inverse RS subst) 1);
  13.346  by (res_inst_tac [("t","x")] (hypreal_inverse_inverse RS subst) 1);
  13.347 @@ -504,30 +504,30 @@
  13.348  			addsimps [hypreal_inverse_gt_zero]));
  13.349  qed "hypreal_inverse_less_iff";
  13.350  
  13.351 -Goal "[| #0 < r; #0 < x|] ==> (inverse x <= inverse r) = (r <= (x::hypreal))";
  13.352 +Goal "[| Numeral0 < r; Numeral0 < x|] ==> (inverse x <= inverse r) = (r <= (x::hypreal))";
  13.353  by (asm_simp_tac (simpset() addsimps [linorder_not_less RS sym, 
  13.354                                        hypreal_inverse_less_iff]) 1); 
  13.355  qed "hypreal_inverse_le_iff";
  13.356  
  13.357  (** Division by 1, -1 **)
  13.358  
  13.359 -Goal "(x::hypreal)/#1 = x";
  13.360 +Goal "(x::hypreal)/Numeral1 = x";
  13.361  by (simp_tac (simpset() addsimps [hypreal_divide_def]) 1); 
  13.362  qed "hypreal_divide_1";
  13.363  Addsimps [hypreal_divide_1];
  13.364  
  13.365 -Goal "x/#-1 = -(x::hypreal)";
  13.366 +Goal "x/# -1 = -(x::hypreal)";
  13.367  by (Simp_tac 1); 
  13.368  qed "hypreal_divide_minus1";
  13.369  Addsimps [hypreal_divide_minus1];
  13.370  
  13.371 -Goal "#-1/(x::hypreal) = - (#1/x)";
  13.372 +Goal "# -1/(x::hypreal) = - (Numeral1/x)";
  13.373  by (simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_minus_inverse]) 1); 
  13.374  qed "hypreal_minus1_divide";
  13.375  Addsimps [hypreal_minus1_divide];
  13.376  
  13.377 -Goal "[| (#0::hypreal) < d1; #0 < d2 |] ==> EX e. #0 < e & e < d1 & e < d2";
  13.378 -by (res_inst_tac [("x","(min d1 d2)/#2")] exI 1); 
  13.379 +Goal "[| (Numeral0::hypreal) < d1; Numeral0 < d2 |] ==> EX e. Numeral0 < e & e < d1 & e < d2";
  13.380 +by (res_inst_tac [("x","(min d1 d2)/# 2")] exI 1); 
  13.381  by (asm_simp_tac (simpset() addsimps [min_def]) 1); 
  13.382  qed "hypreal_lbound_gt_zero";
  13.383  
  13.384 @@ -560,7 +560,7 @@
  13.385  by Auto_tac;
  13.386  qed "hypreal_minus_equation";
  13.387  
  13.388 -Goal "(x + - a = (#0::hypreal)) = (x=a)";
  13.389 +Goal "(x + - a = (Numeral0::hypreal)) = (x=a)";
  13.390  by (arith_tac 1);
  13.391  qed "hypreal_add_minus_iff";
  13.392  Addsimps [hypreal_add_minus_iff];
  13.393 @@ -588,44 +588,44 @@
  13.394  	  [hypreal_minus_less, hypreal_minus_le, hypreal_minus_equation]);
  13.395  
  13.396  
  13.397 -(*** Simprules combining x+y and #0 ***)
  13.398 +(*** Simprules combining x+y and Numeral0 ***)
  13.399  
  13.400 -Goal "(x+y = (#0::hypreal)) = (y = -x)";
  13.401 +Goal "(x+y = (Numeral0::hypreal)) = (y = -x)";
  13.402  by Auto_tac;  
  13.403  qed "hypreal_add_eq_0_iff";
  13.404  AddIffs [hypreal_add_eq_0_iff];
  13.405  
  13.406 -Goal "(x+y < (#0::hypreal)) = (y < -x)";
  13.407 +Goal "(x+y < (Numeral0::hypreal)) = (y < -x)";
  13.408  by Auto_tac;  
  13.409  qed "hypreal_add_less_0_iff";
  13.410  AddIffs [hypreal_add_less_0_iff];
  13.411  
  13.412 -Goal "((#0::hypreal) < x+y) = (-x < y)";
  13.413 +Goal "((Numeral0::hypreal) < x+y) = (-x < y)";
  13.414  by Auto_tac;  
  13.415  qed "hypreal_0_less_add_iff";
  13.416  AddIffs [hypreal_0_less_add_iff];
  13.417  
  13.418 -Goal "(x+y <= (#0::hypreal)) = (y <= -x)";
  13.419 +Goal "(x+y <= (Numeral0::hypreal)) = (y <= -x)";
  13.420  by Auto_tac;  
  13.421  qed "hypreal_add_le_0_iff";
  13.422  AddIffs [hypreal_add_le_0_iff];
  13.423  
  13.424 -Goal "((#0::hypreal) <= x+y) = (-x <= y)";
  13.425 +Goal "((Numeral0::hypreal) <= x+y) = (-x <= y)";
  13.426  by Auto_tac;  
  13.427  qed "hypreal_0_le_add_iff";
  13.428  AddIffs [hypreal_0_le_add_iff];
  13.429  
  13.430  
  13.431 -(** Simprules combining x-y and #0; see also hypreal_less_iff_diff_less_0 etc
  13.432 +(** Simprules combining x-y and Numeral0; see also hypreal_less_iff_diff_less_0 etc
  13.433      in HyperBin
  13.434  **)
  13.435  
  13.436 -Goal "((#0::hypreal) < x-y) = (y < x)";
  13.437 +Goal "((Numeral0::hypreal) < x-y) = (y < x)";
  13.438  by Auto_tac;  
  13.439  qed "hypreal_0_less_diff_iff";
  13.440  AddIffs [hypreal_0_less_diff_iff];
  13.441  
  13.442 -Goal "((#0::hypreal) <= x-y) = (y <= x)";
  13.443 +Goal "((Numeral0::hypreal) <= x-y) = (y <= x)";
  13.444  by Auto_tac;  
  13.445  qed "hypreal_0_le_diff_iff";
  13.446  AddIffs [hypreal_0_le_diff_iff];
  13.447 @@ -644,11 +644,11 @@
  13.448  
  13.449  (*** Density of the Hyperreals ***)
  13.450  
  13.451 -Goal "x < y ==> x < (x+y) / (#2::hypreal)";
  13.452 +Goal "x < y ==> x < (x+y) / (# 2::hypreal)";
  13.453  by Auto_tac;
  13.454  qed "hypreal_less_half_sum";
  13.455  
  13.456 -Goal "x < y ==> (x+y)/(#2::hypreal) < y";
  13.457 +Goal "x < y ==> (x+y)/(# 2::hypreal) < y";
  13.458  by Auto_tac;
  13.459  qed "hypreal_gt_half_sum";
  13.460  
  13.461 @@ -657,7 +657,7 @@
  13.462  qed "hypreal_dense";
  13.463  
  13.464  
  13.465 -(*Replaces "inverse #nn" by #1/#nn *)
  13.466 +(*Replaces "inverse #nn" by Numeral1/#nn *)
  13.467  Addsimps [inst "x" "number_of ?w" hypreal_inverse_eq_divide];
  13.468  
  13.469  
    14.1 --- a/src/HOL/Hyperreal/HyperBin.ML	Fri Oct 05 21:50:37 2001 +0200
    14.2 +++ b/src/HOL/Hyperreal/HyperBin.ML	Fri Oct 05 21:52:39 2001 +0200
    14.3 @@ -13,11 +13,11 @@
    14.4  qed "hypreal_number_of";
    14.5  Addsimps [hypreal_number_of];
    14.6  
    14.7 -Goalw [hypreal_number_of_def] "(0::hypreal) = #0";
    14.8 +Goalw [hypreal_number_of_def] "(0::hypreal) = Numeral0";
    14.9  by (simp_tac (simpset() addsimps [hypreal_of_real_zero RS sym]) 1);
   14.10  qed "zero_eq_numeral_0";
   14.11  
   14.12 -Goalw [hypreal_number_of_def] "1hr = #1";
   14.13 +Goalw [hypreal_number_of_def] "1hr = Numeral1";
   14.14  by (simp_tac (simpset() addsimps [hypreal_of_real_one RS sym]) 1);
   14.15  qed "one_eq_numeral_1";
   14.16  
   14.17 @@ -57,18 +57,18 @@
   14.18  qed "mult_hypreal_number_of";
   14.19  Addsimps [mult_hypreal_number_of];
   14.20  
   14.21 -Goal "(#2::hypreal) = #1 + #1";
   14.22 +Goal "(# 2::hypreal) = Numeral1 + Numeral1";
   14.23  by (Simp_tac 1);
   14.24  val lemma = result();
   14.25  
   14.26  (*For specialist use: NOT as default simprules*)
   14.27 -Goal "#2 * z = (z+z::hypreal)";
   14.28 +Goal "# 2 * z = (z+z::hypreal)";
   14.29  by (simp_tac (simpset ()
   14.30  	      addsimps [lemma, hypreal_add_mult_distrib,
   14.31  			one_eq_numeral_1 RS sym]) 1);
   14.32  qed "hypreal_mult_2";
   14.33  
   14.34 -Goal "z * #2 = (z+z::hypreal)";
   14.35 +Goal "z * # 2 = (z+z::hypreal)";
   14.36  by (stac hypreal_mult_commute 1 THEN rtac hypreal_mult_2 1);
   14.37  qed "hypreal_mult_2_right";
   14.38  
   14.39 @@ -107,11 +107,11 @@
   14.40  
   14.41  (*** New versions of existing theorems involving 0, 1hr ***)
   14.42  
   14.43 -Goal "- #1 = (#-1::hypreal)";
   14.44 +Goal "- Numeral1 = (# -1::hypreal)";
   14.45  by (Simp_tac 1);
   14.46  qed "minus_numeral_one";
   14.47  
   14.48 -(*Maps 0 to #0 and 1hr to #1 and -1hr to #-1*)
   14.49 +(*Maps 0 to Numeral0 and 1hr to Numeral1 and -1hr to # -1*)
   14.50  val hypreal_numeral_ss = 
   14.51      real_numeral_ss addsimps [zero_eq_numeral_0, one_eq_numeral_1, 
   14.52  		              minus_numeral_one];
   14.53 @@ -176,15 +176,15 @@
   14.54  
   14.55  (** Combining of literal coefficients in sums of products **)
   14.56  
   14.57 -Goal "(x < y) = (x-y < (#0::hypreal))";
   14.58 +Goal "(x < y) = (x-y < (Numeral0::hypreal))";
   14.59  by (simp_tac (simpset() addsimps [hypreal_diff_less_eq]) 1);   
   14.60  qed "hypreal_less_iff_diff_less_0";
   14.61  
   14.62 -Goal "(x = y) = (x-y = (#0::hypreal))";
   14.63 +Goal "(x = y) = (x-y = (Numeral0::hypreal))";
   14.64  by (simp_tac (simpset() addsimps [hypreal_diff_eq_eq]) 1);   
   14.65  qed "hypreal_eq_iff_diff_eq_0";
   14.66  
   14.67 -Goal "(x <= y) = (x-y <= (#0::hypreal))";
   14.68 +Goal "(x <= y) = (x-y <= (Numeral0::hypreal))";
   14.69  by (simp_tac (simpset() addsimps [hypreal_diff_le_eq]) 1);   
   14.70  qed "hypreal_le_iff_diff_le_0";
   14.71  
   14.72 @@ -242,14 +242,14 @@
   14.73                          hypreal_add_ac@rel_iff_rel_0_rls) 1);
   14.74  qed "hypreal_le_add_iff2";
   14.75  
   14.76 -Goal "(z::hypreal) * #-1 = -z";
   14.77 +Goal "(z::hypreal) * # -1 = -z";
   14.78  by (stac (minus_numeral_one RS sym) 1);
   14.79  by (stac (hypreal_minus_mult_eq2 RS sym) 1); 
   14.80  by Auto_tac;  
   14.81  qed "hypreal_mult_minus_1_right";
   14.82  Addsimps [hypreal_mult_minus_1_right];
   14.83  
   14.84 -Goal "#-1 * (z::hypreal) = -z";
   14.85 +Goal "# -1 * (z::hypreal) = -z";
   14.86  by (simp_tac (simpset() addsimps [hypreal_mult_commute]) 1); 
   14.87  qed "hypreal_mult_minus_1";
   14.88  Addsimps [hypreal_mult_minus_1];
   14.89 @@ -275,7 +275,7 @@
   14.90  
   14.91  val uminus_const = Const ("uminus", hyprealT --> hyprealT);
   14.92  
   14.93 -(*Thus mk_sum[t] yields t+#0; longer sums don't have a trailing zero*)
   14.94 +(*Thus mk_sum[t] yields t+Numeral0; longer sums don't have a trailing zero*)
   14.95  fun mk_sum []        = zero
   14.96    | mk_sum [t,u]     = mk_plus (t, u)
   14.97    | mk_sum (t :: ts) = mk_plus (t, mk_sum ts);
   14.98 @@ -335,7 +335,7 @@
   14.99  	handle TERM _ => find_first_coeff (t::past) u terms;
  14.100  
  14.101  
  14.102 -(*Simplify #1*n and n*#1 to n*)
  14.103 +(*Simplify Numeral1*n and n*Numeral1 to n*)
  14.104  val add_0s = map rename_numerals
  14.105                   [hypreal_add_zero_left, hypreal_add_zero_right];
  14.106  val mult_plus_1s = map rename_numerals
  14.107 @@ -471,7 +471,7 @@
  14.108  structure CombineNumeralsData =
  14.109    struct
  14.110    val add		= op + : int*int -> int 
  14.111 -  val mk_sum    	= long_mk_sum    (*to work for e.g. #2*x + #3*x *)
  14.112 +  val mk_sum    	= long_mk_sum    (*to work for e.g. # 2*x + # 3*x *)
  14.113    val dest_sum		= dest_sum
  14.114    val mk_coeff		= mk_coeff
  14.115    val dest_coeff	= dest_coeff 1
  14.116 @@ -530,34 +530,34 @@
  14.117  set trace_simp;
  14.118  fun test s = (Goal s, by (Simp_tac 1)); 
  14.119  
  14.120 -test "l + #2 + #2 + #2 + (l + #2) + (oo + #2) = (uu::hypreal)";
  14.121 -test "#2*u = (u::hypreal)";
  14.122 -test "(i + j + #12 + (k::hypreal)) - #15 = y";
  14.123 -test "(i + j + #12 + (k::hypreal)) - #5 = y";
  14.124 +test "l + # 2 + # 2 + # 2 + (l + # 2) + (oo + # 2) = (uu::hypreal)";
  14.125 +test "# 2*u = (u::hypreal)";
  14.126 +test "(i + j + # 12 + (k::hypreal)) - # 15 = y";
  14.127 +test "(i + j + # 12 + (k::hypreal)) - # 5 = y";
  14.128  
  14.129  test "y - b < (b::hypreal)";
  14.130 -test "y - (#3*b + c) < (b::hypreal) - #2*c";
  14.131 +test "y - (# 3*b + c) < (b::hypreal) - # 2*c";
  14.132  
  14.133 -test "(#2*x - (u*v) + y) - v*#3*u = (w::hypreal)";
  14.134 -test "(#2*x*u*v + (u*v)*#4 + y) - v*u*#4 = (w::hypreal)";
  14.135 -test "(#2*x*u*v + (u*v)*#4 + y) - v*u = (w::hypreal)";
  14.136 -test "u*v - (x*u*v + (u*v)*#4 + y) = (w::hypreal)";
  14.137 +test "(# 2*x - (u*v) + y) - v*# 3*u = (w::hypreal)";
  14.138 +test "(# 2*x*u*v + (u*v)*# 4 + y) - v*u*# 4 = (w::hypreal)";
  14.139 +test "(# 2*x*u*v + (u*v)*# 4 + y) - v*u = (w::hypreal)";
  14.140 +test "u*v - (x*u*v + (u*v)*# 4 + y) = (w::hypreal)";
  14.141  
  14.142 -test "(i + j + #12 + (k::hypreal)) = u + #15 + y";
  14.143 -test "(i + j*#2 + #12 + (k::hypreal)) = j + #5 + y";
  14.144 +test "(i + j + # 12 + (k::hypreal)) = u + # 15 + y";
  14.145 +test "(i + j*# 2 + # 12 + (k::hypreal)) = j + # 5 + y";
  14.146  
  14.147 -test "#2*y + #3*z + #6*w + #2*y + #3*z + #2*u = #2*y' + #3*z' + #6*w' + #2*y' + #3*z' + u + (vv::hypreal)";
  14.148 +test "# 2*y + # 3*z + # 6*w + # 2*y + # 3*z + # 2*u = # 2*y' + # 3*z' + # 6*w' + # 2*y' + # 3*z' + u + (vv::hypreal)";
  14.149  
  14.150  test "a + -(b+c) + b = (d::hypreal)";
  14.151  test "a + -(b+c) - b = (d::hypreal)";
  14.152  
  14.153  (*negative numerals*)
  14.154 -test "(i + j + #-2 + (k::hypreal)) - (u + #5 + y) = zz";
  14.155 -test "(i + j + #-3 + (k::hypreal)) < u + #5 + y";
  14.156 -test "(i + j + #3 + (k::hypreal)) < u + #-6 + y";
  14.157 -test "(i + j + #-12 + (k::hypreal)) - #15 = y";
  14.158 -test "(i + j + #12 + (k::hypreal)) - #-15 = y";
  14.159 -test "(i + j + #-12 + (k::hypreal)) - #-15 = y";
  14.160 +test "(i + j + # -2 + (k::hypreal)) - (u + # 5 + y) = zz";
  14.161 +test "(i + j + # -3 + (k::hypreal)) < u + # 5 + y";
  14.162 +test "(i + j + # 3 + (k::hypreal)) < u + # -6 + y";
  14.163 +test "(i + j + # -12 + (k::hypreal)) - # 15 = y";
  14.164 +test "(i + j + # 12 + (k::hypreal)) - # -15 = y";
  14.165 +test "(i + j + # -12 + (k::hypreal)) - # -15 = y";
  14.166  *)
  14.167  
  14.168  
    15.1 --- a/src/HOL/Hyperreal/HyperDef.ML	Fri Oct 05 21:50:37 2001 +0200
    15.2 +++ b/src/HOL/Hyperreal/HyperDef.ML	Fri Oct 05 21:52:39 2001 +0200
    15.3 @@ -304,7 +304,7 @@
    15.4  by (asm_full_simp_tac (simpset() addsimps [hypreal_minus_minus]) 1);
    15.5  qed "inj_hypreal_minus";
    15.6  
    15.7 -Goalw [hypreal_zero_def] "-0 = (0::hypreal)";
    15.8 +Goalw [hypreal_zero_def] "- 0 = (0::hypreal)";
    15.9  by (simp_tac (simpset() addsimps [hypreal_minus]) 1);
   15.10  qed "hypreal_minus_zero";
   15.11  Addsimps [hypreal_minus_zero];
   15.12 @@ -622,13 +622,13 @@
   15.13  (**** multiplicative inverse on hypreal ****)
   15.14  
   15.15  Goalw [congruent_def]
   15.16 -  "congruent hyprel (%X. hyprel``{%n. if X n = #0 then #0 else inverse(X n)})";
   15.17 +  "congruent hyprel (%X. hyprel``{%n. if X n = Numeral0 then Numeral0 else inverse(X n)})";
   15.18  by (Auto_tac THEN Ultra_tac 1);
   15.19  qed "hypreal_inverse_congruent";
   15.20  
   15.21  Goalw [hypreal_inverse_def]
   15.22        "inverse (Abs_hypreal(hyprel``{%n. X n})) = \
   15.23 -\      Abs_hypreal(hyprel `` {%n. if X n = #0 then #0 else inverse(X n)})";
   15.24 +\      Abs_hypreal(hyprel `` {%n. if X n = Numeral0 then Numeral0 else inverse(X n)})";
   15.25  by (res_inst_tac [("f","Abs_hypreal")] arg_cong 1);
   15.26  by (simp_tac (simpset() addsimps 
   15.27     [hyprel_in_hypreal RS Abs_hypreal_inverse,
   15.28 @@ -840,8 +840,8 @@
   15.29                           Trichotomy of the hyperreals
   15.30    --------------------------------------------------------------------------------*)
   15.31  
   15.32 -Goalw [hyprel_def] "EX x. x: hyprel `` {%n. #0}";
   15.33 -by (res_inst_tac [("x","%n. #0")] exI 1);
   15.34 +Goalw [hyprel_def] "EX x. x: hyprel `` {%n. Numeral0}";
   15.35 +by (res_inst_tac [("x","%n. Numeral0")] exI 1);
   15.36  by (Step_tac 1);
   15.37  by (auto_tac (claset() addSIs [FreeUltrafilterNat_Nat_set], simpset()));
   15.38  qed "lemma_hyprel_0r_mem";
   15.39 @@ -1101,22 +1101,22 @@
   15.40  (*DON'T insert this or the next one as default simprules.
   15.41    They are used in both orientations and anyway aren't the ones we finally
   15.42    need, which would use binary literals.*)
   15.43 -Goalw [hypreal_of_real_def,hypreal_one_def] "hypreal_of_real  #1 = 1hr";
   15.44 +Goalw [hypreal_of_real_def,hypreal_one_def] "hypreal_of_real  Numeral1 = 1hr";
   15.45  by (Step_tac 1);
   15.46  qed "hypreal_of_real_one";
   15.47  
   15.48 -Goalw [hypreal_of_real_def,hypreal_zero_def] "hypreal_of_real #0 = 0";
   15.49 +Goalw [hypreal_of_real_def,hypreal_zero_def] "hypreal_of_real Numeral0 = 0";
   15.50  by (Step_tac 1);
   15.51  qed "hypreal_of_real_zero";
   15.52  
   15.53 -Goal "(hypreal_of_real r = 0) = (r = #0)";
   15.54 +Goal "(hypreal_of_real r = 0) = (r = Numeral0)";
   15.55  by (auto_tac (claset() addIs [FreeUltrafilterNat_P],
   15.56      simpset() addsimps [hypreal_of_real_def,
   15.57                          hypreal_zero_def,FreeUltrafilterNat_Nat_set]));
   15.58  qed "hypreal_of_real_zero_iff";
   15.59  
   15.60  Goal "hypreal_of_real (inverse r) = inverse (hypreal_of_real r)";
   15.61 -by (case_tac "r=#0" 1);
   15.62 +by (case_tac "r=Numeral0" 1);
   15.63  by (asm_simp_tac (simpset() addsimps [REAL_DIVIDE_ZERO, INVERSE_ZERO, 
   15.64                                HYPREAL_INVERSE_ZERO, hypreal_of_real_zero]) 1);
   15.65  by (res_inst_tac [("c1","hypreal_of_real r")] 
    16.1 --- a/src/HOL/Hyperreal/HyperDef.thy	Fri Oct 05 21:50:37 2001 +0200
    16.2 +++ b/src/HOL/Hyperreal/HyperDef.thy	Fri Oct 05 21:52:39 2001 +0200
    16.3 @@ -35,10 +35,10 @@
    16.4  defs
    16.5  
    16.6    hypreal_zero_def
    16.7 -  "0 == Abs_hypreal(hyprel``{%n::nat. (#0::real)})"
    16.8 +  "0 == Abs_hypreal(hyprel``{%n::nat. (Numeral0::real)})"
    16.9  
   16.10    hypreal_one_def
   16.11 -  "1hr == Abs_hypreal(hyprel``{%n::nat. (#1::real)})"
   16.12 +  "1hr == Abs_hypreal(hyprel``{%n::nat. (Numeral1::real)})"
   16.13  
   16.14    hypreal_minus_def
   16.15    "- P == Abs_hypreal(UN X: Rep_hypreal(P). hyprel``{%n::nat. - (X n)})"
   16.16 @@ -48,7 +48,7 @@
   16.17  
   16.18    hypreal_inverse_def
   16.19    "inverse P == Abs_hypreal(UN X: Rep_hypreal(P). 
   16.20 -                    hyprel``{%n. if X n = #0 then #0 else inverse (X n)})"
   16.21 +                    hyprel``{%n. if X n = Numeral0 then Numeral0 else inverse (X n)})"
   16.22  
   16.23    hypreal_divide_def
   16.24    "P / Q::hypreal == P * inverse Q"
    17.1 --- a/src/HOL/Hyperreal/HyperNat.ML	Fri Oct 05 21:50:37 2001 +0200
    17.2 +++ b/src/HOL/Hyperreal/HyperNat.ML	Fri Oct 05 21:52:39 2001 +0200
    17.3 @@ -682,7 +682,7 @@
    17.4  Goalw [hypnat_one_def,hypnat_zero_def,hypnat_less_def] 
    17.5        "(0::hypnat) < 1hn";
    17.6  by (res_inst_tac [("x","%n. 0")] exI 1);
    17.7 -by (res_inst_tac [("x","%n. 1'")] exI 1);
    17.8 +by (res_inst_tac [("x","%n. Suc 0")] exI 1);
    17.9  by Auto_tac;
   17.10  qed "hypnat_zero_less_one";
   17.11  
   17.12 @@ -806,7 +806,7 @@
   17.13  by Auto_tac;
   17.14  qed "hypnat_of_nat_le_iff";
   17.15  
   17.16 -Goalw [hypnat_of_nat_def,hypnat_one_def] "hypnat_of_nat 1' = 1hn";
   17.17 +Goalw [hypnat_of_nat_def,hypnat_one_def] "hypnat_of_nat (Suc 0) = 1hn";
   17.18  by (Simp_tac 1);
   17.19  qed "hypnat_of_nat_one";
   17.20  
   17.21 @@ -903,7 +903,7 @@
   17.22  qed "SHNat_hypnat_of_nat";
   17.23  Addsimps [SHNat_hypnat_of_nat];
   17.24  
   17.25 -Goal "hypnat_of_nat 1' : Nats";
   17.26 +Goal "hypnat_of_nat (Suc 0) : Nats";
   17.27  by (Simp_tac 1);
   17.28  qed "SHNat_hypnat_of_nat_one";
   17.29  
   17.30 @@ -1246,14 +1246,14 @@
   17.31  Addsimps [hypnat_of_nat_eq_cancel];
   17.32  
   17.33  Goalw [hypnat_zero_def] 
   17.34 -     "hypreal_of_hypnat 0 = #0";
   17.35 +     "hypreal_of_hypnat 0 = Numeral0";
   17.36  by (simp_tac (HOL_ss addsimps
   17.37               [zero_eq_numeral_0 RS sym, hypreal_zero_def]) 1); 
   17.38  by (simp_tac (simpset() addsimps [hypreal_of_hypnat, real_of_nat_zero]) 1);
   17.39  qed "hypreal_of_hypnat_zero";
   17.40  
   17.41  Goalw [hypnat_one_def] 
   17.42 -     "hypreal_of_hypnat 1hn = #1";
   17.43 +     "hypreal_of_hypnat 1hn = Numeral1";
   17.44  by (simp_tac (HOL_ss addsimps
   17.45               [one_eq_numeral_1 RS sym, hypreal_one_def]) 1); 
   17.46  by (simp_tac (simpset() addsimps [hypreal_of_hypnat, real_of_nat_one]) 1);
   17.47 @@ -1283,7 +1283,7 @@
   17.48  qed "hypreal_of_hypnat_less_iff";
   17.49  Addsimps [hypreal_of_hypnat_less_iff];
   17.50  
   17.51 -Goal "(hypreal_of_hypnat N = #0) = (N = 0)";
   17.52 +Goal "(hypreal_of_hypnat N = Numeral0) = (N = 0)";
   17.53  by (simp_tac (simpset() addsimps [hypreal_of_hypnat_zero RS sym]) 1);
   17.54  qed "hypreal_of_hypnat_eq_zero_iff";
   17.55  Addsimps [hypreal_of_hypnat_eq_zero_iff];
    18.1 --- a/src/HOL/Hyperreal/HyperOrd.ML	Fri Oct 05 21:50:37 2001 +0200
    18.2 +++ b/src/HOL/Hyperreal/HyperOrd.ML	Fri Oct 05 21:52:39 2001 +0200
    18.3 @@ -47,7 +47,7 @@
    18.4    val eq_diff_eq	= hypreal_eq_diff_eq
    18.5    val eqI_rules		= [hypreal_less_eqI, hypreal_eq_eqI, hypreal_le_eqI]
    18.6    fun dest_eqI th = 
    18.7 -      #1 (HOLogic.dest_bin "op =" HOLogic.boolT 
    18.8 +      #1 (HOLogic.dest_bin "op =" HOLogic.boolT
    18.9  	      (HOLogic.dest_Trueprop (concl_of th)))
   18.10  
   18.11    val diff_def		= hypreal_diff_def
   18.12 @@ -150,8 +150,8 @@
   18.13  qed "hypreal_mult_less_zero";
   18.14  
   18.15  Goalw [hypreal_one_def,hypreal_zero_def,hypreal_less_def] "0 < 1hr";
   18.16 -by (res_inst_tac [("x","%n. #0")] exI 1);
   18.17 -by (res_inst_tac [("x","%n. #1")] exI 1);
   18.18 +by (res_inst_tac [("x","%n. Numeral0")] exI 1);
   18.19 +by (res_inst_tac [("x","%n. Numeral1")] exI 1);
   18.20  by (auto_tac (claset(),
   18.21          simpset() addsimps [real_zero_less_one, FreeUltrafilterNat_Nat_set]));
   18.22  qed "hypreal_zero_less_one";
    19.1 --- a/src/HOL/Hyperreal/HyperPow.ML	Fri Oct 05 21:50:37 2001 +0200
    19.2 +++ b/src/HOL/Hyperreal/HyperPow.ML	Fri Oct 05 21:52:39 2001 +0200
    19.3 @@ -6,17 +6,17 @@
    19.4  Exponentials on the hyperreals
    19.5  *)
    19.6  
    19.7 -Goal "(#0::hypreal) ^ (Suc n) = 0";
    19.8 +Goal "(Numeral0::hypreal) ^ (Suc n) = 0";
    19.9  by (Auto_tac);
   19.10  qed "hrealpow_zero";
   19.11  Addsimps [hrealpow_zero];
   19.12  
   19.13 -Goal "r ~= (#0::hypreal) --> r ^ n ~= 0";
   19.14 +Goal "r ~= (Numeral0::hypreal) --> r ^ n ~= 0";
   19.15  by (induct_tac "n" 1);
   19.16  by Auto_tac;
   19.17  qed_spec_mp "hrealpow_not_zero";
   19.18  
   19.19 -Goal "r ~= (#0::hypreal) --> inverse(r ^ n) = (inverse r) ^ n";
   19.20 +Goal "r ~= (Numeral0::hypreal) --> inverse(r ^ n) = (inverse r) ^ n";
   19.21  by (induct_tac "n" 1);
   19.22  by (Auto_tac);
   19.23  by (forw_inst_tac [("n","n")] hrealpow_not_zero 1);
   19.24 @@ -33,49 +33,49 @@
   19.25  by (auto_tac (claset(), simpset() addsimps hypreal_mult_ac));
   19.26  qed "hrealpow_add";
   19.27  
   19.28 -Goal "(r::hypreal) ^ 1' = r";
   19.29 +Goal "(r::hypreal) ^ Suc 0 = r";
   19.30  by (Simp_tac 1);
   19.31  qed "hrealpow_one";
   19.32  Addsimps [hrealpow_one];
   19.33  
   19.34 -Goal "(r::hypreal) ^ 2 = r * r";
   19.35 +Goal "(r::hypreal) ^ Suc (Suc 0) = r * r";
   19.36  by (Simp_tac 1);
   19.37  qed "hrealpow_two";
   19.38  
   19.39 -Goal "(#0::hypreal) <= r --> #0 <= r ^ n";
   19.40 +Goal "(Numeral0::hypreal) <= r --> Numeral0 <= r ^ n";
   19.41  by (induct_tac "n" 1);
   19.42  by (auto_tac (claset(), simpset() addsimps [hypreal_0_le_mult_iff]));
   19.43  qed_spec_mp "hrealpow_ge_zero";
   19.44  
   19.45 -Goal "(#0::hypreal) < r --> #0 < r ^ n";
   19.46 +Goal "(Numeral0::hypreal) < r --> Numeral0 < r ^ n";
   19.47  by (induct_tac "n" 1);
   19.48  by (auto_tac (claset(), simpset() addsimps [hypreal_0_less_mult_iff]));
   19.49  qed_spec_mp "hrealpow_gt_zero";
   19.50  
   19.51 -Goal "x <= y & (#0::hypreal) < x --> x ^ n <= y ^ n";
   19.52 +Goal "x <= y & (Numeral0::hypreal) < x --> x ^ n <= y ^ n";
   19.53  by (induct_tac "n" 1);
   19.54  by (auto_tac (claset() addSIs [hypreal_mult_le_mono], simpset()));
   19.55  by (asm_simp_tac (simpset() addsimps [hrealpow_ge_zero]) 1);
   19.56  qed_spec_mp "hrealpow_le";
   19.57  
   19.58 -Goal "x < y & (#0::hypreal) < x & 0 < n --> x ^ n < y ^ n";
   19.59 +Goal "x < y & (Numeral0::hypreal) < x & 0 < n --> x ^ n < y ^ n";
   19.60  by (induct_tac "n" 1);
   19.61  by (auto_tac (claset() addIs [hypreal_mult_less_mono,gr0I],
   19.62                simpset() addsimps [hrealpow_gt_zero]));
   19.63  qed "hrealpow_less";
   19.64  
   19.65 -Goal "#1 ^ n = (#1::hypreal)";
   19.66 +Goal "Numeral1 ^ n = (Numeral1::hypreal)";
   19.67  by (induct_tac "n" 1);
   19.68  by (Auto_tac);
   19.69  qed "hrealpow_eq_one";
   19.70  Addsimps [hrealpow_eq_one];
   19.71  
   19.72 -Goal "abs(-(#1 ^ n)) = (#1::hypreal)";
   19.73 +Goal "abs(-(Numeral1 ^ n)) = (Numeral1::hypreal)";
   19.74  by Auto_tac;  
   19.75  qed "hrabs_minus_hrealpow_one";
   19.76  Addsimps [hrabs_minus_hrealpow_one];
   19.77  
   19.78 -Goal "abs(#-1 ^ n) = (#1::hypreal)";
   19.79 +Goal "abs(# -1 ^ n) = (Numeral1::hypreal)";
   19.80  by (induct_tac "n" 1);
   19.81  by Auto_tac;  
   19.82  qed "hrabs_hrealpow_minus_one";
   19.83 @@ -86,61 +86,61 @@
   19.84  by (auto_tac (claset(), simpset() addsimps hypreal_mult_ac));
   19.85  qed "hrealpow_mult";
   19.86  
   19.87 -Goal "(#0::hypreal) <= r ^ 2";
   19.88 +Goal "(Numeral0::hypreal) <= r ^Suc (Suc 0)";
   19.89  by (auto_tac (claset(), simpset() addsimps [hypreal_0_le_mult_iff]));
   19.90  qed "hrealpow_two_le";
   19.91  Addsimps [hrealpow_two_le];
   19.92  
   19.93 -Goal "(#0::hypreal) <= u ^ 2 + v ^ 2";
   19.94 +Goal "(Numeral0::hypreal) <= u ^ Suc (Suc 0) + v ^ Suc (Suc 0)";
   19.95  by (simp_tac (HOL_ss addsimps [hrealpow_two_le, 
   19.96                      rename_numerals hypreal_le_add_order]) 1); 
   19.97  qed "hrealpow_two_le_add_order";
   19.98  Addsimps [hrealpow_two_le_add_order];
   19.99  
  19.100 -Goal "(#0::hypreal) <= u ^ 2 + v ^ 2 + w ^ 2";
  19.101 +Goal "(Numeral0::hypreal) <= u ^ Suc (Suc 0) + v ^ Suc (Suc 0) + w ^ Suc (Suc 0)";
  19.102  by (simp_tac (HOL_ss addsimps [hrealpow_two_le, 
  19.103                      rename_numerals hypreal_le_add_order]) 1); 
  19.104  qed "hrealpow_two_le_add_order2";
  19.105  Addsimps [hrealpow_two_le_add_order2];
  19.106  
  19.107 -Goal "(x ^ 2 + y ^ 2 + z ^ 2 = (#0::hypreal)) = (x = #0 & y = #0 & z = #0)";
  19.108 +Goal "(x ^ Suc (Suc 0) + y ^ Suc (Suc 0) + z ^ Suc (Suc 0) = (Numeral0::hypreal)) = (x = Numeral0 & y = Numeral0 & z = Numeral0)";
  19.109  by (simp_tac (HOL_ss addsimps
  19.110        [rename_numerals hypreal_three_squares_add_zero_iff, hrealpow_two]) 1);
  19.111  qed "hrealpow_three_squares_add_zero_iff";
  19.112  Addsimps [hrealpow_three_squares_add_zero_iff];
  19.113  
  19.114 -Goal "abs(x ^ 2) = (x::hypreal) ^ 2";
  19.115 +Goal "abs(x ^ Suc (Suc 0)) = (x::hypreal) ^ Suc (Suc 0)";
  19.116  by (auto_tac (claset(), 
  19.117       simpset() addsimps [hrabs_def, hypreal_0_le_mult_iff])); 
  19.118  qed "hrabs_hrealpow_two";
  19.119  Addsimps [hrabs_hrealpow_two];
  19.120  
  19.121 -Goal "abs(x) ^ 2 = (x::hypreal) ^ 2";
  19.122 +Goal "abs(x) ^ Suc (Suc 0) = (x::hypreal) ^ Suc (Suc 0)";
  19.123  by (simp_tac (simpset() addsimps [hrealpow_hrabs, hrabs_eqI1] 
  19.124                          delsimps [hpowr_Suc]) 1);
  19.125  qed "hrealpow_two_hrabs";
  19.126  Addsimps [hrealpow_two_hrabs];
  19.127  
  19.128 -Goal "(#1::hypreal) < r ==> #1 < r ^ 2";
  19.129 +Goal "(Numeral1::hypreal) < r ==> Numeral1 < r ^ Suc (Suc 0)";
  19.130  by (auto_tac (claset(), simpset() addsimps [hrealpow_two]));
  19.131 -by (res_inst_tac [("y","#1*#1")] order_le_less_trans 1); 
  19.132 +by (res_inst_tac [("y","Numeral1*Numeral1")] order_le_less_trans 1); 
  19.133  by (rtac hypreal_mult_less_mono 2); 
  19.134  by Auto_tac;  
  19.135  qed "hrealpow_two_gt_one";
  19.136  
  19.137 -Goal "(#1::hypreal) <= r ==> #1 <= r ^ 2";
  19.138 +Goal "(Numeral1::hypreal) <= r ==> Numeral1 <= r ^ Suc (Suc 0)";
  19.139  by (etac (order_le_imp_less_or_eq RS disjE) 1);
  19.140  by (etac (hrealpow_two_gt_one RS order_less_imp_le) 1);
  19.141  by Auto_tac;  
  19.142  qed "hrealpow_two_ge_one";
  19.143  
  19.144 -Goal "(#1::hypreal) <= #2 ^ n";
  19.145 -by (res_inst_tac [("y","#1 ^ n")] order_trans 1);
  19.146 +Goal "(Numeral1::hypreal) <= # 2 ^ n";
  19.147 +by (res_inst_tac [("y","Numeral1 ^ n")] order_trans 1);
  19.148  by (rtac hrealpow_le 2);
  19.149  by Auto_tac;
  19.150  qed "two_hrealpow_ge_one";
  19.151  
  19.152 -Goal "hypreal_of_nat n < #2 ^ n";
  19.153 +Goal "hypreal_of_nat n < # 2 ^ n";
  19.154  by (induct_tac "n" 1);
  19.155  by (auto_tac (claset(),
  19.156          simpset() addsimps [hypreal_of_nat_Suc, hypreal_add_mult_distrib]));
  19.157 @@ -149,34 +149,34 @@
  19.158  qed "two_hrealpow_gt";
  19.159  Addsimps [two_hrealpow_gt,two_hrealpow_ge_one];
  19.160  
  19.161 -Goal "#-1 ^ (#2*n) = (#1::hypreal)";
  19.162 +Goal "# -1 ^ (# 2*n) = (Numeral1::hypreal)";
  19.163  by (induct_tac "n" 1);
  19.164  by (Auto_tac);
  19.165  qed "hrealpow_minus_one";
  19.166  
  19.167 -Goal "n+n = (#2*n::nat)";
  19.168 +Goal "n+n = (# 2*n::nat)";
  19.169  by Auto_tac; 
  19.170  qed "double_lemma";
  19.171  
  19.172  (*ugh: need to get rid fo the n+n*)
  19.173 -Goal "#-1 ^ (n + n) = (#1::hypreal)";
  19.174 +Goal "# -1 ^ (n + n) = (Numeral1::hypreal)";
  19.175  by (auto_tac (claset(), 
  19.176                simpset() addsimps [double_lemma, hrealpow_minus_one]));
  19.177  qed "hrealpow_minus_one2";
  19.178  Addsimps [hrealpow_minus_one2];
  19.179  
  19.180 -Goal "(-(x::hypreal)) ^ 2 = x ^ 2";
  19.181 +Goal "(-(x::hypreal)) ^ Suc (Suc 0) = x ^ Suc (Suc 0)";
  19.182  by (Auto_tac);
  19.183  qed "hrealpow_minus_two";
  19.184  Addsimps [hrealpow_minus_two];
  19.185  
  19.186 -Goal "(#0::hypreal) < r & r < #1 --> r ^ Suc n < r ^ n";
  19.187 +Goal "(Numeral0::hypreal) < r & r < Numeral1 --> r ^ Suc n < r ^ n";
  19.188  by (induct_tac "n" 1);
  19.189  by (auto_tac (claset(),
  19.190                simpset() addsimps [hypreal_mult_less_mono2]));
  19.191  qed_spec_mp "hrealpow_Suc_less";
  19.192  
  19.193 -Goal "(#0::hypreal) <= r & r < #1 --> r ^ Suc n <= r ^ n";
  19.194 +Goal "(Numeral0::hypreal) <= r & r < Numeral1 --> r ^ Suc n <= r ^ n";
  19.195  by (induct_tac "n" 1);
  19.196  by (auto_tac (claset() addIs [order_less_imp_le]
  19.197                         addSDs [order_le_imp_less_or_eq,hrealpow_Suc_less],
  19.198 @@ -191,8 +191,8 @@
  19.199                                    one_eq_numeral_1 RS sym]));
  19.200  qed "hrealpow";
  19.201  
  19.202 -Goal "(x + (y::hypreal)) ^ 2 = \
  19.203 -\     x ^ 2 + y ^ 2 + (hypreal_of_nat 2)*x*y";
  19.204 +Goal "(x + (y::hypreal)) ^ Suc (Suc 0) = \
  19.205 +\     x ^ Suc (Suc 0) + y ^ Suc (Suc 0) + (hypreal_of_nat (Suc (Suc 0)))*x*y";
  19.206  by (simp_tac (simpset() addsimps
  19.207                [hypreal_add_mult_distrib2, hypreal_add_mult_distrib, 
  19.208                 hypreal_of_nat_zero, hypreal_of_nat_Suc]) 1);
  19.209 @@ -204,7 +204,7 @@
  19.210     property for the real rather than prove it directly 
  19.211     using induction: proof is much simpler this way!
  19.212   ---------------------------------------------------------------*)
  19.213 -Goal "[|(#0::hypreal) <= x; #0 <= y;x ^ Suc n <= y ^ Suc n |] ==> x <= y";
  19.214 +Goal "[|(Numeral0::hypreal) <= x; Numeral0 <= y;x ^ Suc n <= y ^ Suc n |] ==> x <= y";
  19.215  by (full_simp_tac (simpset() addsimps [rename_numerals hypreal_zero_def]) 1);
  19.216  by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
  19.217  by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
  19.218 @@ -241,14 +241,14 @@
  19.219  by (Fuf_tac 1);
  19.220  qed "hyperpow";
  19.221  
  19.222 -Goalw [hypnat_one_def] "(#0::hypreal) pow (n + 1hn) = #0";
  19.223 +Goalw [hypnat_one_def] "(Numeral0::hypreal) pow (n + 1hn) = Numeral0";
  19.224  by (simp_tac (simpset() addsimps [rename_numerals hypreal_zero_def]) 1);
  19.225  by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
  19.226  by (auto_tac (claset(), simpset() addsimps [hyperpow,hypnat_add]));
  19.227  qed "hyperpow_zero";
  19.228  Addsimps [hyperpow_zero];
  19.229  
  19.230 -Goal "r ~= (#0::hypreal) --> r pow n ~= #0";
  19.231 +Goal "r ~= (Numeral0::hypreal) --> r pow n ~= Numeral0";
  19.232  by (simp_tac (simpset() addsimps [rename_numerals hypreal_zero_def]) 1);
  19.233  by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
  19.234  by (res_inst_tac [("z","r")] eq_Abs_hypreal 1);
  19.235 @@ -258,7 +258,7 @@
  19.236      simpset()) 1);
  19.237  qed_spec_mp "hyperpow_not_zero";
  19.238  
  19.239 -Goal "r ~= (#0::hypreal) --> inverse(r pow n) = (inverse r) pow n";
  19.240 +Goal "r ~= (Numeral0::hypreal) --> inverse(r pow n) = (inverse r) pow n";
  19.241  by (simp_tac (simpset() addsimps [rename_numerals hypreal_zero_def]) 1);
  19.242  by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
  19.243  by (res_inst_tac [("z","r")] eq_Abs_hypreal 1);
  19.244 @@ -298,7 +298,7 @@
  19.245                simpset() addsimps [hyperpow,hypnat_add, hypreal_mult]));
  19.246  qed "hyperpow_two";
  19.247  
  19.248 -Goal "(#0::hypreal) < r --> #0 < r pow n";
  19.249 +Goal "(Numeral0::hypreal) < r --> Numeral0 < r pow n";
  19.250  by (simp_tac (simpset() addsimps [rename_numerals hypreal_zero_def]) 1);
  19.251  by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
  19.252  by (res_inst_tac [("z","r")] eq_Abs_hypreal 1);
  19.253 @@ -306,7 +306,7 @@
  19.254                simpset() addsimps [hyperpow,hypreal_less, hypreal_le]));
  19.255  qed_spec_mp "hyperpow_gt_zero";
  19.256  
  19.257 -Goal "(#0::hypreal) <= r --> #0 <= r pow n";
  19.258 +Goal "(Numeral0::hypreal) <= r --> Numeral0 <= r pow n";
  19.259  by (simp_tac (simpset() addsimps [rename_numerals hypreal_zero_def]) 1);
  19.260  by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
  19.261  by (res_inst_tac [("z","r")] eq_Abs_hypreal 1);
  19.262 @@ -314,7 +314,7 @@
  19.263                simpset() addsimps [hyperpow,hypreal_le]));
  19.264  qed "hyperpow_ge_zero";
  19.265  
  19.266 -Goal "(#0::hypreal) < x & x <= y --> x pow n <= y pow n";
  19.267 +Goal "(Numeral0::hypreal) < x & x <= y --> x pow n <= y pow n";
  19.268  by (full_simp_tac (simpset() addsimps [rename_numerals hypreal_zero_def]) 1);
  19.269  by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
  19.270  by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
  19.271 @@ -326,22 +326,22 @@
  19.272  by (auto_tac (claset() addIs [realpow_le], simpset()));
  19.273  qed_spec_mp "hyperpow_le";
  19.274  
  19.275 -Goal "#1 pow n = (#1::hypreal)";
  19.276 +Goal "Numeral1 pow n = (Numeral1::hypreal)";
  19.277  by (simp_tac (HOL_ss addsimps [one_eq_numeral_1 RS sym, hypreal_one_def]) 1);
  19.278  by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
  19.279  by (auto_tac (claset(), simpset() addsimps [hyperpow]));
  19.280  qed "hyperpow_eq_one";
  19.281  Addsimps [hyperpow_eq_one];
  19.282  
  19.283 -Goal "abs(-(#1 pow n)) = (#1::hypreal)";
  19.284 +Goal "abs(-(Numeral1 pow n)) = (Numeral1::hypreal)";
  19.285  by (simp_tac (HOL_ss addsimps [one_eq_numeral_1 RS sym, hypreal_one_def]) 1);
  19.286  by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
  19.287  by (auto_tac (claset(), simpset() addsimps [hyperpow,hypreal_hrabs]));
  19.288  qed "hrabs_minus_hyperpow_one";
  19.289  Addsimps [hrabs_minus_hyperpow_one];
  19.290  
  19.291 -Goal "abs(#-1 pow n) = (#1::hypreal)";
  19.292 -by (subgoal_tac "abs((-1hr) pow n) = 1hr" 1);
  19.293 +Goal "abs(# -1 pow n) = (Numeral1::hypreal)";
  19.294 +by (subgoal_tac "abs((- 1hr) pow n) = 1hr" 1);
  19.295  by (Asm_full_simp_tac 1); 
  19.296  by (simp_tac (HOL_ss addsimps [hypreal_one_def]) 1);
  19.297  by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
  19.298 @@ -358,7 +358,7 @@
  19.299         simpset() addsimps [hyperpow, hypreal_mult,realpow_mult]));
  19.300  qed "hyperpow_mult";
  19.301  
  19.302 -Goal "(#0::hypreal) <= r pow (1hn + 1hn)";
  19.303 +Goal "(Numeral0::hypreal) <= r pow (1hn + 1hn)";
  19.304  by (auto_tac (claset(), 
  19.305                simpset() addsimps [hyperpow_two, hypreal_0_le_mult_iff]));
  19.306  qed "hyperpow_two_le";
  19.307 @@ -375,21 +375,21 @@
  19.308  Addsimps [hyperpow_two_hrabs];
  19.309  
  19.310  (*? very similar to hrealpow_two_gt_one *)
  19.311 -Goal "(#1::hypreal) < r ==> #1 < r pow (1hn + 1hn)";
  19.312 +Goal "(Numeral1::hypreal) < r ==> Numeral1 < r pow (1hn + 1hn)";
  19.313  by (auto_tac (claset(), simpset() addsimps [hyperpow_two]));
  19.314 -by (res_inst_tac [("y","#1*#1")] order_le_less_trans 1); 
  19.315 +by (res_inst_tac [("y","Numeral1*Numeral1")] order_le_less_trans 1); 
  19.316  by (rtac hypreal_mult_less_mono 2); 
  19.317  by Auto_tac;  
  19.318  qed "hyperpow_two_gt_one";
  19.319  
  19.320 -Goal "(#1::hypreal) <= r ==> #1 <= r pow (1hn + 1hn)";
  19.321 +Goal "(Numeral1::hypreal) <= r ==> Numeral1 <= r pow (1hn + 1hn)";
  19.322  by (auto_tac (claset() addSDs [order_le_imp_less_or_eq] 
  19.323                         addIs [hyperpow_two_gt_one,order_less_imp_le],
  19.324                simpset()));
  19.325  qed "hyperpow_two_ge_one";
  19.326  
  19.327 -Goal "(#1::hypreal) <= #2 pow n";
  19.328 -by (res_inst_tac [("y","#1 pow n")] order_trans 1);
  19.329 +Goal "(Numeral1::hypreal) <= # 2 pow n";
  19.330 +by (res_inst_tac [("y","Numeral1 pow n")] order_trans 1);
  19.331  by (rtac hyperpow_le 2);
  19.332  by Auto_tac;
  19.333  qed "two_hyperpow_ge_one";
  19.334 @@ -397,7 +397,7 @@
  19.335  
  19.336  Addsimps [simplify (simpset()) realpow_minus_one];
  19.337  
  19.338 -Goal "#-1 pow ((1hn + 1hn)*n) = (#1::hypreal)";
  19.339 +Goal "# -1 pow ((1hn + 1hn)*n) = (Numeral1::hypreal)";
  19.340  by (subgoal_tac "(-(1hr)) pow ((1hn + 1hn)*n) = 1hr" 1);
  19.341  by (Asm_full_simp_tac 1); 
  19.342  by (simp_tac (HOL_ss addsimps [hypreal_one_def]) 1);
  19.343 @@ -409,7 +409,7 @@
  19.344  Addsimps [hyperpow_minus_one2];
  19.345  
  19.346  Goalw [hypnat_one_def]
  19.347 -     "(#0::hypreal) < r & r < #1 --> r pow (n + 1hn) < r pow n";
  19.348 +     "(Numeral0::hypreal) < r & r < Numeral1 --> r pow (n + 1hn) < r pow n";
  19.349  by (full_simp_tac
  19.350      (HOL_ss addsimps [zero_eq_numeral_0 RS sym, hypreal_zero_def,
  19.351                        one_eq_numeral_1 RS sym, hypreal_one_def]) 1);
  19.352 @@ -421,7 +421,7 @@
  19.353  qed_spec_mp "hyperpow_Suc_less";
  19.354  
  19.355  Goalw [hypnat_one_def]
  19.356 -     "#0 <= r & r < (#1::hypreal) --> r pow (n + 1hn) <= r pow n";
  19.357 +     "Numeral0 <= r & r < (Numeral1::hypreal) --> r pow (n + 1hn) <= r pow n";
  19.358  by (full_simp_tac
  19.359      (HOL_ss addsimps [zero_eq_numeral_0 RS sym, hypreal_zero_def,
  19.360                        one_eq_numeral_1 RS sym, hypreal_one_def]) 1);
  19.361 @@ -434,7 +434,7 @@
  19.362  qed_spec_mp "hyperpow_Suc_le";
  19.363  
  19.364  Goalw [hypnat_one_def]
  19.365 -     "(#0::hypreal) <= r & r < #1 & n < N --> r pow N <= r pow n";
  19.366 +     "(Numeral0::hypreal) <= r & r < Numeral1 & n < N --> r pow N <= r pow n";
  19.367  by (full_simp_tac
  19.368      (HOL_ss addsimps [zero_eq_numeral_0 RS sym, hypreal_zero_def,
  19.369                        one_eq_numeral_1 RS sym, hypreal_one_def]) 1);
  19.370 @@ -449,12 +449,12 @@
  19.371      simpset()));
  19.372  qed_spec_mp "hyperpow_less_le";
  19.373  
  19.374 -Goal "[| (#0::hypreal) <= r; r < #1 |]  \
  19.375 +Goal "[| (Numeral0::hypreal) <= r; r < Numeral1 |]  \
  19.376  \     ==> ALL N n. n < N --> r pow N <= r pow n";
  19.377  by (blast_tac (claset() addSIs [hyperpow_less_le]) 1);
  19.378  qed "hyperpow_less_le2";
  19.379  
  19.380 -Goal "[| #0 <= r;  r < (#1::hypreal);  N : HNatInfinite |]  \
  19.381 +Goal "[| Numeral0 <= r;  r < (Numeral1::hypreal);  N : HNatInfinite |]  \
  19.382  \     ==> ALL n: Nats. r pow N <= r pow n";
  19.383  by (auto_tac (claset() addSIs [hyperpow_less_le],
  19.384                simpset() addsimps [HNatInfinite_iff]));
  19.385 @@ -471,23 +471,23 @@
  19.386  qed "hyperpow_SReal";
  19.387  Addsimps [hyperpow_SReal];
  19.388  
  19.389 -Goal "N : HNatInfinite ==> (#0::hypreal) pow N = 0";
  19.390 +Goal "N : HNatInfinite ==> (Numeral0::hypreal) pow N = 0";
  19.391  by (dtac HNatInfinite_is_Suc 1);
  19.392  by (Auto_tac);
  19.393  qed "hyperpow_zero_HNatInfinite";
  19.394  Addsimps [hyperpow_zero_HNatInfinite];
  19.395  
  19.396 -Goal "[| (#0::hypreal) <= r; r < #1; n <= N |] ==> r pow N <= r pow n";
  19.397 +Goal "[| (Numeral0::hypreal) <= r; r < Numeral1; n <= N |] ==> r pow N <= r pow n";
  19.398  by (dres_inst_tac [("y","N")] hypnat_le_imp_less_or_eq 1);
  19.399  by (auto_tac (claset() addIs [hyperpow_less_le], simpset()));
  19.400  qed "hyperpow_le_le";
  19.401  
  19.402 -Goal "[| (#0::hypreal) < r; r < #1 |] ==> r pow (n + 1hn) <= r";
  19.403 +Goal "[| (Numeral0::hypreal) < r; r < Numeral1 |] ==> r pow (n + 1hn) <= r";
  19.404  by (dres_inst_tac [("n","1hn")] (order_less_imp_le RS hyperpow_le_le) 1);
  19.405  by (Auto_tac);
  19.406  qed "hyperpow_Suc_le_self";
  19.407  
  19.408 -Goal "[| (#0::hypreal) <= r; r < #1 |] ==> r pow (n + 1hn) <= r";
  19.409 +Goal "[| (Numeral0::hypreal) <= r; r < Numeral1 |] ==> r pow (n + 1hn) <= r";
  19.410  by (dres_inst_tac [("n","1hn")] hyperpow_le_le 1);
  19.411  by (Auto_tac);
  19.412  qed "hyperpow_Suc_le_self2";
    20.1 --- a/src/HOL/Hyperreal/Lim.ML	Fri Oct 05 21:50:37 2001 +0200
    20.2 +++ b/src/HOL/Hyperreal/Lim.ML	Fri Oct 05 21:52:39 2001 +0200
    20.3 @@ -29,7 +29,7 @@
    20.4  Goalw [LIM_def] 
    20.5       "[| f -- x --> l; g -- x --> m |] ==> (%x. f(x) + g(x)) -- x --> (l + m)";
    20.6  by (Clarify_tac 1);
    20.7 -by (REPEAT(dres_inst_tac [("x","r/#2")] spec 1));
    20.8 +by (REPEAT(dres_inst_tac [("x","r/# 2")] spec 1));
    20.9  by (Asm_full_simp_tac 1);
   20.10  by (Clarify_tac 1);
   20.11  by (res_inst_tac [("R1.0","s"),("R2.0","sa")] 
   20.12 @@ -65,7 +65,7 @@
   20.13  (*----------------------------------------------
   20.14       LIM_zero
   20.15   ----------------------------------------------*)
   20.16 -Goal "f -- a --> l ==> (%x. f(x) + -l) -- a --> #0";
   20.17 +Goal "f -- a --> l ==> (%x. f(x) + -l) -- a --> Numeral0";
   20.18  by (res_inst_tac [("z1","l")] (rename_numerals (real_add_minus RS subst)) 1);
   20.19  by (rtac LIM_add_minus 1 THEN Auto_tac);
   20.20  qed "LIM_zero";
   20.21 @@ -73,8 +73,8 @@
   20.22  (*--------------------------
   20.23     Limit not zero
   20.24   --------------------------*)
   20.25 -Goalw [LIM_def] "k \\<noteq> #0 ==> ~ ((%x. k) -- x --> #0)";
   20.26 -by (res_inst_tac [("R1.0","k"),("R2.0","#0")] real_linear_less2 1);
   20.27 +Goalw [LIM_def] "k \\<noteq> Numeral0 ==> ~ ((%x. k) -- x --> Numeral0)";
   20.28 +by (res_inst_tac [("R1.0","k"),("R2.0","Numeral0")] real_linear_less2 1);
   20.29  by (auto_tac (claset(), simpset() addsimps [real_abs_def]));
   20.30  by (res_inst_tac [("x","-k")] exI 1);
   20.31  by (res_inst_tac [("x","k")] exI 2);
   20.32 @@ -85,7 +85,7 @@
   20.33  by Auto_tac;  
   20.34  qed "LIM_not_zero";
   20.35  
   20.36 -(* [| k \\<noteq> #0; (%x. k) -- x --> #0 |] ==> R *)
   20.37 +(* [| k \\<noteq> Numeral0; (%x. k) -- x --> Numeral0 |] ==> R *)
   20.38  bind_thm("LIM_not_zeroE", LIM_not_zero RS notE);
   20.39  
   20.40  Goal "(%x. k) -- x --> L ==> k = L";
   20.41 @@ -108,9 +108,9 @@
   20.42      LIM_mult_zero
   20.43   -------------*)
   20.44  Goalw [LIM_def]
   20.45 -     "[| f -- x --> #0; g -- x --> #0 |] ==> (%x. f(x)*g(x)) -- x --> #0";
   20.46 +     "[| f -- x --> Numeral0; g -- x --> Numeral0 |] ==> (%x. f(x)*g(x)) -- x --> Numeral0";
   20.47  by Safe_tac;
   20.48 -by (dres_inst_tac [("x","#1")] spec 1);
   20.49 +by (dres_inst_tac [("x","Numeral1")] spec 1);
   20.50  by (dres_inst_tac [("x","r")] spec 1);
   20.51  by (cut_facts_tac [real_zero_less_one] 1);
   20.52  by (asm_full_simp_tac (simpset() addsimps 
   20.53 @@ -146,7 +146,7 @@
   20.54  by (auto_tac (claset(), simpset() addsimps [real_add_minus_iff]));
   20.55  qed "LIM_equal";
   20.56  
   20.57 -Goal "[| (%x. f(x) + -g(x)) -- a --> #0;  g -- a --> l |] \
   20.58 +Goal "[| (%x. f(x) + -g(x)) -- a --> Numeral0;  g -- a --> l |] \
   20.59  \     ==> f -- a --> l";
   20.60  by (dtac LIM_add 1 THEN assume_tac 1);
   20.61  by (auto_tac (claset(), simpset() addsimps [real_add_assoc]));
   20.62 @@ -181,7 +181,7 @@
   20.63      Limit: NS definition ==> standard definition
   20.64   ---------------------------------------------------------------------*)
   20.65  
   20.66 -Goal "\\<forall>s. #0 < s --> (\\<exists>xa.  xa \\<noteq> x & \
   20.67 +Goal "\\<forall>s. Numeral0 < s --> (\\<exists>xa.  xa \\<noteq> x & \
   20.68  \        abs (xa + - x) < s  & r \\<le> abs (f xa + -L)) \
   20.69  \     ==> \\<forall>n::nat. \\<exists>xa.  xa \\<noteq> x & \
   20.70  \             abs(xa + -x) < inverse(real(Suc n)) & r \\<le> abs(f xa + -L)";
   20.71 @@ -191,7 +191,7 @@
   20.72  by Auto_tac;
   20.73  val lemma_LIM = result();
   20.74  
   20.75 -Goal "\\<forall>s. #0 < s --> (\\<exists>xa.  xa \\<noteq> x & \
   20.76 +Goal "\\<forall>s. Numeral0 < s --> (\\<exists>xa.  xa \\<noteq> x & \
   20.77  \        abs (xa + - x) < s  & r \\<le> abs (f xa + -L)) \
   20.78  \     ==> \\<exists>X. \\<forall>n::nat. X n \\<noteq> x & \
   20.79  \               abs(X n + -x) < inverse(real(Suc n)) & r \\<le> abs(f (X n) + -L)";
   20.80 @@ -320,7 +320,7 @@
   20.81      NSLIM_inverse
   20.82   -----------------------------*)
   20.83  Goalw [NSLIM_def] 
   20.84 -     "[| f -- a --NS> L;  L \\<noteq> #0 |] \
   20.85 +     "[| f -- a --NS> L;  L \\<noteq> Numeral0 |] \
   20.86  \     ==> (%x. inverse(f(x))) -- a --NS> (inverse L)";
   20.87  by (Clarify_tac 1);
   20.88  by (dtac spec 1);
   20.89 @@ -329,28 +329,28 @@
   20.90  qed "NSLIM_inverse";
   20.91  
   20.92  Goal "[| f -- a --> L; \
   20.93 -\        L \\<noteq> #0 |] ==> (%x. inverse(f(x))) -- a --> (inverse L)";
   20.94 +\        L \\<noteq> Numeral0 |] ==> (%x. inverse(f(x))) -- a --> (inverse L)";
   20.95  by (asm_full_simp_tac (simpset() addsimps [LIM_NSLIM_iff, NSLIM_inverse]) 1);
   20.96  qed "LIM_inverse";
   20.97  
   20.98  (*------------------------------
   20.99      NSLIM_zero
  20.100   ------------------------------*)
  20.101 -Goal "f -- a --NS> l ==> (%x. f(x) + -l) -- a --NS> #0";
  20.102 +Goal "f -- a --NS> l ==> (%x. f(x) + -l) -- a --NS> Numeral0";
  20.103  by (res_inst_tac [("z1","l")] (rename_numerals (real_add_minus RS subst)) 1);
  20.104  by (rtac NSLIM_add_minus 1 THEN Auto_tac);
  20.105  qed "NSLIM_zero";
  20.106  
  20.107 -Goal "f -- a --> l ==> (%x. f(x) + -l) -- a --> #0";
  20.108 +Goal "f -- a --> l ==> (%x. f(x) + -l) -- a --> Numeral0";
  20.109  by (asm_full_simp_tac (simpset() addsimps [LIM_NSLIM_iff, NSLIM_zero]) 1);
  20.110  qed "LIM_zero2";
  20.111  
  20.112 -Goal "(%x. f(x) - l) -- x --NS> #0 ==> f -- x --NS> l";
  20.113 +Goal "(%x. f(x) - l) -- x --NS> Numeral0 ==> f -- x --NS> l";
  20.114  by (dres_inst_tac [("g","%x. l"),("m","l")] NSLIM_add 1);
  20.115  by (auto_tac (claset(),simpset() addsimps [real_diff_def, real_add_assoc]));
  20.116  qed "NSLIM_zero_cancel";
  20.117  
  20.118 -Goal "(%x. f(x) - l) -- x --> #0 ==> f -- x --> l";
  20.119 +Goal "(%x. f(x) - l) -- x --> Numeral0 ==> f -- x --> l";
  20.120  by (dres_inst_tac [("g","%x. l"),("m","l")] LIM_add 1);
  20.121  by (auto_tac (claset(),simpset() addsimps [real_diff_def, real_add_assoc]));
  20.122  qed "LIM_zero_cancel";
  20.123 @@ -359,17 +359,17 @@
  20.124  (*--------------------------
  20.125     NSLIM_not_zero
  20.126   --------------------------*)
  20.127 -Goalw [NSLIM_def] "k \\<noteq> #0 ==> ~ ((%x. k) -- x --NS> #0)";
  20.128 +Goalw [NSLIM_def] "k \\<noteq> Numeral0 ==> ~ ((%x. k) -- x --NS> Numeral0)";
  20.129  by Auto_tac;
  20.130  by (res_inst_tac [("x","hypreal_of_real x + epsilon")] exI 1);
  20.131  by (auto_tac (claset() addIs [Infinitesimal_add_approx_self RS approx_sym],
  20.132                simpset() addsimps [rename_numerals hypreal_epsilon_not_zero]));
  20.133  qed "NSLIM_not_zero";
  20.134  
  20.135 -(* [| k \\<noteq> #0; (%x. k) -- x --NS> #0 |] ==> R *)
  20.136 +(* [| k \\<noteq> Numeral0; (%x. k) -- x --NS> Numeral0 |] ==> R *)
  20.137  bind_thm("NSLIM_not_zeroE", NSLIM_not_zero RS notE);
  20.138  
  20.139 -Goal "k \\<noteq> #0 ==> ~ ((%x. k) -- x --> #0)";
  20.140 +Goal "k \\<noteq> Numeral0 ==> ~ ((%x. k) -- x --> Numeral0)";
  20.141  by (asm_full_simp_tac (simpset() addsimps [LIM_NSLIM_iff, NSLIM_not_zero]) 1);
  20.142  qed "LIM_not_zero2";
  20.143  
  20.144 @@ -405,16 +405,16 @@
  20.145  (*--------------------
  20.146      NSLIM_mult_zero
  20.147   --------------------*)
  20.148 -Goal "[| f -- x --NS> #0; g -- x --NS> #0 |] \
  20.149 -\         ==> (%x. f(x)*g(x)) -- x --NS> #0";
  20.150 +Goal "[| f -- x --NS> Numeral0; g -- x --NS> Numeral0 |] \
  20.151 +\         ==> (%x. f(x)*g(x)) -- x --NS> Numeral0";
  20.152  by (dtac NSLIM_mult 1 THEN Auto_tac);
  20.153  qed "NSLIM_mult_zero";
  20.154  
  20.155  (* we can use the corresponding thm LIM_mult2 *)
  20.156  (* for standard definition of limit           *)
  20.157  
  20.158 -Goal "[| f -- x --> #0; g -- x --> #0 |] \
  20.159 -\     ==> (%x. f(x)*g(x)) -- x --> #0";
  20.160 +Goal "[| f -- x --> Numeral0; g -- x --> Numeral0 |] \
  20.161 +\     ==> (%x. f(x)*g(x)) -- x --> Numeral0";
  20.162  by (dtac LIM_mult2 1 THEN Auto_tac);
  20.163  qed "LIM_mult_zero2";
  20.164  
  20.165 @@ -499,7 +499,7 @@
  20.166   --------------------------------------------------------------------------*)
  20.167  (* Prove equivalence between NS limits - *)
  20.168  (* seems easier than using standard def  *)
  20.169 -Goalw [NSLIM_def] "(f -- a --NS> L) = ((%h. f(a + h)) -- #0 --NS> L)";
  20.170 +Goalw [NSLIM_def] "(f -- a --NS> L) = ((%h. f(a + h)) -- Numeral0 --NS> L)";
  20.171  by (auto_tac (claset(),simpset() addsimps [hypreal_of_real_zero]));
  20.172  by (dres_inst_tac [("x","hypreal_of_real a + x")] spec 1);
  20.173  by (dres_inst_tac [("x","-hypreal_of_real a + x")] spec 2);
  20.174 @@ -516,15 +516,15 @@
  20.175                hypreal_add, real_add_assoc, approx_refl, hypreal_zero_def]));
  20.176  qed "NSLIM_h_iff";
  20.177  
  20.178 -Goal "(f -- a --NS> f a) = ((%h. f(a + h)) -- #0 --NS> f a)";
  20.179 +Goal "(f -- a --NS> f a) = ((%h. f(a + h)) -- Numeral0 --NS> f a)";
  20.180  by (rtac NSLIM_h_iff 1);
  20.181  qed "NSLIM_isCont_iff";
  20.182  
  20.183 -Goal "(f -- a --> f a) = ((%h. f(a + h)) -- #0 --> f(a))";
  20.184 +Goal "(f -- a --> f a) = ((%h. f(a + h)) -- Numeral0 --> f(a))";
  20.185  by (simp_tac (simpset() addsimps [LIM_NSLIM_iff, NSLIM_isCont_iff]) 1);
  20.186  qed "LIM_isCont_iff";
  20.187  
  20.188 -Goalw [isCont_def] "(isCont f x) = ((%h. f(x + h)) -- #0 --> f(x))";
  20.189 +Goalw [isCont_def] "(isCont f x) = ((%h. f(x + h)) -- Numeral0 --> f(x))";
  20.190  by (simp_tac (simpset() addsimps [LIM_isCont_iff]) 1);
  20.191  qed "isCont_iff";
  20.192  
  20.193 @@ -574,11 +574,11 @@
  20.194  qed "isCont_minus";
  20.195  
  20.196  Goalw [isCont_def]  
  20.197 -      "[| isCont f x; f x \\<noteq> #0 |] ==> isCont (%x. inverse (f x)) x";
  20.198 +      "[| isCont f x; f x \\<noteq> Numeral0 |] ==> isCont (%x. inverse (f x)) x";
  20.199  by (blast_tac (claset() addIs [LIM_inverse]) 1);
  20.200  qed "isCont_inverse";
  20.201  
  20.202 -Goal "[| isNSCont f x; f x \\<noteq> #0 |] ==> isNSCont (%x. inverse (f x)) x";
  20.203 +Goal "[| isNSCont f x; f x \\<noteq> Numeral0 |] ==> isNSCont (%x. inverse (f x)) x";
  20.204  by (auto_tac (claset() addIs [isCont_inverse],simpset() addsimps 
  20.205      [isNSCont_isCont_iff]));
  20.206  qed "isNSCont_inverse";
  20.207 @@ -690,7 +690,7 @@
  20.208  by (Ultra_tac 1);
  20.209  qed "isUCont_isNSUCont";
  20.210  
  20.211 -Goal "\\<forall>s. #0 < s --> (\\<exists>z y. abs (z + - y) < s & r \\<le> abs (f z + -f y)) \
  20.212 +Goal "\\<forall>s. Numeral0 < s --> (\\<exists>z y. abs (z + - y) < s & r \\<le> abs (f z + -f y)) \
  20.213  \     ==> \\<forall>n::nat. \\<exists>z y.  \
  20.214  \              abs(z + -y) < inverse(real(Suc n)) & \
  20.215  \              r \\<le> abs(f z + -f y)";
  20.216 @@ -700,7 +700,7 @@
  20.217  by Auto_tac;
  20.218  val lemma_LIMu = result();
  20.219  
  20.220 -Goal "\\<forall>s. #0 < s --> (\\<exists>z y. abs (z + - y) < s  & r \\<le> abs (f z + -f y)) \
  20.221 +Goal "\\<forall>s. Numeral0 < s --> (\\<exists>z y. abs (z + - y) < s  & r \\<le> abs (f z + -f y)) \
  20.222  \     ==> \\<exists>X Y. \\<forall>n::nat. \
  20.223  \              abs(X n + -(Y n)) < inverse(real(Suc n)) & \
  20.224  \              r \\<le> abs(f (X n) + -f (Y n))";
  20.225 @@ -745,23 +745,23 @@
  20.226                           Derivatives
  20.227   ------------------------------------------------------------------*)
  20.228  Goalw [deriv_def] 
  20.229 -      "(DERIV f x :> D) = ((%h. (f(x + h) + - f(x))/h) -- #0 --> D)";
  20.230 +      "(DERIV f x :> D) = ((%h. (f(x + h) + - f(x))/h) -- Numeral0 --> D)";
  20.231  by (Blast_tac 1);        
  20.232  qed "DERIV_iff";
  20.233  
  20.234  Goalw [deriv_def] 
  20.235 -      "(DERIV f x :> D) = ((%h. (f(x + h) + - f(x))/h) -- #0 --NS> D)";
  20.236 +      "(DERIV f x :> D) = ((%h. (f(x + h) + - f(x))/h) -- Numeral0 --NS> D)";
  20.237  by (simp_tac (simpset() addsimps [LIM_NSLIM_iff]) 1);
  20.238  qed "DERIV_NS_iff";
  20.239  
  20.240  Goalw [deriv_def] 
  20.241        "DERIV f x :> D \
  20.242 -\      ==> (%h. (f(x + h) + - f(x))/h) -- #0 --> D";
  20.243 +\      ==> (%h. (f(x + h) + - f(x))/h) -- Numeral0 --> D";
  20.244  by (Blast_tac 1);        
  20.245  qed "DERIVD";
  20.246  
  20.247  Goalw [deriv_def] "DERIV f x :> D ==> \
  20.248 -\          (%h. (f(x + h) + - f(x))/h) -- #0 --NS> D";
  20.249 +\          (%h. (f(x + h) + - f(x))/h) -- Numeral0 --NS> D";
  20.250  by (asm_full_simp_tac (simpset() addsimps [LIM_NSLIM_iff]) 1);
  20.251  qed "NS_DERIVD";
  20.252  
  20.253 @@ -809,7 +809,7 @@
  20.254   -------------------------------------------------------*)
  20.255  
  20.256  Goalw [LIM_def] 
  20.257 - "((%h. (f(a + h) + - f(a))/h) -- #0 --> D) = \
  20.258 + "((%h. (f(a + h) + - f(a))/h) -- Numeral0 --> D) = \
  20.259  \ ((%x. (f(x) + -f(a)) / (x + -a)) -- a --> D)";
  20.260  by Safe_tac;
  20.261  by (ALLGOALS(dtac spec));
  20.262 @@ -836,7 +836,7 @@
  20.263  
  20.264  (*--- first equivalence ---*)
  20.265  Goalw [nsderiv_def,NSLIM_def] 
  20.266 -      "(NSDERIV f x :> D) = ((%h. (f(x + h) + - f(x))/h) -- #0 --NS> D)";
  20.267 +      "(NSDERIV f x :> D) = ((%h. (f(x + h) + - f(x))/h) -- Numeral0 --NS> D)";
  20.268  by (auto_tac (claset(), simpset() addsimps [hypreal_of_real_zero]));
  20.269  by (dres_inst_tac [("x","xa")] bspec 1);
  20.270  by (rtac ccontr 3);
  20.271 @@ -956,12 +956,12 @@
  20.272   ------------------------*)
  20.273  
  20.274  (* use simple constant nslimit theorem *)
  20.275 -Goal "(NSDERIV (%x. k) x :> #0)";
  20.276 +Goal "(NSDERIV (%x. k) x :> Numeral0)";
  20.277  by (simp_tac (simpset() addsimps [NSDERIV_NSLIM_iff]) 1);
  20.278  qed "NSDERIV_const";
  20.279  Addsimps [NSDERIV_const];
  20.280  
  20.281 -Goal "(DERIV (%x. k) x :> #0)";
  20.282 +Goal "(DERIV (%x. k) x :> Numeral0)";
  20.283  by (simp_tac (simpset() addsimps [NSDERIV_DERIV_iff RS sym]) 1);
  20.284  qed "DERIV_const";
  20.285  Addsimps [DERIV_const];
  20.286 @@ -1000,7 +1000,7 @@
  20.287  
  20.288  Goal "[| (x + y) / z = hypreal_of_real D + yb; z \\<noteq> 0; \
  20.289  \        z \\<in> Infinitesimal; yb \\<in> Infinitesimal |] \
  20.290 -\     ==> x + y \\<approx> #0";
  20.291 +\     ==> x + y \\<approx> Numeral0";
  20.292  by (forw_inst_tac [("c1","z")] (hypreal_mult_right_cancel RS iffD2) 1 
  20.293      THEN assume_tac 1);
  20.294  by (thin_tac "(x + y) / z = hypreal_of_real D + yb" 1);
  20.295 @@ -1127,7 +1127,7 @@
  20.296  qed "incrementI2";
  20.297  
  20.298  (* The Increment theorem -- Keisler p. 65 *)
  20.299 -Goal "[| NSDERIV f x :> D; h \\<in> Infinitesimal; h \\<noteq> #0 |] \
  20.300 +Goal "[| NSDERIV f x :> D; h \\<in> Infinitesimal; h \\<noteq> Numeral0 |] \
  20.301  \     ==> \\<exists>e \\<in> Infinitesimal. increment f x h = hypreal_of_real(D)*h + e*h";
  20.302  by (forw_inst_tac [("h","h")] incrementI2 1 THEN rewtac nsderiv_def);
  20.303  by (dtac bspec 1 THEN Auto_tac);
  20.304 @@ -1143,15 +1143,15 @@
  20.305                simpset() addsimps [hypreal_add_mult_distrib]));
  20.306  qed "increment_thm";
  20.307  
  20.308 -Goal "[| NSDERIV f x :> D; h \\<approx> #0; h \\<noteq> #0 |] \
  20.309 +Goal "[| NSDERIV f x :> D; h \\<approx> Numeral0; h \\<noteq> Numeral0 |] \
  20.310  \     ==> \\<exists>e \\<in> Infinitesimal. increment f x h = \
  20.311  \             hypreal_of_real(D)*h + e*h";
  20.312  by (blast_tac (claset() addSDs [mem_infmal_iff RS iffD2] 
  20.313                          addSIs [increment_thm]) 1);
  20.314  qed "increment_thm2";
  20.315  
  20.316 -Goal "[| NSDERIV f x :> D; h \\<approx> #0; h \\<noteq> #0 |] \
  20.317 -\     ==> increment f x h \\<approx> #0";
  20.318 +Goal "[| NSDERIV f x :> D; h \\<approx> Numeral0; h \\<noteq> Numeral0 |] \
  20.319 +\     ==> increment f x h \\<approx> Numeral0";
  20.320  by (dtac increment_thm2 1 THEN auto_tac (claset() addSIs 
  20.321      [Infinitesimal_HFinite_mult2,HFinite_add],simpset() addsimps 
  20.322      [hypreal_add_mult_distrib RS sym,mem_infmal_iff RS sym]));
  20.323 @@ -1172,16 +1172,16 @@
  20.324        "[| NSDERIV g x :> D; \
  20.325  \              (*f* g) (hypreal_of_real(x) + xa) = hypreal_of_real(g x);\
  20.326  \              xa \\<in> Infinitesimal;\
  20.327 -\              xa \\<noteq> #0 \
  20.328 -\           |] ==> D = #0";
  20.329 +\              xa \\<noteq> Numeral0 \
  20.330 +\           |] ==> D = Numeral0";
  20.331  by (dtac bspec 1);
  20.332  by Auto_tac;
  20.333  qed "NSDERIV_zero";
  20.334  
  20.335  (* can be proved differently using NSLIM_isCont_iff *)
  20.336  Goalw [nsderiv_def] 
  20.337 -     "[| NSDERIV f x :> D;  h \\<in> Infinitesimal;  h \\<noteq> #0 |]  \
  20.338 -\     ==> (*f* f) (hypreal_of_real(x) + h) + -hypreal_of_real(f x) \\<approx> #0";    
  20.339 +     "[| NSDERIV f x :> D;  h \\<in> Infinitesimal;  h \\<noteq> Numeral0 |]  \
  20.340 +\     ==> (*f* f) (hypreal_of_real(x) + h) + -hypreal_of_real(f x) \\<approx> Numeral0";    
  20.341  by (asm_full_simp_tac (simpset() addsimps 
  20.342      [mem_infmal_iff RS sym]) 1);
  20.343  by (rtac Infinitesimal_ratio 1);
  20.344 @@ -1214,7 +1214,7 @@
  20.345                 ----------------- \\<approx> Db
  20.346                         h
  20.347   --------------------------------------------------------------*)
  20.348 -Goal "[| NSDERIV g x :> Db; xa \\<in> Infinitesimal; xa \\<noteq> #0 |] \
  20.349 +Goal "[| NSDERIV g x :> Db; xa \\<in> Infinitesimal; xa \\<noteq> Numeral0 |] \
  20.350  \     ==> ((*f* g) (hypreal_of_real(x) + xa) + - hypreal_of_real(g x)) / xa \
  20.351  \         \\<approx> hypreal_of_real(Db)";
  20.352  by (auto_tac (claset(),
  20.353 @@ -1266,7 +1266,7 @@
  20.354  (*------------------------------------------------------------------
  20.355             Differentiation of natural number powers
  20.356   ------------------------------------------------------------------*)
  20.357 -Goal "NSDERIV (%x. x) x :> #1";
  20.358 +Goal "NSDERIV (%x. x) x :> Numeral1";
  20.359  by (auto_tac (claset(),
  20.360       simpset() addsimps [NSDERIV_NSLIM_iff,
  20.361            NSLIM_def ,starfun_Id, hypreal_of_real_zero,
  20.362 @@ -1275,7 +1275,7 @@
  20.363  Addsimps [NSDERIV_Id];
  20.364  
  20.365  (*derivative of the identity function*)
  20.366 -Goal "DERIV (%x. x) x :> #1";
  20.367 +Goal "DERIV (%x. x) x :> Numeral1";
  20.368  by (simp_tac (simpset() addsimps [NSDERIV_DERIV_iff RS sym]) 1);
  20.369  qed "DERIV_Id";
  20.370  Addsimps [DERIV_Id];
  20.371 @@ -1294,7 +1294,7 @@
  20.372  qed "NSDERIV_cmult_Id";
  20.373  Addsimps [NSDERIV_cmult_Id];
  20.374  
  20.375 -Goal "DERIV (%x. x ^ n) x :> real n * (x ^ (n - 1'))";
  20.376 +Goal "DERIV (%x. x ^ n) x :> real n * (x ^ (n - Suc 0))";
  20.377  by (induct_tac "n" 1);
  20.378  by (dtac (DERIV_Id RS DERIV_mult) 2);
  20.379  by (auto_tac (claset(), 
  20.380 @@ -1306,7 +1306,7 @@
  20.381  qed "DERIV_pow";
  20.382  
  20.383  (* NS version *)
  20.384 -Goal "NSDERIV (%x. x ^ n) x :> real n * (x ^ (n - 1'))";
  20.385 +Goal "NSDERIV (%x. x ^ n) x :> real n * (x ^ (n - Suc 0))";
  20.386  by (simp_tac (simpset() addsimps [NSDERIV_DERIV_iff, DERIV_pow]) 1);
  20.387  qed "NSDERIV_pow";
  20.388  
  20.389 @@ -1314,9 +1314,9 @@
  20.390                      Power of -1 
  20.391   ---------------------------------------------------------------*)
  20.392  
  20.393 -(*Can't get rid of x \\<noteq> #0 because it isn't continuous at zero*)
  20.394 +(*Can't get rid of x \\<noteq> Numeral0 because it isn't continuous at zero*)
  20.395  Goalw [nsderiv_def]
  20.396 -     "x \\<noteq> #0 ==> NSDERIV (%x. inverse(x)) x :> (- (inverse x ^ 2))";
  20.397 +     "x \\<noteq> Numeral0 ==> NSDERIV (%x. inverse(x)) x :> (- (inverse x ^ Suc (Suc 0)))";
  20.398  by (rtac ballI 1 THEN Asm_full_simp_tac 1 THEN Step_tac 1);
  20.399  by (forward_tac [Infinitesimal_add_not_zero] 1);
  20.400  by (asm_full_simp_tac (simpset() addsimps [hypreal_add_commute]) 2); 
  20.401 @@ -1345,7 +1345,7 @@
  20.402  qed "NSDERIV_inverse";
  20.403  
  20.404  
  20.405 -Goal "x \\<noteq> #0 ==> DERIV (%x. inverse(x)) x :> (-(inverse x ^ 2))";
  20.406 +Goal "x \\<noteq> Numeral0 ==> DERIV (%x. inverse(x)) x :> (-(inverse x ^ Suc (Suc 0)))";
  20.407  by (asm_simp_tac (simpset() addsimps [NSDERIV_inverse,
  20.408           NSDERIV_DERIV_iff RS sym] delsimps [realpow_Suc]) 1);
  20.409  qed "DERIV_inverse";
  20.410 @@ -1353,8 +1353,8 @@
  20.411  (*--------------------------------------------------------------
  20.412          Derivative of inverse 
  20.413   -------------------------------------------------------------*)
  20.414 -Goal "[| DERIV f x :> d; f(x) \\<noteq> #0 |] \
  20.415 -\     ==> DERIV (%x. inverse(f x)) x :> (- (d * inverse(f(x) ^ 2)))";
  20.416 +Goal "[| DERIV f x :> d; f(x) \\<noteq> Numeral0 |] \
  20.417 +\     ==> DERIV (%x. inverse(f x)) x :> (- (d * inverse(f(x) ^ Suc (Suc 0))))";
  20.418  by (rtac (real_mult_commute RS subst) 1);
  20.419  by (asm_simp_tac (simpset() addsimps [real_minus_mult_eq1,
  20.420      realpow_inverse] delsimps [realpow_Suc, 
  20.421 @@ -1363,8 +1363,8 @@
  20.422  by (blast_tac (claset() addSIs [DERIV_chain,DERIV_inverse]) 1);
  20.423  qed "DERIV_inverse_fun";
  20.424  
  20.425 -Goal "[| NSDERIV f x :> d; f(x) \\<noteq> #0 |] \
  20.426 -\     ==> NSDERIV (%x. inverse(f x)) x :> (- (d * inverse(f(x) ^ 2)))";
  20.427 +Goal "[| NSDERIV f x :> d; f(x) \\<noteq> Numeral0 |] \
  20.428 +\     ==> NSDERIV (%x. inverse(f x)) x :> (- (d * inverse(f(x) ^ Suc (Suc 0))))";
  20.429  by (asm_full_simp_tac (simpset() addsimps [NSDERIV_DERIV_iff,
  20.430              DERIV_inverse_fun] delsimps [realpow_Suc]) 1);
  20.431  qed "NSDERIV_inverse_fun";
  20.432 @@ -1372,8 +1372,8 @@
  20.433  (*--------------------------------------------------------------
  20.434          Derivative of quotient 
  20.435   -------------------------------------------------------------*)
  20.436 -Goal "[| DERIV f x :> d; DERIV g x :> e; g(x) \\<noteq> #0 |] \
  20.437 -\      ==> DERIV (%y. f(y) / (g y)) x :> (d*g(x) + -(e*f(x))) / (g(x) ^ 2)";
  20.438 +Goal "[| DERIV f x :> d; DERIV g x :> e; g(x) \\<noteq> Numeral0 |] \
  20.439 +\      ==> DERIV (%y. f(y) / (g y)) x :> (d*g(x) + -(e*f(x))) / (g(x) ^ Suc (Suc 0))";
  20.440  by (dres_inst_tac [("f","g")] DERIV_inverse_fun 1);
  20.441  by (dtac DERIV_mult 2);
  20.442  by (REPEAT(assume_tac 1));
  20.443 @@ -1384,9 +1384,9 @@
  20.444                   real_minus_mult_eq2 RS sym]) 1);
  20.445  qed "DERIV_quotient";
  20.446  
  20.447 -Goal "[| NSDERIV f x :> d; DERIV g x :> e; g(x) \\<noteq> #0 |] \
  20.448 +Goal "[| NSDERIV f x :> d; DERIV g x :> e; g(x) \\<noteq> Numeral0 |] \
  20.449  \      ==> NSDERIV (%y. f(y) / (g y)) x :> (d*g(x) \
  20.450 -\                           + -(e*f(x))) / (g(x) ^ 2)";
  20.451 +\                           + -(e*f(x))) / (g(x) ^ Suc (Suc 0))";
  20.452  by (asm_full_simp_tac (simpset() addsimps [NSDERIV_DERIV_iff,
  20.453              DERIV_quotient] delsimps [realpow_Suc]) 1);
  20.454  qed "NSDERIV_quotient";
  20.455 @@ -1401,7 +1401,7 @@
  20.456  by (res_inst_tac 
  20.457      [("x","%z. if  z = x then l else (f(z) - f(x)) / (z - x)")] exI 1);
  20.458  by (auto_tac (claset(),simpset() addsimps [real_mult_assoc,
  20.459 -    ARITH_PROVE "z \\<noteq> x ==> z - x \\<noteq> (#0::real)"]));
  20.460 +    ARITH_PROVE "z \\<noteq> x ==> z - x \\<noteq> (Numeral0::real)"]));
  20.461  by (auto_tac (claset(),simpset() addsimps [isCont_iff,DERIV_iff]));
  20.462  by (ALLGOALS(rtac (LIM_equal RS iffD1)));
  20.463  by (auto_tac (claset(),simpset() addsimps [real_diff_def,real_mult_assoc]));
  20.464 @@ -1511,7 +1511,7 @@
  20.465  Goal "[| \\<forall>n. f(n) \\<le> f(Suc n); \
  20.466  \        \\<forall>n. g(Suc n) \\<le> g(n); \
  20.467  \        \\<forall>n. f(n) \\<le> g(n); \
  20.468 -\        (%n. f(n) - g(n)) ----> #0 |] \
  20.469 +\        (%n. f(n) - g(n)) ----> Numeral0 |] \
  20.470  \     ==> \\<exists>l. ((\\<forall>n. f(n) \\<le> l) & f ----> l) & \
  20.471  \               ((\\<forall>n. l \\<le> g(n)) & g ----> l)";
  20.472  by (dtac lemma_nest 1 THEN Auto_tac);
  20.473 @@ -1544,15 +1544,15 @@
  20.474                simpset() addsimps [Bolzano_bisect_le, Let_def, split_def]));  
  20.475  qed "Bolzano_bisect_Suc_le_snd";
  20.476  
  20.477 -Goal "((x::real) = y / (#2 * z)) = (#2 * x = y/z)";
  20.478 +Goal "((x::real) = y / (# 2 * z)) = (# 2 * x = y/z)";
  20.479  by Auto_tac;  
  20.480 -by (dres_inst_tac [("f","%u. (#1/#2)*u")] arg_cong 1); 
  20.481 +by (dres_inst_tac [("f","%u. (Numeral1/# 2)*u")] arg_cong 1); 
  20.482  by Auto_tac;  
  20.483  qed "eq_divide_2_times_iff";
  20.484  
  20.485  Goal "a \\<le> b ==> \
  20.486  \     snd(Bolzano_bisect P a b n) - fst(Bolzano_bisect P a b n) = \
  20.487 -\     (b-a) / (#2 ^ n)";
  20.488 +\     (b-a) / (# 2 ^ n)";
  20.489  by (induct_tac "n" 1);
  20.490  by (auto_tac (claset(), 
  20.491        simpset() addsimps [eq_divide_2_times_iff, real_add_divide_distrib, 
  20.492 @@ -1589,7 +1589,7 @@
  20.493  
  20.494  
  20.495  Goal "[| \\<forall>a b c. P(a,b) & P(b,c) & a \\<le> b & b \\<le> c --> P(a,c); \
  20.496 -\        \\<forall>x. \\<exists>d::real. #0 < d & \
  20.497 +\        \\<forall>x. \\<exists>d::real. Numeral0 < d & \
  20.498  \               (\\<forall>a b. a \\<le> x & x \\<le> b & (b - a) < d --> P(a,b)); \
  20.499  \        a \\<le> b |]  \
  20.500  \     ==> P(a,b)";
  20.501 @@ -1604,8 +1604,8 @@
  20.502  by (rename_tac "l" 1);
  20.503  by (dres_inst_tac [("x","l")] spec 1 THEN Clarify_tac 1);
  20.504  by (rewtac LIMSEQ_def);
  20.505 -by (dres_inst_tac [("P", "%r. #0<r --> ?Q r"), ("x","d/#2")] spec 1);
  20.506 -by (dres_inst_tac [("P", "%r. #0<r --> ?Q r"), ("x","d/#2")] spec 1);
  20.507 +by (dres_inst_tac [("P", "%r. Numeral0<r --> ?Q r"), ("x","d/# 2")] spec 1);
  20.508 +by (dres_inst_tac [("P", "%r. Numeral0<r --> ?Q r"), ("x","d/# 2")] spec 1);
  20.509  by (dtac real_less_half_sum 1);
  20.510  by Safe_tac;
  20.511  (*linear arithmetic bug if we just use Asm_simp_tac*)
  20.512 @@ -1626,7 +1626,7 @@
  20.513  
  20.514  
  20.515  Goal "((\\<forall>a b c. (a \\<le> b & b \\<le> c & P(a,b) & P(b,c)) --> P(a,c)) & \
  20.516 -\      (\\<forall>x. \\<exists>d::real. #0 < d & \
  20.517 +\      (\\<forall>x. \\<exists>d::real. Numeral0 < d & \
  20.518  \               (\\<forall>a b. a \\<le> x & x \\<le> b & (b - a) < d --> P(a,b)))) \
  20.519  \     --> (\\<forall>a b. a \\<le> b --> P(a,b))";
  20.520  by (Clarify_tac 1);
  20.521 @@ -1654,14 +1654,14 @@
  20.522  by (rtac ccontr 1);
  20.523  by (subgoal_tac "a \\<le> x & x \\<le> b" 1);
  20.524  by (Asm_full_simp_tac 2);
  20.525 -by (dres_inst_tac [("P", "%d. #0<d --> ?P d"),("x","#1")] spec 2);
  20.526 +by (dres_inst_tac [("P", "%d. Numeral0<d --> ?P d"),("x","Numeral1")] spec 2);
  20.527  by (Step_tac 2);
  20.528  by (Asm_full_simp_tac 2);
  20.529  by (Asm_full_simp_tac 2);
  20.530  by (REPEAT(blast_tac (claset() addIs [order_trans]) 2));
  20.531  by (REPEAT(dres_inst_tac [("x","x")] spec 1));
  20.532  by (Asm_full_simp_tac 1);
  20.533 -by (dres_inst_tac [("P", "%r. ?P r --> (\\<exists>s. #0<s & ?Q r s)"),
  20.534 +by (dres_inst_tac [("P", "%r. ?P r --> (\\<exists>s. Numeral0<s & ?Q r s)"),
  20.535                     ("x","abs(y - f x)")] spec 1);
  20.536  by Safe_tac;
  20.537  by (asm_full_simp_tac (simpset() addsimps []) 1);
  20.538 @@ -1738,15 +1738,15 @@
  20.539  by (cut_inst_tac [("x","xb"),("y","xa")] linorder_linear 1);
  20.540  by (Force_tac 1); 
  20.541  by (case_tac "a \\<le> x & x \\<le> b" 1);
  20.542 -by (res_inst_tac [("x","#1")] exI 2);
  20.543 +by (res_inst_tac [("x","Numeral1")] exI 2);
  20.544  by (Force_tac 2); 
  20.545  by (asm_full_simp_tac (simpset() addsimps [LIM_def,isCont_iff]) 1);
  20.546  by (dres_inst_tac [("x","x")] spec 1 THEN Auto_tac);
  20.547  by (thin_tac "\\<forall>M. \\<exists>x. a \\<le> x & x \\<le> b & ~ f x \\<le> M" 1);
  20.548 -by (dres_inst_tac [("x","#1")] spec 1);
  20.549 +by (dres_inst_tac [("x","Numeral1")] spec 1);
  20.550  by Auto_tac;  
  20.551  by (res_inst_tac [("x","s")] exI 1 THEN Clarify_tac 1);
  20.552 -by (res_inst_tac [("x","abs(f x) + #1")] exI 1 THEN Clarify_tac 1);
  20.553 +by (res_inst_tac [("x","abs(f x) + Numeral1")] exI 1 THEN Clarify_tac 1);
  20.554  by (dres_inst_tac [("x","xa - x")] spec 1 THEN Safe_tac);
  20.555  by (arith_tac 1);
  20.556  by (arith_tac 1);
  20.557 @@ -1803,23 +1803,23 @@
  20.558      "\\<exists>k. \\<forall>x. a \\<le> x & x \\<le> b --> (%x. inverse(M - (f x))) x \\<le> k" 1);
  20.559  by (rtac isCont_bounded 2);
  20.560  by Safe_tac;
  20.561 -by (subgoal_tac "\\<forall>x. a \\<le> x & x \\<le> b --> #0 < inverse(M - f(x))" 1);
  20.562 +by (subgoal_tac "\\<forall>x. a \\<le> x & x \\<le> b --> Numeral0 < inverse(M - f(x))" 1);
  20.563  by (Asm_full_simp_tac 1); 
  20.564  by Safe_tac;
  20.565  by (asm_full_simp_tac (simpset() addsimps [real_less_diff_eq]) 2);
  20.566  by (subgoal_tac 
  20.567 -    "\\<forall>x. a \\<le> x & x \\<le> b --> (%x. inverse(M - (f x))) x < (k + #1)" 1);
  20.568 +    "\\<forall>x. a \\<le> x & x \\<le> b --> (%x. inverse(M - (f x))) x < (k + Numeral1)" 1);
  20.569  by Safe_tac;
  20.570  by (res_inst_tac [("y","k")] order_le_less_trans 2);
  20.571  by (asm_full_simp_tac (simpset() addsimps [real_zero_less_one]) 3);
  20.572  by (Asm_full_simp_tac 2); 
  20.573  by (subgoal_tac "\\<forall>x. a \\<le> x & x \\<le> b --> \
  20.574 -\                inverse(k + #1) < inverse((%x. inverse(M - (f x))) x)" 1);
  20.575 +\                inverse(k + Numeral1) < inverse((%x. inverse(M - (f x))) x)" 1);
  20.576  by Safe_tac;
  20.577  by (rtac real_inverse_less_swap 2);
  20.578  by (ALLGOALS Asm_full_simp_tac);
  20.579  by (dres_inst_tac [("P", "%N. N<M --> ?Q N"),
  20.580 -                   ("x","M - inverse(k + #1)")] spec 1);
  20.581 +                   ("x","M - inverse(k + Numeral1)")] spec 1);
  20.582  by (Step_tac 1 THEN dtac real_leI 1);
  20.583  by (dtac (real_le_diff_eq RS iffD1) 1);
  20.584  by (REPEAT(dres_inst_tac [("x","a")] spec 1));
  20.585 @@ -1879,11 +1879,11 @@
  20.586  (*----------------------------------------------------------------------------*)
  20.587  
  20.588  Goalw [deriv_def,LIM_def] 
  20.589 -    "[| DERIV f x :> l;  #0 < l |] ==> \
  20.590 -\      \\<exists>d. #0 < d & (\\<forall>h. #0 < h & h < d --> f(x) < f(x + h))";
  20.591 +    "[| DERIV f x :> l;  Numeral0 < l |] ==> \
  20.592 +\      \\<exists>d. Numeral0 < d & (\\<forall>h. Numeral0 < h & h < d --> f(x) < f(x + h))";
  20.593  by (dtac spec 1 THEN Auto_tac);
  20.594  by (res_inst_tac [("x","s")] exI 1 THEN Auto_tac);
  20.595 -by (subgoal_tac "#0 < l*h" 1);
  20.596 +by (subgoal_tac "Numeral0 < l*h" 1);
  20.597  by (asm_full_simp_tac (simpset() addsimps [real_0_less_mult_iff]) 2); 
  20.598  by (dres_inst_tac [("x","h")] spec 1);
  20.599  by (asm_full_simp_tac
  20.600 @@ -1893,11 +1893,11 @@
  20.601  qed "DERIV_left_inc";
  20.602  
  20.603  Goalw [deriv_def,LIM_def] 
  20.604 -    "[| DERIV f x :> l;  l < #0 |] ==> \
  20.605 -\      \\<exists>d. #0 < d & (\\<forall>h. #0 < h & h < d --> f(x) < f(x - h))";
  20.606 +    "[| DERIV f x :> l;  l < Numeral0 |] ==> \
  20.607 +\      \\<exists>d. Numeral0 < d & (\\<forall>h. Numeral0 < h & h < d --> f(x) < f(x - h))";
  20.608  by (dres_inst_tac [("x","-l")] spec 1 THEN Auto_tac);
  20.609  by (res_inst_tac [("x","s")] exI 1 THEN Auto_tac);
  20.610 -by (subgoal_tac "l*h < #0" 1);
  20.611 +by (subgoal_tac "l*h < Numeral0" 1);
  20.612  by (asm_full_simp_tac (simpset() addsimps [real_mult_less_0_iff]) 2); 
  20.613  by (dres_inst_tac [("x","-h")] spec 1);
  20.614  by (asm_full_simp_tac
  20.615 @@ -1905,7 +1905,7 @@
  20.616                           pos_real_less_divide_eq,
  20.617                           symmetric real_diff_def]
  20.618                 addsplits [split_if_asm]) 1);
  20.619 -by (subgoal_tac "#0 < (f (x - h) - f x)/h" 1);
  20.620 +by (subgoal_tac "Numeral0 < (f (x - h) - f x)/h" 1);
  20.621  by (arith_tac 2);
  20.622  by (asm_full_simp_tac
  20.623      (simpset() addsimps [pos_real_less_divide_eq]) 1); 
  20.624 @@ -1913,9 +1913,9 @@
  20.625  
  20.626  
  20.627  Goal "[| DERIV f x :> l; \
  20.628 -\        \\<exists>d. #0 < d & (\\<forall>y. abs(x - y) < d --> f(y) \\<le> f(x)) |] \
  20.629 -\     ==> l = #0";
  20.630 -by (res_inst_tac [("R1.0","l"),("R2.0","#0")] real_linear_less2 1);
  20.631 +\        \\<exists>d. Numeral0 < d & (\\<forall>y. abs(x - y) < d --> f(y) \\<le> f(x)) |] \
  20.632 +\     ==> l = Numeral0";
  20.633 +by (res_inst_tac [("R1.0","l"),("R2.0","Numeral0")] real_linear_less2 1);
  20.634  by Safe_tac;
  20.635  by (dtac DERIV_left_dec 1);
  20.636  by (dtac DERIV_left_inc 3);
  20.637 @@ -1933,8 +1933,8 @@
  20.638  (*----------------------------------------------------------------------------*)
  20.639  
  20.640  Goal "[| DERIV f x :> l; \
  20.641 -\        \\<exists>d::real. #0 < d & (\\<forall>y. abs(x - y) < d --> f(x) \\<le> f(y)) |] \
  20.642 -\     ==> l = #0";
  20.643 +\        \\<exists>d::real. Numeral0 < d & (\\<forall>y. abs(x - y) < d --> f(x) \\<le> f(y)) |] \
  20.644 +\     ==> l = Numeral0";
  20.645  by (dtac (DERIV_minus RS DERIV_local_max) 1); 
  20.646  by Auto_tac;  
  20.647  qed "DERIV_local_min";
  20.648 @@ -1944,8 +1944,8 @@
  20.649  (*----------------------------------------------------------------------------*)
  20.650  
  20.651  Goal "[| DERIV f x :> l; \
  20.652 -\        \\<exists>d. #0 < d & (\\<forall>y. abs(x - y) < d --> f(x) = f(y)) |] \
  20.653 -\     ==> l = #0";
  20.654 +\        \\<exists>d. Numeral0 < d & (\\<forall>y. abs(x - y) < d --> f(x) = f(y)) |] \
  20.655 +\     ==> l = Numeral0";
  20.656  by (auto_tac (claset() addSDs [DERIV_local_max],simpset()));
  20.657  qed "DERIV_local_const";
  20.658  
  20.659 @@ -1954,7 +1954,7 @@
  20.660  (*----------------------------------------------------------------------------*)
  20.661  
  20.662  Goal "[| a < x;  x < b |] ==> \
  20.663 -\       \\<exists>d::real. #0 < d &  (\\<forall>y. abs(x - y) < d --> a < y & y < b)";
  20.664 +\       \\<exists>d::real. Numeral0 < d &  (\\<forall>y. abs(x - y) < d --> a < y & y < b)";
  20.665  by (simp_tac (simpset() addsimps [abs_interval_iff]) 1);
  20.666  by (cut_inst_tac [("x","x - a"),("y","b - x")] linorder_linear 1);
  20.667  by Safe_tac;
  20.668 @@ -1965,7 +1965,7 @@
  20.669  qed "lemma_interval_lt";
  20.670  
  20.671  Goal "[| a < x;  x < b |] ==> \
  20.672 -\       \\<exists>d::real. #0 < d &  (\\<forall>y. abs(x - y) < d --> a \\<le> y & y \\<le> b)";
  20.673 +\       \\<exists>d::real. Numeral0 < d &  (\\<forall>y. abs(x - y) < d --> a \\<le> y & y \\<le> b)";
  20.674  by (dtac lemma_interval_lt 1);
  20.675  by Auto_tac;
  20.676  by (auto_tac (claset() addSIs [exI] ,simpset()));
  20.677 @@ -1975,13 +1975,13 @@
  20.678              Rolle's Theorem
  20.679     If f is defined and continuous on the finite closed interval [a,b]
  20.680     and differentiable a least on the open interval (a,b), and f(a) = f(b),
  20.681 -   then x0 \\<in> (a,b) such that f'(x0) = #0
  20.682 +   then x0 \\<in> (a,b) such that f'(x0) = Numeral0
  20.683   ----------------------------------------------------------------------*)
  20.684  
  20.685  Goal "[| a < b; f(a) = f(b); \
  20.686  \        \\<forall>x. a \\<le> x & x \\<le> b --> isCont f x; \
  20.687  \        \\<forall>x. a < x & x < b --> f differentiable x \
  20.688 -\     |] ==> \\<exists>z. a < z & z < b & DERIV f z :> #0";
  20.689 +\     |] ==> \\<exists>z. a < z & z < b & DERIV f z :> Numeral0";
  20.690  by (ftac (order_less_imp_le RS isCont_eq_Ub) 1);
  20.691  by (EVERY1[assume_tac,Step_tac]);
  20.692  by (ftac (order_less_imp_le RS isCont_eq_Lb) 1);
  20.693 @@ -1992,7 +1992,7 @@
  20.694  by (EVERY1[assume_tac,etac exE]);
  20.695  by (res_inst_tac [("x","x")] exI 1 THEN Asm_full_simp_tac 1);
  20.696  by (subgoal_tac "(\\<exists>l. DERIV f x :> l) & \
  20.697 -\        (\\<exists>d. #0 < d & (\\<forall>y. abs(x - y) < d --> f(y) \\<le> f(x)))" 1);
  20.698 +\        (\\<exists>d. Numeral0 < d & (\\<forall>y. abs(x - y) < d --> f(y) \\<le> f(x)))" 1);
  20.699  by (Clarify_tac 1 THEN rtac conjI 2);
  20.700  by (blast_tac (claset() addIs [differentiableD]) 2);
  20.701  by (Blast_tac 2);
  20.702 @@ -2004,7 +2004,7 @@
  20.703  by (EVERY1[assume_tac,etac exE]);
  20.704  by (res_inst_tac [("x","xa")] exI 1 THEN Asm_full_simp_tac 1);
  20.705  by (subgoal_tac "(\\<exists>l. DERIV f xa :> l) & \
  20.706 -\        (\\<exists>d. #0 < d & (\\<forall>y. abs(xa - y) < d --> f(xa) \\<le> f(y)))" 1);
  20.707 +\        (\\<exists>d. Numeral0 < d & (\\<forall>y. abs(xa - y) < d --> f(xa) \\<le> f(y)))" 1);
  20.708  by (Clarify_tac 1 THEN rtac conjI 2);
  20.709  by (blast_tac (claset() addIs [differentiableD]) 2);
  20.710  by (Blast_tac 2);
  20.711 @@ -2030,7 +2030,7 @@
  20.712  by (forw_inst_tac [("a","a"),("x","r")] lemma_interval 1);
  20.713  by (EVERY1[assume_tac, etac exE]);
  20.714  by (subgoal_tac "(\\<exists>l. DERIV f r :> l) & \
  20.715 -\        (\\<exists>d. #0 < d & (\\<forall>y. abs(r - y) < d --> f(r) = f(y)))" 1);
  20.716 +\        (\\<exists>d. Numeral0 < d & (\\<forall>y. abs(r - y) < d --> f(r) = f(y)))" 1);
  20.717  by (Clarify_tac 1 THEN rtac conjI 2);
  20.718  by (blast_tac (claset() addIs [differentiableD]) 2);
  20.719  by (EVERY1[ftac DERIV_local_const, Blast_tac, Blast_tac]);
  20.720 @@ -2098,7 +2098,7 @@
  20.721  
  20.722  Goal "[| a < b; \
  20.723  \        \\<forall>x. a \\<le> x & x \\<le> b --> isCont f x; \
  20.724 -\        \\<forall>x. a < x & x < b --> DERIV f x :> #0 |] \
  20.725 +\        \\<forall>x. a < x & x < b --> DERIV f x :> Numeral0 |] \
  20.726  \       ==> (f b = f a)";
  20.727  by (dtac MVT 1 THEN assume_tac 1);
  20.728  by (blast_tac (claset() addIs [differentiableI]) 1);
  20.729 @@ -2108,7 +2108,7 @@
  20.730  
  20.731  Goal "[| a < b; \
  20.732  \        \\<forall>x. a \\<le> x & x \\<le> b --> isCont f x; \
  20.733 -\        \\<forall>x. a < x & x < b --> DERIV f x :> #0 |] \
  20.734 +\        \\<forall>x. a < x & x < b --> DERIV f x :> Numeral0 |] \
  20.735  \       ==> \\<forall>x. a \\<le> x & x \\<le> b --> f x = f a";
  20.736  by Safe_tac;
  20.737  by (dres_inst_tac [("x","a")] order_le_imp_less_or_eq 1);
  20.738 @@ -2119,13 +2119,13 @@
  20.739  
  20.740  Goal "[| a < b; \
  20.741  \        \\<forall>x. a \\<le> x & x \\<le> b --> isCont f x; \
  20.742 -\        \\<forall>x. a < x & x < b --> DERIV f x :> #0; \
  20.743 +\        \\<forall>x. a < x & x < b --> DERIV f x :> Numeral0; \
  20.744  \        a \\<le> x; x \\<le> b |] \
  20.745  \       ==> f x = f a";
  20.746  by (blast_tac (claset() addDs [DERIV_isconst1]) 1);
  20.747  qed "DERIV_isconst2";
  20.748  
  20.749 -Goal "\\<forall>x. DERIV f x :> #0 ==> f(x) = f(y)";
  20.750 +Goal "\\<forall>x. DERIV f x :> Numeral0 ==> f(x) = f(y)";
  20.751  by (res_inst_tac [("R1.0","x"),("R2.0","y")] real_linear_less2 1);
  20.752  by (rtac sym 1);
  20.753  by (auto_tac (claset() addIs [DERIV_isCont,DERIV_isconst_end],simpset()));
  20.754 @@ -2148,12 +2148,12 @@
  20.755                simpset() addsimps [real_mult_assoc]));
  20.756  qed "DERIV_const_ratio_const2";
  20.757  
  20.758 -Goal "((a + b) /#2 - a) = (b - a)/(#2::real)";
  20.759 +Goal "((a + b) /# 2 - a) = (b - a)/(# 2::real)";
  20.760  by Auto_tac;  
  20.761  qed "real_average_minus_first";
  20.762  Addsimps [real_average_minus_first];
  20.763  
  20.764 -Goal "((b + a)/#2 - a) = (b - a)/(#2::real)";
  20.765 +Goal "((b + a)/# 2 - a) = (b - a)/(# 2::real)";
  20.766  by Auto_tac;  
  20.767  qed "real_average_minus_second";
  20.768  Addsimps [real_average_minus_second];
  20.769 @@ -2161,7 +2161,7 @@
  20.770  
  20.771  (* Gallileo's "trick": average velocity = av. of end velocities *)
  20.772  Goal "[|a \\<noteq> (b::real); \\<forall>x. DERIV v x :> k|] \
  20.773 -\     ==> v((a + b)/#2) = (v a + v b)/#2";
  20.774 +\     ==> v((a + b)/# 2) = (v a + v b)/# 2";
  20.775  by (res_inst_tac [("R1.0","a"),("R2.0","b")] real_linear_less2 1);
  20.776  by Auto_tac;
  20.777  by (ftac DERIV_const_ratio_const2 1 THEN assume_tac 1);
  20.778 @@ -2182,7 +2182,7 @@
  20.779  (* maximum at an end point, not in the middle.                              *)
  20.780  (* ------------------------------------------------------------------------ *)
  20.781  
  20.782 -Goal "[|#0 < d; \\<forall>z. abs(z - x) \\<le> d --> g(f z) = z; \
  20.783 +Goal "[|Numeral0 < d; \\<forall>z. abs(z - x) \\<le> d --> g(f z) = z; \
  20.784  \       \\<forall>z. abs(z - x) \\<le> d --> isCont f z |]  \
  20.785  \     ==> ~(\\<forall>z. abs(z - x) \\<le> d --> f(z) \\<le> f(x))";
  20.786  by (rtac notI 1);
  20.787 @@ -2221,7 +2221,7 @@
  20.788  (* Similar version for lower bound                                          *)
  20.789  (* ------------------------------------------------------------------------ *)
  20.790  
  20.791 -Goal "[|#0 < d; \\<forall>z. abs(z - x) \\<le> d --> g(f z) = z; \
  20.792 +Goal "[|Numeral0 < d; \\<forall>z. abs(z - x) \\<le> d --> g(f z) = z; \
  20.793  \       \\<forall>z. abs(z - x) \\<le> d --> isCont f z |]  \
  20.794  \     ==> ~(\\<forall>z. abs(z - x) \\<le> d --> f(x) \\<le> f(z))";
  20.795  by (auto_tac (claset() addSDs [(asm_full_simplify (simpset()) 
  20.796 @@ -2236,12 +2236,12 @@
  20.797  
  20.798  Addsimps [zero_eq_numeral_0,one_eq_numeral_1];
  20.799  
  20.800 -val lemma_le = ARITH_PROVE "#0 \\<le> (d::real) ==> -d \\<le> d";
  20.801 +val lemma_le = ARITH_PROVE "Numeral0 \\<le> (d::real) ==> -d \\<le> d";
  20.802  
  20.803  (* FIXME: awful proof - needs improvement *)
  20.804 -Goal "[| #0 < d; \\<forall>z. abs(z - x) \\<le> d --> g(f z) = z; \
  20.805 +Goal "[| Numeral0 < d; \\<forall>z. abs(z - x) \\<le> d --> g(f z) = z; \
  20.806  \        \\<forall>z. abs(z - x) \\<le> d --> isCont f z |] \
  20.807 -\      ==> \\<exists>e. #0 < e & \
  20.808 +\      ==> \\<exists>e. Numeral0 < e & \
  20.809  \                 (\\<forall>y. \
  20.810  \                     abs(y - f(x)) \\<le> e --> \
  20.811  \                     (\\<exists>z. abs(z - x) \\<le> d & (f z = y)))";
  20.812 @@ -2255,8 +2255,8 @@
  20.813  by (Asm_full_simp_tac 2);
  20.814  by (subgoal_tac "L < f x & f x < M" 1);
  20.815  by Safe_tac;
  20.816 -by (dres_inst_tac [("x","L")] (ARITH_PROVE "x < y ==> #0 < y - (x::real)") 1);
  20.817 -by (dres_inst_tac [("x","f x")] (ARITH_PROVE "x < y ==> #0 < y - (x::real)") 1);
  20.818 +by (dres_inst_tac [("x","L")] (ARITH_PROVE "x < y ==> Numeral0 < y - (x::real)") 1);
  20.819 +by (dres_inst_tac [("x","f x")] (ARITH_PROVE "x < y ==> Numeral0 < y - (x::real)") 1);
  20.820  by (dres_inst_tac [("d1.0","f x - L"),("d2.0","M - f x")] 
  20.821      (rename_numerals real_lbound_gt_zero) 1);
  20.822  by Safe_tac;
  20.823 @@ -2284,7 +2284,7 @@
  20.824  (* Continuity of inverse function                                           *)
  20.825  (* ------------------------------------------------------------------------ *)
  20.826  
  20.827 -Goal "[| #0 < d; \\<forall>z. abs(z - x) \\<le> d --> g(f(z)) = z; \
  20.828 +Goal "[| Numeral0 < d; \\<forall>z. abs(z - x) \\<le> d --> g(f(z)) = z; \
  20.829  \        \\<forall>z. abs(z - x) \\<le> d --> isCont f z |] \
  20.830  \     ==> isCont g (f x)";
  20.831  by (simp_tac (simpset() addsimps [isCont_iff,LIM_def]) 1);
    21.1 --- a/src/HOL/Hyperreal/Lim.thy	Fri Oct 05 21:50:37 2001 +0200
    21.2 +++ b/src/HOL/Hyperreal/Lim.thy	Fri Oct 05 21:52:39 2001 +0200
    21.3 @@ -15,8 +15,8 @@
    21.4    LIM :: [real=>real,real,real] => bool
    21.5  				("((_)/ -- (_)/ --> (_))" [60, 0, 60] 60)
    21.6    "f -- a --> L ==
    21.7 -     ALL r. #0 < r --> 
    21.8 -	     (EX s. #0 < s & (ALL x. (x ~= a & (abs(x + -a) < s)
    21.9 +     ALL r. Numeral0 < r --> 
   21.10 +	     (EX s. Numeral0 < s & (ALL x. (x ~= a & (abs(x + -a) < s)
   21.11  			  --> abs(f x + -L) < r)))"
   21.12  
   21.13    NSLIM :: [real=>real,real,real] => bool
   21.14 @@ -36,7 +36,7 @@
   21.15    (* differentiation: D is derivative of function f at x *)
   21.16    deriv:: [real=>real,real,real] => bool
   21.17  			    ("(DERIV (_)/ (_)/ :> (_))" [60, 0, 60] 60)
   21.18 -  "DERIV f x :> D == ((%h. (f(x + h) + -f(x))/h) -- #0 --> D)"
   21.19 +  "DERIV f x :> D == ((%h. (f(x + h) + -f(x))/h) -- Numeral0 --> D)"
   21.20  
   21.21    nsderiv :: [real=>real,real,real] => bool
   21.22  			    ("(NSDERIV (_)/ (_)/ :> (_))" [60, 0, 60] 60)
   21.23 @@ -55,8 +55,8 @@
   21.24  		       inc = (*f* f)(hypreal_of_real x + h) + -hypreal_of_real (f x))"
   21.25  
   21.26    isUCont :: (real=>real) => bool
   21.27 -  "isUCont f ==  (ALL r. #0 < r --> 
   21.28 -		      (EX s. #0 < s & (ALL x y. abs(x + -y) < s
   21.29 +  "isUCont f ==  (ALL r. Numeral0 < r --> 
   21.30 +		      (EX s. Numeral0 < s & (ALL x y. abs(x + -y) < s
   21.31  			    --> abs(f x + -f y) < r)))"
   21.32  
   21.33    isNSUCont :: (real=>real) => bool
   21.34 @@ -71,8 +71,8 @@
   21.35    "Bolzano_bisect P a b 0 = (a,b)"
   21.36    "Bolzano_bisect P a b (Suc n) =
   21.37        (let (x,y) = Bolzano_bisect P a b n
   21.38 -       in if P(x, (x+y)/#2) then ((x+y)/#2, y)
   21.39 -                            else (x, (x+y)/#2) )"
   21.40 +       in if P(x, (x+y)/# 2) then ((x+y)/# 2, y)
   21.41 +                            else (x, (x+y)/# 2) )"
   21.42    
   21.43  
   21.44  end
    22.1 --- a/src/HOL/Hyperreal/NSA.ML	Fri Oct 05 21:50:37 2001 +0200
    22.2 +++ b/src/HOL/Hyperreal/NSA.ML	Fri Oct 05 21:52:39 2001 +0200
    22.3 @@ -211,9 +211,9 @@
    22.4  
    22.5  Goalw [SReal_def,HFinite_def] "Reals <= HFinite";
    22.6  by Auto_tac;
    22.7 -by (res_inst_tac [("x","#1 + abs(hypreal_of_real r)")] exI 1);
    22.8 +by (res_inst_tac [("x","Numeral1 + abs(hypreal_of_real r)")] exI 1);
    22.9  by (auto_tac (claset(), simpset() addsimps [hypreal_of_real_hrabs]));
   22.10 -by (res_inst_tac [("x","#1 + abs r")] exI 1);
   22.11 +by (res_inst_tac [("x","Numeral1 + abs r")] exI 1);
   22.12  by (Simp_tac 1);
   22.13  qed "SReal_subset_HFinite";
   22.14  
   22.15 @@ -238,8 +238,8 @@
   22.16  qed "HFinite_number_of";
   22.17  Addsimps [HFinite_number_of];
   22.18  
   22.19 -Goal "[|x : HFinite; y <= x; #0 <= y |] ==> y: HFinite";
   22.20 -by (case_tac "x <= #0" 1);
   22.21 +Goal "[|x : HFinite; y <= x; Numeral0 <= y |] ==> y: HFinite";
   22.22 +by (case_tac "x <= Numeral0" 1);
   22.23  by (dres_inst_tac [("y","x")] order_trans 1);
   22.24  by (dtac hypreal_le_anti_sym 2);
   22.25  by (auto_tac (claset() addSDs [not_hypreal_leE], simpset()));
   22.26 @@ -251,20 +251,20 @@
   22.27         Set of infinitesimals is a subring of the hyperreals   
   22.28   ------------------------------------------------------------------*)
   22.29  Goalw [Infinitesimal_def]
   22.30 -      "x : Infinitesimal ==> ALL r: Reals. #0 < r --> abs x < r";
   22.31 +      "x : Infinitesimal ==> ALL r: Reals. Numeral0 < r --> abs x < r";
   22.32  by Auto_tac;
   22.33  qed "InfinitesimalD";
   22.34  
   22.35 -Goalw [Infinitesimal_def] "#0 : Infinitesimal";
   22.36 +Goalw [Infinitesimal_def] "Numeral0 : Infinitesimal";
   22.37  by (simp_tac (simpset() addsimps [hrabs_zero]) 1);
   22.38  qed "Infinitesimal_zero";
   22.39  AddIffs [Infinitesimal_zero];
   22.40  
   22.41 -Goal "x/(#2::hypreal) + x/(#2::hypreal) = x";
   22.42 +Goal "x/(# 2::hypreal) + x/(# 2::hypreal) = x";
   22.43  by Auto_tac;  
   22.44  qed "hypreal_sum_of_halves";
   22.45  
   22.46 -Goal "#0 < r ==> #0 < r/(#2::hypreal)";
   22.47 +Goal "Numeral0 < r ==> Numeral0 < r/(# 2::hypreal)";
   22.48  by Auto_tac;  
   22.49  qed "hypreal_half_gt_zero";
   22.50  
   22.51 @@ -290,8 +290,8 @@
   22.52  Goalw [Infinitesimal_def] 
   22.53       "[| x : Infinitesimal; y : Infinitesimal |] ==> (x * y) : Infinitesimal";
   22.54  by Auto_tac;
   22.55 -by (case_tac "y=#0" 1);
   22.56 -by (cut_inst_tac [("u","abs x"),("v","#1"),("x","abs y"),("y","r")] 
   22.57 +by (case_tac "y=Numeral0" 1);
   22.58 +by (cut_inst_tac [("u","abs x"),("v","Numeral1"),("x","abs y"),("y","r")] 
   22.59      hypreal_mult_less_mono 2);
   22.60  by Auto_tac;  
   22.61  qed "Infinitesimal_mult";
   22.62 @@ -332,27 +332,27 @@
   22.63  
   22.64  Goalw [HInfinite_def] "[|x: HInfinite;y: HInfinite|] ==> (x*y): HInfinite";
   22.65  by Auto_tac;
   22.66 -by (eres_inst_tac [("x","#1")] ballE 1);
   22.67 +by (eres_inst_tac [("x","Numeral1")] ballE 1);
   22.68  by (eres_inst_tac [("x","r")] ballE 1);
   22.69  by (case_tac "y=0" 1); 
   22.70 -by (cut_inst_tac [("x","#1"),("y","abs x"),
   22.71 +by (cut_inst_tac [("x","Numeral1"),("y","abs x"),
   22.72                    ("u","r"),("v","abs y")] hypreal_mult_less_mono 2);
   22.73  by (auto_tac (claset(), simpset() addsimps hypreal_mult_ac));  
   22.74  qed "HInfinite_mult";
   22.75  
   22.76  Goalw [HInfinite_def] 
   22.77 -      "[|x: HInfinite; #0 <= y; #0 <= x|] ==> (x + y): HInfinite";
   22.78 +      "[|x: HInfinite; Numeral0 <= y; Numeral0 <= x|] ==> (x + y): HInfinite";
   22.79  by (auto_tac (claset() addSIs [hypreal_add_zero_less_le_mono],
   22.80                simpset() addsimps [hrabs_eqI1, hypreal_add_commute,
   22.81                                    hypreal_le_add_order]));
   22.82  qed "HInfinite_add_ge_zero";
   22.83  
   22.84 -Goal "[|x: HInfinite; #0 <= y; #0 <= x|] ==> (y + x): HInfinite";
   22.85 +Goal "[|x: HInfinite; Numeral0 <= y; Numeral0 <= x|] ==> (y + x): HInfinite";
   22.86  by (auto_tac (claset() addSIs [HInfinite_add_ge_zero],
   22.87                simpset() addsimps [hypreal_add_commute]));
   22.88  qed "HInfinite_add_ge_zero2";
   22.89  
   22.90 -Goal "[|x: HInfinite; #0 < y; #0 < x|] ==> (x + y): HInfinite";
   22.91 +Goal "[|x: HInfinite; Numeral0 < y; Numeral0 < x|] ==> (x + y): HInfinite";
   22.92  by (blast_tac (claset() addIs [HInfinite_add_ge_zero,
   22.93                      order_less_imp_le]) 1);
   22.94  qed "HInfinite_add_gt_zero";
   22.95 @@ -361,14 +361,14 @@
   22.96  by Auto_tac;
   22.97  qed "HInfinite_minus_iff";
   22.98  
   22.99 -Goal "[|x: HInfinite; y <= #0; x <= #0|] ==> (x + y): HInfinite";
  22.100 +Goal "[|x: HInfinite; y <= Numeral0; x <= Numeral0|] ==> (x + y): HInfinite";
  22.101  by (dtac (HInfinite_minus_iff RS iffD2) 1);
  22.102  by (rtac (HInfinite_minus_iff RS iffD1) 1);
  22.103  by (auto_tac (claset() addIs [HInfinite_add_ge_zero],
  22.104                simpset() addsimps [hypreal_minus_zero_le_iff]));
  22.105  qed "HInfinite_add_le_zero";
  22.106  
  22.107 -Goal "[|x: HInfinite; y < #0; x < #0|] ==> (x + y): HInfinite";
  22.108 +Goal "[|x: HInfinite; y < Numeral0; x < Numeral0|] ==> (x + y): HInfinite";
  22.109  by (blast_tac (claset() addIs [HInfinite_add_le_zero,
  22.110                                 order_less_imp_le]) 1);
  22.111  qed "HInfinite_add_lt_zero";
  22.112 @@ -378,11 +378,11 @@
  22.113  by (auto_tac (claset() addIs [HFinite_mult,HFinite_add], simpset()));
  22.114  qed "HFinite_sum_squares";
  22.115  
  22.116 -Goal "x ~: Infinitesimal ==> x ~= #0";
  22.117 +Goal "x ~: Infinitesimal ==> x ~= Numeral0";
  22.118  by Auto_tac;
  22.119  qed "not_Infinitesimal_not_zero";
  22.120  
  22.121 -Goal "x: HFinite - Infinitesimal ==> x ~= #0";
  22.122 +Goal "x: HFinite - Infinitesimal ==> x ~= Numeral0";
  22.123  by Auto_tac;
  22.124  qed "not_Infinitesimal_not_zero2";
  22.125  
  22.126 @@ -441,7 +441,7 @@
  22.127  by (fast_tac (claset() addDs [not_Infinitesimal_mult]) 1);
  22.128  qed "Infinitesimal_mult_disj";
  22.129  
  22.130 -Goal "x: HFinite-Infinitesimal ==> x ~= #0";
  22.131 +Goal "x: HFinite-Infinitesimal ==> x ~= Numeral0";
  22.132  by (Blast_tac 1);
  22.133  qed "HFinite_Infinitesimal_not_zero";
  22.134  
  22.135 @@ -455,7 +455,7 @@
  22.136  Goalw [Infinitesimal_def,HFinite_def]  
  22.137        "Infinitesimal <= HFinite";
  22.138  by Auto_tac;  
  22.139 -by (res_inst_tac [("x","#1")] bexI 1); 
  22.140 +by (res_inst_tac [("x","Numeral1")] bexI 1); 
  22.141  by Auto_tac;  
  22.142  qed "Infinitesimal_subset_HFinite";
  22.143  
  22.144 @@ -474,15 +474,15 @@
  22.145   ----------------------------------------------------------------------*)
  22.146  
  22.147  Goalw [Infinitesimal_def,approx_def] 
  22.148 -        "(x:Infinitesimal) = (x @= #0)";
  22.149 +        "(x:Infinitesimal) = (x @= Numeral0)";
  22.150  by (Simp_tac 1);
  22.151  qed "mem_infmal_iff";
  22.152  
  22.153 -Goalw [approx_def]" (x @= y) = (x + -y @= #0)";
  22.154 +Goalw [approx_def]" (x @= y) = (x + -y @= Numeral0)";
  22.155  by (Simp_tac 1);
  22.156  qed "approx_minus_iff";
  22.157  
  22.158 -Goalw [approx_def]" (x @= y) = (-y + x @= #0)";
  22.159 +Goalw [approx_def]" (x @= y) = (-y + x @= Numeral0)";
  22.160  by (simp_tac (simpset() addsimps [hypreal_add_commute]) 1);
  22.161  qed "approx_minus_iff2";
  22.162  
  22.163 @@ -704,36 +704,36 @@
  22.164              approx_hypreal_of_real_HFinite,HFinite_hypreal_of_real]) 1);
  22.165  qed "approx_mult_hypreal_of_real";
  22.166  
  22.167 -Goal "[| a: Reals; a ~= #0; a*x @= #0 |] ==> x @= #0";
  22.168 +Goal "[| a: Reals; a ~= Numeral0; a*x @= Numeral0 |] ==> x @= Numeral0";
  22.169  by (dtac (SReal_inverse RS (SReal_subset_HFinite RS subsetD)) 1);
  22.170  by (auto_tac (claset() addDs [approx_mult2],
  22.171      simpset() addsimps [hypreal_mult_assoc RS sym]));
  22.172  qed "approx_SReal_mult_cancel_zero";
  22.173  
  22.174  (* REM comments: newly added *)
  22.175 -Goal "[| a: Reals; x @= #0 |] ==> x*a @= #0";
  22.176 +Goal "[| a: Reals; x @= Numeral0 |] ==> x*a @= Numeral0";
  22.177  by (auto_tac (claset() addDs [(SReal_subset_HFinite RS subsetD),
  22.178                approx_mult1], simpset()));
  22.179  qed "approx_mult_SReal1";
  22.180  
  22.181 -Goal "[| a: Reals; x @= #0 |] ==> a*x @= #0";
  22.182 +Goal "[| a: Reals; x @= Numeral0 |] ==> a*x @= Numeral0";
  22.183  by (auto_tac (claset() addDs [(SReal_subset_HFinite RS subsetD),
  22.184                approx_mult2], simpset()));
  22.185  qed "approx_mult_SReal2";
  22.186  
  22.187 -Goal "[|a : Reals; a ~= #0 |] ==> (a*x @= #0) = (x @= #0)";
  22.188 +Goal "[|a : Reals; a ~= Numeral0 |] ==> (a*x @= Numeral0) = (x @= Numeral0)";
  22.189  by (blast_tac (claset() addIs [approx_SReal_mult_cancel_zero,
  22.190      approx_mult_SReal2]) 1);
  22.191  qed "approx_mult_SReal_zero_cancel_iff";
  22.192  Addsimps [approx_mult_SReal_zero_cancel_iff];
  22.193  
  22.194 -Goal "[| a: Reals; a ~= #0; a* w @= a*z |] ==> w @= z";
  22.195 +Goal "[| a: Reals; a ~= Numeral0; a* w @= a*z |] ==> w @= z";
  22.196  by (dtac (SReal_inverse RS (SReal_subset_HFinite RS subsetD)) 1);
  22.197  by (auto_tac (claset() addDs [approx_mult2],
  22.198      simpset() addsimps [hypreal_mult_assoc RS sym]));
  22.199  qed "approx_SReal_mult_cancel";
  22.200  
  22.201 -Goal "[| a: Reals; a ~= #0|] ==> (a* w @= a*z) = (w @= z)";
  22.202 +Goal "[| a: Reals; a ~= Numeral0|] ==> (a* w @= a*z) = (w @= z)";
  22.203  by (auto_tac (claset() addSIs [approx_mult2,SReal_subset_HFinite RS subsetD] 
  22.204      addIs [approx_SReal_mult_cancel], simpset()));
  22.205  qed "approx_SReal_mult_cancel_iff1";
  22.206 @@ -754,50 +754,50 @@
  22.207   -----------------------------------------------------------------*)
  22.208  
  22.209  Goalw [Infinitesimal_def] 
  22.210 -     "[| x: Reals; y: Infinitesimal; #0 < x |] ==> y < x";
  22.211 +     "[| x: Reals; y: Infinitesimal; Numeral0 < x |] ==> y < x";
  22.212  by (rtac (hrabs_ge_self RS order_le_less_trans) 1);
  22.213  by Auto_tac;  
  22.214  qed "Infinitesimal_less_SReal";
  22.215  
  22.216 -Goal "y: Infinitesimal ==> ALL r: Reals. #0 < r --> y < r";
  22.217 +Goal "y: Infinitesimal ==> ALL r: Reals. Numeral0 < r --> y < r";
  22.218  by (blast_tac (claset() addIs [Infinitesimal_less_SReal]) 1);
  22.219  qed "Infinitesimal_less_SReal2";
  22.220  
  22.221  Goalw [Infinitesimal_def] 
  22.222 -     "[| #0 < y;  y: Reals|] ==> y ~: Infinitesimal";
  22.223 +     "[| Numeral0 < y;  y: Reals|] ==> y ~: Infinitesimal";
  22.224  by (auto_tac (claset(), simpset() addsimps [hrabs_def]));
  22.225  qed "SReal_not_Infinitesimal";
  22.226  
  22.227 -Goal "[| y < #0;  y : Reals |] ==> y ~: Infinitesimal";
  22.228 +Goal "[| y < Numeral0;  y : Reals |] ==> y ~: Infinitesimal";
  22.229  by (stac (Infinitesimal_minus_iff RS sym) 1); 
  22.230  by (rtac SReal_not_Infinitesimal 1); 
  22.231  by Auto_tac;  
  22.232  qed "SReal_minus_not_Infinitesimal";
  22.233  
  22.234 -Goal "Reals Int Infinitesimal = {#0}";
  22.235 +Goal "Reals Int Infinitesimal = {Numeral0}";
  22.236  by Auto_tac;
  22.237 -by (cut_inst_tac [("x","x"),("y","#0")] hypreal_linear 1);
  22.238 +by (cut_inst_tac [("x","x"),("y","Numeral0")] hypreal_linear 1);
  22.239  by (blast_tac (claset() addDs [SReal_not_Infinitesimal,
  22.240                                 SReal_minus_not_Infinitesimal]) 1);
  22.241  qed "SReal_Int_Infinitesimal_zero";
  22.242  
  22.243 -Goal "[| x: Reals; x: Infinitesimal|] ==> x = #0";
  22.244 +Goal "[| x: Reals; x: Infinitesimal|] ==> x = Numeral0";
  22.245  by (cut_facts_tac [SReal_Int_Infinitesimal_zero] 1);
  22.246  by (Blast_tac 1);
  22.247  qed "SReal_Infinitesimal_zero";
  22.248  
  22.249 -Goal "[| x : Reals; x ~= #0 |] ==> x : HFinite - Infinitesimal";
  22.250 +Goal "[| x : Reals; x ~= Numeral0 |] ==> x : HFinite - Infinitesimal";
  22.251  by (auto_tac (claset() addDs [SReal_Infinitesimal_zero,
  22.252                                SReal_subset_HFinite RS subsetD], 
  22.253                simpset()));
  22.254  qed "SReal_HFinite_diff_Infinitesimal";
  22.255  
  22.256 -Goal "hypreal_of_real x ~= #0 ==> hypreal_of_real x : HFinite - Infinitesimal";
  22.257 +Goal "hypreal_of_real x ~= Numeral0 ==> hypreal_of_real x : HFinite - Infinitesimal";
  22.258  by (rtac SReal_HFinite_diff_Infinitesimal 1);
  22.259  by Auto_tac;
  22.260  qed "hypreal_of_real_HFinite_diff_Infinitesimal";
  22.261  
  22.262 -Goal "(hypreal_of_real x : Infinitesimal) = (x=#0)";
  22.263 +Goal "(hypreal_of_real x : Infinitesimal) = (x=Numeral0)";
  22.264  by (auto_tac (claset(), simpset() addsimps [hypreal_of_real_zero]));  
  22.265  by (rtac ccontr 1); 
  22.266  by (rtac (hypreal_of_real_HFinite_diff_Infinitesimal RS DiffD2) 1); 
  22.267 @@ -805,12 +805,12 @@
  22.268  qed "hypreal_of_real_Infinitesimal_iff_0";
  22.269  AddIffs [hypreal_of_real_Infinitesimal_iff_0];
  22.270  
  22.271 -Goal "number_of w ~= (#0::hypreal) ==> number_of w ~: Infinitesimal";
  22.272 +Goal "number_of w ~= (Numeral0::hypreal) ==> number_of w ~: Infinitesimal";
  22.273  by (fast_tac (claset() addDs [SReal_number_of RS SReal_Infinitesimal_zero]) 1);
  22.274  qed "number_of_not_Infinitesimal";
  22.275  Addsimps [number_of_not_Infinitesimal];
  22.276  
  22.277 -Goal "[| y: Reals; x @= y; y~= #0 |] ==> x ~= #0";
  22.278 +Goal "[| y: Reals; x @= y; y~= Numeral0 |] ==> x ~= Numeral0";
  22.279  by (cut_inst_tac [("x","y")] hypreal_trichotomy 1);
  22.280  by (Asm_full_simp_tac 1); 
  22.281  by (blast_tac (claset() addDs 
  22.282 @@ -828,7 +828,7 @@
  22.283  
  22.284  (*The premise y~=0 is essential; otherwise x/y =0 and we lose the 
  22.285    HFinite premise.*)
  22.286 -Goal "[| y ~= #0;  y: Infinitesimal;  x/y : HFinite |] ==> x : Infinitesimal";
  22.287 +Goal "[| y ~= Numeral0;  y: Infinitesimal;  x/y : HFinite |] ==> x : Infinitesimal";
  22.288  by (dtac Infinitesimal_HFinite_mult2 1);
  22.289  by (assume_tac 1);
  22.290  by (asm_full_simp_tac 
  22.291 @@ -912,7 +912,7 @@
  22.292      lemma_st_part_nonempty, lemma_st_part_subset]) 1);
  22.293  qed "lemma_st_part_lub";
  22.294  
  22.295 -Goal "((t::hypreal) + r <= t) = (r <= #0)";
  22.296 +Goal "((t::hypreal) + r <= t) = (r <= Numeral0)";
  22.297  by (Step_tac 1);
  22.298  by (dres_inst_tac [("x","-t")] hypreal_add_left_le_mono1 1);
  22.299  by (dres_inst_tac [("x","t")] hypreal_add_left_le_mono1 2);
  22.300 @@ -920,7 +920,7 @@
  22.301  qed "lemma_hypreal_le_left_cancel";
  22.302  
  22.303  Goal "[| x: HFinite;  isLub Reals {s. s: Reals & s < x} t; \
  22.304 -\        r: Reals;  #0 < r |] ==> x <= t + r";
  22.305 +\        r: Reals;  Numeral0 < r |] ==> x <= t + r";
  22.306  by (forward_tac [isLubD1a] 1);
  22.307  by (rtac ccontr 1 THEN dtac (linorder_not_le RS iffD2) 1);
  22.308  by (dres_inst_tac [("x","t")] SReal_add 1 THEN assume_tac 1);
  22.309 @@ -945,14 +945,14 @@
  22.310      addIs [order_less_imp_le] addSIs [isUbI,setleI], simpset()));
  22.311  qed "lemma_st_part_gt_ub";
  22.312  
  22.313 -Goal "t <= t + -r ==> r <= (#0::hypreal)";
  22.314 +Goal "t <= t + -r ==> r <= (Numeral0::hypreal)";
  22.315  by (dres_inst_tac [("x","-t")] hypreal_add_left_le_mono1 1);
  22.316  by (auto_tac (claset(), simpset() addsimps [hypreal_add_assoc RS sym]));
  22.317  qed "lemma_minus_le_zero";
  22.318  
  22.319  Goal "[| x: HFinite; \
  22.320  \        isLub Reals {s. s: Reals & s < x} t; \
  22.321 -\        r: Reals; #0 < r |] \
  22.322 +\        r: Reals; Numeral0 < r |] \
  22.323  \     ==> t + -r <= x";
  22.324  by (forward_tac [isLubD1a] 1);
  22.325  by (rtac ccontr 1 THEN dtac not_hypreal_leE 1);
  22.326 @@ -970,7 +970,7 @@
  22.327  
  22.328  Goal "[| x: HFinite; \
  22.329  \        isLub Reals {s. s: Reals & s < x} t; \
  22.330 -\        r: Reals; #0 < r |] \
  22.331 +\        r: Reals; Numeral0 < r |] \
  22.332  \     ==> x + -t <= r";
  22.333  by (blast_tac (claset() addSIs [lemma_hypreal_le_swap RS iffD1,
  22.334                                  lemma_st_part_le1]) 1);
  22.335 @@ -982,7 +982,7 @@
  22.336  
  22.337  Goal "[| x: HFinite; \
  22.338  \        isLub Reals {s. s: Reals & s < x} t; \
  22.339 -\        r: Reals;  #0 < r |] \
  22.340 +\        r: Reals;  Numeral0 < r |] \
  22.341  \     ==> -(x + -t) <= r";
  22.342  by (blast_tac (claset() addSIs [lemma_hypreal_le_swap2 RS iffD1,
  22.343                                  lemma_st_part_le2]) 1);
  22.344 @@ -1004,7 +1004,7 @@
  22.345  
  22.346  Goal "[| x: HFinite; \
  22.347  \        isLub Reals {s. s: Reals & s < x} t; \
  22.348 -\        r: Reals; #0 < r |] \
  22.349 +\        r: Reals; Numeral0 < r |] \
  22.350  \     ==> x + -t ~= r";
  22.351  by Auto_tac;
  22.352  by (forward_tac [isLubD1a RS SReal_minus] 1);
  22.353 @@ -1016,7 +1016,7 @@
  22.354  
  22.355  Goal "[| x: HFinite; \
  22.356  \        isLub Reals {s. s: Reals & s < x} t; \
  22.357 -\        r: Reals; #0 < r |] \
  22.358 +\        r: Reals; Numeral0 < r |] \
  22.359  \     ==> -(x + -t) ~= r";
  22.360  by (auto_tac (claset(), simpset() addsimps [hypreal_minus_add_distrib]));
  22.361  by (forward_tac [isLubD1a] 1);
  22.362 @@ -1030,7 +1030,7 @@
  22.363  
  22.364  Goal "[| x: HFinite; \
  22.365  \        isLub Reals {s. s: Reals & s < x} t; \
  22.366 -\        r: Reals; #0 < r |] \
  22.367 +\        r: Reals; Numeral0 < r |] \
  22.368  \     ==> abs (x + -t) < r";
  22.369  by (forward_tac [lemma_st_part1a] 1);
  22.370  by (forward_tac [lemma_st_part2a] 4);
  22.371 @@ -1042,7 +1042,7 @@
  22.372  
  22.373  Goal "[| x: HFinite; \
  22.374  \        isLub Reals {s. s: Reals & s < x} t |] \
  22.375 -\     ==> ALL r: Reals. #0 < r --> abs (x + -t) < r";
  22.376 +\     ==> ALL r: Reals. Numeral0 < r --> abs (x + -t) < r";
  22.377  by (blast_tac (claset() addSDs [lemma_st_part_major]) 1);
  22.378  qed "lemma_st_part_major2";
  22.379  
  22.380 @@ -1050,7 +1050,7 @@
  22.381    Existence of real and Standard Part Theorem
  22.382   ----------------------------------------------*)
  22.383  Goal "x: HFinite ==> \
  22.384 -\     EX t: Reals. ALL r: Reals. #0 < r --> abs (x + -t) < r";
  22.385 +\     EX t: Reals. ALL r: Reals. Numeral0 < r --> abs (x + -t) < r";
  22.386  by (forward_tac [lemma_st_part_lub] 1 THEN Step_tac 1);
  22.387  by (forward_tac [isLubD1a] 1);
  22.388  by (blast_tac (claset() addDs [lemma_st_part_major2]) 1);
  22.389 @@ -1089,7 +1089,7 @@
  22.390  
  22.391  Goalw [HInfinite_def, HFinite_def] "x~: HFinite ==> x: HInfinite";
  22.392  by Auto_tac;  
  22.393 -by (dres_inst_tac [("x","r + #1")] bspec 1);
  22.394 +by (dres_inst_tac [("x","r + Numeral1")] bspec 1);
  22.395  by (auto_tac (claset(), simpset() addsimps [SReal_add]));   
  22.396  qed "not_HFinite_HInfinite";
  22.397  
  22.398 @@ -1241,16 +1241,16 @@
  22.399  by Auto_tac;
  22.400  qed "mem_monad_iff";
  22.401  
  22.402 -Goalw [monad_def] "(x:Infinitesimal) = (x:monad #0)";
  22.403 +Goalw [monad_def] "(x:Infinitesimal) = (x:monad Numeral0)";
  22.404  by (auto_tac (claset() addIs [approx_sym],
  22.405      simpset() addsimps [mem_infmal_iff]));
  22.406  qed "Infinitesimal_monad_zero_iff";
  22.407  
  22.408 -Goal "(x:monad #0) = (-x:monad #0)";
  22.409 +Goal "(x:monad Numeral0) = (-x:monad Numeral0)";
  22.410  by (simp_tac (simpset() addsimps [Infinitesimal_monad_zero_iff RS sym]) 1);
  22.411  qed "monad_zero_minus_iff";
  22.412  
  22.413 -Goal "(x:monad #0) = (abs x:monad #0)";
  22.414 +Goal "(x:monad Numeral0) = (abs x:monad Numeral0)";
  22.415  by (res_inst_tac [("x1","x")] (hrabs_disj RS disjE) 1);
  22.416  by (auto_tac (claset(), simpset() addsimps [monad_zero_minus_iff RS sym]));
  22.417  qed "monad_zero_hrabs_iff";
  22.418 @@ -1286,7 +1286,7 @@
  22.419  by (blast_tac (claset() addSIs [approx_sym]) 1);
  22.420  qed "approx_mem_monad2";
  22.421  
  22.422 -Goal "[| x @= y;x:monad #0 |] ==> y:monad #0";
  22.423 +Goal "[| x @= y;x:monad Numeral0 |] ==> y:monad Numeral0";
  22.424  by (dtac mem_monad_approx 1);
  22.425  by (fast_tac (claset() addIs [approx_mem_monad,approx_trans]) 1);
  22.426  qed "approx_mem_monad_zero";
  22.427 @@ -1297,7 +1297,7 @@
  22.428       monad_zero_hrabs_iff RS iffD1, mem_monad_approx, approx_trans3]) 1);
  22.429  qed "Infinitesimal_approx_hrabs";
  22.430  
  22.431 -Goal "[| #0 < x;  x ~:Infinitesimal;  e :Infinitesimal |] ==> e < x";
  22.432 +Goal "[| Numeral0 < x;  x ~:Infinitesimal;  e :Infinitesimal |] ==> e < x";
  22.433  by (rtac ccontr 1);
  22.434  by (auto_tac (claset()
  22.435                 addIs [Infinitesimal_zero RSN (2, Infinitesimal_interval)] 
  22.436 @@ -1305,38 +1305,38 @@
  22.437                simpset()));
  22.438  qed "less_Infinitesimal_less";
  22.439  
  22.440 -Goal "[| #0 < x;  x ~: Infinitesimal; u: monad x |] ==> #0 < u";
  22.441 +Goal "[| Numeral0 < x;  x ~: Infinitesimal; u: monad x |] ==> Numeral0 < u";
  22.442  by (dtac (mem_monad_approx RS approx_sym) 1);
  22.443  by (etac (bex_Infinitesimal_iff2 RS iffD2 RS bexE) 1);
  22.444  by (dres_inst_tac [("e","-xa")] less_Infinitesimal_less 1);
  22.445  by Auto_tac;  
  22.446  qed "Ball_mem_monad_gt_zero";
  22.447  
  22.448 -Goal "[| x < #0; x ~: Infinitesimal; u: monad x |] ==> u < #0";
  22.449 +Goal "[| x < Numeral0; x ~: Infinitesimal; u: monad x |] ==> u < Numeral0";
  22.450  by (dtac (mem_monad_approx RS approx_sym) 1);
  22.451  by (etac (bex_Infinitesimal_iff RS iffD2 RS bexE) 1);
  22.452  by (cut_inst_tac [("x","-x"),("e","xa")] less_Infinitesimal_less 1);
  22.453  by Auto_tac;  
  22.454  qed "Ball_mem_monad_less_zero";
  22.455  
  22.456 -Goal "[|#0 < x; x ~: Infinitesimal; x @= y|] ==> #0 < y";
  22.457 +Goal "[|Numeral0 < x; x ~: Infinitesimal; x @= y|] ==> Numeral0 < y";
  22.458  by (blast_tac (claset() addDs [Ball_mem_monad_gt_zero,
  22.459                                 approx_subset_monad]) 1);
  22.460  qed "lemma_approx_gt_zero";
  22.461  
  22.462 -Goal "[|x < #0; x ~: Infinitesimal; x @= y|] ==> y < #0";
  22.463 +Goal "[|x < Numeral0; x ~: Infinitesimal; x @= y|] ==> y < Numeral0";
  22.464  by (blast_tac (claset() addDs [Ball_mem_monad_less_zero,
  22.465      approx_subset_monad]) 1);
  22.466  qed "lemma_approx_less_zero";
  22.467  
  22.468 -Goal "[| x @= y; x < #0; x ~: Infinitesimal |] ==> abs x @= abs y";
  22.469 +Goal "[| x @= y; x < Numeral0; x ~: Infinitesimal |] ==> abs x @= abs y";
  22.470  by (forward_tac [lemma_approx_less_zero] 1);
  22.471  by (REPEAT(assume_tac 1));
  22.472  by (REPEAT(dtac hrabs_minus_eqI2 1));
  22.473  by Auto_tac;
  22.474  qed "approx_hrabs1";
  22.475  
  22.476 -Goal "[| x @= y; #0 < x; x ~: Infinitesimal |] ==> abs x @= abs y";
  22.477 +Goal "[| x @= y; Numeral0 < x; x ~: Infinitesimal |] ==> abs x @= abs y";
  22.478  by (forward_tac [lemma_approx_gt_zero] 1);
  22.479  by (REPEAT(assume_tac 1));
  22.480  by (REPEAT(dtac hrabs_eqI2 1));
  22.481 @@ -1345,12 +1345,12 @@
  22.482  
  22.483  Goal "x @= y ==> abs x @= abs y";
  22.484  by (res_inst_tac [("Q","x:Infinitesimal")] (excluded_middle RS disjE) 1);
  22.485 -by (res_inst_tac [("x1","x"),("y1","#0")] (hypreal_linear RS disjE) 1);
  22.486 +by (res_inst_tac [("x1","x"),("y1","Numeral0")] (hypreal_linear RS disjE) 1);
  22.487  by (auto_tac (claset() addIs [approx_hrabs1,approx_hrabs2,
  22.488      Infinitesimal_approx_hrabs], simpset()));
  22.489  qed "approx_hrabs";
  22.490  
  22.491 -Goal "abs(x) @= #0 ==> x @= #0";
  22.492 +Goal "abs(x) @= Numeral0 ==> x @= Numeral0";
  22.493  by (cut_inst_tac [("x","x")] hrabs_disj 1);
  22.494  by (auto_tac (claset() addDs [approx_minus], simpset()));
  22.495  qed "approx_hrabs_zero_cancel";
  22.496 @@ -1445,7 +1445,7 @@
  22.497                            hypreal_of_real_le_add_Infininitesimal_cancel]) 1);
  22.498  qed "hypreal_of_real_le_add_Infininitesimal_cancel2";
  22.499  
  22.500 -Goal "[| hypreal_of_real x < e; e: Infinitesimal |] ==> hypreal_of_real x <= #0";
  22.501 +Goal "[| hypreal_of_real x < e; e: Infinitesimal |] ==> hypreal_of_real x <= Numeral0";
  22.502  by (rtac hypreal_leI 1 THEN Step_tac 1);
  22.503  by (dtac Infinitesimal_interval 1);
  22.504  by (dtac (SReal_hypreal_of_real RS SReal_Infinitesimal_zero) 4);
  22.505 @@ -1453,7 +1453,7 @@
  22.506  qed "hypreal_of_real_less_Infinitesimal_le_zero";
  22.507  
  22.508  (*used once, in NSDERIV_inverse*)
  22.509 -Goal "[| h: Infinitesimal; x ~= #0 |] ==> hypreal_of_real x + h ~= #0";
  22.510 +Goal "[| h: Infinitesimal; x ~= Numeral0 |] ==> hypreal_of_real x + h ~= Numeral0";
  22.511  by Auto_tac;  
  22.512  qed "Infinitesimal_add_not_zero";
  22.513  
  22.514 @@ -1524,7 +1524,7 @@
  22.515  qed "HFinite_sum_square_cancel3";
  22.516  Addsimps [HFinite_sum_square_cancel3];
  22.517  
  22.518 -Goal "[| y: monad x; #0 < hypreal_of_real e |] \
  22.519 +Goal "[| y: monad x; Numeral0 < hypreal_of_real e |] \
  22.520  \     ==> abs (y + -x) < hypreal_of_real e";
  22.521  by (dtac (mem_monad_approx RS approx_sym) 1);
  22.522  by (dtac (bex_Infinitesimal_iff RS iffD2) 1);
  22.523 @@ -1682,18 +1682,18 @@
  22.524  by (blast_tac (claset() addSIs [lemma_st_mult]) 1);
  22.525  qed "st_mult";
  22.526  
  22.527 -Goal "x: Infinitesimal ==> st x = #0";
  22.528 +Goal "x: Infinitesimal ==> st x = Numeral0";
  22.529  by (rtac (st_number_of RS subst) 1);
  22.530  by (rtac approx_st_eq 1);
  22.531  by (auto_tac (claset() addIs [Infinitesimal_subset_HFinite RS subsetD],
  22.532                simpset() addsimps [mem_infmal_iff RS sym]));
  22.533  qed "st_Infinitesimal";
  22.534  
  22.535 -Goal "st(x) ~= #0 ==> x ~: Infinitesimal";
  22.536 +Goal "st(x) ~= Numeral0 ==> x ~: Infinitesimal";
  22.537  by (fast_tac (claset() addIs [st_Infinitesimal]) 1);
  22.538  qed "st_not_Infinitesimal";
  22.539  
  22.540 -Goal "[| x: HFinite; st x ~= #0 |] \
  22.541 +Goal "[| x: HFinite; st x ~= Numeral0 |] \
  22.542  \     ==> st(inverse x) = inverse (st x)";
  22.543  by (res_inst_tac [("c1","st x")] (hypreal_mult_left_cancel RS iffD1) 1);
  22.544  by (auto_tac (claset(),
  22.545 @@ -1703,7 +1703,7 @@
  22.546  by Auto_tac;  
  22.547  qed "st_inverse";
  22.548  
  22.549 -Goal "[| x: HFinite; y: HFinite; st y ~= #0 |] \
  22.550 +Goal "[| x: HFinite; y: HFinite; st y ~= Numeral0 |] \
  22.551  \     ==> st(x/y) = (st x) / (st y)";
  22.552  by (auto_tac (claset(),
  22.553        simpset() addsimps [hypreal_divide_def, st_mult, st_not_Infinitesimal, 
  22.554 @@ -1747,20 +1747,20 @@
  22.555           simpset() addsimps [hypreal_add_assoc RS sym]));
  22.556  qed "st_le";
  22.557  
  22.558 -Goal "[| #0 <= x;  x: HFinite |] ==> #0 <= st x";
  22.559 +Goal "[| Numeral0 <= x;  x: HFinite |] ==> Numeral0 <= st x";
  22.560  by (rtac (st_number_of RS subst) 1);
  22.561  by (auto_tac (claset() addIs [st_le],
  22.562                simpset() delsimps [st_number_of]));
  22.563  qed "st_zero_le";
  22.564  
  22.565 -Goal "[| x <= #0;  x: HFinite |] ==> st x <= #0";
  22.566 +Goal "[| x <= Numeral0;  x: HFinite |] ==> st x <= Numeral0";
  22.567  by (rtac (st_number_of RS subst) 1);
  22.568  by (auto_tac (claset() addIs [st_le],
  22.569                simpset() delsimps [st_number_of]));
  22.570  qed "st_zero_ge";
  22.571  
  22.572  Goal "x: HFinite ==> abs(st x) = st(abs x)";
  22.573 -by (case_tac "#0 <= x" 1);
  22.574 +by (case_tac "Numeral0 <= x" 1);
  22.575  by (auto_tac (claset() addSDs [not_hypreal_leE, order_less_imp_le],
  22.576                simpset() addsimps [st_zero_le,hrabs_eqI1, hrabs_minus_eqI1,
  22.577                                    st_zero_ge,st_minus]));
  22.578 @@ -1834,7 +1834,7 @@
  22.579  by Auto_tac;
  22.580  qed "lemma_Int_eq1";
  22.581  
  22.582 -Goal "{n. abs (xa n) = u} <= {n. abs (xa n) < u + (#1::real)}";
  22.583 +Goal "{n. abs (xa n) = u} <= {n. abs (xa n) < u + (Numeral1::real)}";
  22.584  by Auto_tac;
  22.585  qed "lemma_FreeUltrafilterNat_one";
  22.586  
  22.587 @@ -1847,7 +1847,7 @@
  22.588  \              |] ==> x: HFinite";
  22.589  by (rtac FreeUltrafilterNat_HFinite 1);
  22.590  by (res_inst_tac [("x","xa")] bexI 1);
  22.591 -by (res_inst_tac [("x","u + #1")] exI 1);
  22.592 +by (res_inst_tac [("x","u + Numeral1")] exI 1);
  22.593  by (Ultra_tac 1 THEN assume_tac 1);
  22.594  qed "FreeUltrafilterNat_const_Finite";
  22.595  
  22.596 @@ -1915,7 +1915,7 @@
  22.597  
  22.598  Goalw [Infinitesimal_def] 
  22.599            "x : Infinitesimal ==> EX X: Rep_hypreal x. \
  22.600 -\          ALL u. #0 < u --> {n. abs (X n) < u}:  FreeUltrafilterNat";
  22.601 +\          ALL u. Numeral0 < u --> {n. abs (X n) < u}:  FreeUltrafilterNat";
  22.602  by (auto_tac (claset(), simpset() addsimps [hrabs_interval_iff]));
  22.603  by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
  22.604  by (EVERY[Auto_tac, rtac bexI 1, rtac lemma_hyprel_refl 2, Step_tac 1]);
  22.605 @@ -1930,7 +1930,7 @@
  22.606  
  22.607  Goalw [Infinitesimal_def] 
  22.608       "EX X: Rep_hypreal x. \
  22.609 -\           ALL u. #0 < u --> {n. abs (X n) < u} : FreeUltrafilterNat \
  22.610 +\           ALL u. Numeral0 < u --> {n. abs (X n) < u} : FreeUltrafilterNat \
  22.611  \     ==> x : Infinitesimal";
  22.612  by (auto_tac (claset(),
  22.613                simpset() addsimps [hrabs_interval_iff,abs_interval_iff]));
  22.614 @@ -1942,7 +1942,7 @@
  22.615  qed "FreeUltrafilterNat_Infinitesimal";
  22.616  
  22.617  Goal "(x : Infinitesimal) = (EX X: Rep_hypreal x. \
  22.618 -\          ALL u. #0 < u --> {n. abs (X n) < u}:  FreeUltrafilterNat)";
  22.619 +\          ALL u. Numeral0 < u --> {n. abs (X n) < u}:  FreeUltrafilterNat)";
  22.620  by (blast_tac (claset() addSIs [Infinitesimal_FreeUltrafilterNat,
  22.621                 FreeUltrafilterNat_Infinitesimal]) 1);
  22.622  qed "Infinitesimal_FreeUltrafilterNat_iff";
  22.623 @@ -1951,13 +1951,13 @@
  22.624           Infinitesimals as smaller than 1/n for all n::nat (> 0)
  22.625   ------------------------------------------------------------------------*)
  22.626  
  22.627 -Goal "(ALL r. #0 < r --> x < r) = (ALL n. x < inverse(real (Suc n)))";
  22.628 +Goal "(ALL r. Numeral0 < r --> x < r) = (ALL n. x < inverse(real (Suc n)))";
  22.629  by (auto_tac (claset(), simpset() addsimps [real_of_nat_Suc_gt_zero]));
  22.630  by (blast_tac (claset() addSDs [reals_Archimedean] 
  22.631                          addIs [order_less_trans]) 1);
  22.632  qed "lemma_Infinitesimal";
  22.633  
  22.634 -Goal "(ALL r: Reals. #0 < r --> x < r) = \
  22.635 +Goal "(ALL r: Reals. Numeral0 < r --> x < r) = \
  22.636  \     (ALL n. x < inverse(hypreal_of_nat (Suc n)))";
  22.637  by (Step_tac 1);
  22.638  by (dres_inst_tac [("x","inverse (hypreal_of_real(real (Suc n)))")] 
  22.639 @@ -2089,7 +2089,7 @@
  22.640  qed "HFinite_epsilon";
  22.641  Addsimps [HFinite_epsilon];
  22.642  
  22.643 -Goal "epsilon @= #0";
  22.644 +Goal "epsilon @= Numeral0";
  22.645  by (simp_tac (simpset() addsimps [mem_infmal_iff RS sym]) 1);
  22.646  qed "epsilon_approx_zero";
  22.647  Addsimps [epsilon_approx_zero];
  22.648 @@ -2109,7 +2109,7 @@
  22.649  by (simp_tac (simpset() addsimps [real_of_nat_Suc_gt_zero]) 1); 
  22.650  qed "real_of_nat_less_inverse_iff";
  22.651  
  22.652 -Goal "#0 < u ==> finite {n. u < inverse(real(Suc n))}";
  22.653 +Goal "Numeral0 < u ==> finite {n. u < inverse(real(Suc n))}";
  22.654  by (asm_simp_tac (simpset() addsimps [real_of_nat_less_inverse_iff]) 1);
  22.655  by (asm_simp_tac (simpset() addsimps [real_of_nat_Suc, 
  22.656                           real_less_diff_eq RS sym]) 1); 
  22.657 @@ -2122,7 +2122,7 @@
  22.658                simpset() addsimps [order_less_imp_le]));
  22.659  qed "lemma_real_le_Un_eq2";
  22.660  
  22.661 -Goal "(inverse (real(Suc n)) <= r) = (#1 <= r * real(Suc n))";
  22.662 +Goal "(inverse (real(Suc n)) <= r) = (Numeral1 <= r * real(Suc n))";
  22.663  by (simp_tac (simpset() addsimps [linorder_not_less RS sym]) 1); 
  22.664  by (simp_tac (simpset() addsimps [real_inverse_eq_divide]) 1);
  22.665  by (stac pos_real_less_divide_eq 1); 
  22.666 @@ -2138,18 +2138,18 @@
  22.667  
  22.668  Goal "finite {n::nat. u = inverse(real(Suc n))}";
  22.669  by (asm_simp_tac (simpset() addsimps [real_of_nat_inverse_eq_iff]) 1);
  22.670 -by (cut_inst_tac [("x","inverse u - #1")] lemma_finite_omega_set 1);
  22.671 +by (cut_inst_tac [("x","inverse u - Numeral1")] lemma_finite_omega_set 1);
  22.672  by (asm_full_simp_tac (simpset() addsimps [real_of_nat_Suc, 
  22.673                           real_diff_eq_eq RS sym, eq_commute]) 1); 
  22.674  qed "lemma_finite_omega_set2";
  22.675  
  22.676 -Goal "#0 < u ==> finite {n. u <= inverse(real(Suc n))}";
  22.677 +Goal "Numeral0 < u ==> finite {n. u <= inverse(real(Suc n))}";
  22.678  by (auto_tac (claset(), 
  22.679        simpset() addsimps [lemma_real_le_Un_eq2,lemma_finite_omega_set2,
  22.680                            finite_inverse_real_of_posnat_gt_real]));
  22.681  qed "finite_inverse_real_of_posnat_ge_real";
  22.682  
  22.683 -Goal "#0 < u ==> \
  22.684 +Goal "Numeral0 < u ==> \
  22.685  \      {n. u <= inverse(real(Suc n))} ~: FreeUltrafilterNat";
  22.686  by (blast_tac (claset() addSIs [FreeUltrafilterNat_finite,
  22.687                                  finite_inverse_real_of_posnat_ge_real]) 1);
  22.688 @@ -2166,7 +2166,7 @@
  22.689                simpset() addsimps [not_real_leE]));
  22.690  val lemma = result();
  22.691  
  22.692 -Goal "#0 < u ==> \
  22.693 +Goal "Numeral0 < u ==> \
  22.694  \     {n. inverse(real(Suc n)) < u} : FreeUltrafilterNat";
  22.695  by (cut_inst_tac [("u","u")]  inverse_real_of_posnat_ge_real_FreeUltrafilterNat 1);
  22.696  by (auto_tac (claset() addDs [FreeUltrafilterNat_Compl_mem],
    23.1 --- a/src/HOL/Hyperreal/NatStar.ML	Fri Oct 05 21:50:37 2001 +0200
    23.2 +++ b/src/HOL/Hyperreal/NatStar.ML	Fri Oct 05 21:52:39 2001 +0200
    23.3 @@ -404,7 +404,7 @@
    23.4  Goal "N : HNatInfinite \
    23.5  \  ==> (*fNat* (%x::nat. inverse(real x))) N = inverse(hypreal_of_hypnat N)";
    23.6  by (res_inst_tac [("f1","inverse")]  (starfun_stafunNat_o2 RS subst) 1);
    23.7 -by (subgoal_tac "hypreal_of_hypnat N ~= #0" 1);
    23.8 +by (subgoal_tac "hypreal_of_hypnat N ~= Numeral0" 1);
    23.9  by (auto_tac (claset(), 
   23.10         simpset() addsimps [starfunNat_real_of_nat, starfun_inverse_inverse]));
   23.11  qed "starfunNat_inverse_real_of_nat_eq";
    24.1 --- a/src/HOL/Hyperreal/SEQ.ML	Fri Oct 05 21:50:37 2001 +0200
    24.2 +++ b/src/HOL/Hyperreal/SEQ.ML	Fri Oct 05 21:52:39 2001 +0200
    24.3 @@ -26,7 +26,7 @@
    24.4  
    24.5  Goalw [LIMSEQ_def] 
    24.6        "(X ----> L) = \
    24.7 -\      (ALL r. #0 <r --> (EX no. ALL n. no <= n --> abs(X n + -L) < r))";
    24.8 +\      (ALL r. Numeral0 <r --> (EX no. ALL n. no <= n --> abs(X n + -L) < r))";
    24.9  by (Simp_tac 1);
   24.10  qed "LIMSEQ_iff";
   24.11  
   24.12 @@ -120,7 +120,7 @@
   24.13  by Auto_tac;  
   24.14  val lemmaLIM2 = result();
   24.15  
   24.16 -Goal "[| #0 < r; ALL n. r <= abs (X (f n) + - L); \
   24.17 +Goal "[| Numeral0 < r; ALL n. r <= abs (X (f n) + - L); \
   24.18  \          (*fNat* X) (Abs_hypnat (hypnatrel `` {f})) + \
   24.19  \          - hypreal_of_real  L @= 0 |] ==> False";
   24.20  by (auto_tac (claset(),simpset() addsimps [starfunNat,
   24.21 @@ -234,7 +234,7 @@
   24.22      Proof is like that of NSLIM_inverse.
   24.23   --------------------------------------------------------------*)
   24.24  Goalw [NSLIMSEQ_def] 
   24.25 -     "[| X ----NS> a;  a ~= #0 |] ==> (%n. inverse(X n)) ----NS> inverse(a)";
   24.26 +     "[| X ----NS> a;  a ~= Numeral0 |] ==> (%n. inverse(X n)) ----NS> inverse(a)";
   24.27  by (Clarify_tac 1);
   24.28  by (dtac bspec 1);
   24.29  by (auto_tac (claset(), 
   24.30 @@ -244,18 +244,18 @@
   24.31  
   24.32  
   24.33  (*------ Standard version of theorem -------*)
   24.34 -Goal "[| X ----> a; a ~= #0 |] ==> (%n. inverse(X n)) ----> inverse(a)";
   24.35 +Goal "[| X ----> a; a ~= Numeral0 |] ==> (%n. inverse(X n)) ----> inverse(a)";
   24.36  by (asm_full_simp_tac (simpset() addsimps [NSLIMSEQ_inverse,
   24.37      LIMSEQ_NSLIMSEQ_iff]) 1);
   24.38  qed "LIMSEQ_inverse";
   24.39  
   24.40 -Goal "[| X ----NS> a;  Y ----NS> b;  b ~= #0 |] \
   24.41 +Goal "[| X ----NS> a;  Y ----NS> b;  b ~= Numeral0 |] \
   24.42  \     ==> (%n. X n / Y n) ----NS> a/b";
   24.43  by (asm_full_simp_tac (simpset() addsimps [NSLIMSEQ_mult, NSLIMSEQ_inverse, 
   24.44                                             real_divide_def]) 1);
   24.45  qed "NSLIMSEQ_mult_inverse";
   24.46  
   24.47 -Goal "[| X ----> a;  Y ----> b;  b ~= #0 |] ==> (%n. X n / Y n) ----> a/b";
   24.48 +Goal "[| X ----> a;  Y ----> b;  b ~= Numeral0 |] ==> (%n. X n / Y n) ----> a/b";
   24.49  by (asm_full_simp_tac (simpset() addsimps [LIMSEQ_mult, LIMSEQ_inverse, 
   24.50                                             real_divide_def]) 1);
   24.51  qed "LIMSEQ_divide";
   24.52 @@ -376,16 +376,16 @@
   24.53                    Bounded Sequence
   24.54   ------------------------------------------------------------------*)
   24.55  Goalw [Bseq_def] 
   24.56 -      "Bseq X ==> EX K. #0 < K & (ALL n. abs(X n) <= K)";
   24.57 +      "Bseq X ==> EX K. Numeral0 < K & (ALL n. abs(X n) <= K)";
   24.58  by (assume_tac 1);
   24.59  qed "BseqD";
   24.60  
   24.61  Goalw [Bseq_def]
   24.62 -      "[| #0 < K; ALL n. abs(X n) <= K |] ==> Bseq X";
   24.63 +      "[| Numeral0 < K; ALL n. abs(X n) <= K |] ==> Bseq X";
   24.64  by (Blast_tac 1);
   24.65  qed "BseqI";
   24.66  
   24.67 -Goal "(EX K. #0 < K & (ALL n. abs(X n) <= K)) = \
   24.68 +Goal "(EX K. Numeral0 < K & (ALL n. abs(X n) <= K)) = \
   24.69  \     (EX N. ALL n. abs(X n) <= real(Suc N))";
   24.70  by Auto_tac;
   24.71  by (cut_inst_tac [("x","K")] reals_Archimedean2 1);
   24.72 @@ -401,7 +401,7 @@
   24.73  by (simp_tac (simpset() addsimps [lemma_NBseq_def]) 1);
   24.74  qed "Bseq_iff";
   24.75  
   24.76 -Goal "(EX K. #0 < K & (ALL n. abs(X n) <= K)) = \
   24.77 +Goal "(EX K. Numeral0 < K & (ALL n. abs(X n) <= K)) = \
   24.78  \     (EX N. ALL n. abs(X n) < real(Suc N))";
   24.79  by (stac lemma_NBseq_def 1); 
   24.80  by Auto_tac;
   24.81 @@ -444,7 +444,7 @@
   24.82                                    HNatInfinite_FreeUltrafilterNat_iff]));
   24.83  by (EVERY[rtac bexI 1, rtac lemma_hyprel_refl 2]);
   24.84  by (dres_inst_tac [("f","Xa")] lemma_Bseq 1); 
   24.85 -by (res_inst_tac [("x","K+#1")] exI 1);
   24.86 +by (res_inst_tac [("x","K+Numeral1")] exI 1);
   24.87  by (rotate_tac 2 1 THEN dtac FreeUltrafilterNat_all 1);
   24.88  by (Ultra_tac 1);
   24.89  qed "Bseq_NSBseq";
   24.90 @@ -461,14 +461,14 @@
   24.91     is not what we want (read useless!)
   24.92   -------------------------------------------------------------------*)
   24.93   
   24.94 -Goal "ALL K. #0 < K --> (EX n. K < abs (X n)) \
   24.95 +Goal "ALL K. Numeral0 < K --> (EX n. K < abs (X n)) \
   24.96  \          ==> ALL N. EX n. real(Suc N) < abs (X n)";
   24.97  by (Step_tac 1);
   24.98  by (cut_inst_tac [("n","N")] real_of_nat_Suc_gt_zero 1);
   24.99  by (Blast_tac 1);
  24.100  val lemmaNSBseq = result();
  24.101  
  24.102 -Goal "ALL K. #0 < K --> (EX n. K < abs (X n)) \
  24.103 +Goal "ALL K. Numeral0 < K --> (EX n. K < abs (X n)) \
  24.104  \         ==> EX f. ALL N. real(Suc N) < abs (X (f N))";
  24.105  by (dtac lemmaNSBseq 1);
  24.106  by (dtac choice 1);
  24.107 @@ -652,7 +652,7 @@
  24.108  Goal "!!(X::nat=> real). \
  24.109  \              [| ALL m. X m ~= U; \
  24.110  \                 isLub UNIV {x. EX n. X n = x} U; \
  24.111 -\                 #0 < T; \
  24.112 +\                 Numeral0 < T; \
  24.113  \                 U + - T < U \
  24.114  \              |] ==> EX m. U + -T < X m & X m < U";
  24.115  by (dtac lemma_converg2 1 THEN assume_tac 1);
  24.116 @@ -722,7 +722,7 @@
  24.117   
  24.118  (***--- alternative formulation for boundedness---***)
  24.119  Goalw [Bseq_def] 
  24.120 -   "Bseq X = (EX k x. #0 < k & (ALL n. abs(X(n) + -x) <= k))";
  24.121 +   "Bseq X = (EX k x. Numeral0 < k & (ALL n. abs(X(n) + -x) <= k))";
  24.122  by (Step_tac 1);
  24.123  by (res_inst_tac [("x","k + abs(x)")] exI 2);
  24.124  by (res_inst_tac [("x","K")] exI 1);
  24.125 @@ -733,7 +733,7 @@
  24.126  qed "Bseq_iff2";
  24.127  
  24.128  (***--- alternative formulation for boundedness ---***)
  24.129 -Goal "Bseq X = (EX k N. #0 < k & (ALL n. abs(X(n) + -X(N)) <= k))";
  24.130 +Goal "Bseq X = (EX k N. Numeral0 < k & (ALL n. abs(X(n) + -X(N)) <= k))";
  24.131  by (Step_tac 1);
  24.132  by (asm_full_simp_tac (simpset() addsimps [Bseq_def]) 1);
  24.133  by (Step_tac 1);
  24.134 @@ -748,7 +748,7 @@
  24.135  qed "Bseq_iff3";
  24.136  
  24.137  Goalw [Bseq_def] "(ALL n. k <= f n & f n <= K) ==> Bseq f";
  24.138 -by (res_inst_tac [("x","(abs(k) + abs(K)) + #1")] exI 1);
  24.139 +by (res_inst_tac [("x","(abs(k) + abs(K)) + Numeral1")] exI 1);
  24.140  by (Auto_tac);
  24.141  by (dres_inst_tac [("x","n")] spec 2);
  24.142  by (ALLGOALS arith_tac);
  24.143 @@ -841,8 +841,8 @@
  24.144   -------------------------------------------------------*)
  24.145  
  24.146  (***-------------  VARIOUS LEMMAS --------------***)
  24.147 -Goal "ALL n. M <= n --> abs (X M + - X n) < (#1::real) \
  24.148 -\         ==>  ALL n. M <= n --> abs(X n) < #1 + abs(X M)";
  24.149 +Goal "ALL n. M <= n --> abs (X M + - X n) < (Numeral1::real) \
  24.150 +\         ==>  ALL n. M <= n --> abs(X n) < Numeral1 + abs(X M)";
  24.151  by (Step_tac 1);
  24.152  by (dtac spec 1 THEN Auto_tac);
  24.153  by (arith_tac 1);
  24.154 @@ -911,7 +911,7 @@
  24.155     outlines sketched by various authors would suggest
  24.156   ---------------------------------------------------------*)
  24.157  Goalw [Cauchy_def,Bseq_def] "Cauchy X ==> Bseq X";
  24.158 -by (dres_inst_tac [("x","#1")] spec 1);
  24.159 +by (dres_inst_tac [("x","Numeral1")] spec 1);
  24.160  by (etac (rename_numerals real_zero_less_one RSN (2,impE)) 1);
  24.161  by (Step_tac 1);
  24.162  by (dres_inst_tac [("x","M")] spec 1);
  24.163 @@ -920,7 +920,7 @@
  24.164  by (cut_inst_tac [("M","M"),("X","X")] SUP_rabs_subseq 1);
  24.165  by (Step_tac 1);
  24.166  by (cut_inst_tac [("R1.0","abs(X m)"),
  24.167 -     ("R2.0","#1 + abs(X M)")] real_linear 1);
  24.168 +     ("R2.0","Numeral1 + abs(X M)")] real_linear 1);
  24.169  by (Step_tac 1);
  24.170  by (dtac lemma_trans1 1 THEN assume_tac 1);
  24.171  by (dtac lemma_trans2 3 THEN assume_tac 3);
  24.172 @@ -928,8 +928,8 @@
  24.173  by (dtac (abs_add_one_gt_zero RS order_less_trans) 3);
  24.174  by (dtac lemma_trans4 1);
  24.175  by (dtac lemma_trans4 2);
  24.176 -by (res_inst_tac [("x","#1 + abs(X M)")] exI 1);
  24.177 -by (res_inst_tac [("x","#1 + abs(X M)")] exI 2);
  24.178 +by (res_inst_tac [("x","Numeral1 + abs(X M)")] exI 1);
  24.179 +by (res_inst_tac [("x","Numeral1 + abs(X M)")] exI 2);
  24.180  by (res_inst_tac [("x","abs(X m)")] exI 3);
  24.181  by (auto_tac (claset() addSEs [lemma_Nat_covered],
  24.182                simpset()));
  24.183 @@ -1082,7 +1082,7 @@
  24.184   ----------------------------------------------------*)
  24.185  (* we can prove this directly since proof is trivial *)
  24.186  Goalw [LIMSEQ_def] 
  24.187 -      "((%n. abs(f n)) ----> #0) = (f ----> #0)";
  24.188 +      "((%n. abs(f n)) ----> Numeral0) = (f ----> Numeral0)";
  24.189  by (simp_tac (simpset() addsimps [abs_idempotent]) 1);
  24.190  qed "LIMSEQ_rabs_zero";
  24.191  
  24.192 @@ -1092,7 +1092,7 @@
  24.193  (* than the direct standard one above!                 *)
  24.194  (*-----------------------------------------------------*)
  24.195  
  24.196 -Goal "((%n. abs(f n)) ----NS> #0) = (f ----NS> #0)";
  24.197 +Goal "((%n. abs(f n)) ----NS> Numeral0) = (f ----NS> Numeral0)";
  24.198  by (simp_tac (simpset() addsimps [LIMSEQ_NSLIMSEQ_iff RS sym,
  24.199               LIMSEQ_rabs_zero]) 1);
  24.200  qed "NSLIMSEQ_rabs_zero";
  24.201 @@ -1119,7 +1119,7 @@
  24.202  (* standard proof seems easier *)
  24.203  Goalw [LIMSEQ_def] 
  24.204        "ALL y. EX N. ALL n. N <= n --> y < f(n) \
  24.205 -\      ==> (%n. inverse(f n)) ----> #0";
  24.206 +\      ==> (%n. inverse(f n)) ----> Numeral0";
  24.207  by (Step_tac 1 THEN Asm_full_simp_tac 1);
  24.208  by (dres_inst_tac [("x","inverse r")] spec 1 THEN Step_tac 1);
  24.209  by (res_inst_tac [("x","N")] exI 1 THEN Step_tac 1);
  24.210 @@ -1134,7 +1134,7 @@
  24.211  qed "LIMSEQ_inverse_zero";
  24.212  
  24.213  Goal "ALL y. EX N. ALL n. N <= n --> y < f(n) \
  24.214 -\     ==> (%n. inverse(f n)) ----NS> #0";
  24.215 +\     ==> (%n. inverse(f n)) ----NS> Numeral0";
  24.216  by (asm_simp_tac (simpset() addsimps [LIMSEQ_NSLIMSEQ_iff RS sym,
  24.217                    LIMSEQ_inverse_zero]) 1);
  24.218  qed "NSLIMSEQ_inverse_zero";
  24.219 @@ -1143,7 +1143,7 @@
  24.220               Sequence  1/n --> 0 as n --> infinity 
  24.221   -------------------------------------------------------------*)
  24.222  
  24.223 -Goal "(%n. inverse(real(Suc n))) ----> #0";
  24.224 +Goal "(%n. inverse(real(Suc n))) ----> Numeral0";
  24.225  by (rtac LIMSEQ_inverse_zero 1 THEN Step_tac 1);
  24.226  by (cut_inst_tac [("x","y")] reals_Archimedean2 1);
  24.227  by (Step_tac 1 THEN res_inst_tac [("x","n")] exI 1);
  24.228 @@ -1153,7 +1153,7 @@
  24.229  by (blast_tac (claset() addIs [order_less_le_trans]) 1);  
  24.230  qed "LIMSEQ_inverse_real_of_nat";
  24.231  
  24.232 -Goal "(%n. inverse(real(Suc n))) ----NS> #0";
  24.233 +Goal "(%n. inverse(real(Suc n))) ----NS> Numeral0";
  24.234  by (simp_tac (simpset() addsimps [LIMSEQ_NSLIMSEQ_iff RS sym,
  24.235      LIMSEQ_inverse_real_of_nat]) 1);
  24.236  qed "NSLIMSEQ_inverse_real_of_nat";
  24.237 @@ -1188,13 +1188,13 @@
  24.238      LIMSEQ_inverse_real_of_posnat_add_minus]) 1);
  24.239  qed "NSLIMSEQ_inverse_real_of_posnat_add_minus";
  24.240  
  24.241 -Goal "(%n. r*( #1 + -inverse(real(Suc n)))) ----> r";
  24.242 -by (cut_inst_tac [("b","#1")] ([LIMSEQ_const,
  24.243 +Goal "(%n. r*( Numeral1 + -inverse(real(Suc n)))) ----> r";
  24.244 +by (cut_inst_tac [("b","Numeral1")] ([LIMSEQ_const,
  24.245      LIMSEQ_inverse_real_of_posnat_add_minus] MRS LIMSEQ_mult) 1);
  24.246  by (Auto_tac);
  24.247  qed "LIMSEQ_inverse_real_of_posnat_add_minus_mult";
  24.248  
  24.249 -Goal "(%n. r*( #1 + -inverse(real(Suc n)))) ----NS> r";
  24.250 +Goal "(%n. r*( Numeral1 + -inverse(real(Suc n)))) ----NS> r";
  24.251  by (simp_tac (simpset() addsimps [LIMSEQ_NSLIMSEQ_iff RS sym,
  24.252      LIMSEQ_inverse_real_of_posnat_add_minus_mult]) 1);
  24.253  qed "NSLIMSEQ_inverse_real_of_posnat_add_minus_mult";
  24.254 @@ -1214,22 +1214,22 @@
  24.255  qed "LIMSEQ_pow";
  24.256  
  24.257  (*----------------------------------------------------------------
  24.258 -               0 <= x < #1 ==> (x ^ n ----> 0)
  24.259 +               0 <= x < Numeral1 ==> (x ^ n ----> 0)
  24.260    Proof will use (NS) Cauchy equivalence for convergence and
  24.261    also fact that bounded and monotonic sequence converges.  
  24.262   ---------------------------------------------------------------*)
  24.263 -Goalw [Bseq_def] "[| #0 <= x; x < #1 |] ==> Bseq (%n. x ^ n)";
  24.264 -by (res_inst_tac [("x","#1")] exI 1);
  24.265 +Goalw [Bseq_def] "[| Numeral0 <= x; x < Numeral1 |] ==> Bseq (%n. x ^ n)";
  24.266 +by (res_inst_tac [("x","Numeral1")] exI 1);
  24.267  by (auto_tac (claset() addDs [conjI RS realpow_le] 
  24.268                         addIs [order_less_imp_le], 
  24.269                simpset() addsimps [abs_eqI1, realpow_abs RS sym] ));
  24.270  qed "Bseq_realpow";
  24.271  
  24.272 -Goal "[| #0 <= x; x < #1 |] ==> monoseq (%n. x ^ n)";
  24.273 +Goal "[| Numeral0 <= x; x < Numeral1 |] ==> monoseq (%n. x ^ n)";
  24.274  by (blast_tac (claset() addSIs [mono_SucI2,realpow_Suc_le3]) 1);
  24.275  qed "monoseq_realpow";
  24.276  
  24.277 -Goal "[| #0 <= x; x < #1 |] ==> convergent (%n. x ^ n)";
  24.278 +Goal "[| Numeral0 <= x; x < Numeral1 |] ==> convergent (%n. x ^ n)";
  24.279  by (blast_tac (claset() addSIs [Bseq_monoseq_convergent,
  24.280                                  Bseq_realpow,monoseq_realpow]) 1);
  24.281  qed "convergent_realpow";
  24.282 @@ -1238,7 +1238,7 @@
  24.283  
  24.284  
  24.285  Goalw [NSLIMSEQ_def]
  24.286 -     "[| #0 <= x; x < #1 |] ==> (%n. x ^ n) ----NS> #0";
  24.287 +     "[| Numeral0 <= x; x < Numeral1 |] ==> (%n. x ^ n) ----NS> Numeral0";
  24.288  by (auto_tac (claset() addSDs [convergent_realpow],
  24.289                simpset() addsimps [convergent_NSconvergent_iff]));
  24.290  by (forward_tac [NSconvergentD] 1);
  24.291 @@ -1258,12 +1258,12 @@
  24.292  qed "NSLIMSEQ_realpow_zero";
  24.293  
  24.294  (*---------------  standard version ---------------*)
  24.295 -Goal "[| #0 <= x; x < #1 |] ==> (%n. x ^ n) ----> #0";
  24.296 +Goal "[| Numeral0 <= x; x < Numeral1 |] ==> (%n. x ^ n) ----> Numeral0";
  24.297  by (asm_simp_tac (simpset() addsimps [NSLIMSEQ_realpow_zero,
  24.298                                        LIMSEQ_NSLIMSEQ_iff]) 1);
  24.299  qed "LIMSEQ_realpow_zero";
  24.300  
  24.301 -Goal "#1 < x ==> (%n. a / (x ^ n)) ----> #0";
  24.302 +Goal "Numeral1 < x ==> (%n. a / (x ^ n)) ----> Numeral0";
  24.303  by (cut_inst_tac [("a","a"),("x1","inverse x")] 
  24.304      ([LIMSEQ_const, LIMSEQ_realpow_zero] MRS LIMSEQ_mult) 1);
  24.305  by (auto_tac (claset(), 
  24.306 @@ -1275,22 +1275,22 @@
  24.307  (*----------------------------------------------------------------
  24.308                 Limit of c^n for |c| < 1  
  24.309   ---------------------------------------------------------------*)
  24.310 -Goal "abs(c) < #1 ==> (%n. abs(c) ^ n) ----> #0";
  24.311 +Goal "abs(c) < Numeral1 ==> (%n. abs(c) ^ n) ----> Numeral0";
  24.312  by (blast_tac (claset() addSIs [LIMSEQ_realpow_zero,abs_ge_zero]) 1);
  24.313  qed "LIMSEQ_rabs_realpow_zero";
  24.314  
  24.315 -Goal "abs(c) < #1 ==> (%n. abs(c) ^ n) ----NS> #0";
  24.316 +Goal "abs(c) < Numeral1 ==> (%n. abs(c) ^ n) ----NS> Numeral0";
  24.317  by (asm_full_simp_tac (simpset() addsimps [LIMSEQ_rabs_realpow_zero,
  24.318      LIMSEQ_NSLIMSEQ_iff RS sym]) 1);
  24.319  qed "NSLIMSEQ_rabs_realpow_zero";
  24.320  
  24.321 -Goal "abs(c) < #1 ==> (%n. c ^ n) ----> #0";
  24.322 +Goal "abs(c) < Numeral1 ==> (%n. c ^ n) ----> Numeral0";
  24.323  by (rtac (LIMSEQ_rabs_zero RS iffD1) 1);
  24.324  by (auto_tac (claset() addIs [LIMSEQ_rabs_realpow_zero],
  24.325                simpset() addsimps [realpow_abs RS sym]));
  24.326  qed "LIMSEQ_rabs_realpow_zero2";
  24.327  
  24.328 -Goal "abs(c) < #1 ==> (%n. c ^ n) ----NS> #0";
  24.329 +Goal "abs(c) < Numeral1 ==> (%n. c ^ n) ----NS> Numeral0";
  24.330  by (asm_full_simp_tac (simpset() addsimps [LIMSEQ_rabs_realpow_zero2,
  24.331      LIMSEQ_NSLIMSEQ_iff RS sym]) 1);
  24.332  qed "NSLIMSEQ_rabs_realpow_zero2";
  24.333 @@ -1308,7 +1308,7 @@
  24.334  
  24.335  (*** A sequence converging to zero defines an infinitesimal ***)
  24.336  Goalw [NSLIMSEQ_def] 
  24.337 -      "X ----NS> #0 ==> Abs_hypreal(hyprel``{X}) : Infinitesimal";
  24.338 +      "X ----NS> Numeral0 ==> Abs_hypreal(hyprel``{X}) : Infinitesimal";
  24.339  by (dres_inst_tac [("x","whn")] bspec 1);
  24.340  by (simp_tac (simpset() addsimps [HNatInfinite_whn]) 1);
  24.341  by (auto_tac (claset(),
    25.1 --- a/src/HOL/Hyperreal/SEQ.thy	Fri Oct 05 21:50:37 2001 +0200
    25.2 +++ b/src/HOL/Hyperreal/SEQ.thy	Fri Oct 05 21:52:39 2001 +0200
    25.3 @@ -10,7 +10,7 @@
    25.4  
    25.5    (* Standard definition of convergence of sequence *)           
    25.6    LIMSEQ :: [nat=>real,real] => bool    ("((_)/ ----> (_))" [60, 60] 60)
    25.7 -  "X ----> L == (ALL r. #0 < r --> (EX no. ALL n. no <= n --> abs (X n + -L) < r))"
    25.8 +  "X ----> L == (ALL r. Numeral0 < r --> (EX no. ALL n. no <= n --> abs (X n + -L) < r))"
    25.9    
   25.10    (* Nonstandard definition of convergence of sequence *)
   25.11    NSLIMSEQ :: [nat=>real,real] => bool    ("((_)/ ----NS> (_))" [60, 60] 60)
   25.12 @@ -33,7 +33,7 @@
   25.13  
   25.14    (* Standard definition for bounded sequence *)
   25.15    Bseq :: (nat => real) => bool
   25.16 -  "Bseq X == (EX K. (#0 < K & (ALL n. abs(X n) <= K)))"
   25.17 +  "Bseq X == (EX K. (Numeral0 < K & (ALL n. abs(X n) <= K)))"
   25.18   
   25.19    (* Nonstandard definition for bounded sequence *)
   25.20    NSBseq :: (nat=>real) => bool
   25.21 @@ -52,7 +52,7 @@
   25.22  
   25.23    (* Standard definition *)
   25.24    Cauchy :: (nat => real) => bool
   25.25 -  "Cauchy X == (ALL e. (#0 < e -->
   25.26 +  "Cauchy X == (ALL e. (Numeral0 < e -->
   25.27                         (EX M. (ALL m n. M <= m & M <= n 
   25.28                               --> abs((X m) + -(X n)) < e))))"
   25.29  
    26.1 --- a/src/HOL/Hyperreal/Series.ML	Fri Oct 05 21:50:37 2001 +0200
    26.2 +++ b/src/HOL/Hyperreal/Series.ML	Fri Oct 05 21:52:39 2001 +0200
    26.3 @@ -5,13 +5,13 @@
    26.4      Description : Finite summation and infinite series
    26.5  *) 
    26.6  
    26.7 -Goal "sumr (Suc n) n f = #0";
    26.8 +Goal "sumr (Suc n) n f = Numeral0";
    26.9  by (induct_tac "n" 1);
   26.10  by (Auto_tac);
   26.11  qed "sumr_Suc_zero";
   26.12  Addsimps [sumr_Suc_zero];
   26.13  
   26.14 -Goal "sumr m m f = #0";
   26.15 +Goal "sumr m m f = Numeral0";
   26.16  by (induct_tac "m" 1);
   26.17  by (Auto_tac);
   26.18  qed "sumr_eq_bounds";
   26.19 @@ -22,7 +22,7 @@
   26.20  qed "sumr_Suc_eq";
   26.21  Addsimps [sumr_Suc_eq];
   26.22  
   26.23 -Goal "sumr (m+k) k f = #0";
   26.24 +Goal "sumr (m+k) k f = Numeral0";
   26.25  by (induct_tac "k" 1);
   26.26  by (Auto_tac);
   26.27  qed "sumr_add_lbound_zero";
   26.28 @@ -83,7 +83,7 @@
   26.29  by (full_simp_tac (simpset() addsimps [sumr_add_mult_const]) 1);
   26.30  qed "sumr_diff_mult_const";
   26.31  
   26.32 -Goal "n < m --> sumr m n f = #0";
   26.33 +Goal "n < m --> sumr m n f = Numeral0";
   26.34  by (induct_tac "n" 1);
   26.35  by (auto_tac (claset() addDs [less_imp_le], simpset()));
   26.36  qed_spec_mp "sumr_less_bounds_zero";
   26.37 @@ -101,7 +101,7 @@
   26.38  by (Auto_tac);
   26.39  qed "sumr_shift_bounds";
   26.40  
   26.41 -Goal "sumr 0 (#2*n) (%i. (#-1) ^ Suc i) = #0";
   26.42 +Goal "sumr 0 (# 2*n) (%i. (# -1) ^ Suc i) = Numeral0";
   26.43  by (induct_tac "n" 1);
   26.44  by (Auto_tac);
   26.45  qed "sumr_minus_one_realpow_zero";
   26.46 @@ -137,7 +137,7 @@
   26.47                                        real_of_nat_Suc]) 1);
   26.48  qed_spec_mp "sumr_interval_const2";
   26.49  
   26.50 -Goal "(ALL n. m <= n --> #0 <= f n) & m < k --> sumr 0 m f <= sumr 0 k f";
   26.51 +Goal "(ALL n. m <= n --> Numeral0 <= f n) & m < k --> sumr 0 m f <= sumr 0 k f";
   26.52  by (induct_tac "k" 1);
   26.53  by (Step_tac 1);
   26.54  by (ALLGOALS(asm_full_simp_tac (simpset() addsimps [less_Suc_eq_le])));
   26.55 @@ -156,21 +156,21 @@
   26.56      simpset() addsimps [le_def]));
   26.57  qed_spec_mp "sumr_le2";
   26.58  
   26.59 -Goal "(ALL n. #0 <= f n) --> #0 <= sumr m n f";
   26.60 +Goal "(ALL n. Numeral0 <= f n) --> Numeral0 <= sumr m n f";
   26.61  by (induct_tac "n" 1);
   26.62  by Auto_tac;
   26.63  by (dres_inst_tac [("x","n")] spec 1);
   26.64  by (arith_tac 1);
   26.65  qed_spec_mp "sumr_ge_zero";
   26.66  
   26.67 -Goal "(ALL n. m <= n --> #0 <= f n) --> #0 <= sumr m n f";
   26.68 +Goal "(ALL n. m <= n --> Numeral0 <= f n) --> Numeral0 <= sumr m n f";
   26.69  by (induct_tac "n" 1);
   26.70  by Auto_tac;
   26.71  by (dres_inst_tac [("x","n")] spec 1);
   26.72  by (arith_tac 1);
   26.73  qed_spec_mp "sumr_ge_zero2";
   26.74  
   26.75 -Goal "#0 <= sumr m n (%n. abs (f n))";
   26.76 +Goal "Numeral0 <= sumr m n (%n. abs (f n))";
   26.77  by (induct_tac "n" 1);
   26.78  by Auto_tac;
   26.79  by (arith_tac 1);
   26.80 @@ -184,21 +184,21 @@
   26.81  qed "rabs_sumr_rabs_cancel";
   26.82  Addsimps [rabs_sumr_rabs_cancel];
   26.83  
   26.84 -Goal "ALL n. N <= n --> f n = #0 \
   26.85 -\     ==> ALL m n. N <= m --> sumr m n f = #0";   
   26.86 +Goal "ALL n. N <= n --> f n = Numeral0 \
   26.87 +\     ==> ALL m n. N <= m --> sumr m n f = Numeral0";   
   26.88  by (Step_tac 1);
   26.89  by (induct_tac "n" 1);
   26.90  by (Auto_tac);
   26.91  qed "sumr_zero";
   26.92  
   26.93 -Goal "ALL n. N <= n --> f (Suc n) = #0 \
   26.94 -\     ==> ALL m n. Suc N <= m --> sumr m n f = #0";   
   26.95 +Goal "ALL n. N <= n --> f (Suc n) = Numeral0 \
   26.96 +\     ==> ALL m n. Suc N <= m --> sumr m n f = Numeral0";   
   26.97  by (rtac sumr_zero 1 THEN Step_tac 1);
   26.98  by (case_tac "n" 1);
   26.99  by Auto_tac; 
  26.100  qed "Suc_le_imp_diff_ge2";
  26.101  
  26.102 -Goal "sumr 1' n (%n. f(n) * #0 ^ n) = #0";
  26.103 +Goal "sumr (Suc 0) n (%n. f(n) * Numeral0 ^ n) = Numeral0";
  26.104  by (induct_tac "n" 1);
  26.105  by (case_tac "n" 2);
  26.106  by Auto_tac; 
  26.107 @@ -269,7 +269,7 @@
  26.108  
  26.109  (*
  26.110  Goalw [sums_def,LIMSEQ_def] 
  26.111 -     "(ALL m. n <= Suc m --> f(m) = #0) ==> f sums (sumr 0 n f)";
  26.112 +     "(ALL m. n <= Suc m --> f(m) = Numeral0) ==> f sums (sumr 0 n f)";
  26.113  by (Step_tac 1);
  26.114  by (res_inst_tac [("x","n")] exI 1);
  26.115  by (Step_tac 1 THEN forward_tac [le_imp_less_or_eq] 1);
  26.116 @@ -283,7 +283,7 @@
  26.117  **********************)
  26.118  
  26.119  Goalw [sums_def,LIMSEQ_def] 
  26.120 -     "(ALL m. n <= m --> f(m) = #0) ==> f sums (sumr 0 n f)";
  26.121 +     "(ALL m. n <= m --> f(m) = Numeral0) ==> f sums (sumr 0 n f)";
  26.122  by (Step_tac 1);
  26.123  by (res_inst_tac [("x","n")] exI 1);
  26.124  by (Step_tac 1 THEN forward_tac [le_imp_less_or_eq] 1);
  26.125 @@ -341,35 +341,35 @@
  26.126  by (Auto_tac);
  26.127  qed "sums_group";
  26.128  
  26.129 -Goal "[|summable f; ALL d. #0 < (f(n + (2 * d))) + f(n + ((2 * d) + 1))|] \
  26.130 +Goal "[|summable f; ALL d. Numeral0 < (f(n + (Suc (Suc 0) * d))) + f(n + ((Suc (Suc 0) * d) + 1))|] \
  26.131  \     ==> sumr 0 n f < suminf f";
  26.132  by (dtac summable_sums 1);
  26.133  by (auto_tac (claset(),simpset() addsimps [sums_def,LIMSEQ_def]));
  26.134  by (dres_inst_tac [("x","f(n) + f(n + 1)")] spec 1);
  26.135  by (Auto_tac);
  26.136  by (rtac ccontr 2 THEN dtac real_leI 2);
  26.137 -by (subgoal_tac "sumr 0 (n + 2) f <= sumr 0 (2 * (Suc no) + n) f" 2);
  26.138 +by (subgoal_tac "sumr 0 (n + Suc (Suc 0)) f <= sumr 0 (Suc (Suc 0) * (Suc no) + n) f" 2);
  26.139  by (induct_tac "no" 3 THEN Simp_tac 3);
  26.140 -by (res_inst_tac [("y","sumr 0 (2*(Suc na)+n) f")] order_trans 3);
  26.141 +by (res_inst_tac [("y","sumr 0 (Suc (Suc 0)*(Suc na)+n) f")] order_trans 3);
  26.142  by (assume_tac 3);
  26.143  by (dres_inst_tac [("x","Suc na")] spec 3);
  26.144  by (dres_inst_tac [("x","0")] spec 1);
  26.145  by (Asm_full_simp_tac 1);
  26.146  by (asm_full_simp_tac (simpset() addsimps add_ac) 2);
  26.147 -by (rotate_tac 1 1 THEN dres_inst_tac [("x","2 * (Suc no) + n")] spec 1);
  26.148 +by (rotate_tac 1 1 THEN dres_inst_tac [("x","Suc (Suc 0) * (Suc no) + n")] spec 1);
  26.149  by (Step_tac 1 THEN Asm_full_simp_tac 1);
  26.150  by (subgoal_tac "suminf f + (f(n) + f(n + 1)) <= \
  26.151 -\                 sumr 0 (2 * (Suc no) + n) f" 1);
  26.152 -by (res_inst_tac [("y","sumr 0 (n+2) f")] order_trans 2);
  26.153 +\                 sumr 0 (Suc (Suc 0) * (Suc no) + n) f" 1);
  26.154 +by (res_inst_tac [("y","sumr 0 (n+ Suc (Suc 0)) f")] order_trans 2);
  26.155  by (assume_tac 3);
  26.156  by (res_inst_tac [("y","sumr 0 n f + (f(n) + f(n + 1))")] order_trans 2);
  26.157  by (REPEAT(Asm_simp_tac 2));
  26.158 -by (subgoal_tac "suminf f <= sumr 0 (2 * (Suc no) + n) f" 1);
  26.159 +by (subgoal_tac "suminf f <= sumr 0 (Suc (Suc 0) * (Suc no) + n) f" 1);
  26.160  by (res_inst_tac [("y","suminf f + (f(n) + f(n + 1))")] order_trans 2);
  26.161  by (assume_tac 3);
  26.162  by (dres_inst_tac [("x","0")] spec 2);
  26.163  by (Asm_full_simp_tac 2);
  26.164 -by (subgoal_tac "#0 <= sumr 0 (2 * Suc no + n) f + - suminf f" 1);
  26.165 +by (subgoal_tac "Numeral0 <= sumr 0 (Suc (Suc 0) * Suc no + n) f + - suminf f" 1);
  26.166  by (dtac (rename_numerals abs_eqI1) 1 );
  26.167  by (Asm_full_simp_tac 1);
  26.168  by (auto_tac (claset(),simpset() addsimps [real_le_def]));
  26.169 @@ -379,7 +379,7 @@
  26.170     Summable series of positive terms has limit >= any partial sum 
  26.171   ----------------------------------------------------------------*)
  26.172  Goal 
  26.173 -     "[| summable f; ALL m. n <= m --> #0 <= f(m) |] \
  26.174 +     "[| summable f; ALL m. n <= m --> Numeral0 <= f(m) |] \
  26.175  \          ==> sumr 0 n f <= suminf f";
  26.176  by (dtac summable_sums 1);
  26.177  by (rewtac sums_def);
  26.178 @@ -390,7 +390,7 @@
  26.179  by (auto_tac (claset() addIs [sumr_le], simpset()));
  26.180  qed "series_pos_le";
  26.181  
  26.182 -Goal "[| summable f; ALL m. n <= m --> #0 < f(m) |] \
  26.183 +Goal "[| summable f; ALL m. n <= m --> Numeral0 < f(m) |] \
  26.184  \          ==> sumr 0 n f < suminf f";
  26.185  by (res_inst_tac [("y","sumr 0 (Suc n) f")] order_less_le_trans 1);
  26.186  by (rtac series_pos_le 2);
  26.187 @@ -403,10 +403,10 @@
  26.188                      sum of geometric progression                 
  26.189   -------------------------------------------------------------------*)
  26.190  
  26.191 -Goal "x ~= #1 ==> sumr 0 n (%n. x ^ n) = (x ^ n - #1) / (x - #1)";
  26.192 +Goal "x ~= Numeral1 ==> sumr 0 n (%n. x ^ n) = (x ^ n - Numeral1) / (x - Numeral1)";
  26.193  by (induct_tac "n" 1);
  26.194  by (Auto_tac);
  26.195 -by (res_inst_tac [("c1","x - #1")] (real_mult_right_cancel RS iffD1) 1);
  26.196 +by (res_inst_tac [("c1","x - Numeral1")] (real_mult_right_cancel RS iffD1) 1);
  26.197  by (auto_tac (claset(),
  26.198         simpset() addsimps [real_mult_assoc, real_add_mult_distrib]));
  26.199  by (auto_tac (claset(),
  26.200 @@ -414,12 +414,12 @@
  26.201                             real_diff_def, real_mult_commute]));
  26.202  qed "sumr_geometric";
  26.203  
  26.204 -Goal "abs(x) < #1 ==> (%n. x ^ n) sums (#1/(#1 - x))";
  26.205 -by (case_tac "x = #1" 1);
  26.206 +Goal "abs(x) < Numeral1 ==> (%n. x ^ n) sums (Numeral1/(Numeral1 - x))";
  26.207 +by (case_tac "x = Numeral1" 1);
  26.208  by (auto_tac (claset() addSDs [LIMSEQ_rabs_realpow_zero2],
  26.209               simpset() addsimps [sumr_geometric ,sums_def,
  26.210                                   real_diff_def, real_add_divide_distrib]));
  26.211 -by (subgoal_tac "#1 / (#1 + - x) = #0/(x-#1) + - #1/(x-#1)" 1);
  26.212 +by (subgoal_tac "Numeral1 / (Numeral1 + - x) = Numeral0/(x-Numeral1) + - Numeral1/(x-Numeral1)" 1);
  26.213  by (asm_full_simp_tac (simpset() addsimps [real_divide_eq_cancel1,
  26.214                   real_divide_minus_eq RS sym, real_diff_def]) 2); 
  26.215  by (etac ssubst 1); 
  26.216 @@ -437,7 +437,7 @@
  26.217  qed "summable_convergent_sumr_iff";
  26.218  
  26.219  Goal "summable f = \
  26.220 -\     (ALL e. #0 < e --> (EX N. ALL m n. N <= m --> abs(sumr m n f) < e))";
  26.221 +\     (ALL e. Numeral0 < e --> (EX N. ALL m n. N <= m --> abs(sumr m n f) < e))";
  26.222  by (auto_tac (claset(),simpset() addsimps [summable_convergent_sumr_iff,
  26.223      Cauchy_convergent_iff RS sym,Cauchy_def]));
  26.224  by (ALLGOALS(dtac spec) THEN Auto_tac);
  26.225 @@ -455,7 +455,7 @@
  26.226  
  26.227  (*-------------------------------------------------------------------
  26.228       Terms of a convergent series tend to zero
  26.229 -     > Goalw [LIMSEQ_def] "summable f ==> f ----> #0";
  26.230 +     > Goalw [LIMSEQ_def] "summable f ==> f ----> Numeral0";
  26.231       Proved easily in HSeries after proving nonstandard case.
  26.232   -------------------------------------------------------------------*)
  26.233  (*-------------------------------------------------------------------
  26.234 @@ -527,10 +527,10 @@
  26.235                          The ratio test
  26.236   -------------------------------------------------------------------*)
  26.237  
  26.238 -Goal "[| c <= #0; abs x <= c * abs y |] ==> x = (#0::real)";
  26.239 +Goal "[| c <= Numeral0; abs x <= c * abs y |] ==> x = (Numeral0::real)";
  26.240  by (dtac order_le_imp_less_or_eq 1);
  26.241  by Auto_tac;  
  26.242 -by (subgoal_tac "#0 <= c * abs y" 1);
  26.243 +by (subgoal_tac "Numeral0 <= c * abs y" 1);
  26.244  by (arith_tac 2);
  26.245  by (asm_full_simp_tac (simpset() addsimps [real_0_le_mult_iff]) 1); 
  26.246  qed "rabs_ratiotest_lemma";
  26.247 @@ -546,19 +546,19 @@
  26.248  by (auto_tac (claset(),simpset() addsimps [le_Suc_ex]));
  26.249  qed "le_Suc_ex_iff";
  26.250  
  26.251 -(*All this trouble just to get #0<c *)
  26.252 +(*All this trouble just to get Numeral0<c *)
  26.253  Goal "[| ALL n. N <= n --> abs(f(Suc n)) <= c*abs(f n) |] \
  26.254 -\     ==> #0 < c | summable f";
  26.255 +\     ==> Numeral0 < c | summable f";
  26.256  by (simp_tac (simpset() addsimps [linorder_not_le RS sym]) 1); 
  26.257  by (asm_full_simp_tac (simpset() addsimps [summable_Cauchy]) 1);
  26.258 -by (Step_tac 1 THEN subgoal_tac "ALL n. N <= n --> f (Suc n) = #0" 1);
  26.259 +by (Step_tac 1 THEN subgoal_tac "ALL n. N <= n --> f (Suc n) = Numeral0" 1);
  26.260  by (blast_tac (claset() addIs [rabs_ratiotest_lemma]) 2);
  26.261  by (res_inst_tac [("x","Suc N")] exI 1);
  26.262  by (Clarify_tac 1); 
  26.263  by (dtac Suc_le_imp_diff_ge2 1 THEN Auto_tac);
  26.264  qed "ratio_test_lemma2";
  26.265  
  26.266 -Goal "[| c < #1; ALL n. N <= n --> abs(f(Suc n)) <= c*abs(f n) |] \
  26.267 +Goal "[| c < Numeral1; ALL n. N <= n --> abs(f(Suc n)) <= c*abs(f n) |] \
  26.268  \     ==> summable f";
  26.269  by (forward_tac [ratio_test_lemma2] 1);
  26.270  by Auto_tac;  
  26.271 @@ -573,7 +573,7 @@
  26.272  by (auto_tac (claset() addIs [real_mult_le_mono1],
  26.273                simpset() addsimps [summable_def]));
  26.274  by (asm_full_simp_tac (simpset() addsimps real_mult_ac) 1);
  26.275 -by (res_inst_tac [("x","abs(f N) * (#1/(#1 - c)) / (c ^ N)")] exI 1);
  26.276 +by (res_inst_tac [("x","abs(f N) * (Numeral1/(Numeral1 - c)) / (c ^ N)")] exI 1);
  26.277  by (rtac sums_divide 1); 
  26.278  by (rtac sums_mult 1); 
  26.279  by (auto_tac (claset() addSIs [sums_mult,geometric_sums], 
    27.1 --- a/src/HOL/Hyperreal/Series.thy	Fri Oct 05 21:50:37 2001 +0200
    27.2 +++ b/src/HOL/Hyperreal/Series.thy	Fri Oct 05 21:52:39 2001 +0200
    27.3 @@ -9,8 +9,8 @@
    27.4  
    27.5  consts sumr :: "[nat,nat,(nat=>real)] => real"
    27.6  primrec
    27.7 -   sumr_0   "sumr m 0 f = #0"
    27.8 -   sumr_Suc "sumr m (Suc n) f = (if n < m then #0 
    27.9 +   sumr_0   "sumr m 0 f = Numeral0"
   27.10 +   sumr_Suc "sumr m (Suc n) f = (if n < m then Numeral0 
   27.11                                 else sumr m n f + f(n))"
   27.12  
   27.13  constdefs
    28.1 --- a/src/HOL/Hyperreal/hypreal_arith0.ML	Fri Oct 05 21:50:37 2001 +0200
    28.2 +++ b/src/HOL/Hyperreal/hypreal_arith0.ML	Fri Oct 05 21:52:39 2001 +0200
    28.3 @@ -115,7 +115,7 @@
    28.4  qed "";
    28.5  
    28.6  Goal "!!a::hypreal. [| a+b+c+d <= i+j+k+l; a<=b; b<=c; c<=d; i<=j; j<=k; k<=l |] \
    28.7 -\     ==> #6*a <= #5*l+i";
    28.8 +\     ==> # 6*a <= # 5*l+i";
    28.9  by (fast_arith_tac 1);
   28.10  qed "";
   28.11  *)
    29.1 --- a/src/HOL/IMP/Compiler.thy	Fri Oct 05 21:50:37 2001 +0200
    29.2 +++ b/src/HOL/IMP/Compiler.thy	Fri Oct 05 21:52:39 2001 +0200
    29.3 @@ -39,9 +39,9 @@
    29.4  "compile (x:==a) = [ASIN x a]"
    29.5  "compile (c1;c2) = compile c1 @ compile c2"
    29.6  "compile (IF b THEN c1 ELSE c2) =
    29.7 - [JMPF b (length(compile c1)+2)] @ compile c1 @
    29.8 + [JMPF b (length(compile c1) + # 2)] @ compile c1 @
    29.9   [JMPF (%x. False) (length(compile c2)+1)] @ compile c2"
   29.10 -"compile (WHILE b DO c) = [JMPF b (length(compile c)+2)] @ compile c @
   29.11 +"compile (WHILE b DO c) = [JMPF b (length(compile c) + # 2)] @ compile c @
   29.12   [JMPB (length(compile c)+1)]"
   29.13  
   29.14  declare nth_append[simp];
    30.1 --- a/src/HOL/IMP/Examples.ML	Fri Oct 05 21:50:37 2001 +0200
    30.2 +++ b/src/HOL/IMP/Examples.ML	Fri Oct 05 21:52:39 2001 +0200
    30.3 @@ -34,7 +34,7 @@
    30.4  val step = resolve_tac evalc.intrs 1;
    30.5  val simp = Asm_simp_tac 1;
    30.6  Goalw [factorial_def] "a~=b ==> \
    30.7 -\ <factorial a b, Mem(a:=#3)>  -c-> Mem(b:=#6,a:=#0)";
    30.8 +\ <factorial a b, Mem(a:=# 3)>  -c-> Mem(b:=# 6,a:=Numeral0)";
    30.9  by (ftac not_sym 1);
   30.10  by step;
   30.11  by  step;
    31.1 --- a/src/HOL/IMPP/EvenOdd.ML	Fri Oct 05 21:50:37 2001 +0200
    31.2 +++ b/src/HOL/IMPP/EvenOdd.ML	Fri Oct 05 21:52:39 2001 +0200
    31.3 @@ -11,13 +11,13 @@
    31.4  qed "even_0";
    31.5  Addsimps [even_0];
    31.6  
    31.7 -Goalw [even_def] "even 1' = False";
    31.8 +Goalw [even_def] "even (Suc 0) = False";
    31.9  by (Simp_tac 1);
   31.10  qed "not_even_1";
   31.11  Addsimps [not_even_1];
   31.12  
   31.13  Goalw [even_def] "even (Suc (Suc n)) = even n";
   31.14 -by (subgoal_tac "Suc (Suc n) = n+#2" 1);
   31.15 +by (subgoal_tac "Suc (Suc n) = n+# 2" 1);
   31.16  by  (Simp_tac 2);
   31.17  by (etac ssubst 1);
   31.18  by (rtac dvd_reduce 1);
   31.19 @@ -50,13 +50,13 @@
   31.20  
   31.21  section "verification";
   31.22  
   31.23 -Goalw [odd_def] "{{Z=Arg+0}. BODY Even .{Res_ok}}|-{Z=Arg+1'}. odd .{Res_ok}";
   31.24 +Goalw [odd_def] "{{Z=Arg+0}. BODY Even .{Res_ok}}|-{Z=Arg+Suc 0}. odd .{Res_ok}";
   31.25  by (rtac hoare_derivs.If 1);
   31.26  by (rtac (hoare_derivs.Ass RS conseq1) 1);
   31.27  by  (clarsimp_tac Arg_Res_css 1);
   31.28  by (rtac export_s 1);
   31.29  by (rtac (hoare_derivs.Call RS conseq1) 1);
   31.30 -by  (res_inst_tac [("P","Z=Arg+2")] conseq12 1);
   31.31 +by  (res_inst_tac [("P","Z=Arg+Suc (Suc 0)")] conseq12 1);
   31.32  by (rtac single_asm 1);
   31.33  by (auto_tac Arg_Res_css);
   31.34  qed "Odd_lemma";
    32.1 --- a/src/HOL/IMPP/EvenOdd.thy	Fri Oct 05 21:50:37 2001 +0200
    32.2 +++ b/src/HOL/IMPP/EvenOdd.thy	Fri Oct 05 21:52:39 2001 +0200
    32.3 @@ -9,7 +9,7 @@
    32.4  EvenOdd = Misc +
    32.5  
    32.6  constdefs even :: nat => bool
    32.7 -  "even n == #2 dvd n"
    32.8 +  "even n == # 2 dvd n"
    32.9  
   32.10  consts
   32.11    Even, Odd :: pname
   32.12 @@ -27,7 +27,7 @@
   32.13    odd :: com
   32.14   "odd == IF (%s. s<Arg>=0)
   32.15           THEN Loc Res:==(%s. 1)
   32.16 -         ELSE(Loc Res:=CALL Even (%s. s<Arg> -1))"
   32.17 +         ELSE(Loc Res:=CALL Even (%s. s<Arg> - 1))"
   32.18  
   32.19  defs
   32.20    bodies_def "bodies == [(Even,evn),(Odd,odd)]"
    33.1 --- a/src/HOL/Induct/Com.thy	Fri Oct 05 21:50:37 2001 +0200
    33.2 +++ b/src/HOL/Induct/Com.thy	Fri Oct 05 21:52:39 2001 +0200
    33.3 @@ -52,10 +52,10 @@
    33.4      IfTrue "[| (e,s) -|[eval]-> (0,s');  (c0,s') -[eval]-> s1 |] 
    33.5              ==> (IF e THEN c0 ELSE c1, s) -[eval]-> s1"
    33.6  
    33.7 -    IfFalse "[| (e,s) -|[eval]->  (1',s');  (c1,s') -[eval]-> s1 |] 
    33.8 +    IfFalse "[| (e,s) -|[eval]->  (Suc 0, s');  (c1,s') -[eval]-> s1 |] 
    33.9               ==> (IF e THEN c0 ELSE c1, s) -[eval]-> s1"
   33.10  
   33.11 -    WhileFalse "(e,s) -|[eval]-> (1',s1) ==> (WHILE e DO c, s) -[eval]-> s1"
   33.12 +    WhileFalse "(e,s) -|[eval]-> (Suc 0, s1) ==> (WHILE e DO c, s) -[eval]-> s1"
   33.13  
   33.14      WhileTrue  "[| (e,s) -|[eval]-> (0,s1);
   33.15                  (c,s1) -[eval]-> s2;  (WHILE e DO c, s2) -[eval]-> s3 |] 
    34.1 --- a/src/HOL/Induct/Mutil.thy	Fri Oct 05 21:50:37 2001 +0200
    34.2 +++ b/src/HOL/Induct/Mutil.thy	Fri Oct 05 21:52:39 2001 +0200
    34.3 @@ -29,7 +29,7 @@
    34.4  
    34.5  constdefs
    34.6    coloured :: "nat => (nat \<times> nat) set"
    34.7 -   "coloured b == {(i, j). (i + j) mod #2 = b}"
    34.8 +   "coloured b == {(i, j). (i + j) mod # 2 = b}"
    34.9  
   34.10  
   34.11  text {* \medskip The union of two disjoint tilings is a tiling *}
   34.12 @@ -61,14 +61,14 @@
   34.13    apply auto
   34.14    done
   34.15  
   34.16 -lemma dominoes_tile_row [intro!]: "{i} \<times> lessThan (#2 * n) \<in> tiling domino"
   34.17 +lemma dominoes_tile_row [intro!]: "{i} \<times> lessThan (# 2 * n) \<in> tiling domino"
   34.18    apply (induct n)
   34.19     apply (simp_all add: Un_assoc [symmetric])
   34.20    apply (rule tiling.Un)
   34.21      apply (auto simp add: sing_Times_lemma)
   34.22    done
   34.23  
   34.24 -lemma dominoes_tile_matrix: "(lessThan m) \<times> lessThan (#2 * n) \<in> tiling domino"
   34.25 +lemma dominoes_tile_matrix: "(lessThan m) \<times> lessThan (# 2 * n) \<in> tiling domino"
   34.26    apply (induct m)
   34.27     apply auto
   34.28    done
   34.29 @@ -78,7 +78,7 @@
   34.30  
   34.31  lemma coloured_insert [simp]:
   34.32    "coloured b \<inter> (insert (i, j) t) =
   34.33 -   (if (i + j) mod #2 = b then insert (i, j) (coloured b \<inter> t)
   34.34 +   (if (i + j) mod # 2 = b then insert (i, j) (coloured b \<inter> t)
   34.35      else coloured b \<inter> t)"
   34.36    apply (unfold coloured_def)
   34.37    apply auto
   34.38 @@ -110,7 +110,7 @@
   34.39    Diff_Int_distrib [simp]
   34.40  
   34.41  lemma tiling_domino_0_1:
   34.42 -  "t \<in> tiling domino ==> card (coloured 0 \<inter> t) = card (coloured 1' \<inter> t)"
   34.43 +  "t \<in> tiling domino ==> card (coloured 0 \<inter> t) = card (coloured (Suc 0) \<inter> t)"
   34.44    apply (erule tiling.induct)
   34.45     apply (drule_tac [2] domino_singletons)
   34.46     apply auto
   34.47 @@ -125,13 +125,13 @@
   34.48  
   34.49  theorem gen_mutil_not_tiling:
   34.50    "t \<in> tiling domino ==>
   34.51 -    (i + j) mod #2 = 0 ==> (m + n) mod #2 = 0 ==>
   34.52 +    (i + j) mod # 2 = 0 ==> (m + n) mod # 2 = 0 ==>
   34.53      {(i, j), (m, n)} \<subseteq> t
   34.54    ==> (t - {(i, j)} - {(m, n)}) \<notin> tiling domino"
   34.55    apply (rule notI)
   34.56    apply (subgoal_tac
   34.57      "card (coloured 0 \<inter> (t - {(i, j)} - {(m, n)})) <
   34.58 -      card (coloured 1' \<inter> (t - {(i, j)} - {(m, n)}))")
   34.59 +      card (coloured (Suc 0) \<inter> (t - {(i, j)} - {(m, n)}))")
   34.60     apply (force simp only: tiling_domino_0_1)
   34.61    apply (simp add: tiling_domino_0_1 [symmetric])
   34.62    apply (simp add: coloured_def card_Diff2_less)
   34.63 @@ -140,8 +140,8 @@
   34.64  text {* Apply the general theorem to the well-known case *}
   34.65  
   34.66  theorem mutil_not_tiling:
   34.67 -  "t = lessThan (#2 * Suc m) \<times> lessThan (#2 * Suc n)
   34.68 -    ==> t - {(0, 0)} - {(Suc (#2 * m), Suc (#2 * n))} \<notin> tiling domino"
   34.69 +  "t = lessThan (# 2 * Suc m) \<times> lessThan (# 2 * Suc n)
   34.70 +    ==> t - {(0, 0)} - {(Suc (# 2 * m), Suc (# 2 * n))} \<notin> tiling domino"
   34.71    apply (rule gen_mutil_not_tiling)
   34.72       apply (blast intro!: dominoes_tile_matrix)
   34.73      apply auto
    35.1 --- a/src/HOL/Integ/Bin.ML	Fri Oct 05 21:50:37 2001 +0200
    35.2 +++ b/src/HOL/Integ/Bin.ML	Fri Oct 05 21:52:39 2001 +0200
    35.3 @@ -160,7 +160,7 @@
    35.4  
    35.5  (*The correctness of shifting.  But it doesn't seem to give a measurable
    35.6    speed-up.*)
    35.7 -Goal "(#2::int) * number_of w = number_of (w BIT False)";
    35.8 +Goal "(# 2::int) * number_of w = number_of (w BIT False)";
    35.9  by (induct_tac "w" 1);
   35.10  by (ALLGOALS (asm_simp_tac
   35.11      (simpset() addsimps bin_mult_simps @ [zadd_zmult_distrib] @ zadd_ac)));
   35.12 @@ -169,11 +169,11 @@
   35.13  
   35.14  (** Simplification rules with integer constants **)
   35.15  
   35.16 -Goal "#0 + z = (z::int)";
   35.17 +Goal "Numeral0 + z = (z::int)";
   35.18  by (Simp_tac 1);
   35.19  qed "zadd_0";
   35.20  
   35.21 -Goal "z + #0 = (z::int)";
   35.22 +Goal "z + Numeral0 = (z::int)";
   35.23  by (Simp_tac 1);
   35.24  qed "zadd_0_right";
   35.25  
   35.26 @@ -182,29 +182,29 @@
   35.27  
   35.28  (** Converting simple cases of (int n) to numerals **)
   35.29  
   35.30 -(*int 0 = #0 *)
   35.31 +(*int 0 = Numeral0 *)
   35.32  bind_thm ("int_0", number_of_Pls RS sym);
   35.33  
   35.34 -Goal "int (Suc n) = #1 + int n";
   35.35 +Goal "int (Suc n) = Numeral1 + int n";
   35.36  by (simp_tac (simpset() addsimps [zadd_int]) 1);
   35.37  qed "int_Suc";
   35.38  
   35.39 -Goal "- (#0) = (#0::int)";
   35.40 +Goal "- (Numeral0) = (Numeral0::int)";
   35.41  by (Simp_tac 1);
   35.42  qed "zminus_0";
   35.43  
   35.44  Addsimps [zminus_0];
   35.45  
   35.46  
   35.47 -Goal "(#0::int) - x = -x";
   35.48 +Goal "(Numeral0::int) - x = -x";
   35.49  by (simp_tac (simpset() addsimps [zdiff_def]) 1);
   35.50  qed "zdiff0";
   35.51  
   35.52 -Goal "x - (#0::int) = x";
   35.53 +Goal "x - (Numeral0::int) = x";
   35.54  by (simp_tac (simpset() addsimps [zdiff_def]) 1);
   35.55  qed "zdiff0_right";
   35.56  
   35.57 -Goal "x - x = (#0::int)";
   35.58 +Goal "x - x = (Numeral0::int)";
   35.59  by (simp_tac (simpset() addsimps [zdiff_def]) 1);
   35.60  qed "zdiff_self";
   35.61  
   35.62 @@ -234,27 +234,27 @@
   35.63  
   35.64  (** Special-case simplification for small constants **)
   35.65  
   35.66 -Goal "#0 * z = (#0::int)";
   35.67 +Goal "Numeral0 * z = (Numeral0::int)";
   35.68  by (Simp_tac 1);
   35.69  qed "zmult_0";
   35.70  
   35.71 -Goal "z * #0 = (#0::int)";
   35.72 +Goal "z * Numeral0 = (Numeral0::int)";
   35.73  by (Simp_tac 1);
   35.74  qed "zmult_0_right";
   35.75  
   35.76 -Goal "#1 * z = (z::int)";
   35.77 +Goal "Numeral1 * z = (z::int)";
   35.78  by (Simp_tac 1);
   35.79  qed "zmult_1";
   35.80  
   35.81 -Goal "z * #1 = (z::int)";
   35.82 +Goal "z * Numeral1 = (z::int)";
   35.83  by (Simp_tac 1);
   35.84  qed "zmult_1_right";
   35.85  
   35.86 -Goal "#-1 * z = -(z::int)";
   35.87 +Goal "# -1 * z = -(z::int)";
   35.88  by (simp_tac (simpset() addsimps zcompare_rls@[zmult_zminus]) 1);
   35.89  qed "zmult_minus1";
   35.90  
   35.91 -Goal "z * #-1 = -(z::int)";
   35.92 +Goal "z * # -1 = -(z::int)";
   35.93  by (simp_tac (simpset() addsimps zcompare_rls@[zmult_zminus_right]) 1);
   35.94  qed "zmult_minus1_right";
   35.95  
   35.96 @@ -272,61 +272,61 @@
   35.97  
   35.98  (** Inequality reasoning **)
   35.99  
  35.100 -Goal "(m*n = (#0::int)) = (m = #0 | n = #0)";
  35.101 +Goal "(m*n = (Numeral0::int)) = (m = Numeral0 | n = Numeral0)";
  35.102  by (stac (int_0 RS sym) 1 THEN rtac zmult_eq_int0_iff 1);
  35.103  qed "zmult_eq_0_iff";
  35.104  AddIffs [zmult_eq_0_iff];
  35.105  
  35.106 -Goal "(w < z + (#1::int)) = (w<z | w=z)";
  35.107 +Goal "(w < z + (Numeral1::int)) = (w<z | w=z)";
  35.108  by (simp_tac (simpset() addsimps [zless_add_int_Suc_eq]) 1);
  35.109  qed "zless_add1_eq";
  35.110  
  35.111 -Goal "(w + (#1::int) <= z) = (w<z)";
  35.112 +Goal "(w + (Numeral1::int) <= z) = (w<z)";
  35.113  by (simp_tac (simpset() addsimps [add_int_Suc_zle_eq]) 1);
  35.114  qed "add1_zle_eq";
  35.115  
  35.116 -Goal "((#1::int) + w <= z) = (w<z)";
  35.117 +Goal "((Numeral1::int) + w <= z) = (w<z)";
  35.118  by (stac zadd_commute 1);
  35.119  by (rtac add1_zle_eq 1);
  35.120  qed "add1_left_zle_eq";
  35.121  
  35.122 -Goal "neg x = (x < #0)";
  35.123 +Goal "neg x = (x < Numeral0)";
  35.124  by (simp_tac (simpset() addsimps [neg_eq_less_int0]) 1); 
  35.125  qed "neg_eq_less_0"; 
  35.126  
  35.127 -Goal "(~neg x) = (#0 <= x)";
  35.128 +Goal "(~neg x) = (Numeral0 <= x)";
  35.129  by (simp_tac (simpset() addsimps [not_neg_eq_ge_int0]) 1); 
  35.130  qed "not_neg_eq_ge_0"; 
  35.131  
  35.132 -Goal "#0 <= int m";
  35.133 +Goal "Numeral0 <= int m";
  35.134  by (Simp_tac 1);
  35.135  qed "zero_zle_int";
  35.136  AddIffs [zero_zle_int];
  35.137  
  35.138  
  35.139 -(** Needed because (int 0) rewrites to #0.
  35.140 +(** Needed because (int 0) rewrites to Numeral0.   (* FIXME !? *)
  35.141      Can these be generalized without evaluating large numbers?**)
  35.142  
  35.143 -Goal "~ (int k < #0)";
  35.144 +Goal "~ (int k < Numeral0)";
  35.145  by (Simp_tac 1);
  35.146  qed "int_less_0_conv";
  35.147  
  35.148 -Goal "(int k <= #0) = (k=0)";
  35.149 +Goal "(int k <= Numeral0) = (k=0)";
  35.150  by (Simp_tac 1);
  35.151  qed "int_le_0_conv";
  35.152  
  35.153 -Goal "(int k = #0) = (k=0)";
  35.154 +Goal "(int k = Numeral0) = (k=0)";
  35.155  by (Simp_tac 1);
  35.156  qed "int_eq_0_conv";
  35.157  
  35.158 -Goal "(#0 < int k) = (0<k)";
  35.159 +Goal "(Numeral0 < int k) = (0<k)";
  35.160  by (Simp_tac 1);
  35.161  qed "zero_less_int_conv";
  35.162  
  35.163  Addsimps [int_less_0_conv, int_le_0_conv, int_eq_0_conv, zero_less_int_conv];
  35.164  
  35.165 -Goal "(0 < nat z) = (#0 < z)";
  35.166 -by (cut_inst_tac [("w","#0")] zless_nat_conj 1);
  35.167 +Goal "(0 < nat z) = (Numeral0 < z)";
  35.168 +by (cut_inst_tac [("w","Numeral0")] zless_nat_conj 1);
  35.169  by Auto_tac;  
  35.170  qed "zero_less_nat_eq";
  35.171  Addsimps [zero_less_nat_eq];
  35.172 @@ -339,7 +339,7 @@
  35.173  Goalw [iszero_def]
  35.174    "((number_of x::int) = number_of y) = \
  35.175  \  iszero (number_of (bin_add x (bin_minus y)))"; 
  35.176 -by (simp_tac (simpset() delsimps [number_of_reorient] 
  35.177 +by (simp_tac (simpset() delsimps [thm "number_of_reorient"] 
  35.178                   addsimps zcompare_rls @ [number_of_add, number_of_minus]) 1); 
  35.179  qed "eq_number_of_eq"; 
  35.180  
    36.1 --- a/src/HOL/Integ/Int.ML	Fri Oct 05 21:50:37 2001 +0200
    36.2 +++ b/src/HOL/Integ/Int.ML	Fri Oct 05 21:52:39 2001 +0200
    36.3 @@ -50,7 +50,7 @@
    36.4    val eq_diff_eq	= eq_zdiff_eq
    36.5    val eqI_rules		= [zless_eqI, zeq_eqI, zle_eqI]
    36.6    fun dest_eqI th = 
    36.7 -      #1 (HOLogic.dest_bin "op =" HOLogic.boolT 
    36.8 +      #1 (HOLogic.dest_bin "op =" HOLogic.boolT
    36.9  	      (HOLogic.dest_Trueprop (concl_of th)))
   36.10  
   36.11    val diff_def		= zdiff_def
    37.1 --- a/src/HOL/Integ/IntArith.ML	Fri Oct 05 21:50:37 2001 +0200
    37.2 +++ b/src/HOL/Integ/IntArith.ML	Fri Oct 05 21:52:39 2001 +0200
    37.3 @@ -20,7 +20,7 @@
    37.4  
    37.5  (*** Intermediate value theorems ***)
    37.6  
    37.7 -Goal "(ALL i<n. abs(f(i+1) - f i) <= #1) --> \
    37.8 +Goal "(ALL i<n::nat. abs(f(i+1) - f i) <= Numeral1) --> \
    37.9  \     f 0 <= k --> k <= f n --> (EX i <= n. f i = (k::int))";
   37.10  by(induct_tac "n" 1);
   37.11   by(Asm_simp_tac 1);
   37.12 @@ -40,7 +40,7 @@
   37.13  
   37.14  bind_thm("nat0_intermed_int_val", rulify_no_asm lemma);
   37.15  
   37.16 -Goal "[| !i. m <= i & i < n --> abs(f(i+1) - f i) <= #1; m < n; \
   37.17 +Goal "[| !i. m <= i & i < n --> abs(f(i + 1::nat) - f i) <= Numeral1; m < n; \
   37.18  \        f m <= k; k <= f n |] ==> ? i. m <= i & i <= n & f i = (k::int)";
   37.19  by(cut_inst_tac [("n","n-m"),("f", "%i. f(i+m)"),("k","k")]lemma 1);
   37.20  by(Asm_full_simp_tac 1);
   37.21 @@ -56,22 +56,22 @@
   37.22  
   37.23  (*** Some convenient biconditionals for products of signs ***)
   37.24  
   37.25 -Goal "[| (#0::int) < i; #0 < j |] ==> #0 < i*j";
   37.26 +Goal "[| (Numeral0::int) < i; Numeral0 < j |] ==> Numeral0 < i*j";
   37.27  by (dtac zmult_zless_mono1 1);
   37.28  by Auto_tac; 
   37.29  qed "zmult_pos";
   37.30  
   37.31 -Goal "[| i < (#0::int); j < #0 |] ==> #0 < i*j";
   37.32 +Goal "[| i < (Numeral0::int); j < Numeral0 |] ==> Numeral0 < i*j";
   37.33  by (dtac zmult_zless_mono1_neg 1);
   37.34  by Auto_tac; 
   37.35  qed "zmult_neg";
   37.36  
   37.37 -Goal "[| (#0::int) < i; j < #0 |] ==> i*j < #0";
   37.38 +Goal "[| (Numeral0::int) < i; j < Numeral0 |] ==> i*j < Numeral0";
   37.39  by (dtac zmult_zless_mono1_neg 1);
   37.40  by Auto_tac; 
   37.41  qed "zmult_pos_neg";
   37.42  
   37.43 -Goal "((#0::int) < x*y) = (#0 < x & #0 < y | x < #0 & y < #0)";
   37.44 +Goal "((Numeral0::int) < x*y) = (Numeral0 < x & Numeral0 < y | x < Numeral0 & y < Numeral0)";
   37.45  by (auto_tac (claset(), 
   37.46                simpset() addsimps [order_le_less, linorder_not_less,
   37.47  	                          zmult_pos, zmult_neg]));
   37.48 @@ -84,13 +84,13 @@
   37.49                simpset() addsimps [zmult_commute]));  
   37.50  qed "int_0_less_mult_iff";
   37.51  
   37.52 -Goal "((#0::int) <= x*y) = (#0 <= x & #0 <= y | x <= #0 & y <= #0)";
   37.53 +Goal "((Numeral0::int) <= x*y) = (Numeral0 <= x & Numeral0 <= y | x <= Numeral0 & y <= Numeral0)";
   37.54  by (auto_tac (claset(), 
   37.55                simpset() addsimps [order_le_less, linorder_not_less,  
   37.56                                    int_0_less_mult_iff]));
   37.57  qed "int_0_le_mult_iff";
   37.58  
   37.59 -Goal "(x*y < (#0::int)) = (#0 < x & y < #0 | x < #0 & #0 < y)";
   37.60 +Goal "(x*y < (Numeral0::int)) = (Numeral0 < x & y < Numeral0 | x < Numeral0 & Numeral0 < y)";
   37.61  by (auto_tac (claset(), 
   37.62                simpset() addsimps [int_0_le_mult_iff, 
   37.63                                    linorder_not_le RS sym]));
   37.64 @@ -98,7 +98,7 @@
   37.65                simpset() addsimps [linorder_not_le]));
   37.66  qed "zmult_less_0_iff";
   37.67  
   37.68 -Goal "(x*y <= (#0::int)) = (#0 <= x & y <= #0 | x <= #0 & #0 <= y)";
   37.69 +Goal "(x*y <= (Numeral0::int)) = (Numeral0 <= x & y <= Numeral0 | x <= Numeral0 & Numeral0 <= y)";
   37.70  by (auto_tac (claset() addDs [order_less_not_sym], 
   37.71                simpset() addsimps [int_0_less_mult_iff, 
   37.72                                    linorder_not_less RS sym]));
   37.73 @@ -109,19 +109,19 @@
   37.74                           addsimps [zmult_less_0_iff, zle_def]) 1);
   37.75  qed "abs_mult";
   37.76  
   37.77 -Goal "(abs x = #0) = (x = (#0::int))";
   37.78 +Goal "(abs x = Numeral0) = (x = (Numeral0::int))";
   37.79  by (simp_tac (simpset () addsplits [zabs_split]) 1);
   37.80  qed "abs_eq_0";
   37.81  AddIffs [abs_eq_0];
   37.82  
   37.83 -Goal "(#0 < abs x) = (x ~= (#0::int))";
   37.84 +Goal "(Numeral0 < abs x) = (x ~= (Numeral0::int))";
   37.85  by (simp_tac (simpset () addsplits [zabs_split]) 1);
   37.86  by (arith_tac 1);
   37.87  qed "zero_less_abs_iff";
   37.88  AddIffs [zero_less_abs_iff];
   37.89  
   37.90 -Goal "#0 <= x * (x::int)";
   37.91 -by (subgoal_tac "(- x) * x <= #0" 1);
   37.92 +Goal "Numeral0 <= x * (x::int)";
   37.93 +by (subgoal_tac "(- x) * x <= Numeral0" 1);
   37.94   by (Asm_full_simp_tac 1);
   37.95  by (simp_tac (HOL_basic_ss addsimps [zmult_le_0_iff]) 1);
   37.96  by Auto_tac;
   37.97 @@ -132,48 +132,48 @@
   37.98  
   37.99  (*** Products and 1, by T. M. Rasmussen ***)
  37.100  
  37.101 -Goal "(m = m*(n::int)) = (n = #1 | m = #0)";
  37.102 +Goal "(m = m*(n::int)) = (n = Numeral1 | m = Numeral0)";
  37.103  by Auto_tac;
  37.104 -by (subgoal_tac "m*#1 = m*n" 1);
  37.105 +by (subgoal_tac "m*Numeral1 = m*n" 1);
  37.106  by (dtac (zmult_cancel1 RS iffD1) 1); 
  37.107  by Auto_tac;
  37.108  qed "zmult_eq_self_iff";
  37.109  
  37.110 -Goal "[| #1 < m; #1 < n |] ==> #1 < m*(n::int)";
  37.111 -by (res_inst_tac [("y","#1*n")] order_less_trans 1);
  37.112 +Goal "[| Numeral1 < m; Numeral1 < n |] ==> Numeral1 < m*(n::int)";
  37.113 +by (res_inst_tac [("y","Numeral1*n")] order_less_trans 1);
  37.114  by (rtac zmult_zless_mono1 2);
  37.115  by (ALLGOALS Asm_simp_tac);
  37.116  qed "zless_1_zmult";
  37.117  
  37.118 -Goal "[| #0 < n; n ~= #1 |] ==> #1 < (n::int)";
  37.119 +Goal "[| Numeral0 < n; n ~= Numeral1 |] ==> Numeral1 < (n::int)";
  37.120  by (arith_tac 1);
  37.121  val lemma = result();
  37.122  
  37.123 -Goal "#0 < (m::int) ==> (m * n = #1) = (m = #1 & n = #1)";
  37.124 +Goal "Numeral0 < (m::int) ==> (m * n = Numeral1) = (m = Numeral1 & n = Numeral1)";
  37.125  by Auto_tac;
  37.126 -by (case_tac "m=#1" 1);
  37.127 -by (case_tac "n=#1" 2);
  37.128 -by (case_tac "m=#1" 4);
  37.129 -by (case_tac "n=#1" 5);
  37.130 +by (case_tac "m=Numeral1" 1);
  37.131 +by (case_tac "n=Numeral1" 2);
  37.132 +by (case_tac "m=Numeral1" 4);
  37.133 +by (case_tac "n=Numeral1" 5);
  37.134  by Auto_tac;
  37.135  by distinct_subgoals_tac;
  37.136 -by (subgoal_tac "#1<m*n" 1);
  37.137 +by (subgoal_tac "Numeral1<m*n" 1);
  37.138  by (Asm_full_simp_tac 1);
  37.139  by (rtac zless_1_zmult 1);
  37.140  by (ALLGOALS (rtac lemma));
  37.141  by Auto_tac;  
  37.142 -by (subgoal_tac "#0<m*n" 1);
  37.143 +by (subgoal_tac "Numeral0<m*n" 1);
  37.144  by (Asm_simp_tac 2);
  37.145  by (dtac (int_0_less_mult_iff RS iffD1) 1);
  37.146  by Auto_tac;  
  37.147  qed "pos_zmult_eq_1_iff";
  37.148  
  37.149 -Goal "(m*n = (#1::int)) = ((m = #1 & n = #1) | (m = #-1 & n = #-1))";
  37.150 -by (case_tac "#0<m" 1);
  37.151 +Goal "(m*n = (Numeral1::int)) = ((m = Numeral1 & n = Numeral1) | (m = # -1 & n = # -1))";
  37.152 +by (case_tac "Numeral0<m" 1);
  37.153  by (asm_simp_tac (simpset() addsimps [pos_zmult_eq_1_iff]) 1);
  37.154 -by (case_tac "m=#0" 1);
  37.155 +by (case_tac "m=Numeral0" 1);
  37.156  by (Asm_simp_tac 1);
  37.157 -by (subgoal_tac "#0 < -m" 1);
  37.158 +by (subgoal_tac "Numeral0 < -m" 1);
  37.159  by (arith_tac 2);
  37.160  by (dres_inst_tac [("n","-n")] pos_zmult_eq_1_iff 1); 
  37.161  by Auto_tac;  
    38.1 --- a/src/HOL/Integ/IntDef.ML	Fri Oct 05 21:50:37 2001 +0200
    38.2 +++ b/src/HOL/Integ/IntDef.ML	Fri Oct 05 21:52:39 2001 +0200
    38.3 @@ -7,8 +7,8 @@
    38.4  *)
    38.5  
    38.6  
    38.7 -(*Rewrite the overloaded 0::int to (int 0)*)
    38.8 -Addsimps [Zero_def];
    38.9 +(*Rewrite the overloaded 0::int to (int 0)*)    (* FIXME !? *)
   38.10 +Addsimps [Zero_int_def];
   38.11  
   38.12  Goalw  [intrel_def] "(((x1,y1),(x2,y2)): intrel) = (x1+y2 = x2+y1)";
   38.13  by (Blast_tac 1);
   38.14 @@ -326,7 +326,7 @@
   38.15  by (asm_simp_tac (simpset() addsimps [zmult]) 1);
   38.16  qed "zmult_int0";
   38.17  
   38.18 -Goalw [int_def] "int 1' * z = z";
   38.19 +Goalw [int_def] "int (Suc 0) * z = z";
   38.20  by (res_inst_tac [("z","z")] eq_Abs_Integ 1);
   38.21  by (asm_simp_tac (simpset() addsimps [zmult]) 1);
   38.22  qed "zmult_int1";
   38.23 @@ -335,7 +335,7 @@
   38.24  by (rtac ([zmult_commute, zmult_int0] MRS trans) 1);
   38.25  qed "zmult_int0_right";
   38.26  
   38.27 -Goal "z * int 1' = z";
   38.28 +Goal "z * int (Suc 0) = z";
   38.29  by (rtac ([zmult_commute, zmult_int1] MRS trans) 1);
   38.30  qed "zmult_int1_right";
   38.31  
    39.1 --- a/src/HOL/Integ/IntDef.thy	Fri Oct 05 21:50:37 2001 +0200
    39.2 +++ b/src/HOL/Integ/IntDef.thy	Fri Oct 05 21:52:39 2001 +0200
    39.3 @@ -35,7 +35,7 @@
    39.4    
    39.5  defs (*of overloaded constants*)
    39.6    
    39.7 -  Zero_def      "0 == int 0"
    39.8 +  Zero_int_def      "0 == int 0"
    39.9  
   39.10    zadd_def
   39.11     "z + w == 
    40.1 --- a/src/HOL/Integ/IntDiv.ML	Fri Oct 05 21:50:37 2001 +0200
    40.2 +++ b/src/HOL/Integ/IntDiv.ML	Fri Oct 05 21:52:39 2001 +0200
    40.3 @@ -34,21 +34,21 @@
    40.4  
    40.5  (*** Uniqueness and monotonicity of quotients and remainders ***)
    40.6  
    40.7 -Goal "[| b*q' + r'  <= b*q + r;  #0 <= r';  #0 < b;  r < b |] \
    40.8 +Goal "[| b*q' + r'  <= b*q + r;  Numeral0 <= r';  Numeral0 < b;  r < b |] \
    40.9  \     ==> q' <= (q::int)";
   40.10  by (subgoal_tac "r' + b * (q'-q) <= r" 1);
   40.11  by (simp_tac (simpset() addsimps [zdiff_zmult_distrib2]) 2);
   40.12 -by (subgoal_tac "#0 < b * (#1 + q - q')" 1);
   40.13 +by (subgoal_tac "Numeral0 < b * (Numeral1 + q - q')" 1);
   40.14  by (etac order_le_less_trans 2);
   40.15  by (full_simp_tac (simpset() addsimps [zdiff_zmult_distrib2,
   40.16  				       zadd_zmult_distrib2]) 2);
   40.17 -by (subgoal_tac "b * q' < b * (#1 + q)" 1);
   40.18 +by (subgoal_tac "b * q' < b * (Numeral1 + q)" 1);
   40.19  by (full_simp_tac (simpset() addsimps [zdiff_zmult_distrib2,
   40.20  				       zadd_zmult_distrib2]) 2);
   40.21  by (asm_full_simp_tac (simpset() addsimps [zmult_zless_cancel1]) 1); 
   40.22  qed "unique_quotient_lemma";
   40.23  
   40.24 -Goal "[| b*q' + r' <= b*q + r;  r <= #0;  b < #0;  b < r' |] \
   40.25 +Goal "[| b*q' + r' <= b*q + r;  r <= Numeral0;  b < Numeral0;  b < r' |] \
   40.26  \     ==> q <= (q'::int)";
   40.27  by (res_inst_tac [("b", "-b"), ("r", "-r'"), ("r'", "-r")] 
   40.28      unique_quotient_lemma 1);
   40.29 @@ -57,7 +57,7 @@
   40.30  qed "unique_quotient_lemma_neg";
   40.31  
   40.32  
   40.33 -Goal "[| quorem ((a,b), (q,r));  quorem ((a,b), (q',r'));  b ~= #0 |] \
   40.34 +Goal "[| quorem ((a,b), (q,r));  quorem ((a,b), (q',r'));  b ~= Numeral0 |] \
   40.35  \     ==> q = q'";
   40.36  by (asm_full_simp_tac 
   40.37      (simpset() addsimps split_ifs@
   40.38 @@ -72,7 +72,7 @@
   40.39  qed "unique_quotient";
   40.40  
   40.41  
   40.42 -Goal "[| quorem ((a,b), (q,r));  quorem ((a,b), (q',r'));  b ~= #0 |] \
   40.43 +Goal "[| quorem ((a,b), (q,r));  quorem ((a,b), (q',r'));  b ~= Numeral0 |] \
   40.44  \     ==> r = r'";
   40.45  by (subgoal_tac "q = q'" 1);
   40.46  by (blast_tac (claset() addIs [unique_quotient]) 2);
   40.47 @@ -84,8 +84,8 @@
   40.48  
   40.49  
   40.50  Goal "adjust a b (q,r) = (let diff = r-b in \
   40.51 -\                         if #0 <= diff then (#2*q + #1, diff)  \
   40.52 -\                                       else (#2*q, r))";
   40.53 +\                         if Numeral0 <= diff then (# 2*q + Numeral1, diff)  \
   40.54 +\                                       else (# 2*q, r))";
   40.55  by (simp_tac (simpset() addsimps [Let_def,adjust_def]) 1);
   40.56  qed "adjust_eq";
   40.57  Addsimps [adjust_eq];
   40.58 @@ -101,9 +101,9 @@
   40.59  bind_thm ("posDivAlg_raw_eqn", lemma RS hd posDivAlg.simps);
   40.60  
   40.61  (**use with simproc to avoid re-proving the premise*)
   40.62 -Goal "#0 < b ==> \
   40.63 +Goal "Numeral0 < b ==> \
   40.64  \     posDivAlg (a,b) =      \
   40.65 -\      (if a<b then (#0,a) else adjust a b (posDivAlg(a, #2*b)))";
   40.66 +\      (if a<b then (Numeral0,a) else adjust a b (posDivAlg(a, # 2*b)))";
   40.67  by (rtac (posDivAlg_raw_eqn RS trans) 1);
   40.68  by (Asm_simp_tac 1);
   40.69  qed "posDivAlg_eqn";
   40.70 @@ -112,7 +112,7 @@
   40.71  
   40.72  
   40.73  (*Correctness of posDivAlg: it computes quotients correctly*)
   40.74 -Goal "#0 <= a --> #0 < b --> quorem ((a, b), posDivAlg (a, b))";
   40.75 +Goal "Numeral0 <= a --> Numeral0 < b --> quorem ((a, b), posDivAlg (a, b))";
   40.76  by (induct_thm_tac posDivAlg_induct "a b" 1);
   40.77  by Auto_tac;
   40.78  by (ALLGOALS (asm_full_simp_tac (simpset() addsimps [quorem_def])));
   40.79 @@ -139,9 +139,9 @@
   40.80  bind_thm ("negDivAlg_raw_eqn", lemma RS hd negDivAlg.simps);
   40.81  
   40.82  (**use with simproc to avoid re-proving the premise*)
   40.83 -Goal "#0 < b ==> \
   40.84 +Goal "Numeral0 < b ==> \
   40.85  \     negDivAlg (a,b) =      \
   40.86 -\      (if #0<=a+b then (#-1,a+b) else adjust a b (negDivAlg(a, #2*b)))";
   40.87 +\      (if Numeral0<=a+b then (# -1,a+b) else adjust a b (negDivAlg(a, # 2*b)))";
   40.88  by (rtac (negDivAlg_raw_eqn RS trans) 1);
   40.89  by (Asm_simp_tac 1);
   40.90  qed "negDivAlg_eqn";
   40.91 @@ -151,7 +151,7 @@
   40.92  
   40.93  (*Correctness of negDivAlg: it computes quotients correctly
   40.94    It doesn't work if a=0 because the 0/b=0 rather than -1*)
   40.95 -Goal "a < #0 --> #0 < b --> quorem ((a, b), negDivAlg (a, b))";
   40.96 +Goal "a < Numeral0 --> Numeral0 < b --> quorem ((a, b), negDivAlg (a, b))";
   40.97  by (induct_thm_tac negDivAlg_induct "a b" 1);
   40.98  by Auto_tac;
   40.99  by (ALLGOALS (asm_full_simp_tac (simpset() addsimps [quorem_def])));
  40.100 @@ -168,18 +168,18 @@
  40.101  (*** Existence shown by proving the division algorithm to be correct ***)
  40.102  
  40.103  (*the case a=0*)
  40.104 -Goal "b ~= #0 ==> quorem ((#0,b), (#0,#0))";
  40.105 +Goal "b ~= Numeral0 ==> quorem ((Numeral0,b), (Numeral0,Numeral0))";
  40.106  by (auto_tac (claset(), 
  40.107  	      simpset() addsimps [quorem_def, linorder_neq_iff]));
  40.108  qed "quorem_0";
  40.109  
  40.110 -Goal "posDivAlg (#0, b) = (#0, #0)";
  40.111 +Goal "posDivAlg (Numeral0, b) = (Numeral0, Numeral0)";
  40.112  by (stac posDivAlg_raw_eqn 1);
  40.113  by Auto_tac;
  40.114  qed "posDivAlg_0";
  40.115  Addsimps [posDivAlg_0];
  40.116  
  40.117 -Goal "negDivAlg (#-1, b) = (#-1, b-#1)";
  40.118 +Goal "negDivAlg (# -1, b) = (# -1, b-Numeral1)";
  40.119  by (stac negDivAlg_raw_eqn 1);
  40.120  by Auto_tac;
  40.121  qed "negDivAlg_minus1";
  40.122 @@ -194,7 +194,7 @@
  40.123  by (auto_tac (claset(), simpset() addsimps split_ifs@[quorem_def]));
  40.124  qed "quorem_neg";
  40.125  
  40.126 -Goal "b ~= #0 ==> quorem ((a,b), divAlg(a,b))";
  40.127 +Goal "b ~= Numeral0 ==> quorem ((a,b), divAlg(a,b))";
  40.128  by (auto_tac (claset(), 
  40.129  	      simpset() addsimps [quorem_0, divAlg_def]));
  40.130  by (REPEAT_FIRST (resolve_tac [quorem_neg, posDivAlg_correct,
  40.131 @@ -206,11 +206,11 @@
  40.132  (** Arbitrary definitions for division by zero.  Useful to simplify 
  40.133      certain equations **)
  40.134  
  40.135 -Goal "a div (#0::int) = #0";
  40.136 +Goal "a div (Numeral0::int) = Numeral0";
  40.137  by (simp_tac (simpset() addsimps [div_def, divAlg_def, posDivAlg_raw_eqn]) 1);
  40.138  qed "DIVISION_BY_ZERO_ZDIV";  (*NOT for adding to default simpset*)
  40.139  
  40.140 -Goal "a mod (#0::int) = a";
  40.141 +Goal "a mod (Numeral0::int) = a";
  40.142  by (simp_tac (simpset() addsimps [mod_def, divAlg_def, posDivAlg_raw_eqn]) 1);
  40.143  qed "DIVISION_BY_ZERO_ZMOD";  (*NOT for adding to default simpset*)
  40.144  
  40.145 @@ -222,20 +222,20 @@
  40.146  (** Basic laws about division and remainder **)
  40.147  
  40.148  Goal "(a::int) = b * (a div b) + (a mod b)";
  40.149 -by (zdiv_undefined_case_tac "b = #0" 1);
  40.150 +by (zdiv_undefined_case_tac "b = Numeral0" 1);
  40.151  by (cut_inst_tac [("a","a"),("b","b")] divAlg_correct 1);
  40.152  by (auto_tac (claset(), 
  40.153  	      simpset() addsimps [quorem_def, div_def, mod_def]));
  40.154  qed "zmod_zdiv_equality";  
  40.155  
  40.156 -Goal "(#0::int) < b ==> #0 <= a mod b & a mod b < b";
  40.157 +Goal "(Numeral0::int) < b ==> Numeral0 <= a mod b & a mod b < b";
  40.158  by (cut_inst_tac [("a","a"),("b","b")] divAlg_correct 1);
  40.159  by (auto_tac (claset(), 
  40.160  	      simpset() addsimps [quorem_def, mod_def]));
  40.161  bind_thm ("pos_mod_sign", result() RS conjunct1);
  40.162  bind_thm ("pos_mod_bound", result() RS conjunct2);
  40.163  
  40.164 -Goal "b < (#0::int) ==> a mod b <= #0 & b < a mod b";
  40.165 +Goal "b < (Numeral0::int) ==> a mod b <= Numeral0 & b < a mod b";
  40.166  by (cut_inst_tac [("a","a"),("b","b")] divAlg_correct 1);
  40.167  by (auto_tac (claset(), 
  40.168  	      simpset() addsimps [quorem_def, div_def, mod_def]));
  40.169 @@ -245,7 +245,7 @@
  40.170  
  40.171  (** proving general properties of div and mod **)
  40.172  
  40.173 -Goal "b ~= #0 ==> quorem ((a, b), (a div b, a mod b))";
  40.174 +Goal "b ~= Numeral0 ==> quorem ((a, b), (a div b, a mod b))";
  40.175  by (cut_inst_tac [("a","a"),("b","b")] zmod_zdiv_equality 1);
  40.176  by (auto_tac
  40.177      (claset(),
  40.178 @@ -254,43 +254,43 @@
  40.179  			 neg_mod_sign, neg_mod_bound]));
  40.180  qed "quorem_div_mod";
  40.181  
  40.182 -Goal "[| quorem((a,b),(q,r));  b ~= #0 |] ==> a div b = q";
  40.183 +Goal "[| quorem((a,b),(q,r));  b ~= Numeral0 |] ==> a div b = q";
  40.184  by (asm_simp_tac (simpset() addsimps [quorem_div_mod RS unique_quotient]) 1);
  40.185  qed "quorem_div";
  40.186  
  40.187 -Goal "[| quorem((a,b),(q,r));  b ~= #0 |] ==> a mod b = r";
  40.188 +Goal "[| quorem((a,b),(q,r));  b ~= Numeral0 |] ==> a mod b = r";
  40.189  by (asm_simp_tac (simpset() addsimps [quorem_div_mod RS unique_remainder]) 1);
  40.190  qed "quorem_mod";
  40.191  
  40.192 -Goal "[| (#0::int) <= a;  a < b |] ==> a div b = #0";
  40.193 +Goal "[| (Numeral0::int) <= a;  a < b |] ==> a div b = Numeral0";
  40.194  by (rtac quorem_div 1);
  40.195  by (auto_tac (claset(), simpset() addsimps [quorem_def]));
  40.196  qed "div_pos_pos_trivial";
  40.197  
  40.198 -Goal "[| a <= (#0::int);  b < a |] ==> a div b = #0";
  40.199 +Goal "[| a <= (Numeral0::int);  b < a |] ==> a div b = Numeral0";
  40.200  by (rtac quorem_div 1);
  40.201  by (auto_tac (claset(), simpset() addsimps [quorem_def]));
  40.202  qed "div_neg_neg_trivial";
  40.203  
  40.204 -Goal "[| (#0::int) < a;  a+b <= #0 |] ==> a div b = #-1";
  40.205 +Goal "[| (Numeral0::int) < a;  a+b <= Numeral0 |] ==> a div b = # -1";
  40.206  by (rtac quorem_div 1);
  40.207  by (auto_tac (claset(), simpset() addsimps [quorem_def]));
  40.208  qed "div_pos_neg_trivial";
  40.209  
  40.210 -(*There is no div_neg_pos_trivial because  #0 div b = #0 would supersede it*)
  40.211 +(*There is no div_neg_pos_trivial because  Numeral0 div b = Numeral0 would supersede it*)
  40.212  
  40.213 -Goal "[| (#0::int) <= a;  a < b |] ==> a mod b = a";
  40.214 -by (res_inst_tac [("q","#0")] quorem_mod 1);
  40.215 +Goal "[| (Numeral0::int) <= a;  a < b |] ==> a mod b = a";
  40.216 +by (res_inst_tac [("q","Numeral0")] quorem_mod 1);
  40.217  by (auto_tac (claset(), simpset() addsimps [quorem_def]));
  40.218  qed "mod_pos_pos_trivial";
  40.219  
  40.220 -Goal "[| a <= (#0::int);  b < a |] ==> a mod b = a";
  40.221 -by (res_inst_tac [("q","#0")] quorem_mod 1);
  40.222 +Goal "[| a <= (Numeral0::int);  b < a |] ==> a mod b = a";
  40.223 +by (res_inst_tac [("q","Numeral0")] quorem_mod 1);
  40.224  by (auto_tac (claset(), simpset() addsimps [quorem_def]));
  40.225  qed "mod_neg_neg_trivial";
  40.226  
  40.227 -Goal "[| (#0::int) < a;  a+b <= #0 |] ==> a mod b = a+b";
  40.228 -by (res_inst_tac [("q","#-1")] quorem_mod 1);
  40.229 +Goal "[| (Numeral0::int) < a;  a+b <= Numeral0 |] ==> a mod b = a+b";
  40.230 +by (res_inst_tac [("q","# -1")] quorem_mod 1);
  40.231  by (auto_tac (claset(), simpset() addsimps [quorem_def]));
  40.232  qed "mod_pos_neg_trivial";
  40.233  
  40.234 @@ -299,7 +299,7 @@
  40.235  
  40.236  (*Simpler laws such as -a div b = -(a div b) FAIL, but see just below*)
  40.237  Goal "(-a) div (-b) = a div (b::int)";
  40.238 -by (zdiv_undefined_case_tac "b = #0" 1);
  40.239 +by (zdiv_undefined_case_tac "b = Numeral0" 1);
  40.240  by (stac ((simplify(simpset()) (quorem_div_mod RS quorem_neg)) 
  40.241  	  RS quorem_div) 1);
  40.242  by Auto_tac;
  40.243 @@ -308,7 +308,7 @@
  40.244  
  40.245  (*Simpler laws such as -a mod b = -(a mod b) FAIL, but see just below*)
  40.246  Goal "(-a) mod (-b) = - (a mod (b::int))";
  40.247 -by (zdiv_undefined_case_tac "b = #0" 1);
  40.248 +by (zdiv_undefined_case_tac "b = Numeral0" 1);
  40.249  by (stac ((simplify(simpset()) (quorem_div_mod RS quorem_neg)) 
  40.250  	  RS quorem_mod) 1);
  40.251  by Auto_tac;
  40.252 @@ -319,8 +319,8 @@
  40.253  (*** div, mod and unary minus ***)
  40.254  
  40.255  Goal "quorem((a,b),(q,r)) \
  40.256 -\     ==> quorem ((-a,b), (if r=#0 then -q else -q-#1), \
  40.257 -\                         (if r=#0 then #0 else b-r))";
  40.258 +\     ==> quorem ((-a,b), (if r=Numeral0 then -q else -q-Numeral1), \
  40.259 +\                         (if r=Numeral0 then Numeral0 else b-r))";
  40.260  by (auto_tac
  40.261      (claset(),
  40.262       simpset() addsimps split_ifs@
  40.263 @@ -328,14 +328,14 @@
  40.264  			 zdiff_zmult_distrib2]));
  40.265  val lemma = result();
  40.266  
  40.267 -Goal "b ~= (#0::int) \
  40.268 +Goal "b ~= (Numeral0::int) \
  40.269  \     ==> (-a) div b = \
  40.270 -\         (if a mod b = #0 then - (a div b) else  - (a div b) - #1)";
  40.271 +\         (if a mod b = Numeral0 then - (a div b) else  - (a div b) - Numeral1)";
  40.272  by (blast_tac (claset() addIs [quorem_div_mod RS lemma RS quorem_div]) 1);
  40.273  qed "zdiv_zminus1_eq_if";
  40.274  
  40.275 -Goal "(-a::int) mod b = (if a mod b = #0 then #0 else  b - (a mod b))";
  40.276 -by (zdiv_undefined_case_tac "b = #0" 1);
  40.277 +Goal "(-a::int) mod b = (if a mod b = Numeral0 then Numeral0 else  b - (a mod b))";
  40.278 +by (zdiv_undefined_case_tac "b = Numeral0" 1);
  40.279  by (blast_tac (claset() addIs [quorem_div_mod RS lemma RS quorem_mod]) 1);
  40.280  qed "zmod_zminus1_eq_if";
  40.281  
  40.282 @@ -349,32 +349,32 @@
  40.283  by Auto_tac;  
  40.284  qed "zmod_zminus2";
  40.285  
  40.286 -Goal "b ~= (#0::int) \
  40.287 +Goal "b ~= (Numeral0::int) \
  40.288  \     ==> a div (-b) = \
  40.289 -\         (if a mod b = #0 then - (a div b) else  - (a div b) - #1)";
  40.290 +\         (if a mod b = Numeral0 then - (a div b) else  - (a div b) - Numeral1)";
  40.291  by (asm_simp_tac (simpset() addsimps [zdiv_zminus1_eq_if, zdiv_zminus2]) 1); 
  40.292  qed "zdiv_zminus2_eq_if";
  40.293  
  40.294 -Goal "a mod (-b::int) = (if a mod b = #0 then #0 else  (a mod b) - b)";
  40.295 +Goal "a mod (-b::int) = (if a mod b = Numeral0 then Numeral0 else  (a mod b) - b)";
  40.296  by (asm_simp_tac (simpset() addsimps [zmod_zminus1_eq_if, zmod_zminus2]) 1); 
  40.297  qed "zmod_zminus2_eq_if";
  40.298  
  40.299  
  40.300  (*** division of a number by itself ***)
  40.301  
  40.302 -Goal "[| (#0::int) < a; a = r + a*q; r < a |] ==> #1 <= q";
  40.303 -by (subgoal_tac "#0 < a*q" 1);
  40.304 +Goal "[| (Numeral0::int) < a; a = r + a*q; r < a |] ==> Numeral1 <= q";
  40.305 +by (subgoal_tac "Numeral0 < a*q" 1);
  40.306  by (arith_tac 2);
  40.307  by (asm_full_simp_tac (simpset() addsimps [int_0_less_mult_iff]) 1);
  40.308  val lemma1 = result();
  40.309  
  40.310 -Goal "[| (#0::int) < a; a = r + a*q; #0 <= r |] ==> q <= #1";
  40.311 -by (subgoal_tac "#0 <= a*(#1-q)" 1);
  40.312 +Goal "[| (Numeral0::int) < a; a = r + a*q; Numeral0 <= r |] ==> q <= Numeral1";
  40.313 +by (subgoal_tac "Numeral0 <= a*(Numeral1-q)" 1);
  40.314  by (asm_simp_tac (simpset() addsimps [zdiff_zmult_distrib2]) 2);
  40.315  by (asm_full_simp_tac (simpset() addsimps [int_0_le_mult_iff]) 1);
  40.316  val lemma2 = result();
  40.317  
  40.318 -Goal "[| quorem((a,a),(q,r));  a ~= (#0::int) |] ==> q = #1";
  40.319 +Goal "[| quorem((a,a),(q,r));  a ~= (Numeral0::int) |] ==> q = Numeral1";
  40.320  by (asm_full_simp_tac 
  40.321      (simpset() addsimps split_ifs@[quorem_def, linorder_neq_iff]) 1);
  40.322  by (rtac order_antisym 1);
  40.323 @@ -386,20 +386,20 @@
  40.324  	      simpset() addsimps [zadd_commute, zmult_zminus]) 1));
  40.325  qed "self_quotient";
  40.326  
  40.327 -Goal "[| quorem((a,a),(q,r));  a ~= (#0::int) |] ==> r = #0";
  40.328 +Goal "[| quorem((a,a),(q,r));  a ~= (Numeral0::int) |] ==> r = Numeral0";
  40.329  by (ftac self_quotient 1);
  40.330  by (assume_tac 1);
  40.331  by (asm_full_simp_tac (simpset() addsimps [quorem_def]) 1);
  40.332  qed "self_remainder";
  40.333  
  40.334 -Goal "a ~= #0 ==> a div a = (#1::int)";
  40.335 +Goal "a ~= Numeral0 ==> a div a = (Numeral1::int)";
  40.336  by (asm_simp_tac (simpset() addsimps [quorem_div_mod RS self_quotient]) 1);
  40.337  qed "zdiv_self";
  40.338  Addsimps [zdiv_self];
  40.339  
  40.340  (*Here we have 0 mod 0 = 0, also assumed by Knuth (who puts m mod 0 = 0) *)
  40.341 -Goal "a mod a = (#0::int)";
  40.342 -by (zdiv_undefined_case_tac "a = #0" 1);
  40.343 +Goal "a mod a = (Numeral0::int)";
  40.344 +by (zdiv_undefined_case_tac "a = Numeral0" 1);
  40.345  by (asm_simp_tac (simpset() addsimps [quorem_div_mod RS self_remainder]) 1);
  40.346  qed "zmod_self";
  40.347  Addsimps [zmod_self];
  40.348 @@ -407,65 +407,65 @@
  40.349  
  40.350  (*** Computation of division and remainder ***)
  40.351  
  40.352 -Goal "(#0::int) div b = #0";
  40.353 +Goal "(Numeral0::int) div b = Numeral0";
  40.354  by (simp_tac (simpset() addsimps [div_def, divAlg_def]) 1);
  40.355  qed "zdiv_zero";
  40.356  
  40.357 -Goal "(#0::int) < b ==> #-1 div b = #-1";
  40.358 +Goal "(Numeral0::int) < b ==> # -1 div b = # -1";
  40.359  by (asm_simp_tac (simpset() addsimps [div_def, divAlg_def]) 1);
  40.360  qed "div_eq_minus1";
  40.361  
  40.362 -Goal "(#0::int) mod b = #0";
  40.363 +Goal "(Numeral0::int) mod b = Numeral0";
  40.364  by (simp_tac (simpset() addsimps [mod_def, divAlg_def]) 1);
  40.365  qed "zmod_zero";
  40.366  
  40.367  Addsimps [zdiv_zero, zmod_zero];
  40.368  
  40.369 -Goal "(#0::int) < b ==> #-1 div b = #-1";
  40.370 +Goal "(Numeral0::int) < b ==> # -1 div b = # -1";
  40.371  by (asm_simp_tac (simpset() addsimps [div_def, divAlg_def]) 1);
  40.372  qed "zdiv_minus1";
  40.373  
  40.374 -Goal "(#0::int) < b ==> #-1 mod b = b-#1";
  40.375 +Goal "(Numeral0::int) < b ==> # -1 mod b = b-Numeral1";
  40.376  by (asm_simp_tac (simpset() addsimps [mod_def, divAlg_def]) 1);
  40.377  qed "zmod_minus1";
  40.378  
  40.379  (** a positive, b positive **)
  40.380  
  40.381 -Goal "[| #0 < a;  #0 <= b |] ==> a div b = fst (posDivAlg(a,b))";
  40.382 +Goal "[| Numeral0 < a;  Numeral0 <= b |] ==> a div b = fst (posDivAlg(a,b))";
  40.383  by (asm_simp_tac (simpset() addsimps [div_def, divAlg_def]) 1);
  40.384  qed "div_pos_pos";
  40.385  
  40.386 -Goal "[| #0 < a;  #0 <= b |] ==> a mod b = snd (posDivAlg(a,b))";
  40.387 +Goal "[| Numeral0 < a;  Numeral0 <= b |] ==> a mod b = snd (posDivAlg(a,b))";
  40.388  by (asm_simp_tac (simpset() addsimps [mod_def, divAlg_def]) 1);
  40.389  qed "mod_pos_pos";
  40.390  
  40.391  (** a negative, b positive **)
  40.392  
  40.393 -Goal "[| a < #0;  #0 < b |] ==> a div b = fst (negDivAlg(a,b))";
  40.394 +Goal "[| a < Numeral0;  Numeral0 < b |] ==> a div b = fst (negDivAlg(a,b))";
  40.395  by (asm_simp_tac (simpset() addsimps [div_def, divAlg_def]) 1);
  40.396  qed "div_neg_pos";
  40.397  
  40.398 -Goal "[| a < #0;  #0 < b |] ==> a mod b = snd (negDivAlg(a,b))";
  40.399 +Goal "[| a < Numeral0;  Numeral0 < b |] ==> a mod b = snd (negDivAlg(a,b))";
  40.400  by (asm_simp_tac (simpset() addsimps [mod_def, divAlg_def]) 1);
  40.401  qed "mod_neg_pos";
  40.402  
  40.403  (** a positive, b negative **)
  40.404  
  40.405 -Goal "[| #0 < a;  b < #0 |] ==> a div b = fst (negateSnd(negDivAlg(-a,-b)))";
  40.406 +Goal "[| Numeral0 < a;  b < Numeral0 |] ==> a div b = fst (negateSnd(negDivAlg(-a,-b)))";
  40.407  by (asm_simp_tac (simpset() addsimps [div_def, divAlg_def]) 1);
  40.408  qed "div_pos_neg";
  40.409  
  40.410 -Goal "[| #0 < a;  b < #0 |] ==> a mod b = snd (negateSnd(negDivAlg(-a,-b)))";
  40.411 +Goal "[| Numeral0 < a;  b < Numeral0 |] ==> a mod b = snd (negateSnd(negDivAlg(-a,-b)))";
  40.412  by (asm_simp_tac (simpset() addsimps [mod_def, divAlg_def]) 1);
  40.413  qed "mod_pos_neg";
  40.414  
  40.415  (** a negative, b negative **)
  40.416  
  40.417 -Goal "[| a < #0;  b <= #0 |] ==> a div b = fst (negateSnd(posDivAlg(-a,-b)))";
  40.418 +Goal "[| a < Numeral0;  b <= Numeral0 |] ==> a div b = fst (negateSnd(posDivAlg(-a,-b)))";
  40.419  by (asm_simp_tac (simpset() addsimps [div_def, divAlg_def]) 1);
  40.420  qed "div_neg_neg";
  40.421  
  40.422 -Goal "[| a < #0;  b <= #0 |] ==> a mod b = snd (negateSnd(posDivAlg(-a,-b)))";
  40.423 +Goal "[| a < Numeral0;  b <= Numeral0 |] ==> a mod b = snd (negateSnd(posDivAlg(-a,-b)))";
  40.424  by (asm_simp_tac (simpset() addsimps [mod_def, divAlg_def]) 1);
  40.425  qed "mod_neg_neg";
  40.426  
  40.427 @@ -478,28 +478,28 @@
  40.428  
  40.429  (** Special-case simplification **)
  40.430  
  40.431 -Goal "a mod (#1::int) = #0";
  40.432 -by (cut_inst_tac [("a","a"),("b","#1")] pos_mod_sign 1);
  40.433 -by (cut_inst_tac [("a","a"),("b","#1")] pos_mod_bound 2);
  40.434 +Goal "a mod (Numeral1::int) = Numeral0";
  40.435 +by (cut_inst_tac [("a","a"),("b","Numeral1")] pos_mod_sign 1);
  40.436 +by (cut_inst_tac [("a","a"),("b","Numeral1")] pos_mod_bound 2);
  40.437  by Auto_tac;
  40.438  qed "zmod_1";
  40.439  Addsimps [zmod_1];
  40.440  
  40.441 -Goal "a div (#1::int) = a";
  40.442 -by (cut_inst_tac [("a","a"),("b","#1")] zmod_zdiv_equality 1);
  40.443 +Goal "a div (Numeral1::int) = a";
  40.444 +by (cut_inst_tac [("a","a"),("b","Numeral1")] zmod_zdiv_equality 1);
  40.445  by Auto_tac;
  40.446  qed "zdiv_1";
  40.447  Addsimps [zdiv_1];
  40.448  
  40.449 -Goal "a mod (#-1::int) = #0";
  40.450 -by (cut_inst_tac [("a","a"),("b","#-1")] neg_mod_sign 1);
  40.451 -by (cut_inst_tac [("a","a"),("b","#-1")] neg_mod_bound 2);
  40.452 +Goal "a mod (# -1::int) = Numeral0";
  40.453 +by (cut_inst_tac [("a","a"),("b","# -1")] neg_mod_sign 1);
  40.454 +by (cut_inst_tac [("a","a"),("b","# -1")] neg_mod_bound 2);
  40.455  by Auto_tac;
  40.456  qed "zmod_minus1_right";
  40.457  Addsimps [zmod_minus1_right];
  40.458  
  40.459 -Goal "a div (#-1::int) = -a";
  40.460 -by (cut_inst_tac [("a","a"),("b","#-1")] zmod_zdiv_equality 1);
  40.461 +Goal "a div (# -1::int) = -a";
  40.462 +by (cut_inst_tac [("a","a"),("b","# -1")] zmod_zdiv_equality 1);
  40.463  by Auto_tac;
  40.464  qed "zdiv_minus1_right";
  40.465  Addsimps [zdiv_minus1_right];
  40.466 @@ -507,7 +507,7 @@
  40.467  
  40.468  (*** Monotonicity in the first argument (divisor) ***)
  40.469  
  40.470 -Goal "[| a <= a';  #0 < (b::int) |] ==> a div b <= a' div b";
  40.471 +Goal "[| a <= a';  Numeral0 < (b::int) |] ==> a div b <= a' div b";
  40.472  by (cut_inst_tac [("a","a"),("b","b")] zmod_zdiv_equality 1);
  40.473  by (cut_inst_tac [("a","a'"),("b","b")] zmod_zdiv_equality 1);
  40.474  by (rtac unique_quotient_lemma 1);
  40.475 @@ -516,7 +516,7 @@
  40.476  by (ALLGOALS (asm_simp_tac (simpset() addsimps [pos_mod_sign,pos_mod_bound])));
  40.477  qed "zdiv_mono1";
  40.478  
  40.479 -Goal "[| a <= a';  (b::int) < #0 |] ==> a' div b <= a div b";
  40.480 +Goal "[| a <= a';  (b::int) < Numeral0 |] ==> a' div b <= a div b";
  40.481  by (cut_inst_tac [("a","a"),("b","b")] zmod_zdiv_equality 1);
  40.482  by (cut_inst_tac [("a","a'"),("b","b")] zmod_zdiv_equality 1);
  40.483  by (rtac unique_quotient_lemma_neg 1);
  40.484 @@ -528,14 +528,14 @@
  40.485  
  40.486  (*** Monotonicity in the second argument (dividend) ***)
  40.487  
  40.488 -Goal "[| b*q + r = b'*q' + r';  #0 <= b'*q' + r';  \
  40.489 -\        r' < b';  #0 <= r;  #0 < b';  b' <= b |]  \
  40.490 +Goal "[| b*q + r = b'*q' + r';  Numeral0 <= b'*q' + r';  \
  40.491 +\        r' < b';  Numeral0 <= r;  Numeral0 < b';  b' <= b |]  \
  40.492  \     ==> q <= (q'::int)";
  40.493 -by (subgoal_tac "#0 <= q'" 1);
  40.494 - by (subgoal_tac "#0 < b'*(q' + #1)" 2);
  40.495 +by (subgoal_tac "Numeral0 <= q'" 1);
  40.496 + by (subgoal_tac "Numeral0 < b'*(q' + Numeral1)" 2);
  40.497    by (asm_simp_tac (simpset() addsimps [zadd_zmult_distrib2]) 3);
  40.498   by (asm_full_simp_tac (simpset() addsimps [int_0_less_mult_iff]) 2);
  40.499 -by (subgoal_tac "b*q < b*(q' + #1)" 1);
  40.500 +by (subgoal_tac "b*q < b*(q' + Numeral1)" 1);
  40.501   by (asm_full_simp_tac (simpset() addsimps [zmult_zless_cancel1]) 1); 
  40.502  by (subgoal_tac "b*q = r' - r + b'*q'" 1);
  40.503   by (Simp_tac 2);
  40.504 @@ -545,9 +545,9 @@
  40.505  by Auto_tac;
  40.506  qed "zdiv_mono2_lemma";
  40.507  
  40.508 -Goal "[| (#0::int) <= a;  #0 < b';  b' <= b |]  \
  40.509 +Goal "[| (Numeral0::int) <= a;  Numeral0 < b';  b' <= b |]  \
  40.510  \     ==> a div b <= a div b'";
  40.511 -by (subgoal_tac "b ~= #0" 1);
  40.512 +by (subgoal_tac "b ~= Numeral0" 1);
  40.513  by (arith_tac 2);
  40.514  by (cut_inst_tac [("a","a"),("b","b")] zmod_zdiv_equality 1);
  40.515  by (cut_inst_tac [("a","a"),("b","b'")] zmod_zdiv_equality 1);
  40.516 @@ -557,14 +557,14 @@
  40.517  by (ALLGOALS (asm_simp_tac (simpset() addsimps [pos_mod_sign,pos_mod_bound])));
  40.518  qed "zdiv_mono2";
  40.519  
  40.520 -Goal "[| b*q + r = b'*q' + r';  b'*q' + r' < #0;  \
  40.521 -\        r < b;  #0 <= r';  #0 < b';  b' <= b |]  \
  40.522 +Goal "[| b*q + r = b'*q' + r';  b'*q' + r' < Numeral0;  \
  40.523 +\        r < b;  Numeral0 <= r';  Numeral0 < b';  b' <= b |]  \
  40.524  \     ==> q' <= (q::int)";
  40.525 -by (subgoal_tac "q' < #0" 1);
  40.526 - by (subgoal_tac "b'*q' < #0" 2);
  40.527 +by (subgoal_tac "q' < Numeral0" 1);
  40.528 + by (subgoal_tac "b'*q' < Numeral0" 2);
  40.529    by (arith_tac 3);
  40.530   by (asm_full_simp_tac (simpset() addsimps [zmult_less_0_iff]) 2);
  40.531 -by (subgoal_tac "b*q' < b*(q + #1)" 1);
  40.532 +by (subgoal_tac "b*q' < b*(q + Numeral1)" 1);
  40.533   by (asm_full_simp_tac (simpset() addsimps [zmult_zless_cancel1]) 1); 
  40.534  by (asm_simp_tac (simpset() addsimps [zadd_zmult_distrib2]) 1);
  40.535  by (subgoal_tac "b*q' <= b'*q'" 1);
  40.536 @@ -574,7 +574,7 @@
  40.537  by (arith_tac 1);
  40.538  qed "zdiv_mono2_neg_lemma";
  40.539  
  40.540 -Goal "[| a < (#0::int);  #0 < b';  b' <= b |]  \
  40.541 +Goal "[| a < (Numeral0::int);  Numeral0 < b';  b' <= b |]  \
  40.542  \     ==> a div b' <= a div b";
  40.543  by (cut_inst_tac [("a","a"),("b","b")] zmod_zdiv_equality 1);
  40.544  by (cut_inst_tac [("a","a"),("b","b'")] zmod_zdiv_equality 1);
  40.545 @@ -589,7 +589,7 @@
  40.546  
  40.547  (** proving (a*b) div c = a * (b div c) + a * (b mod c) **)
  40.548  
  40.549 -Goal "[| quorem((b,c),(q,r));  c ~= #0 |] \
  40.550 +Goal "[| quorem((b,c),(q,r));  c ~= Numeral0 |] \
  40.551  \     ==> quorem ((a*b, c), (a*q + a*r div c, a*r mod c))";
  40.552  by (auto_tac
  40.553      (claset(),
  40.554 @@ -602,12 +602,12 @@
  40.555  val lemma = result();
  40.556  
  40.557  Goal "(a*b) div c = a*(b div c) + a*(b mod c) div (c::int)";
  40.558 -by (zdiv_undefined_case_tac "c = #0" 1);
  40.559 +by (zdiv_undefined_case_tac "c = Numeral0" 1);
  40.560  by (blast_tac (claset() addIs [quorem_div_mod RS lemma RS quorem_div]) 1);
  40.561  qed "zdiv_zmult1_eq";
  40.562  
  40.563  Goal "(a*b) mod c = a*(b mod c) mod (c::int)";
  40.564 -by (zdiv_undefined_case_tac "c = #0" 1);
  40.565 +by (zdiv_undefined_case_tac "c = Numeral0" 1);
  40.566  by (blast_tac (claset() addIs [quorem_div_mod RS lemma RS quorem_mod]) 1);
  40.567  qed "zmod_zmult1_eq";
  40.568  
  40.569 @@ -623,27 +623,27 @@
  40.570  by (rtac zmod_zmult1_eq 1);
  40.571  qed "zmod_zmult_distrib";
  40.572  
  40.573 -Goal "b ~= (#0::int) ==> (a*b) div b = a";
  40.574 +Goal "b ~= (Numeral0::int) ==> (a*b) div b = a";
  40.575  by (asm_simp_tac (simpset() addsimps [zdiv_zmult1_eq]) 1);
  40.576  qed "zdiv_zmult_self1";
  40.577  
  40.578 -Goal "b ~= (#0::int) ==> (b*a) div b = a";
  40.579 +Goal "b ~= (Numeral0::int) ==> (b*a) div b = a";
  40.580  by (stac zmult_commute 1 THEN etac zdiv_zmult_self1 1);
  40.581  qed "zdiv_zmult_self2";
  40.582  
  40.583  Addsimps [zdiv_zmult_self1, zdiv_zmult_self2];
  40.584  
  40.585 -Goal "(a*b) mod b = (#0::int)";
  40.586 +Goal "(a*b) mod b = (Numeral0::int)";
  40.587  by (simp_tac (simpset() addsimps [zmod_zmult1_eq]) 1);
  40.588  qed "zmod_zmult_self1";
  40.589  
  40.590 -Goal "(b*a) mod b = (#0::int)";
  40.591 +Goal "(b*a) mod b = (Numeral0::int)";
  40.592  by (simp_tac (simpset() addsimps [zmult_commute, zmod_zmult1_eq]) 1);
  40.593  qed "zmod_zmult_self2";
  40.594  
  40.595  Addsimps [zmod_zmult_self1, zmod_zmult_self2];
  40.596  
  40.597 -Goal "(m mod d = #0) = (EX q::int. m = d*q)";
  40.598 +Goal "(m mod d = Numeral0) = (EX q::int. m = d*q)";
  40.599  by (cut_inst_tac [("a","m"),("b","d")] zmod_zdiv_equality 1);
  40.600  by Auto_tac;  
  40.601  qed "zmod_eq_0_iff";
  40.602 @@ -652,7 +652,7 @@
  40.603  
  40.604  (** proving (a+b) div c = a div c + b div c + ((a mod c + b mod c) div c) **)
  40.605  
  40.606 -Goal "[| quorem((a,c),(aq,ar));  quorem((b,c),(bq,br));  c ~= #0 |] \
  40.607 +Goal "[| quorem((a,c),(aq,ar));  quorem((b,c),(bq,br));  c ~= Numeral0 |] \
  40.608  \     ==> quorem ((a+b, c), (aq + bq + (ar+br) div c, (ar+br) mod c))";
  40.609  by (auto_tac
  40.610      (claset(),
  40.611 @@ -666,19 +666,19 @@
  40.612  
  40.613  (*NOT suitable for rewriting: the RHS has an instance of the LHS*)
  40.614  Goal "(a+b) div (c::int) = a div c + b div c + ((a mod c + b mod c) div c)";
  40.615 -by (zdiv_undefined_case_tac "c = #0" 1);
  40.616 +by (zdiv_undefined_case_tac "c = Numeral0" 1);
  40.617  by (blast_tac (claset() addIs [[quorem_div_mod,quorem_div_mod]
  40.618  			       MRS lemma RS quorem_div]) 1);
  40.619  qed "zdiv_zadd1_eq";
  40.620  
  40.621  Goal "(a+b) mod (c::int) = (a mod c + b mod c) mod c";
  40.622 -by (zdiv_undefined_case_tac "c = #0" 1);
  40.623 +by (zdiv_undefined_case_tac "c = Numeral0" 1);
  40.624  by (blast_tac (claset() addIs [[quorem_div_mod,quorem_div_mod]
  40.625  			       MRS lemma RS quorem_mod]) 1);
  40.626  qed "zmod_zadd1_eq";
  40.627  
  40.628 -Goal "(a mod b) div b = (#0::int)";
  40.629 -by (zdiv_undefined_case_tac "b = #0" 1);
  40.630 +Goal "(a mod b) div b = (Numeral0::int)";
  40.631 +by (zdiv_undefined_case_tac "b = Numeral0" 1);
  40.632  by (auto_tac (claset(), 
  40.633         simpset() addsimps [linorder_neq_iff, 
  40.634  			   pos_mod_sign, pos_mod_bound, div_pos_pos_trivial, 
  40.635 @@ -687,7 +687,7 @@
  40.636  Addsimps [mod_div_trivial];
  40.637  
  40.638  Goal "(a mod b) mod b = a mod (b::int)";
  40.639 -by (zdiv_undefined_case_tac "b = #0" 1);
  40.640 +by (zdiv_undefined_case_tac "b = Numeral0" 1);
  40.641  by (auto_tac (claset(), 
  40.642         simpset() addsimps [linorder_neq_iff, 
  40.643  			   pos_mod_sign, pos_mod_bound, mod_pos_pos_trivial, 
  40.644 @@ -710,22 +710,22 @@
  40.645  qed "zmod_zadd_right_eq";
  40.646  
  40.647  
  40.648 -Goal "a ~= (#0::int) ==> (a+b) div a = b div a + #1";
  40.649 +Goal "a ~= (Numeral0::int) ==> (a+b) div a = b div a + Numeral1";
  40.650  by (asm_simp_tac (simpset() addsimps [zdiv_zadd1_eq]) 1);
  40.651  qed "zdiv_zadd_self1";
  40.652  
  40.653 -Goal "a ~= (#0::int) ==> (b+a) div a = b div a + #1";
  40.654 +Goal "a ~= (Numeral0::int) ==> (b+a) div a = b div a + Numeral1";
  40.655  by (asm_simp_tac (simpset() addsimps [zdiv_zadd1_eq]) 1);
  40.656  qed "zdiv_zadd_self2";
  40.657  Addsimps [zdiv_zadd_self1, zdiv_zadd_self2];
  40.658  
  40.659  Goal "(a+b) mod a = b mod (a::int)";
  40.660 -by (zdiv_undefined_case_tac "a = #0" 1);
  40.661 +by (zdiv_undefined_case_tac "a = Numeral0" 1);
  40.662  by (asm_simp_tac (simpset() addsimps [zmod_zadd1_eq]) 1);
  40.663  qed "zmod_zadd_self1";
  40.664  
  40.665  Goal "(b+a) mod a = b mod (a::int)";
  40.666 -by (zdiv_undefined_case_tac "a = #0" 1);
  40.667 +by (zdiv_undefined_case_tac "a = Numeral0" 1);
  40.668  by (asm_simp_tac (simpset() addsimps [zmod_zadd1_eq]) 1);
  40.669  qed "zmod_zadd_self2";
  40.670  Addsimps [zmod_zadd_self1, zmod_zadd_self2];
  40.671 @@ -739,8 +739,8 @@
  40.672  
  40.673  (** first, four lemmas to bound the remainder for the cases b<0 and b>0 **)
  40.674  
  40.675 -Goal "[| (#0::int) < c;  b < r;  r <= #0 |] ==> b*c < b*(q mod c) + r";
  40.676 -by (subgoal_tac "b * (c - q mod c) < r * #1" 1);
  40.677 +Goal "[| (Numeral0::int) < c;  b < r;  r <= Numeral0 |] ==> b*c < b*(q mod c) + r";
  40.678 +by (subgoal_tac "b * (c - q mod c) < r * Numeral1" 1);
  40.679  by (asm_full_simp_tac (simpset() addsimps [zdiff_zmult_distrib2]) 1);
  40.680  by (rtac order_le_less_trans 1);
  40.681  by (etac zmult_zless_mono1 2);
  40.682 @@ -751,20 +751,20 @@
  40.683                          [zadd_commute, add1_zle_eq, pos_mod_bound]));
  40.684  val lemma1 = result();
  40.685  
  40.686 -Goal "[| (#0::int) < c;   b < r;  r <= #0 |] ==> b * (q mod c) + r <= #0";
  40.687 -by (subgoal_tac "b * (q mod c) <= #0" 1);
  40.688 +Goal "[| (Numeral0::int) < c;   b < r;  r <= Numeral0 |] ==> b * (q mod c) + r <= Numeral0";
  40.689 +by (subgoal_tac "b * (q mod c) <= Numeral0" 1);
  40.690  by (arith_tac 1);
  40.691  by (asm_simp_tac (simpset() addsimps [zmult_le_0_iff, pos_mod_sign]) 1);
  40.692  val lemma2 = result();
  40.693  
  40.694 -Goal "[| (#0::int) < c;  #0 <= r;  r < b |] ==> #0 <= b * (q mod c) + r";
  40.695 -by (subgoal_tac "#0 <= b * (q mod c)" 1);
  40.696 +Goal "[| (Numeral0::int) < c;  Numeral0 <= r;  r < b |] ==> Numeral0 <= b * (q mod c) + r";
  40.697 +by (subgoal_tac "Numeral0 <= b * (q mod c)" 1);
  40.698  by (arith_tac 1);
  40.699  by (asm_simp_tac (simpset() addsimps [int_0_le_mult_iff, pos_mod_sign]) 1);
  40.700  val lemma3 = result();
  40.701  
  40.702 -Goal "[| (#0::int) < c; #0 <= r; r < b |] ==> b * (q mod c) + r < b * c";
  40.703 -by (subgoal_tac "r * #1 < b * (c - q mod c)" 1);
  40.704 +Goal "[| (Numeral0::int) < c; Numeral0 <= r; r < b |] ==> b * (q mod c) + r < b * c";
  40.705 +by (subgoal_tac "r * Numeral1 < b * (c - q mod c)" 1);
  40.706  by (asm_full_simp_tac (simpset() addsimps [zdiff_zmult_distrib2]) 1);
  40.707  by (rtac order_less_le_trans 1);
  40.708  by (etac zmult_zless_mono1 1);
  40.709 @@ -775,7 +775,7 @@
  40.710                          [zadd_commute, add1_zle_eq, pos_mod_bound]));
  40.711  val lemma4 = result();
  40.712  
  40.713 -Goal "[| quorem ((a,b), (q,r));  b ~= #0;  #0 < c |] \
  40.714 +Goal "[| quorem ((a,b), (q,r));  b ~= Numeral0;  Numeral0 < c |] \
  40.715  \     ==> quorem ((a, b*c), (q div c, b*(q mod c) + r))";
  40.716  by (auto_tac  
  40.717      (claset(),
  40.718 @@ -786,15 +786,15 @@
  40.719  			 lemma1, lemma2, lemma3, lemma4]));
  40.720  val lemma = result();
  40.721  
  40.722 -Goal "(#0::int) < c ==> a div (b*c) = (a div b) div c";
  40.723 -by (zdiv_undefined_case_tac "b = #0" 1);
  40.724 +Goal "(Numeral0::int) < c ==> a div (b*c) = (a div b) div c";
  40.725 +by (zdiv_undefined_case_tac "b = Numeral0" 1);
  40.726  by (force_tac (claset(),
  40.727  	       simpset() addsimps [quorem_div_mod RS lemma RS quorem_div, 
  40.728  				   zmult_eq_0_iff]) 1);
  40.729  qed "zdiv_zmult2_eq";
  40.730  
  40.731 -Goal "(#0::int) < c ==> a mod (b*c) = b*(a div b mod c) + a mod b";
  40.732 -by (zdiv_undefined_case_tac "b = #0" 1);
  40.733 +Goal "(Numeral0::int) < c ==> a mod (b*c) = b*(a div b mod c) + a mod b";
  40.734 +by (zdiv_undefined_case_tac "b = Numeral0" 1);
  40.735  by (force_tac (claset(),
  40.736  	       simpset() addsimps [quorem_div_mod RS lemma RS quorem_mod, 
  40.737  				   zmult_eq_0_iff]) 1);
  40.738 @@ -803,26 +803,26 @@
  40.739  
  40.740  (*** Cancellation of common factors in "div" ***)
  40.741  
  40.742 -Goal "[| (#0::int) < b;  c ~= #0 |] ==> (c*a) div (c*b) = a div b";
  40.743 +Goal "[| (Numeral0::int) < b;  c ~= Numeral0 |] ==> (c*a) div (c*b) = a div b";
  40.744  by (stac zdiv_zmult2_eq 1);
  40.745  by Auto_tac;
  40.746  val lemma1 = result();
  40.747  
  40.748 -Goal "[| b < (#0::int);  c ~= #0 |] ==> (c*a) div (c*b) = a div b";
  40.749 +Goal "[| b < (Numeral0::int);  c ~= Numeral0 |] ==> (c*a) div (c*b) = a div b";
  40.750  by (subgoal_tac "(c * (-a)) div (c * (-b)) = (-a) div (-b)" 1);
  40.751  by (rtac lemma1 2);
  40.752  by Auto_tac;
  40.753  val lemma2 = result();
  40.754  
  40.755 -Goal "c ~= (#0::int) ==> (c*a) div (c*b) = a div b";
  40.756 -by (zdiv_undefined_case_tac "b = #0" 1);
  40.757 +Goal "c ~= (Numeral0::int) ==> (c*a) div (c*b) = a div b";
  40.758 +by (zdiv_undefined_case_tac "b = Numeral0" 1);
  40.759  by (auto_tac
  40.760      (claset(), 
  40.761       simpset() addsimps [read_instantiate [("x", "b")] linorder_neq_iff, 
  40.762  			 lemma1, lemma2]));
  40.763  qed "zdiv_zmult_zmult1";
  40.764  
  40.765 -Goal "c ~= (#0::int) ==> (a*c) div (b*c) = a div b";
  40.766 +Goal "c ~= (Numeral0::int) ==> (a*c) div (b*c) = a div b";
  40.767  by (dtac zdiv_zmult_zmult1 1);
  40.768  by (auto_tac (claset(), simpset() addsimps [zmult_commute]));
  40.769  qed "zdiv_zmult_zmult2";
  40.770 @@ -831,20 +831,20 @@
  40.771  
  40.772  (*** Distribution of factors over "mod" ***)
  40.773  
  40.774 -Goal "[| (#0::int) < b;  c ~= #0 |] ==> (c*a) mod (c*b) = c * (a mod b)";
  40.775 +Goal "[| (Numeral0::int) < b;  c ~= Numeral0 |] ==> (c*a) mod (c*b) = c * (a mod b)";
  40.776  by (stac zmod_zmult2_eq 1);
  40.777  by Auto_tac;
  40.778  val lemma1 = result();
  40.779  
  40.780 -Goal "[| b < (#0::int);  c ~= #0 |] ==> (c*a) mod (c*b) = c * (a mod b)";
  40.781 +Goal "[| b < (Numeral0::int);  c ~= Numeral0 |] ==> (c*a) mod (c*b) = c * (a mod b)";
  40.782  by (subgoal_tac "(c * (-a)) mod (c * (-b)) = c * ((-a) mod (-b))" 1);
  40.783  by (rtac lemma1 2);
  40.784  by Auto_tac;
  40.785  val lemma2 = result();
  40.786  
  40.787  Goal "(c*a) mod (c*b) = (c::int) * (a mod b)";
  40.788 -by (zdiv_undefined_case_tac "b = #0" 1);
  40.789 -by (zdiv_undefined_case_tac "c = #0" 1);
  40.790 +by (zdiv_undefined_case_tac "b = Numeral0" 1);
  40.791 +by (zdiv_undefined_case_tac "c = Numeral0" 1);
  40.792  by (auto_tac
  40.793      (claset(), 
  40.794       simpset() addsimps [read_instantiate [("x", "b")] linorder_neq_iff, 
  40.795 @@ -861,13 +861,13 @@
  40.796  
  40.797  (** computing "div" by shifting **)
  40.798  
  40.799 -Goal "(#0::int) <= a ==> (#1 + #2*b) div (#2*a) = b div a";
  40.800 -by (zdiv_undefined_case_tac "a = #0" 1);
  40.801 -by (subgoal_tac "#1 <= a" 1);
  40.802 +Goal "(Numeral0::int) <= a ==> (Numeral1 + # 2*b) div (# 2*a) = b div a";
  40.803 +by (zdiv_undefined_case_tac "a = Numeral0" 1);
  40.804 +by (subgoal_tac "Numeral1 <= a" 1);
  40.805   by (arith_tac 2);
  40.806 -by (subgoal_tac "#1 < a * #2" 1);
  40.807 +by (subgoal_tac "Numeral1 < a * # 2" 1);
  40.808   by (arith_tac 2);
  40.809 -by (subgoal_tac "#2*(#1 + b mod a) <= #2*a" 1);
  40.810 +by (subgoal_tac "# 2*(Numeral1 + b mod a) <= # 2*a" 1);
  40.811   by (rtac zmult_zle_mono2 2);
  40.812  by (auto_tac (claset(),
  40.813  	      simpset() addsimps [zadd_commute, zmult_commute, 
  40.814 @@ -881,18 +881,18 @@
  40.815                      pos_mod_sign RS zadd_zle_mono1 RSN (2,order_trans)]) 1);
  40.816  by (auto_tac (claset(),
  40.817  	      simpset() addsimps [mod_pos_pos_trivial]));
  40.818 -by (subgoal_tac "#0 <= b mod a" 1);
  40.819 +by (subgoal_tac "Numeral0 <= b mod a" 1);
  40.820   by (asm_simp_tac (simpset() addsimps [pos_mod_sign]) 2);
  40.821  by (arith_tac 1);
  40.822  qed "pos_zdiv_mult_2";
  40.823  
  40.824  
  40.825 -Goal "a <= (#0::int) ==> (#1 + #2*b) div (#2*a) = (b+#1) div a";
  40.826 -by (subgoal_tac "(#1 + #2*(-b-#1)) div (#2 * (-a)) = (-b-#1) div (-a)" 1);
  40.827 +Goal "a <= (Numeral0::int) ==> (Numeral1 + # 2*b) div (# 2*a) = (b+Numeral1) div a";
  40.828 +by (subgoal_tac "(Numeral1 + # 2*(-b-Numeral1)) div (# 2 * (-a)) = (-b-Numeral1) div (-a)" 1);
  40.829  by (rtac pos_zdiv_mult_2 2);
  40.830  by (auto_tac (claset(),
  40.831  	      simpset() addsimps [zmult_zminus_right]));
  40.832 -by (subgoal_tac "(#-1 - (#2 * b)) = - (#1 + (#2 * b))" 1);
  40.833 +by (subgoal_tac "(# -1 - (# 2 * b)) = - (Numeral1 + (# 2 * b))" 1);
  40.834  by (Simp_tac 2);
  40.835  by (asm_full_simp_tac (HOL_ss
  40.836  		       addsimps [zdiv_zminus_zminus, zdiff_def,
  40.837 @@ -902,17 +902,17 @@
  40.838  
  40.839  (*Not clear why this must be proved separately; probably number_of causes
  40.840    simplification problems*)
  40.841 -Goal "~ #0 <= x ==> x <= (#0::int)";
  40.842 +Goal "~ Numeral0 <= x ==> x <= (Numeral0::int)";
  40.843  by Auto_tac;
  40.844  val lemma = result();
  40.845  
  40.846  Goal "number_of (v BIT b) div number_of (w BIT False) = \
  40.847 -\         (if ~b | (#0::int) <= number_of w                   \
  40.848 +\         (if ~b | (Numeral0::int) <= number_of w                   \
  40.849  \          then number_of v div (number_of w)    \
  40.850 -\          else (number_of v + (#1::int)) div (number_of w))";
  40.851 +\          else (number_of v + (Numeral1::int)) div (number_of w))";
  40.852  by (simp_tac (simpset_of Int.thy addsimps [zadd_assoc, number_of_BIT]) 1);
  40.853  by (asm_simp_tac (simpset()
  40.854 -           delsimps [number_of_reorient]@bin_arith_extra_simps@bin_rel_simps
  40.855 +           delsimps [thm "number_of_reorient"]@bin_arith_extra_simps@bin_rel_simps
  40.856   	   addsimps [zdiv_zmult_zmult1, pos_zdiv_mult_2, lemma, 
  40.857                       neg_zdiv_mult_2]) 1);
  40.858  qed "zdiv_number_of_BIT";
  40.859 @@ -921,13 +921,13 @@
  40.860  
  40.861  (** computing "mod" by shifting (proofs resemble those for "div") **)
  40.862  
  40.863 -Goal "(#0::int) <= a ==> (#1 + #2*b) mod (#2*a) = #1 + #2 * (b mod a)";
  40.864 -by (zdiv_undefined_case_tac "a = #0" 1);
  40.865 -by (subgoal_tac "#1 <= a" 1);
  40.866 +Goal "(Numeral0::int) <= a ==> (Numeral1 + # 2*b) mod (# 2*a) = Numeral1 + # 2 * (b mod a)";
  40.867 +by (zdiv_undefined_case_tac "a = Numeral0" 1);
  40.868 +by (subgoal_tac "Numeral1 <= a" 1);
  40.869   by (arith_tac 2);
  40.870 -by (subgoal_tac "#1 < a * #2" 1);
  40.871 +by (subgoal_tac "Numeral1 < a * # 2" 1);
  40.872   by (arith_tac 2);
  40.873 -by (subgoal_tac "#2*(#1 + b mod a) <= #2*a" 1);
  40.874 +by (subgoal_tac "# 2*(Numeral1 + b mod a) <= # 2*a" 1);
  40.875   by (rtac zmult_zle_mono2 2);
  40.876  by (auto_tac (claset(),
  40.877  	      simpset() addsimps [zadd_commute, zmult_commute, 
  40.878 @@ -941,19 +941,19 @@
  40.879                      pos_mod_sign RS zadd_zle_mono1 RSN (2,order_trans)]) 1);
  40.880  by (auto_tac (claset(),
  40.881  	      simpset() addsimps [mod_pos_pos_trivial]));
  40.882 -by (subgoal_tac "#0 <= b mod a" 1);
  40.883 +by (subgoal_tac "Numeral0 <= b mod a" 1);
  40.884   by (asm_simp_tac (simpset() addsimps [pos_mod_sign]) 2);
  40.885  by (arith_tac 1);
  40.886  qed "pos_zmod_mult_2";
  40.887  
  40.888  
  40.889 -Goal "a <= (#0::int) ==> (#1 + #2*b) mod (#2*a) = #2 * ((b+#1) mod a) - #1";
  40.890 +Goal "a <= (Numeral0::int) ==> (Numeral1 + # 2*b) mod (# 2*a) = # 2 * ((b+Numeral1) mod a) - Numeral1";
  40.891  by (subgoal_tac 
  40.892 -    "(#1 + #2*(-b-#1)) mod (#2*(-a)) = #1 + #2*((-b-#1) mod (-a))" 1);
  40.893 +    "(Numeral1 + # 2*(-b-Numeral1)) mod (# 2*(-a)) = Numeral1 + # 2*((-b-Numeral1) mod (-a))" 1);
  40.894  by (rtac pos_zmod_mult_2 2);
  40.895  by (auto_tac (claset(),
  40.896  	      simpset() addsimps [zmult_zminus_right]));
  40.897 -by (subgoal_tac "(#-1 - (#2 * b)) = - (#1 + (#2 * b))" 1);
  40.898 +by (subgoal_tac "(# -1 - (# 2 * b)) = - (Numeral1 + (# 2 * b))" 1);
  40.899  by (Simp_tac 2);
  40.900  by (asm_full_simp_tac (HOL_ss
  40.901  		       addsimps [zmod_zminus_zminus, zdiff_def,
  40.902 @@ -964,10 +964,10 @@
  40.903  
  40.904  Goal "number_of (v BIT b) mod number_of (w BIT False) = \
  40.905  \         (if b then \
  40.906 -\               if (#0::int) <= number_of w \
  40.907 -\               then #2 * (number_of v mod number_of w) + #1    \
  40.908 -\               else #2 * ((number_of v + (#1::int)) mod number_of w) - #1  \
  40.909 -\          else #2 * (number_of v mod number_of w))";
  40.910 +\               if (Numeral0::int) <= number_of w \
  40.911 +\               then # 2 * (number_of v mod number_of w) + Numeral1    \
  40.912 +\               else # 2 * ((number_of v + (Numeral1::int)) mod number_of w) - Numeral1  \
  40.913 +\          else # 2 * (number_of v mod number_of w))";
  40.914  by (simp_tac (simpset_of Int.thy addsimps [zadd_assoc, number_of_BIT]) 1);
  40.915  by (asm_simp_tac (simpset()
  40.916  		  delsimps bin_arith_extra_simps@bin_rel_simps
  40.917 @@ -980,20 +980,20 @@
  40.918  
  40.919  (** Quotients of signs **)
  40.920  
  40.921 -Goal "[| a < (#0::int);  #0 < b |] ==> a div b < #0";
  40.922 -by (subgoal_tac "a div b <= #-1" 1);
  40.923 +Goal "[| a < (Numeral0::int);  Numeral0 < b |] ==> a div b < Numeral0";
  40.924 +by (subgoal_tac "a div b <= # -1" 1);
  40.925  by (Force_tac 1);
  40.926  by (rtac order_trans 1);
  40.927 -by (res_inst_tac [("a'","#-1")]  zdiv_mono1 1);
  40.928 +by (res_inst_tac [("a'","# -1")]  zdiv_mono1 1);
  40.929  by (auto_tac (claset(), simpset() addsimps [zdiv_minus1]));
  40.930  qed "div_neg_pos_less0";
  40.931  
  40.932 -Goal "[| (#0::int) <= a;  b < #0 |] ==> a div b <= #0";
  40.933 +Goal "[| (Numeral0::int) <= a;  b < Numeral0 |] ==> a div b <= Numeral0";
  40.934  by (dtac zdiv_mono1_neg 1);
  40.935  by Auto_tac;
  40.936  qed "div_nonneg_neg_le0";
  40.937  
  40.938 -Goal "(#0::int) < b ==> (#0 <= a div b) = (#0 <= a)";
  40.939 +Goal "(Numeral0::int) < b ==> (Numeral0 <= a div b) = (Numeral0 <= a)";
  40.940  by Auto_tac;
  40.941  by (dtac zdiv_mono1 2);
  40.942  by (auto_tac (claset(), simpset() addsimps [linorder_neq_iff]));
  40.943 @@ -1001,20 +1001,20 @@
  40.944  by (blast_tac (claset() addIs [div_neg_pos_less0]) 1);
  40.945  qed "pos_imp_zdiv_nonneg_iff";
  40.946  
  40.947 -Goal "b < (#0::int) ==> (#0 <= a div b) = (a <= (#0::int))";
  40.948 +Goal "b < (Numeral0::int) ==> (Numeral0 <= a div b) = (a <= (Numeral0::int))";
  40.949  by (stac (zdiv_zminus_zminus RS sym) 1);
  40.950  by (stac pos_imp_zdiv_nonneg_iff 1);
  40.951  by Auto_tac;
  40.952  qed "neg_imp_zdiv_nonneg_iff";
  40.953  
  40.954  (*But not (a div b <= 0 iff a<=0); consider a=1, b=2 when a div b = 0.*)
  40.955 -Goal "(#0::int) < b ==> (a div b < #0) = (a < #0)";
  40.956 +Goal "(Numeral0::int) < b ==> (a div b < Numeral0) = (a < Numeral0)";
  40.957  by (asm_simp_tac (simpset() addsimps [linorder_not_le RS sym,
  40.958  				      pos_imp_zdiv_nonneg_iff]) 1);
  40.959  qed "pos_imp_zdiv_neg_iff";
  40.960  
  40.961  (*Again the law fails for <=: consider a = -1, b = -2 when a div b = 0*)
  40.962 -Goal "b < (#0::int) ==> (a div b < #0) = (#0 < a)";
  40.963 +Goal "b < (Numeral0::int) ==> (a div b < Numeral0) = (Numeral0 < a)";
  40.964  by (asm_simp_tac (simpset() addsimps [linorder_not_le RS sym,
  40.965  				      neg_imp_zdiv_nonneg_iff]) 1);
  40.966  qed "neg_imp_zdiv_neg_iff";
    41.1 --- a/src/HOL/Integ/IntDiv.thy	Fri Oct 05 21:50:37 2001 +0200
    41.2 +++ b/src/HOL/Integ/IntDiv.thy	Fri Oct 05 21:52:39 2001 +0200
    41.3 @@ -12,27 +12,27 @@
    41.4    quorem :: "(int*int) * (int*int) => bool"
    41.5      "quorem == %((a,b), (q,r)).
    41.6                        a = b*q + r &
    41.7 -                      (if #0<b then #0<=r & r<b else b<r & r <= #0)"
    41.8 +                      (if Numeral0 < b then Numeral0<=r & r<b else b<r & r <= Numeral0)"
    41.9  
   41.10    adjust :: "[int, int, int*int] => int*int"
   41.11 -    "adjust a b == %(q,r). if #0 <= r-b then (#2*q + #1, r-b)
   41.12 -                           else (#2*q, r)"
   41.13 +    "adjust a b == %(q,r). if Numeral0 <= r-b then (# 2*q + Numeral1, r-b)
   41.14 +                           else (# 2*q, r)"
   41.15  
   41.16  (** the division algorithm **)
   41.17  
   41.18  (*for the case a>=0, b>0*)
   41.19  consts posDivAlg :: "int*int => int*int"
   41.20 -recdef posDivAlg "inv_image less_than (%(a,b). nat(a - b + #1))"
   41.21 +recdef posDivAlg "inv_image less_than (%(a,b). nat(a - b + Numeral1))"
   41.22      "posDivAlg (a,b) =
   41.23 -       (if (a<b | b<=#0) then (#0,a)
   41.24 -        else adjust a b (posDivAlg(a, #2*b)))"
   41.25 +       (if (a<b | b<=Numeral0) then (Numeral0,a)
   41.26 +        else adjust a b (posDivAlg(a, # 2*b)))"
   41.27  
   41.28  (*for the case a<0, b>0*)
   41.29  consts negDivAlg :: "int*int => int*int"
   41.30  recdef negDivAlg "inv_image less_than (%(a,b). nat(- a - b))"
   41.31      "negDivAlg (a,b) =
   41.32 -       (if (#0<=a+b | b<=#0) then (#-1,a+b)
   41.33 -        else adjust a b (negDivAlg(a, #2*b)))"
   41.34 +       (if (Numeral0<=a+b | b<=Numeral0) then (# -1,a+b)
   41.35 +        else adjust a b (negDivAlg(a, # 2*b)))"
   41.36  
   41.37  (*for the general case b~=0*)
   41.38  
   41.39 @@ -44,12 +44,12 @@
   41.40      including the special case a=0, b<0, because negDivAlg requires a<0*)
   41.41    divAlg :: "int*int => int*int"
   41.42      "divAlg ==
   41.43 -       %(a,b). if #0<=a then
   41.44 -                  if #0<=b then posDivAlg (a,b)
   41.45 -                  else if a=#0 then (#0,#0)
   41.46 +       %(a,b). if Numeral0<=a then
   41.47 +                  if Numeral0<=b then posDivAlg (a,b)
   41.48 +                  else if a=Numeral0 then (Numeral0,Numeral0)
   41.49                         else negateSnd (negDivAlg (-a,-b))
   41.50                 else 
   41.51 -                  if #0<b then negDivAlg (a,b)
   41.52 +                  if Numeral0<b then negDivAlg (a,b)
   41.53                    else         negateSnd (posDivAlg (-a,-b))"
   41.54  
   41.55  instance
    42.1 --- a/src/HOL/Integ/IntPower.ML	Fri Oct 05 21:50:37 2001 +0200
    42.2 +++ b/src/HOL/Integ/IntPower.ML	Fri Oct 05 21:52:39 2001 +0200
    42.3 @@ -15,7 +15,7 @@
    42.4  by (rtac (zmod_zmult_distrib RS sym) 1);
    42.5  qed "zpower_zmod";
    42.6  
    42.7 -Goal "#1^y = (#1::int)";
    42.8 +Goal "Numeral1^y = (Numeral1::int)";
    42.9  by (induct_tac "y" 1);
   42.10  by Auto_tac;
   42.11  qed "zpower_1";
    43.1 --- a/src/HOL/Integ/IntPower.thy	Fri Oct 05 21:50:37 2001 +0200
    43.2 +++ b/src/HOL/Integ/IntPower.thy	Fri Oct 05 21:52:39 2001 +0200
    43.3 @@ -12,7 +12,7 @@
    43.4    int :: {power}
    43.5  
    43.6  primrec
    43.7 -  power_0   "p ^ 0 = #1"
    43.8 +  power_0   "p ^ 0 = Numeral1"
    43.9    power_Suc "p ^ (Suc n) = (p::int) * (p ^ n)"
   43.10  
   43.11  end
    44.1 --- a/src/HOL/Integ/NatSimprocs.ML	Fri Oct 05 21:50:37 2001 +0200
    44.2 +++ b/src/HOL/Integ/NatSimprocs.ML	Fri Oct 05 21:52:39 2001 +0200
    44.3 @@ -6,16 +6,16 @@
    44.4  Simprocs for nat numerals (see also nat_simprocs.ML).
    44.5  *)
    44.6  
    44.7 -(** For simplifying  Suc m - #n **)
    44.8 +(** For simplifying  Suc m - # n **)
    44.9  
   44.10 -Goal "#0 < n ==> Suc m - n = m - (n - #1)";
   44.11 +Goal "Numeral0 < n ==> Suc m - n = m - (n - Numeral1)";
   44.12  by (asm_simp_tac (simpset() addsplits [nat_diff_split]) 1);
   44.13  qed "Suc_diff_eq_diff_pred";
   44.14  
   44.15  (*Now just instantiating n to (number_of v) does the right simplification,
   44.16    but with some redundant inequality tests.*)
   44.17  Goal "neg (number_of (bin_pred v)) = (number_of v = (0::nat))";
   44.18 -by (subgoal_tac "neg (number_of (bin_pred v)) = (number_of v < 1')" 1);
   44.19 +by (subgoal_tac "neg (number_of (bin_pred v)) = (number_of v < Suc 0)" 1);
   44.20  by (asm_simp_tac (HOL_ss addsimps [less_Suc_eq_le, le_0_eq]) 1); 
   44.21  by (stac less_number_of_Suc 1);
   44.22  by (Simp_tac 1);
   44.23 @@ -78,54 +78,54 @@
   44.24  Addsimps [nat_rec_number_of, nat_rec_add_eq_if];
   44.25  
   44.26  
   44.27 -(** For simplifying  #m - Suc n **)
   44.28 +(** For simplifying  # m - Suc n **)
   44.29  
   44.30 -Goal "m - Suc n = (m - #1) - n";
   44.31 +Goal "m - Suc n = (m - Numeral1) - n";
   44.32  by (simp_tac (numeral_ss addsplits [nat_diff_split]) 1);
   44.33  qed "diff_Suc_eq_diff_pred";
   44.34  
   44.35  (*Obsolete because of natdiff_cancel_numerals
   44.36      Addsimps [inst "m" "number_of ?v" diff_Suc_eq_diff_pred];
   44.37 -  It LOOPS if #1 is being replaced by 1.
   44.38 +  It LOOPS if Numeral1 is being replaced by 1.
   44.39  *)
   44.40  
   44.41  
   44.42  (** Evens and Odds, for Mutilated Chess Board **)
   44.43  
   44.44 -(*Case analysis on b<#2*)
   44.45 -Goal "(n::nat) < #2 ==> n = #0 | n = #1";
   44.46 +(*Case analysis on b<# 2*)
   44.47 +Goal "(n::nat) < # 2 ==> n = Numeral0 | n = Numeral1";
   44.48  by (arith_tac 1);
   44.49  qed "less_2_cases";
   44.50  
   44.51 -Goal "Suc(Suc(m)) mod #2 = m mod #2";
   44.52 -by (subgoal_tac "m mod #2 < #2" 1);
   44.53 +Goal "Suc(Suc(m)) mod # 2 = m mod # 2";
   44.54 +by (subgoal_tac "m mod # 2 < # 2" 1);
   44.55  by (Asm_simp_tac 2);
   44.56  be (less_2_cases RS disjE) 1;
   44.57  by (ALLGOALS (asm_simp_tac (simpset() addsimps [mod_Suc])));
   44.58  qed "mod2_Suc_Suc";
   44.59  Addsimps [mod2_Suc_Suc];
   44.60  
   44.61 -Goal "!!m::nat. (0 < m mod #2) = (m mod #2 = #1)";
   44.62 -by (subgoal_tac "m mod #2 < #2" 1);
   44.63 +Goal "!!m::nat. (0 < m mod # 2) = (m mod # 2 = Numeral1)";
   44.64 +by (subgoal_tac "m mod # 2 < # 2" 1);
   44.65  by (Asm_simp_tac 2);
   44.66  by (auto_tac (claset(), simpset() delsimps [mod_less_divisor]));
   44.67  qed "mod2_gr_0";
   44.68  Addsimps [mod2_gr_0, rename_numerals mod2_gr_0];
   44.69  
   44.70 -(** Removal of small numerals: #0, #1 and (in additive positions) #2 **)
   44.71 +(** Removal of small numerals: Numeral0, Numeral1 and (in additive positions) # 2 **)
   44.72  
   44.73 -Goal "#2 + n = Suc (Suc n)";
   44.74 +Goal "# 2 + n = Suc (Suc n)";
   44.75  by (Simp_tac 1);
   44.76  qed "add_2_eq_Suc";
   44.77  
   44.78 -Goal "n + #2 = Suc (Suc n)";
   44.79 +Goal "n + # 2 = Suc (Suc n)";
   44.80  by (Simp_tac 1);
   44.81  qed "add_2_eq_Suc'";
   44.82  
   44.83  Addsimps [numeral_0_eq_0, numeral_1_eq_1, add_2_eq_Suc, add_2_eq_Suc'];
   44.84  
   44.85  (*Can be used to eliminate long strings of Sucs, but not by default*)
   44.86 -Goal "Suc (Suc (Suc n)) = #3 + n";
   44.87 +Goal "Suc (Suc (Suc n)) = # 3 + n";
   44.88  by (Simp_tac 1);
   44.89  qed "Suc3_eq_add_3";
   44.90  
   44.91 @@ -136,21 +136,21 @@
   44.92      We already have some rules to simplify operands smaller than 3.
   44.93  **)
   44.94  
   44.95 -Goal "m div (Suc (Suc (Suc n))) = m div (#3+n)";
   44.96 +Goal "m div (Suc (Suc (Suc n))) = m div (# 3+n)";
   44.97  by (simp_tac (simpset() addsimps [Suc3_eq_add_3]) 1);
   44.98  qed "div_Suc_eq_div_add3";
   44.99  
  44.100 -Goal "m mod (Suc (Suc (Suc n))) = m mod (#3+n)";
  44.101 +Goal "m mod (Suc (Suc (Suc n))) = m mod (# 3+n)";
  44.102  by (simp_tac (simpset() addsimps [Suc3_eq_add_3]) 1);
  44.103  qed "mod_Suc_eq_mod_add3";
  44.104  
  44.105  Addsimps [div_Suc_eq_div_add3, mod_Suc_eq_mod_add3];
  44.106  
  44.107 -Goal "(Suc (Suc (Suc m))) div n = (#3+m) div n";
  44.108 +Goal "(Suc (Suc (Suc m))) div n = (# 3+m) div n";
  44.109  by (simp_tac (simpset() addsimps [Suc3_eq_add_3]) 1);
  44.110  qed "Suc_div_eq_add3_div";
  44.111  
  44.112 -Goal "(Suc (Suc (Suc m))) mod n = (#3+m) mod n";
  44.113 +Goal "(Suc (Suc (Suc m))) mod n = (# 3+m) mod n";
  44.114  by (simp_tac (simpset() addsimps [Suc3_eq_add_3]) 1);
  44.115  qed "Suc_mod_eq_add3_mod";
  44.116  
    45.1 --- a/src/HOL/Integ/int_arith1.ML	Fri Oct 05 21:50:37 2001 +0200
    45.2 +++ b/src/HOL/Integ/int_arith1.ML	Fri Oct 05 21:52:39 2001 +0200
    45.3 @@ -9,15 +9,15 @@
    45.4  
    45.5  (** Combining of literal coefficients in sums of products **)
    45.6  
    45.7 -Goal "(x < y) = (x-y < (#0::int))";
    45.8 +Goal "(x < y) = (x-y < (Numeral0::int))";
    45.9  by (simp_tac (simpset() addsimps zcompare_rls) 1);
   45.10  qed "zless_iff_zdiff_zless_0";
   45.11  
   45.12 -Goal "(x = y) = (x-y = (#0::int))";
   45.13 +Goal "(x = y) = (x-y = (Numeral0::int))";
   45.14  by (simp_tac (simpset() addsimps zcompare_rls) 1);
   45.15  qed "eq_iff_zdiff_eq_0";
   45.16  
   45.17 -Goal "(x <= y) = (x-y <= (#0::int))";
   45.18 +Goal "(x <= y) = (x-y <= (Numeral0::int))";
   45.19  by (simp_tac (simpset() addsimps zcompare_rls) 1);
   45.20  qed "zle_iff_zdiff_zle_0";
   45.21  
   45.22 @@ -97,7 +97,7 @@
   45.23  
   45.24  val uminus_const = Const ("uminus", HOLogic.intT --> HOLogic.intT);
   45.25  
   45.26 -(*Thus mk_sum[t] yields t+#0; longer sums don't have a trailing zero*)
   45.27 +(*Thus mk_sum[t] yields t+Numeral0; longer sums don't have a trailing zero*)
   45.28  fun mk_sum []        = zero
   45.29    | mk_sum [t,u]     = mk_plus (t, u)
   45.30    | mk_sum (t :: ts) = mk_plus (t, mk_sum ts);
   45.31 @@ -157,7 +157,7 @@
   45.32  	handle TERM _ => find_first_coeff (t::past) u terms;
   45.33  
   45.34  
   45.35 -(*Simplify #1*n and n*#1 to n*)
   45.36 +(*Simplify Numeral1*n and n*Numeral1 to n*)
   45.37  val add_0s = [zadd_0, zadd_0_right];
   45.38  val mult_1s = [zmult_1, zmult_1_right, zmult_minus1, zmult_minus1_right];
   45.39  
   45.40 @@ -279,7 +279,7 @@
   45.41  structure CombineNumeralsData =
   45.42    struct
   45.43    val add		= op + : int*int -> int 
   45.44 -  val mk_sum    	= long_mk_sum    (*to work for e.g. #2*x + #3*x *)
   45.45 +  val mk_sum    	= long_mk_sum    (*to work for e.g. # 2*x + # 3*x *)
   45.46    val dest_sum		= dest_sum
   45.47    val mk_coeff		= mk_coeff
   45.48    val dest_coeff	= dest_coeff 1
   45.49 @@ -318,35 +318,35 @@
   45.50  set trace_simp;
   45.51  fun test s = (Goal s; by (Simp_tac 1)); 
   45.52  
   45.53 -test "l + #2 + #2 + #2 + (l + #2) + (oo + #2) = (uu::int)";
   45.54 +test "l + # 2 + # 2 + # 2 + (l + # 2) + (oo + # 2) = (uu::int)";
   45.55  
   45.56 -test "#2*u = (u::int)";
   45.57 -test "(i + j + #12 + (k::int)) - #15 = y";
   45.58 -test "(i + j + #12 + (k::int)) - #5 = y";
   45.59 +test "# 2*u = (u::int)";
   45.60 +test "(i + j + # 12 + (k::int)) - # 15 = y";
   45.61 +test "(i + j + # 12 + (k::int)) - # 5 = y";
   45.62  
   45.63  test "y - b < (b::int)";
   45.64 -test "y - (#3*b + c) < (b::int) - #2*c";
   45.65 +test "y - (# 3*b + c) < (b::int) - # 2*c";
   45.66  
   45.67 -test "(#2*x - (u*v) + y) - v*#3*u = (w::int)";
   45.68 -test "(#2*x*u*v + (u*v)*#4 + y) - v*u*#4 = (w::int)";
   45.69 -test "(#2*x*u*v + (u*v)*#4 + y) - v*u = (w::int)";
   45.70 -test "u*v - (x*u*v + (u*v)*#4 + y) = (w::int)";
   45.71 +test "(# 2*x - (u*v) + y) - v*# 3*u = (w::int)";
   45.72 +test "(# 2*x*u*v + (u*v)*# 4 + y) - v*u*# 4 = (w::int)";
   45.73 +test "(# 2*x*u*v + (u*v)*# 4 + y) - v*u = (w::int)";
   45.74 +test "u*v - (x*u*v + (u*v)*# 4 + y) = (w::int)";
   45.75  
   45.76 -test "(i + j + #12 + (k::int)) = u + #15 + y";
   45.77 -test "(i + j*#2 + #12 + (k::int)) = j + #5 + y";
   45.78 +test "(i + j + # 12 + (k::int)) = u + # 15 + y";
   45.79 +test "(i + j*# 2 + # 12 + (k::int)) = j + # 5 + y";
   45.80  
   45.81 -test "#2*y + #3*z + #6*w + #2*y + #3*z + #2*u = #2*y' + #3*z' + #6*w' + #2*y' + #3*z' + u + (vv::int)";
   45.82 +test "# 2*y + # 3*z + # 6*w + # 2*y + # 3*z + # 2*u = # 2*y' + # 3*z' + # 6*w' + # 2*y' + # 3*z' + u + (vv::int)";
   45.83  
   45.84  test "a + -(b+c) + b = (d::int)";
   45.85  test "a + -(b+c) - b = (d::int)";
   45.86  
   45.87  (*negative numerals*)
   45.88 -test "(i + j + #-2 + (k::int)) - (u + #5 + y) = zz";
   45.89 -test "(i + j + #-3 + (k::int)) < u + #5 + y";
   45.90 -test "(i + j + #3 + (k::int)) < u + #-6 + y";
   45.91 -test "(i + j + #-12 + (k::int)) - #15 = y";
   45.92 -test "(i + j + #12 + (k::int)) - #-15 = y";
   45.93 -test "(i + j + #-12 + (k::int)) - #-15 = y";
   45.94 +test "(i + j + # -2 + (k::int)) - (u + # 5 + y) = zz";
   45.95 +test "(i + j + # -3 + (k::int)) < u + # 5 + y";
   45.96 +test "(i + j + # 3 + (k::int)) < u + # -6 + y";
   45.97 +test "(i + j + # -12 + (k::int)) - # 15 = y";
   45.98 +test "(i + j + # 12 + (k::int)) - # -15 = y";
   45.99 +test "(i + j + # -12 + (k::int)) - # -15 = y";
  45.100  *)
  45.101  
  45.102  
  45.103 @@ -410,7 +410,7 @@
  45.104  		 zmult_1, zmult_1_right, 
  45.105  		 zmult_minus1, zmult_minus1_right,
  45.106  		 zminus_zadd_distrib, zminus_zminus, zmult_assoc,
  45.107 -                 IntDef.Zero_def, int_0, zadd_int RS sym, int_Suc];
  45.108 +                 Zero_int_def, int_0, zadd_int RS sym, int_Suc];
  45.109  
  45.110  val simprocs = [Int_Times_Assoc.conv, Int_Numeral_Simprocs.combine_numerals]@
  45.111                 Int_Numeral_Simprocs.cancel_numerals;
  45.112 @@ -455,9 +455,9 @@
  45.113  (* Some test data
  45.114  Goal "!!a::int. [| a <= b; c <= d; x+y<z |] ==> a+c <= b+d";
  45.115  by (fast_arith_tac 1);
  45.116 -Goal "!!a::int. [| a < b; c < d |] ==> a-d+ #2 <= b+(-c)";
  45.117 +Goal "!!a::int. [| a < b; c < d |] ==> a-d+ # 2 <= b+(-c)";
  45.118  by (fast_arith_tac 1);
  45.119 -Goal "!!a::int. [| a < b; c < d |] ==> a+c+ #1 < b+d";
  45.120 +Goal "!!a::int. [| a < b; c < d |] ==> a+c+ Numeral1 < b+d";
  45.121  by (fast_arith_tac 1);
  45.122  Goal "!!a::int. [| a <= b; b+b <= c |] ==> a+a <= c";
  45.123  by (fast_arith_tac 1);
  45.124 @@ -465,7 +465,7 @@
  45.125  \     ==> a+a <= j+j";
  45.126  by (fast_arith_tac 1);
  45.127  Goal "!!a::int. [| a+b < i+j; a<b; i<j |] \
  45.128 -\     ==> a+a - - #-1 < j+j - #3";
  45.129 +\     ==> a+a - - # -1 < j+j - # 3";
  45.130  by (fast_arith_tac 1);
  45.131  Goal "!!a::int. a+b+c <= i+j+k & a<=b & b<=c & i<=j & j<=k --> a+a+a <= k+k+k";
  45.132  by (arith_tac 1);
  45.133 @@ -482,6 +482,6 @@
  45.134  \     ==> a+a+a+a+a+a <= l+l+l+l+i+l";
  45.135  by (fast_arith_tac 1);
  45.136  Goal "!!a::int. [| a+b+c+d <= i+j+k+l; a<=b; b<=c; c<=d; i<=j; j<=k; k<=l |] \
  45.137 -\     ==> #6*a <= #5*l+i";
  45.138 +\     ==> # 6*a <= # 5*l+i";
  45.139  by (fast_arith_tac 1);
  45.140  *)
    46.1 --- a/src/HOL/Integ/int_arith2.ML	Fri Oct 05 21:50:37 2001 +0200
    46.2 +++ b/src/HOL/Integ/int_arith2.ML	Fri Oct 05 21:52:39 2001 +0200
    46.3 @@ -5,17 +5,17 @@
    46.4  
    46.5  (** Simplification of inequalities involving numerical constants **)
    46.6  
    46.7 -Goal "(w <= z - (#1::int)) = (w<(z::int))";
    46.8 +Goal "(w <= z - (Numeral1::int)) = (w<(z::int))";
    46.9  by (arith_tac 1);
   46.10  qed "zle_diff1_eq";
   46.11  Addsimps [zle_diff1_eq];
   46.12  
   46.13 -Goal "(w < z + #1) = (w<=(z::int))";
   46.14 +Goal "(w < z + Numeral1) = (w<=(z::int))";
   46.15  by (arith_tac 1);
   46.16  qed "zle_add1_eq_le";
   46.17  Addsimps [zle_add1_eq_le];
   46.18  
   46.19 -Goal "(z = z + w) = (w = (#0::int))";
   46.20 +Goal "(z = z + w) = (w = (Numeral0::int))";
   46.21  by (arith_tac 1);
   46.22  qed "zadd_left_cancel0";
   46.23  Addsimps [zadd_left_cancel0];
   46.24 @@ -23,13 +23,13 @@
   46.25  
   46.26  (* nat *)
   46.27  
   46.28 -Goal "#0 <= z ==> int (nat z) = z"; 
   46.29 +Goal "Numeral0 <= z ==> int (nat z) = z"; 
   46.30  by (asm_full_simp_tac
   46.31      (simpset() addsimps [neg_eq_less_0, zle_def, not_neg_nat]) 1); 
   46.32  qed "nat_0_le"; 
   46.33  
   46.34 -Goal "z <= #0 ==> nat z = 0"; 
   46.35 -by (case_tac "z = #0" 1);
   46.36 +Goal "z <= Numeral0 ==> nat z = 0"; 
   46.37 +by (case_tac "z = Numeral0" 1);
   46.38  by (asm_simp_tac (simpset() addsimps [nat_le_int0]) 1); 
   46.39  by (asm_full_simp_tac 
   46.40      (simpset() addsimps [neg_eq_less_0, neg_nat, linorder_neq_iff]) 1);
   46.41 @@ -37,19 +37,19 @@
   46.42  
   46.43  Addsimps [nat_0_le, nat_le_0];
   46.44  
   46.45 -val [major,minor] = Goal "[| #0 <= z;  !!m. z = int m ==> P |] ==> P"; 
   46.46 +val [major,minor] = Goal "[| Numeral0 <= z;  !!m. z = int m ==> P |] ==> P"; 
   46.47  by (rtac (major RS nat_0_le RS sym RS minor) 1);
   46.48  qed "nonneg_eq_int"; 
   46.49  
   46.50 -Goal "(nat w = m) = (if #0 <= w then w = int m else m=0)";
   46.51 +Goal "(nat w = m) = (if Numeral0 <= w then w = int m else m=0)";
   46.52  by Auto_tac;
   46.53  qed "nat_eq_iff";
   46.54  
   46.55 -Goal "(m = nat w) = (if #0 <= w then w = int m else m=0)";
   46.56 +Goal "(m = nat w) = (if Numeral0 <= w then w = int m else m=0)";
   46.57  by Auto_tac;
   46.58  qed "nat_eq_iff2";
   46.59  
   46.60 -Goal "#0 <= w ==> (nat w < m) = (w < int m)";
   46.61 +Goal "Numeral0 <= w ==> (nat w < m) = (w < int m)";
   46.62  by (rtac iffI 1);
   46.63  by (asm_full_simp_tac 
   46.64      (simpset() delsimps [zless_int] addsimps [zless_int RS sym]) 2);
   46.65 @@ -57,7 +57,7 @@
   46.66  by (Simp_tac 1);
   46.67  qed "nat_less_iff";
   46.68  
   46.69 -Goal "(int m = z) = (m = nat z & #0 <= z)";
   46.70 +Goal "(int m = z) = (m = nat z & Numeral0 <= z)";
   46.71  by (auto_tac (claset(), simpset() addsimps [nat_eq_iff2]));  
   46.72  qed "int_eq_iff";
   46.73  
   46.74 @@ -67,26 +67,26 @@
   46.75  (*Users don't want to see (int 0), int(Suc 0) or w + - z*)
   46.76  Addsimps [int_0, int_Suc, symmetric zdiff_def];
   46.77  
   46.78 -Goal "nat #0 = 0";
   46.79 +Goal "nat Numeral0 = 0";
   46.80  by (simp_tac (simpset() addsimps [nat_eq_iff]) 1);
   46.81  qed "nat_0";
   46.82  
   46.83 -Goal "nat #1 = 1";
   46.84 +Goal "nat Numeral1 = Suc 0";
   46.85  by (simp_tac (simpset() addsimps [nat_eq_iff]) 1);
   46.86  qed "nat_1";
   46.87  
   46.88 -Goal "nat #2 = 2";
   46.89 +Goal "nat # 2 = Suc (Suc 0)";
   46.90  by (simp_tac (simpset() addsimps [nat_eq_iff]) 1);
   46.91  qed "nat_2";
   46.92  
   46.93 -Goal "#0 <= w ==> (nat w < nat z) = (w<z)";
   46.94 +Goal "Numeral0 <= w ==> (nat w < nat z) = (w<z)";
   46.95  by (case_tac "neg z" 1);
   46.96  by (auto_tac (claset(), simpset() addsimps [nat_less_iff]));
   46.97  by (auto_tac (claset() addIs [zless_trans], 
   46.98  	      simpset() addsimps [neg_eq_less_0, zle_def]));
   46.99  qed "nat_less_eq_zless";
  46.100  
  46.101 -Goal "#0 < w | #0 <= z ==> (nat w <= nat z) = (w<=z)";
  46.102 +Goal "Numeral0 < w | Numeral0 <= z ==> (nat w <= nat z) = (w<=z)";
  46.103  by (auto_tac (claset(), 
  46.104  	      simpset() addsimps [linorder_not_less RS sym, 
  46.105  				  zless_nat_conj]));
  46.106 @@ -106,11 +106,11 @@
  46.107  *)
  46.108  
  46.109  Goalw [zabs_def]
  46.110 - "P(abs(i::int)) = ((#0 <= i --> P i) & (i < #0 --> P(-i)))";
  46.111 + "P(abs(i::int)) = ((Numeral0 <= i --> P i) & (i < Numeral0 --> P(-i)))";
  46.112  by(Simp_tac 1);
  46.113  qed "zabs_split";
  46.114  
  46.115 -Goal "#0 <= abs (z::int)";
  46.116 +Goal "Numeral0 <= abs (z::int)";
  46.117  by (simp_tac (simpset() addsimps [zabs_def]) 1); 
  46.118  qed "zero_le_zabs";
  46.119  AddIffs [zero_le_zabs];
    47.1 --- a/src/HOL/Integ/int_factor_simprocs.ML	Fri Oct 05 21:50:37 2001 +0200
    47.2 +++ b/src/HOL/Integ/int_factor_simprocs.ML	Fri Oct 05 21:52:39 2001 +0200
    47.3 @@ -10,27 +10,27 @@
    47.4  
    47.5  (** Factor cancellation theorems for "int" **)
    47.6  
    47.7 -Goal "!!k::int. (k*m <= k*n) = ((#0 < k --> m<=n) & (k < #0 --> n<=m))";
    47.8 +Goal "!!k::int. (k*m <= k*n) = ((Numeral0 < k --> m<=n) & (k < Numeral0 --> n<=m))";
    47.9  by (stac zmult_zle_cancel1 1);
   47.10  by Auto_tac;  
   47.11  qed "int_mult_le_cancel1";
   47.12  
   47.13 -Goal "!!k::int. (k*m < k*n) = ((#0 < k & m<n) | (k < #0 & n<m))";
   47.14 +Goal "!!k::int. (k*m < k*n) = ((Numeral0 < k & m<n) | (k < Numeral0 & n<m))";
   47.15  by (stac zmult_zless_cancel1 1);
   47.16  by Auto_tac;  
   47.17  qed "int_mult_less_cancel1";
   47.18  
   47.19 -Goal "!!k::int. (k*m = k*n) = (k = #0 | m=n)";
   47.20 +Goal "!!k::int. (k*m = k*n) = (k = Numeral0 | m=n)";
   47.21  by Auto_tac;  
   47.22  qed "int_mult_eq_cancel1";
   47.23  
   47.24 -Goal "!!k::int. k~=#0 ==> (k*m) div (k*n) = (m div n)";
   47.25 +Goal "!!k::int. k~=Numeral0 ==> (k*m) div (k*n) = (m div n)";
   47.26  by (stac zdiv_zmult_zmult1 1); 
   47.27  by Auto_tac;  
   47.28  qed "int_mult_div_cancel1";
   47.29  
   47.30  (*For ExtractCommonTermFun, cancelling common factors*)
   47.31 -Goal "(k*m) div (k*n) = (if k = (#0::int) then #0 else m div n)";
   47.32 +Goal "(k*m) div (k*n) = (if k = (Numeral0::int) then Numeral0 else m div n)";
   47.33  by (simp_tac (simpset() addsimps [int_mult_div_cancel1]) 1); 
   47.34  qed "int_mult_div_cancel_disj";
   47.35  
   47.36 @@ -114,33 +114,33 @@
   47.37  set trace_simp;
   47.38  fun test s = (Goal s; by (Simp_tac 1)); 
   47.39  
   47.40 -test "#9*x = #12 * (y::int)";
   47.41 -test "(#9*x) div (#12 * (y::int)) = z";
   47.42 -test "#9*x < #12 * (y::int)";
   47.43 -test "#9*x <= #12 * (y::int)";
   47.44 +test "# 9*x = # 12 * (y::int)";
   47.45 +test "(# 9*x) div (# 12 * (y::int)) = z";
   47.46 +test "# 9*x < # 12 * (y::int)";
   47.47 +test "# 9*x <= # 12 * (y::int)";
   47.48  
   47.49 -test "#-99*x = #132 * (y::int)";
   47.50 -test "(#-99*x) div (#132 * (y::int)) = z";
   47.51 -test "#-99*x < #132 * (y::int)";
   47.52 -test "#-99*x <= #132 * (y::int)";
   47.53 +test "# -99*x = # 132 * (y::int)";
   47.54 +test "(# -99*x) div (# 132 * (y::int)) = z";
   47.55 +test "# -99*x < # 132 * (y::int)";
   47.56 +test "# -99*x <= # 132 * (y::int)";
   47.57  
   47.58 -test "#999*x = #-396 * (y::int)";
   47.59 -test "(#999*x) div (#-396 * (y::int)) = z";
   47.60 -test "#999*x < #-396 * (y::int)";
   47.61 -test "#999*x <= #-396 * (y::int)";
   47.62 +test "# 999*x = # -396 * (y::int)";
   47.63 +test "(# 999*x) div (# -396 * (y::int)) = z";
   47.64 +test "# 999*x < # -396 * (y::int)";
   47.65 +test "# 999*x <= # -396 * (y::int)";
   47.66  
   47.67 -test "#-99*x = #-81 * (y::int)";
   47.68 -test "(#-99*x) div (#-81 * (y::int)) = z";
   47.69 -test "#-99*x <= #-81 * (y::int)";
   47.70 -test "#-99*x < #-81 * (y::int)";
   47.71 +test "# -99*x = # -81 * (y::int)";
   47.72 +test "(# -99*x) div (# -81 * (y::int)) = z";
   47.73 +test "# -99*x <= # -81 * (y::int)";
   47.74 +test "# -99*x < # -81 * (y::int)";
   47.75  
   47.76 -test "#-2 * x = #-1 * (y::int)";
   47.77 -test "#-2 * x = -(y::int)";
   47.78 -test "(#-2 * x) div (#-1 * (y::int)) = z";
   47.79 -test "#-2 * x < -(y::int)";
   47.80 -test "#-2 * x <= #-1 * (y::int)";
   47.81 -test "-x < #-23 * (y::int)";
   47.82 -test "-x <= #-23 * (y::int)";
   47.83 +test "# -2 * x = # -1 * (y::int)";
   47.84 +test "# -2 * x = -(y::int)";
   47.85 +test "(# -2 * x) div (# -1 * (y::int)) = z";
   47.86 +test "# -2 * x < -(y::int)";
   47.87 +test "# -2 * x <= # -1 * (y::int)";
   47.88 +test "-x < # -23 * (y::int)";
   47.89 +test "-x <= # -23 * (y::int)";
   47.90  *)
   47.91  
   47.92  
    48.1 --- a/src/HOL/Integ/nat_bin.ML	Fri Oct 05 21:50:37 2001 +0200
    48.2 +++ b/src/HOL/Integ/nat_bin.ML	Fri Oct 05 21:52:39 2001 +0200
    48.3 @@ -17,16 +17,16 @@
    48.4  
    48.5  (*These rewrites should one day be re-oriented...*)
    48.6  
    48.7 -Goal "#0 = (0::nat)";
    48.8 +Goal "Numeral0 = (0::nat)";
    48.9  by (simp_tac (HOL_basic_ss addsimps [nat_0, nat_number_of_def]) 1);
   48.10  qed "numeral_0_eq_0";
   48.11  
   48.12 -Goal "#1 = (1::nat)";
   48.13 -by (simp_tac (HOL_basic_ss addsimps [nat_1, nat_number_of_def]) 1);
   48.14 +Goal "Numeral1 = (1::nat)";
   48.15 +by (simp_tac (HOL_basic_ss addsimps [nat_1, nat_number_of_def, One_nat_def]) 1);
   48.16  qed "numeral_1_eq_1";
   48.17  
   48.18 -Goal "#2 = (2::nat)";
   48.19 -by (simp_tac (HOL_basic_ss addsimps [nat_2, nat_number_of_def]) 1);
   48.20 +Goal "# 2 = Suc 1";
   48.21 +by (simp_tac (HOL_basic_ss addsimps [nat_2, nat_number_of_def, One_nat_def]) 1);
   48.22  qed "numeral_2_eq_2";
   48.23  
   48.24  bind_thm ("zero_eq_numeral_0", numeral_0_eq_0 RS sym);
   48.25 @@ -35,7 +35,7 @@
   48.26  
   48.27  (*"neg" is used in rewrite rules for binary comparisons*)
   48.28  Goal "int (number_of v :: nat) = \
   48.29 -\        (if neg (number_of v) then #0 \
   48.30 +\        (if neg (number_of v) then Numeral0 \
   48.31  \         else (number_of v :: int))";
   48.32  by (simp_tac
   48.33      (simpset_of Int.thy addsimps [neg_nat, nat_number_of_def, 
   48.34 @@ -54,13 +54,13 @@
   48.35  
   48.36  (** Successor **)
   48.37  
   48.38 -Goal "(#0::int) <= z ==> Suc (nat z) = nat (#1 + z)";
   48.39 +Goal "(Numeral0::int) <= z ==> Suc (nat z) = nat (Numeral1 + z)";
   48.40  by (rtac sym 1);
   48.41  by (asm_simp_tac (simpset() addsimps [nat_eq_iff]) 1);
   48.42  qed "Suc_nat_eq_nat_zadd1";
   48.43  
   48.44  Goal "Suc (number_of v) = \
   48.45 -\       (if neg (number_of v) then #1 else number_of (bin_succ v))";
   48.46 +\       (if neg (number_of v) then Numeral1 else number_of (bin_succ v))";
   48.47  by (simp_tac
   48.48      (simpset_of Int.thy addsimps [neg_nat, nat_1, not_neg_eq_ge_0, 
   48.49  				  nat_number_of_def, int_Suc, 
   48.50 @@ -69,21 +69,21 @@
   48.51  Addsimps [Suc_nat_number_of];
   48.52  
   48.53  Goal "Suc (number_of v + n) = \
   48.54 -\       (if neg (number_of v) then #1+n else number_of (bin_succ v) + n)";
   48.55 +\       (if neg (number_of v) then Numeral1+n else number_of (bin_succ v) + n)";
   48.56  by (Simp_tac 1);
   48.57  qed "Suc_nat_number_of_add";
   48.58  
   48.59 -Goal "Suc #0 = #1";
   48.60 +Goal "Suc Numeral0 = Numeral1";
   48.61  by (Simp_tac 1);
   48.62  qed "Suc_numeral_0_eq_1";
   48.63  
   48.64 -Goal "Suc #1 = #2";
   48.65 +Goal "Suc Numeral1 = # 2";
   48.66  by (Simp_tac 1);
   48.67  qed "Suc_numeral_1_eq_2";
   48.68  
   48.69  (** Addition **)
   48.70  
   48.71 -Goal "[| (#0::int) <= z;  #0 <= z' |] ==> nat (z+z') = nat z + nat z'";
   48.72 +Goal "[| (Numeral0::int) <= z;  Numeral0 <= z' |] ==> nat (z+z') = nat z + nat z'";
   48.73  by (rtac (inj_int RS injD) 1);
   48.74  by (asm_simp_tac (simpset() addsimps [zadd_int RS sym]) 1);
   48.75  qed "nat_add_distrib";
   48.76 @@ -103,7 +103,7 @@
   48.77  
   48.78  (** Subtraction **)
   48.79  
   48.80 -Goal "[| (#0::int) <= z';  z' <= z |] ==> nat (z-z') = nat z - nat z'";
   48.81 +Goal "[| (Numeral0::int) <= z';  z' <= z |] ==> nat (z-z') = nat z - nat z'";
   48.82  by (rtac (inj_int RS injD) 1);
   48.83  by (asm_simp_tac (simpset() addsimps [zdiff_int RS sym, nat_le_eq_zle]) 1);
   48.84  qed "nat_diff_distrib";
   48.85 @@ -122,7 +122,7 @@
   48.86       "(number_of v :: nat) - number_of v' = \
   48.87  \       (if neg (number_of v') then number_of v \
   48.88  \        else let d = number_of (bin_add v (bin_minus v')) in    \
   48.89 -\             if neg d then #0 else nat d)";
   48.90 +\             if neg d then Numeral0 else nat d)";
   48.91  by (simp_tac
   48.92      (simpset_of Int.thy delcongs [if_weak_cong]
   48.93  			addsimps [not_neg_eq_ge_0, nat_0,
   48.94 @@ -134,22 +134,22 @@
   48.95  
   48.96  (** Multiplication **)
   48.97  
   48.98 -Goal "(#0::int) <= z ==> nat (z*z') = nat z * nat z'";
   48.99 -by (case_tac "#0 <= z'" 1);
  48.100 +Goal "(Numeral0::int) <= z ==> nat (z*z') = nat z * nat z'";
  48.101 +by (case_tac "Numeral0 <= z'" 1);
  48.102  by (asm_full_simp_tac (simpset() addsimps [zmult_le_0_iff]) 2);
  48.103  by (rtac (inj_int RS injD) 1);
  48.104  by (asm_simp_tac (simpset() addsimps [zmult_int RS sym,
  48.105  				      int_0_le_mult_iff]) 1);
  48.106  qed "nat_mult_distrib";
  48.107  
  48.108 -Goal "z <= (#0::int) ==> nat(z*z') = nat(-z) * nat(-z')"; 
  48.109 +Goal "z <= (Numeral0::int) ==> nat(z*z') = nat(-z) * nat(-z')"; 
  48.110  by (rtac trans 1); 
  48.111  by (rtac nat_mult_distrib 2); 
  48.112  by Auto_tac;  
  48.113  qed "nat_mult_distrib_neg";
  48.114  
  48.115  Goal "(number_of v :: nat) * number_of v' = \
  48.116 -\      (if neg (number_of v) then #0 else number_of (bin_mult v v'))";
  48.117 +\      (if neg (number_of v) then Numeral0 else number_of (bin_mult v v'))";
  48.118  by (simp_tac
  48.119      (simpset_of Int.thy addsimps [neg_nat, not_neg_eq_ge_0, nat_number_of_def, 
  48.120  				  nat_mult_distrib RS sym, number_of_mult, 
  48.121 @@ -161,15 +161,15 @@
  48.122  
  48.123  (** Quotient **)
  48.124  
  48.125 -Goal "(#0::int) <= z ==> nat (z div z') = nat z div nat z'";
  48.126 -by (case_tac "#0 <= z'" 1);
  48.127 +Goal "(Numeral0::int) <= z ==> nat (z div z') = nat z div nat z'";
  48.128 +by (case_tac "Numeral0 <= z'" 1);
  48.129  by (auto_tac (claset(), 
  48.130  	      simpset() addsimps [div_nonneg_neg_le0, DIVISION_BY_ZERO_DIV]));
  48.131 -by (zdiv_undefined_case_tac "z' = #0" 1);
  48.132 +by (zdiv_undefined_case_tac "z' = Numeral0" 1);
  48.133   by (simp_tac (simpset() addsimps [numeral_0_eq_0, DIVISION_BY_ZERO_DIV]) 1);
  48.134  by (auto_tac (claset() addSEs [nonneg_eq_int], simpset()));
  48.135  by (rename_tac "m m'" 1);
  48.136 -by (subgoal_tac "#0 <= int m div int m'" 1);
  48.137 +by (subgoal_tac "Numeral0 <= int m div int m'" 1);
  48.138   by (asm_full_simp_tac 
  48.139       (simpset() addsimps [numeral_0_eq_0, pos_imp_zdiv_nonneg_iff]) 2);
  48.140  by (rtac (inj_int RS injD) 1);
  48.141 @@ -184,7 +184,7 @@
  48.142  qed "nat_div_distrib";
  48.143  
  48.144  Goal "(number_of v :: nat)  div  number_of v' = \
  48.145 -\         (if neg (number_of v) then #0 \
  48.146 +\         (if neg (number_of v) then Numeral0 \
  48.147  \          else nat (number_of v div number_of v'))";
  48.148  by (simp_tac
  48.149      (simpset_of Int.thy addsimps [not_neg_eq_ge_0, nat_number_of_def, neg_nat, 
  48.150 @@ -197,12 +197,12 @@
  48.151  (** Remainder **)
  48.152  
  48.153  (*Fails if z'<0: the LHS collapses to (nat z) but the RHS doesn't*)
  48.154 -Goal "[| (#0::int) <= z;  #0 <= z' |] ==> nat (z mod z') = nat z mod nat z'";
  48.155 -by (zdiv_undefined_case_tac "z' = #0" 1);
  48.156 +Goal "[| (Numeral0::int) <= z;  Numeral0 <= z' |] ==> nat (z mod z') = nat z mod nat z'";
  48.157 +by (zdiv_undefined_case_tac "z' = Numeral0" 1);
  48.158   by (simp_tac (simpset() addsimps [numeral_0_eq_0, DIVISION_BY_ZERO_MOD]) 1);
  48.159  by (auto_tac (claset() addSEs [nonneg_eq_int], simpset()));
  48.160  by (rename_tac "m m'" 1);
  48.161 -by (subgoal_tac "#0 <= int m mod int m'" 1);
  48.162 +by (subgoal_tac "Numeral0 <= int m mod int m'" 1);
  48.163   by (asm_full_simp_tac 
  48.164       (simpset() addsimps [nat_less_iff, numeral_0_eq_0, pos_mod_sign]) 2);
  48.165  by (rtac (inj_int RS injD) 1);
  48.166 @@ -217,7 +217,7 @@
  48.167  qed "nat_mod_distrib";
  48.168  
  48.169  Goal "(number_of v :: nat)  mod  number_of v' = \
  48.170 -\       (if neg (number_of v) then #0 \
  48.171 +\       (if neg (number_of v) then Numeral0 \
  48.172  \        else if neg (number_of v') then number_of v \
  48.173  \        else nat (number_of v mod number_of v'))";
  48.174  by (simp_tac
  48.175 @@ -233,7 +233,7 @@
  48.176  
  48.177  (** Equals (=) **)
  48.178  
  48.179 -Goal "[| (#0::int) <= z;  #0 <= z' |] ==> (nat z = nat z') = (z=z')";
  48.180 +Goal "[| (Numeral0::int) <= z;  Numeral0 <= z' |] ==> (nat z = nat z') = (z=z')";
  48.181  by (auto_tac (claset() addSEs [nonneg_eq_int], simpset()));
  48.182  qed "eq_nat_nat_iff";
  48.183  
  48.184 @@ -280,22 +280,22 @@
  48.185  
  48.186  (*** New versions of existing theorems involving 0, 1, 2 ***)
  48.187  
  48.188 -(*Maps n to #n for n = 0, 1, 2*)
  48.189 -val numeral_sym_ss = 
  48.190 -    HOL_ss addsimps [numeral_0_eq_0 RS sym, 
  48.191 -		     numeral_1_eq_1 RS sym, 
  48.192 +(*Maps n to # n for n = 0, 1, 2*)
  48.193 +val numeral_sym_ss =
  48.194 +    HOL_ss addsimps [numeral_0_eq_0 RS sym,
  48.195 +		     numeral_1_eq_1 RS sym,
  48.196  		     numeral_2_eq_2 RS sym,
  48.197  		     Suc_numeral_1_eq_2, Suc_numeral_0_eq_1];
  48.198  
  48.199  fun rename_numerals th = simplify numeral_sym_ss (Thm.transfer (the_context ()) th);
  48.200  
  48.201 -(*Maps #n to n for n = 0, 1, 2*)
  48.202 +(*Maps # n to n for n = 0, 1, 2*)
  48.203  bind_thms ("numerals", [numeral_0_eq_0, numeral_1_eq_1, numeral_2_eq_2]);
  48.204  val numeral_ss = simpset() addsimps numerals;
  48.205  
  48.206  (** Nat **)
  48.207  
  48.208 -Goal "#0 < n ==> n = Suc(n - #1)";
  48.209 +Goal "Numeral0 < n ==> n = Suc(n - Numeral1)";
  48.210  by (asm_full_simp_tac numeral_ss 1);
  48.211  qed "Suc_pred'";
  48.212  
  48.213 @@ -329,28 +329,28 @@
  48.214  
  48.215  AddIffs (map rename_numerals [add_is_0, add_gr_0]);
  48.216  
  48.217 -Goal "Suc n = n + #1";
  48.218 +Goal "Suc n = n + Numeral1";
  48.219  by (asm_simp_tac numeral_ss 1);
  48.220  qed "Suc_eq_add_numeral_1";
  48.221  
  48.222  (* These two can be useful when m = number_of... *)
  48.223  
  48.224 -Goal "(m::nat) + n = (if m=#0 then n else Suc ((m - #1) + n))";
  48.225 +Goal "(m::nat) + n = (if m=Numeral0 then n else Suc ((m - Numeral1) + n))";
  48.226  by (case_tac "m" 1);
  48.227  by (ALLGOALS (asm_simp_tac numeral_ss));
  48.228  qed "add_eq_if";
  48.229  
  48.230 -Goal "(m::nat) * n = (if m=#0 then #0 else n + ((m - #1) * n))";
  48.231 +Goal "(m::nat) * n = (if m=Numeral0 then Numeral0 else n + ((m - Numeral1) * n))";
  48.232  by (case_tac "m" 1);
  48.233  by (ALLGOALS (asm_simp_tac numeral_ss));
  48.234  qed "mult_eq_if";
  48.235  
  48.236 -Goal "(p ^ m :: nat) = (if m=#0 then #1 else p * (p ^ (m - #1)))";
  48.237 +Goal "(p ^ m :: nat) = (if m=Numeral0 then Numeral1 else p * (p ^ (m - Numeral1)))";
  48.238  by (case_tac "m" 1);
  48.239  by (ALLGOALS (asm_simp_tac numeral_ss));
  48.240  qed "power_eq_if";
  48.241  
  48.242 -Goal "[| #0<n; #0<m |] ==> m - n < (m::nat)";
  48.243 +Goal "[| Numeral0<n; Numeral0<m |] ==> m - n < (m::nat)";
  48.244  by (asm_full_simp_tac (numeral_ss addsimps [diff_less]) 1);
  48.245  qed "diff_less'";
  48.246  
  48.247 @@ -375,20 +375,20 @@
  48.248  
  48.249  (** Power **)
  48.250  
  48.251 -Goal "(p::nat) ^ #0 = #1";
  48.252 +Goal "(p::nat) ^ Numeral0 = Numeral1";
  48.253  by (simp_tac numeral_ss 1);
  48.254  qed "power_zero";
  48.255  
  48.256 -Goal "(p::nat) ^ #1 = p";
  48.257 +Goal "(p::nat) ^ Numeral1 = p";
  48.258  by (simp_tac numeral_ss 1);
  48.259  qed "power_one";
  48.260  Addsimps [power_zero, power_one];
  48.261  
  48.262 -Goal "(p::nat) ^ #2 = p*p";
  48.263 +Goal "(p::nat) ^ # 2 = p*p";
  48.264  by (simp_tac numeral_ss 1);
  48.265  qed "power_two";
  48.266  
  48.267 -Goal "#0 < (i::nat) ==> #0 < i^n";
  48.268 +Goal "Numeral0 < (i::nat) ==> Numeral0 < i^n";
  48.269  by (asm_simp_tac numeral_ss 1);
  48.270  qed "zero_less_power'";
  48.271  Addsimps [zero_less_power'];
  48.272 @@ -495,9 +495,9 @@
  48.273  by Auto_tac;
  48.274  val lemma1 = result();
  48.275  
  48.276 -Goal "m+m ~= int 1' + n + n";
  48.277 +Goal "m+m ~= int (Suc 0) + n + n";
  48.278  by Auto_tac;
  48.279 -by (dres_inst_tac [("f", "%x. x mod #2")] arg_cong 1);
  48.280 +by (dres_inst_tac [("f", "%x. x mod # 2")] arg_cong 1);
  48.281  by (full_simp_tac (simpset() addsimps [zmod_zadd1_eq]) 1); 
  48.282  val lemma2 = result();
  48.283  
  48.284 @@ -514,7 +514,7 @@
  48.285  by (res_inst_tac [("x", "number_of v")] spec 1);
  48.286  by Safe_tac;
  48.287  by (ALLGOALS Full_simp_tac);
  48.288 -by (dres_inst_tac [("f", "%x. x mod #2")] arg_cong 1);
  48.289 +by (dres_inst_tac [("f", "%x. x mod # 2")] arg_cong 1);
  48.290  by (full_simp_tac (simpset() addsimps [zmod_zadd1_eq]) 1); 
  48.291  qed "eq_number_of_BIT_Pls"; 
  48.292  
  48.293 @@ -524,7 +524,7 @@
  48.294  	       [number_of_BIT, number_of_Min, eq_commute]) 1); 
  48.295  by (res_inst_tac [("x", "number_of v")] spec 1);
  48.296  by Auto_tac;
  48.297 -by (dres_inst_tac [("f", "%x. x mod #2")] arg_cong 1);
  48.298 +by (dres_inst_tac [("f", "%x. x mod # 2")] arg_cong 1);
  48.299  by Auto_tac;
  48.300  qed "eq_number_of_BIT_Min"; 
  48.301  
  48.302 @@ -536,7 +536,7 @@
  48.303  (*** Further lemmas about "nat" ***)
  48.304  
  48.305  Goal "nat (abs (w * z)) = nat (abs w) * nat (abs z)";
  48.306 -by (case_tac "z=#0 | w=#0" 1);
  48.307 +by (case_tac "z=Numeral0 | w=Numeral0" 1);
  48.308  by Auto_tac;  
  48.309  by (simp_tac (simpset() addsimps [zabs_def, nat_mult_distrib RS sym, 
  48.310                            nat_mult_distrib_neg RS sym, zmult_less_0_iff]) 1);
    49.1 --- a/src/HOL/Integ/nat_simprocs.ML	Fri Oct 05 21:50:37 2001 +0200
    49.2 +++ b/src/HOL/Integ/nat_simprocs.ML	Fri Oct 05 21:52:39 2001 +0200
    49.3 @@ -66,19 +66,19 @@
    49.4  
    49.5  (** For cancel_numeral_factors **)
    49.6  
    49.7 -Goal "(#0::nat) < k ==> (k*m <= k*n) = (m<=n)";
    49.8 +Goal "(Numeral0::nat) < k ==> (k*m <= k*n) = (m<=n)";
    49.9  by Auto_tac;  
   49.10  qed "nat_mult_le_cancel1";
   49.11  
   49.12 -Goal "(#0::nat) < k ==> (k*m < k*n) = (m<n)";
   49.13 +Goal "(Numeral0::nat) < k ==> (k*m < k*n) = (m<n)";
   49.14  by Auto_tac;  
   49.15  qed "nat_mult_less_cancel1";
   49.16  
   49.17 -Goal "(#0::nat) < k ==> (k*m = k*n) = (m=n)";
   49.18 +Goal "(Numeral0::nat) < k ==> (k*m = k*n) = (m=n)";
   49.19  by Auto_tac;  
   49.20  qed "nat_mult_eq_cancel1";
   49.21  
   49.22 -Goal "(#0::nat) < k ==> (k*m) div (k*n) = (m div n)";
   49.23 +Goal "(Numeral0::nat) < k ==> (k*m) div (k*n) = (m div n)";
   49.24  by Auto_tac;  
   49.25  qed "nat_mult_div_cancel1";
   49.26  
   49.27 @@ -125,7 +125,7 @@
   49.28  val zero = mk_numeral 0;
   49.29  val mk_plus = HOLogic.mk_binop "op +";
   49.30  
   49.31 -(*Thus mk_sum[t] yields t+#0; longer sums don't have a trailing zero*)
   49.32 +(*Thus mk_sum[t] yields t+Numeral0; longer sums don't have a trailing zero*)
   49.33  fun mk_sum []        = zero
   49.34    | mk_sum [t,u]     = mk_plus (t, u)
   49.35    | mk_sum (t :: ts) = mk_plus (t, mk_sum ts);
   49.36 @@ -158,7 +158,7 @@
   49.37  val bin_simps = [add_nat_number_of, nat_number_of_add_left,
   49.38                   diff_nat_number_of, le_nat_number_of_eq_not_less,
   49.39                   less_nat_number_of, mult_nat_number_of, 
   49.40 -                 Let_number_of, nat_number_of] @
   49.41 +                 thm "Let_number_of", nat_number_of] @
   49.42                  bin_arith_simps @ bin_rel_simps;
   49.43  
   49.44  fun prep_simproc (name, pats, proc) = Simplifier.mk_simproc name pats proc;
   49.45 @@ -204,11 +204,11 @@
   49.46          handle TERM _ => find_first_coeff (t::past) u terms;
   49.47  
   49.48  
   49.49 -(*Simplify #1*n and n*#1 to n*)
   49.50 +(*Simplify Numeral1*n and n*Numeral1 to n*)
   49.51  val add_0s = map rename_numerals [add_0, add_0_right];
   49.52  val mult_1s = map rename_numerals [mult_1, mult_1_right];
   49.53  
   49.54 -(*Final simplification: cancel + and *; replace #0 by 0 and #1 by 1*)
   49.55 +(*Final simplification: cancel + and *; replace Numeral0 by 0 and Numeral1 by 1*)
   49.56  val simplify_meta_eq =
   49.57      Int_Numeral_Simprocs.simplify_meta_eq
   49.58           [numeral_0_eq_0, numeral_1_eq_1, add_0, add_0_right,
   49.59 @@ -319,7 +319,7 @@
   49.60  structure CombineNumeralsData =
   49.61    struct
   49.62    val add		= op + : int*int -> int 
   49.63 -  val mk_sum            = long_mk_sum    (*to work for e.g. #2*x + #3*x *)
   49.64 +  val mk_sum            = long_mk_sum    (*to work for e.g. # 2*x + # 3*x *)
   49.65    val dest_sum          = restricted_dest_Sucs_sum
   49.66    val mk_coeff          = mk_coeff
   49.67    val dest_coeff        = dest_coeff
   49.68 @@ -504,62 +504,62 @@
   49.69  fun test s = (Goal s; by (Simp_tac 1));
   49.70  
   49.71  (*cancel_numerals*)
   49.72 -test "l +( #2) + (#2) + #2 + (l + #2) + (oo  + #2) = (uu::nat)";
   49.73 -test "(#2*length xs < #2*length xs + j)";
   49.74 -test "(#2*length xs < length xs * #2 + j)";
   49.75 -test "#2*u = (u::nat)";
   49.76 -test "#2*u = Suc (u)";
   49.77 -test "(i + j + #12 + (k::nat)) - #15 = y";
   49.78 -test "(i + j + #12 + (k::nat)) - #5 = y";
   49.79 -test "Suc u - #2 = y";
   49.80 -test "Suc (Suc (Suc u)) - #2 = y";
   49.81 -test "(i + j + #2 + (k::nat)) - 1 = y";
   49.82 -test "(i + j + #1 + (k::nat)) - 2 = y";
   49.83 +test "l +( # 2) + (# 2) + # 2 + (l + # 2) + (oo  + # 2) = (uu::nat)";
   49.84 +test "(# 2*length xs < # 2*length xs + j)";
   49.85 +test "(# 2*length xs < length xs * # 2 + j)";
   49.86 +test "# 2*u = (u::nat)";
   49.87 +test "# 2*u = Suc (u)";
   49.88 +test "(i + j + # 12 + (k::nat)) - # 15 = y";
   49.89 +test "(i + j + # 12 + (k::nat)) - # 5 = y";
   49.90 +test "Suc u - # 2 = y";
   49.91 +test "Suc (Suc (Suc u)) - # 2 = y";
   49.92 +test "(i + j + # 2 + (k::nat)) - 1 = y";
   49.93 +test "(i + j + Numeral1 + (k::nat)) - 2 = y";
   49.94  
   49.95 -test "(#2*x + (u*v) + y) - v*#3*u = (w::nat)";
   49.96 -test "(#2*x*u*v + #5 + (u*v)*#4 + y) - v*u*#4 = (w::nat)";
   49.97 -test "(#2*x*u*v + (u*v)*#4 + y) - v*u = (w::nat)";
   49.98 -test "Suc (Suc (#2*x*u*v + u*#4 + y)) - u = w";
   49.99 -test "Suc ((u*v)*#4) - v*#3*u = w";
  49.100 -test "Suc (Suc ((u*v)*#3)) - v*#3*u = w";
  49.101 +test "(# 2*x + (u*v) + y) - v*# 3*u = (w::nat)";
  49.102 +test "(# 2*x*u*v + # 5 + (u*v)*# 4 + y) - v*u*# 4 = (w::nat)";
  49.103 +test "(# 2*x*u*v + (u*v)*# 4 + y) - v*u = (w::nat)";
  49.104 +test "Suc (Suc (# 2*x*u*v + u*# 4 + y)) - u = w";
  49.105 +test "Suc ((u*v)*# 4) - v*# 3*u = w";
  49.106 +test "Suc (Suc ((u*v)*# 3)) - v*# 3*u = w";
  49.107  
  49.108 -test "(i + j + #12 + (k::nat)) = u + #15 + y";
  49.109 -test "(i + j + #32 + (k::nat)) - (u + #15 + y) = zz";
  49.110 -test "(i + j + #12 + (k::nat)) = u + #5 + y";
  49.111 +test "(i + j + # 12 + (k::nat)) = u + # 15 + y";
  49.112 +test "(i + j + # 32 + (k::nat)) - (u + # 15 + y) = zz";
  49.113 +test "(i + j + # 12 + (k::nat)) = u + # 5 + y";
  49.114  (*Suc*)
  49.115 -test "(i + j + #12 + k) = Suc (u + y)";
  49.116 -test "Suc (Suc (Suc (Suc (Suc (u + y))))) <= ((i + j) + #41 + k)";
  49.117 -test "(i + j + #5 + k) < Suc (Suc (Suc (Suc (Suc (u + y)))))";
  49.118 -test "Suc (Suc (Suc (Suc (Suc (u + y))))) - #5 = v";
  49.119 -test "(i + j + #5 + k) = Suc (Suc (Suc (Suc (Suc (Suc (Suc (u + y)))))))";
  49.120 -test "#2*y + #3*z + #2*u = Suc (u)";
  49.121 -test "#2*y + #3*z + #6*w + #2*y + #3*z + #2*u = Suc (u)";
  49.122 -test "#2*y + #3*z + #6*w + #2*y + #3*z + #2*u = #2*y' + #3*z' + #6*w' + #2*y' + #3*z' + u + (vv::nat)";
  49.123 -test "#6 + #2*y + #3*z + #4*u = Suc (vv + #2*u + z)";
  49.124 -test "(#2*n*m) < (#3*(m*n)) + (u::nat)";
  49.125 +test "(i + j + # 12 + k) = Suc (u + y)";
  49.126 +test "Suc (Suc (Suc (Suc (Suc (u + y))))) <= ((i + j) + # 41 + k)";
  49.127 +test "(i + j + # 5 + k) < Suc (Suc (Suc (Suc (Suc (u + y)))))";
  49.128 +test "Suc (Suc (Suc (Suc (Suc (u + y))))) - # 5 = v";
  49.129 +test "(i + j + # 5 + k) = Suc (Suc (Suc (Suc (Suc (Suc (Suc (u + y)))))))";
  49.130 +test "# 2*y + # 3*z + # 2*u = Suc (u)";
  49.131 +test "# 2*y + # 3*z + # 6*w + # 2*y + # 3*z + # 2*u = Suc (u)";
  49.132 +test "# 2*y + # 3*z + # 6*w + # 2*y + # 3*z + # 2*u = # 2*y' + # 3*z' + # 6*w' + # 2*y' + # 3*z' + u + (vv::nat)";
  49.133 +test "# 6 + # 2*y + # 3*z + # 4*u = Suc (vv + # 2*u + z)";
  49.134 +test "(# 2*n*m) < (# 3*(m*n)) + (u::nat)";
  49.135  
  49.136  (*negative numerals: FAIL*)
  49.137 -test "(i + j + #-23 + (k::nat)) < u + #15 + y";
  49.138 -test "(i + j + #3 + (k::nat)) < u + #-15 + y";
  49.139 -test "(i + j + #-12 + (k::nat)) - #15 = y";
  49.140 -test "(i + j + #12 + (k::nat)) - #-15 = y";
  49.141 -test "(i + j + #-12 + (k::nat)) - #-15 = y";
  49.142 +test "(i + j + # -23 + (k::nat)) < u + # 15 + y";
  49.143 +test "(i + j + # 3 + (k::nat)) < u + # -15 + y";
  49.144 +test "(i + j + # -12 + (k::nat)) - # 15 = y";
  49.145 +test "(i + j + # 12 + (k::nat)) - # -15 = y";
  49.146 +test "(i + j + # -12 + (k::nat)) - # -15 = y";
  49.147  
  49.148  (*combine_numerals*)
  49.149 -test "k + #3*k = (u::nat)";
  49.150 -test "Suc (i + #3) = u";
  49.151 -test "Suc (i + j + #3 + k) = u";
  49.152 -test "k + j + #3*k + j = (u::nat)";
  49.153 -test "Suc (j*i + i + k + #5 + #3*k + i*j*#4) = (u::nat)";
  49.154 -test "(#2*n*m) + (#3*(m*n)) = (u::nat)";
  49.155 +test "k + # 3*k = (u::nat)";
  49.156 +test "Suc (i + # 3) = u";
  49.157 +test "Suc (i + j + # 3 + k) = u";
  49.158 +test "k + j + # 3*k + j = (u::nat)";
  49.159 +test "Suc (j*i + i + k + # 5 + # 3*k + i*j*# 4) = (u::nat)";
  49.160 +test "(# 2*n*m) + (# 3*(m*n)) = (u::nat)";
  49.161  (*negative numerals: FAIL*)
  49.162 -test "Suc (i + j + #-3 + k) = u";
  49.163 +test "Suc (i + j + # -3 + k) = u";
  49.164  
  49.165  (*cancel_numeral_factors*)
  49.166 -test "#9*x = #12 * (y::nat)";
  49.167 -test "(#9*x) div (#12 * (y::nat)) = z";
  49.168 -test "#9*x < #12 * (y::nat)";
  49.169 -test "#9*x <= #12 * (y::nat)";
  49.170 +test "# 9*x = # 12 * (y::nat)";
  49.171 +test "(# 9*x) div (# 12 * (y::nat)) = z";
  49.172 +test "# 9*x < # 12 * (y::nat)";
  49.173 +test "# 9*x <= # 12 * (y::nat)";
  49.174  
  49.175  (*cancel_factor*)
  49.176  test "x*k = k*(y::nat)";
  49.177 @@ -597,7 +597,7 @@
  49.178     Suc_eq_number_of,eq_number_of_Suc,
  49.179     mult_0, mult_0_right, mult_Suc, mult_Suc_right,
  49.180     eq_number_of_0, eq_0_number_of, less_0_number_of,
  49.181 -   nat_number_of, Let_number_of, if_True, if_False];
  49.182 +   nat_number_of, thm "Let_number_of", if_True, if_False];
  49.183  
  49.184  val simprocs = [Nat_Times_Assoc.conv,
  49.185                  Nat_Numeral_Simprocs.combine_numerals]@
    50.1 --- a/src/HOL/Isar_examples/Fibonacci.thy	Fri Oct 05 21:50:37 2001 +0200
    50.2 +++ b/src/HOL/Isar_examples/Fibonacci.thy	Fri Oct 05 21:52:39 2001 +0200
    50.3 @@ -29,7 +29,7 @@
    50.4  consts fib :: "nat => nat"
    50.5  recdef fib less_than
    50.6   "fib 0 = 0"
    50.7 - "fib 1' = 1"
    50.8 + "fib (Suc 0) = 1"
    50.9   "fib (Suc (Suc x)) = fib x + fib (Suc x)"
   50.10  
   50.11  lemma [simp]: "0 < fib (Suc n)"
   50.12 @@ -39,7 +39,7 @@
   50.13  text {* Alternative induction rule. *}
   50.14  
   50.15  theorem fib_induct:
   50.16 -    "P 0 ==> P 1 ==> (!!n. P (n + 1) ==> P n ==> P (n + 2)) ==> P n"
   50.17 +    "P 0 ==> P 1 ==> (!!n. P (n + 1) ==> P n ==> P (n + # 2)) ==> P (n::nat)"
   50.18    by (induct rule: fib.induct, simp+)
   50.19  
   50.20  
   50.21 @@ -56,7 +56,7 @@
   50.22    show "?P 0" by simp
   50.23    show "?P 1" by simp
   50.24    fix n
   50.25 -  have "fib (n + 2 + k + 1)
   50.26 +  have "fib (n + # 2 + k + 1)
   50.27      = fib (n + k + 1) + fib (n + 1 + k + 1)" by simp
   50.28    also assume "fib (n + k + 1)
   50.29      = fib (k + 1) * fib (n + 1) + fib k * fib n"
   50.30 @@ -65,9 +65,9 @@
   50.31      = fib (k + 1) * fib (n + 1 + 1) + fib k * fib (n + 1)"
   50.32        (is " _ = ?R2")
   50.33    also have "?R1 + ?R2
   50.34 -    = fib (k + 1) * fib (n + 2 + 1) + fib k * fib (n + 2)"
   50.35 +    = fib (k + 1) * fib (n + # 2 + 1) + fib k * fib (n + # 2)"
   50.36      by (simp add: add_mult_distrib2)
   50.37 -  finally show "?P (n + 2)" .
   50.38 +  finally show "?P (n + # 2)" .
   50.39  qed
   50.40  
   50.41  lemma gcd_fib_Suc_eq_1: "gcd (fib n, fib (n + 1)) = 1" (is "?P n")
   50.42 @@ -75,14 +75,14 @@
   50.43    show "?P 0" by simp
   50.44    show "?P 1" by simp
   50.45    fix n
   50.46 -  have "fib (n + 2 + 1) = fib (n + 1) + fib (n + 2)"
   50.47 +  have "fib (n + # 2 + 1) = fib (n + 1) + fib (n + # 2)"
   50.48      by simp
   50.49 -  also have "gcd (fib (n + 2), ...) = gcd (fib (n + 2), fib (n + 1))"
   50.50 +  also have "gcd (fib (n + # 2), ...) = gcd (fib (n + # 2), fib (n + 1))"
   50.51      by (simp only: gcd_add2')
   50.52    also have "... = gcd (fib (n + 1), fib (n + 1 + 1))"
   50.53      by (simp add: gcd_commute)
   50.54    also assume "... = 1"
   50.55 -  finally show "?P (n + 2)" .
   50.56 +  finally show "?P (n + # 2)" .
   50.57  qed
   50.58  
   50.59  lemma gcd_mult_add: "0 < n ==> gcd (n * k + m, n) = gcd (m, n)"
    51.1 --- a/src/HOL/Isar_examples/HoareEx.thy	Fri Oct 05 21:50:37 2001 +0200
    51.2 +++ b/src/HOL/Isar_examples/HoareEx.thy	Fri Oct 05 21:52:39 2001 +0200
    51.3 @@ -39,7 +39,7 @@
    51.4  *}
    51.5  
    51.6  lemma
    51.7 -  "|- .{\<acute>(N_update (2 * \<acute>N)) : .{\<acute>N = #10}.}. \<acute>N := 2 * \<acute>N .{\<acute>N = #10}."
    51.8 +  "|- .{\<acute>(N_update (# 2 * \<acute>N)) : .{\<acute>N = # 10}.}. \<acute>N := # 2 * \<acute>N .{\<acute>N = # 10}."
    51.9    by (rule assign)
   51.10  
   51.11  text {*
   51.12 @@ -49,13 +49,13 @@
   51.13   ``obvious'' consequences as well.
   51.14  *}
   51.15  
   51.16 -lemma "|- .{True}. \<acute>N := #10 .{\<acute>N = #10}."
   51.17 +lemma "|- .{True}. \<acute>N := # 10 .{\<acute>N = # 10}."
   51.18    by hoare
   51.19  
   51.20 -lemma "|- .{2 * \<acute>N = #10}. \<acute>N := 2 * \<acute>N .{\<acute>N = #10}."
   51.21 +lemma "|- .{# 2 * \<acute>N = # 10}. \<acute>N := # 2 * \<acute>N .{\<acute>N = # 10}."
   51.22    by hoare
   51.23  
   51.24 -lemma "|- .{\<acute>N = #5}. \<acute>N := 2 * \<acute>N .{\<acute>N = #10}."
   51.25 +lemma "|- .{\<acute>N = # 5}. \<acute>N := # 2 * \<acute>N .{\<acute>N = # 10}."
   51.26    by hoare simp
   51.27  
   51.28  lemma "|- .{\<acute>N + 1 = a + 1}. \<acute>N := \<acute>N + 1 .{\<acute>N = a + 1}."
   51.29 @@ -112,7 +112,7 @@
   51.30  
   51.31  lemma "|- .{\<acute>M = \<acute>N}. \<acute>M := \<acute>M + 1 .{\<acute>M ~= \<acute>N}."
   51.32  proof -
   51.33 -  have "!!m n. m = n --> m + 1 ~= n"
   51.34 +  have "!!m n::nat. m = n --> m + 1 ~= n"
   51.35        -- {* inclusion of assertions expressed in ``pure'' logic, *}
   51.36        -- {* without mentioning the state space *}
   51.37      by simp
    52.1 --- a/src/HOL/Isar_examples/MutilatedCheckerboard.thy	Fri Oct 05 21:50:37 2001 +0200
    52.2 +++ b/src/HOL/Isar_examples/MutilatedCheckerboard.thy	Fri Oct 05 21:52:39 2001 +0200
    52.3 @@ -76,7 +76,7 @@
    52.4    by (simp add: below_def less_Suc_eq) blast
    52.5  
    52.6  lemma Sigma_Suc2:
    52.7 -    "m = n + 2 ==> A <*> below m =
    52.8 +    "m = n + # 2 ==> A <*> below m =
    52.9        (A <*> {n}) Un (A <*> {n + 1}) Un (A <*> below n)"
   52.10    by (auto simp add: below_def) arith
   52.11  
   52.12 @@ -87,10 +87,10 @@
   52.13  
   52.14  constdefs
   52.15    evnodd :: "(nat * nat) set => nat => (nat * nat) set"
   52.16 -  "evnodd A b == A Int {(i, j). (i + j) mod #2 = b}"
   52.17 +  "evnodd A b == A Int {(i, j). (i + j) mod # 2 = b}"
   52.18  
   52.19  lemma evnodd_iff:
   52.20 -    "(i, j): evnodd A b = ((i, j): A  & (i + j) mod #2 = b)"
   52.21 +    "(i, j): evnodd A b = ((i, j): A  & (i + j) mod # 2 = b)"
   52.22    by (simp add: evnodd_def)
   52.23  
   52.24  lemma evnodd_subset: "evnodd A b <= A"
   52.25 @@ -112,7 +112,7 @@
   52.26    by (simp add: evnodd_def)
   52.27  
   52.28  lemma evnodd_insert: "evnodd (insert (i, j) C) b =
   52.29 -    (if (i + j) mod #2 = b
   52.30 +    (if (i + j) mod # 2 = b
   52.31        then insert (i, j) (evnodd C b) else evnodd C b)"
   52.32    by (simp add: evnodd_def) blast
   52.33  
   52.34 @@ -128,21 +128,21 @@
   52.35      vertl: "{(i, j), (i + 1, j)} : domino"
   52.36  
   52.37  lemma dominoes_tile_row:
   52.38 -  "{i} <*> below (2 * n) : tiling domino"
   52.39 +  "{i} <*> below (# 2 * n) : tiling domino"
   52.40    (is "?P n" is "?B n : ?T")
   52.41  proof (induct n)
   52.42    show "?P 0" by (simp add: below_0 tiling.empty)
   52.43  
   52.44    fix n assume hyp: "?P n"
   52.45 -  let ?a = "{i} <*> {2 * n + 1} Un {i} <*> {2 * n}"
   52.46 +  let ?a = "{i} <*> {# 2 * n + 1} Un {i} <*> {# 2 * n}"
   52.47  
   52.48    have "?B (Suc n) = ?a Un ?B n"
   52.49      by (auto simp add: Sigma_Suc Un_assoc)
   52.50    also have "... : ?T"
   52.51    proof (rule tiling.Un)
   52.52 -    have "{(i, 2 * n), (i, 2 * n + 1)} : domino"
   52.53 +    have "{(i, # 2 * n), (i, # 2 * n + 1)} : domino"
   52.54        by (rule domino.horiz)
   52.55 -    also have "{(i, 2 * n), (i, 2 * n + 1)} = ?a" by blast
   52.56 +    also have "{(i, # 2 * n), (i, # 2 * n + 1)} = ?a" by blast
   52.57      finally show "... : domino" .
   52.58      from hyp show "?B n : ?T" .
   52.59      show "?a <= - ?B n" by blast
   52.60 @@ -151,13 +151,13 @@
   52.61  qed
   52.62  
   52.63  lemma dominoes_tile_matrix:
   52.64 -  "below m <*> below (2 * n) : tiling domino"
   52.65 +  "below m <*> below (# 2 * n) : tiling domino"
   52.66    (is "?P m" is "?B m : ?T")
   52.67  proof (induct m)
   52.68    show "?P 0" by (simp add: below_0 tiling.empty)
   52.69  
   52.70    fix m assume hyp: "?P m"
   52.71 -  let ?t = "{m} <*> below (2 * n)"
   52.72 +  let ?t = "{m} <*> below (# 2 * n)"
   52.73  
   52.74    have "?B (Suc m) = ?t Un ?B m" by (simp add: Sigma_Suc)
   52.75    also have "... : ?T"
   52.76 @@ -170,9 +170,9 @@
   52.77  qed
   52.78  
   52.79  lemma domino_singleton:
   52.80 -  "d : domino ==> b < 2 ==> EX i j. evnodd d b = {(i, j)}"
   52.81 +  "d : domino ==> b < # 2 ==> EX i j. evnodd d b = {(i, j)}"
   52.82  proof -
   52.83 -  assume b: "b < 2"
   52.84 +  assume b: "b < # 2"
   52.85    assume "d : domino"
   52.86    thus ?thesis (is "?P d")
   52.87    proof induct
   52.88 @@ -227,9 +227,9 @@
   52.89        and at: "a <= - t"
   52.90  
   52.91      have card_suc:
   52.92 -      "!!b. b < 2 ==> card (?e (a Un t) b) = Suc (card (?e t b))"
   52.93 +      "!!b. b < # 2 ==> card (?e (a Un t) b) = Suc (card (?e t b))"
   52.94      proof -
   52.95 -      fix b assume "b < 2"
   52.96 +      fix b :: nat assume "b < # 2"
   52.97        have "?e (a Un t) b = ?e a b Un ?e t b" by (rule evnodd_Un)
   52.98        also obtain i j where e: "?e a b = {(i, j)}"
   52.99        proof -
  52.100 @@ -260,15 +260,15 @@
  52.101  constdefs
  52.102    mutilated_board :: "nat => nat => (nat * nat) set"
  52.103    "mutilated_board m n ==
  52.104 -    below (2 * (m + 1)) <*> below (2 * (n + 1))
  52.105 -      - {(0, 0)} - {(2 * m + 1, 2 * n + 1)}"
  52.106 +    below (# 2 * (m + 1)) <*> below (# 2 * (n + 1))
  52.107 +      - {(0, 0)} - {(# 2 * m + 1, # 2 * n + 1)}"
  52.108  
  52.109  theorem mutil_not_tiling: "mutilated_board m n ~: tiling domino"
  52.110  proof (unfold mutilated_board_def)
  52.111    let ?T = "tiling domino"
  52.112 -  let ?t = "below (2 * (m + 1)) <*> below (2 * (n + 1))"
  52.113 +  let ?t = "below (# 2 * (m + 1)) <*> below (# 2 * (n + 1))"
  52.114    let ?t' = "?t - {(0, 0)}"
  52.115 -  let ?t'' = "?t' - {(2 * m + 1, 2 * n + 1)}"
  52.116 +  let ?t'' = "?t' - {(# 2 * m + 1, # 2 * n + 1)}"
  52.117  
  52.118    show "?t'' ~: ?T"
  52.119    proof
  52.120 @@ -282,12 +282,12 @@
  52.121      note [simp] = evnodd_iff evnodd_empty evnodd_insert evnodd_Diff
  52.122      have "card (?e ?t'' 0) < card (?e ?t' 0)"
  52.123      proof -
  52.124 -      have "card (?e ?t' 0 - {(2 * m + 1, 2 * n + 1)})
  52.125 +      have "card (?e ?t' 0 - {(# 2 * m + 1, # 2 * n + 1)})
  52.126          < card (?e ?t' 0)"
  52.127        proof (rule card_Diff1_less)
  52.128          from _ fin show "finite (?e ?t' 0)"
  52.129            by (rule finite_subset) auto
  52.130 -        show "(2 * m + 1, 2 * n + 1) : ?e ?t' 0" by simp
  52.131 +        show "(# 2 * m + 1, # 2 * n + 1) : ?e ?t' 0" by simp
  52.132        qed
  52.133        thus ?thesis by simp
  52.134      qed
    53.1 --- a/src/HOL/Isar_examples/Summation.thy	Fri Oct 05 21:50:37 2001 +0200
    53.2 +++ b/src/HOL/Isar_examples/Summation.thy	Fri Oct 05 21:52:39 2001 +0200
    53.3 @@ -31,14 +31,14 @@
    53.4  *}
    53.5  
    53.6  theorem sum_of_naturals:
    53.7 -  "2 * (\<Sum>i < n + 1. i) = n * (n + 1)"
    53.8 +  "# 2 * (\<Sum>i < n + 1. i) = n * (n + 1)"
    53.9    (is "?P n" is "?S n = _")
   53.10  proof (induct n)
   53.11    show "?P 0" by simp
   53.12  next
   53.13 -  fix n have "?S (n + 1) = ?S n + 2 * (n + 1)" by simp
   53.14 +  fix n have "?S (n + 1) = ?S n + # 2 * (n + 1)" by simp
   53.15    also assume "?S n = n * (n + 1)"
   53.16 -  also have "... + 2 * (n + 1) = (n + 1) * (n + 2)" by simp
   53.17 +  also have "... + # 2 * (n + 1) = (n + 1) * (n + # 2)" by simp
   53.18    finally show "?P (Suc n)" by simp
   53.19  qed
   53.20  
   53.21 @@ -86,14 +86,14 @@
   53.22  *}
   53.23  
   53.24  theorem sum_of_odds:
   53.25 -  "(\<Sum>i < n. 2 * i + 1) = n^2"
   53.26 +  "(\<Sum>i < n. # 2 * i + 1) = n^Suc (Suc 0)"
   53.27    (is "?P n" is "?S n = _")
   53.28  proof (induct n)
   53.29    show "?P 0" by simp
   53.30  next
   53.31 -  fix n have "?S (n + 1) = ?S n + 2 * n + 1" by simp
   53.32 -  also assume "?S n = n^2"
   53.33 -  also have "... + 2 * n + 1 = (n + 1)^2" by simp
   53.34 +  fix n have "?S (n + 1) = ?S n + # 2 * n + 1" by simp
   53.35 +  also assume "?S n = n^Suc (Suc 0)"
   53.36 +  also have "... + # 2 * n + 1 = (n + 1)^Suc (Suc 0)" by simp
   53.37    finally show "?P (Suc n)" by simp
   53.38  qed
   53.39  
   53.40 @@ -106,28 +106,28 @@
   53.41  lemmas distrib = add_mult_distrib add_mult_distrib2
   53.42  
   53.43  theorem sum_of_squares:
   53.44 -  "#6 * (\<Sum>i < n + 1. i^2) = n * (n + 1) * (2 * n + 1)"
   53.45 +  "# 6 * (\<Sum>i < n + 1. i^Suc (Suc 0)) = n * (n + 1) * (# 2 * n + 1)"
   53.46    (is "?P n" is "?S n = _")
   53.47  proof (induct n)
   53.48    show "?P 0" by simp
   53.49  next
   53.50 -  fix n have "?S (n + 1) = ?S n + #6 * (n + 1)^2" by (simp add: distrib)
   53.51 -  also assume "?S n = n * (n + 1) * (2 * n + 1)"
   53.52 -  also have "... + #6 * (n + 1)^2 =
   53.53 -    (n + 1) * (n + 2) * (2 * (n + 1) + 1)" by (simp add: distrib)
   53.54 +  fix n have "?S (n + 1) = ?S n + # 6 * (n + 1)^Suc (Suc 0)" by (simp add: distrib)
   53.55 +  also assume "?S n = n * (n + 1) * (# 2 * n + 1)"
   53.56 +  also have "... + # 6 * (n + 1)^Suc (Suc 0) =
   53.57 +    (n + 1) * (n + # 2) * (# 2 * (n + 1) + 1)" by (simp add: distrib)
   53.58    finally show "?P (Suc n)" by simp
   53.59  qed
   53.60  
   53.61  theorem sum_of_cubes:
   53.62 -  "#4 * (\<Sum>i < n + 1. i^#3) = (n * (n + 1))^2"
   53.63 +  "# 4 * (\<Sum>i < n + 1. i^# 3) = (n * (n + 1))^Suc (Suc 0)"
   53.64    (is "?P n" is "?S n = _")
   53.65  proof (induct n)
   53.66    show "?P 0" by (simp add: power_eq_if)
   53.67  next
   53.68 -  fix n have "?S (n + 1) = ?S n + #4 * (n + 1)^#3"
   53.69 +  fix n have "?S (n + 1) = ?S n + # 4 * (n + 1)^# 3"
   53.70      by (simp add: power_eq_if distrib)
   53.71 -  also assume "?S n = (n * (n + 1))^2"
   53.72 -  also have "... + #4 * (n + 1)^#3 = ((n + 1) * ((n + 1) + 1))^2"
   53.73 +  also assume "?S n = (n * (n + 1))^Suc (Suc 0)"
   53.74 +  also have "... + # 4 * (n + 1)^# 3 = ((n + 1) * ((n + 1) + 1))^Suc (Suc 0)"
   53.75      by (simp add: power_eq_if distrib)
   53.76    finally show "?P (Suc n)" by simp
   53.77  qed
    54.1 --- a/src/HOL/Lambda/Type.thy	Fri Oct 05 21:50:37 2001 +0200
    54.2 +++ b/src/HOL/Lambda/Type.thy	Fri Oct 05 21:52:39 2001 +0200
    54.3 @@ -59,11 +59,11 @@
    54.4  
    54.5  subsection {* Some examples *}
    54.6  
    54.7 -lemma "e |- Abs (Abs (Abs (Var 1 $ (Var 2 $ Var 1 $ Var 0)))) : ?T"
    54.8 +lemma "e |- Abs (Abs (Abs (Var 1 $ (Var # 2 $ Var 1 $ Var 0)))) : ?T"
    54.9    apply force
   54.10    done
   54.11  
   54.12 -lemma "e |- Abs (Abs (Abs (Var 2 $ Var 0 $ (Var 1 $ Var 0)))) : ?T"
   54.13 +lemma "e |- Abs (Abs (Abs (Var # 2 $ Var 0 $ (Var 1 $ Var 0)))) : ?T"
   54.14    apply force
   54.15    done
   54.16  
   54.17 @@ -219,7 +219,7 @@
   54.18    "e |- t : T ==> \<forall>e' i U u.
   54.19      e = (\<lambda>j. if j < i then e' j
   54.20                else if j = i then U
   54.21 -              else e' (j-1)) -->
   54.22 +              else e' (j - 1)) -->
   54.23      e' |- u : U --> e' |- t[u/i] : T"
   54.24    apply (erule typing.induct)
   54.25      apply (intro strip)
    55.1 --- a/src/HOL/Library/Multiset.thy	Fri Oct 05 21:50:37 2001 +0200
    55.2 +++ b/src/HOL/Library/Multiset.thy	Fri Oct 05 21:52:39 2001 +0200
    55.3 @@ -28,7 +28,7 @@
    55.4    "{#} == Abs_multiset (\<lambda>a. 0)"
    55.5  
    55.6    single :: "'a => 'a multiset"    ("{#_#}")
    55.7 -  "{#a#} == Abs_multiset (\<lambda>b. if b = a then 1' else 0)"
    55.8 +  "{#a#} == Abs_multiset (\<lambda>b. if b = a then 1 else 0)"
    55.9  
   55.10    count :: "'a multiset => 'a => nat"
   55.11    "count == Rep_multiset"
   55.12 @@ -54,7 +54,7 @@
   55.13  defs (overloaded)
   55.14    union_def: "M + N == Abs_multiset (\<lambda>a. Rep_multiset M a + Rep_multiset N a)"
   55.15    diff_def: "M - N == Abs_multiset (\<lambda>a. Rep_multiset M a - Rep_multiset N a)"
   55.16 -  Zero_def [simp]: "0 == {#}"
   55.17 +  Zero_multiset_def [simp]: "0 == {#}"
   55.18    size_def: "size M == setsum (count M) (set_of M)"
   55.19  
   55.20  
   55.21 @@ -66,7 +66,7 @@
   55.22    apply (simp add: multiset_def)
   55.23    done
   55.24  
   55.25 -lemma only1_in_multiset [simp]: "(\<lambda>b. if b = a then 1' else 0) \<in> multiset"
   55.26 +lemma only1_in_multiset [simp]: "(\<lambda>b. if b = a then 1 else 0) \<in> multiset"
   55.27    apply (simp add: multiset_def)
   55.28    done
   55.29  
   55.30 @@ -139,7 +139,7 @@
   55.31    apply (simp add: count_def Mempty_def)
   55.32    done
   55.33  
   55.34 -theorem count_single [simp]: "count {#b#} a = (if b = a then 1' else 0)"
   55.35 +theorem count_single [simp]: "count {#b#} a = (if b = a then 1 else 0)"
   55.36    apply (simp add: count_def single_def)
   55.37    done
   55.38  
   55.39 @@ -319,8 +319,8 @@
   55.40  subsection {* Induction over multisets *}
   55.41  
   55.42  lemma setsum_decr:
   55.43 -  "finite F ==> 0 < f a ==>
   55.44 -    setsum (f (a := f a - 1')) F = (if a \<in> F then setsum f F - 1 else setsum f F)"
   55.45 +  "finite F ==> (0::nat) < f a ==>
   55.46 +    setsum (f (a := f a - 1)) F = (if a \<in> F then setsum f F - 1 else setsum f F)"
   55.47    apply (erule finite_induct)
   55.48     apply auto
   55.49    apply (drule_tac a = a in mk_disjoint_insert)
   55.50 @@ -328,7 +328,7 @@
   55.51    done
   55.52  
   55.53  lemma rep_multiset_induct_aux:
   55.54 -  "P (\<lambda>a. 0) ==> (!!f b. f \<in> multiset ==> P f ==> P (f (b := f b + 1')))
   55.55 +  "P (\<lambda>a. (0::nat)) ==> (!!f b. f \<in> multiset ==> P f ==> P (f (b := f b + 1)))
   55.56      ==> \<forall>f. f \<in> multiset --> setsum f {x. 0 < f x} = n --> P f"
   55.57  proof -
   55.58    case rule_context
   55.59 @@ -347,14 +347,14 @@
   55.60      apply (frule setsum_SucD)
   55.61      apply clarify
   55.62      apply (rename_tac a)
   55.63 -    apply (subgoal_tac "finite {x. 0 < (f (a := f a - 1')) x}")
   55.64 +    apply (subgoal_tac "finite {x. 0 < (f (a := f a - 1)) x}")
   55.65       prefer 2
   55.66       apply (rule finite_subset)
   55.67        prefer 2
   55.68        apply assumption
   55.69       apply simp
   55.70       apply blast
   55.71 -    apply (subgoal_tac "f = (f (a := f a - 1'))(a := (f (a := f a - 1')) a + 1')")
   55.72 +    apply (subgoal_tac "f = (f (a := f a - 1))(a := (f (a := f a - 1)) a + 1)")
   55.73       prefer 2
   55.74       apply (rule ext)
   55.75       apply (simp (no_asm_simp))
   55.76 @@ -362,7 +362,7 @@
   55.77       apply blast
   55.78      apply (erule allE, erule impE, erule_tac [2] mp)
   55.79       apply blast
   55.80 -    apply (simp (no_asm_simp) add: setsum_decr del: fun_upd_apply)
   55.81 +    apply (simp (no_asm_simp) add: setsum_decr del: fun_upd_apply One_nat_def)
   55.82      apply (subgoal_tac "{x. x \<noteq> a --> 0 < f x} = {x. 0 < f x}")
   55.83       prefer 2
   55.84       apply blast
   55.85 @@ -375,7 +375,7 @@
   55.86  
   55.87  theorem rep_multiset_induct:
   55.88    "f \<in> multiset ==> P (\<lambda>a. 0) ==>
   55.89 -    (!!f b. f \<in> multiset ==> P f ==> P (f (b := f b + 1'))) ==> P f"
   55.90 +    (!!f b. f \<in> multiset ==> P f ==> P (f (b := f b + 1))) ==> P f"
   55.91    apply (insert rep_multiset_induct_aux)
   55.92    apply blast
   55.93    done
   55.94 @@ -390,7 +390,7 @@
   55.95      apply (rule Rep_multiset_inverse [THEN subst])
   55.96      apply (rule Rep_multiset [THEN rep_multiset_induct])
   55.97       apply (rule prem1)
   55.98 -    apply (subgoal_tac "f (b := f b + 1') = (\<lambda>a. f a + (if a = b then 1' else 0))")
   55.99 +    apply (subgoal_tac "f (b := f b + 1) = (\<lambda>a. f a + (if a = b then 1 else 0))")
  55.100       prefer 2
  55.101       apply (simp add: expand_fun_eq)
  55.102      apply (erule ssubst)
    56.1 --- a/src/HOL/Library/Nat_Infinity.thy	Fri Oct 05 21:50:37 2001 +0200
    56.2 +++ b/src/HOL/Library/Nat_Infinity.thy	Fri Oct 05 21:52:39 2001 +0200
    56.3 @@ -31,14 +31,14 @@
    56.4    Infty :: inat    ("\<infinity>")
    56.5  
    56.6  defs
    56.7 -  iZero_def: "0 == Fin 0"
    56.8 +  Zero_inat_def: "0 == Fin 0"
    56.9    iSuc_def: "iSuc i == case i of Fin n  => Fin (Suc n) | \<infinity> => \<infinity>"
   56.10    iless_def: "m < n ==
   56.11      case m of Fin m1 => (case n of Fin n1 => m1 < n1 | \<infinity> => True)
   56.12      | \<infinity>  => False"
   56.13    ile_def: "(m::inat) \<le> n == \<not> (n < m)"
   56.14  
   56.15 -lemmas inat_defs = iZero_def iSuc_def iless_def ile_def
   56.16 +lemmas inat_defs = Zero_inat_def iSuc_def iless_def ile_def
   56.17  lemmas inat_splits = inat.split inat.split_asm
   56.18  
   56.19  text {*
    57.1 --- a/src/HOL/Library/Primes.thy	Fri Oct 05 21:50:37 2001 +0200
    57.2 +++ b/src/HOL/Library/Primes.thy	Fri Oct 05 21:52:39 2001 +0200
    57.3 @@ -54,7 +54,7 @@
    57.4  
    57.5  declare gcd.simps [simp del]
    57.6  
    57.7 -lemma gcd_1 [simp]: "gcd (m, 1') = 1"
    57.8 +lemma gcd_1 [simp]: "gcd (m, Suc 0) = 1"
    57.9    apply (simp add: gcd_non_0)
   57.10    done
   57.11  
   57.12 @@ -140,8 +140,8 @@
   57.13    apply (simp add: gcd_commute [of 0])
   57.14    done
   57.15  
   57.16 -lemma gcd_1_left [simp]: "gcd (1', m) = 1"
   57.17 -  apply (simp add: gcd_commute [of "1'"])
   57.18 +lemma gcd_1_left [simp]: "gcd (Suc 0, m) = 1"
   57.19 +  apply (simp add: gcd_commute [of "Suc 0"])
   57.20    done
   57.21  
   57.22  
   57.23 @@ -194,7 +194,7 @@
   57.24    apply (blast intro: relprime_dvd_mult prime_imp_relprime)
   57.25    done
   57.26  
   57.27 -lemma prime_dvd_square: "p \<in> prime ==> p dvd m^2 ==> p dvd m"
   57.28 +lemma prime_dvd_square: "p \<in> prime ==> p dvd m^Suc (Suc 0) ==> p dvd m"
   57.29    apply (auto dest: prime_dvd_mult)
   57.30    done
   57.31  
    58.1 --- a/src/HOL/Library/Rational_Numbers.thy	Fri Oct 05 21:50:37 2001 +0200
    58.2 +++ b/src/HOL/Library/Rational_Numbers.thy	Fri Oct 05 21:52:39 2001 +0200
    58.3 @@ -17,7 +17,7 @@
    58.4  
    58.5  typedef fraction = "{(a, b) :: int \<times> int | a b. b \<noteq> 0}"
    58.6  proof
    58.7 -  show "(0, #1) \<in> ?fraction" by simp
    58.8 +  show "(0, Numeral1) \<in> ?fraction" by simp
    58.9  qed
   58.10  
   58.11  constdefs
   58.12 @@ -140,7 +140,7 @@
   58.13  instance fraction :: ord ..
   58.14  
   58.15  defs (overloaded)
   58.16 -  zero_fraction_def: "0 == fract 0 #1"
   58.17 +  zero_fraction_def: "0 == fract 0 Numeral1"
   58.18    add_fraction_def: "Q + R ==
   58.19      fract (num Q * den R + num R * den Q) (den Q * den R)"
   58.20    minus_fraction_def: "-Q == fract (-(num Q)) (den Q)"
   58.21 @@ -386,9 +386,9 @@
   58.22    le_rat_def: "q \<le> r == fraction_of q \<le> fraction_of r"
   58.23    less_rat_def: "q < r == q \<le> r \<and> q \<noteq> (r::rat)"
   58.24    abs_rat_def: "\<bar>q\<bar> == if q < 0 then -q else (q::rat)"
   58.25 -  number_of_rat_def: "number_of b == Fract (number_of b) #1"
   58.26 +  number_of_rat_def: "number_of b == Fract (number_of b) Numeral1"
   58.27  
   58.28 -theorem zero_rat: "0 = Fract 0 #1"
   58.29 +theorem zero_rat: "0 = Fract 0 Numeral1"
   58.30    by (simp add: zero_rat_def zero_fraction_def rat_of_def Fract_def)
   58.31  
   58.32  theorem add_rat: "b \<noteq> 0 ==> d \<noteq> 0 ==>
   58.33 @@ -497,17 +497,17 @@
   58.34      by (induct q) (simp add: zero_rat minus_rat add_rat eq_rat)
   58.35    show "q - r = q + (-r)"
   58.36      by (induct q, induct r) (simp add: add_rat minus_rat diff_rat)
   58.37 -  show "(0::rat) = #0"
   58.38 +  show "(0::rat) = Numeral0"
   58.39      by (simp add: zero_rat number_of_rat_def)
   58.40    show "(q * r) * s = q * (r * s)"
   58.41      by (induct q, induct r, induct s) (simp add: mult_rat zmult_ac)
   58.42    show "q * r = r * q"
   58.43      by (induct q, induct r) (simp add: mult_rat zmult_ac)
   58.44 -  show "#1 * q = q"
   58.45 +  show "Numeral1 * q = q"
   58.46      by (induct q) (simp add: number_of_rat_def mult_rat)
   58.47    show "(q + r) * s = q * s + r * s"
   58.48      by (induct q, induct r, induct s) (simp add: add_rat mult_rat eq_rat int_distrib)
   58.49 -  show "q \<noteq> 0 ==> inverse q * q = #1"
   58.50 +  show "q \<noteq> 0 ==> inverse q * q = Numeral1"
   58.51      by (induct q) (simp add: inverse_rat mult_rat number_of_rat_def zero_rat eq_rat)
   58.52    show "r \<noteq> 0 ==> q / r = q * inverse r"
   58.53      by (induct q, induct r) (simp add: mult_rat divide_rat inverse_rat zero_rat eq_rat)
   58.54 @@ -630,15 +630,15 @@
   58.55  
   58.56  constdefs
   58.57    rat :: "int => rat"    (* FIXME generalize int to any numeric subtype *)
   58.58 -  "rat z == Fract z #1"
   58.59 +  "rat z == Fract z Numeral1"
   58.60    int_set :: "rat set"    ("\<int>")    (* FIXME generalize rat to any numeric supertype *)
   58.61    "\<int> == range rat"
   58.62  
   58.63  lemma rat_inject: "(rat z = rat w) = (z = w)"
   58.64  proof
   58.65    assume "rat z = rat w"
   58.66 -  hence "Fract z #1 = Fract w #1" by (unfold rat_def)
   58.67 -  hence "\<lfloor>fract z #1\<rfloor> = \<lfloor>fract w #1\<rfloor>" ..
   58.68 +  hence "Fract z Numeral1 = Fract w Numeral1" by (unfold rat_def)
   58.69 +  hence "\<lfloor>fract z Numeral1\<rfloor> = \<lfloor>fract w Numeral1\<rfloor>" ..
   58.70    thus "z = w" by auto
   58.71  next
   58.72    assume "z = w"
    59.1 --- a/src/HOL/Library/Ring_and_Field.thy	Fri Oct 05 21:50:37 2001 +0200
    59.2 +++ b/src/HOL/Library/Ring_and_Field.thy	Fri Oct 05 21:52:39 2001 +0200
    59.3 @@ -18,11 +18,11 @@
    59.4    left_zero [simp]: "0 + a = a"
    59.5    left_minus [simp]: "- a + a = 0"
    59.6    diff_minus: "a - b = a + (-b)"
    59.7 -  zero_number: "0 = #0"
    59.8 +  zero_number: "0 = Numeral0"
    59.9  
   59.10    mult_assoc: "(a * b) * c = a * (b * c)"
   59.11    mult_commute: "a * b = b * a"
   59.12 -  left_one [simp]: "#1 * a = a"
   59.13 +  left_one [simp]: "Numeral1 * a = a"
   59.14  
   59.15    left_distrib: "(a + b) * c = a * c + b * c"
   59.16  
   59.17 @@ -32,7 +32,7 @@
   59.18    abs_if: "\<bar>a\<bar> = (if a < 0 then -a else a)"
   59.19  
   59.20  axclass field \<subseteq> ring, inverse
   59.21 -  left_inverse [simp]: "a \<noteq> 0 ==> inverse a * a = #1"
   59.22 +  left_inverse [simp]: "a \<noteq> 0 ==> inverse a * a = Numeral1"
   59.23    divide_inverse: "b \<noteq> 0 ==> a / b = a * inverse b"
   59.24  
   59.25  axclass ordered_field \<subseteq> ordered_ring, field
   59.26 @@ -86,10 +86,10 @@
   59.27  
   59.28  subsubsection {* Derived rules for multiplication *}
   59.29  
   59.30 -lemma right_one [simp]: "a = a * (#1::'a::field)"
   59.31 +lemma right_one [simp]: "a = a * (Numeral1::'a::field)"
   59.32  proof -
   59.33 -  have "a = #1 * a" by simp
   59.34 -  also have "... = a * #1" by (simp add: mult_commute)
   59.35 +  have "a = Numeral1 * a" by simp
   59.36 +  also have "... = a * Numeral1" by (simp add: mult_commute)
   59.37    finally show ?thesis .
   59.38  qed
   59.39  
   59.40 @@ -102,28 +102,28 @@
   59.41  
   59.42  theorems ring_mult_ac = mult_assoc mult_commute mult_left_commute
   59.43  
   59.44 -lemma right_inverse [simp]: "a \<noteq> 0 ==>  a * inverse (a::'a::field) = #1" 
   59.45 +lemma right_inverse [simp]: "a \<noteq> 0 ==>  a * inverse (a::'a::field) = Numeral1" 
   59.46  proof -
   59.47    have "a * inverse a = inverse a * a" by (simp add: ring_mult_ac)
   59.48    also assume "a \<noteq> 0"
   59.49 -  hence "inverse a * a = #1" by simp
   59.50 +  hence "inverse a * a = Numeral1" by simp
   59.51    finally show ?thesis .
   59.52  qed
   59.53  
   59.54 -lemma right_inverse_eq: "b \<noteq> 0 ==> (a / b = #1) = (a = (b::'a::field))"
   59.55 +lemma right_inverse_eq: "b \<noteq> 0 ==> (a / b = Numeral1) = (a = (b::'a::field))"
   59.56  proof 
   59.57    assume neq: "b \<noteq> 0"
   59.58    {
   59.59      hence "a = (a / b) * b" by (simp add: divide_inverse ring_mult_ac)
   59.60 -    also assume "a / b = #1"
   59.61 +    also assume "a / b = Numeral1"
   59.62      finally show "a = b" by simp
   59.63    next
   59.64      assume "a = b"
   59.65 -    with neq show "a / b = #1" by (simp add: divide_inverse)
   59.66 +    with neq show "a / b = Numeral1" by (simp add: divide_inverse)
   59.67    }
   59.68  qed
   59.69  
   59.70 -lemma divide_self [simp]: "a \<noteq> 0 ==> a / (a::'a::field) = #1"
   59.71 +lemma divide_self [simp]: "a \<noteq> 0 ==> a / (a::'a::field) = Numeral1"
   59.72    by (simp add: divide_inverse)
   59.73  
   59.74  
    60.1 --- a/src/HOL/Library/Ring_and_Field_Example.thy	Fri Oct 05 21:50:37 2001 +0200
    60.2 +++ b/src/HOL/Library/Ring_and_Field_Example.thy	Fri Oct 05 21:52:39 2001 +0200
    60.3 @@ -13,8 +13,8 @@
    60.4    show "i - j = i + (-j)" by simp
    60.5    show "(i * j) * k = i * (j * k)" by simp
    60.6    show "i * j = j * i" by simp
    60.7 -  show "#1 * i = i" by simp
    60.8 -  show "0 = (#0::int)" by simp
    60.9 +  show "Numeral1 * i = i" by simp
   60.10 +  show "0 = (Numeral0::int)" by simp
   60.11    show "(i + j) * k = i * k + j * k" by (simp add: int_distrib)
   60.12    show "i \<le> j ==> k + i \<le> k + j" by simp
   60.13    show "i < j ==> 0 < k ==> k * i < k * j" by (simp add: zmult_zless_mono2)
    61.1 --- a/src/HOL/Library/While_Combinator.thy	Fri Oct 05 21:50:37 2001 +0200
    61.2 +++ b/src/HOL/Library/While_Combinator.thy	Fri Oct 05 21:52:39 2001 +0200
    61.3 @@ -22,9 +22,9 @@
    61.4  recdef (permissive) while_aux
    61.5    "same_fst (\<lambda>b. True) (\<lambda>b. same_fst (\<lambda>c. True) (\<lambda>c.
    61.6        {(t, s).  b s \<and> c s = t \<and>
    61.7 -        \<not> (\<exists>f. f 0 = s \<and> (\<forall>i. b (f i) \<and> c (f i) = f (i + 1)))}))"
    61.8 +        \<not> (\<exists>f. f (0::nat) = s \<and> (\<forall>i. b (f i) \<and> c (f i) = f (i + 1)))}))"
    61.9    "while_aux (b, c, s) =
   61.10 -    (if (\<exists>f. f 0 = s \<and> (\<forall>i. b (f i) \<and> c (f i) = f (i + 1)))
   61.11 +    (if (\<exists>f. f (0::nat) = s \<and> (\<forall>i. b (f i) \<and> c (f i) = f (i + 1)))
   61.12        then arbitrary
   61.13        else if b s then while_aux (b, c, c s)
   61.14        else s)"
   61.15 @@ -42,11 +42,10 @@
   61.16  
   61.17  lemma while_aux_unfold:
   61.18    "while_aux (b, c, s) =
   61.19 -    (if \<exists>f. f 0 = s \<and> (\<forall>i. b (f i) \<and> c (f i) = f (i + 1))
   61.20 +    (if \<exists>f. f (0::nat) = s \<and> (\<forall>i. b (f i) \<and> c (f i) = f (i + 1))
   61.21        then arbitrary
   61.22        else if b s then while_aux (b, c, c s)
   61.23        else s)"
   61.24 -thm while_aux.simps
   61.25    apply (rule while_aux_tc [THEN while_aux.simps [THEN trans]])
   61.26    apply (rule refl)
   61.27    done
   61.28 @@ -136,14 +135,14 @@
   61.29   theory.}
   61.30  *}
   61.31  
   61.32 -theorem "P (lfp (\<lambda>N::int set. {#0} \<union> {(n + #2) mod #6 | n. n \<in> N})) =
   61.33 -    P {#0, #4, #2}"
   61.34 +theorem "P (lfp (\<lambda>N::int set. {Numeral0} \<union> {(n + # 2) mod # 6 | n. n \<in> N})) =
   61.35 +    P {Numeral0, # 4, # 2}"
   61.36  proof -
   61.37    have aux: "!!f A B. {f n | n. A n \<or> B n} = {f n | n. A n} \<union> {f n | n. B n}"
   61.38      apply blast
   61.39      done
   61.40    show ?thesis
   61.41 -    apply (subst lfp_conv_while [where ?U = "{#0, #1, #2, #3, #4, #5}"])
   61.42 +    apply (subst lfp_conv_while [where ?U = "{Numeral0, Numeral1, # 2, # 3, # 4, # 5}"])
   61.43         apply (rule monoI)
   61.44        apply blast
   61.45       apply simp
    62.1 --- a/src/HOL/List.ML	Fri Oct 05 21:50:37 2001 +0200
    62.2 +++ b/src/HOL/List.ML	Fri Oct 05 21:52:39 2001 +0200
    62.3 @@ -1323,7 +1323,7 @@
    62.4  qed_spec_mp "hd_replicate";
    62.5  Addsimps [hd_replicate];
    62.6  
    62.7 -Goal "n ~= 0 --> tl(replicate n x) = replicate (n-1) x";
    62.8 +Goal "n ~= 0 --> tl(replicate n x) = replicate (n - 1) x";
    62.9  by (induct_tac "n" 1);
   62.10  by Auto_tac;
   62.11  qed_spec_mp "tl_replicate";
   62.12 @@ -1506,19 +1506,19 @@
   62.13  AddIffs (map rename_numerals
   62.14  	  [length_0_conv, length_greater_0_conv, sum_eq_0_conv]);
   62.15  
   62.16 -Goal "take n (x#xs) = (if n = #0 then [] else x # take (n-#1) xs)";
   62.17 +Goal "take n (x#xs) = (if n = Numeral0 then [] else x # take (n - Numeral1) xs)";
   62.18  by (case_tac "n" 1);
   62.19  by (ALLGOALS 
   62.20      (asm_simp_tac (simpset() addsimps [numeral_0_eq_0, numeral_1_eq_1])));
   62.21  qed "take_Cons'";
   62.22  
   62.23 -Goal "drop n (x#xs) = (if n = #0 then x#xs else drop (n-#1) xs)";
   62.24 +Goal "drop n (x#xs) = (if n = Numeral0 then x#xs else drop (n - Numeral1) xs)";
   62.25  by (case_tac "n" 1);
   62.26  by (ALLGOALS
   62.27      (asm_simp_tac (simpset() addsimps [numeral_0_eq_0, numeral_1_eq_1])));
   62.28  qed "drop_Cons'";
   62.29  
   62.30 -Goal "(x#xs)!n = (if n = #0 then x else xs!(n-#1))";
   62.31 +Goal "(x#xs)!n = (if n = Numeral0 then x else xs!(n - Numeral1))";
   62.32  by (case_tac "n" 1);
   62.33  by (ALLGOALS
   62.34      (asm_simp_tac (simpset() addsimps [numeral_0_eq_0, numeral_1_eq_1])));
    63.1 --- a/src/HOL/MicroJava/BV/JVM.thy	Fri Oct 05 21:50:37 2001 +0200
    63.2 +++ b/src/HOL/MicroJava/BV/JVM.thy	Fri Oct 05 21:52:39 2001 +0200
    63.3 @@ -22,7 +22,7 @@
    63.4    "wt_kil G C pTs rT mxs mxl ins ==
    63.5     bounded (\<lambda>n. succs (ins!n) n) (size ins) \<and> 0 < size ins \<and> 
    63.6     (let first  = Some ([],(OK (Class C))#((map OK pTs))@(replicate mxl Err));
    63.7 -        start  = OK first#(replicate (size ins-1) (OK None));
    63.8 +        start  = OK first#(replicate (size ins - 1) (OK None));
    63.9          result = kiljvm G mxs (1+size pTs+mxl) rT ins start
   63.10      in \<forall>n < size ins. result!n \<noteq> Err)"
   63.11  
   63.12 @@ -149,7 +149,7 @@
   63.13    ==> \<exists>phi. wt_method G C pTs rT maxs mxl bs phi"
   63.14  proof -
   63.15    let ?start = "OK (Some ([],(OK (Class C))#((map OK pTs))@(replicate mxl Err)))
   63.16 -                #(replicate (size bs-1) (OK None))"
   63.17 +                #(replicate (size bs - 1) (OK None))"
   63.18  
   63.19    assume wf:      "wf_prog wf_mb G"
   63.20    assume isclass: "is_class G C"
   63.21 @@ -318,7 +318,7 @@
   63.22      by (rule is_bcv_kiljvm)
   63.23  
   63.24    let ?start = "OK (Some ([],(OK (Class C))#((map OK pTs))@(replicate mxl Err)))
   63.25 -                #(replicate (size bs-1) (OK None))"
   63.26 +                #(replicate (size bs - 1) (OK None))"
   63.27  
   63.28    { fix l x
   63.29      have "set (replicate l x) \<subseteq> {x}"
    64.1 --- a/src/HOL/MicroJava/BV/Step.thy	Fri Oct 05 21:50:37 2001 +0200
    64.2 +++ b/src/HOL/MicroJava/BV/Step.thy	Fri Oct 05 21:52:39 2001 +0200
    64.3 @@ -114,26 +114,26 @@
    64.4  "succs (Invoke C mn fpTs) pc = [pc+1]"
    64.5  
    64.6  
    64.7 -lemma 1: "2 < length a ==> (\<exists>l l' l'' ls. a = l#l'#l''#ls)"
    64.8 +lemma 1: "Suc (Suc 0) < length a ==> (\<exists>l l' l'' ls. a = l#l'#l''#ls)"
    64.9  proof (cases a)
   64.10 -  fix x xs assume "a = x#xs" "2 < length a"
   64.11 +  fix x xs assume "a = x#xs" "Suc (Suc 0) < length a"
   64.12    thus ?thesis by - (cases xs, simp, cases "tl xs", auto)
   64.13  qed auto
   64.14  
   64.15 -lemma 2: "\<not>(2 < length a) ==> a = [] \<or> (\<exists> l. a = [l]) \<or> (\<exists> l l'. a = [l,l'])"
   64.16 +lemma 2: "\<not>(Suc (Suc 0) < length a) ==> a = [] \<or> (\<exists> l. a = [l]) \<or> (\<exists> l l'. a = [l,l'])"
   64.17  proof -;
   64.18 -  assume "\<not>(2 < length a)"
   64.19 -  hence "length a < (Suc 2)" by simp
   64.20 -  hence * : "length a = 0 \<or> length a = 1' \<or> length a = 2" 
   64.21 +  assume "\<not>(Suc (Suc 0) < length a)"
   64.22 +  hence "length a < Suc (Suc (Suc 0))" by simp
   64.23 +  hence * : "length a = 0 \<or> length a = Suc 0 \<or> length a = Suc (Suc 0)" 
   64.24      by (auto simp add: less_Suc_eq)
   64.25  
   64.26    { 
   64.27      fix x 
   64.28 -    assume "length x = 1'"
   64.29 +    assume "length x = Suc 0"
   64.30      hence "\<exists> l. x = [l]"  by - (cases x, auto)
   64.31    } note 0 = this
   64.32  
   64.33 -  have "length a = 2 ==> \<exists>l l'. a = [l,l']" by (cases a, auto dest: 0)
   64.34 +  have "length a = Suc (Suc 0) ==> \<exists>l l'. a = [l,l']" by (cases a, auto dest: 0)
   64.35    with * show ?thesis by (auto dest: 0)
   64.36  qed
   64.37  
   64.38 @@ -152,7 +152,7 @@
   64.39  
   64.40  lemma appStore[simp]:
   64.41  "(app (Store idx) G maxs rT (Some s)) = (\<exists> ts ST LT. s = (ts#ST,LT) \<and> idx < length LT)"
   64.42 -  by (cases s, cases "2 < length (fst s)", auto dest: 1 2 simp add: app_def)
   64.43 +  by (cases s, cases "Suc (Suc 0) < length (fst s)", auto dest: 1 2 simp add: app_def)
   64.44  
   64.45  lemma appLitPush[simp]:
   64.46  "(app (LitPush v) G maxs rT (Some s)) = (maxs < length (fst s) \<and> typeof (\<lambda>v. None) v \<noteq> None)"
   64.47 @@ -162,13 +162,13 @@
   64.48  "(app (Getfield F C) G maxs rT (Some s)) = 
   64.49   (\<exists> oT vT ST LT. s = (oT#ST, LT) \<and> is_class G C \<and>  
   64.50    field (G,C) F = Some (C,vT) \<and> G \<turnstile> oT \<preceq> (Class C))"
   64.51 -  by (cases s, cases "2 < length (fst s)", auto dest!: 1 2 simp add: app_def)
   64.52 +  by (cases s, cases "Suc (Suc 0) < length (fst s)", auto dest!: 1 2 simp add: app_def)
   64.53  
   64.54  lemma appPutField[simp]:
   64.55  "(app (Putfield F C) G maxs rT (Some s)) = 
   64.56   (\<exists> vT vT' oT ST LT. s = (vT#oT#ST, LT) \<and> is_class G C \<and> 
   64.57    field (G,C) F = Some (C, vT') \<and> G \<turnstile> oT \<preceq> (Class C) \<and> G \<turnstile> vT \<preceq> vT')"
   64.58 -  by (cases s, cases "2 < length (fst s)", auto dest!: 1 2 simp add: app_def)
   64.59 +  by (cases s, cases "Suc (Suc 0) < length (fst s)", auto dest!: 1 2 simp add: app_def)
   64.60  
   64.61  lemma appNew[simp]:
   64.62  "(app (New C) G maxs rT (Some s)) = (is_class G C \<and> maxs < length (fst s))"
   64.63 @@ -181,27 +181,27 @@
   64.64  
   64.65  lemma appPop[simp]:
   64.66  "(app Pop G maxs rT (Some s)) = (\<exists>ts ST LT. s = (ts#ST,LT))" 
   64.67 -  by (cases s, cases "2 < length (fst s)", auto dest: 1 2 simp add: app_def)
   64.68 +  by (cases s, cases "Suc (Suc 0) < length (fst s)", auto dest: 1 2 simp add: app_def)
   64.69  
   64.70  
   64.71  lemma appDup[simp]:
   64.72  "(app Dup G maxs rT (Some s)) = (\<exists>ts ST LT. s = (ts#ST,LT) \<and> maxs < Suc (length ST))" 
   64.73 -  by (cases s, cases "2 < length (fst s)", auto dest: 1 2 simp add: app_def)
   64.74 +  by (cases s, cases "Suc (Suc 0) < length (fst s)", auto dest: 1 2 simp add: app_def)
   64.75  
   64.76  
   64.77  lemma appDup_x1[simp]:
   64.78  "(app Dup_x1 G maxs rT (Some s)) = (\<exists>ts1 ts2 ST LT. s = (ts1#ts2#ST,LT) \<and> maxs < Suc (Suc (length ST)))" 
   64.79 -  by (cases s, cases "2 < length (fst s)", auto dest: 1 2 simp add: app_def)
   64.80 +  by (cases s, cases "Suc (Suc 0) < length (fst s)", auto dest: 1 2 simp add: app_def)
   64.81  
   64.82  
   64.83  lemma appDup_x2[simp]:
   64.84  "(app Dup_x2 G maxs rT (Some s)) = (\<exists>ts1 ts2 ts3 ST LT. s = (ts1#ts2#ts3#ST,LT) \<and> maxs < Suc (Suc (Suc (length ST))))"
   64.85 -  by (cases s, cases "2 < length (fst s)", auto dest: 1 2 simp add: app_def)
   64.86 +  by (cases s, cases "Suc (Suc 0) < length (fst s)", auto dest: 1 2 simp add: app_def)
   64.87  
   64.88  
   64.89  lemma appSwap[simp]:
   64.90  "app Swap G maxs rT (Some s) = (\<exists>ts1 ts2 ST LT. s = (ts1#ts2#ST,LT))" 
   64.91 -  by (cases s, cases "2 < length (fst s)", auto dest: 1 2 simp add: app_def)
   64.92 +  by (cases s, cases "Suc (Suc 0) < length (fst s)", auto dest: 1 2 simp add: app_def)
   64.93  
   64.94  
   64.95  lemma appIAdd[simp]:
   64.96 @@ -238,12 +238,12 @@
   64.97  lemma appIfcmpeq[simp]:
   64.98  "app (Ifcmpeq b) G maxs rT (Some s) = (\<exists>ts1 ts2 ST LT. s = (ts1#ts2#ST,LT) \<and> 
   64.99   ((\<exists> p. ts1 = PrimT p \<and> ts2 = PrimT p) \<or> (\<exists>r r'. ts1 = RefT r \<and> ts2 = RefT r')))" 
  64.100 -  by (cases s, cases "2 < length (fst s)", auto dest: 1 2 simp add: app_def)
  64.101 +  by (cases s, cases "Suc (Suc 0) < length (fst s)", auto dest: 1 2 simp add: app_def)
  64.102  
  64.103  
  64.104  lemma appReturn[simp]:
  64.105  "app Return G maxs rT (Some s) = (\<exists>T ST LT. s = (T#ST,LT) \<and> (G \<turnstile> T \<preceq> rT))" 
  64.106 -  by (cases s, cases "2 < length (fst s)", auto dest: 1 2 simp add: app_def)
  64.107 +  by (cases s, cases "Suc (Suc 0) < length (fst s)", auto dest: 1 2 simp add: app_def)
  64.108  
  64.109  lemma appGoto[simp]:
  64.110  "app (Goto branch) G maxs rT (Some s) = True"
    65.1 --- a/src/HOL/MicroJava/J/Example.thy	Fri Oct 05 21:50:37 2001 +0200
    65.2 +++ b/src/HOL/MicroJava/J/Example.thy	Fri Oct 05 21:52:39 2001 +0200
    65.3 @@ -100,7 +100,7 @@
    65.4  			     [(vee, PrimT Boolean)], 
    65.5  			     [((foo,[Class Base]),Class Base,foo_Base)]))"
    65.6    foo_Ext_def:"foo_Ext == ([x],[],Expr( {Ext}Cast Ext
    65.7 -				       (LAcc x)..vee:=Lit (Intg #1)),
    65.8 +				       (LAcc x)..vee:=Lit (Intg Numeral1)),
    65.9  				   Lit Null)"
   65.10    ExtC_def: "ExtC  == (Ext,  (Base  , 
   65.11  			     [(vee, PrimT Integer)], 
   65.12 @@ -127,7 +127,7 @@
   65.13    "NP"   == "NullPointer"
   65.14    "tprg" == "[ObjectC, BaseC, ExtC]"
   65.15    "obj1"    <= "(Ext, empty((vee, Base)\<mapsto>Bool False)
   65.16 -			   ((vee, Ext )\<mapsto>Intg #0))"
   65.17 +			   ((vee, Ext )\<mapsto>Intg Numeral0))"
   65.18    "s0" == " Norm    (empty, empty)"
   65.19    "s1" == " Norm    (empty(a\<mapsto>obj1),empty(e\<mapsto>Addr a))"
   65.20    "s2" == " Norm    (empty(a\<mapsto>obj1),empty(x\<mapsto>Null)(This\<mapsto>Addr a))"
    66.1 --- a/src/HOL/MicroJava/J/Value.thy	Fri Oct 05 21:50:37 2001 +0200
    66.2 +++ b/src/HOL/MicroJava/J/Value.thy	Fri Oct 05 21:52:39 2001 +0200
    66.3 @@ -40,7 +40,7 @@
    66.4  primrec
    66.5    "defpval Void    = Unit"
    66.6    "defpval Boolean = Bool False"
    66.7 -  "defpval Integer = Intg (#0)"
    66.8 +  "defpval Integer = Intg (Numeral0)"
    66.9  
   66.10  primrec
   66.11    "default_val (PrimT pt) = defpval pt"
    67.1 --- a/src/HOL/Nat.ML	Fri Oct 05 21:50:37 2001 +0200
    67.2 +++ b/src/HOL/Nat.ML	Fri Oct 05 21:52:39 2001 +0200
    67.3 @@ -68,7 +68,7 @@
    67.4  by Auto_tac;
    67.5  qed "less_Suc_eq_0_disj";
    67.6  
    67.7 -val prems = Goal "[| P 0; P(1'); !!k. P k ==> P (Suc (Suc k)) |] ==> P n";
    67.8 +val prems = Goal "[| P 0; P(Suc 0); !!k. P k ==> P (Suc (Suc k)) |] ==> P n";
    67.9  by (rtac nat_less_induct 1);
   67.10  by (case_tac "n" 1);
   67.11  by (case_tac "nat" 2);
   67.12 @@ -157,7 +157,7 @@
   67.13  (* Could be (and is, below) generalized in various ways;
   67.14     However, none of the generalizations are currently in the simpset,
   67.15     and I dread to think what happens if I put them in *)
   67.16 -Goal "0 < n ==> Suc(n-1') = n";
   67.17 +Goal "0 < n ==> Suc(n - Suc 0) = n";
   67.18  by (asm_simp_tac (simpset() addsplits [nat.split]) 1);
   67.19  qed "Suc_pred";
   67.20  Addsimps [Suc_pred];
   67.21 @@ -238,12 +238,12 @@
   67.22  qed "add_is_0";
   67.23  AddIffs [add_is_0];
   67.24  
   67.25 -Goal "(m+n=1') = (m=1' & n=0 | m=0 & n=1')";
   67.26 +Goal "(m+n= Suc 0) = (m= Suc 0 & n=0 | m=0 & n= Suc 0)";
   67.27  by (case_tac "m" 1);
   67.28  by (Auto_tac);
   67.29  qed "add_is_1";
   67.30  
   67.31 -Goal "(1' = m+n) = (m=1' & n=0 | m=0 & n=1')";
   67.32 +Goal "(Suc 0 = m+n) = (m=Suc 0 & n=0 | m=0 & n= Suc 0)";
   67.33  by (case_tac "m" 1);
   67.34  by (Auto_tac);
   67.35  qed "one_is_add";
   67.36 @@ -396,11 +396,11 @@
   67.37  
   67.38  Addsimps [mult_0_right, mult_Suc_right];
   67.39  
   67.40 -Goal "1 * n = n";
   67.41 +Goal "(1::nat) * n = n";
   67.42  by (Asm_simp_tac 1);
   67.43  qed "mult_1";
   67.44  
   67.45 -Goal "n * 1 = n";
   67.46 +Goal "n * (1::nat) = n";
   67.47  by (Asm_simp_tac 1);
   67.48  qed "mult_1_right";
   67.49  
   67.50 @@ -638,14 +638,14 @@
   67.51  qed "zero_less_mult_iff";
   67.52  Addsimps [zero_less_mult_iff];
   67.53  
   67.54 -Goal "(1' <= m*n) = (1<=m & 1<=n)";
   67.55 +Goal "(Suc 0 <= m*n) = (1<=m & 1<=n)";
   67.56  by (induct_tac "m" 1);
   67.57  by (case_tac "n" 2);
   67.58  by (ALLGOALS Asm_simp_tac);
   67.59  qed "one_le_mult_iff";
   67.60  Addsimps [one_le_mult_iff];
   67.61  
   67.62 -Goal "(m*n = 1') = (m=1 & n=1)";
   67.63 +Goal "(m*n = Suc 0) = (m=1 & n=1)";
   67.64  by (induct_tac "m" 1);
   67.65  by (Simp_tac 1);
   67.66  by (induct_tac "n" 1);
   67.67 @@ -654,7 +654,7 @@
   67.68  qed "mult_eq_1_iff";
   67.69  Addsimps [mult_eq_1_iff];
   67.70  
   67.71 -Goal "(1' = m*n) = (m=1 & n=1)";
   67.72 +Goal "(Suc 0 = m*n) = (m=1 & n=1)";
   67.73  by(rtac (mult_eq_1_iff RSN (2,trans)) 1);
   67.74  by (fast_tac (claset() addss simpset()) 1);
   67.75  qed "one_eq_mult_iff";
    68.1 --- a/src/HOL/NatArith.ML	Fri Oct 05 21:50:37 2001 +0200
    68.2 +++ b/src/HOL/NatArith.ML	Fri Oct 05 21:52:39 2001 +0200
    68.3 @@ -96,17 +96,17 @@
    68.4  
    68.5  (** Lemmas for ex/Factorization **)
    68.6  
    68.7 -Goal "!!m::nat. [| 1' < n; 1' < m |] ==> 1' < m*n";
    68.8 +Goal "!!m::nat. [| Suc 0 < n; Suc 0 < m |] ==> Suc 0 < m*n";
    68.9  by (case_tac "m" 1);
   68.10  by Auto_tac;
   68.11  qed "one_less_mult"; 
   68.12  
   68.13 -Goal "!!m::nat. [| 1' < n; 1' < m |] ==> n<m*n";
   68.14 +Goal "!!m::nat. [| Suc 0 < n; Suc 0 < m |] ==> n<m*n";
   68.15  by (case_tac "m" 1);
   68.16  by Auto_tac;
   68.17  qed "n_less_m_mult_n"; 
   68.18  
   68.19 -Goal "!!m::nat. [| 1' < n; 1' < m |] ==> n<n*m";
   68.20 +Goal "!!m::nat. [| Suc 0 < n; Suc 0 < m |] ==> n<n*m";
   68.21  by (case_tac "m" 1);
   68.22  by Auto_tac;
   68.23  qed "n_less_n_mult_m"; 
    69.1 --- a/src/HOL/NatDef.ML	Fri Oct 05 21:50:37 2001 +0200
    69.2 +++ b/src/HOL/NatDef.ML	Fri Oct 05 21:52:39 2001 +0200
    69.3 @@ -4,13 +4,13 @@
    69.4      Copyright   1991  University of Cambridge
    69.5  *)
    69.6  
    69.7 -Addsimps [One_def];
    69.8 +Addsimps [One_nat_def];
    69.9  
   69.10  val rew = rewrite_rule [symmetric Nat_def];
   69.11  
   69.12  (*** Induction ***)
   69.13  
   69.14 -val prems = Goalw [Zero_def,Suc_def]
   69.15 +val prems = Goalw [Zero_nat_def,Suc_def]
   69.16      "[| P(0);   \
   69.17  \       !!n. P(n) ==> P(Suc(n)) |]  ==> P(n)";
   69.18  by (rtac (Rep_Nat_inverse RS subst) 1);   (*types force good instantiation*)
   69.19 @@ -53,7 +53,7 @@
   69.20  
   69.21  (*** Distinctness of constructors ***)
   69.22  
   69.23 -Goalw [Zero_def,Suc_def] "Suc(m) ~= 0";
   69.24 +Goalw [Zero_nat_def,Suc_def] "Suc(m) ~= 0";
   69.25  by (rtac (inj_on_Abs_Nat RS inj_on_contraD) 1);
   69.26  by (rtac Suc_Rep_not_Zero_Rep 1);
   69.27  by (REPEAT (resolve_tac [Rep_Nat, rew Nat'.Suc_RepI, rew Nat'.Zero_RepI] 1));
   69.28 @@ -191,7 +191,7 @@
   69.29  by (blast_tac (claset() addSEs [less_SucE] addIs [less_trans]) 1);
   69.30  qed "less_Suc_eq";
   69.31  
   69.32 -Goal "(n<1) = (n=0)";
   69.33 +Goal "(n < (1::nat)) = (n = 0)";
   69.34  by (simp_tac (simpset() addsimps [less_Suc_eq]) 1);
   69.35  qed "less_one";
   69.36  AddIffs [less_one];
   69.37 @@ -462,12 +462,13 @@
   69.38  qed "zero_reorient";
   69.39  Addsimps [zero_reorient];
   69.40  
   69.41 +(*Polymorphic, not just for "nat"*)
   69.42  Goal "True ==> (1 = x) = (x = 1)";
   69.43  by Auto_tac;  
   69.44  qed "one_reorient";
   69.45  Addsimps [one_reorient];
   69.46  
   69.47 -Goal "True ==> (2 = x) = (x = 2)";
   69.48 -by Auto_tac;  
   69.49 +Goal "True ==> (Suc (Suc 0) = x) = (x = Suc (Suc 0))";  (* FIXME !? *)
   69.50 +by Auto_tac;
   69.51  qed "two_reorient";
   69.52  Addsimps [two_reorient];
    70.1 --- a/src/HOL/NatDef.thy	Fri Oct 05 21:50:37 2001 +0200
    70.2 +++ b/src/HOL/NatDef.thy	Fri Oct 05 21:52:39 2001 +0200
    70.3 @@ -47,7 +47,7 @@
    70.4    nat = "Nat'"   (Nat'.Zero_RepI)
    70.5  
    70.6  instance
    70.7 -  nat :: {ord, zero}
    70.8 +  nat :: {ord, zero, one}
    70.9  
   70.10  
   70.11  (* abstract constants and syntax *)
   70.12 @@ -55,23 +55,13 @@
   70.13  consts
   70.14    Suc       :: nat => nat
   70.15    pred_nat  :: "(nat * nat) set"
   70.16 -  "1"       :: nat                ("1")
   70.17 -
   70.18 -syntax
   70.19 -  "1'"       :: nat                ("1'")
   70.20 -  "2"       :: nat                ("2")
   70.21 -
   70.22 -translations
   70.23 -  "1'"  == "Suc 0"
   70.24 -  "2"  == "Suc 1'"
   70.25 -
   70.26  
   70.27  local
   70.28  
   70.29  defs
   70.30 -  Zero_def      "0 == Abs_Nat(Zero_Rep)"
   70.31 +  Zero_nat_def  "0 == Abs_Nat(Zero_Rep)"
   70.32    Suc_def       "Suc == (%n. Abs_Nat(Suc_Rep(Rep_Nat(n))))"
   70.33 -  One_def	"1 == 1'"
   70.34 +  One_nat_def	"1 == Suc 0"
   70.35  
   70.36    (*nat operations*)
   70.37    pred_nat_def  "pred_nat == {(m,n). n = Suc m}"
    71.1 --- a/src/HOL/NumberTheory/Chinese.thy	Fri Oct 05 21:50:37 2001 +0200
    71.2 +++ b/src/HOL/NumberTheory/Chinese.thy	Fri Oct 05 21:52:39 2001 +0200
    71.3 @@ -45,26 +45,26 @@
    71.4  defs
    71.5    m_cond_def:
    71.6      "m_cond n mf ==
    71.7 -      (\<forall>i. i \<le> n --> #0 < mf i) \<and>
    71.8 -      (\<forall>i j. i \<le> n \<and> j \<le> n \<and> i \<noteq> j --> zgcd (mf i, mf j) = #1)"
    71.9 +      (\<forall>i. i \<le> n --> Numeral0 < mf i) \<and>
   71.10 +      (\<forall>i j. i \<le> n \<and> j \<le> n \<and> i \<noteq> j --> zgcd (mf i, mf j) = Numeral1)"
   71.11  
   71.12    km_cond_def:
   71.13 -    "km_cond n kf mf == \<forall>i. i \<le> n --> zgcd (kf i, mf i) = #1"
   71.14 +    "km_cond n kf mf == \<forall>i. i \<le> n --> zgcd (kf i, mf i) = Numeral1"
   71.15  
   71.16    lincong_sol_def:
   71.17      "lincong_sol n kf bf mf x == \<forall>i. i \<le> n --> zcong (kf i * x) (bf i) (mf i)"
   71.18  
   71.19    mhf_def:
   71.20      "mhf mf n i ==
   71.21 -      if i = 0 then funprod mf 1' (n - 1')
   71.22 -      else if i = n then funprod mf 0 (n - 1')
   71.23 -      else funprod mf 0 (i - 1') * funprod mf (Suc i) (n - 1' - i)"
   71.24 +      if i = 0 then funprod mf (Suc 0) (n - Suc 0)
   71.25 +      else if i = n then funprod mf 0 (n - Suc 0)
   71.26 +      else funprod mf 0 (i - Suc 0) * funprod mf (Suc i) (n - Suc 0 - i)"
   71.27  
   71.28    xilin_sol_def:
   71.29      "xilin_sol i n kf bf mf ==
   71.30        if 0 < n \<and> i \<le> n \<and> m_cond n mf \<and> km_cond n kf mf then
   71.31 -        (SOME x. #0 \<le> x \<and> x &l