author paulson Tue, 02 May 2000 18:45:17 +0200 changeset 8778 268195e8c017 parent 8777 0c1061ea7559 child 8779 2d4afbc46801
Cassini identity is easier to prove using INTEGERS
 src/HOL/ex/Fib.ML file | annotate | diff | comparison | revisions
```--- a/src/HOL/ex/Fib.ML	Tue May 02 18:44:33 2000 +0200
+++ b/src/HOL/ex/Fib.ML	Tue May 02 18:45:17 2000 +0200
@@ -47,26 +47,21 @@
by Auto_tac;
qed "fib_gr_0";

-
-(*Concrete Mathematics, page 278: Cassini's identity*)
-Goal "fib (Suc (Suc n)) * fib n = \
-\     (if n mod 2 = 0 then (fib(Suc n) * fib(Suc n)) - 1 \
-\                     else Suc (fib(Suc n) * fib(Suc n)))";
+(*Concrete Mathematics, page 278: Cassini's identity.
+  It is much easier to prove using integers!*)
+Goal "int (fib (Suc (Suc n)) * fib n) = \
+\     (if n mod 2 = 0 then int (fib(Suc n) * fib(Suc n)) - #1 \
+\                     else int (fib(Suc n) * fib(Suc n)) + #1)";
by (res_inst_tac [("u","n")] fib.induct 1);
-by (res_inst_tac [("P", "%z. ?ff(x) * z = ?kk(x)")] (fib_Suc_Suc RS ssubst) 3);
-by (stac (read_instantiate [("x", "Suc(Suc ?n)")] fib_Suc_Suc) 3);
-by (stac fib_Suc3 3);
-by (ALLGOALS  (*using [fib_Suc_Suc] here results in a longer proof!*)
-				       mod_Suc])));
+by (simp_tac (simpset() addsimps [fib_Suc_Suc, mod_Suc]) 2);
+by (simp_tac (simpset() addsimps [fib_Suc_Suc]) 1);
by (asm_full_simp_tac