src/FOLP/ex/Propositional_Cla.thy
author paulson
Thu, 14 Jun 2018 14:23:48 +0100
changeset 68446 92ddca1edc43
parent 61337 4645502c3c64
child 69593 3dda49e08b9d
permissions -rw-r--r--
merged
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
26408
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
     1
(*  Title:      FOLP/ex/Propositional_Cla.thy
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
     2
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
     3
    Copyright   1991  University of Cambridge
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
     4
*)
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
     5
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 58957
diff changeset
     6
section \<open>First-Order Logic: propositional examples\<close>
26408
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
     7
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
     8
theory Propositional_Cla
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
     9
imports FOLP
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    10
begin
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    11
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    12
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    13
text "commutative laws of & and | "
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    14
schematic_goal "?p : P & Q  -->  Q & P"
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 58957
diff changeset
    15
  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
26408
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    16
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    17
schematic_goal "?p : P | Q  -->  Q | P"
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 58957
diff changeset
    18
  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
26408
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    19
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    20
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    21
text "associative laws of & and | "
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    22
schematic_goal "?p : (P & Q) & R  -->  P & (Q & R)"
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 58957
diff changeset
    23
  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
26408
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    24
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    25
schematic_goal "?p : (P | Q) | R  -->  P | (Q | R)"
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 58957
diff changeset
    26
  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
26408
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    27
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    28
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    29
text "distributive laws of & and | "
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    30
schematic_goal "?p : (P & Q) | R  --> (P | R) & (Q | R)"
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 58957
diff changeset
    31
  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
26408
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    32
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    33
schematic_goal "?p : (P | R) & (Q | R)  --> (P & Q) | R"
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 58957
diff changeset
    34
  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
26408
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    35
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    36
schematic_goal "?p : (P | Q) & R  --> (P & R) | (Q & R)"
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 58957
diff changeset
    37
  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
26408
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    38
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    39
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    40
schematic_goal "?p : (P & R) | (Q & R)  --> (P | Q) & R"
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 58957
diff changeset
    41
  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
26408
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    42
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    43
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    44
text "Laws involving implication"
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    45
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    46
schematic_goal "?p : (P-->R) & (Q-->R) <-> (P|Q --> R)"
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 58957
diff changeset
    47
  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
26408
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    48
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    49
schematic_goal "?p : (P & Q --> R) <-> (P--> (Q-->R))"
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 58957
diff changeset
    50
  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
26408
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    51
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    52
schematic_goal "?p : ((P-->R)-->R) --> ((Q-->R)-->R) --> (P&Q-->R) --> R"
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 58957
diff changeset
    53
  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
26408
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    54
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    55
schematic_goal "?p : ~(P-->R) --> ~(Q-->R) --> ~(P&Q-->R)"
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 58957
diff changeset
    56
  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
26408
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    57
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    58
schematic_goal "?p : (P --> Q & R) <-> (P-->Q)  &  (P-->R)"
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 58957
diff changeset
    59
  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
26408
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    60
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    61
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    62
text "Propositions-as-types"
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    63
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    64
(*The combinator K*)
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    65
schematic_goal "?p : P --> (Q --> P)"
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 58957
diff changeset
    66
  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
26408
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    67
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    68
(*The combinator S*)
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    69
schematic_goal "?p : (P-->Q-->R)  --> (P-->Q) --> (P-->R)"
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 58957
diff changeset
    70
  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
26408
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    71
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    72
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    73
(*Converse is classical*)
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    74
schematic_goal "?p : (P-->Q) | (P-->R)  -->  (P --> Q | R)"
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 58957
diff changeset
    75
  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
26408
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    76
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    77
schematic_goal "?p : (P-->Q)  -->  (~Q --> ~P)"
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 58957
diff changeset
    78
  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
26408
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    79
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    80
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    81
text "Schwichtenberg's examples (via T. Nipkow)"
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    82
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    83
schematic_goal stab_imp: "?p : (((Q-->R)-->R)-->Q) --> (((P-->Q)-->R)-->R)-->P-->Q"
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 58957
diff changeset
    84
  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
26408
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    85
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    86
schematic_goal stab_to_peirce: "?p : (((P --> R) --> R) --> P) --> (((Q --> R) --> R) --> Q)  
26408
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    87
              --> ((P --> Q) --> P) --> P"
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 58957
diff changeset
    88
  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
26408
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    89
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    90
schematic_goal peirce_imp1: "?p : (((Q --> R) --> Q) --> Q)  
26408
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    91
               --> (((P --> Q) --> R) --> P --> Q) --> P --> Q"
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 58957
diff changeset
    92
  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
26408
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    93
  
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    94
schematic_goal peirce_imp2: "?p : (((P --> R) --> P) --> P) --> ((P --> Q --> R) --> P) --> P"
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 58957
diff changeset
    95
  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
26408
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    96
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    97
schematic_goal mints: "?p : ((((P --> Q) --> P) --> P) --> Q) --> Q"
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 58957
diff changeset
    98
  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
26408
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
    99
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
   100
schematic_goal mints_solovev: "?p : (P --> (Q --> R) --> Q) --> ((P --> Q) --> R) --> R"
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 58957
diff changeset
   101
  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
26408
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
   102
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
   103
schematic_goal tatsuta: "?p : (((P7 --> P1) --> P10) --> P4 --> P5)  
26408
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
   104
          --> (((P8 --> P2) --> P9) --> P3 --> P10)  
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
   105
          --> (P1 --> P8) --> P6 --> P7  
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
   106
          --> (((P3 --> P2) --> P9) --> P4)  
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
   107
          --> (P1 --> P3) --> (((P6 --> P1) --> P2) --> P9) --> P5"
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 58957
diff changeset
   108
  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
26408
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
   109
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
   110
schematic_goal tatsuta1: "?p : (((P8 --> P2) --> P9) --> P3 --> P10)  
26408
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
   111
     --> (((P3 --> P2) --> P9) --> P4)  
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
   112
     --> (((P6 --> P1) --> P2) --> P9)  
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
   113
     --> (((P7 --> P1) --> P10) --> P4 --> P5)  
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
   114
     --> (P1 --> P3) --> (P1 --> P8) --> P6 --> P7 --> P5"
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 58957
diff changeset
   115
  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
26408
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
   116
6964c4799f47 converted legacy ML scripts;
wenzelm
parents:
diff changeset
   117
end