src/FOL/ex/Propositional_Int.thy
author blanchet
Mon, 15 Sep 2014 10:49:07 +0200
changeset 58335 a5a3b576fcfb
parent 51798 ad3a241def73
child 58889 5b7a9633cfa8
permissions -rw-r--r--
generate 'code' attribute only if 'code' plugin is enabled
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
23914
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
     1
(*  Title:      FOL/ex/Propositional_Int.thy
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
     2
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
     3
    Copyright   1991  University of Cambridge
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
     4
*)
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
     5
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
     6
header {* First-Order Logic: propositional examples (intuitionistic version) *}
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
     7
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
     8
theory Propositional_Int
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
     9
imports IFOL
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    10
begin
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    11
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    12
text {* commutative laws of @{text "&"} and @{text "|"} *}
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    13
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    14
lemma "P & Q  -->  Q & P"
51798
ad3a241def73 uniform Proof.context for hyp_subst_tac;
wenzelm
parents: 31974
diff changeset
    15
  by (tactic "IntPr.fast_tac @{context} 1")
23914
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    16
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    17
lemma "P | Q  -->  Q | P"
51798
ad3a241def73 uniform Proof.context for hyp_subst_tac;
wenzelm
parents: 31974
diff changeset
    18
  by (tactic "IntPr.fast_tac @{context} 1")
23914
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    19
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    20
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    21
text {* associative laws of @{text "&"} and @{text "|"} *}
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    22
lemma "(P & Q) & R  -->  P & (Q & R)"
51798
ad3a241def73 uniform Proof.context for hyp_subst_tac;
wenzelm
parents: 31974
diff changeset
    23
  by (tactic "IntPr.fast_tac @{context} 1")
23914
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    24
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    25
lemma "(P | Q) | R  -->  P | (Q | R)"
51798
ad3a241def73 uniform Proof.context for hyp_subst_tac;
wenzelm
parents: 31974
diff changeset
    26
  by (tactic "IntPr.fast_tac @{context} 1")
23914
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    27
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    28
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    29
text {* distributive laws of @{text "&"} and @{text "|"} *}
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    30
lemma "(P & Q) | R  --> (P | R) & (Q | R)"
51798
ad3a241def73 uniform Proof.context for hyp_subst_tac;
wenzelm
parents: 31974
diff changeset
    31
  by (tactic "IntPr.fast_tac @{context} 1")
23914
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    32
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    33
lemma "(P | R) & (Q | R)  --> (P & Q) | R"
51798
ad3a241def73 uniform Proof.context for hyp_subst_tac;
wenzelm
parents: 31974
diff changeset
    34
  by (tactic "IntPr.fast_tac @{context} 1")
23914
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    35
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    36
lemma "(P | Q) & R  --> (P & R) | (Q & R)"
51798
ad3a241def73 uniform Proof.context for hyp_subst_tac;
wenzelm
parents: 31974
diff changeset
    37
  by (tactic "IntPr.fast_tac @{context} 1")
23914
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    38
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    39
lemma "(P & R) | (Q & R)  --> (P | Q) & R"
51798
ad3a241def73 uniform Proof.context for hyp_subst_tac;
wenzelm
parents: 31974
diff changeset
    40
  by (tactic "IntPr.fast_tac @{context} 1")
23914
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    41
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    42
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    43
text {* Laws involving implication *}
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    44
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    45
lemma "(P-->R) & (Q-->R) <-> (P|Q --> R)"
51798
ad3a241def73 uniform Proof.context for hyp_subst_tac;
wenzelm
parents: 31974
diff changeset
    46
  by (tactic "IntPr.fast_tac @{context} 1")
23914
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    47
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    48
lemma "(P & Q --> R) <-> (P--> (Q-->R))"
51798
ad3a241def73 uniform Proof.context for hyp_subst_tac;
wenzelm
parents: 31974
diff changeset
    49
  by (tactic "IntPr.fast_tac @{context} 1")
23914
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    50
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    51
lemma "((P-->R)-->R) --> ((Q-->R)-->R) --> (P&Q-->R) --> R"
51798
ad3a241def73 uniform Proof.context for hyp_subst_tac;
wenzelm
parents: 31974
diff changeset
    52
  by (tactic "IntPr.fast_tac @{context} 1")
23914
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    53
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    54
lemma "~(P-->R) --> ~(Q-->R) --> ~(P&Q-->R)"
51798
ad3a241def73 uniform Proof.context for hyp_subst_tac;
wenzelm
parents: 31974
diff changeset
    55
  by (tactic "IntPr.fast_tac @{context} 1")
23914
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    56
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    57
lemma "(P --> Q & R) <-> (P-->Q)  &  (P-->R)"
51798
ad3a241def73 uniform Proof.context for hyp_subst_tac;
wenzelm
parents: 31974
diff changeset
    58
  by (tactic "IntPr.fast_tac @{context} 1")
23914
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    59
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    60
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    61
text {* Propositions-as-types *}
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    62
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    63
-- {* The combinator K *}
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    64
lemma "P --> (Q --> P)"
51798
ad3a241def73 uniform Proof.context for hyp_subst_tac;
wenzelm
parents: 31974
diff changeset
    65
  by (tactic "IntPr.fast_tac @{context} 1")
23914
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    66
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    67
-- {* The combinator S *}
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    68
lemma "(P-->Q-->R)  --> (P-->Q) --> (P-->R)"
51798
ad3a241def73 uniform Proof.context for hyp_subst_tac;
wenzelm
parents: 31974
diff changeset
    69
  by (tactic "IntPr.fast_tac @{context} 1")
23914
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    70
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    71
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    72
-- {* Converse is classical *}
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    73
lemma "(P-->Q) | (P-->R)  -->  (P --> Q | R)"
51798
ad3a241def73 uniform Proof.context for hyp_subst_tac;
wenzelm
parents: 31974
diff changeset
    74
  by (tactic "IntPr.fast_tac @{context} 1")
23914
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    75
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    76
lemma "(P-->Q)  -->  (~Q --> ~P)"
51798
ad3a241def73 uniform Proof.context for hyp_subst_tac;
wenzelm
parents: 31974
diff changeset
    77
  by (tactic "IntPr.fast_tac @{context} 1")
23914
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    78
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    79
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    80
text {* Schwichtenberg's examples (via T. Nipkow) *}
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    81
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    82
lemma stab_imp: "(((Q-->R)-->R)-->Q) --> (((P-->Q)-->R)-->R)-->P-->Q"
51798
ad3a241def73 uniform Proof.context for hyp_subst_tac;
wenzelm
parents: 31974
diff changeset
    83
  by (tactic "IntPr.fast_tac @{context} 1")
23914
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    84
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    85
lemma stab_to_peirce:
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    86
  "(((P --> R) --> R) --> P) --> (((Q --> R) --> R) --> Q)  
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    87
                              --> ((P --> Q) --> P) --> P"
51798
ad3a241def73 uniform Proof.context for hyp_subst_tac;
wenzelm
parents: 31974
diff changeset
    88
  by (tactic "IntPr.fast_tac @{context} 1")
23914
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    89
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    90
lemma peirce_imp1: "(((Q --> R) --> Q) --> Q)  
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    91
                --> (((P --> Q) --> R) --> P --> Q) --> P --> Q"
51798
ad3a241def73 uniform Proof.context for hyp_subst_tac;
wenzelm
parents: 31974
diff changeset
    92
  by (tactic "IntPr.fast_tac @{context} 1")
23914
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    93
  
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    94
lemma peirce_imp2: "(((P --> R) --> P) --> P) --> ((P --> Q --> R) --> P) --> P"
51798
ad3a241def73 uniform Proof.context for hyp_subst_tac;
wenzelm
parents: 31974
diff changeset
    95
  by (tactic "IntPr.fast_tac @{context} 1")
23914
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    96
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    97
lemma mints: "((((P --> Q) --> P) --> P) --> Q) --> Q"
51798
ad3a241def73 uniform Proof.context for hyp_subst_tac;
wenzelm
parents: 31974
diff changeset
    98
  by (tactic "IntPr.fast_tac @{context} 1")
23914
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
    99
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
   100
lemma mints_solovev: "(P --> (Q --> R) --> Q) --> ((P --> Q) --> R) --> R"
51798
ad3a241def73 uniform Proof.context for hyp_subst_tac;
wenzelm
parents: 31974
diff changeset
   101
  by (tactic "IntPr.fast_tac @{context} 1")
23914
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
   102
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
   103
lemma tatsuta: "(((P7 --> P1) --> P10) --> P4 --> P5)  
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
   104
  --> (((P8 --> P2) --> P9) --> P3 --> P10)  
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
   105
  --> (P1 --> P8) --> P6 --> P7  
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
   106
  --> (((P3 --> P2) --> P9) --> P4)  
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
   107
  --> (P1 --> P3) --> (((P6 --> P1) --> P2) --> P9) --> P5"
51798
ad3a241def73 uniform Proof.context for hyp_subst_tac;
wenzelm
parents: 31974
diff changeset
   108
  by (tactic "IntPr.fast_tac @{context} 1")
23914
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
   109
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
   110
lemma tatsuta1: "(((P8 --> P2) --> P9) --> P3 --> P10)  
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
   111
  --> (((P3 --> P2) --> P9) --> P4)  
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
   112
  --> (((P6 --> P1) --> P2) --> P9)  
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
   113
  --> (((P7 --> P1) --> P10) --> P4 --> P5)  
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
   114
  --> (P1 --> P3) --> (P1 --> P8) --> P6 --> P7 --> P5"
51798
ad3a241def73 uniform Proof.context for hyp_subst_tac;
wenzelm
parents: 31974
diff changeset
   115
  by (tactic "IntPr.fast_tac @{context} 1")
23914
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
   116
3e0424305fa4 turned ex/prop.ML, ex/quant.ML into proper theories;
wenzelm
parents:
diff changeset
   117
end