16417
|
1 |
theory Force imports Main begin
|
11456
|
2 |
(*Use Divides rather than Main to experiment with the first proof.
|
|
3 |
Otherwise, it is done by the nat_divide_cancel_factor simprocs.*)
|
11407
|
4 |
|
58860
|
5 |
declare div_mult_self_is_m [simp del]
|
10295
|
6 |
|
11407
|
7 |
lemma div_mult_self_is_m:
|
|
8 |
"0<n \<Longrightarrow> (m*n) div n = (m::nat)"
|
|
9 |
apply (insert mod_div_equality [of "m*n" n])
|
|
10 |
apply simp
|
|
11 |
done
|
10295
|
12 |
|
|
13 |
|
|
14 |
lemma "(\<forall>x. P x) \<and> (\<exists>x. Q x) \<longrightarrow> (\<forall>x. P x \<and> Q x)"
|
|
15 |
apply clarify
|
|
16 |
oops
|
|
17 |
|
|
18 |
text {*
|
|
19 |
proof\ {\isacharparenleft}prove{\isacharparenright}{\isacharcolon}\ step\ {\isadigit{1}}\isanewline
|
|
20 |
\isanewline
|
|
21 |
goal\ {\isacharparenleft}lemma{\isacharparenright}{\isacharcolon}\isanewline
|
|
22 |
{\isacharparenleft}{\isasymforall}x{\isachardot}\ P\ x{\isacharparenright}\ {\isasymand}\ {\isacharparenleft}{\isasymexists}x{\isachardot}\ Q\ x{\isacharparenright}\ {\isasymlongrightarrow}\ {\isacharparenleft}{\isasymforall}x{\isachardot}\ P\ x\ {\isasymand}\ Q\ x{\isacharparenright}\isanewline
|
|
23 |
\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}x\ xa{\isachardot}\ {\isasymlbrakk}{\isasymforall}x{\isachardot}\ P\ x{\isacharsemicolon}\ Q\ xa{\isasymrbrakk}\ {\isasymLongrightarrow}\ P\ x\ {\isasymand}\ Q\ x
|
58860
|
24 |
*}
|
10295
|
25 |
|
|
26 |
text {*
|
|
27 |
couldn't find a good example of clarsimp
|
|
28 |
|
|
29 |
@{thm[display]"someI"}
|
|
30 |
\rulename{someI}
|
58860
|
31 |
*}
|
10295
|
32 |
|
|
33 |
lemma "\<lbrakk>Q a; P a\<rbrakk> \<Longrightarrow> P (SOME x. P x \<and> Q x) \<and> Q (SOME x. P x \<and> Q x)"
|
|
34 |
apply (rule someI)
|
|
35 |
oops
|
|
36 |
|
|
37 |
lemma "\<lbrakk>Q a; P a\<rbrakk> \<Longrightarrow> P (SOME x. P x \<and> Q x) \<and> Q (SOME x. P x \<and> Q x)"
|
|
38 |
apply (fast intro!: someI)
|
|
39 |
done
|
|
40 |
|
|
41 |
text{*
|
|
42 |
proof\ {\isacharparenleft}prove{\isacharparenright}{\isacharcolon}\ step\ \isadigit{1}\isanewline
|
|
43 |
\isanewline
|
|
44 |
goal\ {\isacharparenleft}lemma{\isacharparenright}{\isacharcolon}\isanewline
|
|
45 |
{\isasymlbrakk}Q\ a{\isacharsemicolon}\ P\ a{\isasymrbrakk}\ {\isasymLongrightarrow}\ P\ {\isacharparenleft}SOME\ x{\isachardot}\ P\ x\ {\isasymand}\ Q\ x{\isacharparenright}\ {\isasymand}\ Q\ {\isacharparenleft}SOME\ x{\isachardot}\ P\ x\ {\isasymand}\ Q\ x{\isacharparenright}\isanewline
|
|
46 |
\ \isadigit{1}{\isachardot}\ {\isasymlbrakk}Q\ a{\isacharsemicolon}\ P\ a{\isasymrbrakk}\ {\isasymLongrightarrow}\ P\ {\isacharquery}x\ {\isasymand}\ Q\ {\isacharquery}x
|
|
47 |
*}
|
|
48 |
|
|
49 |
end
|
|
50 |
|