src/HOL/ex/Coherent.thy
author griff
Tue Apr 03 17:26:30 2012 +0900 (2012-04-03)
changeset 47433 07f4bf913230
parent 32734 06c13b2e562e
child 58889 5b7a9633cfa8
permissions -rw-r--r--
renamed "rel_comp" to "relcomp" (to be consistent with, e.g., "relpow")
wenzelm@32734
     1
(*  Title:      HOL/ex/Coherent.thy
berghofe@28323
     2
    Author:     Stefan Berghofer, TU Muenchen
wenzelm@32734
     3
    Author:     Marc Bezem, Institutt for Informatikk, Universitetet i Bergen 
berghofe@28323
     4
*)
berghofe@28323
     5
wenzelm@32734
     6
header {* Coherent Logic Problems *}
berghofe@28323
     7
wenzelm@32734
     8
theory Coherent
wenzelm@32734
     9
imports Main
wenzelm@32734
    10
begin
berghofe@28323
    11
wenzelm@32734
    12
subsection {* Equivalence of two versions of Pappus' Axiom *}
berghofe@28323
    13
berghofe@28323
    14
no_notation
berghofe@28323
    15
  comp (infixl "o" 55) and
griff@47433
    16
  relcomp (infixr "O" 75)
berghofe@28323
    17
berghofe@28323
    18
lemma p1p2:
berghofe@28323
    19
  assumes
berghofe@28323
    20
  "col a b c l \<and> col d e f m"
berghofe@28323
    21
  "col b f g n \<and> col c e g o"
berghofe@28323
    22
  "col b d h p \<and> col a e h q"
berghofe@28323
    23
  "col c d i r \<and> col a f i s"
berghofe@28323
    24
  "el n o \<Longrightarrow> goal"
berghofe@28323
    25
  "el p q \<Longrightarrow> goal"
berghofe@28323
    26
  "el s r \<Longrightarrow> goal"
berghofe@28323
    27
  "\<And>A. el A A \<Longrightarrow> pl g A \<Longrightarrow> pl h A \<Longrightarrow> pl i A \<Longrightarrow> goal"
berghofe@28323
    28
  "\<And>A B C D. col A B C D \<Longrightarrow> pl A D"
berghofe@28323
    29
  "\<And>A B C D. col A B C D \<Longrightarrow> pl B D"
berghofe@28323
    30
  "\<And>A B C D. col A B C D \<Longrightarrow> pl C D"
berghofe@28323
    31
  "\<And>A B. pl A B \<Longrightarrow> ep A A"
berghofe@28323
    32
  "\<And>A B. ep A B \<Longrightarrow> ep B A"
berghofe@28323
    33
  "\<And>A B C. ep A B \<Longrightarrow> ep B C \<Longrightarrow> ep A C"
berghofe@28323
    34
  "\<And>A B. pl A B \<Longrightarrow> el B B"
berghofe@28323
    35
  "\<And>A B. el A B \<Longrightarrow> el B A"
berghofe@28323
    36
  "\<And>A B C. el A B \<Longrightarrow> el B C \<Longrightarrow> el A C"
berghofe@28323
    37
  "\<And>A B C. ep A B \<Longrightarrow> pl B C \<Longrightarrow> pl A C"
berghofe@28323
    38
  "\<And>A B C. pl A B \<Longrightarrow> el B C \<Longrightarrow> pl A C"
berghofe@28323
    39
  "\<And>A B C D E F G H I J K L M N O P Q.
berghofe@28323
    40
     col A B C D \<Longrightarrow> col E F G H \<Longrightarrow> col B G I J \<Longrightarrow> col C F I K \<Longrightarrow>
berghofe@28323
    41
     col B E L M \<Longrightarrow> col A F L N \<Longrightarrow> col C E O P \<Longrightarrow> col A G O Q \<Longrightarrow>
berghofe@28323
    42
     (\<exists> R. col I L O R) \<or> pl A H \<or> pl B H \<or> pl C H \<or> pl E D \<or> pl F D \<or> pl G D"
berghofe@28323
    43
  "\<And>A B C D. pl A B \<Longrightarrow> pl A C \<Longrightarrow> pl D B \<Longrightarrow> pl D C \<Longrightarrow> ep A D \<or> el B C"
berghofe@28323
    44
  "\<And>A B. ep A A \<Longrightarrow> ep B B \<Longrightarrow> \<exists>C. pl A C \<and> pl B C"
berghofe@28323
    45
  shows goal using assms
berghofe@28323
    46
  by coherent
berghofe@28323
    47
berghofe@28323
    48
lemma p2p1:
berghofe@28323
    49
  assumes
berghofe@28323
    50
  "col a b c l \<and> col d e f m"
berghofe@28323
    51
  "col b f g n \<and> col c e g o"
berghofe@28323
    52
  "col b d h p \<and> col a e h q"
berghofe@28323
    53
  "col c d i r \<and> col a f i s"
berghofe@28323
    54
  "pl a m \<Longrightarrow> goal"
berghofe@28323
    55
  "pl b m \<Longrightarrow> goal"
berghofe@28323
    56
  "pl c m \<Longrightarrow> goal"
berghofe@28323
    57
  "pl d l \<Longrightarrow> goal"
berghofe@28323
    58
  "pl e l \<Longrightarrow> goal"
berghofe@28323
    59
  "pl f l \<Longrightarrow> goal"
berghofe@28323
    60
  "\<And>A. pl g A \<Longrightarrow> pl h A \<Longrightarrow> pl i A \<Longrightarrow> goal"
berghofe@28323
    61
  "\<And>A B C D. col A B C D \<Longrightarrow> pl A D"
berghofe@28323
    62
  "\<And>A B C D. col A B C D \<Longrightarrow> pl B D"
berghofe@28323
    63
  "\<And>A B C D. col A B C D \<Longrightarrow> pl C D"
berghofe@28323
    64
  "\<And>A B. pl A B \<Longrightarrow> ep A A"
berghofe@28323
    65
  "\<And>A B. ep A B \<Longrightarrow> ep B A"
berghofe@28323
    66
  "\<And>A B C. ep A B \<Longrightarrow> ep B C \<Longrightarrow> ep A C"
berghofe@28323
    67
  "\<And>A B. pl A B \<Longrightarrow> el B B"
berghofe@28323
    68
  "\<And>A B. el A B \<Longrightarrow> el B A"
berghofe@28323
    69
  "\<And>A B C. el A B \<Longrightarrow> el B C \<Longrightarrow> el A C"
berghofe@28323
    70
  "\<And>A B C. ep A B \<Longrightarrow> pl B C \<Longrightarrow> pl A C"
berghofe@28323
    71
  "\<And>A B C. pl A B \<Longrightarrow> el B C \<Longrightarrow> pl A C"
berghofe@28323
    72
  "\<And>A B C D E F G H I J K L M N O P Q.
berghofe@28323
    73
     col A B C J \<Longrightarrow> col D E F K \<Longrightarrow> col B F G L \<Longrightarrow> col C E G M \<Longrightarrow>
berghofe@28323
    74
     col B D H N \<Longrightarrow> col A E H O \<Longrightarrow> col C D I P \<Longrightarrow> col A F I Q \<Longrightarrow>
berghofe@28323
    75
     (\<exists> R. col G H I R) \<or> el L M \<or> el N O \<or> el P Q"
berghofe@28323
    76
  "\<And>A B C D. pl C A \<Longrightarrow> pl C B \<Longrightarrow> pl D A \<Longrightarrow> pl D B \<Longrightarrow> ep C D \<or> el A B"
berghofe@28323
    77
  "\<And>A B C. ep A A \<Longrightarrow> ep B B \<Longrightarrow> \<exists>C. pl A C \<and> pl B C"
berghofe@28323
    78
  shows goal using assms
berghofe@28323
    79
  by coherent
berghofe@28323
    80
berghofe@28323
    81
berghofe@28323
    82
subsection {* Preservation of the Diamond Property under reflexive closure *}
berghofe@28323
    83
berghofe@28323
    84
lemma diamond:
berghofe@28323
    85
  assumes
berghofe@28323
    86
  "reflexive_rewrite a b" "reflexive_rewrite a c"
berghofe@28323
    87
  "\<And>A. reflexive_rewrite b A \<Longrightarrow> reflexive_rewrite c A \<Longrightarrow> goal"
berghofe@28323
    88
  "\<And>A. equalish A A" 
berghofe@28323
    89
  "\<And>A B. equalish A B \<Longrightarrow> equalish B A"
berghofe@28323
    90
  "\<And>A B C. equalish A B \<Longrightarrow> reflexive_rewrite B C \<Longrightarrow> reflexive_rewrite A C"
berghofe@28323
    91
  "\<And>A B. equalish A B \<Longrightarrow> reflexive_rewrite A B"
berghofe@28323
    92
  "\<And>A B. rewrite A B \<Longrightarrow> reflexive_rewrite A B"
berghofe@28323
    93
  "\<And>A B. reflexive_rewrite A B \<Longrightarrow> equalish A B \<or> rewrite A B"
berghofe@28323
    94
  "\<And>A B C. rewrite A B \<Longrightarrow> rewrite A C \<Longrightarrow> \<exists>D. rewrite B D \<and> rewrite C D"
berghofe@28323
    95
  shows goal using assms
berghofe@28323
    96
  by coherent
berghofe@28323
    97
berghofe@28323
    98
end