181 by (auto simp add: image_def compose_eq) |
181 by (auto simp add: image_def compose_eq) |
182 |
182 |
183 |
183 |
184 subsection{*Bounded Abstraction: @{term restrict}*} |
184 subsection{*Bounded Abstraction: @{term restrict}*} |
185 |
185 |
186 lemma restrict_in_funcset: "(!!x. x \<in> A ==> f x \<in> B) ==> (\<lambda>x\<in>A. f x) \<in> A -> B" |
186 lemma restrict_in_funcset: "(\<And>x. x \<in> A \<Longrightarrow> f x \<in> B) \<Longrightarrow> (\<lambda>x\<in>A. f x) \<in> A \<rightarrow> B" |
187 by (simp add: Pi_def restrict_def) |
187 by (simp add: Pi_def restrict_def) |
188 |
188 |
189 lemma restrictI[intro!]: "(!!x. x \<in> A ==> f x \<in> B x) ==> (\<lambda>x\<in>A. f x) \<in> Pi A B" |
189 lemma restrictI[intro!]: "(\<And>x. x \<in> A \<Longrightarrow> f x \<in> B x) \<Longrightarrow> (\<lambda>x\<in>A. f x) \<in> Pi A B" |
190 by (simp add: Pi_def restrict_def) |
190 by (simp add: Pi_def restrict_def) |
191 |
191 |
192 lemma restrict_apply [simp]: |
192 lemma restrict_apply[simp]: "(\<lambda>y\<in>A. f y) x = (if x \<in> A then f x else undefined)" |
193 "(\<lambda>y\<in>A. f y) x = (if x \<in> A then f x else undefined)" |
|
194 by (simp add: restrict_def) |
193 by (simp add: restrict_def) |
195 |
194 |
|
195 lemma restrict_apply': "x \<in> A \<Longrightarrow> (\<lambda>y\<in>A. f y) x = f x" |
|
196 by simp |
|
197 |
196 lemma restrict_ext: |
198 lemma restrict_ext: |
197 "(!!x. x \<in> A ==> f x = g x) ==> (\<lambda>x\<in>A. f x) = (\<lambda>x\<in>A. g x)" |
199 "(\<And>x. x \<in> A \<Longrightarrow> f x = g x) \<Longrightarrow> (\<lambda>x\<in>A. f x) = (\<lambda>x\<in>A. g x)" |
198 by (simp add: fun_eq_iff Pi_def restrict_def) |
200 by (simp add: fun_eq_iff Pi_def restrict_def) |
199 |
201 |
200 lemma inj_on_restrict_eq [simp]: "inj_on (restrict f A) A = inj_on f A" |
202 lemma inj_on_restrict_eq [simp]: "inj_on (restrict f A) A = inj_on f A" |
201 by (simp add: inj_on_def restrict_def) |
203 by (simp add: inj_on_def restrict_def) |
202 |
204 |
360 |
362 |
361 lemma extensional_funcset_def: "extensional_funcset S T = (S -> T) \<inter> extensional S" |
363 lemma extensional_funcset_def: "extensional_funcset S T = (S -> T) \<inter> extensional S" |
362 by (simp add: PiE_def) |
364 by (simp add: PiE_def) |
363 |
365 |
364 lemma PiE_empty_domain[simp]: "PiE {} T = {%x. undefined}" |
366 lemma PiE_empty_domain[simp]: "PiE {} T = {%x. undefined}" |
|
367 unfolding PiE_def by simp |
|
368 |
|
369 lemma PiE_UNIV_domain: "PiE UNIV T = Pi UNIV T" |
365 unfolding PiE_def by simp |
370 unfolding PiE_def by simp |
366 |
371 |
367 lemma PiE_empty_range[simp]: "i \<in> I \<Longrightarrow> F i = {} \<Longrightarrow> (PIE i:I. F i) = {}" |
372 lemma PiE_empty_range[simp]: "i \<in> I \<Longrightarrow> F i = {} \<Longrightarrow> (PIE i:I. F i) = {}" |
368 unfolding PiE_def by auto |
373 unfolding PiE_def by auto |
369 |
374 |