author | berghofe |
Thu, 03 Jan 2008 23:17:01 +0100 | |
changeset 25822 | 05756950011c |
parent 24893 | b8ef7afe3a6b |
child 26056 | 6a0801279f4c |
permissions | -rw-r--r-- |
1478 | 1 |
(* Title: ZF/OrderType.thy |
435 | 2 |
ID: $Id$ |
1478 | 3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
435 | 4 |
Copyright 1994 University of Cambridge |
5 |
||
6 |
*) |
|
7 |
||
13356 | 8 |
header{*Order Types and Ordinal Arithmetic*} |
9 |
||
16417 | 10 |
theory OrderType imports OrderArith OrdQuant Nat begin |
13221 | 11 |
|
13356 | 12 |
text{*The order type of a well-ordering is the least ordinal isomorphic to it. |
13 |
Ordinal arithmetic is traditionally defined in terms of order types, as it is |
|
14 |
here. But a definition by transfinite recursion would be much simpler!*} |
|
15 |
||
24893 | 16 |
definition |
17 |
ordermap :: "[i,i]=>i" where |
|
13125
be50e0b050b2
ordinal addition now coerces its arguments to ordinals
paulson
parents:
12114
diff
changeset
|
18 |
"ordermap(A,r) == lam x:A. wfrec[A](r, x, %x f. f `` pred(A,x,r))" |
435 | 19 |
|
24893 | 20 |
definition |
21 |
ordertype :: "[i,i]=>i" where |
|
13125
be50e0b050b2
ordinal addition now coerces its arguments to ordinals
paulson
parents:
12114
diff
changeset
|
22 |
"ordertype(A,r) == ordermap(A,r)``A" |
850 | 23 |
|
24893 | 24 |
definition |
13125
be50e0b050b2
ordinal addition now coerces its arguments to ordinals
paulson
parents:
12114
diff
changeset
|
25 |
(*alternative definition of ordinal numbers*) |
24893 | 26 |
Ord_alt :: "i => o" where |
13125
be50e0b050b2
ordinal addition now coerces its arguments to ordinals
paulson
parents:
12114
diff
changeset
|
27 |
"Ord_alt(X) == well_ord(X, Memrel(X)) & (ALL u:X. u=pred(X, u, Memrel(X)))" |
435 | 28 |
|
24893 | 29 |
definition |
13125
be50e0b050b2
ordinal addition now coerces its arguments to ordinals
paulson
parents:
12114
diff
changeset
|
30 |
(*coercion to ordinal: if not, just 0*) |
24893 | 31 |
ordify :: "i=>i" where |
13125
be50e0b050b2
ordinal addition now coerces its arguments to ordinals
paulson
parents:
12114
diff
changeset
|
32 |
"ordify(x) == if Ord(x) then x else 0" |
be50e0b050b2
ordinal addition now coerces its arguments to ordinals
paulson
parents:
12114
diff
changeset
|
33 |
|
24893 | 34 |
definition |
850 | 35 |
(*ordinal multiplication*) |
24893 | 36 |
omult :: "[i,i]=>i" (infixl "**" 70) where |
13125
be50e0b050b2
ordinal addition now coerces its arguments to ordinals
paulson
parents:
12114
diff
changeset
|
37 |
"i ** j == ordertype(j*i, rmult(j,Memrel(j),i,Memrel(i)))" |
850 | 38 |
|
24893 | 39 |
definition |
850 | 40 |
(*ordinal addition*) |
24893 | 41 |
raw_oadd :: "[i,i]=>i" where |
13125
be50e0b050b2
ordinal addition now coerces its arguments to ordinals
paulson
parents:
12114
diff
changeset
|
42 |
"raw_oadd(i,j) == ordertype(i+j, radd(i,Memrel(i),j,Memrel(j)))" |
be50e0b050b2
ordinal addition now coerces its arguments to ordinals
paulson
parents:
12114
diff
changeset
|
43 |
|
24893 | 44 |
definition |
45 |
oadd :: "[i,i]=>i" (infixl "++" 65) where |
|
13125
be50e0b050b2
ordinal addition now coerces its arguments to ordinals
paulson
parents:
12114
diff
changeset
|
46 |
"i ++ j == raw_oadd(ordify(i),ordify(j))" |
850 | 47 |
|
24893 | 48 |
definition |
1033 | 49 |
(*ordinal subtraction*) |
24893 | 50 |
odiff :: "[i,i]=>i" (infixl "--" 65) where |
13125
be50e0b050b2
ordinal addition now coerces its arguments to ordinals
paulson
parents:
12114
diff
changeset
|
51 |
"i -- j == ordertype(i-j, Memrel(i))" |
1033 | 52 |
|
13125
be50e0b050b2
ordinal addition now coerces its arguments to ordinals
paulson
parents:
12114
diff
changeset
|
53 |
|
24826 | 54 |
notation (xsymbols) |
55 |
omult (infixl "\<times>\<times>" 70) |
|
9964 | 56 |
|
24826 | 57 |
notation (HTML output) |
58 |
omult (infixl "\<times>\<times>" 70) |
|
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
59 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
60 |
|
13269 | 61 |
subsection{*Proofs needing the combination of Ordinal.thy and Order.thy*} |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
62 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
63 |
lemma le_well_ord_Memrel: "j le i ==> well_ord(j, Memrel(i))" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
64 |
apply (rule well_ordI) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
65 |
apply (rule wf_Memrel [THEN wf_imp_wf_on]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
66 |
apply (simp add: ltD lt_Ord linear_def |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
67 |
ltI [THEN lt_trans2 [of _ j i]]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
68 |
apply (intro ballI Ord_linear) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
69 |
apply (blast intro: Ord_in_Ord lt_Ord)+ |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
70 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
71 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
72 |
(*"Ord(i) ==> well_ord(i, Memrel(i))"*) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
73 |
lemmas well_ord_Memrel = le_refl [THEN le_well_ord_Memrel] |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
74 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
75 |
(*Kunen's Theorem 7.3 (i), page 16; see also Ordinal/Ord_in_Ord |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
76 |
The smaller ordinal is an initial segment of the larger *) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
77 |
lemma lt_pred_Memrel: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
78 |
"j<i ==> pred(i, j, Memrel(i)) = j" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
79 |
apply (unfold pred_def lt_def) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
80 |
apply (simp (no_asm_simp)) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
81 |
apply (blast intro: Ord_trans) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
82 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
83 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
84 |
lemma pred_Memrel: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
85 |
"x:A ==> pred(A, x, Memrel(A)) = A Int x" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
86 |
by (unfold pred_def Memrel_def, blast) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
87 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
88 |
lemma Ord_iso_implies_eq_lemma: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
89 |
"[| j<i; f: ord_iso(i,Memrel(i),j,Memrel(j)) |] ==> R" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
90 |
apply (frule lt_pred_Memrel) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
91 |
apply (erule ltE) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
92 |
apply (rule well_ord_Memrel [THEN well_ord_iso_predE, of i f j], auto) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
93 |
apply (unfold ord_iso_def) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
94 |
(*Combining the two simplifications causes looping*) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
95 |
apply (simp (no_asm_simp)) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
96 |
apply (blast intro: bij_is_fun [THEN apply_type] Ord_trans) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
97 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
98 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
99 |
(*Kunen's Theorem 7.3 (ii), page 16. Isomorphic ordinals are equal*) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
100 |
lemma Ord_iso_implies_eq: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
101 |
"[| Ord(i); Ord(j); f: ord_iso(i,Memrel(i),j,Memrel(j)) |] |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
102 |
==> i=j" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
103 |
apply (rule_tac i = i and j = j in Ord_linear_lt) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
104 |
apply (blast intro: ord_iso_sym Ord_iso_implies_eq_lemma)+ |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
105 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
106 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
107 |
|
13269 | 108 |
subsection{*Ordermap and ordertype*} |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
109 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
110 |
lemma ordermap_type: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
111 |
"ordermap(A,r) : A -> ordertype(A,r)" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
112 |
apply (unfold ordermap_def ordertype_def) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
113 |
apply (rule lam_type) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
114 |
apply (rule lamI [THEN imageI], assumption+) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
115 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
116 |
|
13356 | 117 |
subsubsection{*Unfolding of ordermap *} |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
118 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
119 |
(*Useful for cardinality reasoning; see CardinalArith.ML*) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
120 |
lemma ordermap_eq_image: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
121 |
"[| wf[A](r); x:A |] |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
122 |
==> ordermap(A,r) ` x = ordermap(A,r) `` pred(A,x,r)" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
123 |
apply (unfold ordermap_def pred_def) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
124 |
apply (simp (no_asm_simp)) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
125 |
apply (erule wfrec_on [THEN trans], assumption) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
126 |
apply (simp (no_asm_simp) add: subset_iff image_lam vimage_singleton_iff) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
127 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
128 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
129 |
(*Useful for rewriting PROVIDED pred is not unfolded until later!*) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
130 |
lemma ordermap_pred_unfold: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
131 |
"[| wf[A](r); x:A |] |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
132 |
==> ordermap(A,r) ` x = {ordermap(A,r)`y . y : pred(A,x,r)}" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
133 |
by (simp add: ordermap_eq_image pred_subset ordermap_type [THEN image_fun]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
134 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
135 |
(*pred-unfolded version. NOT suitable for rewriting -- loops!*) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
136 |
lemmas ordermap_unfold = ordermap_pred_unfold [simplified pred_def] |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
137 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
138 |
(*The theorem above is |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
139 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
140 |
[| wf[A](r); x : A |] |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
141 |
==> ordermap(A,r) ` x = {ordermap(A,r) ` y . y: {y: A . <y,x> : r}} |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
142 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
143 |
NOTE: the definition of ordermap used here delivers ordinals only if r is |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
144 |
transitive. If r is the predecessor relation on the naturals then |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
145 |
ordermap(nat,predr) ` n equals {n-1} and not n. A more complicated definition, |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
146 |
like |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
147 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
148 |
ordermap(A,r) ` x = Union{succ(ordermap(A,r) ` y) . y: {y: A . <y,x> : r}}, |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
149 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
150 |
might eliminate the need for r to be transitive. |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
151 |
*) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
152 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
153 |
|
13356 | 154 |
subsubsection{*Showing that ordermap, ordertype yield ordinals *} |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
155 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
156 |
lemma Ord_ordermap: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
157 |
"[| well_ord(A,r); x:A |] ==> Ord(ordermap(A,r) ` x)" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
158 |
apply (unfold well_ord_def tot_ord_def part_ord_def, safe) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
159 |
apply (rule_tac a=x in wf_on_induct, assumption+) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
160 |
apply (simp (no_asm_simp) add: ordermap_pred_unfold) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
161 |
apply (rule OrdI [OF _ Ord_is_Transset]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
162 |
apply (unfold pred_def Transset_def) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
163 |
apply (blast intro: trans_onD |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
164 |
dest!: ordermap_unfold [THEN equalityD1])+ |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
165 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
166 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
167 |
lemma Ord_ordertype: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
168 |
"well_ord(A,r) ==> Ord(ordertype(A,r))" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
169 |
apply (unfold ordertype_def) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
170 |
apply (subst image_fun [OF ordermap_type subset_refl]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
171 |
apply (rule OrdI [OF _ Ord_is_Transset]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
172 |
prefer 2 apply (blast intro: Ord_ordermap) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
173 |
apply (unfold Transset_def well_ord_def) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
174 |
apply (blast intro: trans_onD |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
175 |
dest!: ordermap_unfold [THEN equalityD1]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
176 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
177 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
178 |
|
13356 | 179 |
subsubsection{*ordermap preserves the orderings in both directions *} |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
180 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
181 |
lemma ordermap_mono: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
182 |
"[| <w,x>: r; wf[A](r); w: A; x: A |] |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
183 |
==> ordermap(A,r)`w : ordermap(A,r)`x" |
13163 | 184 |
apply (erule_tac x1 = x in ordermap_unfold [THEN ssubst], assumption, blast) |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
185 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
186 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
187 |
(*linearity of r is crucial here*) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
188 |
lemma converse_ordermap_mono: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
189 |
"[| ordermap(A,r)`w : ordermap(A,r)`x; well_ord(A,r); w: A; x: A |] |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
190 |
==> <w,x>: r" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
191 |
apply (unfold well_ord_def tot_ord_def, safe) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
192 |
apply (erule_tac x=w and y=x in linearE, assumption+) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
193 |
apply (blast elim!: mem_not_refl [THEN notE]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
194 |
apply (blast dest: ordermap_mono intro: mem_asym) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
195 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
196 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
197 |
lemmas ordermap_surj = |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
198 |
ordermap_type [THEN surj_image, unfolded ordertype_def [symmetric]] |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
199 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
200 |
lemma ordermap_bij: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
201 |
"well_ord(A,r) ==> ordermap(A,r) : bij(A, ordertype(A,r))" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
202 |
apply (unfold well_ord_def tot_ord_def bij_def inj_def) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
203 |
apply (force intro!: ordermap_type ordermap_surj |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
204 |
elim: linearE dest: ordermap_mono |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
205 |
simp add: mem_not_refl) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
206 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
207 |
|
13356 | 208 |
subsubsection{*Isomorphisms involving ordertype *} |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
209 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
210 |
lemma ordertype_ord_iso: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
211 |
"well_ord(A,r) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
212 |
==> ordermap(A,r) : ord_iso(A,r, ordertype(A,r), Memrel(ordertype(A,r)))" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
213 |
apply (unfold ord_iso_def) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
214 |
apply (safe elim!: well_ord_is_wf |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
215 |
intro!: ordermap_type [THEN apply_type] ordermap_mono ordermap_bij) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
216 |
apply (blast dest!: converse_ordermap_mono) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
217 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
218 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
219 |
lemma ordertype_eq: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
220 |
"[| f: ord_iso(A,r,B,s); well_ord(B,s) |] |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
221 |
==> ordertype(A,r) = ordertype(B,s)" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
222 |
apply (frule well_ord_ord_iso, assumption) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
223 |
apply (rule Ord_iso_implies_eq, (erule Ord_ordertype)+) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
224 |
apply (blast intro: ord_iso_trans ord_iso_sym ordertype_ord_iso) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
225 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
226 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
227 |
lemma ordertype_eq_imp_ord_iso: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
228 |
"[| ordertype(A,r) = ordertype(B,s); well_ord(A,r); well_ord(B,s) |] |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
229 |
==> EX f. f: ord_iso(A,r,B,s)" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
230 |
apply (rule exI) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
231 |
apply (rule ordertype_ord_iso [THEN ord_iso_trans], assumption) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
232 |
apply (erule ssubst) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
233 |
apply (erule ordertype_ord_iso [THEN ord_iso_sym]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
234 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
235 |
|
13356 | 236 |
subsubsection{*Basic equalities for ordertype *} |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
237 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
238 |
(*Ordertype of Memrel*) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
239 |
lemma le_ordertype_Memrel: "j le i ==> ordertype(j,Memrel(i)) = j" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
240 |
apply (rule Ord_iso_implies_eq [symmetric]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
241 |
apply (erule ltE, assumption) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
242 |
apply (blast intro: le_well_ord_Memrel Ord_ordertype) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
243 |
apply (rule ord_iso_trans) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
244 |
apply (erule_tac [2] le_well_ord_Memrel [THEN ordertype_ord_iso]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
245 |
apply (rule id_bij [THEN ord_isoI]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
246 |
apply (simp (no_asm_simp)) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
247 |
apply (fast elim: ltE Ord_in_Ord Ord_trans) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
248 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
249 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
250 |
(*"Ord(i) ==> ordertype(i, Memrel(i)) = i"*) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
251 |
lemmas ordertype_Memrel = le_refl [THEN le_ordertype_Memrel] |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
252 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
253 |
lemma ordertype_0 [simp]: "ordertype(0,r) = 0" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
254 |
apply (rule id_bij [THEN ord_isoI, THEN ordertype_eq, THEN trans]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
255 |
apply (erule emptyE) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
256 |
apply (rule well_ord_0) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
257 |
apply (rule Ord_0 [THEN ordertype_Memrel]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
258 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
259 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
260 |
(*Ordertype of rvimage: [| f: bij(A,B); well_ord(B,s) |] ==> |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
261 |
ordertype(A, rvimage(A,f,s)) = ordertype(B,s) *) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
262 |
lemmas bij_ordertype_vimage = ord_iso_rvimage [THEN ordertype_eq] |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
263 |
|
13356 | 264 |
subsubsection{*A fundamental unfolding law for ordertype. *} |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
265 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
266 |
(*Ordermap returns the same result if applied to an initial segment*) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
267 |
lemma ordermap_pred_eq_ordermap: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
268 |
"[| well_ord(A,r); y:A; z: pred(A,y,r) |] |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
269 |
==> ordermap(pred(A,y,r), r) ` z = ordermap(A, r) ` z" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
270 |
apply (frule wf_on_subset_A [OF well_ord_is_wf pred_subset]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
271 |
apply (rule_tac a=z in wf_on_induct, assumption+) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
272 |
apply (safe elim!: predE) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
273 |
apply (simp (no_asm_simp) add: ordermap_pred_unfold well_ord_is_wf pred_iff) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
274 |
(*combining these two simplifications LOOPS! *) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
275 |
apply (simp (no_asm_simp) add: pred_pred_eq) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
276 |
apply (simp add: pred_def) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
277 |
apply (rule RepFun_cong [OF _ refl]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
278 |
apply (drule well_ord_is_trans_on) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
279 |
apply (fast elim!: trans_onD) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
280 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
281 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
282 |
lemma ordertype_unfold: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
283 |
"ordertype(A,r) = {ordermap(A,r)`y . y : A}" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
284 |
apply (unfold ordertype_def) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
285 |
apply (rule image_fun [OF ordermap_type subset_refl]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
286 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
287 |
|
14046 | 288 |
text{*Theorems by Krzysztof Grabczewski; proofs simplified by lcp *} |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
289 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
290 |
lemma ordertype_pred_subset: "[| well_ord(A,r); x:A |] ==> |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
291 |
ordertype(pred(A,x,r),r) <= ordertype(A,r)" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
292 |
apply (simp add: ordertype_unfold well_ord_subset [OF _ pred_subset]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
293 |
apply (fast intro: ordermap_pred_eq_ordermap elim: predE) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
294 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
295 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
296 |
lemma ordertype_pred_lt: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
297 |
"[| well_ord(A,r); x:A |] |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
298 |
==> ordertype(pred(A,x,r),r) < ordertype(A,r)" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
299 |
apply (rule ordertype_pred_subset [THEN subset_imp_le, THEN leE]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
300 |
apply (simp_all add: Ord_ordertype well_ord_subset [OF _ pred_subset]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
301 |
apply (erule sym [THEN ordertype_eq_imp_ord_iso, THEN exE]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
302 |
apply (erule_tac [3] well_ord_iso_predE) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
303 |
apply (simp_all add: well_ord_subset [OF _ pred_subset]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
304 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
305 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
306 |
(*May rewrite with this -- provided no rules are supplied for proving that |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
307 |
well_ord(pred(A,x,r), r) *) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
308 |
lemma ordertype_pred_unfold: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
309 |
"well_ord(A,r) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
310 |
==> ordertype(A,r) = {ordertype(pred(A,x,r),r). x:A}" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
311 |
apply (rule equalityI) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
312 |
apply (safe intro!: ordertype_pred_lt [THEN ltD]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
313 |
apply (auto simp add: ordertype_def well_ord_is_wf [THEN ordermap_eq_image] |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
314 |
ordermap_type [THEN image_fun] |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
315 |
ordermap_pred_eq_ordermap pred_subset) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
316 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
317 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
318 |
|
13269 | 319 |
subsection{*Alternative definition of ordinal*} |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
320 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
321 |
(*proof by Krzysztof Grabczewski*) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
322 |
lemma Ord_is_Ord_alt: "Ord(i) ==> Ord_alt(i)" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
323 |
apply (unfold Ord_alt_def) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
324 |
apply (rule conjI) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
325 |
apply (erule well_ord_Memrel) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
326 |
apply (unfold Ord_def Transset_def pred_def Memrel_def, blast) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
327 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
328 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
329 |
(*proof by lcp*) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
330 |
lemma Ord_alt_is_Ord: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
331 |
"Ord_alt(i) ==> Ord(i)" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
332 |
apply (unfold Ord_alt_def Ord_def Transset_def well_ord_def |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
333 |
tot_ord_def part_ord_def trans_on_def) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
334 |
apply (simp add: pred_Memrel) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
335 |
apply (blast elim!: equalityE) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
336 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
337 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
338 |
|
13269 | 339 |
subsection{*Ordinal Addition*} |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
340 |
|
13356 | 341 |
subsubsection{*Order Type calculations for radd *} |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
342 |
|
14046 | 343 |
text{*Addition with 0 *} |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
344 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
345 |
lemma bij_sum_0: "(lam z:A+0. case(%x. x, %y. y, z)) : bij(A+0, A)" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
346 |
apply (rule_tac d = Inl in lam_bijective, safe) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
347 |
apply (simp_all (no_asm_simp)) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
348 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
349 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
350 |
lemma ordertype_sum_0_eq: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
351 |
"well_ord(A,r) ==> ordertype(A+0, radd(A,r,0,s)) = ordertype(A,r)" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
352 |
apply (rule bij_sum_0 [THEN ord_isoI, THEN ordertype_eq]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
353 |
prefer 2 apply assumption |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
354 |
apply force |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
355 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
356 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
357 |
lemma bij_0_sum: "(lam z:0+A. case(%x. x, %y. y, z)) : bij(0+A, A)" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
358 |
apply (rule_tac d = Inr in lam_bijective, safe) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
359 |
apply (simp_all (no_asm_simp)) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
360 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
361 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
362 |
lemma ordertype_0_sum_eq: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
363 |
"well_ord(A,r) ==> ordertype(0+A, radd(0,s,A,r)) = ordertype(A,r)" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
364 |
apply (rule bij_0_sum [THEN ord_isoI, THEN ordertype_eq]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
365 |
prefer 2 apply assumption |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
366 |
apply force |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
367 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
368 |
|
14046 | 369 |
text{*Initial segments of radd. Statements by Grabczewski *} |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
370 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
371 |
(*In fact, pred(A+B, Inl(a), radd(A,r,B,s)) = pred(A,a,r)+0 *) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
372 |
lemma pred_Inl_bij: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
373 |
"a:A ==> (lam x:pred(A,a,r). Inl(x)) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
374 |
: bij(pred(A,a,r), pred(A+B, Inl(a), radd(A,r,B,s)))" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
375 |
apply (unfold pred_def) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
376 |
apply (rule_tac d = "case (%x. x, %y. y) " in lam_bijective) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
377 |
apply auto |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
378 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
379 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
380 |
lemma ordertype_pred_Inl_eq: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
381 |
"[| a:A; well_ord(A,r) |] |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
382 |
==> ordertype(pred(A+B, Inl(a), radd(A,r,B,s)), radd(A,r,B,s)) = |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
383 |
ordertype(pred(A,a,r), r)" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
384 |
apply (rule pred_Inl_bij [THEN ord_isoI, THEN ord_iso_sym, THEN ordertype_eq]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
385 |
apply (simp_all add: well_ord_subset [OF _ pred_subset]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
386 |
apply (simp add: pred_def) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
387 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
388 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
389 |
lemma pred_Inr_bij: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
390 |
"b:B ==> |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
391 |
id(A+pred(B,b,s)) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
392 |
: bij(A+pred(B,b,s), pred(A+B, Inr(b), radd(A,r,B,s)))" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
393 |
apply (unfold pred_def id_def) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
394 |
apply (rule_tac d = "%z. z" in lam_bijective, auto) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
395 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
396 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
397 |
lemma ordertype_pred_Inr_eq: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
398 |
"[| b:B; well_ord(A,r); well_ord(B,s) |] |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
399 |
==> ordertype(pred(A+B, Inr(b), radd(A,r,B,s)), radd(A,r,B,s)) = |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
400 |
ordertype(A+pred(B,b,s), radd(A,r,pred(B,b,s),s))" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
401 |
apply (rule pred_Inr_bij [THEN ord_isoI, THEN ord_iso_sym, THEN ordertype_eq]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
402 |
prefer 2 apply (force simp add: pred_def id_def, assumption) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
403 |
apply (blast intro: well_ord_radd well_ord_subset [OF _ pred_subset]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
404 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
405 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
406 |
|
13356 | 407 |
subsubsection{*ordify: trivial coercion to an ordinal *} |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
408 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
409 |
lemma Ord_ordify [iff, TC]: "Ord(ordify(x))" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
410 |
by (simp add: ordify_def) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
411 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
412 |
(*Collapsing*) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
413 |
lemma ordify_idem [simp]: "ordify(ordify(x)) = ordify(x)" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
414 |
by (simp add: ordify_def) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
415 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
416 |
|
13356 | 417 |
subsubsection{*Basic laws for ordinal addition *} |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
418 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
419 |
lemma Ord_raw_oadd: "[|Ord(i); Ord(j)|] ==> Ord(raw_oadd(i,j))" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
420 |
by (simp add: raw_oadd_def ordify_def Ord_ordertype well_ord_radd |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
421 |
well_ord_Memrel) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
422 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
423 |
lemma Ord_oadd [iff,TC]: "Ord(i++j)" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
424 |
by (simp add: oadd_def Ord_raw_oadd) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
425 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
426 |
|
14046 | 427 |
text{*Ordinal addition with zero *} |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
428 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
429 |
lemma raw_oadd_0: "Ord(i) ==> raw_oadd(i,0) = i" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
430 |
by (simp add: raw_oadd_def ordify_def ordertype_sum_0_eq |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
431 |
ordertype_Memrel well_ord_Memrel) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
432 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
433 |
lemma oadd_0 [simp]: "Ord(i) ==> i++0 = i" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
434 |
apply (simp (no_asm_simp) add: oadd_def raw_oadd_0 ordify_def) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
435 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
436 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
437 |
lemma raw_oadd_0_left: "Ord(i) ==> raw_oadd(0,i) = i" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
438 |
by (simp add: raw_oadd_def ordify_def ordertype_0_sum_eq ordertype_Memrel |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
439 |
well_ord_Memrel) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
440 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
441 |
lemma oadd_0_left [simp]: "Ord(i) ==> 0++i = i" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
442 |
by (simp add: oadd_def raw_oadd_0_left ordify_def) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
443 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
444 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
445 |
lemma oadd_eq_if_raw_oadd: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
446 |
"i++j = (if Ord(i) then (if Ord(j) then raw_oadd(i,j) else i) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
447 |
else (if Ord(j) then j else 0))" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
448 |
by (simp add: oadd_def ordify_def raw_oadd_0_left raw_oadd_0) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
449 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
450 |
lemma raw_oadd_eq_oadd: "[|Ord(i); Ord(j)|] ==> raw_oadd(i,j) = i++j" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
451 |
by (simp add: oadd_def ordify_def) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
452 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
453 |
(*** Further properties of ordinal addition. Statements by Grabczewski, |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
454 |
proofs by lcp. ***) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
455 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
456 |
(*Surely also provable by transfinite induction on j?*) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
457 |
lemma lt_oadd1: "k<i ==> k < i++j" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
458 |
apply (simp add: oadd_def ordify_def lt_Ord2 raw_oadd_0, clarify) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
459 |
apply (simp add: raw_oadd_def) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
460 |
apply (rule ltE, assumption) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
461 |
apply (rule ltI) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
462 |
apply (force simp add: ordertype_pred_unfold well_ord_radd well_ord_Memrel |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
463 |
ordertype_pred_Inl_eq lt_pred_Memrel leI [THEN le_ordertype_Memrel]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
464 |
apply (blast intro: Ord_ordertype well_ord_radd well_ord_Memrel) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
465 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
466 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
467 |
(*Thus also we obtain the rule i++j = k ==> i le k *) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
468 |
lemma oadd_le_self: "Ord(i) ==> i le i++j" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
469 |
apply (rule all_lt_imp_le) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
470 |
apply (auto simp add: Ord_oadd lt_oadd1) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
471 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
472 |
|
14046 | 473 |
text{*Various other results *} |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
474 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
475 |
lemma id_ord_iso_Memrel: "A<=B ==> id(A) : ord_iso(A, Memrel(A), A, Memrel(B))" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
476 |
apply (rule id_bij [THEN ord_isoI]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
477 |
apply (simp (no_asm_simp)) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
478 |
apply blast |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
479 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
480 |
|
13221 | 481 |
lemma subset_ord_iso_Memrel: |
482 |
"[| f: ord_iso(A,Memrel(B),C,r); A<=B |] ==> f: ord_iso(A,Memrel(A),C,r)" |
|
483 |
apply (frule ord_iso_is_bij [THEN bij_is_fun, THEN fun_is_rel]) |
|
484 |
apply (frule ord_iso_trans [OF id_ord_iso_Memrel], assumption) |
|
485 |
apply (simp add: right_comp_id) |
|
486 |
done |
|
487 |
||
488 |
lemma restrict_ord_iso: |
|
489 |
"[| f \<in> ord_iso(i, Memrel(i), Order.pred(A,a,r), r); a \<in> A; j < i; |
|
490 |
trans[A](r) |] |
|
491 |
==> restrict(f,j) \<in> ord_iso(j, Memrel(j), Order.pred(A,f`j,r), r)" |
|
492 |
apply (frule ltD) |
|
493 |
apply (frule ord_iso_is_bij [THEN bij_is_fun, THEN apply_type], assumption) |
|
494 |
apply (frule ord_iso_restrict_pred, assumption) |
|
495 |
apply (simp add: pred_iff trans_pred_pred_eq lt_pred_Memrel) |
|
496 |
apply (blast intro!: subset_ord_iso_Memrel le_imp_subset [OF leI]) |
|
497 |
done |
|
498 |
||
499 |
lemma restrict_ord_iso2: |
|
500 |
"[| f \<in> ord_iso(Order.pred(A,a,r), r, i, Memrel(i)); a \<in> A; |
|
501 |
j < i; trans[A](r) |] |
|
502 |
==> converse(restrict(converse(f), j)) |
|
503 |
\<in> ord_iso(Order.pred(A, converse(f)`j, r), r, j, Memrel(j))" |
|
504 |
by (blast intro: restrict_ord_iso ord_iso_sym ltI) |
|
505 |
||
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
506 |
lemma ordertype_sum_Memrel: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
507 |
"[| well_ord(A,r); k<j |] |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
508 |
==> ordertype(A+k, radd(A, r, k, Memrel(j))) = |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
509 |
ordertype(A+k, radd(A, r, k, Memrel(k)))" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
510 |
apply (erule ltE) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
511 |
apply (rule ord_iso_refl [THEN sum_ord_iso_cong, THEN ordertype_eq]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
512 |
apply (erule OrdmemD [THEN id_ord_iso_Memrel, THEN ord_iso_sym]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
513 |
apply (simp_all add: well_ord_radd well_ord_Memrel) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
514 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
515 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
516 |
lemma oadd_lt_mono2: "k<j ==> i++k < i++j" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
517 |
apply (simp add: oadd_def ordify_def raw_oadd_0_left lt_Ord lt_Ord2, clarify) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
518 |
apply (simp add: raw_oadd_def) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
519 |
apply (rule ltE, assumption) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
520 |
apply (rule ordertype_pred_unfold [THEN equalityD2, THEN subsetD, THEN ltI]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
521 |
apply (simp_all add: Ord_ordertype well_ord_radd well_ord_Memrel) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
522 |
apply (rule bexI) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
523 |
apply (erule_tac [2] InrI) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
524 |
apply (simp add: ordertype_pred_Inr_eq well_ord_Memrel lt_pred_Memrel |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
525 |
leI [THEN le_ordertype_Memrel] ordertype_sum_Memrel) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
526 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
527 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
528 |
lemma oadd_lt_cancel2: "[| i++j < i++k; Ord(j) |] ==> j<k" |
13611 | 529 |
apply (simp (asm_lr) add: oadd_eq_if_raw_oadd split add: split_if_asm) |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
530 |
prefer 2 |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
531 |
apply (frule_tac i = i and j = j in oadd_le_self) |
13611 | 532 |
apply (simp (asm_lr) add: oadd_def ordify_def lt_Ord not_lt_iff_le [THEN iff_sym]) |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
533 |
apply (rule Ord_linear_lt, auto) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
534 |
apply (simp_all add: raw_oadd_eq_oadd) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
535 |
apply (blast dest: oadd_lt_mono2 elim: lt_irrefl lt_asym)+ |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
536 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
537 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
538 |
lemma oadd_lt_iff2: "Ord(j) ==> i++j < i++k <-> j<k" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
539 |
by (blast intro!: oadd_lt_mono2 dest!: oadd_lt_cancel2) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
540 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
541 |
lemma oadd_inject: "[| i++j = i++k; Ord(j); Ord(k) |] ==> j=k" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
542 |
apply (simp add: oadd_eq_if_raw_oadd split add: split_if_asm) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
543 |
apply (simp add: raw_oadd_eq_oadd) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
544 |
apply (rule Ord_linear_lt, auto) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
545 |
apply (force dest: oadd_lt_mono2 [of concl: i] simp add: lt_not_refl)+ |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
546 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
547 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
548 |
lemma lt_oadd_disj: "k < i++j ==> k<i | (EX l:j. k = i++l )" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
549 |
apply (simp add: Ord_in_Ord' [of _ j] oadd_eq_if_raw_oadd |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
550 |
split add: split_if_asm) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
551 |
prefer 2 |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
552 |
apply (simp add: Ord_in_Ord' [of _ j] lt_def) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
553 |
apply (simp add: ordertype_pred_unfold well_ord_radd well_ord_Memrel raw_oadd_def) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
554 |
apply (erule ltD [THEN RepFunE]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
555 |
apply (force simp add: ordertype_pred_Inl_eq well_ord_Memrel ltI |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
556 |
lt_pred_Memrel le_ordertype_Memrel leI |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
557 |
ordertype_pred_Inr_eq ordertype_sum_Memrel) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
558 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
559 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
560 |
|
13356 | 561 |
subsubsection{*Ordinal addition with successor -- via associativity! *} |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
562 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
563 |
lemma oadd_assoc: "(i++j)++k = i++(j++k)" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
564 |
apply (simp add: oadd_eq_if_raw_oadd Ord_raw_oadd raw_oadd_0 raw_oadd_0_left, clarify) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
565 |
apply (simp add: raw_oadd_def) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
566 |
apply (rule ordertype_eq [THEN trans]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
567 |
apply (rule sum_ord_iso_cong [OF ordertype_ord_iso [THEN ord_iso_sym] |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
568 |
ord_iso_refl]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
569 |
apply (simp_all add: Ord_ordertype well_ord_radd well_ord_Memrel) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
570 |
apply (rule sum_assoc_ord_iso [THEN ordertype_eq, THEN trans]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
571 |
apply (rule_tac [2] ordertype_eq) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
572 |
apply (rule_tac [2] sum_ord_iso_cong [OF ord_iso_refl ordertype_ord_iso]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
573 |
apply (blast intro: Ord_ordertype well_ord_radd well_ord_Memrel)+ |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
574 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
575 |
|
13615
449a70d88b38
Numerous cosmetic changes, prompted by the new simplifier
paulson
parents:
13611
diff
changeset
|
576 |
lemma oadd_unfold: "[| Ord(i); Ord(j) |] ==> i++j = i Un (\<Union>k\<in>j. {i++k})" |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
577 |
apply (rule subsetI [THEN equalityI]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
578 |
apply (erule ltI [THEN lt_oadd_disj, THEN disjE]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
579 |
apply (blast intro: Ord_oadd) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
580 |
apply (blast elim!: ltE, blast) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
581 |
apply (force intro: lt_oadd1 oadd_lt_mono2 simp add: Ord_mem_iff_lt) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
582 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
583 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
584 |
lemma oadd_1: "Ord(i) ==> i++1 = succ(i)" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
585 |
apply (simp (no_asm_simp) add: oadd_unfold Ord_1 oadd_0) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
586 |
apply blast |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
587 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
588 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
589 |
lemma oadd_succ [simp]: "Ord(j) ==> i++succ(j) = succ(i++j)" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
590 |
apply (simp add: oadd_eq_if_raw_oadd, clarify) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
591 |
apply (simp add: raw_oadd_eq_oadd) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
592 |
apply (simp add: oadd_1 [of j, symmetric] oadd_1 [of "i++j", symmetric] |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
593 |
oadd_assoc) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
594 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
595 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
596 |
|
14046 | 597 |
text{*Ordinal addition with limit ordinals *} |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
598 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
599 |
lemma oadd_UN: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
600 |
"[| !!x. x:A ==> Ord(j(x)); a:A |] |
13615
449a70d88b38
Numerous cosmetic changes, prompted by the new simplifier
paulson
parents:
13611
diff
changeset
|
601 |
==> i ++ (\<Union>x\<in>A. j(x)) = (\<Union>x\<in>A. i++j(x))" |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
602 |
by (blast intro: ltI Ord_UN Ord_oadd lt_oadd1 [THEN ltD] |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
603 |
oadd_lt_mono2 [THEN ltD] |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
604 |
elim!: ltE dest!: ltI [THEN lt_oadd_disj]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
605 |
|
13615
449a70d88b38
Numerous cosmetic changes, prompted by the new simplifier
paulson
parents:
13611
diff
changeset
|
606 |
lemma oadd_Limit: "Limit(j) ==> i++j = (\<Union>k\<in>j. i++k)" |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
607 |
apply (frule Limit_has_0 [THEN ltD]) |
13356 | 608 |
apply (simp add: Limit_is_Ord [THEN Ord_in_Ord] oadd_UN [symmetric] |
609 |
Union_eq_UN [symmetric] Limit_Union_eq) |
|
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
610 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
611 |
|
13221 | 612 |
lemma oadd_eq_0_iff: "[| Ord(i); Ord(j) |] ==> (i ++ j) = 0 <-> i=0 & j=0" |
613 |
apply (erule trans_induct3 [of j]) |
|
614 |
apply (simp_all add: oadd_Limit) |
|
615 |
apply (simp add: Union_empty_iff Limit_def lt_def, blast) |
|
616 |
done |
|
617 |
||
618 |
lemma oadd_eq_lt_iff: "[| Ord(i); Ord(j) |] ==> 0 < (i ++ j) <-> 0<i | 0<j" |
|
619 |
by (simp add: Ord_0_lt_iff [symmetric] oadd_eq_0_iff) |
|
620 |
||
621 |
lemma oadd_LimitI: "[| Ord(i); Limit(j) |] ==> Limit(i ++ j)" |
|
622 |
apply (simp add: oadd_Limit) |
|
623 |
apply (frule Limit_has_1 [THEN ltD]) |
|
624 |
apply (rule increasing_LimitI) |
|
625 |
apply (rule Ord_0_lt) |
|
626 |
apply (blast intro: Ord_in_Ord [OF Limit_is_Ord]) |
|
627 |
apply (force simp add: Union_empty_iff oadd_eq_0_iff |
|
628 |
Limit_is_Ord [of j, THEN Ord_in_Ord], auto) |
|
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
13269
diff
changeset
|
629 |
apply (rule_tac x="succ(y)" in bexI) |
13221 | 630 |
apply (simp add: ltI Limit_is_Ord [of j, THEN Ord_in_Ord]) |
631 |
apply (simp add: Limit_def lt_def) |
|
632 |
done |
|
633 |
||
14046 | 634 |
text{*Order/monotonicity properties of ordinal addition *} |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
635 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
636 |
lemma oadd_le_self2: "Ord(i) ==> i le j++i" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
637 |
apply (erule_tac i = i in trans_induct3) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
638 |
apply (simp (no_asm_simp) add: Ord_0_le) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
639 |
apply (simp (no_asm_simp) add: oadd_succ succ_leI) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
640 |
apply (simp (no_asm_simp) add: oadd_Limit) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
641 |
apply (rule le_trans) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
642 |
apply (rule_tac [2] le_implies_UN_le_UN) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
643 |
apply (erule_tac [2] bspec) |
13356 | 644 |
prefer 2 apply assumption |
645 |
apply (simp add: Union_eq_UN [symmetric] Limit_Union_eq le_refl Limit_is_Ord) |
|
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
646 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
647 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
648 |
lemma oadd_le_mono1: "k le j ==> k++i le j++i" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
649 |
apply (frule lt_Ord) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
650 |
apply (frule le_Ord2) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
651 |
apply (simp add: oadd_eq_if_raw_oadd, clarify) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
652 |
apply (simp add: raw_oadd_eq_oadd) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
653 |
apply (erule_tac i = i in trans_induct3) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
654 |
apply (simp (no_asm_simp)) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
655 |
apply (simp (no_asm_simp) add: oadd_succ succ_le_iff) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
656 |
apply (simp (no_asm_simp) add: oadd_Limit) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
657 |
apply (rule le_implies_UN_le_UN, blast) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
658 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
659 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
660 |
lemma oadd_lt_mono: "[| i' le i; j'<j |] ==> i'++j' < i++j" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
661 |
by (blast intro: lt_trans1 oadd_le_mono1 oadd_lt_mono2 Ord_succD elim: ltE) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
662 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
663 |
lemma oadd_le_mono: "[| i' le i; j' le j |] ==> i'++j' le i++j" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
664 |
by (simp del: oadd_succ add: oadd_succ [symmetric] le_Ord2 oadd_lt_mono) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
665 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
666 |
lemma oadd_le_iff2: "[| Ord(j); Ord(k) |] ==> i++j le i++k <-> j le k" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
667 |
by (simp del: oadd_succ add: oadd_lt_iff2 oadd_succ [symmetric] Ord_succ) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
668 |
|
13221 | 669 |
lemma oadd_lt_self: "[| Ord(i); 0<j |] ==> i < i++j" |
670 |
apply (rule lt_trans2) |
|
671 |
apply (erule le_refl) |
|
672 |
apply (simp only: lt_Ord2 oadd_1 [of i, symmetric]) |
|
673 |
apply (blast intro: succ_leI oadd_le_mono) |
|
674 |
done |
|
675 |
||
13269 | 676 |
text{*Every ordinal is exceeded by some limit ordinal.*} |
677 |
lemma Ord_imp_greater_Limit: "Ord(i) ==> \<exists>k. i<k & Limit(k)" |
|
678 |
apply (rule_tac x="i ++ nat" in exI) |
|
679 |
apply (blast intro: oadd_LimitI oadd_lt_self Limit_nat [THEN Limit_has_0]) |
|
680 |
done |
|
681 |
||
682 |
lemma Ord2_imp_greater_Limit: "[|Ord(i); Ord(j)|] ==> \<exists>k. i<k & j<k & Limit(k)" |
|
683 |
apply (insert Ord_Un [of i j, THEN Ord_imp_greater_Limit]) |
|
684 |
apply (simp add: Un_least_lt_iff) |
|
685 |
done |
|
686 |
||
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
687 |
|
14046 | 688 |
subsection{*Ordinal Subtraction*} |
689 |
||
690 |
text{*The difference is @{term "ordertype(j-i, Memrel(j))"}. |
|
691 |
It's probably simpler to define the difference recursively!*} |
|
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
692 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
693 |
lemma bij_sum_Diff: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
694 |
"A<=B ==> (lam y:B. if(y:A, Inl(y), Inr(y))) : bij(B, A+(B-A))" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
695 |
apply (rule_tac d = "case (%x. x, %y. y) " in lam_bijective) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
696 |
apply (blast intro!: if_type) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
697 |
apply (fast intro!: case_type) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
698 |
apply (erule_tac [2] sumE) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
699 |
apply (simp_all (no_asm_simp)) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
700 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
701 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
702 |
lemma ordertype_sum_Diff: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
703 |
"i le j ==> |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
704 |
ordertype(i+(j-i), radd(i,Memrel(j),j-i,Memrel(j))) = |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
705 |
ordertype(j, Memrel(j))" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
706 |
apply (safe dest!: le_subset_iff [THEN iffD1]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
707 |
apply (rule bij_sum_Diff [THEN ord_isoI, THEN ord_iso_sym, THEN ordertype_eq]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
708 |
apply (erule_tac [3] well_ord_Memrel, assumption) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
709 |
apply (simp (no_asm_simp)) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
710 |
apply (frule_tac j = y in Ord_in_Ord, assumption) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
711 |
apply (frule_tac j = x in Ord_in_Ord, assumption) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
712 |
apply (simp (no_asm_simp) add: Ord_mem_iff_lt lt_Ord not_lt_iff_le) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
713 |
apply (blast intro: lt_trans2 lt_trans) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
714 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
715 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
716 |
lemma Ord_odiff [simp,TC]: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
717 |
"[| Ord(i); Ord(j) |] ==> Ord(i--j)" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
718 |
apply (unfold odiff_def) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
719 |
apply (blast intro: Ord_ordertype Diff_subset well_ord_subset well_ord_Memrel) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
720 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
721 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
722 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
723 |
lemma raw_oadd_ordertype_Diff: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
724 |
"i le j |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
725 |
==> raw_oadd(i,j--i) = ordertype(i+(j-i), radd(i,Memrel(j),j-i,Memrel(j)))" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
726 |
apply (simp add: raw_oadd_def odiff_def) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
727 |
apply (safe dest!: le_subset_iff [THEN iffD1]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
728 |
apply (rule sum_ord_iso_cong [THEN ordertype_eq]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
729 |
apply (erule id_ord_iso_Memrel) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
730 |
apply (rule ordertype_ord_iso [THEN ord_iso_sym]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
731 |
apply (blast intro: well_ord_radd Diff_subset well_ord_subset well_ord_Memrel)+ |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
732 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
733 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
734 |
lemma oadd_odiff_inverse: "i le j ==> i ++ (j--i) = j" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
735 |
by (simp add: lt_Ord le_Ord2 oadd_def ordify_def raw_oadd_ordertype_Diff |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
736 |
ordertype_sum_Diff ordertype_Memrel lt_Ord2 [THEN Ord_succD]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
737 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
738 |
(*By oadd_inject, the difference between i and j is unique. Note that we get |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
739 |
i++j = k ==> j = k--i. *) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
740 |
lemma odiff_oadd_inverse: "[| Ord(i); Ord(j) |] ==> (i++j) -- i = j" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
741 |
apply (rule oadd_inject) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
742 |
apply (blast intro: oadd_odiff_inverse oadd_le_self) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
743 |
apply (blast intro: Ord_ordertype Ord_oadd Ord_odiff)+ |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
744 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
745 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
746 |
lemma odiff_lt_mono2: "[| i<j; k le i |] ==> i--k < j--k" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
747 |
apply (rule_tac i = k in oadd_lt_cancel2) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
748 |
apply (simp add: oadd_odiff_inverse) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
749 |
apply (subst oadd_odiff_inverse) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
750 |
apply (blast intro: le_trans leI, assumption) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
751 |
apply (simp (no_asm_simp) add: lt_Ord le_Ord2) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
752 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
753 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
754 |
|
13269 | 755 |
subsection{*Ordinal Multiplication*} |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
756 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
757 |
lemma Ord_omult [simp,TC]: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
758 |
"[| Ord(i); Ord(j) |] ==> Ord(i**j)" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
759 |
apply (unfold omult_def) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
760 |
apply (blast intro: Ord_ordertype well_ord_rmult well_ord_Memrel) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
761 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
762 |
|
13356 | 763 |
subsubsection{*A useful unfolding law *} |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
764 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
765 |
lemma pred_Pair_eq: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
766 |
"[| a:A; b:B |] ==> pred(A*B, <a,b>, rmult(A,r,B,s)) = |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
767 |
pred(A,a,r)*B Un ({a} * pred(B,b,s))" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
768 |
apply (unfold pred_def, blast) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
769 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
770 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
771 |
lemma ordertype_pred_Pair_eq: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
772 |
"[| a:A; b:B; well_ord(A,r); well_ord(B,s) |] ==> |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
773 |
ordertype(pred(A*B, <a,b>, rmult(A,r,B,s)), rmult(A,r,B,s)) = |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
774 |
ordertype(pred(A,a,r)*B + pred(B,b,s), |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
775 |
radd(A*B, rmult(A,r,B,s), B, s))" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
776 |
apply (simp (no_asm_simp) add: pred_Pair_eq) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
777 |
apply (rule ordertype_eq [symmetric]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
778 |
apply (rule prod_sum_singleton_ord_iso) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
779 |
apply (simp_all add: pred_subset well_ord_rmult [THEN well_ord_subset]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
780 |
apply (blast intro: pred_subset well_ord_rmult [THEN well_ord_subset] |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
781 |
elim!: predE) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
782 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
783 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
784 |
lemma ordertype_pred_Pair_lemma: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
785 |
"[| i'<i; j'<j |] |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
786 |
==> ordertype(pred(i*j, <i',j'>, rmult(i,Memrel(i),j,Memrel(j))), |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
787 |
rmult(i,Memrel(i),j,Memrel(j))) = |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
788 |
raw_oadd (j**i', j')" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
789 |
apply (unfold raw_oadd_def omult_def) |
13356 | 790 |
apply (simp add: ordertype_pred_Pair_eq lt_pred_Memrel ltD lt_Ord2 |
791 |
well_ord_Memrel) |
|
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
792 |
apply (rule trans) |
13356 | 793 |
apply (rule_tac [2] ordertype_ord_iso |
794 |
[THEN sum_ord_iso_cong, THEN ordertype_eq]) |
|
795 |
apply (rule_tac [3] ord_iso_refl) |
|
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
796 |
apply (rule id_bij [THEN ord_isoI, THEN ordertype_eq]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
797 |
apply (elim SigmaE sumE ltE ssubst) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
798 |
apply (simp_all add: well_ord_rmult well_ord_radd well_ord_Memrel |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
799 |
Ord_ordertype lt_Ord lt_Ord2) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
800 |
apply (blast intro: Ord_trans)+ |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
801 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
802 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
803 |
lemma lt_omult: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
804 |
"[| Ord(i); Ord(j); k<j**i |] |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
805 |
==> EX j' i'. k = j**i' ++ j' & j'<j & i'<i" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
806 |
apply (unfold omult_def) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
807 |
apply (simp add: ordertype_pred_unfold well_ord_rmult well_ord_Memrel) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
808 |
apply (safe elim!: ltE) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
809 |
apply (simp add: ordertype_pred_Pair_lemma ltI raw_oadd_eq_oadd |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
810 |
omult_def [symmetric] Ord_in_Ord' [of _ i] Ord_in_Ord' [of _ j]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
811 |
apply (blast intro: ltI) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
812 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
813 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
814 |
lemma omult_oadd_lt: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
815 |
"[| j'<j; i'<i |] ==> j**i' ++ j' < j**i" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
816 |
apply (unfold omult_def) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
817 |
apply (rule ltI) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
818 |
prefer 2 |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
819 |
apply (simp add: Ord_ordertype well_ord_rmult well_ord_Memrel lt_Ord2) |
13356 | 820 |
apply (simp add: ordertype_pred_unfold well_ord_rmult well_ord_Memrel lt_Ord2) |
14864 | 821 |
apply (rule bexI [of _ i']) |
822 |
apply (rule bexI [of _ j']) |
|
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
823 |
apply (simp add: ordertype_pred_Pair_lemma ltI omult_def [symmetric]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
824 |
apply (simp add: lt_Ord lt_Ord2 raw_oadd_eq_oadd) |
14864 | 825 |
apply (simp_all add: lt_def) |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
826 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
827 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
828 |
lemma omult_unfold: |
13615
449a70d88b38
Numerous cosmetic changes, prompted by the new simplifier
paulson
parents:
13611
diff
changeset
|
829 |
"[| Ord(i); Ord(j) |] ==> j**i = (\<Union>j'\<in>j. \<Union>i'\<in>i. {j**i' ++ j'})" |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
830 |
apply (rule subsetI [THEN equalityI]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
831 |
apply (rule lt_omult [THEN exE]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
832 |
apply (erule_tac [3] ltI) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
833 |
apply (simp_all add: Ord_omult) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
834 |
apply (blast elim!: ltE) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
835 |
apply (blast intro: omult_oadd_lt [THEN ltD] ltI) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
836 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
837 |
|
13356 | 838 |
subsubsection{*Basic laws for ordinal multiplication *} |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
839 |
|
14046 | 840 |
text{*Ordinal multiplication by zero *} |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
841 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
842 |
lemma omult_0 [simp]: "i**0 = 0" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
843 |
apply (unfold omult_def) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
844 |
apply (simp (no_asm_simp)) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
845 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
846 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
847 |
lemma omult_0_left [simp]: "0**i = 0" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
848 |
apply (unfold omult_def) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
849 |
apply (simp (no_asm_simp)) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
850 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
851 |
|
14046 | 852 |
text{*Ordinal multiplication by 1 *} |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
853 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
854 |
lemma omult_1 [simp]: "Ord(i) ==> i**1 = i" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
855 |
apply (unfold omult_def) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
856 |
apply (rule_tac s1="Memrel(i)" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
857 |
in ord_isoI [THEN ordertype_eq, THEN trans]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
858 |
apply (rule_tac c = snd and d = "%z.<0,z>" in lam_bijective) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
859 |
apply (auto elim!: snd_type well_ord_Memrel ordertype_Memrel) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
860 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
861 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
862 |
lemma omult_1_left [simp]: "Ord(i) ==> 1**i = i" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
863 |
apply (unfold omult_def) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
864 |
apply (rule_tac s1="Memrel(i)" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
865 |
in ord_isoI [THEN ordertype_eq, THEN trans]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
866 |
apply (rule_tac c = fst and d = "%z.<z,0>" in lam_bijective) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
867 |
apply (auto elim!: fst_type well_ord_Memrel ordertype_Memrel) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
868 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
869 |
|
14046 | 870 |
text{*Distributive law for ordinal multiplication and addition *} |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
871 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
872 |
lemma oadd_omult_distrib: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
873 |
"[| Ord(i); Ord(j); Ord(k) |] ==> i**(j++k) = (i**j)++(i**k)" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
874 |
apply (simp add: oadd_eq_if_raw_oadd) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
875 |
apply (simp add: omult_def raw_oadd_def) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
876 |
apply (rule ordertype_eq [THEN trans]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
877 |
apply (rule prod_ord_iso_cong [OF ordertype_ord_iso [THEN ord_iso_sym] |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
878 |
ord_iso_refl]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
879 |
apply (simp_all add: well_ord_rmult well_ord_radd well_ord_Memrel |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
880 |
Ord_ordertype) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
881 |
apply (rule sum_prod_distrib_ord_iso [THEN ordertype_eq, THEN trans]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
882 |
apply (rule_tac [2] ordertype_eq) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
883 |
apply (rule_tac [2] sum_ord_iso_cong [OF ordertype_ord_iso ordertype_ord_iso]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
884 |
apply (simp_all add: well_ord_rmult well_ord_radd well_ord_Memrel |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
885 |
Ord_ordertype) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
886 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
887 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
888 |
lemma omult_succ: "[| Ord(i); Ord(j) |] ==> i**succ(j) = (i**j)++i" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
889 |
by (simp del: oadd_succ add: oadd_1 [of j, symmetric] oadd_omult_distrib) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
890 |
|
14046 | 891 |
text{*Associative law *} |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
892 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
893 |
lemma omult_assoc: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
894 |
"[| Ord(i); Ord(j); Ord(k) |] ==> (i**j)**k = i**(j**k)" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
895 |
apply (unfold omult_def) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
896 |
apply (rule ordertype_eq [THEN trans]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
897 |
apply (rule prod_ord_iso_cong [OF ord_iso_refl |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
898 |
ordertype_ord_iso [THEN ord_iso_sym]]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
899 |
apply (blast intro: well_ord_rmult well_ord_Memrel)+ |
13356 | 900 |
apply (rule prod_assoc_ord_iso |
901 |
[THEN ord_iso_sym, THEN ordertype_eq, THEN trans]) |
|
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
902 |
apply (rule_tac [2] ordertype_eq) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
903 |
apply (rule_tac [2] prod_ord_iso_cong [OF ordertype_ord_iso ord_iso_refl]) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
904 |
apply (blast intro: well_ord_rmult well_ord_Memrel Ord_ordertype)+ |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
905 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
906 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
907 |
|
14046 | 908 |
text{*Ordinal multiplication with limit ordinals *} |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
909 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
910 |
lemma omult_UN: |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
911 |
"[| Ord(i); !!x. x:A ==> Ord(j(x)) |] |
13615
449a70d88b38
Numerous cosmetic changes, prompted by the new simplifier
paulson
parents:
13611
diff
changeset
|
912 |
==> i ** (\<Union>x\<in>A. j(x)) = (\<Union>x\<in>A. i**j(x))" |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
913 |
by (simp (no_asm_simp) add: Ord_UN omult_unfold, blast) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
914 |
|
13615
449a70d88b38
Numerous cosmetic changes, prompted by the new simplifier
paulson
parents:
13611
diff
changeset
|
915 |
lemma omult_Limit: "[| Ord(i); Limit(j) |] ==> i**j = (\<Union>k\<in>j. i**k)" |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
916 |
by (simp add: Limit_is_Ord [THEN Ord_in_Ord] omult_UN [symmetric] |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
917 |
Union_eq_UN [symmetric] Limit_Union_eq) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
918 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
919 |
|
13356 | 920 |
subsubsection{*Ordering/monotonicity properties of ordinal multiplication *} |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
921 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
922 |
(*As a special case we have "[| 0<i; 0<j |] ==> 0 < i**j" *) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
923 |
lemma lt_omult1: "[| k<i; 0<j |] ==> k < i**j" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
924 |
apply (safe elim!: ltE intro!: ltI Ord_omult) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
925 |
apply (force simp add: omult_unfold) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
926 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
927 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
928 |
lemma omult_le_self: "[| Ord(i); 0<j |] ==> i le i**j" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
929 |
by (blast intro: all_lt_imp_le Ord_omult lt_omult1 lt_Ord2) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
930 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
931 |
lemma omult_le_mono1: "[| k le j; Ord(i) |] ==> k**i le j**i" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
932 |
apply (frule lt_Ord) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
933 |
apply (frule le_Ord2) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
934 |
apply (erule trans_induct3) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
935 |
apply (simp (no_asm_simp) add: le_refl Ord_0) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
936 |
apply (simp (no_asm_simp) add: omult_succ oadd_le_mono) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
937 |
apply (simp (no_asm_simp) add: omult_Limit) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
938 |
apply (rule le_implies_UN_le_UN, blast) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
939 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
940 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
941 |
lemma omult_lt_mono2: "[| k<j; 0<i |] ==> i**k < i**j" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
942 |
apply (rule ltI) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
943 |
apply (simp (no_asm_simp) add: omult_unfold lt_Ord2) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
944 |
apply (safe elim!: ltE intro!: Ord_omult) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
945 |
apply (force simp add: Ord_omult) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
946 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
947 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
948 |
lemma omult_le_mono2: "[| k le j; Ord(i) |] ==> i**k le i**j" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
949 |
apply (rule subset_imp_le) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
950 |
apply (safe elim!: ltE dest!: Ord_succD intro!: Ord_omult) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
951 |
apply (simp add: omult_unfold) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
952 |
apply (blast intro: Ord_trans) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
953 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
954 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
955 |
lemma omult_le_mono: "[| i' le i; j' le j |] ==> i'**j' le i**j" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
956 |
by (blast intro: le_trans omult_le_mono1 omult_le_mono2 Ord_succD elim: ltE) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
957 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
958 |
lemma omult_lt_mono: "[| i' le i; j'<j; 0<i |] ==> i'**j' < i**j" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
959 |
by (blast intro: lt_trans1 omult_le_mono1 omult_lt_mono2 Ord_succD elim: ltE) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
960 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
961 |
lemma omult_le_self2: "[| Ord(i); 0<j |] ==> i le j**i" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
962 |
apply (frule lt_Ord2) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
963 |
apply (erule_tac i = i in trans_induct3) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
964 |
apply (simp (no_asm_simp)) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
965 |
apply (simp (no_asm_simp) add: omult_succ) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
966 |
apply (erule lt_trans1) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
967 |
apply (rule_tac b = "j**x" in oadd_0 [THEN subst], rule_tac [2] oadd_lt_mono2) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
968 |
apply (blast intro: Ord_omult, assumption) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
969 |
apply (simp (no_asm_simp) add: omult_Limit) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
970 |
apply (rule le_trans) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
971 |
apply (rule_tac [2] le_implies_UN_le_UN) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
972 |
prefer 2 apply blast |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
973 |
apply (simp (no_asm_simp) add: Union_eq_UN [symmetric] Limit_Union_eq Limit_is_Ord) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
974 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
975 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
976 |
|
14046 | 977 |
text{*Further properties of ordinal multiplication *} |
13140
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
978 |
|
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
979 |
lemma omult_inject: "[| i**j = i**k; 0<i; Ord(j); Ord(k) |] ==> j=k" |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
980 |
apply (rule Ord_linear_lt) |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
981 |
prefer 4 apply assumption |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
982 |
apply auto |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
983 |
apply (force dest: omult_lt_mono2 simp add: lt_not_refl)+ |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
984 |
done |
6d97dbb189a9
converted Order.ML OrderType.ML OrderArith.ML to Isar format
paulson
parents:
13125
diff
changeset
|
985 |
|
14046 | 986 |
subsection{*The Relation @{term Lt}*} |
987 |
||
988 |
lemma wf_Lt: "wf(Lt)" |
|
989 |
apply (rule wf_subset) |
|
990 |
apply (rule wf_Memrel) |
|
991 |
apply (auto simp add: Lt_def Memrel_def lt_def) |
|
992 |
done |
|
993 |
||
994 |
lemma irrefl_Lt: "irrefl(A,Lt)" |
|
995 |
by (auto simp add: Lt_def irrefl_def) |
|
996 |
||
997 |
lemma trans_Lt: "trans[A](Lt)" |
|
998 |
apply (simp add: Lt_def trans_on_def) |
|
999 |
apply (blast intro: lt_trans) |
|
1000 |
done |
|
1001 |
||
1002 |
lemma part_ord_Lt: "part_ord(A,Lt)" |
|
1003 |
by (simp add: part_ord_def irrefl_Lt trans_Lt) |
|
1004 |
||
1005 |
lemma linear_Lt: "linear(nat,Lt)" |
|
1006 |
apply (auto dest!: not_lt_imp_le simp add: Lt_def linear_def le_iff) |
|
1007 |
apply (drule lt_asym, auto) |
|
1008 |
done |
|
1009 |
||
1010 |
lemma tot_ord_Lt: "tot_ord(nat,Lt)" |
|
1011 |
by (simp add: tot_ord_def linear_Lt part_ord_Lt) |
|
1012 |
||
14052 | 1013 |
lemma well_ord_Lt: "well_ord(nat,Lt)" |
1014 |
by (simp add: well_ord_def wf_Lt wf_imp_wf_on tot_ord_Lt) |
|
1015 |
||
435 | 1016 |
end |