src/ZF/OrdQuant.thy
author paulson
Mon Jan 21 14:47:55 2002 +0100 (2002-01-21)
changeset 12825 f1f7964ed05c
parent 12820 02e2ff3e4d37
child 13118 336b0bcbd27c
permissions -rw-r--r--
new simprules and classical rules
paulson@2469
     1
(*  Title:      ZF/AC/OrdQuant.thy
paulson@2469
     2
    ID:         $Id$
paulson@2469
     3
    Authors:    Krzysztof Grabczewski and L C Paulson
paulson@2469
     4
paulson@2469
     5
Quantifiers and union operator for ordinals. 
paulson@2469
     6
*)
paulson@2469
     7
paulson@12620
     8
theory OrdQuant = Ordinal:
paulson@2469
     9
paulson@12620
    10
constdefs
paulson@2469
    11
  
paulson@2469
    12
  (* Ordinal Quantifiers *)
paulson@12620
    13
  oall :: "[i, i => o] => o"
paulson@12620
    14
    "oall(A, P) == ALL x. x<A --> P(x)"
paulson@12620
    15
  
paulson@12620
    16
  oex :: "[i, i => o] => o"
paulson@12620
    17
    "oex(A, P)  == EX x. x<A & P(x)"
paulson@2469
    18
paulson@2469
    19
  (* Ordinal Union *)
paulson@12620
    20
  OUnion :: "[i, i => i] => i"
paulson@12620
    21
    "OUnion(i,B) == {z: UN x:i. B(x). Ord(i)}"
paulson@2469
    22
  
paulson@2469
    23
syntax
paulson@12620
    24
  "@oall"     :: "[idt, i, o] => o"        ("(3ALL _<_./ _)" 10)
paulson@12620
    25
  "@oex"      :: "[idt, i, o] => o"        ("(3EX _<_./ _)" 10)
paulson@12620
    26
  "@OUNION"   :: "[idt, i, i] => i"        ("(3UN _<_./ _)" 10)
paulson@2469
    27
paulson@2469
    28
translations
paulson@2469
    29
  "ALL x<a. P"  == "oall(a, %x. P)"
paulson@2469
    30
  "EX x<a. P"   == "oex(a, %x. P)"
paulson@2469
    31
  "UN x<a. B"   == "OUnion(a, %x. B)"
paulson@2469
    32
wenzelm@12114
    33
syntax (xsymbols)
paulson@12620
    34
  "@oall"     :: "[idt, i, o] => o"        ("(3\<forall>_<_./ _)" 10)
paulson@12620
    35
  "@oex"      :: "[idt, i, o] => o"        ("(3\<exists>_<_./ _)" 10)
paulson@12620
    36
  "@OUNION"   :: "[idt, i, i] => i"        ("(3\<Union>_<_./ _)" 10)
paulson@12620
    37
paulson@12620
    38
paulson@12825
    39
(** simplification of the new quantifiers **)
paulson@12825
    40
paulson@12825
    41
paulson@12825
    42
(*MOST IMPORTANT that this is added to the simpset BEFORE OrdQuant.ML
paulson@12825
    43
  is loaded: it's Ord_atomize would convert this rule to 
paulson@12825
    44
    x < 0 ==> P(x) == True, which causes dire effects!*)
paulson@12825
    45
lemma [simp]: "(ALL x<0. P(x))"
paulson@12825
    46
by (simp add: oall_def) 
paulson@12825
    47
paulson@12825
    48
lemma [simp]: "~(EX x<0. P(x))"
paulson@12825
    49
by (simp add: oex_def) 
paulson@12825
    50
paulson@12825
    51
lemma [simp]: "(ALL x<succ(i). P(x)) <-> (Ord(i) --> P(i) & (ALL x<i. P(x)))"
paulson@12825
    52
apply (simp add: oall_def le_iff) 
paulson@12825
    53
apply (blast intro: lt_Ord2) 
paulson@12825
    54
done
paulson@12825
    55
paulson@12825
    56
lemma [simp]: "(EX x<succ(i). P(x)) <-> (Ord(i) & (P(i) | (EX x<i. P(x))))"
paulson@12825
    57
apply (simp add: oex_def le_iff) 
paulson@12825
    58
apply (blast intro: lt_Ord2) 
paulson@12825
    59
done
paulson@12825
    60
paulson@12667
    61
declare Ord_Un [intro,simp,TC]
paulson@12667
    62
declare Ord_UN [intro,simp,TC]
paulson@12667
    63
declare Ord_Union [intro,simp,TC]
paulson@12620
    64
paulson@12620
    65
(** These mostly belong to theory Ordinal **)
paulson@12620
    66
paulson@12620
    67
lemma Union_upper_le:
paulson@12620
    68
     "\<lbrakk>j: J;  i\<le>j;  Ord(\<Union>(J))\<rbrakk> \<Longrightarrow> i \<le> \<Union>J"
paulson@12620
    69
apply (subst Union_eq_UN)  
paulson@12820
    70
apply (rule UN_upper_le, auto)
paulson@12620
    71
done
paulson@12620
    72
paulson@12667
    73
lemma zero_not_Limit [iff]: "~ Limit(0)"
paulson@12667
    74
by (simp add: Limit_def)
paulson@12667
    75
paulson@12667
    76
lemma Limit_has_1: "Limit(i) \<Longrightarrow> 1 < i"
paulson@12667
    77
by (blast intro: Limit_has_0 Limit_has_succ)
paulson@12667
    78
paulson@12667
    79
lemma Limit_Union [rule_format]: "\<lbrakk>I \<noteq> 0;  \<forall>i\<in>I. Limit(i)\<rbrakk> \<Longrightarrow> Limit(\<Union>I)"
paulson@12667
    80
apply (simp add: Limit_def lt_def)
paulson@12667
    81
apply (blast intro!: equalityI)
paulson@12667
    82
done
paulson@12667
    83
paulson@12620
    84
lemma increasing_LimitI: "\<lbrakk>0<l; \<forall>x\<in>l. \<exists>y\<in>l. x<y\<rbrakk> \<Longrightarrow> Limit(l)"
paulson@12820
    85
apply (simp add: Limit_def lt_Ord2, clarify)
paulson@12620
    86
apply (drule_tac i=y in ltD) 
paulson@12825
    87
apply (blast intro: lt_trans1 [OF _ ltI] lt_Ord2)
paulson@12620
    88
done
paulson@12620
    89
paulson@12620
    90
lemma UN_upper_lt:
paulson@12825
    91
     "\<lbrakk>a\<in>A;  i < b(a);  Ord(\<Union>x\<in>A. b(x))\<rbrakk> \<Longrightarrow> i < (\<Union>x\<in>A. b(x))"
paulson@12620
    92
by (unfold lt_def, blast) 
paulson@12620
    93
paulson@12620
    94
lemma lt_imp_0_lt: "j<i \<Longrightarrow> 0<i"
paulson@12620
    95
by (blast intro: lt_trans1 Ord_0_le [OF lt_Ord]) 
paulson@12620
    96
paulson@12620
    97
lemma Ord_set_cases:
paulson@12620
    98
   "\<forall>i\<in>I. Ord(i) \<Longrightarrow> I=0 \<or> \<Union>(I) \<in> I \<or> (\<Union>(I) \<notin> I \<and> Limit(\<Union>(I)))"
paulson@12620
    99
apply (clarify elim!: not_emptyE) 
paulson@12620
   100
apply (cases "\<Union>(I)" rule: Ord_cases) 
paulson@12620
   101
   apply (blast intro: Ord_Union)
paulson@12620
   102
  apply (blast intro: subst_elem)
paulson@12620
   103
 apply auto 
paulson@12620
   104
apply (clarify elim!: equalityE succ_subsetE)
paulson@12620
   105
apply (simp add: Union_subset_iff)
paulson@12620
   106
apply (subgoal_tac "B = succ(j)", blast )
paulson@12620
   107
apply (rule le_anti_sym) 
paulson@12620
   108
 apply (simp add: le_subset_iff) 
paulson@12620
   109
apply (simp add: ltI)
paulson@12620
   110
done
paulson@12620
   111
paulson@12620
   112
lemma Ord_Union_eq_succD: "[|\<forall>x\<in>X. Ord(x);  \<Union>X = succ(j)|] ==> succ(j) \<in> X"
paulson@12620
   113
by (drule Ord_set_cases, auto)
paulson@12620
   114
paulson@12620
   115
(*See also Transset_iff_Union_succ*)
paulson@12620
   116
lemma Ord_Union_succ_eq: "Ord(i) \<Longrightarrow> \<Union>(succ(i)) = i"
paulson@12620
   117
by (blast intro: Ord_trans)
wenzelm@2540
   118
paulson@12620
   119
lemma lt_Union_iff: "\<forall>i\<in>A. Ord(i) \<Longrightarrow> (j < \<Union>(A)) <-> (\<exists>i\<in>A. j<i)"
paulson@12620
   120
by (auto simp: lt_def Ord_Union)
paulson@12620
   121
paulson@12620
   122
lemma Un_upper1_lt: "[|k < i; Ord(j)|] ==> k < i Un j"
paulson@12620
   123
by (simp add: lt_def) 
paulson@12620
   124
paulson@12620
   125
lemma Un_upper2_lt: "[|k < j; Ord(i)|] ==> k < i Un j"
paulson@12620
   126
by (simp add: lt_def) 
paulson@12620
   127
paulson@12620
   128
lemma Ord_OUN [intro,simp]:
paulson@12620
   129
     "\<lbrakk>!!x. x<A \<Longrightarrow> Ord(B(x))\<rbrakk> \<Longrightarrow> Ord(\<Union>x<A. B(x))"
paulson@12620
   130
by (simp add: OUnion_def ltI Ord_UN) 
paulson@12620
   131
paulson@12620
   132
lemma OUN_upper_lt:
paulson@12620
   133
     "\<lbrakk>a<A;  i < b(a);  Ord(\<Union>x<A. b(x))\<rbrakk> \<Longrightarrow> i < (\<Union>x<A. b(x))"
paulson@12620
   134
by (unfold OUnion_def lt_def, blast )
paulson@12620
   135
paulson@12620
   136
lemma OUN_upper_le:
paulson@12620
   137
     "\<lbrakk>a<A;  i\<le>b(a);  Ord(\<Union>x<A. b(x))\<rbrakk> \<Longrightarrow> i \<le> (\<Union>x<A. b(x))"
paulson@12820
   138
apply (unfold OUnion_def, auto)
paulson@12620
   139
apply (rule UN_upper_le )
paulson@12620
   140
apply (auto simp add: lt_def) 
paulson@12620
   141
done
paulson@2469
   142
paulson@12620
   143
lemma Limit_OUN_eq: "Limit(i) ==> (UN x<i. x) = i"
paulson@12620
   144
by (simp add: OUnion_def Limit_Union_eq Limit_is_Ord)
paulson@12620
   145
paulson@12620
   146
(* No < version; consider (UN i:nat.i)=nat *)
paulson@12620
   147
lemma OUN_least:
paulson@12620
   148
     "(!!x. x<A ==> B(x) \<subseteq> C) ==> (UN x<A. B(x)) \<subseteq> C"
paulson@12620
   149
by (simp add: OUnion_def UN_least ltI)
paulson@12620
   150
paulson@12620
   151
(* No < version; consider (UN i:nat.i)=nat *)
paulson@12620
   152
lemma OUN_least_le:
paulson@12620
   153
     "[| Ord(i);  !!x. x<A ==> b(x) \<le> i |] ==> (UN x<A. b(x)) \<le> i"
paulson@12620
   154
by (simp add: OUnion_def UN_least_le ltI Ord_0_le)
paulson@12620
   155
paulson@12620
   156
lemma le_implies_OUN_le_OUN:
paulson@12620
   157
     "[| !!x. x<A ==> c(x) \<le> d(x) |] ==> (UN x<A. c(x)) \<le> (UN x<A. d(x))"
paulson@12620
   158
by (blast intro: OUN_least_le OUN_upper_le le_Ord2 Ord_OUN)
paulson@12620
   159
paulson@12620
   160
lemma OUN_UN_eq:
paulson@12620
   161
     "(!!x. x:A ==> Ord(B(x)))
paulson@12620
   162
      ==> (UN z < (UN x:A. B(x)). C(z)) = (UN  x:A. UN z < B(x). C(z))"
paulson@12620
   163
by (simp add: OUnion_def) 
paulson@12620
   164
paulson@12620
   165
lemma OUN_Union_eq:
paulson@12620
   166
     "(!!x. x:X ==> Ord(x))
paulson@12620
   167
      ==> (UN z < Union(X). C(z)) = (UN x:X. UN z < x. C(z))"
paulson@12620
   168
by (simp add: OUnion_def) 
paulson@12620
   169
paulson@12763
   170
(*So that rule_format will get rid of ALL x<A...*)
paulson@12763
   171
lemma atomize_oall [symmetric, rulify]:
paulson@12763
   172
     "(!!x. x<A ==> P(x)) == Trueprop (ALL x<A. P(x))"
paulson@12763
   173
by (simp add: oall_def atomize_all atomize_imp)
paulson@12763
   174
paulson@2469
   175
end