--- a/src/HOL/ex/NatSum.thy Fri Oct 05 23:58:52 2001 +0200
+++ b/src/HOL/ex/NatSum.thy Sat Oct 06 00:02:46 2001 +0200
@@ -36,8 +36,8 @@
*}
lemma sum_of_odd_squares:
- "# 3 * setsum (\<lambda>i. Suc (i + i) * Suc (i + i)) (lessThan n) =
- n * (# 4 * n * n - Numeral1)"
+ "3 * setsum (\<lambda>i. Suc (i + i) * Suc (i + i)) (lessThan n) =
+ n * (4 * n * n - Numeral1)"
apply (induct n)
txt {* This removes the @{term "-Numeral1"} from the inductive step *}
apply (case_tac [2] n)
@@ -51,7 +51,7 @@
lemma sum_of_odd_cubes:
"setsum (\<lambda>i. Suc (i + i) * Suc (i + i) * Suc (i + i)) (lessThan n) =
- n * n * (# 2 * n * n - Numeral1)"
+ n * n * (2 * n * n - Numeral1)"
apply (induct "n")
txt {* This removes the @{term "-Numeral1"} from the inductive step *}
apply (case_tac [2] "n")
@@ -63,19 +63,19 @@
@{text "n (n + 1) / 2"}.*}
lemma sum_of_naturals:
- "# 2 * setsum id (atMost n) = n * Suc n"
+ "2 * setsum id (atMost n) = n * Suc n"
apply (induct n)
apply auto
done
lemma sum_of_squares:
- "# 6 * setsum (\<lambda>i. i * i) (atMost n) = n * Suc n * Suc (# 2 * n)"
+ "6 * setsum (\<lambda>i. i * i) (atMost n) = n * Suc n * Suc (2 * n)"
apply (induct n)
apply auto
done
lemma sum_of_cubes:
- "# 4 * setsum (\<lambda>i. i * i * i) (atMost n) = n * n * Suc n * Suc n"
+ "4 * setsum (\<lambda>i. i * i * i) (atMost n) = n * n * Suc n * Suc n"
apply (induct n)
apply auto
done
@@ -86,8 +86,8 @@
*}
lemma sum_of_fourth_powers:
- "# 30 * setsum (\<lambda>i. i * i * i * i) (atMost n) =
- n * Suc n * Suc (# 2 * n) * (# 3 * n * n + # 3 * n - Numeral1)"
+ "30 * setsum (\<lambda>i. i * i * i * i) (atMost n) =
+ n * Suc n * Suc (2 * n) * (3 * n * n + 3 * n - Numeral1)"
apply (induct n)
apply auto
txt {* Eliminates the subtraction *}
@@ -107,9 +107,9 @@
zdiff_zmult_distrib2 [simp]
lemma int_sum_of_fourth_powers:
- "# 30 * int (setsum (\<lambda>i. i * i * i * i) (lessThan m)) =
- int m * (int m - Numeral1) * (int (# 2 * m) - Numeral1) *
- (int (# 3 * m * m) - int (# 3 * m) - Numeral1)"
+ "30 * int (setsum (\<lambda>i. i * i * i * i) (lessThan m)) =
+ int m * (int m - Numeral1) * (int (2 * m) - Numeral1) *
+ (int (3 * m * m) - int (3 * m) - Numeral1)"
apply (induct m)
apply simp_all
done
@@ -118,12 +118,12 @@
text {*
\medskip Sums of geometric series: 2, 3 and the general case *}
-lemma sum_of_2_powers: "setsum (\<lambda>i. # 2^i) (lessThan n) = # 2^n - (1::nat)"
+lemma sum_of_2_powers: "setsum (\<lambda>i. 2^i) (lessThan n) = 2^n - (1::nat)"
apply (induct n)
apply (auto split: nat_diff_split)
done
-lemma sum_of_3_powers: "# 2 * setsum (\<lambda>i. # 3^i) (lessThan n) = # 3^n - (1::nat)"
+lemma sum_of_3_powers: "2 * setsum (\<lambda>i. 3^i) (lessThan n) = 3^n - (1::nat)"
apply (induct n)
apply auto
done