src/Pure/Pure.thy
author wenzelm
Wed Feb 22 22:18:32 2006 +0100 (2006-02-22)
changeset 19121 d7fd5415a781
parent 19048 2b875dd5eb4c
child 19783 82f365a14960
permissions -rw-r--r--
simplified Pure conjunction;
wenzelm@15803
     1
(*  Title:      Pure/Pure.thy
wenzelm@15803
     2
    ID:         $Id$
wenzelm@18710
     3
wenzelm@18710
     4
The actual Pure theory.
wenzelm@18466
     5
*)
wenzelm@15803
     6
wenzelm@18466
     7
header {* The Pure theory *}
wenzelm@15803
     8
wenzelm@15803
     9
theory Pure
wenzelm@15803
    10
imports ProtoPure
wenzelm@15803
    11
begin
wenzelm@15803
    12
wenzelm@19048
    13
setup  -- {* Common setup of internal components *}
wenzelm@15803
    14
wenzelm@18710
    15
wenzelm@18466
    16
subsection {* Meta-level connectives in assumptions *}
wenzelm@15803
    17
wenzelm@15803
    18
lemma meta_mp:
wenzelm@18019
    19
  assumes "PROP P ==> PROP Q" and "PROP P"
wenzelm@15803
    20
  shows "PROP Q"
wenzelm@18019
    21
    by (rule `PROP P ==> PROP Q` [OF `PROP P`])
wenzelm@15803
    22
wenzelm@15803
    23
lemma meta_spec:
wenzelm@18019
    24
  assumes "!!x. PROP P(x)"
wenzelm@15803
    25
  shows "PROP P(x)"
wenzelm@18019
    26
    by (rule `!!x. PROP P(x)`)
wenzelm@15803
    27
wenzelm@15803
    28
lemmas meta_allE = meta_spec [elim_format]
wenzelm@15803
    29
wenzelm@18466
    30
wenzelm@18466
    31
subsection {* Meta-level conjunction *}
wenzelm@18466
    32
wenzelm@18466
    33
locale (open) meta_conjunction_syntax =
wenzelm@18466
    34
  fixes meta_conjunction :: "prop => prop => prop"  (infixr "&&" 2)
wenzelm@18466
    35
wenzelm@18466
    36
parse_translation {*
wenzelm@18466
    37
  [("\<^fixed>meta_conjunction", fn [t, u] => Logic.mk_conjunction (t, u))]
wenzelm@18466
    38
*}
wenzelm@18466
    39
wenzelm@18466
    40
lemma all_conjunction:
wenzelm@18466
    41
  includes meta_conjunction_syntax
wenzelm@18466
    42
  shows "(!!x. PROP A(x) && PROP B(x)) == ((!!x. PROP A(x)) && (!!x. PROP B(x)))"
wenzelm@18466
    43
proof
wenzelm@18466
    44
  assume conj: "!!x. PROP A(x) && PROP B(x)"
wenzelm@19121
    45
  show "(\<And>x. PROP A(x)) && (\<And>x. PROP B(x))"
wenzelm@19121
    46
  proof -
wenzelm@18466
    47
    fix x
wenzelm@19121
    48
    from conj show "PROP A(x)" by (rule conjunctionD1)
wenzelm@19121
    49
    from conj show "PROP B(x)" by (rule conjunctionD2)
wenzelm@18466
    50
  qed
wenzelm@18466
    51
next
wenzelm@18466
    52
  assume conj: "(!!x. PROP A(x)) && (!!x. PROP B(x))"
wenzelm@18466
    53
  fix x
wenzelm@19121
    54
  show "PROP A(x) && PROP B(x)"
wenzelm@19121
    55
  proof -
wenzelm@19121
    56
    show "PROP A(x)" by (rule conj [THEN conjunctionD1, rule_format])
wenzelm@19121
    57
    show "PROP B(x)" by (rule conj [THEN conjunctionD2, rule_format])
wenzelm@18466
    58
  qed
wenzelm@18466
    59
qed
wenzelm@18466
    60
wenzelm@19121
    61
lemma imp_conjunction:
wenzelm@18466
    62
  includes meta_conjunction_syntax
wenzelm@19121
    63
  shows "(PROP A ==> PROP B && PROP C) == (PROP A ==> PROP B) && (PROP A ==> PROP C)"
wenzelm@18836
    64
proof
wenzelm@18466
    65
  assume conj: "PROP A ==> PROP B && PROP C"
wenzelm@19121
    66
  show "(PROP A ==> PROP B) && (PROP A ==> PROP C)"
wenzelm@19121
    67
  proof -
wenzelm@18466
    68
    assume "PROP A"
wenzelm@19121
    69
    from conj [OF `PROP A`] show "PROP B" by (rule conjunctionD1)
wenzelm@19121
    70
    from conj [OF `PROP A`] show "PROP C" by (rule conjunctionD2)
wenzelm@18466
    71
  qed
wenzelm@18466
    72
next
wenzelm@18466
    73
  assume conj: "(PROP A ==> PROP B) && (PROP A ==> PROP C)"
wenzelm@18466
    74
  assume "PROP A"
wenzelm@19121
    75
  show "PROP B && PROP C"
wenzelm@19121
    76
  proof -
wenzelm@19121
    77
    from `PROP A` show "PROP B" by (rule conj [THEN conjunctionD1])
wenzelm@19121
    78
    from `PROP A` show "PROP C" by (rule conj [THEN conjunctionD2])
wenzelm@18466
    79
  qed
wenzelm@18466
    80
qed
wenzelm@18466
    81
wenzelm@18466
    82
lemma conjunction_imp:
wenzelm@18466
    83
  includes meta_conjunction_syntax
wenzelm@18466
    84
  shows "(PROP A && PROP B ==> PROP C) == (PROP A ==> PROP B ==> PROP C)"
wenzelm@18466
    85
proof
wenzelm@18466
    86
  assume r: "PROP A && PROP B ==> PROP C"
wenzelm@18466
    87
  assume "PROP A" and "PROP B"
wenzelm@18466
    88
  show "PROP C" by (rule r) -
wenzelm@18466
    89
next
wenzelm@18466
    90
  assume r: "PROP A ==> PROP B ==> PROP C"
wenzelm@18466
    91
  assume conj: "PROP A && PROP B"
wenzelm@18466
    92
  show "PROP C"
wenzelm@18466
    93
  proof (rule r)
wenzelm@19121
    94
    from conj show "PROP A" by (rule conjunctionD1)
wenzelm@19121
    95
    from conj show "PROP B" by (rule conjunctionD2)
wenzelm@18466
    96
  qed
wenzelm@18466
    97
qed
wenzelm@18466
    98
wenzelm@15803
    99
end