doc-src/TutorialI/Rules/Force.thy
author wenzelm
Wed, 26 Jul 2006 00:44:44 +0200
changeset 20207 4c57e850e8d5
parent 16417 9bc16273c2d4
child 42637 381fdcab0f36
permissions -rw-r--r--
added Pure/subgoal.ML;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10341
6eb91805a012 added the $Id:$ line
paulson
parents: 10295
diff changeset
     1
(* ID:         $Id$ *)
16417
9bc16273c2d4 migrated theory headers to new format
haftmann
parents: 11456
diff changeset
     2
theory Force imports Main begin 
11456
7eb63f63e6c6 revisions and indexing
paulson
parents: 11407
diff changeset
     3
  (*Use Divides rather than Main to experiment with the first proof.
7eb63f63e6c6 revisions and indexing
paulson
parents: 11407
diff changeset
     4
    Otherwise, it is done by the nat_divide_cancel_factor simprocs.*)
11407
138919f1a135 tweaks for new version
paulson
parents: 10341
diff changeset
     5
138919f1a135 tweaks for new version
paulson
parents: 10341
diff changeset
     6
declare div_mult_self_is_m [simp del];
10295
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
     7
11407
138919f1a135 tweaks for new version
paulson
parents: 10341
diff changeset
     8
lemma div_mult_self_is_m: 
138919f1a135 tweaks for new version
paulson
parents: 10341
diff changeset
     9
      "0<n \<Longrightarrow> (m*n) div n = (m::nat)"
138919f1a135 tweaks for new version
paulson
parents: 10341
diff changeset
    10
apply (insert mod_div_equality [of "m*n" n])
138919f1a135 tweaks for new version
paulson
parents: 10341
diff changeset
    11
apply simp
138919f1a135 tweaks for new version
paulson
parents: 10341
diff changeset
    12
done
10295
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    13
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    14
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    15
lemma "(\<forall>x. P x) \<and> (\<exists>x. Q x) \<longrightarrow> (\<forall>x. P x \<and> Q x)"
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    16
apply clarify
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    17
oops
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    18
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    19
text {*
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    20
proof\ {\isacharparenleft}prove{\isacharparenright}{\isacharcolon}\ step\ {\isadigit{1}}\isanewline
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    21
\isanewline
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    22
goal\ {\isacharparenleft}lemma{\isacharparenright}{\isacharcolon}\isanewline
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    23
{\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
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    24
\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}x\ xa{\isachardot}\ {\isasymlbrakk}{\isasymforall}x{\isachardot}\ P\ x{\isacharsemicolon}\ Q\ xa{\isasymrbrakk}\ {\isasymLongrightarrow}\ P\ x\ {\isasymand}\ Q\ x
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    25
*};
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    26
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    27
text {*
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    28
couldn't find a good example of clarsimp
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    29
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    30
@{thm[display]"someI"}
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    31
\rulename{someI}
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    32
*};
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    33
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    34
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)"
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    35
apply (rule someI)
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    36
oops
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    37
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    38
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)"
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    39
apply (fast intro!: someI)
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    40
done
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    41
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    42
text{*
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    43
proof\ {\isacharparenleft}prove{\isacharparenright}{\isacharcolon}\ step\ \isadigit{1}\isanewline
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    44
\isanewline
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    45
goal\ {\isacharparenleft}lemma{\isacharparenright}{\isacharcolon}\isanewline
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    46
{\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
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    47
\ \isadigit{1}{\isachardot}\ {\isasymlbrakk}Q\ a{\isacharsemicolon}\ P\ a{\isasymrbrakk}\ {\isasymLongrightarrow}\ P\ {\isacharquery}x\ {\isasymand}\ Q\ {\isacharquery}x
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    48
*}
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    49
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    50
end
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    51