src/ZF/UNITY/Increasing.thy
author wenzelm
Sat, 12 Apr 2008 17:00:40 +0200
changeset 26628 63306cb94313
parent 24893 b8ef7afe3a6b
child 32960 69916a850301
permissions -rw-r--r--
replaced Drule.close_derivation/Goal.close_result by Thm.close_derivation (removed obsolete compression);
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14052
e9c9f69e4f63 some new ZF/UNITY material from Sidi Ehmety
paulson
parents:
diff changeset
     1
(*  Title:      ZF/UNITY/Increasing
14093
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
     2
    ID:         $Id \<in> Increasing.thy,v 1.2 2003/06/02 09:17:52 paulson Exp $
14052
e9c9f69e4f63 some new ZF/UNITY material from Sidi Ehmety
paulson
parents:
diff changeset
     3
    Author:     Sidi O Ehmety, Cambridge University Computer Laboratory
e9c9f69e4f63 some new ZF/UNITY material from Sidi Ehmety
paulson
parents:
diff changeset
     4
    Copyright   2001  University of Cambridge
e9c9f69e4f63 some new ZF/UNITY material from Sidi Ehmety
paulson
parents:
diff changeset
     5
e9c9f69e4f63 some new ZF/UNITY material from Sidi Ehmety
paulson
parents:
diff changeset
     6
Increasing's parameters are a state function f, a domain A and an order
e9c9f69e4f63 some new ZF/UNITY material from Sidi Ehmety
paulson
parents:
diff changeset
     7
relation r over the domain A. 
e9c9f69e4f63 some new ZF/UNITY material from Sidi Ehmety
paulson
parents:
diff changeset
     8
*)
e9c9f69e4f63 some new ZF/UNITY material from Sidi Ehmety
paulson
parents:
diff changeset
     9
14093
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    10
header{*Charpentier's "Increasing" Relation*}
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    11
16417
9bc16273c2d4 migrated theory headers to new format
haftmann
parents: 14093
diff changeset
    12
theory Increasing imports Constrains Monotonicity begin
14093
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    13
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 24892
diff changeset
    14
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 24892
diff changeset
    15
  increasing :: "[i, i, i=>i] => i" ("increasing[_]'(_, _')")  where
14052
e9c9f69e4f63 some new ZF/UNITY material from Sidi Ehmety
paulson
parents:
diff changeset
    16
  "increasing[A](r, f) ==
14093
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    17
    {F \<in> program. (\<forall>k \<in> A. F \<in> stable({s \<in> state. <k, f(s)> \<in> r})) &
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    18
                (\<forall>x \<in> state. f(x):A)}"
14052
e9c9f69e4f63 some new ZF/UNITY material from Sidi Ehmety
paulson
parents:
diff changeset
    19
  
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 24892
diff changeset
    20
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 24892
diff changeset
    21
  Increasing :: "[i, i, i=>i] => i" ("Increasing[_]'(_, _')")  where
14052
e9c9f69e4f63 some new ZF/UNITY material from Sidi Ehmety
paulson
parents:
diff changeset
    22
  "Increasing[A](r, f) ==
14093
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    23
    {F \<in> program. (\<forall>k \<in> A. F \<in> Stable({s \<in> state. <k, f(s)> \<in> r})) &
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    24
                (\<forall>x \<in> state. f(x):A)}"
14052
e9c9f69e4f63 some new ZF/UNITY material from Sidi Ehmety
paulson
parents:
diff changeset
    25
24892
c663e675e177 replaced some 'translations' by 'abbreviation';
wenzelm
parents: 16417
diff changeset
    26
abbreviation (input)
c663e675e177 replaced some 'translations' by 'abbreviation';
wenzelm
parents: 16417
diff changeset
    27
  IncWrt ::  "[i=>i, i, i] => i" ("(_ IncreasingWrt _ '/ _)" [60, 0, 60] 60)  where
c663e675e177 replaced some 'translations' by 'abbreviation';
wenzelm
parents: 16417
diff changeset
    28
  "f IncreasingWrt r/A == Increasing[A](r,f)"
14052
e9c9f69e4f63 some new ZF/UNITY material from Sidi Ehmety
paulson
parents:
diff changeset
    29
14093
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    30
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    31
(** increasing **)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    32
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    33
lemma increasing_type: "increasing[A](r, f) <= program"
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    34
by (unfold increasing_def, blast)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    35
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    36
lemma increasing_into_program: "F \<in> increasing[A](r, f) ==> F \<in> program"
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    37
by (unfold increasing_def, blast)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    38
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    39
lemma increasing_imp_stable: 
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    40
"[| F \<in> increasing[A](r, f); x \<in> A |] ==>F \<in> stable({s \<in> state. <x, f(s)>:r})"
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    41
by (unfold increasing_def, blast)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    42
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    43
lemma increasingD: 
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    44
"F \<in> increasing[A](r,f) ==> F \<in> program & (\<exists>a. a \<in> A) & (\<forall>s \<in> state. f(s):A)"
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    45
apply (unfold increasing_def)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    46
apply (subgoal_tac "\<exists>x. x \<in> state")
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    47
apply (auto dest: stable_type [THEN subsetD] intro: st0_in_state)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    48
done
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    49
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    50
lemma increasing_constant [simp]: 
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    51
 "F \<in> increasing[A](r, %s. c) <-> F \<in> program & c \<in> A"
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    52
apply (unfold increasing_def stable_def)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    53
apply (subgoal_tac "\<exists>x. x \<in> state")
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    54
apply (auto dest: stable_type [THEN subsetD] intro: st0_in_state)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    55
done
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    56
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    57
lemma subset_increasing_comp: 
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    58
"[| mono1(A, r, B, s, g); refl(A, r); trans[B](s)  |] ==>  
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    59
   increasing[A](r, f) <= increasing[B](s, g comp f)"
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    60
apply (unfold increasing_def stable_def part_order_def 
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    61
       constrains_def mono1_def metacomp_def, clarify, simp)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    62
apply clarify
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    63
apply (subgoal_tac "xa \<in> state")
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    64
prefer 2 apply (blast dest!: ActsD)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    65
apply (subgoal_tac "<f (xb), f (xb) >:r")
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    66
prefer 2 apply (force simp add: refl_def)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    67
apply (rotate_tac 5)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    68
apply (drule_tac x = "f (xb) " in bspec)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    69
apply (rotate_tac [2] -1)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    70
apply (drule_tac [2] x = act in bspec, simp_all)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    71
apply (drule_tac A = "act``?u" and c = xa in subsetD, blast)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    72
apply (drule_tac x = "f (xa) " and x1 = "f (xb) " in bspec [THEN bspec])
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    73
apply (rule_tac [3] b = "g (f (xb))" and A = B in trans_onD)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    74
apply simp_all
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    75
done
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    76
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    77
lemma imp_increasing_comp:
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    78
     "[| F \<in> increasing[A](r, f); mono1(A, r, B, s, g);  
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    79
         refl(A, r); trans[B](s) |] ==> F \<in> increasing[B](s, g comp f)"
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    80
by (rule subset_increasing_comp [THEN subsetD], auto)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    81
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    82
lemma strict_increasing: 
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    83
   "increasing[nat](Le, f) <= increasing[nat](Lt, f)"
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    84
by (unfold increasing_def Lt_def, auto)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    85
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    86
lemma strict_gt_increasing: 
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    87
   "increasing[nat](Ge, f) <= increasing[nat](Gt, f)"
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    88
apply (unfold increasing_def Gt_def Ge_def, auto)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    89
apply (erule natE)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    90
apply (auto simp add: stable_def)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    91
done
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    92
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    93
(** Increasing **)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    94
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    95
lemma increasing_imp_Increasing: 
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    96
     "F \<in> increasing[A](r, f) ==> F \<in> Increasing[A](r, f)"
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    97
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    98
apply (unfold increasing_def Increasing_def)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
    99
apply (auto intro: stable_imp_Stable)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   100
done
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   101
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   102
lemma Increasing_type: "Increasing[A](r, f) <= program"
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   103
by (unfold Increasing_def, auto)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   104
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   105
lemma Increasing_into_program: "F \<in> Increasing[A](r, f) ==> F \<in> program"
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   106
by (unfold Increasing_def, auto)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   107
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   108
lemma Increasing_imp_Stable: 
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   109
"[| F \<in> Increasing[A](r, f); a \<in> A |] ==> F \<in> Stable({s \<in> state. <a,f(s)>:r})"
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   110
by (unfold Increasing_def, blast)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   111
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   112
lemma IncreasingD: 
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   113
"F \<in> Increasing[A](r, f) ==> F \<in> program & (\<exists>a. a \<in> A) & (\<forall>s \<in> state. f(s):A)"
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   114
apply (unfold Increasing_def)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   115
apply (subgoal_tac "\<exists>x. x \<in> state")
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   116
apply (auto intro: st0_in_state)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   117
done
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   118
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   119
lemma Increasing_constant [simp]: 
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   120
     "F \<in> Increasing[A](r, %s. c) <-> F \<in> program & (c \<in> A)"
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   121
apply (subgoal_tac "\<exists>x. x \<in> state")
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   122
apply (auto dest!: IncreasingD intro: st0_in_state increasing_imp_Increasing)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   123
done
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   124
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   125
lemma subset_Increasing_comp: 
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   126
"[| mono1(A, r, B, s, g); refl(A, r); trans[B](s) |] ==>  
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   127
   Increasing[A](r, f) <= Increasing[B](s, g comp f)"
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   128
apply (unfold Increasing_def Stable_def Constrains_def part_order_def 
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   129
       constrains_def mono1_def metacomp_def, safe)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   130
apply (simp_all add: ActsD)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   131
apply (subgoal_tac "xb \<in> state & xa \<in> state")
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   132
 prefer 2 apply (simp add: ActsD)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   133
apply (subgoal_tac "<f (xb), f (xb) >:r")
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   134
prefer 2 apply (force simp add: refl_def)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   135
apply (rotate_tac 5)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   136
apply (drule_tac x = "f (xb) " in bspec)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   137
apply simp_all
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   138
apply clarify
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   139
apply (rotate_tac -2)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   140
apply (drule_tac x = act in bspec)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   141
apply (drule_tac [2] A = "act``?u" and c = xa in subsetD, simp_all, blast)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   142
apply (drule_tac x = "f (xa) " and x1 = "f (xb) " in bspec [THEN bspec])
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   143
apply (rule_tac [3] b = "g (f (xb))" and A = B in trans_onD)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   144
apply simp_all
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   145
done
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   146
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   147
lemma imp_Increasing_comp:
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   148
 "[| F \<in> Increasing[A](r, f); mono1(A, r, B, s, g); refl(A, r); trans[B](s) |] 
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   149
  ==> F \<in> Increasing[B](s, g comp f)"
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   150
apply (rule subset_Increasing_comp [THEN subsetD], auto)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   151
done
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   152
  
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   153
lemma strict_Increasing: "Increasing[nat](Le, f) <= Increasing[nat](Lt, f)"
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   154
by (unfold Increasing_def Lt_def, auto)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   155
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   156
lemma strict_gt_Increasing: "Increasing[nat](Ge, f)<= Increasing[nat](Gt, f)"
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   157
apply (unfold Increasing_def Ge_def Gt_def, auto)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   158
apply (erule natE)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   159
apply (auto simp add: Stable_def)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   160
done
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   161
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   162
(** Two-place monotone operations **)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   163
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   164
lemma imp_increasing_comp2: 
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   165
"[| F \<in> increasing[A](r, f); F \<in> increasing[B](s, g);  
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   166
    mono2(A, r, B, s, C, t, h); refl(A, r); refl(B, s); trans[C](t) |]
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   167
 ==> F \<in> increasing[C](t, %x. h(f(x), g(x)))"
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   168
apply (unfold increasing_def stable_def 
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   169
       part_order_def constrains_def mono2_def, clarify, simp)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   170
apply clarify
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   171
apply (rename_tac xa xb)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   172
apply (subgoal_tac "xb \<in> state & xa \<in> state")
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   173
 prefer 2 apply (blast dest!: ActsD)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   174
apply (subgoal_tac "<f (xb), f (xb) >:r & <g (xb), g (xb) >:s")
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   175
prefer 2 apply (force simp add: refl_def)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   176
apply (rotate_tac 6)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   177
apply (drule_tac x = "f (xb) " in bspec)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   178
apply (rotate_tac [2] 1)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   179
apply (drule_tac [2] x = "g (xb) " in bspec)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   180
apply simp_all
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   181
apply (rotate_tac -1)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   182
apply (drule_tac x = act in bspec)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   183
apply (rotate_tac [2] -3)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   184
apply (drule_tac [2] x = act in bspec, simp_all)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   185
apply (drule_tac A = "act``?u" and c = xa in subsetD)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   186
apply (drule_tac [2] A = "act``?u" and c = xa in subsetD, blast, blast)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   187
apply (rotate_tac -4)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   188
apply (drule_tac x = "f (xa) " and x1 = "f (xb) " in bspec [THEN bspec])
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   189
apply (rotate_tac [3] -1)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   190
apply (drule_tac [3] x = "g (xa) " and x1 = "g (xb) " in bspec [THEN bspec])
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   191
apply simp_all
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   192
apply (rule_tac b = "h (f (xb), g (xb))" and A = C in trans_onD)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   193
apply simp_all
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   194
done
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   195
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   196
lemma imp_Increasing_comp2: 
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   197
"[| F \<in> Increasing[A](r, f); F \<in> Increasing[B](s, g);  
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   198
  mono2(A, r, B, s, C, t, h); refl(A, r); refl(B, s); trans[C](t) |] ==>  
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   199
  F \<in> Increasing[C](t, %x. h(f(x), g(x)))"
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   200
apply (unfold Increasing_def stable_def 
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   201
       part_order_def constrains_def mono2_def Stable_def Constrains_def, safe)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   202
apply (simp_all add: ActsD)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   203
apply (subgoal_tac "xa \<in> state & x \<in> state")
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   204
prefer 2 apply (blast dest!: ActsD)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   205
apply (subgoal_tac "<f (xa), f (xa) >:r & <g (xa), g (xa) >:s")
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   206
prefer 2 apply (force simp add: refl_def)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   207
apply (rotate_tac 6)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   208
apply (drule_tac x = "f (xa) " in bspec)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   209
apply (rotate_tac [2] 1)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   210
apply (drule_tac [2] x = "g (xa) " in bspec)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   211
apply simp_all
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   212
apply clarify
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   213
apply (rotate_tac -2)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   214
apply (drule_tac x = act in bspec)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   215
apply (rotate_tac [2] -3)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   216
apply (drule_tac [2] x = act in bspec, simp_all)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   217
apply (drule_tac A = "act``?u" and c = x in subsetD)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   218
apply (drule_tac [2] A = "act``?u" and c = x in subsetD, blast, blast)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   219
apply (rotate_tac -9)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   220
apply (drule_tac x = "f (x) " and x1 = "f (xa) " in bspec [THEN bspec])
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   221
apply (rotate_tac [3] -1)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   222
apply (drule_tac [3] x = "g (x) " and x1 = "g (xa) " in bspec [THEN bspec])
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   223
apply simp_all
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   224
apply (rule_tac b = "h (f (xa), g (xa))" and A = C in trans_onD)
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   225
apply simp_all
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   226
done
24382760fd89 converting more theories to Isar scripts, and tidying
paulson
parents: 14055
diff changeset
   227
14052
e9c9f69e4f63 some new ZF/UNITY material from Sidi Ehmety
paulson
parents:
diff changeset
   228
end