src/LCF/pair.ML
author oheimb
Fri Jun 02 20:38:28 2000 +0200 (2000-06-02)
changeset 9028 8a1ec8f05f14
parent 1461 6bcb44e4d6e5
child 17248 81bf91654e73
permissions -rw-r--r--
added HOL/Prolog
clasohm@1461
     1
(*  Title:      LCF/pair
lcp@660
     2
    ID:         $Id$
clasohm@1461
     3
    Author:     Tobias Nipkow
lcp@660
     4
    Copyright   1992  University of Cambridge
lcp@660
     5
lcp@660
     6
Theory of ordered pairs and products
lcp@660
     7
*)
lcp@660
     8
clasohm@0
     9
val expand_all_PROD = prove_goal LCF.thy
clasohm@1461
    10
        "(ALL p. P(p)) <-> (ALL x y. P(<x,y>))"
clasohm@1461
    11
        (fn _ => [rtac iffI 1, fast_tac FOL_cs 1, rtac allI 1,
clasohm@1461
    12
                  rtac (surj_pairing RS subst) 1, fast_tac FOL_cs 1]);
clasohm@0
    13
clasohm@0
    14
local
clasohm@0
    15
val ppair = read_instantiate [("z","p::'a*'b")] surj_pairing;
clasohm@0
    16
val qpair = read_instantiate [("z","q::'a*'b")] surj_pairing;
clasohm@0
    17
in
clasohm@0
    18
val PROD_less = prove_goal LCF.thy
clasohm@1461
    19
        "(p::'a*'b) << q <-> FST(p) << FST(q) & SND(p) << SND(q)"
clasohm@1461
    20
        (fn _ => [EVERY1[rtac iffI,
clasohm@1461
    21
                  rtac conjI, etac less_ap_term, etac less_ap_term,
clasohm@1461
    22
                  rtac (ppair RS subst), rtac (qpair RS subst),
clasohm@1461
    23
                  etac conjE, rtac mono, etac less_ap_term, atac]]);
clasohm@0
    24
end;
clasohm@0
    25
clasohm@0
    26
val PROD_eq = prove_goal LCF.thy "p=q <-> FST(p)=FST(q) & SND(p)=SND(q)"
clasohm@1461
    27
        (fn _ => [rtac iffI 1, asm_simp_tac LCF_ss 1,
clasohm@1461
    28
                  rewtac eq_def,
clasohm@1461
    29
                  asm_simp_tac (LCF_ss addsimps [PROD_less]) 1]);
clasohm@0
    30
clasohm@0
    31
val PAIR_less = prove_goal LCF.thy "<a,b> << <c,d> <-> a<<c & b<<d"
clasohm@1461
    32
        (fn _ => [simp_tac (LCF_ss addsimps [PROD_less])1]);
clasohm@0
    33
clasohm@0
    34
val PAIR_eq = prove_goal LCF.thy "<a,b> = <c,d> <-> a=c & b=d"
clasohm@1461
    35
        (fn _ => [simp_tac (LCF_ss addsimps [PROD_eq])1]);
clasohm@0
    36
clasohm@0
    37
val UU_is_UU_UU = prove_goal LCF.thy "<UU,UU> << UU"
clasohm@1461
    38
                (fn _ => [simp_tac (LCF_ss addsimps [PROD_less]) 1])
clasohm@1461
    39
        RS less_UU RS sym;
clasohm@0
    40
clasohm@0
    41
val LCF_ss = LCF_ss addsimps [PAIR_less,PAIR_eq,UU_is_UU_UU];