src/Doc/Tutorial/Rules/Force.thy
author wenzelm
Sat, 05 Apr 2014 15:03:40 +0200
changeset 56421 1ffd7eaa778b
parent 48985 5386df44a037
child 58860 fee7cfa69c50
permissions -rw-r--r--
updated to jedit_build-20140405: Code2HTML.jar, CommonControls.jar, Console.jar, kappalayout.jar, Navigator.jar, SideKick.jar, doc with jEdit manuals (ant dist-manuals);
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16417
9bc16273c2d4 migrated theory headers to new format
haftmann
parents: 11456
diff changeset
     1
theory Force imports Main begin 
11456
7eb63f63e6c6 revisions and indexing
paulson
parents: 11407
diff changeset
     2
  (*Use Divides rather than Main to experiment with the first proof.
7eb63f63e6c6 revisions and indexing
paulson
parents: 11407
diff changeset
     3
    Otherwise, it is done by the nat_divide_cancel_factor simprocs.*)
11407
138919f1a135 tweaks for new version
paulson
parents: 10341
diff changeset
     4
138919f1a135 tweaks for new version
paulson
parents: 10341
diff changeset
     5
declare div_mult_self_is_m [simp del];
10295
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
     6
11407
138919f1a135 tweaks for new version
paulson
parents: 10341
diff changeset
     7
lemma div_mult_self_is_m: 
138919f1a135 tweaks for new version
paulson
parents: 10341
diff changeset
     8
      "0<n \<Longrightarrow> (m*n) div n = (m::nat)"
138919f1a135 tweaks for new version
paulson
parents: 10341
diff changeset
     9
apply (insert mod_div_equality [of "m*n" n])
138919f1a135 tweaks for new version
paulson
parents: 10341
diff changeset
    10
apply simp
138919f1a135 tweaks for new version
paulson
parents: 10341
diff changeset
    11
done
10295
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    12
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    13
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    14
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
    15
apply clarify
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    16
oops
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    17
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    18
text {*
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    19
proof\ {\isacharparenleft}prove{\isacharparenright}{\isacharcolon}\ step\ {\isadigit{1}}\isanewline
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    20
\isanewline
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    21
goal\ {\isacharparenleft}lemma{\isacharparenright}{\isacharcolon}\isanewline
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    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
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    23
\ {\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
    24
*};
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    25
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    26
text {*
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    27
couldn't find a good example of clarsimp
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    28
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    29
@{thm[display]"someI"}
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    30
\rulename{someI}
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    31
*};
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    32
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    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)"
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    34
apply (rule someI)
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    35
oops
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    36
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    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)"
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    38
apply (fast intro!: someI)
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    39
done
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    40
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    41
text{*
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    42
proof\ {\isacharparenleft}prove{\isacharparenright}{\isacharcolon}\ step\ \isadigit{1}\isanewline
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    43
\isanewline
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    44
goal\ {\isacharparenleft}lemma{\isacharparenright}{\isacharcolon}\isanewline
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    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
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    46
\ \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
    47
*}
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    48
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    49
end
8eb12693cead the Rules chapter and theories
paulson
parents:
diff changeset
    50