doc-src/TutorialI/Rules/Forward.thy
author kleing
Sun, 18 May 2003 16:16:58 +0200
changeset 14037 3b7f3eec9684
parent 13550 5a176b8dda84
child 14403 32d1526d3237
permissions -rw-r--r--
more cleanup
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10846
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
     1
theory Forward = Primes:
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
     2
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
     3
text{*\noindent
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
     4
Forward proof material: of, OF, THEN, simplify, rule_format.
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
     5
*}
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
     6
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
     7
text{*\noindent
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
     8
SKIP most developments...
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
     9
*}
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    10
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    11
(** Commutativity **)
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    12
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    13
lemma is_gcd_commute: "is_gcd k m n = is_gcd k n m"
10958
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
    14
apply (auto simp add: is_gcd_def);
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
    15
done
10846
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    16
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    17
lemma gcd_commute: "gcd(m,n) = gcd(n,m)"
10958
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
    18
apply (rule is_gcd_unique)
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
    19
apply (rule is_gcd)
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
    20
apply (subst is_gcd_commute)
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
    21
apply (simp add: is_gcd)
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
    22
done
10846
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    23
11711
ecdfd237ffee fixed numerals;
wenzelm
parents: 11480
diff changeset
    24
lemma gcd_1 [simp]: "gcd(m, Suc 0) = Suc 0"
10958
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
    25
apply simp
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
    26
done
10846
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    27
11711
ecdfd237ffee fixed numerals;
wenzelm
parents: 11480
diff changeset
    28
lemma gcd_1_left [simp]: "gcd(Suc 0, m) = Suc 0"
ecdfd237ffee fixed numerals;
wenzelm
parents: 11480
diff changeset
    29
apply (simp add: gcd_commute [of "Suc 0"])
10958
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
    30
done
10846
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    31
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    32
text{*\noindent
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    33
as far as HERE.
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    34
*}
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    35
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    36
text{*\noindent
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    37
SKIP THIS PROOF
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    38
*}
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    39
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    40
lemma gcd_mult_distrib2: "k * gcd(m,n) = gcd(k*m, k*n)"
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    41
apply (induct_tac m n rule: gcd.induct)
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    42
apply (case_tac "n=0")
10958
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
    43
apply simp
10846
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    44
apply (case_tac "k=0")
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    45
apply (simp_all add: mod_geq gcd_non_0 mod_mult_distrib2)
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    46
done
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    47
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    48
text {*
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    49
@{thm[display] gcd_mult_distrib2}
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    50
\rulename{gcd_mult_distrib2}
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    51
*};
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    52
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    53
text{*\noindent
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    54
of, simplified
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    55
*}
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    56
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    57
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    58
lemmas gcd_mult_0 = gcd_mult_distrib2 [of k 1];
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    59
lemmas gcd_mult_1 = gcd_mult_0 [simplified];
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    60
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    61
text {*
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    62
@{thm[display] gcd_mult_distrib2 [of _ 1]}
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    63
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    64
@{thm[display] gcd_mult_0}
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    65
\rulename{gcd_mult_0}
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    66
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    67
@{thm[display] gcd_mult_1}
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    68
\rulename{gcd_mult_1}
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    69
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    70
@{thm[display] sym}
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    71
\rulename{sym}
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    72
*};
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    73
13550
5a176b8dda84 removal of blast.overloaded
paulson
parents: 12390
diff changeset
    74
lemmas gcd_mult0 = gcd_mult_1 [THEN sym];
5a176b8dda84 removal of blast.overloaded
paulson
parents: 12390
diff changeset
    75
      (*not quite right: we need ?k but this gives k*)
10846
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    76
13550
5a176b8dda84 removal of blast.overloaded
paulson
parents: 12390
diff changeset
    77
lemmas gcd_mult0' = gcd_mult_distrib2 [of k 1, simplified, THEN sym];
10846
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    78
      (*better in one step!*)
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    79
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    80
text {*
13550
5a176b8dda84 removal of blast.overloaded
paulson
parents: 12390
diff changeset
    81
more legible, and variables properly generalized
10846
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    82
*};
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    83
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    84
lemma gcd_mult [simp]: "gcd(k, k*n) = k"
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    85
by (rule gcd_mult_distrib2 [of k 1, simplified, THEN sym])
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    86
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    87
13550
5a176b8dda84 removal of blast.overloaded
paulson
parents: 12390
diff changeset
    88
lemmas gcd_self0 = gcd_mult [of k 1, simplified];
10846
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    89
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    90
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    91
text {*
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    92
Rules handy with THEN
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    93
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    94
@{thm[display] iffD1}
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    95
\rulename{iffD1}
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    96
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    97
@{thm[display] iffD2}
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    98
\rulename{iffD2}
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
    99
*};
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   100
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   101
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   102
text {*
13550
5a176b8dda84 removal of blast.overloaded
paulson
parents: 12390
diff changeset
   103
again: more legible, and variables properly generalized
10846
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   104
*};
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   105
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   106
lemma gcd_self [simp]: "gcd(k,k) = k"
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   107
by (rule gcd_mult [of k 1, simplified])
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   108
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   109
10958
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   110
text{*
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   111
NEXT SECTION: Methods for Forward Proof
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   112
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   113
NEW
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   114
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   115
theorem arg_cong, useful in forward steps
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   116
@{thm[display] arg_cong[no_vars]}
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   117
\rulename{arg_cong}
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   118
*}
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   119
11711
ecdfd237ffee fixed numerals;
wenzelm
parents: 11480
diff changeset
   120
lemma "2 \<le> u \<Longrightarrow> u*m \<noteq> Suc(u*n)"
12390
2fa13b499975 adapted intr/elim uses;
wenzelm
parents: 12156
diff changeset
   121
apply (intro notI)
10958
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   122
txt{*
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   123
before using arg_cong
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   124
@{subgoals[display,indent=0,margin=65]}
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   125
*};
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   126
apply (drule_tac f="\<lambda>x. x mod u" in arg_cong)
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   127
txt{*
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   128
after using arg_cong
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   129
@{subgoals[display,indent=0,margin=65]}
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   130
*};
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   131
apply (simp add: mod_Suc)
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   132
done
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   133
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   134
text{*
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   135
have just used this rule:
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   136
@{thm[display] mod_Suc[no_vars]}
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   137
\rulename{mod_Suc}
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   138
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   139
@{thm[display] mult_le_mono1[no_vars]}
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   140
\rulename{mult_le_mono1}
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   141
*}
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   142
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   143
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   144
text{*
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   145
example of "insert"
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   146
*}
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   147
10846
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   148
lemma relprime_dvd_mult: 
11407
138919f1a135 tweaks for new version
paulson
parents: 10958
diff changeset
   149
      "\<lbrakk> gcd(k,n)=1; k dvd m*n \<rbrakk> \<Longrightarrow> k dvd m"
10846
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   150
apply (insert gcd_mult_distrib2 [of m k n])
10958
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   151
apply simp
10846
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   152
apply (erule_tac t="m" in ssubst);
10958
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   153
apply simp
10846
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   154
done
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   155
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   156
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   157
text {*
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   158
Another example of "insert"
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   159
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   160
@{thm[display] mod_div_equality}
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   161
\rulename{mod_div_equality}
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   162
*};
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   163
11407
138919f1a135 tweaks for new version
paulson
parents: 10958
diff changeset
   164
(*MOVED to Force.thy, which now depends only on Divides.thy
138919f1a135 tweaks for new version
paulson
parents: 10958
diff changeset
   165
lemma div_mult_self_is_m: "0<n \<Longrightarrow> (m*n) div n = (m::nat)"
138919f1a135 tweaks for new version
paulson
parents: 10958
diff changeset
   166
*)
10846
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   167
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   168
lemma relprime_dvd_mult_iff: "gcd(k,n)=1 \<Longrightarrow> (k dvd m*n) = (k dvd m)";
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   169
by (blast intro: relprime_dvd_mult dvd_trans)
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   170
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   171
11711
ecdfd237ffee fixed numerals;
wenzelm
parents: 11480
diff changeset
   172
lemma relprime_20_81: "gcd(20,81) = 1";
10846
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   173
by (simp add: gcd.simps)
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   174
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   175
text {*
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   176
Examples of 'OF'
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   177
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   178
@{thm[display] relprime_dvd_mult}
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   179
\rulename{relprime_dvd_mult}
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   180
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   181
@{thm[display] relprime_dvd_mult [OF relprime_20_81]}
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   182
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   183
@{thm[display] dvd_refl}
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   184
\rulename{dvd_refl}
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   185
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   186
@{thm[display] dvd_add}
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   187
\rulename{dvd_add}
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   188
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   189
@{thm[display] dvd_add [OF dvd_refl dvd_refl]}
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   190
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   191
@{thm[display] dvd_add [OF _ dvd_refl]}
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   192
*};
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   193
11711
ecdfd237ffee fixed numerals;
wenzelm
parents: 11480
diff changeset
   194
lemma "\<lbrakk>(z::int) < 37; 66 < 2*z; z*z \<noteq> 1225; Q(34); Q(36)\<rbrakk> \<Longrightarrow> Q(z)";
ecdfd237ffee fixed numerals;
wenzelm
parents: 11480
diff changeset
   195
apply (subgoal_tac "z = 34 \<or> z = 36")
10958
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   196
txt{*
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   197
the tactic leaves two subgoals:
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   198
@{subgoals[display,indent=0,margin=65]}
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   199
*};
10846
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   200
apply blast
11711
ecdfd237ffee fixed numerals;
wenzelm
parents: 11480
diff changeset
   201
apply (subgoal_tac "z \<noteq> 35")
10958
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   202
txt{*
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   203
the tactic leaves two subgoals:
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   204
@{subgoals[display,indent=0,margin=65]}
fd582f0d649b arg_cong example; tidying to use @subgoals
paulson
parents: 10877
diff changeset
   205
*};
10846
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   206
apply arith
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   207
apply force
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   208
done
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   209
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   210
623141a08705 reformatting, and splitting the end of "Primes" to create "Forward"
paulson
parents:
diff changeset
   211
end