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