# HG changeset patch # User wenzelm # Date 1573211259 -3600 # Node ID 950e1cfe0fe46e4c5c69311df46db2eeed1fcd55 # Parent 995fe5877d53550f8bd74c906746d7c129ccefd3 tuned proofs -- more stable proof terms without [rule_format]; diff -r 995fe5877d53 -r 950e1cfe0fe4 src/ZF/Nat.thy --- a/src/ZF/Nat.thy Thu Nov 07 16:03:26 2019 +0100 +++ b/src/ZF/Nat.thy Fri Nov 08 12:07:39 2019 +0100 @@ -155,26 +155,21 @@ lemmas complete_induct = Ord_induct [OF _ Ord_nat, case_names less, consumes 1] -lemmas complete_induct_rule = - complete_induct [rule_format, case_names less, consumes 1] - - -lemma nat_induct_from_lemma [rule_format]: - "[| n \ nat; m \ nat; - !!x. [| x \ nat; m \ x; P(x) |] ==> P(succ(x)) |] - ==> m \ n \ P(m) \ P(n)" -apply (erule nat_induct) -apply (simp_all add: distrib_simps le0_iff le_succ_iff) -done +lemma complete_induct_rule [case_names less, consumes 1]: + "i \ nat \ (\x. x \ nat \ (\y. y \ x \ P(y)) \ P(x)) \ P(i)" + using complete_induct [of i P] by simp (*Induction starting from m rather than 0*) lemma nat_induct_from: - "[| m \ n; m \ nat; n \ nat; - P(m); - !!x. [| x \ nat; m \ x; P(x) |] ==> P(succ(x)) |] - ==> P(n)" -apply (blast intro: nat_induct_from_lemma) -done + assumes "m \ n" "m \ nat" "n \ nat" + and "P(m)" + and "!!x. [| x \ nat; m \ x; P(x) |] ==> P(succ(x))" + shows "P(n)" +proof - + from assms(3) have "m \ n \ P(m) \ P(n)" + by (rule nat_induct) (use assms(5) in \simp_all add: distrib_simps le_succ_iff\) + with assms(1,2,4) show ?thesis by blast +qed (*Induction suitable for subtraction and less-than*) lemma diff_induct [case_names 0 0_succ succ_succ, consumes 2]: diff -r 995fe5877d53 -r 950e1cfe0fe4 src/ZF/Ordinal.thy --- a/src/ZF/Ordinal.thy Thu Nov 07 16:03:26 2019 +0100 +++ b/src/ZF/Ordinal.thy Fri Nov 08 12:07:39 2019 +0100 @@ -329,17 +329,16 @@ done (*Induction over an ordinal*) -lemmas Ord_induct [consumes 2] = Transset_induct [rule_format, OF _ Ord_is_Transset] +lemma Ord_induct [consumes 2]: + "i \ k \ Ord(k) \ (\x. x \ k \ (\y. y \ x \ P(y)) \ P(x)) \ P(i)" + using Transset_induct [OF _ Ord_is_Transset, of i k P] by simp (*Induction over the class of ordinals -- a useful corollary of Ord_induct*) - -lemma trans_induct [rule_format, consumes 1, case_names step]: - "[| Ord(i); - !!x.[| Ord(x); \y\x. P(y) |] ==> P(x) |] - ==> P(i)" -apply (rule Ord_succ [THEN succI1 [THEN Ord_induct]], assumption) -apply (blast intro: Ord_succ [THEN Ord_in_Ord]) -done +lemma trans_induct [consumes 1, case_names step]: + "Ord(i) \ (\x. Ord(x) \ (\y. y \ x \ P(y)) \ P(x)) \ P(i)" + apply (rule Ord_succ [THEN succI1 [THEN Ord_induct]], assumption) + apply (blast intro: Ord_succ [THEN Ord_in_Ord]) + done section\Fundamental properties of the epsilon ordering (< on ordinals)\ @@ -716,7 +715,9 @@ apply (erule Ord_cases, blast+) done -lemmas trans_induct3 = trans_induct3_raw [rule_format, case_names 0 succ limit, consumes 1] +lemma trans_induct3 [case_names 0 succ limit, consumes 1]: + "Ord(i) \ P(0) \ (\x. Ord(x) \ P(x) \ P(succ(x))) \ (\x. Limit(x) \ (\y. y \ x \ P(y)) \ P(x)) \ P(i)" + using trans_induct3_raw [of i P] by simp text\A set of ordinals is either empty, contains its own union, or its union is a limit ordinal.\ @@ -756,7 +757,7 @@ lemma Ord_Union_eq_succD: "[|\x\X. Ord(x); \X = succ(j)|] ==> succ(j) \ X" by (drule Ord_set_cases, auto) -lemma Limit_Union [rule_format]: "[| I \ 0; \i\I. Limit(i) |] ==> Limit(\I)" +lemma Limit_Union [rule_format]: "[| I \ 0; (\i. i\I \ Limit(i)) |] ==> Limit(\I)" apply (simp add: Limit_def lt_def) apply (blast intro!: equalityI) done diff -r 995fe5877d53 -r 950e1cfe0fe4 src/ZF/WF.thy --- a/src/ZF/WF.thy Thu Nov 07 16:03:26 2019 +0100 +++ b/src/ZF/WF.thy Fri Nov 08 12:07:39 2019 +0100 @@ -137,9 +137,9 @@ apply (rule field_Int_square, blast) done -lemmas wf_on_induct = - wf_on_induct_raw [rule_format, consumes 2, case_names step, induct set: wf_on] - +lemma wf_on_induct [consumes 2, case_names step, induct set: wf_on]: + "wf[A](r) \ a \ A \ (\x. x \ A \ (\y. y \ A \ \y, x\ \ r \ P(y)) \ P(x)) \ P(a)" + using wf_on_induct_raw [of A r a P] by simp text\If \<^term>\r\ allows well-founded induction then we have \<^term>\wf(r)\.\ @@ -169,8 +169,9 @@ lemma wf_on_not_refl: "[| wf[A](r); a \ A |] ==> \ r" by (erule_tac a=a in wf_on_induct, assumption, blast) -lemma wf_on_not_sym [rule_format]: - "[| wf[A](r); a \ A |] ==> \b\A. :r \ \r" +lemma wf_on_not_sym: + "[| wf[A](r); a \ A |] ==> (\b. b\A \ :r \ \r)" +apply (atomize (full), intro impI) apply (erule_tac a=a in wf_on_induct, assumption, blast) done diff -r 995fe5877d53 -r 950e1cfe0fe4 src/ZF/equalities.thy --- a/src/ZF/equalities.thy Thu Nov 07 16:03:26 2019 +0100 +++ b/src/ZF/equalities.thy Fri Nov 08 12:07:39 2019 +0100 @@ -105,7 +105,7 @@ lemma Diff_cons_eq: "cons(a,B) - C = (if a\C then B-C else cons(a,B-C))" by auto -lemma equal_singleton [rule_format]: "[| a: C; \y\C. y=b |] ==> C = {b}" +lemma equal_singleton: "[| a: C; \y. y \C \ y=b |] ==> C = {b}" by blast lemma [simp]: "cons(a,cons(a,B)) = cons(a,B)" diff -r 995fe5877d53 -r 950e1cfe0fe4 src/ZF/func.thy --- a/src/ZF/func.thy Thu Nov 07 16:03:26 2019 +0100 +++ b/src/ZF/func.thy Fri Nov 08 12:07:39 2019 +0100 @@ -356,8 +356,8 @@ apply (blast intro!: rel_Union function_Union) done -lemma gen_relation_Union [rule_format]: - "\f\F. relation(f) \ relation(\(F))" +lemma gen_relation_Union: + "(\f. f\F \ relation(f)) \ relation(\(F))" by (simp add: relation_def)