src/FOL/ex/Miniscope.thy
changeset 60770 240563fbf41d
parent 59498 50b60f501b05
child 61489 b8d375aee0df
equal deleted inserted replaced
60769:cf7f3465eaf1 60770:240563fbf41d
    12 begin
    12 begin
    13 
    13 
    14 
    14 
    15 lemmas ccontr = FalseE [THEN classical]
    15 lemmas ccontr = FalseE [THEN classical]
    16 
    16 
    17 subsection {* Negation Normal Form *}
    17 subsection \<open>Negation Normal Form\<close>
    18 
    18 
    19 subsubsection {* de Morgan laws *}
    19 subsubsection \<open>de Morgan laws\<close>
    20 
    20 
    21 lemma demorgans:
    21 lemma demorgans:
    22   "~(P&Q) <-> ~P | ~Q"
    22   "~(P&Q) <-> ~P | ~Q"
    23   "~(P|Q) <-> ~P & ~Q"
    23   "~(P|Q) <-> ~P & ~Q"
    24   "~~P <-> P"
    24   "~~P <-> P"
    36   by blast+
    36   by blast+
    37 
    37 
    38 
    38 
    39 (* BEWARE: rewrite rules for <-> can confuse the simplifier!! *)
    39 (* BEWARE: rewrite rules for <-> can confuse the simplifier!! *)
    40 
    40 
    41 subsubsection {* Pushing in the existential quantifiers *}
    41 subsubsection \<open>Pushing in the existential quantifiers\<close>
    42 
    42 
    43 lemma ex_simps:
    43 lemma ex_simps:
    44   "(EX x. P) <-> P"
    44   "(EX x. P) <-> P"
    45   "!!P Q. (EX x. P(x) & Q) <-> (EX x. P(x)) & Q"
    45   "!!P Q. (EX x. P(x) & Q) <-> (EX x. P(x)) & Q"
    46   "!!P Q. (EX x. P & Q(x)) <-> P & (EX x. Q(x))"
    46   "!!P Q. (EX x. P & Q(x)) <-> P & (EX x. Q(x))"
    48   "!!P Q. (EX x. P(x) | Q) <-> (EX x. P(x)) | Q"
    48   "!!P Q. (EX x. P(x) | Q) <-> (EX x. P(x)) | Q"
    49   "!!P Q. (EX x. P | Q(x)) <-> P | (EX x. Q(x))"
    49   "!!P Q. (EX x. P | Q(x)) <-> P | (EX x. Q(x))"
    50   by blast+
    50   by blast+
    51 
    51 
    52 
    52 
    53 subsubsection {* Pushing in the universal quantifiers *}
    53 subsubsection \<open>Pushing in the universal quantifiers\<close>
    54 
    54 
    55 lemma all_simps:
    55 lemma all_simps:
    56   "(ALL x. P) <-> P"
    56   "(ALL x. P) <-> P"
    57   "!!P Q. (ALL x. P(x) & Q(x)) <-> (ALL x. P(x)) & (ALL x. Q(x))"
    57   "!!P Q. (ALL x. P(x) & Q(x)) <-> (ALL x. P(x)) & (ALL x. Q(x))"
    58   "!!P Q. (ALL x. P(x) & Q) <-> (ALL x. P(x)) & Q"
    58   "!!P Q. (ALL x. P(x) & Q) <-> (ALL x. P(x)) & Q"
    61   "!!P Q. (ALL x. P | Q(x)) <-> P | (ALL x. Q(x))"
    61   "!!P Q. (ALL x. P | Q(x)) <-> P | (ALL x. Q(x))"
    62   by blast+
    62   by blast+
    63 
    63 
    64 lemmas mini_simps = demorgans nnf_simps ex_simps all_simps
    64 lemmas mini_simps = demorgans nnf_simps ex_simps all_simps
    65 
    65 
    66 ML {*
    66 ML \<open>
    67 val mini_ss = simpset_of (@{context} addsimps @{thms mini_simps});
    67 val mini_ss = simpset_of (@{context} addsimps @{thms mini_simps});
    68 fun mini_tac ctxt =
    68 fun mini_tac ctxt =
    69   resolve_tac ctxt @{thms ccontr} THEN' asm_full_simp_tac (put_simpset mini_ss ctxt);
    69   resolve_tac ctxt @{thms ccontr} THEN' asm_full_simp_tac (put_simpset mini_ss ctxt);
    70 *}
    70 \<close>
    71 
    71 
    72 end
    72 end