doc-src/TutorialI/Rules/Basic.thy
author paulson
Mon, 09 Apr 2001 10:12:33 +0200
changeset 11244 ca1de97d67c8
parent 11234 6902638af59e
child 11407 138919f1a135
permissions -rw-r--r--
extra display
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10341
6eb91805a012 added the $Id:$ line
paulson
parents: 10295
diff changeset
     1
(* ID:         $Id$ *)
10295
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
     2
theory Basic = Main:
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
     3
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
     4
lemma conj_rule: "\<lbrakk> P; Q \<rbrakk> \<Longrightarrow> P \<and> (Q \<and> P)"
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
     5
apply (rule conjI)
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
     6
 apply assumption
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
     7
apply (rule conjI)
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
     8
 apply assumption
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
     9
apply assumption
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    10
done
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    11
    
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    12
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    13
lemma disj_swap: "P | Q \<Longrightarrow> Q | P"
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    14
apply (erule disjE)
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    15
 apply (rule disjI2)
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    16
 apply assumption
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    17
apply (rule disjI1)
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    18
apply assumption
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    19
done
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    20
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    21
lemma conj_swap: "P \<and> Q \<Longrightarrow> Q \<and> P"
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    22
apply (rule conjI)
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    23
 apply (drule conjunct2)
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    24
 apply assumption
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    25
apply (drule conjunct1)
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    26
apply assumption
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    27
done
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    28
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    29
lemma imp_uncurry: "P \<longrightarrow> Q \<longrightarrow> R \<Longrightarrow> P \<and> Q \<longrightarrow> R"
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    30
apply (rule impI)
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    31
apply (erule conjE)
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    32
apply (drule mp)
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    33
 apply assumption
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    34
apply (drule mp)
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    35
  apply assumption
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    36
 apply assumption
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    37
done
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    38
10957
2a4a50e7ddf2 rename_tac example; tidying to use @subgoals
paulson
parents: 10843
diff changeset
    39
text {*
10843
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
    40
by eliminates uses of assumption and done
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
    41
*}
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
    42
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
    43
lemma imp_uncurry: "P \<longrightarrow> Q \<longrightarrow> R \<Longrightarrow> P \<and> Q \<longrightarrow> R"
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
    44
apply (rule impI)
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
    45
apply (erule conjE)
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
    46
apply (drule mp)
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
    47
 apply assumption
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
    48
by (drule mp)
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
    49
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
    50
10295
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    51
text {*
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    52
substitution
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    53
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    54
@{thm[display] ssubst}
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    55
\rulename{ssubst}
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    56
*};
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    57
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    58
lemma "\<lbrakk> x = f x; P(f x) \<rbrakk> \<Longrightarrow> P x"
10843
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
    59
by (erule ssubst)
10295
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    60
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    61
text {*
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    62
also provable by simp (re-orients)
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    63
*};
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    64
11182
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
    65
text {*
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
    66
the subst method
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
    67
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
    68
@{thm[display] mult_commute}
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
    69
\rulename{mult_commute}
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
    70
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
    71
this would fail:
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
    72
apply (simp add: mult_commute) 
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
    73
*};
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
    74
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
    75
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
    76
lemma "\<lbrakk>P x y z; Suc x < y\<rbrakk> \<Longrightarrow> f z = x*y"
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
    77
txt{*
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
    78
@{subgoals[display,indent=0,margin=65]}
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
    79
*};
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
    80
apply (subst mult_commute) 
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
    81
txt{*
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
    82
@{subgoals[display,indent=0,margin=65]}
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
    83
*};
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
    84
oops
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
    85
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
    86
(*exercise involving THEN*)
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
    87
lemma "\<lbrakk>P x y z; Suc x < y\<rbrakk> \<Longrightarrow> f z = x*y"
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
    88
apply (rule mult_commute [THEN ssubst]) 
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
    89
oops
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
    90
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
    91
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
    92
lemma "\<lbrakk>x = f x; triple (f x) (f x) x\<rbrakk> \<Longrightarrow> triple x x x"
10957
2a4a50e7ddf2 rename_tac example; tidying to use @subgoals
paulson
parents: 10843
diff changeset
    93
apply (erule ssubst) 
2a4a50e7ddf2 rename_tac example; tidying to use @subgoals
paulson
parents: 10843
diff changeset
    94
  --{* @{subgoals[display,indent=0,margin=65]} *}
2a4a50e7ddf2 rename_tac example; tidying to use @subgoals
paulson
parents: 10843
diff changeset
    95
back --{* @{subgoals[display,indent=0,margin=65]} *}
2a4a50e7ddf2 rename_tac example; tidying to use @subgoals
paulson
parents: 10843
diff changeset
    96
back --{* @{subgoals[display,indent=0,margin=65]} *}
2a4a50e7ddf2 rename_tac example; tidying to use @subgoals
paulson
parents: 10843
diff changeset
    97
back --{* @{subgoals[display,indent=0,margin=65]} *}
2a4a50e7ddf2 rename_tac example; tidying to use @subgoals
paulson
parents: 10843
diff changeset
    98
back --{* @{subgoals[display,indent=0,margin=65]} *}
10295
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    99
apply assumption
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   100
done
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   101
11182
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
   102
lemma "\<lbrakk> x = f x; triple (f x) (f x) x \<rbrakk> \<Longrightarrow> triple x x x"
10295
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   103
apply (erule ssubst, assumption)
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   104
done
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   105
10843
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   106
text{*
10957
2a4a50e7ddf2 rename_tac example; tidying to use @subgoals
paulson
parents: 10843
diff changeset
   107
or better still 
10843
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   108
*}
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   109
11182
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
   110
lemma "\<lbrakk> x = f x; triple (f x) (f x) x \<rbrakk> \<Longrightarrow> triple x x x"
10843
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   111
by (erule ssubst)
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   112
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   113
11182
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
   114
lemma "\<lbrakk> x = f x; triple (f x) (f x) x \<rbrakk> \<Longrightarrow> triple x x x"
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
   115
apply (erule_tac P="\<lambda>u. triple u u x" in ssubst)
10843
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   116
apply (assumption)
10295
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   117
done
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   118
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   119
11182
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
   120
lemma "\<lbrakk> x = f x; triple (f x) (f x) x \<rbrakk> \<Longrightarrow> triple x x x"
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
   121
by (erule_tac P="\<lambda>u. triple u u x" in ssubst)
10843
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   122
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   123
10295
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   124
text {*
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   125
negation
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   126
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   127
@{thm[display] notI}
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   128
\rulename{notI}
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   129
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   130
@{thm[display] notE}
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   131
\rulename{notE}
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   132
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   133
@{thm[display] classical}
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   134
\rulename{classical}
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   135
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   136
@{thm[display] contrapos_pp}
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   137
\rulename{contrapos_pp}
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   138
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   139
@{thm[display] contrapos_np}
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   140
\rulename{contrapos_np}
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   141
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   142
@{thm[display] contrapos_nn}
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   143
\rulename{contrapos_nn}
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   144
*};
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   145
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   146
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   147
lemma "\<lbrakk>\<not>(P\<longrightarrow>Q); \<not>(R\<longrightarrow>Q)\<rbrakk> \<Longrightarrow> R"
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   148
apply (erule_tac Q="R\<longrightarrow>Q" in contrapos_np)
10957
2a4a50e7ddf2 rename_tac example; tidying to use @subgoals
paulson
parents: 10843
diff changeset
   149
	--{* @{subgoals[display,indent=0,margin=65]} *}
10295
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   150
apply intro
10957
2a4a50e7ddf2 rename_tac example; tidying to use @subgoals
paulson
parents: 10843
diff changeset
   151
	--{* @{subgoals[display,indent=0,margin=65]} *}
10843
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   152
by (erule notE)
10295
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   153
11080
22855d091249 various revisions in response to comments from Tobias
paulson
parents: 10957
diff changeset
   154
text {*
22855d091249 various revisions in response to comments from Tobias
paulson
parents: 10957
diff changeset
   155
@{thm[display] disjCI}
22855d091249 various revisions in response to comments from Tobias
paulson
parents: 10957
diff changeset
   156
\rulename{disjCI}
22855d091249 various revisions in response to comments from Tobias
paulson
parents: 10957
diff changeset
   157
*};
22855d091249 various revisions in response to comments from Tobias
paulson
parents: 10957
diff changeset
   158
10295
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   159
lemma "(P \<or> Q) \<and> R \<Longrightarrow> P \<or> Q \<and> R"
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   160
apply intro
10957
2a4a50e7ddf2 rename_tac example; tidying to use @subgoals
paulson
parents: 10843
diff changeset
   161
	--{* @{subgoals[display,indent=0,margin=65]} *}
10295
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   162
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   163
apply (elim conjE disjE)
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   164
 apply assumption
10957
2a4a50e7ddf2 rename_tac example; tidying to use @subgoals
paulson
parents: 10843
diff changeset
   165
	--{* @{subgoals[display,indent=0,margin=65]} *}
10295
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   166
10843
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   167
by (erule contrapos_np, rule conjI)
10957
2a4a50e7ddf2 rename_tac example; tidying to use @subgoals
paulson
parents: 10843
diff changeset
   168
text{*
10295
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   169
proof\ {\isacharparenleft}prove{\isacharparenright}{\isacharcolon}\ step\ {\isadigit{6}}\isanewline
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   170
\isanewline
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   171
goal\ {\isacharparenleft}lemma{\isacharparenright}{\isacharcolon}\isanewline
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   172
{\isacharparenleft}P\ {\isasymor}\ Q{\isacharparenright}\ {\isasymand}\ R\ {\isasymLongrightarrow}\ P\ {\isasymor}\ Q\ {\isasymand}\ R\isanewline
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   173
\ {\isadigit{1}}{\isachardot}\ {\isasymlbrakk}R{\isacharsemicolon}\ Q{\isacharsemicolon}\ {\isasymnot}\ P{\isasymrbrakk}\ {\isasymLongrightarrow}\ Q\isanewline
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   174
\ {\isadigit{2}}{\isachardot}\ {\isasymlbrakk}R{\isacharsemicolon}\ Q{\isacharsemicolon}\ {\isasymnot}\ P{\isasymrbrakk}\ {\isasymLongrightarrow}\ R
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   175
*}
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   176
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   177
11182
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
   178
text{*rule_tac, etc.*}
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
   179
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
   180
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
   181
lemma "P&Q"
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
   182
apply (rule_tac P=P and Q=Q in conjI)
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
   183
oops
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
   184
e123a50aa949 minor fixes
paulson
parents: 11154
diff changeset
   185
10295
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   186
text{*Quantifiers*}
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   187
11080
22855d091249 various revisions in response to comments from Tobias
paulson
parents: 10957
diff changeset
   188
22855d091249 various revisions in response to comments from Tobias
paulson
parents: 10957
diff changeset
   189
text {*
22855d091249 various revisions in response to comments from Tobias
paulson
parents: 10957
diff changeset
   190
@{thm[display] allI}
22855d091249 various revisions in response to comments from Tobias
paulson
parents: 10957
diff changeset
   191
\rulename{allI}
22855d091249 various revisions in response to comments from Tobias
paulson
parents: 10957
diff changeset
   192
22855d091249 various revisions in response to comments from Tobias
paulson
parents: 10957
diff changeset
   193
@{thm[display] allE}
22855d091249 various revisions in response to comments from Tobias
paulson
parents: 10957
diff changeset
   194
\rulename{allE}
22855d091249 various revisions in response to comments from Tobias
paulson
parents: 10957
diff changeset
   195
22855d091249 various revisions in response to comments from Tobias
paulson
parents: 10957
diff changeset
   196
@{thm[display] spec}
22855d091249 various revisions in response to comments from Tobias
paulson
parents: 10957
diff changeset
   197
\rulename{spec}
22855d091249 various revisions in response to comments from Tobias
paulson
parents: 10957
diff changeset
   198
*};
22855d091249 various revisions in response to comments from Tobias
paulson
parents: 10957
diff changeset
   199
10295
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   200
lemma "\<forall>x. P x \<longrightarrow> P x"
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   201
apply (rule allI)
10843
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   202
by (rule impI)
10295
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   203
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   204
lemma "(\<forall>x. P \<longrightarrow> Q x) \<Longrightarrow> P \<longrightarrow> (\<forall>x. Q x)"
10843
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   205
apply (rule impI, rule allI)
10295
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   206
apply (drule spec)
10843
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   207
by (drule mp)
10957
2a4a50e7ddf2 rename_tac example; tidying to use @subgoals
paulson
parents: 10843
diff changeset
   208
11080
22855d091249 various revisions in response to comments from Tobias
paulson
parents: 10957
diff changeset
   209
text{*rename_tac*}
10957
2a4a50e7ddf2 rename_tac example; tidying to use @subgoals
paulson
parents: 10843
diff changeset
   210
lemma "x < y \<Longrightarrow> \<forall>x y. P x (f y)"
2a4a50e7ddf2 rename_tac example; tidying to use @subgoals
paulson
parents: 10843
diff changeset
   211
apply intro
2a4a50e7ddf2 rename_tac example; tidying to use @subgoals
paulson
parents: 10843
diff changeset
   212
	--{* @{subgoals[display,indent=0,margin=65]} *}
2a4a50e7ddf2 rename_tac example; tidying to use @subgoals
paulson
parents: 10843
diff changeset
   213
apply (rename_tac v w)
2a4a50e7ddf2 rename_tac example; tidying to use @subgoals
paulson
parents: 10843
diff changeset
   214
	--{* @{subgoals[display,indent=0,margin=65]} *}
2a4a50e7ddf2 rename_tac example; tidying to use @subgoals
paulson
parents: 10843
diff changeset
   215
oops
2a4a50e7ddf2 rename_tac example; tidying to use @subgoals
paulson
parents: 10843
diff changeset
   216
10295
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   217
10843
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   218
lemma "\<lbrakk>\<forall>x. P x \<longrightarrow> P (h x); P a\<rbrakk> \<Longrightarrow> P(h (h a))"
10295
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   219
apply (frule spec)
10957
2a4a50e7ddf2 rename_tac example; tidying to use @subgoals
paulson
parents: 10843
diff changeset
   220
	--{* @{subgoals[display,indent=0,margin=65]} *}
10295
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   221
apply (drule mp, assumption)
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   222
apply (drule spec)
10957
2a4a50e7ddf2 rename_tac example; tidying to use @subgoals
paulson
parents: 10843
diff changeset
   223
	--{* @{subgoals[display,indent=0,margin=65]} *}
10843
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   224
by (drule mp)
10295
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   225
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   226
lemma "\<lbrakk>\<forall>x. P x \<longrightarrow> P (f x); P a\<rbrakk> \<Longrightarrow> P(f (f a))"
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   227
by blast
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   228
11234
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   229
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   230
text{*
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   231
the existential quantifier*}
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   232
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   233
text {*
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   234
@{thm[display]"exI"}
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   235
\rulename{exI}
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   236
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   237
@{thm[display]"exE"}
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   238
\rulename{exE}
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   239
*};
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   240
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   241
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   242
text{*
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   243
instantiating quantifiers explicitly by rule_tac and erule_tac*}
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   244
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   245
lemma "\<lbrakk>\<forall>x. P x \<longrightarrow> P (h x); P a\<rbrakk> \<Longrightarrow> P(h (h a))"
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   246
apply (frule spec)
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   247
	--{* @{subgoals[display,indent=0,margin=65]} *}
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   248
apply (drule mp, assumption)
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   249
	--{* @{subgoals[display,indent=0,margin=65]} *}
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   250
apply (drule_tac x = "h a" in spec)
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   251
	--{* @{subgoals[display,indent=0,margin=65]} *}
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   252
by (drule mp)
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   253
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   254
text {*
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   255
@{thm[display]"dvd_def"}
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   256
\rulename{dvd_def}
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   257
*};
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   258
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   259
lemma mult_dvd_mono: "\<lbrakk>i dvd m; j dvd n\<rbrakk> \<Longrightarrow> i*j dvd (m*n :: nat)"
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   260
apply (simp add: dvd_def)
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   261
	--{* @{subgoals[display,indent=0,margin=65]} *}
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   262
apply (erule exE) 
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   263
	--{* @{subgoals[display,indent=0,margin=65]} *}
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   264
apply (erule exE) 
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   265
	--{* @{subgoals[display,indent=0,margin=65]} *}
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   266
apply (rule_tac x="k*ka" in exI) 
11244
ca1de97d67c8 extra display
paulson
parents: 11234
diff changeset
   267
	--{* @{subgoals[display,indent=0,margin=65]} *}
11234
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   268
apply simp
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   269
done
6902638af59e quantifier instantiation
paulson
parents: 11182
diff changeset
   270
10957
2a4a50e7ddf2 rename_tac example; tidying to use @subgoals
paulson
parents: 10843
diff changeset
   271
text{*
10843
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   272
Hilbert-epsilon theorems*}
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   273
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   274
text{*
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   275
@{thm[display] some_equality[no_vars]}
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   276
\rulename{some_equality}
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   277
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   278
@{thm[display] someI[no_vars]}
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   279
\rulename{someI}
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   280
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   281
@{thm[display] someI2[no_vars]}
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   282
\rulename{someI2}
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   283
11080
22855d091249 various revisions in response to comments from Tobias
paulson
parents: 10957
diff changeset
   284
@{thm[display] someI_ex[no_vars]}
22855d091249 various revisions in response to comments from Tobias
paulson
parents: 10957
diff changeset
   285
\rulename{someI_ex}
22855d091249 various revisions in response to comments from Tobias
paulson
parents: 10957
diff changeset
   286
10843
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   287
needed for examples
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   288
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   289
@{thm[display] inv_def[no_vars]}
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   290
\rulename{inv_def}
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   291
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   292
@{thm[display] Least_def[no_vars]}
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   293
\rulename{Least_def}
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   294
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   295
@{thm[display] order_antisym[no_vars]}
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   296
\rulename{order_antisym}
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   297
*}
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   298
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   299
11080
22855d091249 various revisions in response to comments from Tobias
paulson
parents: 10957
diff changeset
   300
lemma "inv Suc (Suc n) = n"
10843
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   301
by (simp add: inv_def)
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   302
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   303
text{*but we know nothing about inv Suc 0*}
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   304
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   305
theorem Least_equality:
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   306
     "\<lbrakk> P (k::nat);  \<forall>x. P x \<longrightarrow> k \<le> x \<rbrakk> \<Longrightarrow> (LEAST x. P(x)) = k"
11154
042015819774 for the change to LEAST
paulson
parents: 11080
diff changeset
   307
apply (simp add: Least_def LeastM_def)
10843
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   308
 
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   309
txt{*omit maybe?
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   310
@{subgoals[display,indent=0,margin=65]}
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   311
*};
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   312
   
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   313
apply (rule some_equality)
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   314
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   315
txt{*
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   316
@{subgoals[display,indent=0,margin=65]}
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   317
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   318
first subgoal is existence; second is uniqueness
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   319
*};
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   320
by (auto intro: order_antisym)
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   321
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   322
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   323
theorem axiom_of_choice:
11080
22855d091249 various revisions in response to comments from Tobias
paulson
parents: 10957
diff changeset
   324
     "(\<forall>x. \<exists>y. P x y) \<Longrightarrow> \<exists>f. \<forall>x. P x (f x)"
10843
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   325
apply (rule exI, rule allI)
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   326
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   327
txt{*
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   328
@{subgoals[display,indent=0,margin=65]}
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   329
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   330
state after intro rules
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   331
*};
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   332
apply (drule spec, erule exE)
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   333
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   334
txt{*
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   335
@{subgoals[display,indent=0,margin=65]}
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   336
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   337
applying @text{someI} automatically instantiates
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   338
@{term f} to @{term "\<lambda>x. SOME y. P x y"}
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   339
*};
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   340
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   341
by (rule someI)
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   342
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   343
(*both can be done by blast, which however hasn't been introduced yet*)
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   344
lemma "[| P (k::nat);  \<forall>x. P x \<longrightarrow> k \<le> x |] ==> (LEAST x. P(x)) = k";
11154
042015819774 for the change to LEAST
paulson
parents: 11080
diff changeset
   345
apply (simp add: Least_def LeastM_def)
10843
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   346
by (blast intro: some_equality order_antisym);
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   347
11080
22855d091249 various revisions in response to comments from Tobias
paulson
parents: 10957
diff changeset
   348
theorem axiom_of_choice: "(\<forall>x. \<exists>y. P x y) \<Longrightarrow> \<exists>f. \<forall>x. P x (f x)"
10843
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   349
apply (rule exI [of _  "\<lambda>x. SOME y. P x y"])
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   350
by (blast intro: someI);
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   351
10957
2a4a50e7ddf2 rename_tac example; tidying to use @subgoals
paulson
parents: 10843
diff changeset
   352
text{*end of Epsilon section*}
2a4a50e7ddf2 rename_tac example; tidying to use @subgoals
paulson
parents: 10843
diff changeset
   353
10843
f2e4e383dbca introduction of "by" and a few examples of SOME
paulson
parents: 10341
diff changeset
   354
10295
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   355
lemma "(\<exists>x. P x) \<or> (\<exists>x. Q x) \<Longrightarrow> \<exists>x. P x \<or> Q x"
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   356
apply elim
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   357
 apply intro
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   358
 apply assumption
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   359
apply (intro exI disjI2) (*or else we get disjCI*)
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   360
apply assumption
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   361
done
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   362
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   363
lemma "(P\<longrightarrow>Q) \<or> (Q\<longrightarrow>P)"
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   364
apply intro
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   365
apply elim
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   366
apply assumption
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   367
done
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   368
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   369
lemma "(P\<or>Q)\<and>(P\<or>R) \<Longrightarrow> P \<or> (Q\<and>R)"
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   370
apply intro
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   371
apply (elim conjE disjE)
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   372
apply blast
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   373
apply blast
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   374
apply blast
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   375
apply blast
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   376
(*apply elim*)
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   377
done
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   378
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   379
lemma "(\<exists>x. P \<and> Q x) \<Longrightarrow> P \<and> (\<exists>x. Q x)"
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   380
apply (erule exE)
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   381
apply (erule conjE)
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   382
apply (rule conjI)
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   383
 apply assumption
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   384
apply (rule exI)
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   385
 apply assumption
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   386
done
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   387
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   388
lemma "(\<exists>x. P x) \<and> (\<exists>x. Q x) \<Longrightarrow> \<exists>x. P x \<and> Q x"
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   389
apply (erule conjE)
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   390
apply (erule exE)
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   391
apply (erule exE)
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   392
apply (rule exI)
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   393
apply (rule conjI)
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   394
 apply assumption
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   395
oops
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   396
11080
22855d091249 various revisions in response to comments from Tobias
paulson
parents: 10957
diff changeset
   397
lemma "\<forall> y. R y y \<Longrightarrow> \<exists>x. \<forall> y. R x y"
22855d091249 various revisions in response to comments from Tobias
paulson
parents: 10957
diff changeset
   398
apply (rule exI) 
22855d091249 various revisions in response to comments from Tobias
paulson
parents: 10957
diff changeset
   399
  --{* @{subgoals[display,indent=0,margin=65]} *}
22855d091249 various revisions in response to comments from Tobias
paulson
parents: 10957
diff changeset
   400
apply (rule allI) 
22855d091249 various revisions in response to comments from Tobias
paulson
parents: 10957
diff changeset
   401
  --{* @{subgoals[display,indent=0,margin=65]} *}
22855d091249 various revisions in response to comments from Tobias
paulson
parents: 10957
diff changeset
   402
apply (drule spec) 
22855d091249 various revisions in response to comments from Tobias
paulson
parents: 10957
diff changeset
   403
  --{* @{subgoals[display,indent=0,margin=65]} *}
10295
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   404
oops
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   405
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   406
lemma "\<forall>x. \<exists> y. x=y"
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   407
apply (rule allI)
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   408
apply (rule exI)
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   409
apply (rule refl)
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   410
done
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   411
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   412
lemma "\<exists>x. \<forall> y. x=y"
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   413
apply (rule exI)
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   414
apply (rule allI)
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   415
oops
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   416
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
   417
end