src/Sequents/S4.thy
 author paulson Mon Jun 11 14:34:17 2018 +0100 (14 months ago) changeset 68424 02e5a44ffe7d parent 61386 0a29a984a91b permissions -rw-r--r--
the last of the infinite product proofs
```     1 (*  Title:      Sequents/S4.thy
```
```     2     Author:     Martin Coen
```
```     3     Copyright   1991  University of Cambridge
```
```     4 *)
```
```     5
```
```     6 theory S4
```
```     7 imports Modal0
```
```     8 begin
```
```     9
```
```    10 axiomatization where
```
```    11 (* Definition of the star operation using a set of Horn clauses *)
```
```    12 (* For system S4:  gamma * == {[]P | []P : gamma}               *)
```
```    13 (*                 delta * == {<>P | <>P : delta}               *)
```
```    14
```
```    15   lstar0:         "|L>" and
```
```    16   lstar1:         "\$G |L> \$H \<Longrightarrow> []P, \$G |L> []P, \$H" and
```
```    17   lstar2:         "\$G |L> \$H \<Longrightarrow>   P, \$G |L>      \$H" and
```
```    18   rstar0:         "|R>" and
```
```    19   rstar1:         "\$G |R> \$H \<Longrightarrow> <>P, \$G |R> <>P, \$H" and
```
```    20   rstar2:         "\$G |R> \$H \<Longrightarrow>   P, \$G |R>      \$H" and
```
```    21
```
```    22 (* Rules for [] and <> *)
```
```    23
```
```    24   boxR:
```
```    25    "\<lbrakk>\$E |L> \$E';  \$F |R> \$F';  \$G |R> \$G';
```
```    26            \$E'         \<turnstile> \$F', P, \$G'\<rbrakk> \<Longrightarrow> \$E          \<turnstile> \$F, []P, \$G" and
```
```    27   boxL:     "\$E,P,\$F,[]P \<turnstile>         \$G    \<Longrightarrow> \$E, []P, \$F \<turnstile>          \$G" and
```
```    28
```
```    29   diaR:     "\$E          \<turnstile> \$F,P,\$G,<>P   \<Longrightarrow> \$E          \<turnstile> \$F, <>P, \$G" and
```
```    30   diaL:
```
```    31    "\<lbrakk>\$E |L> \$E';  \$F |L> \$F';  \$G |R> \$G';
```
```    32            \$E', P, \$F' \<turnstile>         \$G'\<rbrakk> \<Longrightarrow> \$E, <>P, \$F \<turnstile> \$G"
```
```    33
```
```    34 ML \<open>
```
```    35 structure S4_Prover = Modal_ProverFun
```
```    36 (
```
```    37   val rewrite_rls = @{thms rewrite_rls}
```
```    38   val safe_rls = @{thms safe_rls}
```
```    39   val unsafe_rls = @{thms unsafe_rls} @ [@{thm boxR}, @{thm diaL}]
```
```    40   val bound_rls = @{thms bound_rls} @ [@{thm boxL}, @{thm diaR}]
```
```    41   val aside_rls = [@{thm lstar0}, @{thm lstar1}, @{thm lstar2}, @{thm rstar0},
```
```    42     @{thm rstar1}, @{thm rstar2}]
```
```    43 )
```
```    44 \<close>
```
```    45
```
```    46 method_setup S4_solve =
```
```    47   \<open>Scan.succeed (fn ctxt => SIMPLE_METHOD (S4_Prover.solve_tac ctxt 2))\<close>
```
```    48
```
```    49
```
```    50 (* Theorems of system T from Hughes and Cresswell and Hailpern, LNCS 129 *)
```
```    51
```
```    52 lemma "\<turnstile> []P \<longrightarrow> P" by S4_solve
```
```    53 lemma "\<turnstile> [](P \<longrightarrow> Q) \<longrightarrow> ([]P \<longrightarrow> []Q)" by S4_solve   (* normality*)
```
```    54 lemma "\<turnstile> (P --< Q) \<longrightarrow> []P \<longrightarrow> []Q" by S4_solve
```
```    55 lemma "\<turnstile> P \<longrightarrow> <>P" by S4_solve
```
```    56
```
```    57 lemma "\<turnstile>  [](P \<and> Q) \<longleftrightarrow> []P \<and> []Q" by S4_solve
```
```    58 lemma "\<turnstile>  <>(P \<or> Q) \<longleftrightarrow> <>P \<or> <>Q" by S4_solve
```
```    59 lemma "\<turnstile>  [](P \<longleftrightarrow> Q) \<longleftrightarrow> (P >-< Q)" by S4_solve
```
```    60 lemma "\<turnstile>  <>(P \<longrightarrow> Q) \<longleftrightarrow> ([]P \<longrightarrow> <>Q)" by S4_solve
```
```    61 lemma "\<turnstile>        []P \<longleftrightarrow> \<not> <>(\<not> P)" by S4_solve
```
```    62 lemma "\<turnstile>     [](\<not> P) \<longleftrightarrow> \<not> <>P" by S4_solve
```
```    63 lemma "\<turnstile>       \<not> []P \<longleftrightarrow> <>(\<not> P)" by S4_solve
```
```    64 lemma "\<turnstile>      [][]P \<longleftrightarrow> \<not> <><>(\<not> P)" by S4_solve
```
```    65 lemma "\<turnstile> \<not> <>(P \<or> Q) \<longleftrightarrow> \<not> <>P \<and> \<not> <>Q" by S4_solve
```
```    66
```
```    67 lemma "\<turnstile> []P \<or> []Q \<longrightarrow> [](P \<or> Q)" by S4_solve
```
```    68 lemma "\<turnstile> <>(P \<and> Q) \<longrightarrow> <>P \<and> <>Q" by S4_solve
```
```    69 lemma "\<turnstile> [](P \<or> Q) \<longrightarrow> []P \<or> <>Q" by S4_solve
```
```    70 lemma "\<turnstile> <>P \<and> []Q \<longrightarrow> <>(P \<and> Q)" by S4_solve
```
```    71 lemma "\<turnstile> [](P \<or> Q) \<longrightarrow> <>P \<or> []Q" by S4_solve
```
```    72 lemma "\<turnstile> <>(P \<longrightarrow> (Q \<and> R)) \<longrightarrow> ([]P \<longrightarrow> <>Q) \<and> ([]P \<longrightarrow> <>R)" by S4_solve
```
```    73 lemma "\<turnstile> (P --< Q) \<and> (Q --< R) \<longrightarrow> (P --< R)" by S4_solve
```
```    74 lemma "\<turnstile> []P \<longrightarrow> <>Q \<longrightarrow> <>(P \<and> Q)" by S4_solve
```
```    75
```
```    76
```
```    77 (* Theorems of system S4 from Hughes and Cresswell, p.46 *)
```
```    78
```
```    79 lemma "\<turnstile> []A \<longrightarrow> A" by S4_solve             (* refexivity *)
```
```    80 lemma "\<turnstile> []A \<longrightarrow> [][]A" by S4_solve         (* transitivity *)
```
```    81 lemma "\<turnstile> []A \<longrightarrow> <>A" by S4_solve           (* seriality *)
```
```    82 lemma "\<turnstile> <>[](<>A \<longrightarrow> []<>A)" by S4_solve
```
```    83 lemma "\<turnstile> <>[](<>[]A \<longrightarrow> []A)" by S4_solve
```
```    84 lemma "\<turnstile> []P \<longleftrightarrow> [][]P" by S4_solve
```
```    85 lemma "\<turnstile> <>P \<longleftrightarrow> <><>P" by S4_solve
```
```    86 lemma "\<turnstile> <>[]<>P \<longrightarrow> <>P" by S4_solve
```
```    87 lemma "\<turnstile> []<>P \<longleftrightarrow> []<>[]<>P" by S4_solve
```
```    88 lemma "\<turnstile> <>[]P \<longleftrightarrow> <>[]<>[]P" by S4_solve
```
```    89
```
```    90 (* Theorems for system S4 from Hughes and Cresswell, p.60 *)
```
```    91
```
```    92 lemma "\<turnstile> []P \<or> []Q \<longleftrightarrow> []([]P \<or> []Q)" by S4_solve
```
```    93 lemma "\<turnstile> ((P >-< Q) --< R) \<longrightarrow> ((P >-< Q) --< []R)" by S4_solve
```
```    94
```
```    95 (* These are from Hailpern, LNCS 129 *)
```
```    96
```
```    97 lemma "\<turnstile> [](P \<and> Q) \<longleftrightarrow> []P \<and> []Q" by S4_solve
```
```    98 lemma "\<turnstile> <>(P \<or> Q) \<longleftrightarrow> <>P \<or> <>Q" by S4_solve
```
```    99 lemma "\<turnstile> <>(P \<longrightarrow> Q) \<longleftrightarrow> ([]P \<longrightarrow> <>Q)" by S4_solve
```
```   100
```
```   101 lemma "\<turnstile> [](P \<longrightarrow> Q) \<longrightarrow> (<>P \<longrightarrow> <>Q)" by S4_solve
```
```   102 lemma "\<turnstile> []P \<longrightarrow> []<>P" by S4_solve
```
```   103 lemma "\<turnstile> <>[]P \<longrightarrow> <>P" by S4_solve
```
```   104
```
```   105 lemma "\<turnstile> []P \<or> []Q \<longrightarrow> [](P \<or> Q)" by S4_solve
```
```   106 lemma "\<turnstile> <>(P \<and> Q) \<longrightarrow> <>P \<and> <>Q" by S4_solve
```
```   107 lemma "\<turnstile> [](P \<or> Q) \<longrightarrow> []P \<or> <>Q" by S4_solve
```
```   108 lemma "\<turnstile> <>P \<and> []Q \<longrightarrow> <>(P \<and> Q)" by S4_solve
```
```   109 lemma "\<turnstile> [](P \<or> Q) \<longrightarrow> <>P \<or> []Q" by S4_solve
```
```   110
```
```   111 end
```