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