re-orienting equations with 0, 1, 2 on the lhs
authorpaulson
Tue, 19 Dec 2000 15:20:23 +0100
changeset 10706 f02834001fca
parent 10705 58c3c00d9fdf
child 10707 9285b4d87d7d
re-orienting equations with 0, 1, 2 on the lhs
src/HOL/NatDef.ML
--- a/src/HOL/NatDef.ML	Tue Dec 19 15:19:12 2000 +0100
+++ b/src/HOL/NatDef.ML	Tue Dec 19 15:20:23 2000 +0100
@@ -521,3 +521,24 @@
 by (Force_tac 1);
 by (force_tac (claset(), simpset() addsimps [less_eq,not_le_iff_less]) 1);
 qed "nonempty_has_least";
+
+(** Re-orientation of the equations 0=x and Suc n = x. *
+
+  The condition "True" is a hack to prevent looping for e.g. Suc m = Suc n.
+  Conditional rewrite rules are tried after unconditional ones.
+**)
+
+Goal "True ==> (0 = x) = (x = (0::nat))";
+by Auto_tac;  
+qed "zero_reorient";
+Addsimps [zero_reorient];
+
+Goal "True ==> (1 = x) = (x = 1)";
+by Auto_tac;  
+qed "one_reorient";
+Addsimps [one_reorient];
+
+Goal "True ==> (2 = x) = (x = 2)";
+by Auto_tac;  
+qed "two_reorient";
+Addsimps [two_reorient];