| author | wenzelm | 
| Thu, 22 Feb 2024 12:19:23 +0100 | |
| changeset 79689 | fabe9f89911f | 
| parent 76217 | 8655344f1cf6 | 
| child 80917 | 2a77bc3b4eac | 
| permissions | -rw-r--r-- | 
| 32960 
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
 wenzelm parents: 
24893diff
changeset | 1 | (* Title: ZF/UNITY/Increasing.thy | 
| 14052 | 2 | Author: Sidi O Ehmety, Cambridge University Computer Laboratory | 
| 3 | Copyright 2001 University of Cambridge | |
| 4 | ||
| 5 | Increasing's parameters are a state function f, a domain A and an order | |
| 6 | relation r over the domain A. | |
| 7 | *) | |
| 8 | ||
| 60770 | 9 | section\<open>Charpentier's "Increasing" Relation\<close> | 
| 14093 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 10 | |
| 16417 | 11 | theory Increasing imports Constrains Monotonicity begin | 
| 14093 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 12 | |
| 24893 | 13 | definition | 
| 76215 
a642599ffdea
More syntactic cleanup. LaTeX markup working
 paulson <lp15@cam.ac.uk> parents: 
76214diff
changeset | 14 | increasing :: "[i, i, i\<Rightarrow>i] \<Rightarrow> i" (\<open>increasing[_]'(_, _')\<close>) where | 
| 76213 
e44d86131648
Removal of obsolete ASCII syntax
 paulson <lp15@cam.ac.uk> parents: 
69587diff
changeset | 15 | "increasing[A](r, f) \<equiv> | 
| 76214 | 16 |     {F \<in> program. (\<forall>k \<in> A. F \<in> stable({s \<in> state. <k, f(s)> \<in> r})) \<and>
 | 
| 14093 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 17 | (\<forall>x \<in> state. f(x):A)}" | 
| 14052 | 18 | |
| 24893 | 19 | definition | 
| 76215 
a642599ffdea
More syntactic cleanup. LaTeX markup working
 paulson <lp15@cam.ac.uk> parents: 
76214diff
changeset | 20 | Increasing :: "[i, i, i\<Rightarrow>i] \<Rightarrow> i" (\<open>Increasing[_]'(_, _')\<close>) where | 
| 76213 
e44d86131648
Removal of obsolete ASCII syntax
 paulson <lp15@cam.ac.uk> parents: 
69587diff
changeset | 21 | "Increasing[A](r, f) \<equiv> | 
| 76214 | 22 |     {F \<in> program. (\<forall>k \<in> A. F \<in> Stable({s \<in> state. <k, f(s)> \<in> r})) \<and>
 | 
| 14093 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 23 | (\<forall>x \<in> state. f(x):A)}" | 
| 14052 | 24 | |
| 24892 | 25 | abbreviation (input) | 
| 76215 
a642599ffdea
More syntactic cleanup. LaTeX markup working
 paulson <lp15@cam.ac.uk> parents: 
76214diff
changeset | 26 | IncWrt :: "[i\<Rightarrow>i, i, i] \<Rightarrow> i" (\<open>(_ IncreasingWrt _ '/ _)\<close> [60, 0, 60] 60) where | 
| 76213 
e44d86131648
Removal of obsolete ASCII syntax
 paulson <lp15@cam.ac.uk> parents: 
69587diff
changeset | 27 | "f IncreasingWrt r/A \<equiv> Increasing[A](r,f)" | 
| 14052 | 28 | |
| 14093 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 29 | |
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 30 | (** increasing **) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 31 | |
| 46823 | 32 | lemma increasing_type: "increasing[A](r, f) \<subseteq> program" | 
| 14093 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 33 | by (unfold increasing_def, blast) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 34 | |
| 76213 
e44d86131648
Removal of obsolete ASCII syntax
 paulson <lp15@cam.ac.uk> parents: 
69587diff
changeset | 35 | lemma increasing_into_program: "F \<in> increasing[A](r, f) \<Longrightarrow> F \<in> program" | 
| 14093 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 36 | by (unfold increasing_def, blast) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 37 | |
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 38 | lemma increasing_imp_stable: | 
| 76213 
e44d86131648
Removal of obsolete ASCII syntax
 paulson <lp15@cam.ac.uk> parents: 
69587diff
changeset | 39 | "\<lbrakk>F \<in> increasing[A](r, f); x \<in> A\<rbrakk> \<Longrightarrow>F \<in> stable({s \<in> state. <x, f(s)>:r})"
 | 
| 14093 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 40 | by (unfold increasing_def, blast) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 41 | |
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 42 | lemma increasingD: | 
| 76214 | 43 | "F \<in> increasing[A](r,f) \<Longrightarrow> F \<in> program \<and> (\<exists>a. a \<in> A) \<and> (\<forall>s \<in> state. f(s):A)" | 
| 76216 
9fc34f76b4e8
getting rid of apply (unfold ...)
 paulson <lp15@cam.ac.uk> parents: 
76215diff
changeset | 44 | unfolding increasing_def | 
| 14093 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 45 | apply (subgoal_tac "\<exists>x. x \<in> state") | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 46 | apply (auto dest: stable_type [THEN subsetD] intro: st0_in_state) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 47 | done | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 48 | |
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 49 | lemma increasing_constant [simp]: | 
| 76215 
a642599ffdea
More syntactic cleanup. LaTeX markup working
 paulson <lp15@cam.ac.uk> parents: 
76214diff
changeset | 50 | "F \<in> increasing[A](r, \<lambda>s. c) \<longleftrightarrow> F \<in> program \<and> c \<in> A" | 
| 76217 | 51 | unfolding increasing_def stable_def | 
| 14093 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 52 | apply (subgoal_tac "\<exists>x. x \<in> state") | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 53 | apply (auto dest: stable_type [THEN subsetD] intro: st0_in_state) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 54 | done | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 55 | |
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 56 | lemma subset_increasing_comp: | 
| 76213 
e44d86131648
Removal of obsolete ASCII syntax
 paulson <lp15@cam.ac.uk> parents: 
69587diff
changeset | 57 | "\<lbrakk>mono1(A, r, B, s, g); refl(A, r); trans[B](s)\<rbrakk> \<Longrightarrow> | 
| 46823 | 58 | increasing[A](r, f) \<subseteq> increasing[B](s, g comp f)" | 
| 14093 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 59 | apply (unfold increasing_def stable_def part_order_def | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 60 | constrains_def mono1_def metacomp_def, clarify, simp) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 61 | apply clarify | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 62 | apply (subgoal_tac "xa \<in> state") | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 63 | prefer 2 apply (blast dest!: ActsD) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 64 | apply (subgoal_tac "<f (xb), f (xb) >:r") | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 65 | prefer 2 apply (force simp add: refl_def) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 66 | apply (rotate_tac 5) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 67 | apply (drule_tac x = "f (xb) " in bspec) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 68 | apply (rotate_tac [2] -1) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 69 | apply (drule_tac [2] x = act in bspec, simp_all) | 
| 59788 | 70 | apply (drule_tac A = "act``u" and c = xa for u in subsetD, blast) | 
| 71 | apply (drule_tac x = "f(xa) " and x1 = "f(xb)" in bspec [THEN bspec]) | |
| 14093 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 72 | 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: 
14055diff
changeset | 73 | apply simp_all | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 74 | done | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 75 | |
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 76 | lemma imp_increasing_comp: | 
| 76213 
e44d86131648
Removal of obsolete ASCII syntax
 paulson <lp15@cam.ac.uk> parents: 
69587diff
changeset | 77 | "\<lbrakk>F \<in> increasing[A](r, f); mono1(A, r, B, s, g); | 
| 
e44d86131648
Removal of obsolete ASCII syntax
 paulson <lp15@cam.ac.uk> parents: 
69587diff
changeset | 78 | refl(A, r); trans[B](s)\<rbrakk> \<Longrightarrow> F \<in> increasing[B](s, g comp f)" | 
| 14093 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 79 | by (rule subset_increasing_comp [THEN subsetD], auto) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 80 | |
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 81 | lemma strict_increasing: | 
| 46823 | 82 | "increasing[nat](Le, f) \<subseteq> increasing[nat](Lt, f)" | 
| 14093 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 83 | by (unfold increasing_def Lt_def, auto) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 84 | |
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 85 | lemma strict_gt_increasing: | 
| 46823 | 86 | "increasing[nat](Ge, f) \<subseteq> increasing[nat](Gt, f)" | 
| 14093 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 87 | apply (unfold increasing_def Gt_def Ge_def, auto) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 88 | apply (erule natE) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 89 | apply (auto simp add: stable_def) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 90 | done | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 91 | |
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 92 | (** Increasing **) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 93 | |
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 94 | lemma increasing_imp_Increasing: | 
| 76213 
e44d86131648
Removal of obsolete ASCII syntax
 paulson <lp15@cam.ac.uk> parents: 
69587diff
changeset | 95 | "F \<in> increasing[A](r, f) \<Longrightarrow> F \<in> Increasing[A](r, f)" | 
| 14093 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 96 | |
| 76217 | 97 | unfolding increasing_def Increasing_def | 
| 14093 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 98 | apply (auto intro: stable_imp_Stable) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 99 | done | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 100 | |
| 46823 | 101 | lemma Increasing_type: "Increasing[A](r, f) \<subseteq> program" | 
| 14093 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 102 | by (unfold Increasing_def, auto) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 103 | |
| 76213 
e44d86131648
Removal of obsolete ASCII syntax
 paulson <lp15@cam.ac.uk> parents: 
69587diff
changeset | 104 | lemma Increasing_into_program: "F \<in> Increasing[A](r, f) \<Longrightarrow> F \<in> program" | 
| 14093 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 105 | by (unfold Increasing_def, auto) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 106 | |
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 107 | lemma Increasing_imp_Stable: | 
| 76213 
e44d86131648
Removal of obsolete ASCII syntax
 paulson <lp15@cam.ac.uk> parents: 
69587diff
changeset | 108 | "\<lbrakk>F \<in> Increasing[A](r, f); a \<in> A\<rbrakk> \<Longrightarrow> F \<in> Stable({s \<in> state. <a,f(s)>:r})"
 | 
| 14093 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 109 | by (unfold Increasing_def, blast) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 110 | |
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 111 | lemma IncreasingD: | 
| 76214 | 112 | "F \<in> Increasing[A](r, f) \<Longrightarrow> F \<in> program \<and> (\<exists>a. a \<in> A) \<and> (\<forall>s \<in> state. f(s):A)" | 
| 76216 
9fc34f76b4e8
getting rid of apply (unfold ...)
 paulson <lp15@cam.ac.uk> parents: 
76215diff
changeset | 113 | unfolding Increasing_def | 
| 14093 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 114 | apply (subgoal_tac "\<exists>x. x \<in> state") | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 115 | apply (auto intro: st0_in_state) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 116 | done | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 117 | |
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 118 | lemma Increasing_constant [simp]: | 
| 76215 
a642599ffdea
More syntactic cleanup. LaTeX markup working
 paulson <lp15@cam.ac.uk> parents: 
76214diff
changeset | 119 | "F \<in> Increasing[A](r, \<lambda>s. c) \<longleftrightarrow> F \<in> program \<and> (c \<in> A)" | 
| 14093 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 120 | apply (subgoal_tac "\<exists>x. x \<in> state") | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 121 | apply (auto dest!: IncreasingD intro: st0_in_state increasing_imp_Increasing) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 122 | done | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 123 | |
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 124 | lemma subset_Increasing_comp: | 
| 76213 
e44d86131648
Removal of obsolete ASCII syntax
 paulson <lp15@cam.ac.uk> parents: 
69587diff
changeset | 125 | "\<lbrakk>mono1(A, r, B, s, g); refl(A, r); trans[B](s)\<rbrakk> \<Longrightarrow> | 
| 46823 | 126 | Increasing[A](r, f) \<subseteq> Increasing[B](s, g comp f)" | 
| 14093 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 127 | apply (unfold Increasing_def Stable_def Constrains_def part_order_def | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 128 | constrains_def mono1_def metacomp_def, safe) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 129 | apply (simp_all add: ActsD) | 
| 76214 | 130 | apply (subgoal_tac "xb \<in> state \<and> xa \<in> state") | 
| 14093 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 131 | prefer 2 apply (simp add: ActsD) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 132 | apply (subgoal_tac "<f (xb), f (xb) >:r") | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 133 | prefer 2 apply (force simp add: refl_def) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 134 | apply (rotate_tac 5) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 135 | apply (drule_tac x = "f (xb) " in bspec) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 136 | apply simp_all | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 137 | apply clarify | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 138 | apply (rotate_tac -2) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 139 | apply (drule_tac x = act in bspec) | 
| 59788 | 140 | apply (drule_tac [2] A = "act``u" and c = xa for u in subsetD, simp_all, blast) | 
| 141 | apply (drule_tac x = "f(xa)" and x1 = "f(xb)" in bspec [THEN bspec]) | |
| 14093 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 142 | 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: 
14055diff
changeset | 143 | apply simp_all | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 144 | done | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 145 | |
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 146 | lemma imp_Increasing_comp: | 
| 76213 
e44d86131648
Removal of obsolete ASCII syntax
 paulson <lp15@cam.ac.uk> parents: 
69587diff
changeset | 147 | "\<lbrakk>F \<in> Increasing[A](r, f); mono1(A, r, B, s, g); refl(A, r); trans[B](s)\<rbrakk> | 
| 
e44d86131648
Removal of obsolete ASCII syntax
 paulson <lp15@cam.ac.uk> parents: 
69587diff
changeset | 148 | \<Longrightarrow> F \<in> Increasing[B](s, g comp f)" | 
| 14093 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 149 | apply (rule subset_Increasing_comp [THEN subsetD], auto) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 150 | done | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 151 | |
| 46823 | 152 | lemma strict_Increasing: "Increasing[nat](Le, f) \<subseteq> Increasing[nat](Lt, f)" | 
| 14093 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 153 | by (unfold Increasing_def Lt_def, auto) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 154 | |
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 155 | lemma strict_gt_Increasing: "Increasing[nat](Ge, f)<= Increasing[nat](Gt, f)" | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 156 | apply (unfold Increasing_def Ge_def Gt_def, auto) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 157 | apply (erule natE) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 158 | apply (auto simp add: Stable_def) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 159 | done | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 160 | |
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 161 | (** Two-place monotone operations **) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 162 | |
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 163 | lemma imp_increasing_comp2: | 
| 76213 
e44d86131648
Removal of obsolete ASCII syntax
 paulson <lp15@cam.ac.uk> parents: 
69587diff
changeset | 164 | "\<lbrakk>F \<in> increasing[A](r, f); F \<in> increasing[B](s, g); | 
| 
e44d86131648
Removal of obsolete ASCII syntax
 paulson <lp15@cam.ac.uk> parents: 
69587diff
changeset | 165 | mono2(A, r, B, s, C, t, h); refl(A, r); refl(B, s); trans[C](t)\<rbrakk> | 
| 76215 
a642599ffdea
More syntactic cleanup. LaTeX markup working
 paulson <lp15@cam.ac.uk> parents: 
76214diff
changeset | 166 | \<Longrightarrow> F \<in> increasing[C](t, \<lambda>x. h(f(x), g(x)))" | 
| 14093 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 167 | apply (unfold increasing_def stable_def | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 168 | part_order_def constrains_def mono2_def, clarify, simp) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 169 | apply clarify | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 170 | apply (rename_tac xa xb) | 
| 76214 | 171 | apply (subgoal_tac "xb \<in> state \<and> xa \<in> state") | 
| 14093 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 172 | prefer 2 apply (blast dest!: ActsD) | 
| 76214 | 173 | apply (subgoal_tac "<f (xb), f (xb) >:r \<and> <g (xb), g (xb) >:s") | 
| 14093 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 174 | prefer 2 apply (force simp add: refl_def) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 175 | apply (rotate_tac 6) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 176 | apply (drule_tac x = "f (xb) " in bspec) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 177 | apply (rotate_tac [2] 1) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 178 | apply (drule_tac [2] x = "g (xb) " in bspec) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 179 | apply simp_all | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 180 | apply (rotate_tac -1) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 181 | apply (drule_tac x = act in bspec) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 182 | apply (rotate_tac [2] -3) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 183 | apply (drule_tac [2] x = act in bspec, simp_all) | 
| 59788 | 184 | apply (drule_tac A = "act``u" and c = xa for u in subsetD) | 
| 185 | apply (drule_tac [2] A = "act``u" and c = xa for u in subsetD, blast, blast) | |
| 14093 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 186 | apply (rotate_tac -4) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 187 | 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: 
14055diff
changeset | 188 | apply (rotate_tac [3] -1) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 189 | 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: 
14055diff
changeset | 190 | apply simp_all | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 191 | 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: 
14055diff
changeset | 192 | apply simp_all | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 193 | done | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 194 | |
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 195 | lemma imp_Increasing_comp2: | 
| 76213 
e44d86131648
Removal of obsolete ASCII syntax
 paulson <lp15@cam.ac.uk> parents: 
69587diff
changeset | 196 | "\<lbrakk>F \<in> Increasing[A](r, f); F \<in> Increasing[B](s, g); | 
| 
e44d86131648
Removal of obsolete ASCII syntax
 paulson <lp15@cam.ac.uk> parents: 
69587diff
changeset | 197 | mono2(A, r, B, s, C, t, h); refl(A, r); refl(B, s); trans[C](t)\<rbrakk> \<Longrightarrow> | 
| 76215 
a642599ffdea
More syntactic cleanup. LaTeX markup working
 paulson <lp15@cam.ac.uk> parents: 
76214diff
changeset | 198 | F \<in> Increasing[C](t, \<lambda>x. h(f(x), g(x)))" | 
| 14093 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 199 | apply (unfold Increasing_def stable_def | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 200 | part_order_def constrains_def mono2_def Stable_def Constrains_def, safe) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 201 | apply (simp_all add: ActsD) | 
| 76214 | 202 | apply (subgoal_tac "xa \<in> state \<and> x \<in> state") | 
| 14093 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 203 | prefer 2 apply (blast dest!: ActsD) | 
| 76214 | 204 | apply (subgoal_tac "<f (xa), f (xa) >:r \<and> <g (xa), g (xa) >:s") | 
| 14093 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 205 | prefer 2 apply (force simp add: refl_def) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 206 | apply (rotate_tac 6) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 207 | apply (drule_tac x = "f (xa) " in bspec) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 208 | apply (rotate_tac [2] 1) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 209 | apply (drule_tac [2] x = "g (xa) " in bspec) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 210 | apply simp_all | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 211 | apply clarify | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 212 | apply (rotate_tac -2) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 213 | apply (drule_tac x = act in bspec) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 214 | apply (rotate_tac [2] -3) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 215 | apply (drule_tac [2] x = act in bspec, simp_all) | 
| 59788 | 216 | apply (drule_tac A = "act``u" and c = x for u in subsetD) | 
| 217 | apply (drule_tac [2] A = "act``u" and c = x for u in subsetD, blast, blast) | |
| 14093 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 218 | apply (rotate_tac -9) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 219 | 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: 
14055diff
changeset | 220 | apply (rotate_tac [3] -1) | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 221 | 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: 
14055diff
changeset | 222 | apply simp_all | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 223 | 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: 
14055diff
changeset | 224 | apply simp_all | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 225 | done | 
| 
24382760fd89
converting more theories to Isar scripts, and tidying
 paulson parents: 
14055diff
changeset | 226 | |
| 14052 | 227 | end |