src/LCF/pair.ML
author clasohm
Thu Sep 16 12:20:38 1993 +0200 (1993-09-16)
changeset 0 a5a9c433f639
child 442 13ac1fd0a14d
permissions -rw-r--r--
Initial revision
clasohm@0
     1
val expand_all_PROD = prove_goal LCF.thy
clasohm@0
     2
	"(ALL p. P(p)) <-> (ALL x y. P(<x,y>))"
clasohm@0
     3
	(fn _ => [rtac iffI 1, fast_tac FOL_cs 1, rtac allI 1,
clasohm@0
     4
		  rtac (surj_pairing RS subst) 1, fast_tac FOL_cs 1]);
clasohm@0
     5
clasohm@0
     6
local
clasohm@0
     7
val ppair = read_instantiate [("z","p::'a*'b")] surj_pairing;
clasohm@0
     8
val qpair = read_instantiate [("z","q::'a*'b")] surj_pairing;
clasohm@0
     9
in
clasohm@0
    10
val PROD_less = prove_goal LCF.thy
clasohm@0
    11
	"p::'a*'b << q <-> FST(p) << FST(q) & SND(p) << SND(q)"
clasohm@0
    12
	(fn _ => [EVERY1[rtac iffI,
clasohm@0
    13
		  rtac conjI, etac less_ap_term, etac less_ap_term,
clasohm@0
    14
		  rtac (ppair RS subst), rtac (qpair RS subst),
clasohm@0
    15
		  etac conjE, rtac mono, etac less_ap_term, atac]]);
clasohm@0
    16
end;
clasohm@0
    17
clasohm@0
    18
val PROD_eq = prove_goal LCF.thy "p=q <-> FST(p)=FST(q) & SND(p)=SND(q)"
clasohm@0
    19
	(fn _ => [rtac iffI 1, asm_simp_tac LCF_ss 1,
clasohm@0
    20
		  rewrite_goals_tac [eq_def],
clasohm@0
    21
		  asm_simp_tac (LCF_ss addsimps [PROD_less]) 1]);
clasohm@0
    22
clasohm@0
    23
val PAIR_less = prove_goal LCF.thy "<a,b> << <c,d> <-> a<<c & b<<d"
clasohm@0
    24
	(fn _ => [simp_tac (LCF_ss addsimps [PROD_less])1]);
clasohm@0
    25
clasohm@0
    26
val PAIR_eq = prove_goal LCF.thy "<a,b> = <c,d> <-> a=c & b=d"
clasohm@0
    27
	(fn _ => [simp_tac (LCF_ss addsimps [PROD_eq])1]);
clasohm@0
    28
clasohm@0
    29
val UU_is_UU_UU = prove_goal LCF.thy "<UU,UU> << UU"
clasohm@0
    30
		(fn _ => [simp_tac (LCF_ss addsimps [PROD_less]) 1])
clasohm@0
    31
	RS less_UU RS sym;
clasohm@0
    32
clasohm@0
    33
val LCF_ss = LCF_ss addsimps [PAIR_less,PAIR_eq,UU_is_UU_UU];