src/ZF/OrderType.ML
author lcp
Tue, 12 Jul 1994 18:05:03 +0200
changeset 467 92868dab2939
parent 437 435875e4b21d
child 760 f0200e91b272
permissions -rw-r--r--
new cardinal arithmetic developments
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
     1
(*  Title: 	ZF/OrderType.ML
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
     2
    ID:         $Id$
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
     3
    Author: 	Lawrence C Paulson, Cambridge University Computer Laboratory
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
     4
    Copyright   1994  University of Cambridge
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
     5
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
     6
For OrderType.thy.  Order types in Zermelo-Fraenkel Set Theory 
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
     7
*)
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
     8
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
     9
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    10
open OrderType;
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    11
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
    12
goalw OrderType.thy [ordermap_def,ordertype_def]
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
    13
    "ordermap(A,r) : A -> ordertype(A,r)";
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
    14
by (rtac lam_type 1);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
    15
by (rtac (lamI RS imageI) 1);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
    16
by (REPEAT (assume_tac 1));
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
    17
val ordermap_type = result();
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
    18
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    19
(** Unfolding of ordermap **)
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    20
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
    21
(*Useful for cardinality reasoning; see CardinalArith.ML*)
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    22
goalw OrderType.thy [ordermap_def, pred_def]
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    23
    "!!r. [| wf[A](r);  x:A |] ==> \
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
    24
\         ordermap(A,r) ` x = ordermap(A,r) `` pred(A,x,r)";
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
    25
by (asm_simp_tac ZF_ss 1);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
    26
by (etac (wfrec_on RS trans) 1);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
    27
by (assume_tac 1);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
    28
by (asm_simp_tac (ZF_ss addsimps [subset_iff, image_lam,
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
    29
                                  vimage_singleton_iff]) 1);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
    30
val ordermap_eq_image = result();
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
    31
467
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
    32
(*Useful for rewriting PROVIDED pred is not unfolded until later!*)
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
    33
goal OrderType.thy 
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
    34
    "!!r. [| wf[A](r);  x:A |] ==> \
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    35
\         ordermap(A,r) ` x = {ordermap(A,r)`y . y : pred(A,x,r)}";
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
    36
by (asm_simp_tac (ZF_ss addsimps [ordermap_eq_image, pred_subset, 
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
    37
				  ordermap_type RS image_fun]) 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    38
val ordermap_pred_unfold = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    39
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    40
(*pred-unfolded version.  NOT suitable for rewriting -- loops!*)
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    41
val ordermap_unfold = rewrite_rule [pred_def] ordermap_pred_unfold;
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    42
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    43
(** Showing that ordermap, ordertype yield ordinals **)
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    44
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    45
fun ordermap_elim_tac i =
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    46
    EVERY [etac (ordermap_unfold RS equalityD1 RS subsetD RS RepFunE) i,
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    47
	   assume_tac (i+1),
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    48
	   assume_tac i];
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    49
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    50
goalw OrderType.thy [well_ord_def, tot_ord_def, part_ord_def]
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    51
    "!!r. [| well_ord(A,r);  x:A |] ==> Ord(ordermap(A,r) ` x)";
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    52
by (safe_tac ZF_cs);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    53
by (wf_on_ind_tac "x" [] 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    54
by (asm_simp_tac (ZF_ss addsimps [ordermap_pred_unfold]) 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    55
by (rtac (Ord_is_Transset RSN (2,OrdI)) 1);
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
    56
by (rewrite_goals_tac [pred_def,Transset_def]);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    57
by (fast_tac ZF_cs 2);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    58
by (safe_tac ZF_cs);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    59
by (ordermap_elim_tac 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    60
by (fast_tac (ZF_cs addSEs [trans_onD]) 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    61
val Ord_ordermap = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    62
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    63
goalw OrderType.thy [ordertype_def]
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    64
    "!!r. well_ord(A,r) ==> Ord(ordertype(A,r))";
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    65
by (rtac ([ordermap_type, subset_refl] MRS image_fun RS ssubst) 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    66
by (rtac (Ord_is_Transset RSN (2,OrdI)) 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    67
by (fast_tac (ZF_cs addIs [Ord_ordermap]) 2);
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
    68
by (rewrite_goals_tac [Transset_def,well_ord_def]);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    69
by (safe_tac ZF_cs);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    70
by (ordermap_elim_tac 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    71
by (fast_tac ZF_cs 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    72
val Ord_ordertype = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    73
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    74
(** ordermap preserves the orderings in both directions **)
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    75
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    76
goal OrderType.thy
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    77
    "!!r. [| <w,x>: r;  wf[A](r);  w: A; x: A |] ==>	\
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    78
\         ordermap(A,r)`w : ordermap(A,r)`x";
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    79
by (eres_inst_tac [("x1", "x")] (ordermap_unfold RS ssubst) 1);
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
    80
by (assume_tac 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    81
by (fast_tac ZF_cs 1);
467
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
    82
val ordermap_mono = result();
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    83
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    84
(*linearity of r is crucial here*)
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    85
goalw OrderType.thy [well_ord_def, tot_ord_def]
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    86
    "!!r. [| ordermap(A,r)`w : ordermap(A,r)`x;  well_ord(A,r);  \
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    87
\            w: A; x: A |] ==> <w,x>: r";
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    88
by (safe_tac ZF_cs);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    89
by (linear_case_tac 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    90
by (fast_tac (ZF_cs addSEs [mem_not_refl RS notE]) 1);
467
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
    91
by (dtac ordermap_mono 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    92
by (REPEAT_SOME assume_tac);
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
    93
by (etac mem_asym 1);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
    94
by (assume_tac 1);
467
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
    95
val converse_ordermap_mono = result();
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    96
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    97
val ordermap_surj = 
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    98
    (ordermap_type RS surj_image) |>
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    99
    rewrite_rule [symmetric ordertype_def] |> 
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   100
    standard;
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   101
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   102
goalw OrderType.thy [well_ord_def, tot_ord_def, bij_def, inj_def]
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   103
    "!!r. well_ord(A,r) ==> ordermap(A,r) : bij(A, ordertype(A,r))";
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   104
by (safe_tac ZF_cs);
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   105
by (rtac ordermap_type 1);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   106
by (rtac ordermap_surj 2);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   107
by (linear_case_tac 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   108
(*The two cases yield similar contradictions*)
467
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   109
by (ALLGOALS (dtac ordermap_mono));
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   110
by (REPEAT_SOME assume_tac);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   111
by (ALLGOALS (asm_full_simp_tac (ZF_ss addsimps [mem_not_refl])));
467
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   112
val ordermap_bij = result();
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   113
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   114
goalw OrderType.thy [ord_iso_def]
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   115
 "!!r. well_ord(A,r) ==> \
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   116
\      ordermap(A,r) : ord_iso(A,r, ordertype(A,r), Memrel(ordertype(A,r)))";
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   117
by (safe_tac ZF_cs);
467
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   118
by (rtac ordermap_bij 1);
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   119
by (assume_tac 1);
467
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   120
by (fast_tac (ZF_cs addSEs [MemrelE, converse_ordermap_mono]) 2);
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   121
by (rewtac well_ord_def);
467
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   122
by (fast_tac (ZF_cs addSIs [MemrelI, ordermap_mono,
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   123
			    ordermap_type RS apply_type]) 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   124
val ordertype_ord_iso = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   125
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   126
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   127
(** Unfolding of ordertype **)
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   128
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   129
goalw OrderType.thy [ordertype_def]
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   130
    "ordertype(A,r) = {ordermap(A,r)`y . y : A}";
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   131
by (rtac ([ordermap_type, subset_refl] MRS image_fun) 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   132
val ordertype_unfold = result();
467
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   133
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   134
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   135
(** Ordertype of Memrel **)
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   136
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   137
(*Requires Ordinal.thy as parent; otherwise could be in Order.ML*)
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   138
goal OrderType.thy "!!i. Ord(i) ==> well_ord(i, Memrel(i))";
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   139
by (rtac well_ordI 1);
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   140
by (rtac (wf_Memrel RS wf_imp_wf_on) 1);
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   141
by (asm_simp_tac (ZF_ss addsimps [linear_def, Memrel_iff]) 1);
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   142
by (REPEAT (resolve_tac [ballI, Ord_linear] 1));;
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   143
by (REPEAT (eresolve_tac [asm_rl, Ord_in_Ord] 1));;
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   144
val well_ord_Memrel = result();
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   145
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   146
goal OrderType.thy "!!i. [| Ord(i);  j:i |] ==> ordermap(i,Memrel(i)) ` j = j";
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   147
by (eresolve_tac [Ord_induct] 1);
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   148
ba 1;
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   149
by (asm_simp_tac (ZF_ss addsimps
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   150
	     [well_ord_Memrel RS well_ord_is_wf RS ordermap_pred_unfold]) 1);
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   151
by (asm_simp_tac (ZF_ss addsimps [pred_def, Memrel_iff]) 1);
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   152
by (dresolve_tac [OrdmemD] 1);
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   153
by (assume_tac 1);
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   154
by (fast_tac eq_cs 1);
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   155
val ordermap_Memrel = result();
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   156
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   157
goal OrderType.thy "!!i. Ord(i) ==> ordertype(i,Memrel(i)) = i";
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   158
by (asm_simp_tac (ZF_ss addsimps [ordertype_unfold, ordermap_Memrel]) 1);
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   159
val ordertype_Memrel = result();
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   160
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   161
(** Ordertype of rvimage **)
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   162
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   163
goal OrderType.thy
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   164
    "!!f. [| f: bij(A,B);  well_ord(B,r);  x:A |] ==>	\
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   165
\         ordermap(A,rvimage(A,f,r)) ` x = ordermap(B,r) ` (f`x)";
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   166
by (metacut_tac well_ord_rvimage 1 THEN 
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   167
    etac bij_is_inj 2 THEN assume_tac 2);
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   168
by (res_inst_tac [("A","A"), ("a","x")] wf_on_induct 1 THEN
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   169
    REPEAT (ares_tac [well_ord_is_wf] 1));
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   170
by (asm_simp_tac
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   171
    (bij_inverse_ss addsimps [ordermap_pred_unfold, well_ord_is_wf]) 1);
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   172
by (asm_simp_tac (ZF_ss addsimps [pred_def, rvimage_iff]) 1);
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   173
by (safe_tac eq_cs);
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   174
by (fast_tac bij_apply_cs 1);
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   175
by (res_inst_tac [("a", "converse(f)`xb")] RepFun_eqI 1);
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   176
by (ALLGOALS (asm_simp_tac bij_inverse_ss));
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   177
val bij_ordermap_vimage = result();
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   178
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   179
goal OrderType.thy
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   180
    "!!f. [| f: bij(A,B);  well_ord(B,r) |] ==>	\
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   181
\    ordertype(A,rvimage(A,f,r)) = ordertype(B,r)";
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   182
by (asm_simp_tac (ZF_ss addsimps [ordertype_unfold, bij_ordermap_vimage]) 1);
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   183
by (safe_tac eq_cs);
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   184
by (fast_tac bij_apply_cs 1);
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   185
by (res_inst_tac [("a", "converse(f)`xa")] RepFun_eqI 1);
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   186
by (ALLGOALS (asm_simp_tac bij_inverse_ss));
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   187
val bij_ordertype_vimage = result();
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   188
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   189
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   190
goal OrderType.thy
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   191
    "!!r. [| well_ord(A,r);  y:A;  z: pred(A,y,r) |] ==>	\
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   192
\	  ordermap(pred(A,y,r), r) ` z = ordermap(A, r) ` z";
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   193
by (forward_tac [[well_ord_is_wf, pred_subset] MRS wf_on_subset_A] 1);
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   194
by (wf_on_ind_tac "z" [] 1);
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   195
by (safe_tac (ZF_cs addSEs [predE]));
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   196
by (asm_simp_tac
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   197
    (ZF_ss addsimps [ordermap_pred_unfold, well_ord_is_wf, pred_iff]) 1);
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   198
(*combining these two simplifications LOOPS! *)
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   199
by (asm_simp_tac (ZF_ss addsimps [pred_pred_eq]) 1);
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   200
by (asm_full_simp_tac (ZF_ss addsimps [pred_def]) 1);
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   201
br (refl RSN (2,RepFun_cong)) 1;
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   202
bd well_ord_is_trans_on 1;
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   203
by (fast_tac (eq_cs addSEs [trans_onD]) 1);
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   204
val ordermap_pred_eq_ordermap = result();
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   205
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   206
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   207
goal OrderType.thy
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   208
    "!!r. [| well_ord(A,r);  i: ordertype(A,r) |] ==>	\
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   209
\	  EX B. B<=A & i = ordertype(B,r)";
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   210
by (dresolve_tac [ordertype_unfold RS equalityD1 RS subsetD] 1);
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   211
by (res_inst_tac [("x", "pred(A, converse(ordermap(A,r))`i, r)")]  exI  1);
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   212
by (safe_tac (ZF_cs addSEs [predE]));
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   213
by (asm_simp_tac (ZF_ss addsimps [ordermap_bij RS left_inverse_bij]) 1);
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   214
by (asm_simp_tac (ZF_ss addsimps
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   215
		  [well_ord_is_wf RS ordermap_pred_unfold]) 1);
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   216
by (asm_simp_tac (ZF_ss addsimps [ordertype_unfold,
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   217
				  ordermap_pred_eq_ordermap]) 1);
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   218
val ordertype_subset = result();
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   219