src/HOLCF/Cprod2.ML
author wenzelm
Mon, 22 Oct 2001 17:58:26 +0200
changeset 11880 a625de9ad62a
parent 9248 e1dee89de037
child 12030 46d57d0290a2
permissions -rw-r--r--
quick_and_dirty_prove_goalw_cterm;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9245
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
     1
(*  Title:      HOLCF/Cprod2
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
     2
    ID:         $Id$
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1267
diff changeset
     3
    Author:     Franz Regensburger
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
     4
    Copyright   1993 Technische Universitaet Muenchen
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
     5
9245
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
     6
Class Instance *::(pcpo,pcpo)po
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
     7
*)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
     8
2640
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2033
diff changeset
     9
(* for compatibility with old HOLCF-Version *)
9248
e1dee89de037 massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents: 9245
diff changeset
    10
Goal "(op <<)=(%x y. fst x<<fst y & snd x<<snd y)";
9245
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    11
by (fold_goals_tac [less_cprod_def]);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    12
by (rtac refl 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    13
qed "inst_cprod_po";
2640
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2033
diff changeset
    14
9248
e1dee89de037 massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents: 9245
diff changeset
    15
Goal "(x1,y1) << (x2,y2) ==> x1 << x2 & y1 << y2";
e1dee89de037 massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents: 9245
diff changeset
    16
by (asm_full_simp_tac (simpset() addsimps [inst_cprod_po]) 1);
9245
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    17
qed "less_cprod4c";
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    18
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    19
(* ------------------------------------------------------------------------ *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    20
(* type cprod is pointed                                                    *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    21
(* ------------------------------------------------------------------------ *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    22
9248
e1dee89de037 massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents: 9245
diff changeset
    23
Goal  "(UU,UU)<<p";
9245
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    24
by (simp_tac(simpset() addsimps[inst_cprod_po])1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    25
qed "minimal_cprod";
2640
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2033
diff changeset
    26
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2033
diff changeset
    27
bind_thm ("UU_cprod_def",minimal_cprod RS minimal2UU RS sym);
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2033
diff changeset
    28
9248
e1dee89de037 massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents: 9245
diff changeset
    29
Goal "EX x::'a*'b. ALL y. x<<y";
9245
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    30
by (res_inst_tac [("x","(UU,UU)")] exI 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    31
by (rtac (minimal_cprod RS allI) 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    32
qed "least_cprod";
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    33
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    34
(* ------------------------------------------------------------------------ *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    35
(* Pair <_,_>  is monotone in both arguments                                *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    36
(* ------------------------------------------------------------------------ *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    37
9248
e1dee89de037 massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents: 9245
diff changeset
    38
Goalw [monofun]  "monofun Pair";
9245
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    39
by (strip_tac 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    40
by (rtac (less_fun RS iffD2) 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    41
by (strip_tac 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    42
by (asm_simp_tac (simpset() addsimps [inst_cprod_po]) 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    43
qed "monofun_pair1";
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    44
9248
e1dee89de037 massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents: 9245
diff changeset
    45
Goalw [monofun]  "monofun(Pair x)";
9245
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    46
by (asm_simp_tac (simpset() addsimps [inst_cprod_po]) 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    47
qed "monofun_pair2";
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    48
9248
e1dee89de037 massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents: 9245
diff changeset
    49
Goal "[|x1<<x2; y1<<y2|] ==> (x1::'a::cpo,y1::'b::cpo)<<(x2,y2)";
9245
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    50
by (rtac trans_less 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    51
by (rtac (monofun_pair1 RS monofunE RS spec RS spec RS mp RS (less_fun RS iffD1 RS spec)) 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    52
by (rtac (monofun_pair2 RS monofunE RS spec RS spec RS mp) 2);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    53
by (atac 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    54
by (atac 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    55
qed "monofun_pair";
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    56
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    57
(* ------------------------------------------------------------------------ *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    58
(* fst and snd are monotone                                                 *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    59
(* ------------------------------------------------------------------------ *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    60
9248
e1dee89de037 massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents: 9245
diff changeset
    61
Goalw [monofun]  "monofun fst";
9245
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    62
by (strip_tac 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    63
by (res_inst_tac [("p","x")] PairE 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    64
by (hyp_subst_tac 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    65
by (res_inst_tac [("p","y")] PairE 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    66
by (hyp_subst_tac 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    67
by (Asm_simp_tac  1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    68
by (etac (less_cprod4c RS conjunct1) 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    69
qed "monofun_fst";
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    70
9248
e1dee89de037 massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents: 9245
diff changeset
    71
Goalw [monofun]  "monofun snd";
9245
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    72
by (strip_tac 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    73
by (res_inst_tac [("p","x")] PairE 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    74
by (hyp_subst_tac 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    75
by (res_inst_tac [("p","y")] PairE 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    76
by (hyp_subst_tac 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    77
by (Asm_simp_tac  1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    78
by (etac (less_cprod4c RS conjunct2) 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    79
qed "monofun_snd";
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    80
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    81
(* ------------------------------------------------------------------------ *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    82
(* the type 'a * 'b is a cpo                                                *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    83
(* ------------------------------------------------------------------------ *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    84
9248
e1dee89de037 massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents: 9245
diff changeset
    85
Goal 
9245
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    86
"chain S ==> range S<<|(lub(range(%i. fst(S i))),lub(range(%i. snd(S i))))";
9248
e1dee89de037 massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents: 9245
diff changeset
    87
by (rtac (is_lubI) 1);
e1dee89de037 massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents: 9245
diff changeset
    88
by (rtac (ub_rangeI) 1);
9245
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    89
by (res_inst_tac [("t","S i")] (surjective_pairing RS ssubst) 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    90
by (rtac monofun_pair 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    91
by (rtac is_ub_thelub 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    92
by (etac (monofun_fst RS ch2ch_monofun) 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    93
by (rtac is_ub_thelub 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    94
by (etac (monofun_snd RS ch2ch_monofun) 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    95
by (strip_tac 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    96
by (res_inst_tac [("t","u")] (surjective_pairing RS ssubst) 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    97
by (rtac monofun_pair 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    98
by (rtac is_lub_thelub 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
    99
by (etac (monofun_fst RS ch2ch_monofun) 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
   100
by (etac (monofun_fst RS ub2ub_monofun) 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
   101
by (rtac is_lub_thelub 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
   102
by (etac (monofun_snd RS ch2ch_monofun) 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
   103
by (etac (monofun_snd RS ub2ub_monofun) 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
   104
qed "lub_cprod";
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
   105
1779
1155c06fa956 introduced forgotten bind_thm calls
oheimb
parents: 1461
diff changeset
   106
bind_thm ("thelub_cprod", lub_cprod RS thelubI);
1168
74be52691d62 The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents: 899
diff changeset
   107
(*
4721
c8a8482a8124 renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
oheimb
parents: 4098
diff changeset
   108
"chain ?S1 ==>
1168
74be52691d62 The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents: 899
diff changeset
   109
 lub (range ?S1) =
74be52691d62 The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents: 899
diff changeset
   110
 (lub (range (%i. fst (?S1 i))), lub (range (%i. snd (?S1 i))))" : thm
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
   111
1168
74be52691d62 The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents: 899
diff changeset
   112
*)
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
   113
9248
e1dee89de037 massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents: 9245
diff changeset
   114
Goal "chain(S::nat=>'a::cpo*'b::cpo)==>EX x. range S<<| x";
9245
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
   115
by (rtac exI 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
   116
by (etac lub_cprod 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 4721
diff changeset
   117
qed "cpo_cprod";
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
   118
1168
74be52691d62 The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents: 899
diff changeset
   119