# HG changeset patch # User wenzelm # Date 1473629423 -7200 # Node ID 23134a486dc676c50753f0e273e709c95266d209 # Parent 9c22a97b767445cc323e6e7a3b5d9000b9c344e2 tuned proofs; diff -r 9c22a97b7674 -r 23134a486dc6 src/HOL/Algebra/Divisibility.thy --- a/src/HOL/Algebra/Divisibility.thy Sun Sep 11 18:12:16 2016 +0200 +++ b/src/HOL/Algebra/Divisibility.thy Sun Sep 11 23:30:23 2016 +0200 @@ -187,8 +187,7 @@ and elim: "\c. \b = a \ c; c \ carrier G\ \ P" shows "P" proof - - from dividesD[OF d] - obtain c where "c \ carrier G" and "b = a \ c" by auto + from dividesD[OF d] obtain c where "c \ carrier G" and "b = a \ c" by auto then show P by (elim elim) qed @@ -319,14 +318,12 @@ unfolding associated_def proof clarify assume "b divides a" - then have "\u\carrier G. a = b \ u" by (rule dividesD) then obtain u where ucarr: "u \ carrier G" and a: "a = b \ u" - by auto + by (rule dividesE) assume "a divides b" - then have "\u'\carrier G. b = a \ u'" by (rule dividesD) then obtain u' where u'carr: "u' \ carrier G" and b: "b = a \ u'" - by auto + by (rule dividesE) note carr = carr ucarr u'carr from carr have "a \ \ = a" by simp @@ -559,8 +556,7 @@ assumes advdb: "a divides b" and neq: "\(a \ b)" shows "properfactor G a b" - apply (rule properfactorI, rule advdb) -proof (rule ccontr, simp) +proof (rule properfactorI, rule advdb, rule notI) assume "b divides a" with advdb have "a \ b" by (rule associatedI) with neq show "False" by fast @@ -784,8 +780,7 @@ proof (cases "a \ Units G") case aunit: True have "irreducible G b" - apply (rule irreducibleI) - proof (rule ccontr, simp) + proof (rule irreducibleI, rule notI) assume "b \ Units G" with aunit have "(a \ b) \ Units G" by fast with abnunit show "False" .. @@ -804,8 +799,7 @@ then have bunit: "b \ Units G" by (intro isunit, simp) have "irreducible G a" - apply (rule irreducibleI) - proof (rule ccontr, simp) + proof (rule irreducibleI, rule notI) assume "a \ Units G" with bunit have "(a \ b) \ Units G" by fast with abnunit show "False" .. @@ -1184,10 +1178,11 @@ and wf: "wfactors G fs a" and carr[simp]: "set fs \ carrier G" shows "fs = []" -proof (rule ccontr, cases fs, simp) - fix f fs' - assume fs: "fs = f # fs'" - +proof (cases fs) + case Nil + then show ?thesis . +next + case fs: (Cons f fs') from carr have fcarr[simp]: "f \ carrier G" and carr'[simp]: "set fs' \ carrier G" by (simp_all add: fs) @@ -1203,7 +1198,7 @@ by (simp add: Units_closed[OF aunit] a[symmetric]) finally have "f \ foldr (op \) fs' \ \ Units G" by simp then have "f \ Units G" by (intro unit_factor[of f], simp+) - with fnunit show "False" by simp + with fnunit show ?thesis by contradiction qed @@ -2181,7 +2176,7 @@ next case bnunit: False have cnunit: "c \ Units G" - proof (rule ccontr, simp) + proof assume cunit: "c \ Units G" from bnunit have "properfactor G a (a \ b)" by (intro properfactorI3[of _ _ b], simp+) @@ -2840,7 +2835,7 @@ apply (clarsimp simp add: Unit_eq_dividesone[symmetric]) apply (rule r, rule, assumption) apply (rule properfactorI, assumption) - proof (rule ccontr, simp) + proof fix y assume ycarr: "y \ carrier G" assume "p divides y" @@ -2860,7 +2855,7 @@ apply (clarsimp simp add: Unit_eq_dividesone[symmetric]) apply (rule r, rule, assumption) apply (rule properfactorI, assumption) - proof (rule ccontr, simp) + proof fix y assume ycarr: "y \ carrier G" assume "p divides y" @@ -3311,7 +3306,7 @@ assume nbdvda: "\ b divides a" have "c \ Units G" - proof (rule ccontr, simp) + proof assume cunit:"c \ Units G" have "b \ inv c = a \ c \ inv c" by (simp add: b)