text
stringlengths 0
3.34M
|
---|
A circle of support is a group (usually of 6 or more people) who are invited to come together to offer support and advice to someone with a learning disability.
If you need extra help in areas of your life this is one way of sharing concerns and making plans for the future.
Every circle is unique but what they have in common is that they consist of people who choose to be in your life. They are not paid to be there. You will meet with them regularly and develop strong relationships of care and personal friendship.
We believe that the strength of the relationships formed within a circle of support is the key to a better quality of life for you.
People we support have found that circles help put an end to loneliness and isolation. When we help you build a circle we aim for lifelong feeling of being at home and belonging to the community.
We are helping some people to build lasting circles of support. In this approach is the circle members would make a long-term commitment to you. This includes looking out for your well-being in years to come – even beyond the lifetime of those who care for you at present.
Equal Futures is an independent company in the Thera Group. Staff there have an outstanding record in building lifelong circles and other types of support network. |
Charles Gray as Dikko Henderson : British contact living in Japan .
|
(*
File: PAC_Checker_Specification.thy
Author: Mathias Fleury, Daniela Kaufmann, JKU
Maintainer: Mathias Fleury, JKU
*)
theory PAC_Checker_Specification
imports PAC_Specification
Refine_Imperative_HOL.IICF
Finite_Map_Multiset
begin
section \<open>Checker Algorithm\<close>
text \<open>
In this level of refinement, we define the first level of the
implementation of the checker, both with the specification as
on ideals and the first version of the loop.
\<close>
subsection \<open>Specification\<close>
datatype status =
is_failed: FAILED |
is_success: SUCCESS |
is_found: FOUND
lemma is_success_alt_def:
\<open>is_success a \<longleftrightarrow> a = SUCCESS\<close>
by (cases a) auto
datatype ('a, 'b, 'lbls) pac_step =
Add (pac_src1: 'lbls) (pac_src2: 'lbls) (new_id: 'lbls) (pac_res: 'a) |
Mult (pac_src1: 'lbls) (pac_mult: 'a) (new_id: 'lbls) (pac_res: 'a) |
Extension (new_id: 'lbls) (new_var: 'b) (pac_res: 'a) |
Del (pac_src1: 'lbls)
type_synonym pac_state = \<open>(nat set \<times> int_poly multiset)\<close>
definition PAC_checker_specification
:: \<open>int_poly \<Rightarrow> int_poly multiset \<Rightarrow> (status \<times> nat set \<times> int_poly multiset) nres\<close>
where
\<open>PAC_checker_specification spec A = SPEC(\<lambda>(b, \<V>, B).
(\<not>is_failed b \<longrightarrow> restricted_ideal_to\<^sub>I (\<Union>(vars ` set_mset A) \<union> vars spec) B \<subseteq> restricted_ideal_to\<^sub>I (\<Union>(vars ` set_mset A) \<union> vars spec) A) \<and>
(is_found b \<longrightarrow> spec \<in> pac_ideal (set_mset A)))\<close>
definition PAC_checker_specification_spec
:: \<open>int_poly \<Rightarrow> pac_state \<Rightarrow> (status \<times> pac_state) \<Rightarrow> bool\<close>
where
\<open>PAC_checker_specification_spec spec = (\<lambda>(\<V>, A) (b, B). (\<not>is_failed b \<longrightarrow> \<Union>(vars ` set_mset A) \<subseteq> \<V>) \<and>
(is_success b \<longrightarrow> PAC_Format\<^sup>*\<^sup>* (\<V>, A) B) \<and>
(is_found b \<longrightarrow> PAC_Format\<^sup>*\<^sup>* (\<V>, A) B \<and> spec \<in> pac_ideal (set_mset A)))\<close>
abbreviation PAC_checker_specification2
:: \<open>int_poly \<Rightarrow> (nat set \<times> int_poly multiset) \<Rightarrow> (status \<times> (nat set \<times> int_poly multiset)) nres\<close>
where
\<open>PAC_checker_specification2 spec A \<equiv> SPEC(PAC_checker_specification_spec spec A)\<close>
definition PAC_checker_specification_step_spec
:: \<open>pac_state \<Rightarrow> int_poly \<Rightarrow> pac_state \<Rightarrow> (status \<times> pac_state) \<Rightarrow> bool\<close>
where
\<open>PAC_checker_specification_step_spec = (\<lambda>(\<V>\<^sub>0, A\<^sub>0) spec (\<V>, A) (b, B).
(is_success b \<longrightarrow>
\<Union>(vars ` set_mset A\<^sub>0) \<subseteq> \<V>\<^sub>0 \<and>
\<Union>(vars ` set_mset A) \<subseteq> \<V> \<and> PAC_Format\<^sup>*\<^sup>* (\<V>\<^sub>0, A\<^sub>0) (\<V>, A) \<and> PAC_Format\<^sup>*\<^sup>* (\<V>, A) B) \<and>
(is_found b \<longrightarrow>
\<Union>(vars ` set_mset A\<^sub>0) \<subseteq> \<V>\<^sub>0 \<and>
\<Union>(vars ` set_mset A) \<subseteq> \<V> \<and> PAC_Format\<^sup>*\<^sup>* (\<V>\<^sub>0, A\<^sub>0) (\<V>, A) \<and> PAC_Format\<^sup>*\<^sup>* (\<V>, A) B \<and>
spec \<in> pac_ideal (set_mset A\<^sub>0)))\<close>
abbreviation PAC_checker_specification_step2
:: \<open>pac_state \<Rightarrow> int_poly \<Rightarrow> pac_state \<Rightarrow> (status \<times> pac_state) nres\<close>
where
\<open>PAC_checker_specification_step2 A\<^sub>0 spec A \<equiv> SPEC(PAC_checker_specification_step_spec A\<^sub>0 spec A)\<close>
definition normalize_poly_spec :: \<open>_\<close> where
\<open>normalize_poly_spec p = SPEC (\<lambda>r. p - r \<in> ideal polynomial_bool \<and> vars r \<subseteq> vars p)\<close>
lemma normalize_poly_spec_alt_def:
\<open>normalize_poly_spec p = SPEC (\<lambda>r. r - p \<in> ideal polynomial_bool \<and> vars r \<subseteq> vars p)\<close>
unfolding normalize_poly_spec_def
by (auto dest: ideal.span_neg)
definition mult_poly_spec :: \<open>int mpoly \<Rightarrow> int mpoly \<Rightarrow> int mpoly nres\<close> where
\<open>mult_poly_spec p q = SPEC (\<lambda>r. p * q - r \<in> ideal polynomial_bool)\<close>
definition check_add :: \<open>(nat, int mpoly) fmap \<Rightarrow> nat set \<Rightarrow> nat \<Rightarrow> nat \<Rightarrow> nat \<Rightarrow> int mpoly \<Rightarrow> bool nres\<close> where
\<open>check_add A \<V> p q i r =
SPEC(\<lambda>b. b \<longrightarrow> p \<in># dom_m A \<and> q \<in># dom_m A \<and> i \<notin># dom_m A \<and> vars r \<subseteq> \<V> \<and>
the (fmlookup A p) + the (fmlookup A q) - r \<in> ideal polynomial_bool)\<close>
definition check_mult :: \<open>(nat, int mpoly) fmap \<Rightarrow> nat set \<Rightarrow> nat \<Rightarrow> int mpoly \<Rightarrow> nat \<Rightarrow> int mpoly \<Rightarrow> bool nres\<close> where
\<open>check_mult A \<V> p q i r =
SPEC(\<lambda>b. b \<longrightarrow> p \<in># dom_m A \<and>i \<notin># dom_m A \<and> vars q \<subseteq> \<V> \<and> vars r \<subseteq> \<V> \<and>
the (fmlookup A p) * q - r \<in> ideal polynomial_bool)\<close>
definition check_extension :: \<open>(nat, int mpoly) fmap \<Rightarrow> nat set \<Rightarrow> nat \<Rightarrow> nat \<Rightarrow> int mpoly \<Rightarrow> (bool) nres\<close> where
\<open>check_extension A \<V> i v p =
SPEC(\<lambda>b. b \<longrightarrow> (i \<notin># dom_m A \<and>
(v \<notin> \<V> \<and>
(p+Var v)\<^sup>2 - (p+Var v) \<in> ideal polynomial_bool \<and>
vars (p+Var v) \<subseteq> \<V>)))\<close>
fun merge_status where
\<open>merge_status (FAILED) _ = FAILED\<close> |
\<open>merge_status _ (FAILED) = FAILED\<close> |
\<open>merge_status FOUND _ = FOUND\<close> |
\<open>merge_status _ FOUND = FOUND\<close> |
\<open>merge_status _ _ = SUCCESS\<close>
type_synonym fpac_step = \<open>nat set \<times> (nat, int_poly) fmap\<close>
definition check_del :: \<open>(nat, int mpoly) fmap \<Rightarrow> nat \<Rightarrow> bool nres\<close> where
\<open>check_del A p =
SPEC(\<lambda>b. b \<longrightarrow> True)\<close>
subsection \<open>Algorithm\<close>
definition PAC_checker_step
:: \<open>int_poly \<Rightarrow> (status \<times> fpac_step) \<Rightarrow> (int_poly, nat, nat) pac_step \<Rightarrow>
(status \<times> fpac_step) nres\<close>
where
\<open>PAC_checker_step = (\<lambda>spec (stat, (\<V>, A)) st. case st of
Add _ _ _ _ \<Rightarrow>
do {
r \<leftarrow> normalize_poly_spec (pac_res st);
eq \<leftarrow> check_add A \<V> (pac_src1 st) (pac_src2 st) (new_id st) r;
st' \<leftarrow> SPEC(\<lambda>st'. (\<not>is_failed st' \<and> is_found st' \<longrightarrow> r - spec \<in> ideal polynomial_bool));
if eq
then RETURN (merge_status stat st',
\<V>, fmupd (new_id st) r A)
else RETURN (FAILED, (\<V>, A))
}
| Del _ \<Rightarrow>
do {
eq \<leftarrow> check_del A (pac_src1 st);
if eq
then RETURN (stat, (\<V>, fmdrop (pac_src1 st) A))
else RETURN (FAILED, (\<V>, A))
}
| Mult _ _ _ _ \<Rightarrow>
do {
r \<leftarrow> normalize_poly_spec (pac_res st);
q \<leftarrow> normalize_poly_spec (pac_mult st);
eq \<leftarrow> check_mult A \<V> (pac_src1 st) q (new_id st) r;
st' \<leftarrow> SPEC(\<lambda>st'. (\<not>is_failed st' \<and> is_found st' \<longrightarrow> r - spec \<in> ideal polynomial_bool));
if eq
then RETURN (merge_status stat st',
\<V>, fmupd (new_id st) r A)
else RETURN (FAILED, (\<V>, A))
}
| Extension _ _ _ \<Rightarrow>
do {
r \<leftarrow> normalize_poly_spec (pac_res st - Var (new_var st));
(eq) \<leftarrow> check_extension A \<V> (new_id st) (new_var st) r;
if eq
then do {
RETURN (stat,
insert (new_var st) \<V>, fmupd (new_id st) (r) A)}
else RETURN (FAILED, (\<V>, A))
}
)\<close>
definition polys_rel :: \<open>((nat, int mpoly)fmap \<times> _) set\<close> where
\<open>polys_rel = {(A, B). B = (ran_m A)}\<close>
definition polys_rel_full :: \<open>((nat set \<times> (nat, int mpoly)fmap) \<times> _) set\<close> where
\<open>polys_rel_full = {((\<V>, A), (\<V>' , B)). (A, B) \<in> polys_rel \<and> \<V> = \<V>'}\<close>
lemma polys_rel_update_remove:
\<open>x13 \<notin>#dom_m A \<Longrightarrow> x11 \<in># dom_m A \<Longrightarrow> x12 \<in># dom_m A \<Longrightarrow> x11 \<noteq> x12 \<Longrightarrow> (A,B) \<in> polys_rel \<Longrightarrow>
(fmupd x13 r (fmdrop x11 (fmdrop x12 A)),
add_mset r B - {#the (fmlookup A x11), the (fmlookup A x12)#})
\<in> polys_rel\<close>
\<open>x13 \<notin>#dom_m A \<Longrightarrow> x11 \<in># dom_m A \<Longrightarrow> (A,B) \<in> polys_rel \<Longrightarrow>
(fmupd x13 r (fmdrop x11 A),add_mset r B - {#the (fmlookup A x11)#})
\<in> polys_rel\<close>
\<open>x13 \<notin>#dom_m A \<Longrightarrow> (A,B) \<in> polys_rel \<Longrightarrow>
(fmupd x13 r A, add_mset r B) \<in> polys_rel\<close>
\<open>x13 \<in>#dom_m A \<Longrightarrow> (A,B) \<in> polys_rel \<Longrightarrow>
(fmdrop x13 A, remove1_mset (the (fmlookup A x13)) B) \<in> polys_rel\<close>
using distinct_mset_dom[of A]
apply (auto simp: polys_rel_def ran_m_mapsto_upd ran_m_mapsto_upd_notin
ran_m_fmdrop)
apply (subst ran_m_mapsto_upd_notin)
apply (auto dest: in_diffD dest!: multi_member_split simp: ran_m_fmdrop ran_m_fmdrop_If distinct_mset_remove1_All ran_m_def
add_mset_eq_add_mset removeAll_notin
split: if_splits intro!: image_mset_cong)
done
lemma polys_rel_in_dom_inD:
\<open>(A, B) \<in> polys_rel \<Longrightarrow>
x12 \<in># dom_m A \<Longrightarrow>
the (fmlookup A x12) \<in># B\<close>
by (auto simp: polys_rel_def)
abbreviation status_rel :: \<open>(status \<times> status) set\<close> where
\<open>status_rel \<equiv> Id\<close>
lemma is_merge_status[simp]:
\<open>is_failed (merge_status a st') \<longleftrightarrow> is_failed a \<or> is_failed st'\<close>
\<open>is_found (merge_status a st') \<longleftrightarrow> \<not>is_failed a \<and> \<not>is_failed st' \<and> (is_found a \<or> is_found st')\<close>
\<open>is_success (merge_status a st') \<longleftrightarrow> (is_success a \<and> is_success st')\<close>
by (cases a; cases st'; auto; fail)+
lemma status_rel_merge_status:
\<open>(merge_status a b, SUCCESS) \<notin> status_rel \<longleftrightarrow>
(a = FAILED) \<or> (b = FAILED) \<or>
a = FOUND \<or> (b = FOUND)\<close>
by (cases a; cases b; auto)
lemma Ex_status_iff:
\<open>(\<exists>a. P a) \<longleftrightarrow> P SUCCESS \<or> P FOUND \<or> (P (FAILED))\<close>
apply auto
apply (case_tac a; auto)
done
lemma is_failed_alt_def:
\<open>is_failed st' \<longleftrightarrow> \<not>is_success st' \<and> \<not>is_found st'\<close>
by (cases st') auto
lemma merge_status_eq_iff[simp]:
\<open>merge_status a SUCCESS = SUCCESS \<longleftrightarrow> a = SUCCESS\<close>
\<open>merge_status a SUCCESS = FOUND \<longleftrightarrow> a = FOUND\<close>
\<open>merge_status SUCCESS a = SUCCESS \<longleftrightarrow> a = SUCCESS\<close>
\<open>merge_status SUCCESS a = FOUND \<longleftrightarrow> a = FOUND\<close>
\<open>merge_status SUCCESS a = FAILED \<longleftrightarrow> a = FAILED\<close>
\<open>merge_status a SUCCESS = FAILED \<longleftrightarrow> a = FAILED\<close>
\<open>merge_status FOUND a = FAILED \<longleftrightarrow> a = FAILED\<close>
\<open>merge_status a FOUND = FAILED \<longleftrightarrow> a = FAILED\<close>
\<open>merge_status a FOUND = SUCCESS \<longleftrightarrow> False\<close>
\<open>merge_status a b = FOUND \<longleftrightarrow> (a = FOUND \<or> b = FOUND) \<and> (a \<noteq> FAILED \<and> b \<noteq> FAILED)\<close>
apply (cases a; auto; fail)+
apply (cases a; cases b; auto; fail)+
done
lemma fmdrop_irrelevant: \<open>x11 \<notin># dom_m A \<Longrightarrow> fmdrop x11 A = A\<close>
by (simp add: fmap_ext in_dom_m_lookup_iff)
lemma PAC_checker_step_PAC_checker_specification2:
fixes a :: \<open>status\<close>
assumes AB: \<open>((\<V>, A),(\<V>\<^sub>B, B)) \<in> polys_rel_full\<close> and
\<open>\<not>is_failed a\<close> and
[simp,intro]: \<open>a = FOUND \<Longrightarrow> spec \<in> pac_ideal (set_mset A\<^sub>0)\<close> and
A\<^sub>0B: \<open>PAC_Format\<^sup>*\<^sup>* (\<V>\<^sub>0, A\<^sub>0) (\<V>, B)\<close> and
spec\<^sub>0: \<open>vars spec \<subseteq> \<V>\<^sub>0\<close> and
vars_A\<^sub>0: \<open>\<Union> (vars ` set_mset A\<^sub>0) \<subseteq> \<V>\<^sub>0\<close>
shows \<open>PAC_checker_step spec (a, (\<V>, A)) st \<le> \<Down> (status_rel \<times>\<^sub>r polys_rel_full) (PAC_checker_specification_step2 (\<V>\<^sub>0, A\<^sub>0) spec (\<V>, B))\<close>
proof -
have
\<open>\<V>\<^sub>B = \<V>\<close>and
[simp, intro]:\<open>(A, B) \<in> polys_rel\<close>
using AB
by (auto simp: polys_rel_full_def)
have H0: \<open>2 * the (fmlookup A x12) - r \<in> More_Modules.ideal polynomial_bool \<Longrightarrow>
r \<in> pac_ideal
(insert (the (fmlookup A x12))
((\<lambda>x. the (fmlookup A x)) ` set_mset Aa))\<close> for x12 r Aa
by (metis (no_types, lifting) ab_semigroup_mult_class.mult.commute
diff_in_polynomial_bool_pac_idealI
ideal.span_base pac_idealI3 set_image_mset set_mset_add_mset_insert union_single_eq_member)+
then have H0': \<open>\<And>Aa. 2 * the (fmlookup A x12) - r \<in> More_Modules.ideal polynomial_bool \<Longrightarrow>
r - spec \<in> More_Modules.ideal polynomial_bool \<Longrightarrow>
spec \<in> pac_ideal (insert (the (fmlookup A x12)) ((\<lambda>x. the (fmlookup A x)) ` set_mset Aa))\<close>
for r x12
by (metis (no_types, lifting) diff_in_polynomial_bool_pac_idealI)
have H1: \<open> x12 \<in># dom_m A \<Longrightarrow>
2 * the (fmlookup A x12) - r \<in> More_Modules.ideal polynomial_bool \<Longrightarrow>
r - spec \<in> More_Modules.ideal polynomial_bool \<Longrightarrow>
vars spec \<subseteq> vars r \<Longrightarrow>
spec \<in> pac_ideal (set_mset B)\<close> for x12 r
using \<open>(A,B) \<in> polys_rel\<close>
ideal.span_add[OF ideal.span_add[OF ideal.span_neg ideal.span_neg,
of \<open>the (fmlookup A x12)\<close> _ \<open>the (fmlookup A x12)\<close>],
of \<open>set_mset B \<union> polynomial_bool\<close> \<open>2 * the (fmlookup A x12) - r\<close>]
unfolding polys_rel_def
by (auto dest!: multi_member_split simp: ran_m_def
intro: H0')
have H2': \<open>the (fmlookup A x11) + the (fmlookup A x12) - r \<in> More_Modules.ideal polynomial_bool \<Longrightarrow>
B = add_mset (the (fmlookup A x11)) {#the (fmlookup A x). x \<in># Aa#} \<Longrightarrow>
(the (fmlookup A x11) + the (fmlookup A x12) - r
\<in> More_Modules.ideal
(insert (the (fmlookup A x11))
((\<lambda>x. the (fmlookup A x)) ` set_mset Aa \<union> polynomial_bool)) \<Longrightarrow>
- r
\<in> More_Modules.ideal
(insert (the (fmlookup A x11))
((\<lambda>x. the (fmlookup A x)) ` set_mset Aa \<union> polynomial_bool))) \<Longrightarrow>
r \<in> pac_ideal (insert (the (fmlookup A x11)) ((\<lambda>x. the (fmlookup A x)) ` set_mset Aa))\<close>
for r x12 x11 A Aa
by (metis (mono_tags, lifting) Un_insert_left diff_diff_eq2 diff_in_polynomial_bool_pac_idealI diff_zero
ideal.span_diff ideal.span_neg minus_diff_eq pac_idealI1 pac_ideal_def set_image_mset
set_mset_add_mset_insert union_single_eq_member)
have H2: \<open>x11 \<in># dom_m A \<Longrightarrow>
x12 \<in># dom_m A \<Longrightarrow>
the (fmlookup A x11) + the (fmlookup A x12) - r
\<in> More_Modules.ideal polynomial_bool \<Longrightarrow>
r - spec \<in> More_Modules.ideal polynomial_bool \<Longrightarrow>
spec \<in> pac_ideal (set_mset B)\<close> for x12 r x11
using \<open>(A,B) \<in> polys_rel\<close>
ideal.span_add[OF ideal.span_add[OF ideal.span_neg ideal.span_neg,
of \<open>the (fmlookup A x11)\<close> _ \<open>the (fmlookup A x12)\<close>],
of \<open>set_mset B \<union> polynomial_bool\<close> \<open>the (fmlookup A x11) + the (fmlookup A x12) - r\<close>]
unfolding polys_rel_def
by (subgoal_tac \<open>r \<in> pac_ideal (set_mset B)\<close>)
(auto dest!: multi_member_split simp: ran_m_def ideal.span_base
intro: diff_in_polynomial_bool_pac_idealI simp: H2')
have H3': \<open>the (fmlookup A x12) * q - r \<in> More_Modules.ideal polynomial_bool \<Longrightarrow>
r - spec \<in> More_Modules.ideal polynomial_bool \<Longrightarrow>
r \<in> pac_ideal (insert (the (fmlookup A x12)) ((\<lambda>x. the (fmlookup A x)) ` set_mset Aa))\<close>
for Aa x12 r q
by (metis (no_types, lifting) ab_semigroup_mult_class.mult.commute diff_in_polynomial_bool_pac_idealI
ideal.span_base pac_idealI3 set_image_mset set_mset_add_mset_insert union_single_eq_member)
have H3: \<open>x12 \<in># dom_m A \<Longrightarrow>
the (fmlookup A x12) * q - r \<in> More_Modules.ideal polynomial_bool \<Longrightarrow>
r - spec \<in> More_Modules.ideal polynomial_bool \<Longrightarrow>
spec \<in> pac_ideal (set_mset B)\<close> for x12 r q
using \<open>(A,B) \<in> polys_rel\<close>
ideal.span_add[OF ideal.span_add[OF ideal.span_neg ideal.span_neg,
of \<open>the (fmlookup A x12)\<close> _ \<open>the (fmlookup A x12)\<close>],
of \<open>set_mset B \<union> polynomial_bool\<close> \<open>2 * the (fmlookup A x12) - r\<close>]
unfolding polys_rel_def
by (subgoal_tac \<open>r \<in> pac_ideal (set_mset B)\<close>)
(auto dest!: multi_member_split simp: ran_m_def H3'
intro: diff_in_polynomial_bool_pac_idealI)
have [intro]: \<open>spec \<in> pac_ideal (set_mset B) \<Longrightarrow> spec \<in> pac_ideal (set_mset A\<^sub>0)\<close> and
vars_B: \<open>\<Union> (vars ` set_mset B) \<subseteq> \<V>\<close>and
vars_B: \<open>\<Union> (vars ` set_mset (ran_m A)) \<subseteq> \<V>\<close>
using rtranclp_PAC_Format_subset_ideal[OF A\<^sub>0B vars_A\<^sub>0] spec\<^sub>0 \<open>(A, B) \<in> polys_rel\<close>[unfolded polys_rel_def, simplified]
by (smt (verit) in_mono mem_Collect_eq restricted_ideal_to_def)+
have eq_successI: \<open>st' \<noteq> FAILED \<Longrightarrow>
st' \<noteq> FOUND \<Longrightarrow> st' = SUCCESS\<close> for st'
by (cases st') auto
have vars_diff_inv: \<open>vars (Var x2 - r) = vars (r - Var x2 :: int mpoly)\<close> for x2 r
using vars_uminus[of \<open>Var x2 - r\<close>]
by (auto simp del: vars_uminus)
have vars_add_inv: \<open>vars (Var x2 + r) = vars (r + Var x2 :: int mpoly)\<close> for x2 r
unfolding add.commute[of \<open>Var x2\<close> r] ..
have [iff]: \<open>a \<noteq> FAILED\<close> and
[intro]: \<open>a \<noteq> SUCCESS \<Longrightarrow> a = FOUND\<close> and
[simp]: \<open>merge_status a FOUND = FOUND\<close>
using assms(2) by (cases a; auto)+
note [[goals_limit=1]]
show ?thesis
unfolding PAC_checker_step_def PAC_checker_specification_step_spec_def
normalize_poly_spec_alt_def check_mult_def check_add_def
check_extension_def polys_rel_full_def
apply (cases st)
apply clarsimp_all
subgoal for x11 x12 x13 x14
apply (refine_vcg lhs_step_If)
subgoal for r eqa st'
using assms vars_B apply -
apply (rule RETURN_SPEC_refine)
apply (rule_tac x = \<open>(merge_status a st',\<V>,add_mset r B)\<close> in exI)
by (auto simp: polys_rel_update_remove ran_m_mapsto_upd_notin
intro: PAC_Format_add_and_remove H2 dest: rtranclp_PAC_Format_subset_ideal)
subgoal
by (rule RETURN_SPEC_refine)
(auto simp: Ex_status_iff dest: rtranclp_PAC_Format_subset_ideal)
done
subgoal for x11 x12 x13 x14
apply (refine_vcg lhs_step_If)
subgoal for r q eqa st'
using assms vars_B apply -
apply (rule RETURN_SPEC_refine)
apply (rule_tac x = \<open>(merge_status a st',\<V>,add_mset r B)\<close> in exI)
by (auto intro: polys_rel_update_remove intro: PAC_Format_add_and_remove(3-) H3
dest: rtranclp_PAC_Format_subset_ideal)
subgoal
by (rule RETURN_SPEC_refine)
(auto simp: Ex_status_iff)
done
subgoal for x31 x32 x34
apply (refine_vcg lhs_step_If)
subgoal for r x
using assms vars_B apply -
apply (rule RETURN_SPEC_refine)
apply (rule_tac x = \<open>(a,insert x32 \<V>, add_mset r B)\<close> in exI)
apply (auto simp: intro!: polys_rel_update_remove PAC_Format_add_and_remove(5-)
dest: rtranclp_PAC_Format_subset_ideal)
done
subgoal
by (rule RETURN_SPEC_refine)
(auto simp: Ex_status_iff)
done
subgoal for x11
unfolding check_del_def
apply (refine_vcg lhs_step_If)
subgoal for eq
using assms vars_B apply -
apply (rule RETURN_SPEC_refine)
apply (cases \<open>x11 \<in># dom_m A\<close>)
subgoal
apply (rule_tac x = \<open>(a,\<V>, remove1_mset (the (fmlookup A x11)) B)\<close> in exI)
apply (auto simp: polys_rel_update_remove PAC_Format_add_and_remove
is_failed_def is_success_def is_found_def
dest!: eq_successI
split: if_splits
dest: rtranclp_PAC_Format_subset_ideal
intro: PAC_Format_add_and_remove H3)
done
subgoal
apply (rule_tac x = \<open>(a,\<V>, B)\<close> in exI)
apply (auto simp: fmdrop_irrelevant
is_failed_def is_success_def is_found_def
dest!: eq_successI
split: if_splits
dest: rtranclp_PAC_Format_subset_ideal
intro: PAC_Format_add_and_remove)
done
done
subgoal
by (rule RETURN_SPEC_refine)
(auto simp: Ex_status_iff)
done
done
qed
definition PAC_checker
:: \<open>int_poly \<Rightarrow> fpac_step \<Rightarrow> status \<Rightarrow> (int_poly, nat, nat) pac_step list \<Rightarrow>
(status \<times> fpac_step) nres\<close>
where
\<open>PAC_checker spec A b st = do {
(S, _) \<leftarrow> WHILE\<^sub>T
(\<lambda>((b :: status, A :: fpac_step), st). \<not>is_failed b \<and> st \<noteq> [])
(\<lambda>((bA), st). do {
ASSERT(st \<noteq> []);
S \<leftarrow> PAC_checker_step spec (bA) (hd st);
RETURN (S, tl st)
})
((b, A), st);
RETURN S
}\<close>
lemma PAC_checker_specification_spec_trans:
\<open>PAC_checker_specification_spec spec A (st, x2) \<Longrightarrow>
PAC_checker_specification_step_spec A spec x2 (st', x1a) \<Longrightarrow>
PAC_checker_specification_spec spec A (st', x1a)\<close>
unfolding PAC_checker_specification_spec_def
PAC_checker_specification_step_spec_def
apply auto
using is_failed_alt_def apply blast+
done
lemma RES_SPEC_eq:
\<open>RES \<Phi> = SPEC(\<lambda>P. P \<in> \<Phi>)\<close>
by auto
lemma is_failed_is_success_completeD:
\<open>\<not> is_failed x \<Longrightarrow> \<not>is_success x \<Longrightarrow> is_found x\<close>
by (cases x) auto
lemma PAC_checker_PAC_checker_specification2:
\<open>(A, B) \<in> polys_rel_full \<Longrightarrow>
\<not>is_failed a \<Longrightarrow>
(a = FOUND \<Longrightarrow> spec \<in> pac_ideal (set_mset (snd B))) \<Longrightarrow>
\<Union>(vars ` set_mset (ran_m (snd A))) \<subseteq> fst B \<Longrightarrow>
vars spec \<subseteq> fst B \<Longrightarrow>
PAC_checker spec A a st \<le> \<Down> (status_rel \<times>\<^sub>r polys_rel_full) (PAC_checker_specification2 spec B)\<close>
unfolding PAC_checker_def conc_fun_RES
apply (subst RES_SPEC_eq)
apply (refine_vcg WHILET_rule[where
I = \<open>\<lambda>((bB), st). bB \<in> (status_rel \<times>\<^sub>r polys_rel_full)\<inverse> ``
Collect (PAC_checker_specification_spec spec B)\<close>
and R = \<open>measure (\<lambda>(_, st). Suc (length st))\<close>])
subgoal by auto
subgoal apply (auto simp: PAC_checker_specification_spec_def)
apply (cases B; cases A)
apply (auto simp:polys_rel_def polys_rel_full_def Image_iff)
done
subgoal by auto
subgoal
apply auto
apply (rule
PAC_checker_step_PAC_checker_specification2[of _ _ _ _ _ _ _ \<open>fst B\<close>, THEN order_trans])
apply assumption
apply assumption
apply (auto intro: PAC_checker_specification_spec_trans simp: conc_fun_RES)
apply (auto simp: PAC_checker_specification_spec_def polys_rel_full_def polys_rel_def
dest: PAC_Format_subset_ideal
dest: is_failed_is_success_completeD; fail)+
by (auto simp: Image_iff intro: PAC_checker_specification_spec_trans
simp: polys_rel_def polys_rel_full_def)
subgoal
by auto
done
definition remap_polys_polynomial_bool :: \<open>int mpoly \<Rightarrow> nat set \<Rightarrow> (nat, int_poly) fmap \<Rightarrow> (status \<times> fpac_step) nres\<close> where
\<open>remap_polys_polynomial_bool spec = (\<lambda>\<V> A.
SPEC(\<lambda>(st, \<V>', A'). (\<not>is_failed st \<longrightarrow>
dom_m A = dom_m A' \<and>
(\<forall>i \<in># dom_m A. the (fmlookup A i) - the (fmlookup A' i) \<in> ideal polynomial_bool) \<and>
\<Union>(vars ` set_mset (ran_m A)) \<subseteq> \<V>' \<and>
\<Union>(vars ` set_mset (ran_m A')) \<subseteq> \<V>') \<and>
(st = FOUND \<longrightarrow> spec \<in># ran_m A')))\<close>
definition remap_polys_change_all :: \<open>int mpoly \<Rightarrow> nat set \<Rightarrow> (nat, int_poly) fmap \<Rightarrow> (status \<times> fpac_step) nres\<close> where
\<open>remap_polys_change_all spec = (\<lambda>\<V> A. SPEC (\<lambda>(st, \<V>', A').
(\<not>is_failed st \<longrightarrow>
pac_ideal (set_mset (ran_m A)) = pac_ideal (set_mset (ran_m A')) \<and>
\<Union>(vars ` set_mset (ran_m A)) \<subseteq> \<V>' \<and>
\<Union>(vars ` set_mset (ran_m A')) \<subseteq> \<V>') \<and>
(st = FOUND \<longrightarrow> spec \<in># ran_m A')))\<close>
lemma fmap_eq_dom_iff:
\<open>A = A' \<longleftrightarrow> dom_m A = dom_m A' \<and> (\<forall>i \<in># dom_m A. the (fmlookup A i) = the (fmlookup A' i))\<close>
by (metis fmap_ext in_dom_m_lookup_iff option.expand)
lemma ideal_remap_incl:
\<open>finite A' \<Longrightarrow> (\<forall>a'\<in>A'. \<exists>a\<in>A. a-a' \<in> B) \<Longrightarrow> ideal (A' \<union> B) \<subseteq> ideal (A \<union> B)\<close>
apply (induction A' rule: finite_induct)
apply (auto intro: ideal.span_mono)
using ideal.span_mono sup_ge2 apply blast
proof -
fix x :: 'a and F :: "'a set" and xa :: 'a and a :: 'a
assume a1: "a \<in> A"
assume a2: "a - x \<in> B"
assume a3: "xa \<in> More_Modules.ideal (insert x (F \<union> B))"
assume a4: "More_Modules.ideal (F \<union> B) \<subseteq> More_Modules.ideal (A \<union> B)"
have "x \<in> More_Modules.ideal (A \<union> B)"
using a2 a1 by (metis (no_types, lifting) Un_upper1 Un_upper2 add_diff_cancel_left' diff_add_cancel
ideal.module_axioms ideal.span_diff in_mono module.span_superset)
then show "xa \<in> More_Modules.ideal (A \<union> B)"
using a4 a3 ideal.span_insert_subset by blast
qed
lemma pac_ideal_remap_eq:
\<open>dom_m b = dom_m ba \<Longrightarrow>
\<forall>i\<in>#dom_m ba.
the (fmlookup b i) - the (fmlookup ba i)
\<in> More_Modules.ideal polynomial_bool \<Longrightarrow>
pac_ideal ((\<lambda>x. the (fmlookup b x)) ` set_mset (dom_m ba)) = pac_ideal ((\<lambda>x. the (fmlookup ba x)) ` set_mset (dom_m ba))\<close>
unfolding pac_ideal_alt_def
apply standard
subgoal
apply (rule ideal_remap_incl)
apply (auto dest!: multi_member_split
dest: ideal.span_neg)
apply (drule ideal.span_neg)
apply auto
done
subgoal
by (rule ideal_remap_incl)
(auto dest!: multi_member_split)
done
lemma remap_polys_polynomial_bool_remap_polys_change_all:
\<open>remap_polys_polynomial_bool spec \<V> A \<le> remap_polys_change_all spec \<V> A\<close>
unfolding remap_polys_polynomial_bool_def remap_polys_change_all_def
apply (simp add: ideal.span_zero fmap_eq_dom_iff ideal.span_eq)
apply (auto dest: multi_member_split simp: ran_m_def ideal.span_base pac_ideal_remap_eq
add_mset_eq_add_mset
eq_commute[of \<open>add_mset _ _\<close> \<open>dom_m (A :: (nat, int mpoly)fmap)\<close> for A])
done
definition remap_polys :: \<open>int mpoly \<Rightarrow> nat set \<Rightarrow> (nat, int_poly) fmap \<Rightarrow> (status \<times> fpac_step) nres\<close> where
\<open>remap_polys spec = (\<lambda>\<V> A. do{
dom \<leftarrow> SPEC(\<lambda>dom. set_mset (dom_m A) \<subseteq> dom \<and> finite dom);
failed \<leftarrow> SPEC(\<lambda>_::bool. True);
if failed
then do {
RETURN (FAILED, \<V>, fmempty)
}
else do {
(b, N) \<leftarrow> FOREACH dom
(\<lambda>i (b, \<V>, A').
if i \<in># dom_m A
then do {
p \<leftarrow> SPEC(\<lambda>p. the (fmlookup A i) - p \<in> ideal polynomial_bool \<and> vars p \<subseteq> vars (the (fmlookup A i)));
eq \<leftarrow> SPEC(\<lambda>eq. eq \<longrightarrow> p = spec);
\<V> \<leftarrow> SPEC(\<lambda>\<V>'. \<V> \<union> vars (the (fmlookup A i)) \<subseteq> \<V>');
RETURN(b \<or> eq, \<V>, fmupd i p A')
} else RETURN (b, \<V>, A'))
(False, \<V>, fmempty);
RETURN (if b then FOUND else SUCCESS, N)
}
})\<close>
lemma remap_polys_spec:
\<open>remap_polys spec \<V> A \<le> remap_polys_polynomial_bool spec \<V> A\<close>
unfolding remap_polys_def remap_polys_polynomial_bool_def
apply (refine_vcg FOREACH_rule[where
I = \<open>\<lambda>dom (b, \<V>, A').
set_mset (dom_m A') = set_mset (dom_m A) - dom \<and>
(\<forall>i \<in> set_mset (dom_m A) - dom. the (fmlookup A i) - the (fmlookup A' i) \<in> ideal polynomial_bool) \<and>
\<Union>(vars ` set_mset (ran_m (fmrestrict_set (set_mset (dom_m A')) A))) \<subseteq> \<V> \<and>
\<Union>(vars ` set_mset (ran_m A')) \<subseteq> \<V> \<and>
(b \<longrightarrow> spec \<in># ran_m A')\<close>])
subgoal by auto
subgoal by auto
subgoal by auto
subgoal by auto
subgoal by auto
subgoal by auto
subgoal by auto
subgoal
by auto
subgoal by auto
subgoal using ideal.span_add by auto
subgoal by auto
subgoal by auto
subgoal by clarsimp auto
subgoal
supply[[goals_limit=1]]
by (auto simp add: ran_m_mapsto_upd_notin dom_m_fmrestrict_set' subset_eq)
subgoal
supply[[goals_limit=1]]
by (auto simp add: ran_m_mapsto_upd_notin dom_m_fmrestrict_set' subset_eq)
subgoal
by (auto simp: ran_m_mapsto_upd_notin)
subgoal
by auto
subgoal
by auto
subgoal
by (auto simp add: ran_m_mapsto_upd_notin dom_m_fmrestrict_set' subset_eq)
subgoal
by (auto simp add: ran_m_mapsto_upd_notin dom_m_fmrestrict_set' subset_eq)
subgoal
by auto
subgoal
by (auto simp: distinct_set_mset_eq_iff[symmetric] distinct_mset_dom)
subgoal
by (auto simp: distinct_set_mset_eq_iff[symmetric] distinct_mset_dom)
subgoal
by (auto simp add: ran_m_mapsto_upd_notin dom_m_fmrestrict_set' subset_eq
fmlookup_restrict_set_id')
subgoal
by (auto simp add: ran_m_mapsto_upd_notin dom_m_fmrestrict_set' subset_eq)
subgoal
by (auto simp add: ran_m_mapsto_upd_notin dom_m_fmrestrict_set' subset_eq
fmlookup_restrict_set_id')
done
subsection \<open>Full Checker\<close>
definition full_checker
:: \<open>int_poly \<Rightarrow> (nat, int_poly) fmap \<Rightarrow> (int_poly, nat,nat) pac_step list \<Rightarrow> (status \<times> _) nres\<close>
where
\<open>full_checker spec0 A pac = do {
spec \<leftarrow> normalize_poly_spec spec0;
(st, \<V>, A) \<leftarrow> remap_polys_change_all spec {} A;
if is_failed st then
RETURN (st, \<V>, A)
else do {
\<V> \<leftarrow> SPEC(\<lambda>\<V>'. \<V> \<union> vars spec0 \<subseteq> \<V>');
PAC_checker spec (\<V>, A) st pac
}
}\<close>
lemma restricted_ideal_to_mono:
\<open>restricted_ideal_to\<^sub>I \<V> I \<subseteq> restricted_ideal_to\<^sub>I \<V>' J \<Longrightarrow>
\<U> \<subseteq> \<V> \<Longrightarrow>
restricted_ideal_to\<^sub>I \<U> I \<subseteq> restricted_ideal_to\<^sub>I \<U> J\<close>
by (auto simp: restricted_ideal_to_def)
lemma pac_ideal_idemp: \<open>pac_ideal (pac_ideal A) = pac_ideal A\<close>
by (metis dual_order.antisym ideal.span_subset_spanI ideal.span_superset le_sup_iff pac_ideal_def)
lemma full_checker_spec:
assumes \<open>(A, A') \<in> polys_rel\<close>
shows
\<open>full_checker spec A pac \<le> \<Down>{((st, G), (st', G')). (st, st') \<in> status_rel \<and>
(st \<noteq> FAILED \<longrightarrow> (G, G') \<in> polys_rel_full)}
(PAC_checker_specification spec (A'))\<close>
proof -
have H: \<open>set_mset b \<subseteq> pac_ideal (set_mset (ran_m A)) \<Longrightarrow>
x \<in> pac_ideal (set_mset b) \<Longrightarrow> x \<in> pac_ideal (set_mset A')\<close> for b x
using assms apply -
by (drule pac_ideal_mono) (auto simp: polys_rel_def pac_ideal_idemp)
have 1: \<open>x \<in> {(st, \<V>', A').
( \<not> is_failed st \<longrightarrow> pac_ideal (set_mset (ran_m x2)) =
pac_ideal (set_mset (ran_m A')) \<and>
\<Union> (vars ` set_mset (ran_m ABC)) \<subseteq> \<V>' \<and>
\<Union> (vars ` set_mset (ran_m A')) \<subseteq> \<V>') \<and>
(st = FOUND \<longrightarrow> speca \<in># ran_m A')} \<Longrightarrow>
x = (st, x') \<Longrightarrow> x' = (\<V>, Aa) \<Longrightarrow>((\<V>', Aa), \<V>', ran_m Aa) \<in> polys_rel_full\<close> for Aa speca x2 st x \<V>' \<V> x' ABC
by (auto simp: polys_rel_def polys_rel_full_def)
have H1: \<open>\<And>a aa b xa x x1a x1 x2 speca.
vars spec \<subseteq> x1b \<Longrightarrow>
\<Union> (vars ` set_mset (ran_m A)) \<subseteq> x1b \<Longrightarrow>
\<Union> (vars ` set_mset (ran_m x2a)) \<subseteq> x1b \<Longrightarrow>
restricted_ideal_to\<^sub>I x1b b \<subseteq> restricted_ideal_to\<^sub>I x1b (ran_m x2a) \<Longrightarrow>
xa \<in> restricted_ideal_to\<^sub>I (\<Union> (vars ` set_mset (ran_m A)) \<union> vars spec) b \<Longrightarrow>
xa \<in> restricted_ideal_to\<^sub>I (\<Union> (vars ` set_mset (ran_m A)) \<union> vars spec) (ran_m x2a)\<close>
for x1b b xa x2a
by (drule restricted_ideal_to_mono[of _ _ _ _ \<open>\<Union> (vars ` set_mset (ran_m A)) \<union> vars spec\<close>])
auto
have H2: \<open>\<And>a aa b speca x2 x1a x1b x2a.
spec - speca \<in> More_Modules.ideal polynomial_bool \<Longrightarrow>
vars spec \<subseteq> x1b \<Longrightarrow>
\<Union> (vars ` set_mset (ran_m A)) \<subseteq> x1b \<Longrightarrow>
\<Union> (vars ` set_mset (ran_m x2a)) \<subseteq> x1b \<Longrightarrow>
speca \<in> pac_ideal (set_mset (ran_m x2a)) \<Longrightarrow>
restricted_ideal_to\<^sub>I x1b b \<subseteq> restricted_ideal_to\<^sub>I x1b (ran_m x2a) \<Longrightarrow>
spec \<in> pac_ideal (set_mset (ran_m x2a))\<close>
by (metis (no_types, lifting) group_eq_aux ideal.span_add ideal.span_base in_mono
pac_ideal_alt_def sup.cobounded2)
show ?thesis
supply[[goals_limit=1]]
unfolding full_checker_def normalize_poly_spec_def
PAC_checker_specification_def remap_polys_change_all_def
apply (refine_vcg PAC_checker_PAC_checker_specification2[THEN order_trans, of _ _]
lhs_step_If)
subgoal by (auto simp: is_failed_def RETURN_RES_refine_iff)
apply (rule 1; assumption)
subgoal
using fmap_ext assms by (auto simp: polys_rel_def ran_m_def)
subgoal
by auto
subgoal
by auto
subgoal for speca x1 x2 x x1a x2a x1b
apply (rule ref_two_step[OF conc_fun_R_mono])
apply auto[]
using assms
by (auto simp add: PAC_checker_specification_spec_def conc_fun_RES polys_rel_def H1 H2
polys_rel_full_def
dest!: rtranclp_PAC_Format_subset_ideal dest: is_failed_is_success_completeD)
done
qed
lemma full_checker_spec':
shows
\<open>(uncurry2 full_checker, uncurry2 (\<lambda>spec A _. PAC_checker_specification spec A)) \<in>
(Id \<times>\<^sub>r polys_rel) \<times>\<^sub>r Id \<rightarrow>\<^sub>f \<langle>{((st, G), (st', G')). (st, st') \<in> status_rel \<and>
(st \<noteq> FAILED \<longrightarrow> (G, G') \<in> polys_rel_full)}\<rangle>nres_rel\<close>
using full_checker_spec
by (auto intro!: frefI nres_relI)
end
|
http://www.ysdhc.com/someassholes
Users/DonovanKelley and Users/TaylorStreet are part of the incestuous Davis Music Scene. They are members of The Backups, Keep Your Distance, and BxUxIx.
Some Assholes play powerviolence, fastcore, sludge or something like that. There is no way you could be cool enough to know. Stop listening to Modest Mouse and start listening to something with some balls (the music, not the musicians).
|
Set Warnings "-notation-overridden".
Require Import Category.Lib.
Require Export Category.Theory.Functor.
Generalizable All Variables.
Set Primitive Projections.
Set Universe Polymorphism.
Unset Transparent Obligations.
Inductive TwoObj : Type := TwoX | TwoY.
Inductive TwoHom : TwoObj -> TwoObj -> Type :=
| TwoIdX : TwoHom TwoX TwoX
| TwoIdY : TwoHom TwoY TwoY
| TwoXY : TwoHom TwoX TwoY.
Definition TwoHom_inv_t : forall x y, TwoHom x y -> Prop.
Proof.
intros [] [] f.
exact (f = TwoIdX).
exact (f = TwoXY).
exact False. (* Unused, any Prop is ok here *)
exact (f = TwoIdY).
Defined.
Corollary TwoHom_inv x y f : TwoHom_inv_t x y f.
Proof. destruct f; reflexivity. Qed.
Lemma TwoHom_Y_X_absurd : TwoHom TwoY TwoX -> False.
Proof. inversion 1. Qed.
Hint Extern 4 => contradiction TwoHom_Y_X_absurd : two_laws.
(* The category 2 has two objects, their identity morphisms, and one morphism
from the first object to the second (here denoted false and true). *)
Program Definition _2 : Category := {|
obj := TwoObj;
hom := TwoHom;
homset := Morphism_equality;
id := fun x => match x with
| TwoX => TwoIdX
| TwoY => TwoIdY
end;
compose := fun x y z (f : TwoHom y z) (g : TwoHom x y) =>
match x, y, z with
| TwoX, TwoX, TwoX => TwoIdX
| TwoY, TwoY, TwoY => TwoIdY
| TwoX, TwoX, TwoY => TwoXY
| TwoX, TwoY, TwoY => TwoXY
| _, _, _ => _
end
|}.
Next Obligation. destruct x, y, z; intuition. Qed.
Next Obligation.
destruct x, y, z; auto with two_laws;
intuition; discriminate.
Qed.
Next Obligation.
destruct x, y, z; auto with two_laws;
intuition; discriminate.
Qed.
Next Obligation.
destruct x, y, z; auto with two_laws;
intuition; discriminate.
Qed.
Next Obligation.
destruct x, y; auto with two_laws; intuition;
symmetry; exact (TwoHom_inv _ _ f).
Qed.
Next Obligation.
destruct x, y; auto with two_laws; intuition;
symmetry; exact (TwoHom_inv _ _ f).
Qed.
Next Obligation.
destruct x, y, z, w; auto with two_laws; intuition.
Qed.
Next Obligation.
destruct x, y, z, w; auto with two_laws; intuition.
Qed.
|
# load required libraries
pacman::p_load(raster, shiny, RColorBrewer, malariaAtlas, shinydashboard, rgdal, googledrive)
##
# load in shapefile
admin0shapefile <- shapefile('data/countries/admin2013_0.shp')
# download admin 0 raster
# https://drive.google.com/open?id=1xY9meFKuR4UqJvc_LwayI11zupvbj5ZQ
temp <- tempfile()
dl <- drive_download(as_id("1xY9meFKuR4UqJvc_LwayI11zupvbj5ZQ"), path = temp, overwrite = TRUE)
admin0raster <- raster(dl$local_path)
# grab a list of available rasters from the MAP API
raster_meta <- as.data.frame(listRaster())
# subset to remove rows where title = "Relative Abundance Africa"
raster_meta <- raster_meta[!raster_meta$title == "Relative Abundance Africa", ]
# turn returned variable as a list to feed into sourcing function
raster_name_list <- as.list(raster_meta$title)
# feed list into getRaster function
raster_list <- lapply(raster_name_list, getRaster)
# stack the surfaces
# error with surfaces due to differing extents
# loop through and get a vector of raster extents
# extents <- t(sapply(raster_list, function (x) as.vector(extent(x))))
#
# get unique extents across all rasters
# u_extents <- unique(extents)
# loop through surfaces and generate info for each country; can't stack as there's 43 unique extents
for(i in 1:length(raster_list)){
# grab the raster for that iteration
r_i <- raster_list[[i]]
# mask it by the extent of the admin 0 raster
r_i <- crop(r_i, admin0raster)
# check number of columns match (cell size is equal)
logic_cell <- r_i@ncols == admin0raster@ncols
# if the number of cells isn't equal, resample
if(logic_cell == FALSE){
message(paste0("Resampling raster ", i, " to align with master grid"))
r_i <- resample(r_i, admin0raster, method = "bilinear")
}
# generate the mean pixel value for all pixels within a country
poly_mean <- zonal(r_i, admin0raster, fun = 'mean')
# create a dataframe with the zonal output
poly_mean <- as.data.frame(poly_mean)
names(poly_mean) <- c("country_id_raster",
names(raster_list[[i]]))
# convert to a binary surface indicating values for a country
poly_mean[[2]] <- ifelse(is.na(poly_mean[[2]]), 0, 1)
# combine results across each raster
if(i == 1){
combined <- poly_mean
} else {
combined <- merge(combined, poly_mean, by = "country_id_raster")
}
}
# add back ISO code
iso3 <- as.data.frame(admin0shapefile[, c(1:2, 5)])
names(combined)[1] <- "GAUL_CODE"
combined <- merge(combined, iso3, by = "GAUL_CODE")
# combined$COUNTRY_ID.x <- NULL
# drop countries which are XXX
combined_trim <- combined[!combined$COUNTRY_ID.y == "XXX", ]
# write out combined dataset
write.csv(combined,
'D:/Dropbox/PhD/collaboration projects/Wellcome Trust data re-use/SHINY-map-prize/data/combined_lookup.csv',
row.names = FALSE)
|
{-# OPTIONS --cubical-compatible #-}
module Common.Integer where
open import Agda.Builtin.Int public renaming (Int to Integer)
|
(* Title: HOL/Auth/n_germanSymIndex_lemma_inv__49_on_rules.thy
Author: Yongjian Li and Kaiqiang Duan, State Key Lab of Computer Science, Institute of Software, Chinese Academy of Sciences
Copyright 2016 State Key Lab of Computer Science, Institute of Software, Chinese Academy of Sciences
*)
header{*The n_germanSymIndex Protocol Case Study*}
theory n_germanSymIndex_lemma_inv__49_on_rules imports n_germanSymIndex_lemma_on_inv__49
begin
section{*All lemmas on causal relation between inv__49*}
lemma lemma_inv__49_on_rules:
assumes b1: "r \<in> rules N" and b2: "(\<exists> p__Inv0 p__Inv2. p__Inv0\<le>N\<and>p__Inv2\<le>N\<and>p__Inv0~=p__Inv2\<and>f=inv__49 p__Inv0 p__Inv2)"
shows "invHoldForRule s f r (invariants N)"
proof -
have c1: "(\<exists> i d. i\<le>N\<and>d\<le>N\<and>r=n_Store i d)\<or>
(\<exists> i. i\<le>N\<and>r=n_SendReqS i)\<or>
(\<exists> i. i\<le>N\<and>r=n_SendReqE__part__0 i)\<or>
(\<exists> i. i\<le>N\<and>r=n_SendReqE__part__1 i)\<or>
(\<exists> i. i\<le>N\<and>r=n_RecvReqS N i)\<or>
(\<exists> i. i\<le>N\<and>r=n_RecvReqE N i)\<or>
(\<exists> i. i\<le>N\<and>r=n_SendInv__part__0 i)\<or>
(\<exists> i. i\<le>N\<and>r=n_SendInv__part__1 i)\<or>
(\<exists> i. i\<le>N\<and>r=n_SendInvAck i)\<or>
(\<exists> i. i\<le>N\<and>r=n_RecvInvAck i)\<or>
(\<exists> i. i\<le>N\<and>r=n_SendGntS i)\<or>
(\<exists> i. i\<le>N\<and>r=n_SendGntE N i)\<or>
(\<exists> i. i\<le>N\<and>r=n_RecvGntS i)\<or>
(\<exists> i. i\<le>N\<and>r=n_RecvGntE i)"
apply (cut_tac b1, auto) done
moreover {
assume d1: "(\<exists> i d. i\<le>N\<and>d\<le>N\<and>r=n_Store i d)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_StoreVsinv__49) done
}
moreover {
assume d1: "(\<exists> i. i\<le>N\<and>r=n_SendReqS i)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_SendReqSVsinv__49) done
}
moreover {
assume d1: "(\<exists> i. i\<le>N\<and>r=n_SendReqE__part__0 i)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_SendReqE__part__0Vsinv__49) done
}
moreover {
assume d1: "(\<exists> i. i\<le>N\<and>r=n_SendReqE__part__1 i)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_SendReqE__part__1Vsinv__49) done
}
moreover {
assume d1: "(\<exists> i. i\<le>N\<and>r=n_RecvReqS N i)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_RecvReqSVsinv__49) done
}
moreover {
assume d1: "(\<exists> i. i\<le>N\<and>r=n_RecvReqE N i)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_RecvReqEVsinv__49) done
}
moreover {
assume d1: "(\<exists> i. i\<le>N\<and>r=n_SendInv__part__0 i)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_SendInv__part__0Vsinv__49) done
}
moreover {
assume d1: "(\<exists> i. i\<le>N\<and>r=n_SendInv__part__1 i)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_SendInv__part__1Vsinv__49) done
}
moreover {
assume d1: "(\<exists> i. i\<le>N\<and>r=n_SendInvAck i)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_SendInvAckVsinv__49) done
}
moreover {
assume d1: "(\<exists> i. i\<le>N\<and>r=n_RecvInvAck i)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_RecvInvAckVsinv__49) done
}
moreover {
assume d1: "(\<exists> i. i\<le>N\<and>r=n_SendGntS i)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_SendGntSVsinv__49) done
}
moreover {
assume d1: "(\<exists> i. i\<le>N\<and>r=n_SendGntE N i)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_SendGntEVsinv__49) done
}
moreover {
assume d1: "(\<exists> i. i\<le>N\<and>r=n_RecvGntS i)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_RecvGntSVsinv__49) done
}
moreover {
assume d1: "(\<exists> i. i\<le>N\<and>r=n_RecvGntE i)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_RecvGntEVsinv__49) done
}
ultimately show "invHoldForRule s f r (invariants N)"
by satx
qed
end
|
[STATEMENT]
lemma poly_squarefree_decomp_order2:
"pderiv p \<noteq> 0 \<Longrightarrow> p = q * d \<Longrightarrow> pderiv p = e * d \<Longrightarrow>
d = r * p + s * pderiv p \<Longrightarrow> \<forall>a. order a q = (if order a p = 0 then 0 else 1)"
for p :: "'a::field_char_0 poly"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>pderiv p \<noteq> 0; p = q * d; pderiv p = e * d; d = r * p + s * pderiv p\<rbrakk> \<Longrightarrow> \<forall>a. order a q = (if order a p = 0 then 0 else 1)
[PROOF STEP]
by (blast intro: poly_squarefree_decomp_order) |
# Copyright 2019 Tobias Frilling
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
gini_coeff(data::Vector{<:Real})
Calculates the Gini coefficient for the given data.
"""
function gini_coeff(data::Vector{<:Real})
@assert all(x->x >= 0, data)
y = sort(data)
n = length(y)
# cargo-culted from Wikipedia
2 * sum([i * y[i] for i in 1:n]) / (n * sum(y)) - (n + 1) / n
end
"""
gini_coeff(curve::ABCcurve)
Calculates the Gini coefficient for the given ABC curve.
"""
function gini_coeff(curve::ABCcurve)
yield = curve.yield
step::Float64 = curve.effort.step
# simplified trapezoidal rule. The '- 1/2 * 2' is for the gini coefficient
# this only works for equidistant steps
((sum(yield) - yield[end] / 2) * step - 1/2) * 2
end
|
(* Title: JinjaThreads/Framework/FWBisimDeadlock.thy
Author: Andreas Lochbihler
*)
header {* \isaheader{Preservation of deadlock across bisimulations} *}
theory FWBisimDeadlock
imports
FWBisimulation
FWDeadlock
begin
context FWdelay_bisimulation_obs begin
lemma actions_ok1_ex_actions_ok2:
assumes "r1.actions_ok s1 t ta1"
and "ta1 \<sim>m ta2"
obtains s2 where "r2.actions_ok s2 t ta2"
proof -
let ?s2 = "(locks s1, (\<lambda>t. map_option (\<lambda>(x1, ln). (SOME x2. if final1 x1 then final2 x2 else \<not> final2 x2, ln)) (thr s1 t), undefined), wset s1, interrupts s1)"
from `ta1 \<sim>m ta2` have "\<lbrace>ta1\<rbrace>\<^bsub>c\<^esub> = \<lbrace>ta2\<rbrace>\<^bsub>c\<^esub>" by(simp add: ta_bisim_def)
with `r1.actions_ok s1 t ta1` have cao1: "r1.cond_action_oks s1 t \<lbrace>ta2\<rbrace>\<^bsub>c\<^esub>" by auto
have "r2.cond_action_oks ?s2 t \<lbrace>ta2\<rbrace>\<^bsub>c\<^esub>" unfolding r2.cond_action_oks_conv_set
proof
fix ct
assume "ct \<in> set \<lbrace>ta2\<rbrace>\<^bsub>c\<^esub>"
with cao1 have "r1.cond_action_ok s1 t ct"
unfolding r1.cond_action_oks_conv_set by auto
thus "r2.cond_action_ok ?s2 t ct" using ex_final1_conv_ex_final2
by(cases ct)(fastforce intro: someI_ex[where P=final2])+
qed
hence "r2.actions_ok ?s2 t ta2"
using assms by(auto simp add: ta_bisim_def split del: split_if elim: rev_iffD1[OF _ thread_oks_bisim_inv])
thus thesis by(rule that)
qed
lemma actions_ok2_ex_actions_ok1:
assumes "r2.actions_ok s2 t ta2"
and "ta1 \<sim>m ta2"
obtains s1 where "r1.actions_ok s1 t ta1"
using FWdelay_bisimulation_obs.actions_ok1_ex_actions_ok2[OF FWdelay_bisimulation_obs_flip] assms
unfolding flip_simps .
lemma ex_actions_ok1_conv_ex_actions_ok2:
"ta1 \<sim>m ta2 \<Longrightarrow> (\<exists>s1. r1.actions_ok s1 t ta1) \<longleftrightarrow> (\<exists>s2. r2.actions_ok s2 t ta2)"
by(metis actions_ok1_ex_actions_ok2 actions_ok2_ex_actions_ok1)
end
context FWdelay_bisimulation_diverge begin
lemma no_\<tau>Move1_\<tau>s_to_no_\<tau>Move2:
fixes no_\<tau>moves1 no_\<tau>moves2
defines "no_\<tau>moves1 \<equiv> \<lambda>s1 t. wset s1 t = None \<and> (\<exists>x. thr s1 t = \<lfloor>(x, no_wait_locks)\<rfloor> \<and> (\<forall>x' m'. \<not> r1.silent_move t (x, shr s1) (x', m')))"
defines "no_\<tau>moves2 \<equiv> \<lambda>s2 t. wset s2 t = None \<and> (\<exists>x. thr s2 t = \<lfloor>(x, no_wait_locks)\<rfloor> \<and> (\<forall>x' m'. \<not> r2.silent_move t (x, shr s2) (x', m')))"
assumes mbisim: "s1 \<approx>m (ls2, (ts2, m2), ws2, is2)"
shows "\<exists>ts2'. r2.mthr.silent_moves (ls2, (ts2, m2), ws2, is2) (ls2, (ts2', m2), ws2, is2) \<and>
(\<forall>t. no_\<tau>moves1 s1 t \<longrightarrow> no_\<tau>moves2 (ls2, (ts2', m2), ws2, is2) t) \<and> s1 \<approx>m (ls2, (ts2', m2), ws2, is2)"
proof -
from mbisim have "finite (dom (thr s1))" by(simp add: mbisim_def)
hence "finite {t. no_\<tau>moves1 s1 t}" unfolding no_\<tau>moves1_def
by-(rule finite_subset, auto)
thus ?thesis using `s1 \<approx>m (ls2, (ts2, m2), ws2, is2)`
proof(induct A\<equiv>"{t. no_\<tau>moves1 s1 t}" arbitrary: s1 ts2 rule: finite_induct)
case empty
from `{} = {t. no_\<tau>moves1 s1 t}`[symmetric] have "no_\<tau>moves1 s1 = (\<lambda>t. False)"
by(auto intro: ext)
thus ?case using `s1 \<approx>m (ls2, (ts2, m2), ws2, is2)` by auto
next
case (insert t A)
note mbisim = `s1 \<approx>m (ls2, (ts2, m2), ws2, is2)`
from `insert t A = {t. no_\<tau>moves1 s1 t}`
have "no_\<tau>moves1 s1 t" by auto
then obtain x1 where ts1t: "thr s1 t = \<lfloor>(x1, no_wait_locks)\<rfloor>"
and ws1t: "wset s1 t = None"
and \<tau>1: "\<And>x1m1'. \<not> r1.silent_move t (x1, shr s1) x1m1'"
by(auto simp add: no_\<tau>moves1_def)
from ts1t mbisim obtain x2 where ts2t: "ts2 t = \<lfloor>(x2, no_wait_locks)\<rfloor>"
and "t \<turnstile> (x1, shr s1) \<approx> (x2, m2)" by(auto dest: mbisim_thrD1)
from mbisim ws1t have "ws2 t = None" by(simp add: mbisim_def)
let ?s1 = "(locks s1, ((thr s1)(t := None), shr s1), wset s1, interrupts s1)"
let ?s2 = "(ls2, (ts2(t := None), m2), ws2, is2)"
from `insert t A = {t. no_\<tau>moves1 s1 t}` `t \<notin> A`
have A: "A = {t. no_\<tau>moves1 ?s1 t}" by(auto simp add: no_\<tau>moves1_def)
have "?s1 \<approx>m ?s2"
proof(rule mbisimI)
from mbisim
show "finite (dom (thr ?s1))" "locks ?s1 = locks ?s2" "wset ?s1 = wset ?s2" "interrupts ?s1 = interrupts ?s2"
by(simp_all add: mbisim_def)
next
from mbisim_wset_thread_ok1[OF mbisim] ws1t show "wset_thread_ok (wset ?s1) (thr ?s1)"
by(auto intro!: wset_thread_okI dest: wset_thread_okD split: split_if_asm)
next
fix t'
assume "thr ?s1 t' = None"
with mbisim_thrNone_eq[OF mbisim, of t']
show "thr ?s2 t' = None" by auto
next
fix t' x1 ln
assume "thr ?s1 t' = \<lfloor>(x1, ln)\<rfloor>"
hence "thr s1 t' = \<lfloor>(x1, ln)\<rfloor>" "t' \<noteq> t" by(auto split: split_if_asm)
with mbisim_thrD1[OF mbisim `thr s1 t' = \<lfloor>(x1, ln)\<rfloor>`] mbisim
show "\<exists>x2. thr ?s2 t' = \<lfloor>(x2, ln)\<rfloor> \<and> t' \<turnstile> (x1, shr ?s1) \<approx> (x2, shr ?s2) \<and> (wset ?s2 t' = None \<or> x1 \<approx>w x2)"
by(auto simp add: mbisim_def)
qed
with A have "\<exists>ts2'. r2.mthr.silent_moves ?s2 (ls2, (ts2', m2), ws2, is2) \<and> (\<forall>t. no_\<tau>moves1 ?s1 t \<longrightarrow> no_\<tau>moves2 (ls2, (ts2', m2), ws2, is2) t) \<and> ?s1 \<approx>m (ls2, (ts2', m2), ws2, is2)" by(rule insert)
then obtain ts2' where "r2.mthr.silent_moves ?s2 (ls2, (ts2', m2), ws2, is2)"
and no_\<tau>: "\<And>t. no_\<tau>moves1 ?s1 t \<Longrightarrow> no_\<tau>moves2 (ls2, (ts2', m2), ws2, is2) t"
and "?s1 \<approx>m (ls2, (ts2', m2), ws2, is2)" by auto
let ?s2' = "(ls2, (ts2'(t \<mapsto> (x2, no_wait_locks)), m2), ws2, is2)"
from ts2t have "ts2(t \<mapsto> (x2, no_wait_locks)) = ts2" by(auto intro: ext)
with r2.\<tau>mRedT_add_thread_inv[OF `r2.mthr.silent_moves ?s2 (ls2, (ts2', m2), ws2, is2)`, of t "(x2, no_wait_locks)"]
have "r2.mthr.silent_moves (ls2, (ts2, m2), ws2, is2) ?s2'" by simp
from no_\<tau>move1_\<tau>s_to_no_\<tau>move2[OF `t \<turnstile> (x1, shr s1) \<approx> (x2, m2)` \<tau>1]
obtain x2' m2' where "r2.silent_moves t (x2, m2) (x2', m2')"
and "\<And>x2'' m2''. \<not> r2.silent_move t (x2', m2') (x2'', m2'')"
and "t \<turnstile> (x1, shr s1) \<approx> (x2', m2')" by auto
let ?s2'' = "(ls2, (ts2'(t \<mapsto> (x2', no_wait_locks)), m2'), ws2, is2)"
from red2_rtrancl_\<tau>_heapD[OF `r2.silent_moves t (x2, m2) (x2', m2')` `t \<turnstile> (x1, shr s1) \<approx> (x2, m2)`]
have "m2' = m2" by simp
with `r2.silent_moves t (x2, m2) (x2', m2')` have "r2.silent_moves t (x2, shr ?s2') (x2', m2)" by simp
hence "r2.mthr.silent_moves ?s2' (redT_upd_\<epsilon> ?s2' t x2' m2)"
by(rule red2_rtrancl_\<tau>_into_RedT_\<tau>)(auto simp add: `ws2 t = None` intro: `t \<turnstile> (x1, shr s1) \<approx> (x2, m2)`)
also have "redT_upd_\<epsilon> ?s2' t x2' m2 = ?s2''" using `m2' = m2`
by(auto simp add: fun_eq_iff redT_updLns_def finfun_Diag_const2 o_def)
finally (back_subst) have "r2.mthr.silent_moves (ls2, (ts2, m2), ws2, is2) ?s2''"
using `r2.mthr.silent_moves (ls2, (ts2, m2), ws2, is2) ?s2'` by-(rule rtranclp_trans)
moreover {
fix t'
assume no_\<tau>1: "no_\<tau>moves1 s1 t'"
have "no_\<tau>moves2 ?s2'' t'"
proof(cases "t' = t")
case True thus ?thesis
using `ws2 t = None` `\<And>x2'' m2''. \<not> r2.silent_move t (x2', m2') (x2'', m2'')` by(simp add: no_\<tau>moves2_def)
next
case False
with no_\<tau>1 have "no_\<tau>moves1 ?s1 t'" by(simp add: no_\<tau>moves1_def)
hence "no_\<tau>moves2 (ls2, (ts2', m2), ws2, is2) t'"
by(rule `no_\<tau>moves1 ?s1 t' \<Longrightarrow> no_\<tau>moves2 (ls2, (ts2', m2), ws2, is2) t'`)
with False `m2' = m2` show ?thesis by(simp add: no_\<tau>moves2_def)
qed }
moreover have "s1 \<approx>m ?s2''"
proof(rule mbisimI)
from mbisim
show "finite (dom (thr s1))" "locks s1 = locks ?s2''" "wset s1 = wset ?s2''" "interrupts s1 = interrupts ?s2''"
by(simp_all add: mbisim_def)
next
from mbisim show "wset_thread_ok (wset s1) (thr s1)" by(rule mbisim_wset_thread_ok1)
next
fix t'
assume "thr s1 t' = None"
hence "thr ?s1 t' = None" "t' \<noteq> t" using ts1t by auto
with mbisim_thrNone_eq[OF `?s1 \<approx>m (ls2, (ts2', m2), ws2, is2)`, of t']
show "thr ?s2'' t' = None" by simp
next
fix t' x1' ln'
assume "thr s1 t' = \<lfloor>(x1', ln')\<rfloor>"
show "\<exists>x2. thr ?s2'' t' = \<lfloor>(x2, ln')\<rfloor> \<and> t' \<turnstile> (x1', shr s1) \<approx> (x2, shr ?s2'') \<and> (wset ?s2'' t' = None \<or> x1' \<approx>w x2)"
proof(cases "t = t'")
case True
with `thr s1 t' = \<lfloor>(x1', ln')\<rfloor>` ts1t `t \<turnstile> (x1, shr s1) \<approx> (x2', m2')` `m2' = m2` `ws2 t = None`
show ?thesis by auto
next
case False
with mbisim_thrD1[OF `?s1 \<approx>m (ls2, (ts2', m2), ws2, is2)`, of t' x1' ln'] `thr s1 t' = \<lfloor>(x1', ln')\<rfloor>` `m2' = m2` mbisim
show ?thesis by(auto simp add: mbisim_def)
qed
qed
ultimately show ?case unfolding `m2' = m2` by blast
qed
qed
lemma no_\<tau>Move2_\<tau>s_to_no_\<tau>Move1:
fixes no_\<tau>moves1 no_\<tau>moves2
defines "no_\<tau>moves1 \<equiv> \<lambda>s1 t. wset s1 t = None \<and> (\<exists>x. thr s1 t = \<lfloor>(x, no_wait_locks)\<rfloor> \<and> (\<forall>x' m'. \<not> r1.silent_move t (x, shr s1) (x', m')))"
defines "no_\<tau>moves2 \<equiv> \<lambda>s2 t. wset s2 t = None \<and> (\<exists>x. thr s2 t = \<lfloor>(x, no_wait_locks)\<rfloor> \<and> (\<forall>x' m'. \<not> r2.silent_move t (x, shr s2) (x', m')))"
assumes "(ls1, (ts1, m1), ws1, is1) \<approx>m s2"
shows "\<exists>ts1'. r1.mthr.silent_moves (ls1, (ts1, m1), ws1, is1) (ls1, (ts1', m1), ws1, is1) \<and>
(\<forall>t. no_\<tau>moves2 s2 t \<longrightarrow> no_\<tau>moves1 (ls1, (ts1', m1), ws1, is1) t) \<and> (ls1, (ts1', m1), ws1, is1) \<approx>m s2"
using assms FWdelay_bisimulation_diverge.no_\<tau>Move1_\<tau>s_to_no_\<tau>Move2[OF FWdelay_bisimulation_diverge_flip]
unfolding flip_simps by blast
lemma deadlock_mbisim_not_final_thread_pres:
assumes dead: "t \<in> r1.deadlocked s1 \<or> r1.deadlock s1"
and nfin: "r1.not_final_thread s1 t"
and fin: "r1.final_thread s1 t \<Longrightarrow> r2.final_thread s2 t"
and mbisim: "s1 \<approx>m s2"
shows "r2.not_final_thread s2 t"
proof -
from nfin obtain x1 ln where "thr s1 t = \<lfloor>(x1, ln)\<rfloor>" by cases auto
with mbisim obtain x2 where "thr s2 t = \<lfloor>(x2, ln)\<rfloor>" "t \<turnstile> (x1, shr s1) \<approx> (x2, shr s2)" "wset s1 t = None \<or> x1 \<approx>w x2"
by(auto dest: mbisim_thrD1)
show "r2.not_final_thread s2 t"
proof(cases "wset s1 t = None \<and> ln = no_wait_locks")
case False
with `r1.not_final_thread s1 t` `thr s1 t = \<lfloor>(x1, ln)\<rfloor>` `thr s2 t = \<lfloor>(x2, ln)\<rfloor>` mbisim
show ?thesis by cases(auto simp add: mbisim_def r2.not_final_thread_iff)
next
case True
with `r1.not_final_thread s1 t` `thr s1 t = \<lfloor>(x1, ln)\<rfloor>` have "\<not> final1 x1" by(cases) auto
have "\<not> final2 x2"
proof
assume "final2 x2"
with final2_simulation[OF `t \<turnstile> (x1, shr s1) \<approx> (x2, shr s2)`]
obtain x1' m1' where "r1.silent_moves t (x1, shr s1) (x1', m1')" "t \<turnstile> (x1', m1') \<approx> (x2, shr s2)" "final1 x1'" by auto
from `r1.silent_moves t (x1, shr s1) (x1', m1')` have "x1' = x1"
proof(cases rule: converse_rtranclpE2[consumes 1, case_names refl step])
case (step x1'' m1'')
from `r1.silent_move t (x1, shr s1) (x1'', m1'')`
have "t \<turnstile> (x1, shr s1) -1-\<epsilon>\<rightarrow> (x1'', m1'')" by(auto dest: r1.silent_tl)
hence "r1.redT s1 (t, \<epsilon>) (redT_upd_\<epsilon> s1 t x1'' m1'')"
using `thr s1 t = \<lfloor>(x1, ln)\<rfloor>` True
by -(erule r1.redT_normal, auto simp add: redT_updLns_def finfun_Diag_const2 o_def redT_updWs_def)
hence False using dead by(auto intro: r1.deadlock_no_red r1.red_no_deadlock)
thus ?thesis ..
qed simp
with `\<not> final1 x1` `final1 x1'` show False by simp
qed
thus ?thesis using `thr s2 t = \<lfloor>(x2, ln)\<rfloor>` by(auto simp add: r2.not_final_thread_iff)
qed
qed
lemma deadlocked1_imp_\<tau>s_deadlocked2:
assumes mbisim: "s1 \<approx>m s2"
and dead: "t \<in> r1.deadlocked s1"
shows "\<exists>s2'. r2.mthr.silent_moves s2 s2' \<and> t \<in> r2.deadlocked s2' \<and> s1 \<approx>m s2'"
proof -
from mfinal1_inv_simulation[OF mbisim]
obtain ls2 ts2 m2 ws2 is2 where red1: "r2.mthr.silent_moves s2 (ls2, (ts2, m2), ws2, is2)"
and "s1 \<approx>m (ls2, (ts2, m2), ws2, is2)" and "m2 = shr s2"
and fin: "\<And>t. r1.final_thread s1 t \<Longrightarrow> r2.final_thread (ls2, (ts2, m2), ws2, is2) t" by fastforce
from no_\<tau>Move1_\<tau>s_to_no_\<tau>Move2[OF `s1 \<approx>m (ls2, (ts2, m2), ws2, is2)`]
obtain ts2' where red2: "r2.mthr.silent_moves (ls2, (ts2, m2), ws2, is2) (ls2, (ts2', m2), ws2, is2)"
and no_\<tau>: "\<And>t x1 x2 x2' m2'. \<lbrakk> wset s1 t = None; thr s1 t = \<lfloor>(x1, no_wait_locks)\<rfloor>; ts2' t = \<lfloor>(x2, no_wait_locks)\<rfloor>;
\<And>x' m'. r1.silent_move t (x1, shr s1) (x', m') \<Longrightarrow> False \<rbrakk>
\<Longrightarrow> \<not> r2.silent_move t (x2, m2) (x2', m2')"
and mbisim: "s1 \<approx>m (ls2, (ts2', m2), ws2, is2)" by fastforce
from mbisim have mbisim_eqs: "ls2 = locks s1" "ws2 = wset s1" "is2 = interrupts s1"
by(simp_all add: mbisim_def)
let ?s2 = "(ls2, (ts2', m2), ws2, is2)"
from red2 have fin': "\<And>t. r1.final_thread s1 t \<Longrightarrow> r2.final_thread ?s2 t"
by(rule r2.\<tau>mRedT_preserves_final_thread)(rule fin)
from dead
have "t \<in> r2.deadlocked ?s2"
proof(coinduct)
case (deadlocked t)
thus ?case
proof(cases rule: r1.deadlocked_elims)
case (lock x1)
hence csmw: "\<And>LT. r1.can_sync t x1 (shr s1) LT \<Longrightarrow>
\<exists>lt\<in>LT. r1.must_wait s1 t lt (r1.deadlocked s1 \<union> r1.final_threads s1)"
by blast
from `thr s1 t = \<lfloor>(x1, no_wait_locks)\<rfloor>` mbisim obtain x2
where "ts2' t = \<lfloor>(x2, no_wait_locks)\<rfloor>" and bisim: "t \<turnstile> (x1, shr s1) \<approx> (x2, m2)"
by(auto dest: mbisim_thrD1)
note `ts2' t = \<lfloor>(x2, no_wait_locks)\<rfloor>` moreover
{ from `r1.must_sync t x1 (shr s1)` obtain ta1 x1' m1'
where r1: "t \<turnstile> (x1, shr s1) -1-ta1\<rightarrow> (x1', m1')"
and s1': "\<exists>s1'. r1.actions_ok s1' t ta1" by(fastforce elim: r1.must_syncE)
have "\<not> \<tau>move1 (x1, shr s1) ta1 (x1', m1')" (is "\<not> ?\<tau>")
proof
assume "?\<tau>"
hence "ta1 = \<epsilon>" by(rule r1.silent_tl)
with r1 have "r1.can_sync t x1 (shr s1) {}"
by(auto intro!: r1.can_syncI simp add: collect_locks_def collect_interrupts_def)
from csmw[OF this] show False by blast
qed
from simulation1[OF bisim r1 this]
obtain x2' m2' x2'' m2'' ta2 where r2: "r2.silent_moves t (x2, m2) (x2', m2')"
and r2': "t \<turnstile> (x2', m2') -2-ta2\<rightarrow> (x2'', m2'')"
and \<tau>2: "\<not> \<tau>move2 (x2', m2') ta2 (x2'', m2'')"
and bisim': "t \<turnstile> (x1', m1') \<approx> (x2'', m2'')" and tasim: "ta1 \<sim>m ta2" by auto
from r2
have "\<exists>ta2 x2' m2' s2'. t \<turnstile> (x2, m2) -2-ta2\<rightarrow> (x2', m2') \<and> r2.actions_ok s2' t ta2"
proof(cases rule: converse_rtranclpE2[consumes 1, case_names base step])
case base
from r2'[folded base] s1'[unfolded ex_actions_ok1_conv_ex_actions_ok2[OF tasim]]
show ?thesis by blast
next
case (step x2''' m2''')
hence "t \<turnstile> (x2, m2) -2-\<epsilon>\<rightarrow> (x2''', m2''')" by(auto dest: r2.silent_tl)
moreover have "r2.actions_ok (undefined, (undefined, undefined), empty, undefined) t \<epsilon>" by auto
ultimately show ?thesis by-(rule exI conjI|assumption)+
qed
hence "r2.must_sync t x2 m2" unfolding r2.must_sync_def2 . }
moreover
{ fix LT
assume "r2.can_sync t x2 m2 LT"
then obtain ta2 x2' m2' where r2: "t \<turnstile> (x2, m2) -2-ta2\<rightarrow> (x2', m2')"
and LT: "LT = collect_locks \<lbrace>ta2\<rbrace>\<^bsub>l\<^esub> <+> collect_cond_actions \<lbrace>ta2\<rbrace>\<^bsub>c\<^esub> <+> collect_interrupts \<lbrace>ta2\<rbrace>\<^bsub>i\<^esub>"
by(auto elim: r2.can_syncE)
from `wset s1 t = None` `thr s1 t = \<lfloor>(x1, no_wait_locks)\<rfloor>` `ts2' t = \<lfloor>(x2, no_wait_locks)\<rfloor>`
have "\<not> r2.silent_move t (x2, m2) (x2', m2')"
proof(rule no_\<tau>)
fix x1' m1'
assume "r1.silent_move t (x1, shr s1) (x1', m1')"
hence "t \<turnstile> (x1, shr s1) -1-\<epsilon>\<rightarrow> (x1', m1')" by(auto dest: r1.silent_tl)
hence "r1.can_sync t x1 (shr s1) {}"
by(auto intro: r1.can_syncI simp add: collect_locks_def collect_interrupts_def)
with csmw[OF this] show False by blast
qed
with r2 have "\<not> \<tau>move2 (x2, m2) ta2 (x2', m2')" by auto
from simulation2[OF bisim r2 this] obtain x1' m1' x1'' m1'' ta1
where \<tau>r1: "r1.silent_moves t (x1, shr s1) (x1', m1')"
and r1: "t \<turnstile> (x1', m1') -1-ta1\<rightarrow> (x1'', m1'')"
and n\<tau>1: "\<not> \<tau>move1 (x1', m1') ta1 (x1'', m1'')"
and bisim': "t \<turnstile> (x1'', m1'') \<approx> (x2', m2')"
and tlsim: "ta1 \<sim>m ta2" by auto
from \<tau>r1 obtain [simp]: "x1' = x1" "m1' = shr s1"
proof(cases rule: converse_rtranclpE2[consumes 1, case_names refl step])
case (step X M)
from `r1.silent_move t (x1, shr s1) (X, M)`
have "t \<turnstile> (x1, shr s1) -1-\<epsilon>\<rightarrow> (X, M)" by(auto dest: r1.silent_tl)
hence "r1.can_sync t x1 (shr s1) {}"
by(auto intro: r1.can_syncI simp add: collect_locks_def collect_interrupts_def)
with csmw[OF this] have False by blast
thus ?thesis ..
qed blast
from tlsim LT have "LT = collect_locks \<lbrace>ta1\<rbrace>\<^bsub>l\<^esub> <+> collect_cond_actions \<lbrace>ta1\<rbrace>\<^bsub>c\<^esub> <+> collect_interrupts \<lbrace>ta1\<rbrace>\<^bsub>i\<^esub>"
by(auto simp add: ta_bisim_def)
with r1 have "r1.can_sync t x1 (shr s1) LT" by(auto intro: r1.can_syncI)
from csmw[OF this] obtain lt
where lt: "lt \<in> LT" and mw: "r1.must_wait s1 t lt (r1.deadlocked s1 \<union> r1.final_threads s1)" by blast
have subset: "r1.deadlocked s1 \<union> r1.final_threads s1 \<subseteq> r1.deadlocked s1 \<union> r2.deadlocked s2 \<union> r2.final_threads ?s2"
by(auto dest: fin')
from mw have "r2.must_wait ?s2 t lt (r1.deadlocked s1 \<union> r2.deadlocked ?s2 \<union> r2.final_threads ?s2)"
proof(cases rule: r1.must_wait_elims)
case lock thus ?thesis by(auto simp add: mbisim_eqs dest!: fin')
next
case (join t')
from `r1.not_final_thread s1 t'` obtain x1 ln
where "thr s1 t' = \<lfloor>(x1, ln)\<rfloor>" by cases auto
with mbisim obtain x2 where "ts2' t' = \<lfloor>(x2, ln)\<rfloor>" "t' \<turnstile> (x1, shr s1) \<approx> (x2, m2)" by(auto dest: mbisim_thrD1)
show ?thesis
proof(cases "wset s1 t' = None \<and> ln = no_wait_locks")
case False
with `r1.not_final_thread s1 t'` `thr s1 t' = \<lfloor>(x1, ln)\<rfloor>` `ts2' t' = \<lfloor>(x2, ln)\<rfloor>` `lt = Inr (Inl t')` join
show ?thesis by(auto simp add: mbisim_eqs r2.not_final_thread_iff r1.final_thread_def)
next
case True
with `r1.not_final_thread s1 t'` `thr s1 t' = \<lfloor>(x1, ln)\<rfloor>` have "\<not> final1 x1" by(cases) auto
with join `thr s1 t' = \<lfloor>(x1, ln)\<rfloor>` have "t' \<in> r1.deadlocked s1" by(auto simp add: r1.final_thread_def)
have "\<not> final2 x2"
proof
assume "final2 x2"
with final2_simulation[OF `t' \<turnstile> (x1, shr s1) \<approx> (x2, m2)`]
obtain x1' m1' where "r1.silent_moves t' (x1, shr s1) (x1', m1')"
and "t' \<turnstile> (x1', m1') \<approx> (x2, m2)" "final1 x1'" by auto
from `r1.silent_moves t' (x1, shr s1) (x1', m1')` have "x1' = x1"
proof(cases rule: converse_rtranclpE2[consumes 1, case_names refl step])
case (step x1'' m1'')
from `r1.silent_move t' (x1, shr s1) (x1'', m1'')`
have "t' \<turnstile> (x1, shr s1) -1-\<epsilon>\<rightarrow> (x1'', m1'')" by(auto dest: r1.silent_tl)
hence "r1.redT s1 (t', \<epsilon>) (redT_upd_\<epsilon> s1 t' x1'' m1'')"
using `thr s1 t' = \<lfloor>(x1, ln)\<rfloor>` True
by -(erule r1.redT_normal, auto simp add: redT_updLns_def redT_updWs_def finfun_Diag_const2 o_def)
hence False using `t' \<in> r1.deadlocked s1` by(rule r1.red_no_deadlock)
thus ?thesis ..
qed simp
with `\<not> final1 x1` `final1 x1'` show False by simp
qed
thus ?thesis using `ts2' t' = \<lfloor>(x2, ln)\<rfloor>` join
by(auto simp add: r2.not_final_thread_iff r1.final_thread_def)
qed
next
case (interrupt t')
have "r2.all_final_except ?s2 (r1.deadlocked s1 \<union> r2.deadlocked ?s2 \<union> r2.final_threads ?s2)"
proof(rule r2.all_final_exceptI)
fix t''
assume "r2.not_final_thread ?s2 t''"
then obtain x2 ln where "thr ?s2 t'' = \<lfloor>(x2, ln)\<rfloor>"
and fin: "\<not> final2 x2 \<or> ln \<noteq> no_wait_locks \<or> wset ?s2 t'' \<noteq> None"
by(auto simp add: r2.not_final_thread_iff)
from `thr ?s2 t'' = \<lfloor>(x2, ln)\<rfloor>` mbisim
obtain x1 where ts1t'': "thr s1 t'' = \<lfloor>(x1, ln)\<rfloor>"
and bisim'': "t'' \<turnstile> (x1, shr s1) \<approx> (x2, shr ?s2)"
by(auto dest: mbisim_thrD2)
have "r1.not_final_thread s1 t''"
proof(cases "wset ?s2 t'' = None \<and> ln = no_wait_locks")
case True
with fin have "\<not> final2 x2" by simp
hence "\<not> final1 x1"
proof(rule contrapos_nn)
assume "final1 x1"
with final1_simulation[OF bisim'']
obtain x2' m2' where \<tau>s2: "r2.silent_moves t'' (x2, shr ?s2) (x2', m2')"
and bisim''': "t'' \<turnstile> (x1, shr s1) \<approx> (x2', m2')"
and "final2 x2'" by auto
from \<tau>s2 have "x2' = x2"
proof(cases rule: converse_rtranclpE2[consumes 1, case_names refl step])
case refl thus ?thesis by simp
next
case (step x2'' m2'')
from True have "wset s1 t'' = None" "thr s1 t'' = \<lfloor>(x1, no_wait_locks)\<rfloor>" "ts2' t'' = \<lfloor>(x2, no_wait_locks)\<rfloor>"
using ts1t'' `thr ?s2 t'' = \<lfloor>(x2, ln)\<rfloor>` mbisim by(simp_all add: mbisim_def)
hence no_\<tau>2: "\<not> r2.silent_move t'' (x2, m2) (x2'', m2'')"
proof(rule no_\<tau>)
fix x1' m1'
assume "r1.silent_move t'' (x1, shr s1) (x1', m1')"
with `final1 x1` show False by(auto dest: r1.final_no_red)
qed
with `r2.silent_move t'' (x2, shr ?s2) (x2'', m2'')` have False by simp
thus ?thesis ..
qed
with `final2 x2'` show "final2 x2" by simp
qed
with ts1t'' show ?thesis ..
next
case False
with ts1t'' mbisim show ?thesis by(auto simp add: r1.not_final_thread_iff mbisim_def)
qed
with `r1.all_final_except s1 (r1.deadlocked s1 \<union> r1.final_threads s1)`
have "t'' \<in> r1.deadlocked s1 \<union> r1.final_threads s1" by(rule r1.all_final_exceptD)
thus "t'' \<in> r1.deadlocked s1 \<union> r2.deadlocked ?s2 \<union> r2.final_threads ?s2"
by(auto dest: fin' simp add: mbisim_eqs)
qed
thus ?thesis using interrupt mbisim by(auto simp add: mbisim_def)
qed
hence "\<exists>lt\<in>LT. r2.must_wait ?s2 t lt (r1.deadlocked s1 \<union> r2.deadlocked ?s2 \<union> r2.final_threads ?s2)"
using `lt \<in> LT` by blast }
moreover from mbisim `wset s1 t = None` have "wset ?s2 t = None" by(simp add: mbisim_def)
ultimately have ?Lock by simp
thus ?thesis ..
next
case (wait x1 ln)
from mbisim `thr s1 t = \<lfloor>(x1, ln)\<rfloor>`
obtain x2 where "ts2' t = \<lfloor>(x2, ln)\<rfloor>" by(auto dest: mbisim_thrD1)
moreover
have "r2.all_final_except ?s2 (r1.deadlocked s1)"
proof(rule r2.all_final_exceptI)
fix t
assume "r2.not_final_thread ?s2 t"
then obtain x2 ln where "ts2' t = \<lfloor>(x2, ln)\<rfloor>" by(auto simp add: r2.not_final_thread_iff)
with mbisim obtain x1 where "thr s1 t = \<lfloor>(x1, ln)\<rfloor>" "t \<turnstile> (x1, shr s1) \<approx> (x2, m2)" by(auto dest: mbisim_thrD2)
hence "r1.not_final_thread s1 t" using `r2.not_final_thread ?s2 t` `ts2' t = \<lfloor>(x2, ln)\<rfloor>` mbisim fin'[of t]
by(cases "wset s1 t")(auto simp add: r1.not_final_thread_iff r2.not_final_thread_iff mbisim_def r1.final_thread_def r2.final_thread_def)
with `r1.all_final_except s1 (r1.deadlocked s1)`
show "t \<in> r1.deadlocked s1" by(rule r1.all_final_exceptD)
qed
hence "r2.all_final_except ?s2 (r1.deadlocked s1 \<union> r2.deadlocked ?s2)"
by(rule r2.all_final_except_mono') blast
moreover
from `waiting (wset s1 t)` mbisim
have "waiting (wset ?s2 t)" by(simp add: mbisim_def)
ultimately have ?Wait by simp
thus ?thesis by blast
next
case (acquire x1 ln l t')
from mbisim `thr s1 t = \<lfloor>(x1, ln)\<rfloor>`
obtain x2 where "ts2' t = \<lfloor>(x2, ln)\<rfloor>" by(auto dest: mbisim_thrD1)
moreover
from `t' \<in> r1.deadlocked s1 \<or> r1.final_thread s1 t'`
have "(t' \<in> r1.deadlocked s1 \<or> t' \<in> r2.deadlocked ?s2) \<or> r2.final_thread ?s2 t'" by(blast dest: fin')
moreover
from mbisim `has_lock (locks s1 $ l) t'`
have "has_lock (locks ?s2 $ l) t'" by(simp add: mbisim_def)
ultimately have ?Acquire
using `0 < ln $ l` `t \<noteq> t'` `\<not> waiting (wset s1 t)` mbisim
by(auto simp add: mbisim_def)
thus ?thesis by blast
qed
qed
with red1 red2 mbisim show ?thesis by(blast intro: rtranclp_trans)
qed
lemma deadlocked2_imp_\<tau>s_deadlocked1:
"\<lbrakk> s1 \<approx>m s2; t \<in> r2.deadlocked s2 \<rbrakk>
\<Longrightarrow> \<exists>s1'. r1.mthr.silent_moves s1 s1' \<and> t \<in> r1.deadlocked s1' \<and> s1' \<approx>m s2"
using FWdelay_bisimulation_diverge.deadlocked1_imp_\<tau>s_deadlocked2[OF FWdelay_bisimulation_diverge_flip]
unfolding flip_simps .
lemma deadlock1_imp_\<tau>s_deadlock2:
assumes mbisim: "s1 \<approx>m s2"
and dead: "r1.deadlock s1"
shows "\<exists>s2'. r2.mthr.silent_moves s2 s2' \<and> r2.deadlock s2' \<and> s1 \<approx>m s2'"
proof(cases "\<exists>t. r1.not_final_thread s1 t")
case True
then obtain t where nfin: "r1.not_final_thread s1 t" ..
from mfinal1_inv_simulation[OF mbisim]
obtain ls2 ts2 m2 ws2 is2 where red1: "r2.mthr.silent_moves s2 (ls2, (ts2, m2), ws2, is2)"
and "s1 \<approx>m (ls2, (ts2, m2), ws2, is2)" and "m2 = shr s2"
and fin: "\<And>t. r1.final_thread s1 t \<Longrightarrow> r2.final_thread (ls2, (ts2, m2), ws2, is2) t" by fastforce
from no_\<tau>Move1_\<tau>s_to_no_\<tau>Move2[OF `s1 \<approx>m (ls2, (ts2, m2), ws2, is2)`]
obtain ts2' where red2: "r2.mthr.silent_moves (ls2, (ts2, m2), ws2, is2) (ls2, (ts2', m2), ws2, is2)"
and no_\<tau>: "\<And>t x1 x2 x2' m2'. \<lbrakk> wset s1 t = None; thr s1 t = \<lfloor>(x1, no_wait_locks)\<rfloor>; ts2' t = \<lfloor>(x2, no_wait_locks)\<rfloor>;
\<And>x' m'. r1.silent_move t (x1, shr s1) (x', m') \<Longrightarrow> False \<rbrakk>
\<Longrightarrow> \<not> r2.silent_move t (x2, m2) (x2', m2')"
and mbisim: "s1 \<approx>m (ls2, (ts2', m2), ws2, is2)" by fastforce
from mbisim have mbisim_eqs: "ls2 = locks s1" "ws2 = wset s1" "is2 = interrupts s1"
by(simp_all add: mbisim_def)
let ?s2 = "(ls2, (ts2', m2), ws2, is2)"
from red2 have fin': "\<And>t. r1.final_thread s1 t \<Longrightarrow> r2.final_thread ?s2 t"
by(rule r2.\<tau>mRedT_preserves_final_thread)(rule fin)
have "r2.deadlock ?s2"
proof(rule r2.deadlockI)
case (goal1 t x2)
note ts2t = `thr ?s2 t = \<lfloor>(x2, no_wait_locks)\<rfloor>`
with mbisim obtain x1 where ts1t: "thr s1 t = \<lfloor>(x1, no_wait_locks)\<rfloor>"
and bisim: "t \<turnstile> (x1, shr s1) \<approx> (x2, m2)" by(auto dest: mbisim_thrD2)
from `wset ?s2 t = None` mbisim have ws1t: "wset s1 t = None" by(simp add: mbisim_def)
have "\<not> final1 x1"
proof
assume "final1 x1"
with ts1t ws1t have "r1.final_thread s1 t" by(simp add: r1.final_thread_def)
hence "r2.final_thread ?s2 t" by(rule fin')
with `\<not> final2 x2` ts2t `wset ?s2 t = None` show False by(simp add: r2.final_thread_def)
qed
from r1.deadlockD1[OF dead ts1t this `wset s1 t = None`]
have ms: "r1.must_sync t x1 (shr s1)"
and csmw: "\<And>LT. r1.can_sync t x1 (shr s1) LT \<Longrightarrow> \<exists>lt\<in>LT. r1.must_wait s1 t lt (dom (thr s1))"
by blast+
{
from `r1.must_sync t x1 (shr s1)` obtain ta1 x1' m1'
where r1: "t \<turnstile> (x1, shr s1) -1-ta1\<rightarrow> (x1', m1')"
and s1': "\<exists>s1'. r1.actions_ok s1' t ta1" by(fastforce elim: r1.must_syncE)
have "\<not> \<tau>move1 (x1, shr s1) ta1 (x1', m1')" (is "\<not> ?\<tau>")
proof
assume "?\<tau>"
hence "ta1 = \<epsilon>" by(rule r1.silent_tl)
with r1 have "r1.can_sync t x1 (shr s1) {}"
by(auto intro!: r1.can_syncI simp add: collect_locks_def collect_interrupts_def)
from csmw[OF this] show False by blast
qed
from simulation1[OF bisim r1 this]
obtain x2' m2' x2'' m2'' ta2 where r2: "r2.silent_moves t (x2, m2) (x2', m2')"
and r2': "t \<turnstile> (x2', m2') -2-ta2\<rightarrow> (x2'', m2'')"
and bisim': "t \<turnstile> (x1', m1') \<approx> (x2'', m2'')" and tasim: "ta1 \<sim>m ta2" by auto
from r2
have "\<exists>ta2 x2' m2' s2'. t \<turnstile> (x2, m2) -2-ta2\<rightarrow> (x2', m2') \<and> r2.actions_ok s2' t ta2"
proof(cases rule: converse_rtranclpE2[consumes 1, case_names base step])
case base
from r2'[folded base] s1'[unfolded ex_actions_ok1_conv_ex_actions_ok2[OF tasim]]
show ?thesis by blast
next
case (step x2''' m2''')
hence "t \<turnstile> (x2, m2) -2-\<epsilon>\<rightarrow> (x2''', m2''')" by(auto dest: r2.silent_tl)
moreover have "r2.actions_ok (undefined, (undefined, undefined), empty, undefined) t \<epsilon>" by auto
ultimately show ?thesis by-(rule exI conjI|assumption)+
qed
hence "r2.must_sync t x2 m2" unfolding r2.must_sync_def2 . }
moreover
{ fix LT
assume "r2.can_sync t x2 m2 LT"
then obtain ta2 x2' m2' where r2: "t \<turnstile> (x2, m2) -2-ta2\<rightarrow> (x2', m2')"
and LT: "LT = collect_locks \<lbrace>ta2\<rbrace>\<^bsub>l\<^esub> <+> collect_cond_actions \<lbrace>ta2\<rbrace>\<^bsub>c\<^esub> <+> collect_interrupts \<lbrace>ta2\<rbrace>\<^bsub>i\<^esub>"
by(auto elim: r2.can_syncE)
from ts2t have "ts2' t = \<lfloor>(x2, no_wait_locks)\<rfloor>" by simp
with ws1t ts1t have "\<not> r2.silent_move t (x2, m2) (x2', m2')"
proof(rule no_\<tau>)
fix x1' m1'
assume "r1.silent_move t (x1, shr s1) (x1', m1')"
hence "t \<turnstile> (x1, shr s1) -1-\<epsilon>\<rightarrow> (x1', m1')" by(auto dest: r1.silent_tl)
hence "r1.can_sync t x1 (shr s1) {}"
by(auto intro: r1.can_syncI simp add: collect_locks_def collect_interrupts_def)
with csmw[OF this] show False by blast
qed
with r2 have "\<not> \<tau>move2 (x2, m2) ta2 (x2', m2')" by auto
from simulation2[OF bisim r2 this] obtain x1' m1' x1'' m1'' ta1
where \<tau>r1: "r1.silent_moves t (x1, shr s1) (x1', m1')"
and r1: "t \<turnstile> (x1', m1') -1-ta1\<rightarrow> (x1'', m1'')"
and n\<tau>1: "\<not> \<tau>move1 (x1', m1') ta1 (x1'', m1'')"
and bisim': "t \<turnstile> (x1'', m1'') \<approx> (x2', m2')"
and tlsim: "ta1 \<sim>m ta2" by auto
from \<tau>r1 obtain [simp]: "x1' = x1" "m1' = shr s1"
proof(cases rule: converse_rtranclpE2[consumes 1, case_names refl step])
case (step X M)
from `r1.silent_move t (x1, shr s1) (X, M)`
have "t \<turnstile> (x1, shr s1) -1-\<epsilon>\<rightarrow> (X, M)" by(auto dest: r1.silent_tl)
hence "r1.can_sync t x1 (shr s1) {}"
by(auto intro: r1.can_syncI simp add: collect_locks_def collect_interrupts_def)
with csmw[OF this] have False by blast
thus ?thesis ..
qed blast
from tlsim LT have "LT = collect_locks \<lbrace>ta1\<rbrace>\<^bsub>l\<^esub> <+> collect_cond_actions \<lbrace>ta1\<rbrace>\<^bsub>c\<^esub> <+> collect_interrupts \<lbrace>ta1\<rbrace>\<^bsub>i\<^esub>"
by(auto simp add: ta_bisim_def)
with r1 have "r1.can_sync t x1 (shr s1) LT" by(auto intro: r1.can_syncI)
from csmw[OF this] obtain lt
where lt: "lt \<in> LT" "r1.must_wait s1 t lt (dom (thr s1))" by blast
from `r1.must_wait s1 t lt (dom (thr s1))` have "r2.must_wait ?s2 t lt (dom (thr ?s2))"
proof(cases rule: r1.must_wait_elims)
case (lock l)
with mbisim_dom_eq[OF mbisim] show ?thesis by(auto simp add: mbisim_eqs)
next
case (join t')
from dead deadlock_mbisim_not_final_thread_pres[OF _ `r1.not_final_thread s1 t'` fin' mbisim]
have "r2.not_final_thread ?s2 t'" by auto
thus ?thesis using join mbisim_dom_eq[OF mbisim] by auto
next
case (interrupt t')
have "r2.all_final_except ?s2 (dom (thr ?s2))" by(auto intro!: r2.all_final_exceptI)
with interrupt show ?thesis by(auto simp add: mbisim_eqs)
qed
with lt have "\<exists>lt\<in>LT. r2.must_wait ?s2 t lt (dom (thr ?s2))" by blast }
ultimately show ?case by fastforce
next
case (goal2 t x2 ln l)
note dead moreover
from mbisim `thr ?s2 t = \<lfloor>(x2, ln)\<rfloor>`
obtain x1 where "thr s1 t = \<lfloor>(x1, ln)\<rfloor>" by(auto dest: mbisim_thrD2)
moreover note `0 < ln $ l`
moreover from `\<not> waiting (wset ?s2 t)` mbisim
have "\<not> waiting (wset s1 t)" by(simp add: mbisim_def)
ultimately obtain l' t' where "0 < ln $ l'" "t \<noteq> t'" "thr s1 t' \<noteq> None" "has_lock (locks s1 $ l') t'"
by(rule r1.deadlockD2)
thus ?case using mbisim_thrNone_eq[OF mbisim, of t'] mbisim by(auto simp add: mbisim_def)
next
case (goal3 t x2 w)
from mbisim_thrD2[OF mbisim this]
obtain x1 where "thr s1 t = \<lfloor>(x1, no_wait_locks)\<rfloor>" by auto
with dead have "wset s1 t \<noteq> \<lfloor>PostWS w\<rfloor>" by(rule r1.deadlockD3[rule_format])
with mbisim show ?case by(simp add: mbisim_def)
qed
with red1 red2 mbisim show ?thesis by(blast intro: rtranclp_trans)
next
case False
hence "r1.mfinal s1" by(auto intro: r1.mfinalI simp add: r1.not_final_thread_iff)
from mfinal1_simulation[OF mbisim this]
obtain s2' where "\<tau>mRed2 s2 s2'" "s1 \<approx>m s2'" "r2.mfinal s2'" "shr s2' = shr s2" by blast
thus ?thesis by(blast intro: r2.mfinal_deadlock)
qed
lemma deadlock2_imp_\<tau>s_deadlock1:
"\<lbrakk> s1 \<approx>m s2; r2.deadlock s2 \<rbrakk>
\<Longrightarrow> \<exists>s1'. r1.mthr.silent_moves s1 s1' \<and> r1.deadlock s1' \<and> s1' \<approx>m s2"
using FWdelay_bisimulation_diverge.deadlock1_imp_\<tau>s_deadlock2[OF FWdelay_bisimulation_diverge_flip]
unfolding flip_simps .
lemma deadlocked'1_imp_\<tau>s_deadlocked'2:
"\<lbrakk> s1 \<approx>m s2; r1.deadlocked' s1 \<rbrakk>
\<Longrightarrow> \<exists>s2'. r2.mthr.silent_moves s2 s2' \<and> r2.deadlocked' s2' \<and> s1 \<approx>m s2'"
unfolding r1.deadlock_eq_deadlocked'[symmetric] r2.deadlock_eq_deadlocked'[symmetric]
by(rule deadlock1_imp_\<tau>s_deadlock2)
lemma deadlocked'2_imp_\<tau>s_deadlocked'1:
"\<lbrakk> s1 \<approx>m s2; r2.deadlocked' s2 \<rbrakk> \<Longrightarrow> \<exists>s1'. r1.mthr.silent_moves s1 s1' \<and> r1.deadlocked' s1' \<and> s1' \<approx>m s2"
unfolding r1.deadlock_eq_deadlocked'[symmetric] r2.deadlock_eq_deadlocked'[symmetric]
by(rule deadlock2_imp_\<tau>s_deadlock1)
end
context FWbisimulation begin
lemma mbisim_final_thread_preserve1:
assumes mbisim: "s1 \<approx>m s2" and fin: "r1.final_thread s1 t"
shows "r2.final_thread s2 t"
proof -
from fin obtain x1 where ts1t: "thr s1 t = \<lfloor>(x1, no_wait_locks)\<rfloor>"
and fin1: "final1 x1" and ws1t: "wset s1 t = None"
by(auto elim: r1.final_threadE)
from mbisim ts1t obtain x2
where ts2t: "thr s2 t = \<lfloor>(x2, no_wait_locks)\<rfloor>"
and bisim: "t \<turnstile> (x1, shr s1) \<approx> (x2, shr s2)" by(auto dest: mbisim_thrD1)
note ts2t moreover from fin1 bisim have "final2 x2" by(auto dest: bisim_final)
moreover from mbisim ws1t have "wset s2 t = None" by(simp add: mbisim_def)
ultimately show ?thesis by(rule r2.final_threadI)
qed
lemma mbisim_final_thread_preserve2:
"\<lbrakk> s1 \<approx>m s2; r2.final_thread s2 t \<rbrakk> \<Longrightarrow> r1.final_thread s1 t"
using FWbisimulation.mbisim_final_thread_preserve1[OF FWbisimulation_flip]
unfolding flip_simps .
lemma mbisim_final_thread_inv:
"s1 \<approx>m s2 \<Longrightarrow> r1.final_thread s1 t \<longleftrightarrow> r2.final_thread s2 t"
by(blast intro: mbisim_final_thread_preserve1 mbisim_final_thread_preserve2)
lemma mbisim_not_final_thread_inv:
assumes bisim: "mbisim s1 s2"
shows "r1.not_final_thread s1 = r2.not_final_thread s2"
proof(rule ext)
fix t
show "r1.not_final_thread s1 t = r2.not_final_thread s2 t"
proof(cases "thr s1 t")
case None
with mbisim_thrNone_eq[OF bisim, of t] have "thr s2 t = None" by simp
with None show ?thesis
by(auto elim!: r2.not_final_thread.cases r1.not_final_thread.cases
intro: r2.not_final_thread.intros r1.not_final_thread.intros)
next
case (Some a)
then obtain x1 ln where tst1: "thr s1 t = \<lfloor>(x1, ln)\<rfloor>" by(cases a) auto
from mbisim_thrD1[OF bisim tst1] obtain x2
where tst2: "thr s2 t = \<lfloor>(x2, ln)\<rfloor>" and bisimt: "t \<turnstile> (x1, shr s1) \<approx> (x2, shr s2)" by blast
from bisim have "wset s2 = wset s1" by(simp add: mbisim_def)
with tst2 tst1 bisim_final[OF bisimt] show ?thesis
by(simp add: r1.not_final_thread_conv r2.not_final_thread_conv)(rule mbisim_final_thread_inv[OF bisim])
qed
qed
lemma mbisim_deadlocked_preserve2:
"\<lbrakk> s1 \<approx>m s2; t \<in> r2.deadlocked s2 \<rbrakk> \<Longrightarrow> t \<in> r1.deadlocked s1"
using FWbisimulation.mbisim_deadlocked_preserve1[OF FWbisimulation_flip]
unfolding flip_simps .
lemma mbisim_deadlocked_inv:
"s1 \<approx>m s2 \<Longrightarrow> r1.deadlocked s1 = r2.deadlocked s2"
by(blast intro!: mbisim_deadlocked_preserve1 mbisim_deadlocked_preserve2)
end
(* Nice to have, but not needed any more *)
context FWbisimulation begin
lemma bisim_can_sync_preserve1:
assumes bisim: "t \<turnstile> (x1, m1) \<approx> (x2, m2)" and cs: "t \<turnstile> \<langle>x1, m1\<rangle> LT \<wrong>1"
shows "t \<turnstile> \<langle>x2, m2\<rangle> LT \<wrong>2"
proof -
from cs obtain ta1 x1' m1' where red1: "t \<turnstile> (x1, m1) -1-ta1\<rightarrow> (x1', m1')"
and LT: "LT = collect_locks \<lbrace>ta1\<rbrace>\<^bsub>l\<^esub> <+> collect_cond_actions \<lbrace>ta1\<rbrace>\<^bsub>c\<^esub> <+> collect_interrupts \<lbrace>ta1\<rbrace>\<^bsub>i\<^esub>" by(rule r1.can_syncE)
from bisimulation.simulation1[OF bisimulation_axioms, OF bisim red1] obtain x2' ta2 m2'
where red2: "t \<turnstile> (x2, m2) -2-ta2\<rightarrow> (x2', m2')"
and tasim: "ta1 \<sim>m ta2" by fastforce
from tasim LT have "LT = collect_locks \<lbrace>ta2\<rbrace>\<^bsub>l\<^esub> <+> collect_cond_actions \<lbrace>ta2\<rbrace>\<^bsub>c\<^esub> <+> collect_interrupts \<lbrace>ta2\<rbrace>\<^bsub>i\<^esub>"
by(auto simp add: ta_bisim_def)
with red2 show ?thesis by(rule r2.can_syncI)
qed
lemma bisim_can_sync_preserve2:
"\<lbrakk> t \<turnstile> (x1, m1) \<approx> (x2, m2); t \<turnstile> \<langle>x2, m2\<rangle> LT \<wrong>2 \<rbrakk> \<Longrightarrow> t \<turnstile> \<langle>x1, m1\<rangle> LT \<wrong>1"
using FWbisimulation.bisim_can_sync_preserve1[OF FWbisimulation_flip]
unfolding flip_simps .
lemma bisim_can_sync_inv:
"t \<turnstile> (x1, m1) \<approx> (x2, m2) \<Longrightarrow> t \<turnstile> \<langle>x1, m1\<rangle> LT \<wrong>1 \<longleftrightarrow> t \<turnstile> \<langle>x2, m2\<rangle> LT \<wrong>2"
by(blast intro: bisim_can_sync_preserve1 bisim_can_sync_preserve2)
lemma bisim_must_sync_preserve1:
assumes bisim: "t \<turnstile> (x1, m1) \<approx> (x2, m2)" and ms: "t \<turnstile> \<langle>x1, m1\<rangle> \<wrong>1"
shows "t \<turnstile> \<langle>x2, m2\<rangle> \<wrong>2"
proof -
from ms obtain ta1 x1' m1' where red1: "t \<turnstile> (x1, m1) -1-ta1\<rightarrow> (x1', m1')"
and s1': "\<exists>s1'. r1.actions_ok s1' t ta1" by(fastforce elim: r1.must_syncE)
from bisimulation.simulation1[OF bisimulation_axioms, OF bisim red1] obtain x2' ta2 m2'
where red2: "t \<turnstile> (x2, m2) -2-ta2\<rightarrow> (x2', m2')"
and tasim: "ta1 \<sim>m ta2" by fastforce
from ex_actions_ok1_conv_ex_actions_ok2[OF tasim, of t] s1' red2
show ?thesis unfolding r2.must_sync_def2 by blast
qed
lemma bisim_must_sync_preserve2:
"\<lbrakk> t \<turnstile> (x1, m1) \<approx> (x2, m2); t \<turnstile> \<langle>x2, m2\<rangle> \<wrong>2 \<rbrakk> \<Longrightarrow> t \<turnstile> \<langle>x1, m1\<rangle> \<wrong>1"
using FWbisimulation.bisim_must_sync_preserve1[OF FWbisimulation_flip]
unfolding flip_simps .
lemma bisim_must_sync_inv:
"t \<turnstile> (x1, m1) \<approx> (x2, m2) \<Longrightarrow> t \<turnstile> \<langle>x1, m1\<rangle> \<wrong>1 \<longleftrightarrow> t \<turnstile> \<langle>x2, m2\<rangle> \<wrong>2"
by(blast intro: bisim_must_sync_preserve1 bisim_must_sync_preserve2)
end
end |
#redirect Marc Hicks
|
theorem Schottky: assumes holf: "f holomorphic_on cball 0 1" and nof0: "norm(f 0) \<le> r" and not01: "\<And>z. z \<in> cball 0 1 \<Longrightarrow> \<not>(f z = 0 \<or> f z = 1)" and "0 < t" "t < 1" "norm z \<le> t" shows "norm(f z) \<le> exp(pi * exp(pi * (2 + 2 * r + 12 * t / (1 - t))))" |
(* Title: HOL/Auth/n_mutualExOnI_lemma_on_inv__4.thy
Author: Yongjian Li and Kaiqiang Duan, State Key Lab of Computer Science, Institute of Software, Chinese Academy of Sciences
Copyright 2016 State Key Lab of Computer Science, Institute of Software, Chinese Academy of Sciences
*)
header{*The n_mutualExOnI Protocol Case Study*}
theory n_mutualExOnI_lemma_on_inv__4 imports n_mutualExOnI_base
begin
section{*All lemmas on causal relation between inv__4 and some rule r*}
lemma n_TryVsinv__4:
assumes a1: "(\<exists> i. i\<le>N\<and>r=n_Try i)" and
a2: "(\<exists> p__Inv0 p__Inv1. p__Inv0\<le>N\<and>p__Inv1\<le>N\<and>p__Inv0~=p__Inv1\<and>f=inv__4 p__Inv0 p__Inv1)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain i where a1:"i\<le>N\<and>r=n_Try i" apply fastforce done
from a2 obtain p__Inv0 p__Inv1 where a2:"p__Inv0\<le>N\<and>p__Inv1\<le>N\<and>p__Inv0~=p__Inv1\<and>f=inv__4 p__Inv0 p__Inv1" apply fastforce done
have "(i=p__Inv0)\<or>(i=p__Inv1)\<or>(i~=p__Inv0\<and>i~=p__Inv1)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(i=p__Inv0)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(i=p__Inv1)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(i~=p__Inv0\<and>i~=p__Inv1)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_CritVsinv__4:
assumes a1: "(\<exists> i. i\<le>N\<and>r=n_Crit i)" and
a2: "(\<exists> p__Inv0 p__Inv1. p__Inv0\<le>N\<and>p__Inv1\<le>N\<and>p__Inv0~=p__Inv1\<and>f=inv__4 p__Inv0 p__Inv1)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain i where a1:"i\<le>N\<and>r=n_Crit i" apply fastforce done
from a2 obtain p__Inv0 p__Inv1 where a2:"p__Inv0\<le>N\<and>p__Inv1\<le>N\<and>p__Inv0~=p__Inv1\<and>f=inv__4 p__Inv0 p__Inv1" apply fastforce done
have "(i=p__Inv0)\<or>(i=p__Inv1)\<or>(i~=p__Inv0\<and>i~=p__Inv1)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(i=p__Inv0)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(i=p__Inv1)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(i~=p__Inv0\<and>i~=p__Inv1)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_ExitVsinv__4:
assumes a1: "(\<exists> i. i\<le>N\<and>r=n_Exit i)" and
a2: "(\<exists> p__Inv0 p__Inv1. p__Inv0\<le>N\<and>p__Inv1\<le>N\<and>p__Inv0~=p__Inv1\<and>f=inv__4 p__Inv0 p__Inv1)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain i where a1:"i\<le>N\<and>r=n_Exit i" apply fastforce done
from a2 obtain p__Inv0 p__Inv1 where a2:"p__Inv0\<le>N\<and>p__Inv1\<le>N\<and>p__Inv0~=p__Inv1\<and>f=inv__4 p__Inv0 p__Inv1" apply fastforce done
have "(i=p__Inv0)\<or>(i=p__Inv1)\<or>(i~=p__Inv0\<and>i~=p__Inv1)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(i=p__Inv0)"
have "?P3 s"
apply (cut_tac a1 a2 b1, simp, rule_tac x="(neg (andForm (eqn (IVar (Para (Ident ''n'') p__Inv0)) (Const C)) (eqn (IVar (Para (Ident ''n'') p__Inv1)) (Const C))))" in exI, auto) done
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(i=p__Inv1)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(i~=p__Inv0\<and>i~=p__Inv1)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_IdleVsinv__4:
assumes a1: "(\<exists> i. i\<le>N\<and>r=n_Idle i)" and
a2: "(\<exists> p__Inv0 p__Inv1. p__Inv0\<le>N\<and>p__Inv1\<le>N\<and>p__Inv0~=p__Inv1\<and>f=inv__4 p__Inv0 p__Inv1)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain i where a1:"i\<le>N\<and>r=n_Idle i" apply fastforce done
from a2 obtain p__Inv0 p__Inv1 where a2:"p__Inv0\<le>N\<and>p__Inv1\<le>N\<and>p__Inv0~=p__Inv1\<and>f=inv__4 p__Inv0 p__Inv1" apply fastforce done
have "(i=p__Inv0)\<or>(i=p__Inv1)\<or>(i~=p__Inv0\<and>i~=p__Inv1)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(i=p__Inv0)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(i=p__Inv1)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(i~=p__Inv0\<and>i~=p__Inv1)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
end
|
State Before: G : Type u_1
inst✝³ : SeminormedAddCommGroup G
H : Type u_2
inst✝² : SeminormedAddCommGroup H
inst✝¹ : SeparatedSpace H
inst✝ : CompleteSpace H
f : NormedAddGroupHom G H
g : NormedAddGroupHom (Completion G) H
hg : ∀ (v : G), ↑f v = ↑g (↑G v)
⊢ extension f = g State After: case H
G : Type u_1
inst✝³ : SeminormedAddCommGroup G
H : Type u_2
inst✝² : SeminormedAddCommGroup H
inst✝¹ : SeparatedSpace H
inst✝ : CompleteSpace H
f : NormedAddGroupHom G H
g : NormedAddGroupHom (Completion G) H
hg : ∀ (v : G), ↑f v = ↑g (↑G v)
v : Completion G
⊢ ↑(extension f) v = ↑g v Tactic: ext v State Before: case H
G : Type u_1
inst✝³ : SeminormedAddCommGroup G
H : Type u_2
inst✝² : SeminormedAddCommGroup H
inst✝¹ : SeparatedSpace H
inst✝ : CompleteSpace H
f : NormedAddGroupHom G H
g : NormedAddGroupHom (Completion G) H
hg : ∀ (v : G), ↑f v = ↑g (↑G v)
v : Completion G
⊢ ↑(extension f) v = ↑g v State After: no goals Tactic: rw [NormedAddGroupHom.extension_coe_to_fun,
Completion.extension_unique f.uniformContinuous g.uniformContinuous fun a => hg a] |
State Before: α : Type u_2
E : Type u_1
F : Type ?u.812425
𝕜 : Type ?u.812428
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : CompleteSpace E
inst✝⁵ : NontriviallyNormedField 𝕜
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : SMulCommClass ℝ 𝕜 E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
inst✝ : CompleteSpace F
f✝ g : α → E
m : MeasurableSpace α
μ : Measure α
f : α → E
⊢ (∫ (a : α), f a ∂μ) = setToFun μ (weightedSMul μ) (_ : DominatedFinMeasAdditive μ (weightedSMul μ) 1) f State After: α : Type u_2
E : Type u_1
F : Type ?u.812425
𝕜 : Type ?u.812428
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : CompleteSpace E
inst✝⁵ : NontriviallyNormedField 𝕜
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : SMulCommClass ℝ 𝕜 E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
inst✝ : CompleteSpace F
f✝ g : α → E
m : MeasurableSpace α
μ : Measure α
f : α → E
⊢ (if hf : Integrable fun a => f a then ↑L1.integralCLM (Integrable.toL1 (fun a => f a) hf) else 0) =
setToFun μ (weightedSMul μ) (_ : DominatedFinMeasAdditive μ (weightedSMul μ) 1) f Tactic: simp only [integral, L1.integral] State Before: α : Type u_2
E : Type u_1
F : Type ?u.812425
𝕜 : Type ?u.812428
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : CompleteSpace E
inst✝⁵ : NontriviallyNormedField 𝕜
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : SMulCommClass ℝ 𝕜 E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
inst✝ : CompleteSpace F
f✝ g : α → E
m : MeasurableSpace α
μ : Measure α
f : α → E
⊢ (if hf : Integrable fun a => f a then ↑L1.integralCLM (Integrable.toL1 (fun a => f a) hf) else 0) =
setToFun μ (weightedSMul μ) (_ : DominatedFinMeasAdditive μ (weightedSMul μ) 1) f State After: no goals Tactic: rfl |
After the completion of City and Ocean Machine : Biomech , Townsend began to approach a mental breakdown . " I started to see human beings as little lonesome , water based , pink meat , " he explained , " life forms pushing air through themselves and making noises that the other little pieces of meat seemed to understand . " In 1997 , he checked himself into a mental @-@ health hospital , where he was diagnosed with bipolar disorder . The diagnosis helped him understand where the two sides of his music were coming from ; he felt his disorder " gave birth to the two extremes that are Strapping 's City record and Ocean Machine : Biomech . " After being discharged from the hospital , Townsend found that " everything just clicked " and he was able to write his third solo album , Infinity , which he described as " the parent project " of City and Ocean Machine : Biomech , with music influenced by Broadway . Townsend returned to the studio , accompanied by Hoglan , to work on the album , on which Townsend played most of the instruments . Infinity was released in October 1998 . Later in his career , Townsend has cited Infinity as his favorite solo record .
|
% StackExchange Mathematics Q1909139
% https://math.stackexchange.com/questions/1909139
% Projection of a Symmetric Matrix onto the Probability Simplex
% References:
% 1.
% Remarks:
% 1. B
% TODO:
% 1. C
% Release Notes
% - 1.0.000 17/06/2021
% * First release.
%% General Parameters
subStreamNumberDefault = 79;
run('InitScript.m');
figureIdx = 0;
figureCounterSpec = '%04d';
generateFigures = ON;
%% Simulation Parameters
numRows = 4;
%% Generate Data
mY = randn(numRows, numRows);
% mY = mY + mY.';
vI = zeros(numRows * numRows, 1);
vI(1:(numRows + 1):(numRows ^ 2)) = 1;
hObjFun = @(mX) 0.5 * sum((mX(:) - mY(:)) .^ 2);
%% Solution by CVX
solverString = 'CVX';
% cvx_solver('SDPT3'); %<! Default, Keep numRows low
% cvx_solver('SeDuMi');
% cvx_solver('Mosek'); %<! Can handle numRows > 500, Very Good!
% cvx_solver('Gurobi');
hRunTime = tic();
cvx_begin('quiet')
% cvx_precision('best');
variable mX(numRows, numRows) symmetric;
minimize( (0.5 * sum_square(mX(:) - mY(:))) );
subject to
% mX <In> symmetric(numRows); %<! Doesn't work for some reason
trace(mX) == 1;
mX >= 0;
cvx_end
runTime = toc(hRunTime);
DisplayRunSummary(solverString, hObjFun, mX, runTime, cvx_status);
sCvxSol.vXCvx = mX(:);
sCvxSol.cvxOptVal = hObjFun(mX);
%% Solution by Orthogonal Projection onto the Intersection of Convex Sets
hP1 = @(vX) reshape((reshape(vX, numRows, numRows) + reshape(vX, numRows, numRows).') / 2, 1, numRows * numRows);
hP2 = @(vX) max(vX, 0); %<! Projection mX >= 0
hP3 = @(vX) (vX .* ~vI) + ((vX - ((sum(vX .* vI) - 1) / numRows)) .* vI); %<! Projection trace(mX) == 1
hRunTime = tic();
vX = OrthogonalProjectionOntoConvexSets({hP1; hP2; hP3}, mY(:), 100, 1e-6);
runTime = toc(hRunTime);
mX1 = reshape(vX, numRows, numRows);
DisplayRunSummary(solverString, hObjFun, reshape(vX, numRows, numRows), runTime);
%% Restore Defaults
% set(0, 'DefaultFigureWindowStyle', 'normal');
% set(0, 'DefaultAxesLooseInset', defaultLoosInset);
|
## MSW Triangle
Paremeters to be used
1. mixing angle $\theta$
2. mass difference $\Delta m^2$
3. energy of neutrinos $E$
4. matter profile $n_e(x)$
Survival probability is given by
\begin{equation}
P_{\nu_e\to\nu_e} = \frac{1}{2} + \left( \frac{1}{2} - P_f \right) \cos 2\theta \cos 2\theta_m,
\end{equation}
where
\begin{equation}
P_f = e^{-\frac{\pi}{2}\gamma},
\end{equation}
and
\begin{equation}
\gamma = \frac{\Delta m^2 \sin^2 2\theta}{2E \cos 2\theta \left\lvert \frac{1}{n_e} \frac{dn_e}{dr} \right\rvert } = \frac{\omega \sin^2 2\theta}{\cos 2\theta \left\lvert \frac{1}{n_e} \frac{dn_e}{dr} \right\rvert } = \frac{\omega \sin^2 2\theta}{\cos 2\theta \left\lvert \frac{1}{\hat\lambda} \frac{d\hat\lambda}{dr} \right\rvert }
\end{equation}
in which
\begin{equation}
\cos 2\theta_m = \frac{\cos 2\theta - \hat\lambda}{\sqrt{\hat\lambda^2 + 1 - 2\hat\lambda \cos 2\theta}},
\end{equation}
What we would like to produce is the survival probability of electron neutrinos as a heat map with two parameters mass difference $\Delta m^2$ and $\sin^22\theta$ at each distance $x$.
The formula we have above is only valid far away from the resonance where the Landau-Zener transition happens.
The gamma for our sun is
\begin{equation}
\gamma_S = 3.36\times 10^{14} \omega \frac{\sin^22\theta}{\cos2\theta} = 2.554\times 10^3 \frac{\sin^22\theta}{\cos2\theta} \frac{1}{\hat\lambda}
\end{equation}
```python
%matplotlib inline
```
```python
import numpy as np
import sys
sys.path.insert(0,'../../module')
import neuosc as ns
import sympy as sp
import matplotlib.pyplot as plt
```
```python
figureSize = (13,9)
```
```python
reload(ns)
```
<module 'neuosc' from '../../module/neuosc.py'>
```python
neu_e = 1000000 #eV
msw_eff = ns.MSW(neu_e)
```
```python
msw_eff.adiabatic_p(0.1,0)
```
0.98026524850072128
```python
size = [200,100]
sinma = np.logspace(-4, 0, num=size[0])
lam = np.logspace(6, -1, size[1])
```
```python
su_prob = [[0 for x in range(size[0])] for x in range(size[1])]
md = 0
for matter in lam:
agl = 0
for sin22theta in sinma:
angle = np.arcsin( np.sqrt(sin22theta) )/2
su_prob[md][agl] = msw_eff.solar_landau_zener_p(angle, matter)#adiabatic_p(angle, matter)
agl = agl + 1
md = md + 1
```
```python
sinma, lam = np.meshgrid(np.log10(sinma), np.log10(lam) )
plt.figure(figsize=figureSize)
plt.pcolormesh(sinma, lam, np.array(su_prob) )
plt.colorbar() #need a colorbar to show the intensity scale
plt.show() #boom
```
```python
```
|
function [slug] = amu2slug(amu)
% Convert mass from atomic mass units to slugs.
% Chad Greene 2012
slug = amu*(3.660864489409*1e-27)/32.17405; |
The topology on a space is a $\sigma$-algebra. |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
-- This module uses the test-framework-quickcheck2 package.
module Main where
import Control.Monad
import qualified Data.Vector.Unboxed as V
import qualified Data.Vector.Storable as VS
import Data.Complex
import Test.Framework (defaultMain, testGroup)
import Test.Framework.Providers.QuickCheck2 (testProperty)
import Test.QuickCheck
import qualified Numeric.FFT.Vector.Invertible as I
import qualified Numeric.FFT.Vector.Invertible.Multi as IM
import qualified Numeric.FFT.Vector.Unitary as U
import qualified Numeric.FFT.Vector.Unitary.Multi as UM
import Numeric.FFT.Vector.Plan
main = defaultMain
-- NB: There's no explicit tests for the Unnormalized package.
-- However, its Planners are implicitly used by the other modules,
-- so it's covered in the below tests.
[ testGroup "invertibility"
[ testProperty "I.dft" $ prop_invert I.dft I.idft
, testProperty "I.dftR2C" $ prop_invert I.dftR2C I.dftC2R
, testProperty "I.dct1" $ prop_invert I.dct1 I.idct1
, testProperty "I.dct2" $ prop_invert I.dct2 I.idct2
, testProperty "I.dct3" $ prop_invert I.dct3 I.idct3
, testProperty "I.dct4" $ prop_invert I.dct4 I.idct4
, testProperty "I.dst1" $ prop_invert I.dst1 I.idst1
, testProperty "I.dst2" $ prop_invert I.dst2 I.idst2
, testProperty "I.dst3" $ prop_invert I.dst3 I.idst3
, testProperty "I.dst4" $ prop_invert I.dst4 I.idst4
, testProperty "U.dft" $ prop_invert U.dft U.idft
, testProperty "U.dftR2C" $ prop_invert U.dftR2C U.dftC2R
, testProperty "U.dct2" $ prop_invert U.dct2 U.idct2
]
, testGroup "orthogonality"
[ testProperty "U.dft" $ prop_orthog U.dft
, testProperty "U.idft" $ prop_orthog U.idft
, testProperty "U.dftR2C" $ prop_orthog U.dftR2C
, testProperty "U.dftC2R" $ prop_orthog U.dftR2C
, testProperty "U.dct2" $ prop_orthog U.dct2
, testProperty "U.idct2" $ prop_orthog U.idct2
, testProperty "U.dct4" $ prop_orthog U.dct4
]
, testGroup "invertibility ND"
[ testProperty "IM.dft" $ prop_invertND IM.dft IM.idft
, testProperty "IM.dftR2C" $ prop_invertND IM.dftR2C IM.dftC2R
, testProperty "UM.dft" $ prop_invertND UM.dft UM.idft
, testProperty "UM.dftR2C" $ prop_invertND UM.dftR2C UM.dftC2R
]
, testGroup "orthogonality"
[ testProperty "UM.dft" $ prop_orthogND UM.dft
, testProperty "UM.idft" $ prop_orthogND UM.idft
, testProperty "UM.dftR2C" $ prop_orthogND UM.dftR2C
, testProperty "UM.dftC2R" $ prop_orthogND UM.dftR2C
]
]
-------------------
-- An instance of Arbitrary that probably belongs in another package.
instance (V.Unbox a, Arbitrary a) => Arbitrary (V.Vector a) where
arbitrary = V.fromList `fmap` arbitrary
-------------------------
-- Support functions to compare Doubles for (near) equality.
class Num a => Mag a where
mag :: a -> Double
instance Mag Double where
mag = abs
instance Mag (Complex Double) where
mag = magnitude
-- Robustly test whether two Doubles are nearly identical.
close :: Mag a => a -> a -> Bool
close x y = tol > mag (x-y) / max 1 (mag x + mag y)
where
tol = 1e-10
withinTol :: (Mag a, V.Unbox a) => V.Vector a -> V.Vector a -> Bool
withinTol a b
| V.length a /= V.length b = False
| otherwise = V.and $ V.zipWith close a b
---------------------
-- The actual properties
-- Test whether the inverse actually inverts the forward transform.
prop_invert f g a = let
p1 = plan f (V.length a)
p2 = plan g (V.length a)
in (V.length a > 1) ==> withinTol a $ execute p2 $ execute p1 a
-- Test whether the transform preserves the L2 (sum-of-squares) norm.
prop_orthog f a = let
p1 = plan f (V.length a)
in (V.length a > 1) ==> close (norm2 a) (norm2 $ execute p1 a)
data DimsAndValues a = DimsAndValues (VS.Vector Int) (V.Vector a)
deriving (Show)
instance (Arbitrary a, V.Unbox a) => Arbitrary (DimsAndValues a) where
arbitrary = do
dims <- liftM (VS.fromList . map getPositive) arbitrary `suchThatMap` maybeReduceSize
values <- V.replicateM (VS.product dims) arbitrary
return (DimsAndValues dims values)
where
-- We use this to prevent test cases from growing too big
maybeReduceSize ds =
if VS.product ds < 1000 then Just ds else maybeReduceSize (VS.init ds)
prop_invertND f g (DimsAndValues ds a) = let
p1 = planND f ds
p2 = planND g ds
in (V.length a > 1) ==> withinTol a $ execute p2 $ execute p1 a
prop_orthogND f (DimsAndValues ds a) = let
p1 = planND f ds
in (V.length a > 1) ==> close (norm2 a) (norm2 $ execute p1 a)
norm2 a = sqrt $ V.sum $ V.map (\x -> x*x) $ V.map mag a
|
(* Title: HOL/HOLCF/IOA/RefCorrectness.thy
Author: Olaf Müller
*)
section \<open>Correctness of Refinement Mappings in HOLCF/IOA\<close>
theory RefCorrectness
imports RefMappings
begin
definition corresp_exC ::
"('a, 's2) ioa \<Rightarrow> ('s1 \<Rightarrow> 's2) \<Rightarrow> ('a, 's1) pairs \<rightarrow> ('s1 \<Rightarrow> ('a, 's2) pairs)"
where "corresp_exC A f =
(fix \<cdot>
(LAM h ex.
(\<lambda>s. case ex of
nil \<Rightarrow> nil
| x ## xs \<Rightarrow>
flift1 (\<lambda>pr.
(SOME cex. move A cex (f s) (fst pr) (f (snd pr))) @@ ((h \<cdot> xs) (snd pr))) \<cdot> x)))"
definition corresp_ex ::
"('a, 's2) ioa \<Rightarrow> ('s1 \<Rightarrow> 's2) \<Rightarrow> ('a, 's1) execution \<Rightarrow> ('a, 's2) execution"
where "corresp_ex A f ex = (f (fst ex), (corresp_exC A f \<cdot> (snd ex)) (fst ex))"
definition is_fair_ref_map ::
"('s1 \<Rightarrow> 's2) \<Rightarrow> ('a, 's1) ioa \<Rightarrow> ('a, 's2) ioa \<Rightarrow> bool"
where "is_fair_ref_map f C A \<longleftrightarrow>
is_ref_map f C A \<and> (\<forall>ex \<in> executions C. fair_ex C ex \<longrightarrow> fair_ex A (corresp_ex A f ex))"
text \<open>
Axioms for fair trace inclusion proof support, not for the correctness proof
of refinement mappings!
Note: Everything is superseded by \<^file>\<open>LiveIOA.thy\<close>.
\<close>
axiomatization where
corresp_laststate:
"Finite ex \<Longrightarrow> laststate (corresp_ex A f (s, ex)) = f (laststate (s, ex))"
axiomatization where
corresp_Finite: "Finite (snd (corresp_ex A f (s, ex))) = Finite ex"
axiomatization where
FromAtoC:
"fin_often (\<lambda>x. P (snd x)) (snd (corresp_ex A f (s, ex))) \<Longrightarrow>
fin_often (\<lambda>y. P (f (snd y))) ex"
axiomatization where
FromCtoA:
"inf_often (\<lambda>y. P (fst y)) ex \<Longrightarrow>
inf_often (\<lambda>x. P (fst x)) (snd (corresp_ex A f (s,ex)))"
text \<open>
Proof by case on \<open>inf W\<close> in ex: If so, ok. If not, only \<open>fin W\<close> in ex, ie.
there is an index \<open>i\<close> from which on no \<open>W\<close> in ex. But \<open>W\<close> inf enabled, ie at
least once after \<open>i\<close> \<open>W\<close> is enabled. As \<open>W\<close> does not occur after \<open>i\<close> and \<open>W\<close>
is \<open>enabling_persistent\<close>, \<open>W\<close> keeps enabled until infinity, ie. indefinitely
\<close>
axiomatization where
persistent:
"inf_often (\<lambda>x. Enabled A W (snd x)) ex \<Longrightarrow> en_persistent A W \<Longrightarrow>
inf_often (\<lambda>x. fst x \<in> W) ex \<or> fin_often (\<lambda>x. \<not> Enabled A W (snd x)) ex"
axiomatization where
infpostcond:
"is_exec_frag A (s,ex) \<Longrightarrow> inf_often (\<lambda>x. fst x \<in> W) ex \<Longrightarrow>
inf_often (\<lambda>x. set_was_enabled A W (snd x)) ex"
subsection \<open>\<open>corresp_ex\<close>\<close>
lemma corresp_exC_unfold:
"corresp_exC A f =
(LAM ex.
(\<lambda>s.
case ex of
nil \<Rightarrow> nil
| x ## xs \<Rightarrow>
(flift1 (\<lambda>pr.
(SOME cex. move A cex (f s) (fst pr) (f (snd pr))) @@
((corresp_exC A f \<cdot> xs) (snd pr))) \<cdot> x)))"
apply (rule trans)
apply (rule fix_eq2)
apply (simp only: corresp_exC_def)
apply (rule beta_cfun)
apply (simp add: flift1_def)
done
lemma corresp_exC_UU: "(corresp_exC A f \<cdot> UU) s = UU"
apply (subst corresp_exC_unfold)
apply simp
done
lemma corresp_exC_nil: "(corresp_exC A f \<cdot> nil) s = nil"
apply (subst corresp_exC_unfold)
apply simp
done
lemma corresp_exC_cons:
"(corresp_exC A f \<cdot> (at \<leadsto> xs)) s =
(SOME cex. move A cex (f s) (fst at) (f (snd at))) @@
((corresp_exC A f \<cdot> xs) (snd at))"
apply (rule trans)
apply (subst corresp_exC_unfold)
apply (simp add: Consq_def flift1_def)
apply simp
done
declare corresp_exC_UU [simp] corresp_exC_nil [simp] corresp_exC_cons [simp]
subsection \<open>Properties of move\<close>
lemma move_is_move:
"is_ref_map f C A \<Longrightarrow> reachable C s \<Longrightarrow> (s, a, t) \<in> trans_of C \<Longrightarrow>
move A (SOME x. move A x (f s) a (f t)) (f s) a (f t)"
apply (unfold is_ref_map_def)
apply (subgoal_tac "\<exists>ex. move A ex (f s) a (f t) ")
prefer 2
apply simp
apply (erule exE)
apply (rule someI)
apply assumption
done
lemma move_subprop1:
"is_ref_map f C A \<Longrightarrow> reachable C s \<Longrightarrow> (s, a, t) \<in> trans_of C \<Longrightarrow>
is_exec_frag A (f s, SOME x. move A x (f s) a (f t))"
apply (cut_tac move_is_move)
defer
apply assumption+
apply (simp add: move_def)
done
lemma move_subprop2:
"is_ref_map f C A \<Longrightarrow> reachable C s \<Longrightarrow> (s, a, t) \<in> trans_of C \<Longrightarrow>
Finite ((SOME x. move A x (f s) a (f t)))"
apply (cut_tac move_is_move)
defer
apply assumption+
apply (simp add: move_def)
done
lemma move_subprop3:
"is_ref_map f C A \<Longrightarrow> reachable C s \<Longrightarrow> (s, a, t) \<in> trans_of C \<Longrightarrow>
laststate (f s, SOME x. move A x (f s) a (f t)) = (f t)"
apply (cut_tac move_is_move)
defer
apply assumption+
apply (simp add: move_def)
done
lemma move_subprop4:
"is_ref_map f C A \<Longrightarrow> reachable C s \<Longrightarrow> (s, a, t) \<in> trans_of C \<Longrightarrow>
mk_trace A \<cdot> ((SOME x. move A x (f s) a (f t))) =
(if a \<in> ext A then a \<leadsto> nil else nil)"
apply (cut_tac move_is_move)
defer
apply assumption+
apply (simp add: move_def)
done
subsection \<open>TRACE INCLUSION Part 1: Traces coincide\<close>
subsubsection \<open>Lemmata for \<open>\<Longleftarrow>\<close>\<close>
text \<open>Lemma 1.1: Distribution of \<open>mk_trace\<close> and \<open>@@\<close>\<close>
lemma mk_traceConc:
"mk_trace C \<cdot> (ex1 @@ ex2) = (mk_trace C \<cdot> ex1) @@ (mk_trace C \<cdot> ex2)"
by (simp add: mk_trace_def filter_act_def MapConc)
text \<open>Lemma 1 : Traces coincide\<close>
lemma lemma_1:
"is_ref_map f C A \<Longrightarrow> ext C = ext A \<Longrightarrow>
\<forall>s. reachable C s \<and> is_exec_frag C (s, xs) \<longrightarrow>
mk_trace C \<cdot> xs = mk_trace A \<cdot> (snd (corresp_ex A f (s, xs)))"
supply if_split [split del]
apply (unfold corresp_ex_def)
apply (pair_induct xs simp: is_exec_frag_def)
text \<open>cons case\<close>
apply (auto simp add: mk_traceConc)
apply (frule reachable.reachable_n)
apply assumption
apply (auto simp add: move_subprop4 split: if_split)
done
subsection \<open>TRACE INCLUSION Part 2: corresp_ex is execution\<close>
subsubsection \<open>Lemmata for \<open>==>\<close>\<close>
text \<open>Lemma 2.1\<close>
lemma lemma_2_1 [rule_format]:
"Finite xs \<longrightarrow>
(\<forall>s. is_exec_frag A (s, xs) \<and> is_exec_frag A (t, ys) \<and>
t = laststate (s, xs) \<longrightarrow> is_exec_frag A (s, xs @@ ys))"
apply (rule impI)
apply Seq_Finite_induct
text \<open>main case\<close>
apply (auto simp add: split_paired_all)
done
text \<open>Lemma 2 : \<open>corresp_ex\<close> is execution\<close>
lemma lemma_2:
"is_ref_map f C A \<Longrightarrow>
\<forall>s. reachable C s \<and> is_exec_frag C (s, xs) \<longrightarrow>
is_exec_frag A (corresp_ex A f (s, xs))"
apply (unfold corresp_ex_def)
apply simp
apply (pair_induct xs simp: is_exec_frag_def)
text \<open>main case\<close>
apply auto
apply (rule_tac t = "f x2" in lemma_2_1)
text \<open>\<open>Finite\<close>\<close>
apply (erule move_subprop2)
apply assumption+
apply (rule conjI)
text \<open>\<open>is_exec_frag\<close>\<close>
apply (erule move_subprop1)
apply assumption+
apply (rule conjI)
text \<open>Induction hypothesis\<close>
text \<open>\<open>reachable_n\<close> looping, therefore apply it manually\<close>
apply (erule_tac x = "x2" in allE)
apply simp
apply (frule reachable.reachable_n)
apply assumption
apply simp
text \<open>\<open>laststate\<close>\<close>
apply (erule move_subprop3 [symmetric])
apply assumption+
done
subsection \<open>Main Theorem: TRACE -- INCLUSION\<close>
theorem trace_inclusion:
"ext C = ext A \<Longrightarrow> is_ref_map f C A \<Longrightarrow> traces C \<subseteq> traces A"
apply (unfold traces_def)
apply (simp add: has_trace_def2)
apply auto
text \<open>give execution of abstract automata\<close>
apply (rule_tac x = "corresp_ex A f ex" in bexI)
text \<open>Traces coincide, Lemma 1\<close>
apply (pair ex)
apply (erule lemma_1 [THEN spec, THEN mp])
apply assumption+
apply (simp add: executions_def reachable.reachable_0)
text \<open>\<open>corresp_ex\<close> is execution, Lemma 2\<close>
apply (pair ex)
apply (simp add: executions_def)
text \<open>start state\<close>
apply (rule conjI)
apply (simp add: is_ref_map_def corresp_ex_def)
text \<open>\<open>is_execution_fragment\<close>\<close>
apply (erule lemma_2 [THEN spec, THEN mp])
apply (simp add: reachable.reachable_0)
done
subsection \<open>Corollary: FAIR TRACE -- INCLUSION\<close>
lemma fininf: "(~inf_often P s) = fin_often P s"
by (auto simp: fin_often_def)
lemma WF_alt: "is_wfair A W (s, ex) =
(fin_often (\<lambda>x. \<not> Enabled A W (snd x)) ex \<longrightarrow> inf_often (\<lambda>x. fst x \<in> W) ex)"
by (auto simp add: is_wfair_def fin_often_def)
lemma WF_persistent:
"is_wfair A W (s, ex) \<Longrightarrow> inf_often (\<lambda>x. Enabled A W (snd x)) ex \<Longrightarrow>
en_persistent A W \<Longrightarrow> inf_often (\<lambda>x. fst x \<in> W) ex"
apply (drule persistent)
apply assumption
apply (simp add: WF_alt)
apply auto
done
lemma fair_trace_inclusion:
assumes "is_ref_map f C A"
and "ext C = ext A"
and "\<And>ex. ex \<in> executions C \<Longrightarrow> fair_ex C ex \<Longrightarrow>
fair_ex A (corresp_ex A f ex)"
shows "fairtraces C \<subseteq> fairtraces A"
apply (insert assms)
apply (simp add: fairtraces_def fairexecutions_def)
apply auto
apply (rule_tac x = "corresp_ex A f ex" in exI)
apply auto
text \<open>Traces coincide, Lemma 1\<close>
apply (pair ex)
apply (erule lemma_1 [THEN spec, THEN mp])
apply assumption+
apply (simp add: executions_def reachable.reachable_0)
text \<open>\<open>corresp_ex\<close> is execution, Lemma 2\<close>
apply (pair ex)
apply (simp add: executions_def)
text \<open>start state\<close>
apply (rule conjI)
apply (simp add: is_ref_map_def corresp_ex_def)
text \<open>\<open>is_execution_fragment\<close>\<close>
apply (erule lemma_2 [THEN spec, THEN mp])
apply (simp add: reachable.reachable_0)
done
lemma fair_trace_inclusion2:
"inp C = inp A \<Longrightarrow> out C = out A \<Longrightarrow> is_fair_ref_map f C A \<Longrightarrow>
fair_implements C A"
apply (simp add: is_fair_ref_map_def fair_implements_def fairtraces_def fairexecutions_def)
apply auto
apply (rule_tac x = "corresp_ex A f ex" in exI)
apply auto
text \<open>Traces coincide, Lemma 1\<close>
apply (pair ex)
apply (erule lemma_1 [THEN spec, THEN mp])
apply (simp (no_asm) add: externals_def)
apply (auto)[1]
apply (simp add: executions_def reachable.reachable_0)
text \<open>\<open>corresp_ex\<close> is execution, Lemma 2\<close>
apply (pair ex)
apply (simp add: executions_def)
text \<open>start state\<close>
apply (rule conjI)
apply (simp add: is_ref_map_def corresp_ex_def)
text \<open>\<open>is_execution_fragment\<close>\<close>
apply (erule lemma_2 [THEN spec, THEN mp])
apply (simp add: reachable.reachable_0)
done
end
|
[STATEMENT]
lemma [code]: "compiler_env_config.make = co14 (\<lambda>f. f ()) compiler_env_config_ext"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. compiler_env_config.make = co14 (\<lambda>f. f ()) compiler_env_config_ext
[PROOF STEP]
by(intro ext, simp add: compiler_env_config.make_def
co14_def) |
%% Converting sparse tensors to matrices and vice versa
% We show how to convert a sptensor to a matrix stored in _coordinate_
% format and with extra information so that it can be converted back to a
% sptensor.
%% Creating a sptenmat (sparse tensor as sparse matrix) object
% A sparse tensor can be converted to a sparse matrix. The matrix, however,
% is not stored as a MATLAB sparse matrix because that format is sometimes
% inefficient for converted sparse tensors. Instead, the row and column
% indices are stored explicitly.
%%
% First, we create a sparse tensor to be converted.
X = sptenrand([10 10 10 10],10) %<-- Generate some data.
%%
% All the same options for tenmat are available as for tenmat.
A = sptenmat(X,1) %<-- Mode-1 matricization.
%%
A = sptenmat(X,[2 3]) %<-- More than one mode is mapped to the columns.
%%
A = sptenmat(X,[2 3],'t') %<-- Specify column dimensions (transpose).
%%
A = sptenmat(X,1:4) %<-- All modes mapped to rows, i.e., vectorize.
%%
A = sptenmat(X,2) %<-- By default, columns are ordered as [1 3 4].
%%
A = sptenmat(X,2,[3 1 4]) %<-- Explicit column ordering.
%%
A = sptenmat(X,2,'fc') %<-- Foward cyclic.
%%
A = sptenmat(X,2,'bc') %<-- Backward cyclic.
%% Constituent parts of a sptenmat
A.subs %<-- Subscripts of the nonzeros.
%%
A.vals %<-- The corresponding nonzero values.
%%
A.tsize %<-- Size of the original tensor.
%%
A.rdims %<-- Dimensions that were mapped to the rows.
%%
A.cdims %<-- Dimensions that were mapped to the columns.
%% Creating a sptenmat from its constituent parts
B = sptenmat(A.subs,A.vals,A.rdims,A.cdims,A.tsize) %<-- Copies A
%%
B = sptenmat(double(A),A.rdims,A.cdims,A.tsize) %<-- More efficient to pass a matrix.
%% Creating a sptenmat with no nonzeros
A = sptenmat([],[],A.rdims,A.cdims,A.tsize) %<-- An empty sptenmat.
%% Creating an emtpy sptenmat
A = sptenmat %<-- A really empty sptenmat.
%% Use double to convert a sptenmat to a MATLAB sparse matrix
X = sptenrand([10 10 10 10],10); %<-- Create a tensor.
A = sptenmat(X,1) %<-- Convert it to a sptenmat
%%
B = double(A) %<-- Convert it to a MATLAB sparse matrix
%%
whos A B %<-- The storage for B (the sparse matrix) is larger than for A.
%%
C = B'; %<-- Transposing the result fixes the problem.
whos C
%% Use full to convert a sptenmat to a tenmat
B = sptenmat(sptenrand([3 3 3], 3), 1) %<-- Create a sptenmat
%%
C = full(B) %<-- Convert to a tenmat
%% Use sptensor to convert a sptenmat to a sptensor
Y = sptensor(A) %<-- Convert a sptenmat to a sptensor
%% Use size and tsize for the dimensions of a sptenmat
size(A) %<-- Matrix size
tsize(A) %<-- Corresponding tensor size
%% Subscripted reference for a sptenmat
% This is not supported beyond getting the constituent parts.
%% Subscripted assignment for a sptenmat
A(1:2,1:2) = ones(2) %<-- Replace part of the matrix.
%% Use end for the last index
% End is not supported.
%% Basic operations for sptenmat
norm(A) %<-- Norm of the matrix.
%%
+A %<-- Calls uplus.
%%
-A %<-- Calls uminus.
%% Use aatx to efficiently compute A * A' * x for a sptenmat
x = ones(10,1); %<-- Create vector
aatx(A,x) %<-- Compute A * A' * x
%%
double(A) * double(A)' * x %<-- Same as above but less efficient
%% Displaying a tenmat
% Shows the original tensor dimensions, the modes mapped to rows, the modes
% mapped to columns, and the matrix.
disp(A)
|
Hall 's rifles ( flintlock ) 2 @,@ 864
|
{-# BUILTIN NATURAL ℕ #-}
module the-naturals where
import Relation.Binary.PropositionalEquality as Eq
open Eq using (_≡_; refl)
open Eq.≡-Reasoning using (begin_; _≡⟨⟩_; _∎)
infixl 6 _+_ _∸_
infixl 7 _*_
-- the naturals
data ℕ : Set where
zero : ℕ
suc : ℕ → ℕ
-- addition
_+_ : ℕ → ℕ → ℕ
zero + n = n
(suc m) + n = suc (m + n)
-- multiplication
_*_ : ℕ → ℕ → ℕ
zero * n = zero
(suc m) * n = n + (m * n)
-- monus ( subtraction for the naturals )
_∸_ : ℕ → ℕ → ℕ
m ∸ zero = m
zero ∸ suc n = zero
suc m ∸ suc n = m ∸ n
|
State Before: α : Type u_2
α' : Type ?u.2378632
β : Type u_1
β' : Type ?u.2378638
γ : Type ?u.2378641
E : Type u_3
inst✝⁸ : MeasurableSpace α
inst✝⁷ : MeasurableSpace α'
inst✝⁶ : MeasurableSpace β
inst✝⁵ : MeasurableSpace β'
inst✝⁴ : MeasurableSpace γ
μ μ' : Measure α
ν ν' : Measure β
τ : Measure γ
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
inst✝ : SigmaFinite ν
f : α × β → E
hf : StronglyMeasurable f
⊢ StronglyMeasurable fun x => ∫ (y : β), f (x, y) ∂ν State After: α : Type u_2
α' : Type ?u.2378632
β : Type u_1
β' : Type ?u.2378638
γ : Type ?u.2378641
E : Type u_3
inst✝⁸ : MeasurableSpace α
inst✝⁷ : MeasurableSpace α'
inst✝⁶ : MeasurableSpace β
inst✝⁵ : MeasurableSpace β'
inst✝⁴ : MeasurableSpace γ
μ μ' : Measure α
ν ν' : Measure β
τ : Measure γ
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
inst✝ : SigmaFinite ν
f : α × β → E
hf : StronglyMeasurable (uncurry (curry f))
⊢ StronglyMeasurable fun x => ∫ (y : β), f (x, y) ∂ν Tactic: rw [← uncurry_curry f] at hf State Before: α : Type u_2
α' : Type ?u.2378632
β : Type u_1
β' : Type ?u.2378638
γ : Type ?u.2378641
E : Type u_3
inst✝⁸ : MeasurableSpace α
inst✝⁷ : MeasurableSpace α'
inst✝⁶ : MeasurableSpace β
inst✝⁵ : MeasurableSpace β'
inst✝⁴ : MeasurableSpace γ
μ μ' : Measure α
ν ν' : Measure β
τ : Measure γ
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
inst✝ : SigmaFinite ν
f : α × β → E
hf : StronglyMeasurable (uncurry (curry f))
⊢ StronglyMeasurable fun x => ∫ (y : β), f (x, y) ∂ν State After: no goals Tactic: exact hf.integral_prod_right |
/************************************************************************
MIT License
Copyright (c) 2021 Deqi Tang
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
************************************************************************/
/// @file src/atomsciflow/qmcpack/qmcpack.cpp
/// @author DeqiTang
/// Mail: [email protected]
/// Created Time: Fri 11 Mar 2022 03:27:27 PM CST
#include "atomsciflow/qmcpack/qmcpack.h"
#include <boost/lexical_cast.hpp>
#include <boost/filesystem.hpp>
#include <boost/format.hpp>
#include <iostream>
#include "atomsciflow/qmcpack/utils.h"
#include "atomsciflow/server/submit_script.h"
#include "atomsciflow/remote/server.h"
namespace atomsciflow {
namespace fs = boost::filesystem;
Qmcpack::Qmcpack() {
this->input.root.put("simulation.project.<xmlattr>.series", 0);
this->input.root.put("simulation.qmcsystem", "");
this->input.root.put("simulation.qmcsystem.simulationcell", "");
this->input.put_i_key("simulation.qmcsystem", 2, "particleset", "");
this->input.root.put("simulation.qmcsystem.wavefunction.<xmlattr>.name", "psi0");
this->input.root.put("simulation.qmcsystem.wavefunction.determinantset.slaterdeterminant", "");
this->input.root.add("simulation.qmcsystem.wavefunction.jastrow", "");
this->input.root.add("simulation.qmcsystem.wavefunction.jastrow", "");
this->input.root.add("simulation.qmcsystem.wavefunction.jastrow", "");
this->input.put_i_key("simulation.qmcsystem.hamiltonian", 0, "pairpot", "");
this->input.put_i_key("simulation.qmcsystem.hamiltonian", 1, "pairpot", "");
this->input.put_i_key("simulation.qmcsystem.hamiltonian", 2, "pairpot", "");
this->input.put_attr("simulation.qmc", "method", "vmc");
this->input.put_i_key("simulation.qmc", 0, "parameter", 100);
this->input.put_i_key("simulation.qmc", 1, "parameter", 200);
this->input.put_i_key("simulation.qmc", 2, "parameter", 300);
this->input.put_i_key_attr("simulation.qmc", 0, "parameter", "name", 10);
this->input.put_i_key_attr("simulation.qmc", 1, "parameter", "name", 20);
this->input.put_i_key_attr("simulation.qmc", 2, "parameter", "name", 30);
job.set_run("cmd", "$ASF_CMD_QMCPACK");
job.set_run("input", "qmcpack.in");
job.set_run("output", "qmcpack.out");
job.set_run("script_name_head", "qmcpack-run");
};
Qmcpack::~Qmcpack() {
}
void Qmcpack::get_xyz(const std::string &xyzfile) {
this->xyz.read_xyz_file(xyzfile);
job.set_run("xyz_file", fs::absolute(xyzfile).string());
this->set_job_steps_default();
}
std::string Qmcpack::to_string() {
return this->input.to_string();
}
void Qmcpack::set_job_steps_default() {
job.steps.clear();
std::ostringstream step;
step << "cd ${ABSOLUTE_WORK_DIR}" << "\n";
step << boost::format("cat > %1%<<EOF\n") % job.run_params["input"];
step << this->input.to_string();
step << "EOF\n";
step << boost::format("${CMD_HEAD} %1% %2%\n") % job.run_params["cmd"] % job.run_params["input"];
job.steps.push_back(step.str());
step.clear();
}
void Qmcpack::run(const std::string& directory) {
job.run(directory);
}
} // namespace atomsciflow
|
State Before: α : Type u_1
β : Type ?u.49056
inst✝ : PartialOrder α
a b c : α
s : Set α
ho : Ioi a ⊆ s
hc : s ⊆ Ici a
h : a ∈ s
⊢ Ici a ⊆ s State After: α : Type u_1
β : Type ?u.49056
inst✝ : PartialOrder α
a b c : α
s : Set α
ho : Ioi a ⊆ s
hc : s ⊆ Ici a
h : a ∈ s
⊢ Ioi a ⊆ s ∧ {a} ⊆ s Tactic: rw [← Ioi_union_left, union_subset_iff] State Before: α : Type u_1
β : Type ?u.49056
inst✝ : PartialOrder α
a b c : α
s : Set α
ho : Ioi a ⊆ s
hc : s ⊆ Ici a
h : a ∈ s
⊢ Ioi a ⊆ s ∧ {a} ⊆ s State After: no goals Tactic: simp [*] |
Nexus Group is Namibia’s leading building and civil construction group with and annual turnover of N$ 500 million and over 700 employees. Nexus Group has immense capability to deliver a range of projects from large scale to a multitude of clients in diverse markets. We are a member of the Chamber of Commerce and Industry with extensive tender capability. Our client base includes, but is not limited to: Government, Parastatals, Local Authorities, Major Mining Houses, Leads of Industry, Large Corporate Groups, Financial Institutes and Property Developers.
iWits was approached by Nexus Group at the begining of 2017 for the design and development of a new corporate website. The core purpose of the website is to provide potential clients with an overview of both Civil and Building projects completed by Nexus. To showcase the various Property Development projects undertaken by Nexus, and the availably of properties to buy or rent from Nexus.
iWits conceptualised, designed and developed a comprehensive corporate website for Nexus Group. This website makes use of a custom-developed Content Management System (CMS) allowing the client to update and manage their content.
The Nexus Group homepage showcases an overview of all the sections available on the website. Main navigation is accessable on this page allowing clients to quickly navigate to other sections of the website.
The Civils division page showcases the capabilities of Nexus Group, Nexus operates in sectors including, but not limited to: Infrastructure, Roads and Earth Works, Property and Concessions, Mining Services, Interior fit-out; and the construction and building sector. |
[STATEMENT]
lemma greaterThanLessThan_unfold:"{a<..<b} = {x. a<x \<and> x<b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. {a<..<b} = {x. a < x \<and> x < b}
[PROOF STEP]
by fastforce |
If $f_n$ is a sequence of functions that are all integrable over the circle of radius $r$ centered at $z$, and if $f_n$ converges uniformly to $f$ on the circle of radius $r$ centered at $z$, then $f$ is integrable over the circle of radius $r$ centered at $z$, and the integral of $f$ over the circle of radius $r$ centered at $z$ is the limit of the integrals of $f_n$ over the circle of radius $r$ centered at $z$. |
Address(Country Club Circle) is a residential Culdesacs culdesac in El Macero that branches off from Country Club Drive.
|
[STATEMENT]
lemma letter_pref_exp_hd: "u \<noteq> \<epsilon> \<Longrightarrow> hd u = a \<Longrightarrow> letter_pref_exp u a \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>u \<noteq> \<epsilon>; hd u = a\<rbrakk> \<Longrightarrow> letter_pref_exp u a \<noteq> 0
[PROOF STEP]
by (induct u, auto) |
module Core
using DistributionsAD, Bijectors
using Libtask, ForwardDiff, Random
using Distributions, LinearAlgebra
using ..Utilities, Reexport
using Tracker: Tracker
using ..Turing: Turing
using DynamicPPL: Model, AbstractSampler, Sampler, SampleFromPrior
using LinearAlgebra: copytri!
using Bijectors: PDMatDistribution
import Bijectors: link, invlink
using AdvancedVI
using StatsFuns: logsumexp, softmax
@reexport using DynamicPPL
using Requires
import AdvancedPS
import ZygoteRules
include("container.jl")
include("ad.jl")
function __init__()
@require ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" begin
include("compat/reversediff.jl")
export ReverseDiffAD, getrdcache, setrdcache, emptyrdcache
end
end
export @model,
@varname,
generate_observe,
translate_tilde!,
get_vars,
get_data,
get_default_values,
ParticleContainer,
Particle,
Trace,
fork,
forkr,
current_trace,
getweights,
getweight,
effectiveSampleSize,
sweep!,
ResampleWithESSThreshold,
ADBackend,
setadbackend,
setadsafe,
ForwardDiffAD,
TrackerAD,
ZygoteAD,
value,
gradient_logp,
CHUNKSIZE,
ADBACKEND,
setchunksize,
verifygrad,
@logprob_str,
@prob_str
end # module
|
[STATEMENT]
lemma insert_before_is_strongly_dom_component_safe:
assumes "heap_is_wellformed h" and "type_wf h" and "known_ptrs h"
assumes "h \<turnstile> insert_before ptr node child \<rightarrow>\<^sub>h h'"
shows "is_strongly_scdom_component_safe ({ptr, cast node} \<union> (case child of Some ref \<Rightarrow> {cast ref} | None \<Rightarrow> {} )) {} h h'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. is_strongly_scdom_component_safe ({ptr, cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r node} \<union> (case child of None \<Rightarrow> {} | Some ref \<Rightarrow> {cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r ref})) {} h h'
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. is_strongly_scdom_component_safe ({ptr, cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r node} \<union> (case child of None \<Rightarrow> {} | Some ref \<Rightarrow> {cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r ref})) {} h h'
[PROOF STEP]
obtain ancestors reference_child owner_document h2 h3 disconnected_nodes_h2 where
ancestors: "h \<turnstile> get_ancestors ptr \<rightarrow>\<^sub>r ancestors" and
node_not_in_ancestors: "cast node \<notin> set ancestors" and
reference_child:
"h \<turnstile> (if Some node = child then a_next_sibling node else return child) \<rightarrow>\<^sub>r reference_child" and
owner_document: "h \<turnstile> get_owner_document ptr \<rightarrow>\<^sub>r owner_document" and
h2: "h \<turnstile> adopt_node owner_document node \<rightarrow>\<^sub>h h2" and
disconnected_nodes_h2: "h2 \<turnstile> get_disconnected_nodes owner_document \<rightarrow>\<^sub>r disconnected_nodes_h2" and
h3: "h2 \<turnstile> set_disconnected_nodes owner_document (remove1 node disconnected_nodes_h2) \<rightarrow>\<^sub>h h3" and
h': "h3 \<turnstile> a_insert_node ptr node reference_child \<rightarrow>\<^sub>h h'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (\<And>ancestors reference_child owner_document h2 disconnected_nodes_h2 h3. \<lbrakk>h \<turnstile> get_ancestors ptr \<rightarrow>\<^sub>r ancestors; cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r node \<notin> set ancestors; h \<turnstile> (if Some node = child then local.a_next_sibling node else return child) \<rightarrow>\<^sub>r reference_child; h \<turnstile> get_owner_document ptr \<rightarrow>\<^sub>r owner_document; h \<turnstile> adopt_node owner_document node \<rightarrow>\<^sub>h h2; h2 \<turnstile> get_disconnected_nodes owner_document \<rightarrow>\<^sub>r disconnected_nodes_h2; h2 \<turnstile> set_disconnected_nodes owner_document (remove1 node disconnected_nodes_h2) \<rightarrow>\<^sub>h h3; h3 \<turnstile> local.a_insert_node ptr node reference_child \<rightarrow>\<^sub>h h'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms(4)
[PROOF STATE]
proof (prove)
using this:
h \<turnstile> insert_before ptr node child \<rightarrow>\<^sub>h h'
goal (1 subgoal):
1. (\<And>ancestors reference_child owner_document h2 disconnected_nodes_h2 h3. \<lbrakk>h \<turnstile> get_ancestors ptr \<rightarrow>\<^sub>r ancestors; cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r node \<notin> set ancestors; h \<turnstile> (if Some node = child then local.a_next_sibling node else return child) \<rightarrow>\<^sub>r reference_child; h \<turnstile> get_owner_document ptr \<rightarrow>\<^sub>r owner_document; h \<turnstile> adopt_node owner_document node \<rightarrow>\<^sub>h h2; h2 \<turnstile> get_disconnected_nodes owner_document \<rightarrow>\<^sub>r disconnected_nodes_h2; h2 \<turnstile> set_disconnected_nodes owner_document (remove1 node disconnected_nodes_h2) \<rightarrow>\<^sub>h h3; h3 \<turnstile> local.a_insert_node ptr node reference_child \<rightarrow>\<^sub>h h'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by(auto simp add: insert_before_def a_ensure_pre_insertion_validity_def
elim!: bind_returns_heap_E bind_returns_result_E
bind_returns_heap_E2[rotated, OF get_parent_pure, rotated]
bind_returns_heap_E2[rotated, OF get_child_nodes_pure, rotated]
bind_returns_heap_E2[rotated, OF get_disconnected_nodes_pure, rotated]
bind_returns_heap_E2[rotated, OF get_ancestors_pure, rotated]
bind_returns_heap_E2[rotated, OF next_sibling_pure, rotated]
bind_returns_heap_E2[rotated, OF get_owner_document_pure, rotated]
split: if_splits option.splits)
[PROOF STATE]
proof (state)
this:
h \<turnstile> get_ancestors ptr \<rightarrow>\<^sub>r ancestors
cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r node \<notin> set ancestors
h \<turnstile> (if Some node = child then local.a_next_sibling node else return child) \<rightarrow>\<^sub>r reference_child
h \<turnstile> get_owner_document ptr \<rightarrow>\<^sub>r owner_document
h \<turnstile> adopt_node owner_document node \<rightarrow>\<^sub>h h2
h2 \<turnstile> get_disconnected_nodes owner_document \<rightarrow>\<^sub>r disconnected_nodes_h2
h2 \<turnstile> set_disconnected_nodes owner_document (remove1 node disconnected_nodes_h2) \<rightarrow>\<^sub>h h3
h3 \<turnstile> local.a_insert_node ptr node reference_child \<rightarrow>\<^sub>h h'
goal (1 subgoal):
1. is_strongly_scdom_component_safe ({ptr, cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r node} \<union> (case child of None \<Rightarrow> {} | Some ref \<Rightarrow> {cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r ref})) {} h h'
[PROOF STEP]
have object_ptr_kinds_M_eq3_h: "object_ptr_kinds h = object_ptr_kinds h2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. object_ptr_kinds h = object_ptr_kinds h2
[PROOF STEP]
apply(rule writes_small_big[where P="\<lambda>h h'. object_ptr_kinds h = object_ptr_kinds h'",
OF adopt_node_writes h2])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
1. \<And>ha h' w. \<lbrakk>w \<in> adopt_node_locs |h \<turnstile> get_parent node|\<^sub>r |h \<turnstile> get_owner_document (cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r node)|\<^sub>r owner_document; ha \<turnstile> w \<rightarrow>\<^sub>h h'\<rbrakk> \<Longrightarrow> object_ptr_kinds ha = object_ptr_kinds h'
2. reflp (\<lambda>h h'. object_ptr_kinds h = object_ptr_kinds h')
3. transp (\<lambda>h h'. object_ptr_kinds h = object_ptr_kinds h')
[PROOF STEP]
using adopt_node_pointers_preserved
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?w \<in> adopt_node_locs ?parent ?owner_document ?document_ptr; ?h \<turnstile> ?w \<rightarrow>\<^sub>h ?h'\<rbrakk> \<Longrightarrow> object_ptr_kinds ?h = object_ptr_kinds ?h'
goal (3 subgoals):
1. \<And>ha h' w. \<lbrakk>w \<in> adopt_node_locs |h \<turnstile> get_parent node|\<^sub>r |h \<turnstile> get_owner_document (cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r node)|\<^sub>r owner_document; ha \<turnstile> w \<rightarrow>\<^sub>h h'\<rbrakk> \<Longrightarrow> object_ptr_kinds ha = object_ptr_kinds h'
2. reflp (\<lambda>h h'. object_ptr_kinds h = object_ptr_kinds h')
3. transp (\<lambda>h h'. object_ptr_kinds h = object_ptr_kinds h')
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (2 subgoals):
1. reflp (\<lambda>h h'. object_ptr_kinds h = object_ptr_kinds h')
2. transp (\<lambda>h h'. object_ptr_kinds h = object_ptr_kinds h')
[PROOF STEP]
by (auto simp add: reflp_def transp_def)
[PROOF STATE]
proof (state)
this:
object_ptr_kinds h = object_ptr_kinds h2
goal (1 subgoal):
1. is_strongly_scdom_component_safe ({ptr, cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r node} \<union> (case child of None \<Rightarrow> {} | Some ref \<Rightarrow> {cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r ref})) {} h h'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
object_ptr_kinds h = object_ptr_kinds h2
[PROOF STEP]
have object_ptr_kinds_M_eq_h: "\<And>ptrs. h \<turnstile> object_ptr_kinds_M \<rightarrow>\<^sub>r ptrs = h2 \<turnstile> object_ptr_kinds_M \<rightarrow>\<^sub>r ptrs"
[PROOF STATE]
proof (prove)
using this:
object_ptr_kinds h = object_ptr_kinds h2
goal (1 subgoal):
1. \<And>ptrs. h \<turnstile> object_ptr_kinds_M \<rightarrow>\<^sub>r ptrs = h2 \<turnstile> object_ptr_kinds_M \<rightarrow>\<^sub>r ptrs
[PROOF STEP]
by(simp add: object_ptr_kinds_M_defs )
[PROOF STATE]
proof (state)
this:
h \<turnstile> object_ptr_kinds_M \<rightarrow>\<^sub>r ?ptrs = h2 \<turnstile> object_ptr_kinds_M \<rightarrow>\<^sub>r ?ptrs
goal (1 subgoal):
1. is_strongly_scdom_component_safe ({ptr, cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r node} \<union> (case child of None \<Rightarrow> {} | Some ref \<Rightarrow> {cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r ref})) {} h h'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
h \<turnstile> object_ptr_kinds_M \<rightarrow>\<^sub>r ?ptrs = h2 \<turnstile> object_ptr_kinds_M \<rightarrow>\<^sub>r ?ptrs
[PROOF STEP]
have object_ptr_kinds_M_eq2_h: "|h \<turnstile> object_ptr_kinds_M|\<^sub>r = |h2 \<turnstile> object_ptr_kinds_M|\<^sub>r"
[PROOF STATE]
proof (prove)
using this:
h \<turnstile> object_ptr_kinds_M \<rightarrow>\<^sub>r ?ptrs = h2 \<turnstile> object_ptr_kinds_M \<rightarrow>\<^sub>r ?ptrs
goal (1 subgoal):
1. |h \<turnstile> object_ptr_kinds_M|\<^sub>r = |h2 \<turnstile> object_ptr_kinds_M|\<^sub>r
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
|h \<turnstile> object_ptr_kinds_M|\<^sub>r = |h2 \<turnstile> object_ptr_kinds_M|\<^sub>r
goal (1 subgoal):
1. is_strongly_scdom_component_safe ({ptr, cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r node} \<union> (case child of None \<Rightarrow> {} | Some ref \<Rightarrow> {cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r ref})) {} h h'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
|h \<turnstile> object_ptr_kinds_M|\<^sub>r = |h2 \<turnstile> object_ptr_kinds_M|\<^sub>r
[PROOF STEP]
have node_ptr_kinds_eq2_h: "|h \<turnstile> node_ptr_kinds_M|\<^sub>r = |h2 \<turnstile> node_ptr_kinds_M|\<^sub>r"
[PROOF STATE]
proof (prove)
using this:
|h \<turnstile> object_ptr_kinds_M|\<^sub>r = |h2 \<turnstile> object_ptr_kinds_M|\<^sub>r
goal (1 subgoal):
1. |h \<turnstile> node_ptr_kinds_M|\<^sub>r = |h2 \<turnstile> node_ptr_kinds_M|\<^sub>r
[PROOF STEP]
using node_ptr_kinds_M_eq
[PROOF STATE]
proof (prove)
using this:
|h \<turnstile> object_ptr_kinds_M|\<^sub>r = |h2 \<turnstile> object_ptr_kinds_M|\<^sub>r
|?h \<turnstile> object_ptr_kinds_M|\<^sub>r = |?h' \<turnstile> object_ptr_kinds_M|\<^sub>r \<Longrightarrow> |?h \<turnstile> node_ptr_kinds_M|\<^sub>r = |?h' \<turnstile> node_ptr_kinds_M|\<^sub>r
goal (1 subgoal):
1. |h \<turnstile> node_ptr_kinds_M|\<^sub>r = |h2 \<turnstile> node_ptr_kinds_M|\<^sub>r
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
|h \<turnstile> node_ptr_kinds_M|\<^sub>r = |h2 \<turnstile> node_ptr_kinds_M|\<^sub>r
goal (1 subgoal):
1. is_strongly_scdom_component_safe ({ptr, cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r node} \<union> (case child of None \<Rightarrow> {} | Some ref \<Rightarrow> {cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r ref})) {} h h'
[PROOF STEP]
have "known_ptrs h2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. known_ptrs h2
[PROOF STEP]
using assms(3) object_ptr_kinds_M_eq3_h known_ptrs_preserved
[PROOF STATE]
proof (prove)
using this:
known_ptrs h
object_ptr_kinds h = object_ptr_kinds h2
object_ptr_kinds ?h = object_ptr_kinds ?h' \<Longrightarrow> known_ptrs ?h = known_ptrs ?h'
goal (1 subgoal):
1. known_ptrs h2
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
known_ptrs h2
goal (1 subgoal):
1. is_strongly_scdom_component_safe ({ptr, cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r node} \<union> (case child of None \<Rightarrow> {} | Some ref \<Rightarrow> {cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r ref})) {} h h'
[PROOF STEP]
have wellformed_h2: "heap_is_wellformed h2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. heap_is_wellformed h2
[PROOF STEP]
using adopt_node_preserves_wellformedness[OF assms(1) h2] assms(3) assms(2)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>known_ptrs h; type_wf h\<rbrakk> \<Longrightarrow> heap_is_wellformed h2
known_ptrs h
type_wf h
goal (1 subgoal):
1. heap_is_wellformed h2
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
heap_is_wellformed h2
goal (1 subgoal):
1. is_strongly_scdom_component_safe ({ptr, cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r node} \<union> (case child of None \<Rightarrow> {} | Some ref \<Rightarrow> {cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r ref})) {} h h'
[PROOF STEP]
have object_ptr_kinds_M_eq3_h2: "object_ptr_kinds h2 = object_ptr_kinds h3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. object_ptr_kinds h2 = object_ptr_kinds h3
[PROOF STEP]
apply(rule writes_small_big[where P="\<lambda>h h'. object_ptr_kinds h = object_ptr_kinds h'",
OF set_disconnected_nodes_writes h3])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
1. \<And>h h' w. \<lbrakk>w \<in> set_disconnected_nodes_locs owner_document; h \<turnstile> w \<rightarrow>\<^sub>h h'\<rbrakk> \<Longrightarrow> object_ptr_kinds h = object_ptr_kinds h'
2. reflp (\<lambda>h h'. object_ptr_kinds h = object_ptr_kinds h')
3. transp (\<lambda>h h'. object_ptr_kinds h = object_ptr_kinds h')
[PROOF STEP]
unfolding a_remove_child_locs_def
[PROOF STATE]
proof (prove)
goal (3 subgoals):
1. \<And>h h' w. \<lbrakk>w \<in> set_disconnected_nodes_locs owner_document; h \<turnstile> w \<rightarrow>\<^sub>h h'\<rbrakk> \<Longrightarrow> object_ptr_kinds h = object_ptr_kinds h'
2. reflp (\<lambda>h h'. object_ptr_kinds h = object_ptr_kinds h')
3. transp (\<lambda>h h'. object_ptr_kinds h = object_ptr_kinds h')
[PROOF STEP]
using set_disconnected_nodes_pointers_preserved
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?w \<in> set_disconnected_nodes_locs ?document_ptr; ?h \<turnstile> ?w \<rightarrow>\<^sub>h ?h'\<rbrakk> \<Longrightarrow> object_ptr_kinds ?h = object_ptr_kinds ?h'
goal (3 subgoals):
1. \<And>h h' w. \<lbrakk>w \<in> set_disconnected_nodes_locs owner_document; h \<turnstile> w \<rightarrow>\<^sub>h h'\<rbrakk> \<Longrightarrow> object_ptr_kinds h = object_ptr_kinds h'
2. reflp (\<lambda>h h'. object_ptr_kinds h = object_ptr_kinds h')
3. transp (\<lambda>h h'. object_ptr_kinds h = object_ptr_kinds h')
[PROOF STEP]
by (auto simp add: reflp_def transp_def)
[PROOF STATE]
proof (state)
this:
object_ptr_kinds h2 = object_ptr_kinds h3
goal (1 subgoal):
1. is_strongly_scdom_component_safe ({ptr, cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r node} \<union> (case child of None \<Rightarrow> {} | Some ref \<Rightarrow> {cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r ref})) {} h h'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
object_ptr_kinds h2 = object_ptr_kinds h3
[PROOF STEP]
have object_ptr_kinds_M_eq_h2: "\<And>ptrs. h2 \<turnstile> object_ptr_kinds_M \<rightarrow>\<^sub>r ptrs = h3 \<turnstile> object_ptr_kinds_M \<rightarrow>\<^sub>r ptrs"
[PROOF STATE]
proof (prove)
using this:
object_ptr_kinds h2 = object_ptr_kinds h3
goal (1 subgoal):
1. \<And>ptrs. h2 \<turnstile> object_ptr_kinds_M \<rightarrow>\<^sub>r ptrs = h3 \<turnstile> object_ptr_kinds_M \<rightarrow>\<^sub>r ptrs
[PROOF STEP]
by(simp add: object_ptr_kinds_M_defs)
[PROOF STATE]
proof (state)
this:
h2 \<turnstile> object_ptr_kinds_M \<rightarrow>\<^sub>r ?ptrs = h3 \<turnstile> object_ptr_kinds_M \<rightarrow>\<^sub>r ?ptrs
goal (1 subgoal):
1. is_strongly_scdom_component_safe ({ptr, cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r node} \<union> (case child of None \<Rightarrow> {} | Some ref \<Rightarrow> {cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r ref})) {} h h'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
h2 \<turnstile> object_ptr_kinds_M \<rightarrow>\<^sub>r ?ptrs = h3 \<turnstile> object_ptr_kinds_M \<rightarrow>\<^sub>r ?ptrs
[PROOF STEP]
have object_ptr_kinds_M_eq2_h2: "|h2 \<turnstile> object_ptr_kinds_M|\<^sub>r = |h3 \<turnstile> object_ptr_kinds_M|\<^sub>r"
[PROOF STATE]
proof (prove)
using this:
h2 \<turnstile> object_ptr_kinds_M \<rightarrow>\<^sub>r ?ptrs = h3 \<turnstile> object_ptr_kinds_M \<rightarrow>\<^sub>r ?ptrs
goal (1 subgoal):
1. |h2 \<turnstile> object_ptr_kinds_M|\<^sub>r = |h3 \<turnstile> object_ptr_kinds_M|\<^sub>r
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
|h2 \<turnstile> object_ptr_kinds_M|\<^sub>r = |h3 \<turnstile> object_ptr_kinds_M|\<^sub>r
goal (1 subgoal):
1. is_strongly_scdom_component_safe ({ptr, cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r node} \<union> (case child of None \<Rightarrow> {} | Some ref \<Rightarrow> {cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r ref})) {} h h'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
|h2 \<turnstile> object_ptr_kinds_M|\<^sub>r = |h3 \<turnstile> object_ptr_kinds_M|\<^sub>r
[PROOF STEP]
have node_ptr_kinds_eq2_h2: "|h2 \<turnstile> node_ptr_kinds_M|\<^sub>r = |h3 \<turnstile> node_ptr_kinds_M|\<^sub>r"
[PROOF STATE]
proof (prove)
using this:
|h2 \<turnstile> object_ptr_kinds_M|\<^sub>r = |h3 \<turnstile> object_ptr_kinds_M|\<^sub>r
goal (1 subgoal):
1. |h2 \<turnstile> node_ptr_kinds_M|\<^sub>r = |h3 \<turnstile> node_ptr_kinds_M|\<^sub>r
[PROOF STEP]
using node_ptr_kinds_M_eq
[PROOF STATE]
proof (prove)
using this:
|h2 \<turnstile> object_ptr_kinds_M|\<^sub>r = |h3 \<turnstile> object_ptr_kinds_M|\<^sub>r
|?h \<turnstile> object_ptr_kinds_M|\<^sub>r = |?h' \<turnstile> object_ptr_kinds_M|\<^sub>r \<Longrightarrow> |?h \<turnstile> node_ptr_kinds_M|\<^sub>r = |?h' \<turnstile> node_ptr_kinds_M|\<^sub>r
goal (1 subgoal):
1. |h2 \<turnstile> node_ptr_kinds_M|\<^sub>r = |h3 \<turnstile> node_ptr_kinds_M|\<^sub>r
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
|h2 \<turnstile> node_ptr_kinds_M|\<^sub>r = |h3 \<turnstile> node_ptr_kinds_M|\<^sub>r
goal (1 subgoal):
1. is_strongly_scdom_component_safe ({ptr, cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r node} \<union> (case child of None \<Rightarrow> {} | Some ref \<Rightarrow> {cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r ref})) {} h h'
[PROOF STEP]
have document_ptr_kinds_eq2_h2: "|h2 \<turnstile> document_ptr_kinds_M|\<^sub>r = |h3 \<turnstile> document_ptr_kinds_M|\<^sub>r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. |h2 \<turnstile> document_ptr_kinds_M|\<^sub>r = |h3 \<turnstile> document_ptr_kinds_M|\<^sub>r
[PROOF STEP]
using object_ptr_kinds_M_eq2_h2 document_ptr_kinds_M_eq
[PROOF STATE]
proof (prove)
using this:
|h2 \<turnstile> object_ptr_kinds_M|\<^sub>r = |h3 \<turnstile> object_ptr_kinds_M|\<^sub>r
|?h \<turnstile> object_ptr_kinds_M|\<^sub>r = |?h' \<turnstile> object_ptr_kinds_M|\<^sub>r \<Longrightarrow> |?h \<turnstile> document_ptr_kinds_M|\<^sub>r = |?h' \<turnstile> document_ptr_kinds_M|\<^sub>r
goal (1 subgoal):
1. |h2 \<turnstile> document_ptr_kinds_M|\<^sub>r = |h3 \<turnstile> document_ptr_kinds_M|\<^sub>r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
|h2 \<turnstile> document_ptr_kinds_M|\<^sub>r = |h3 \<turnstile> document_ptr_kinds_M|\<^sub>r
goal (1 subgoal):
1. is_strongly_scdom_component_safe ({ptr, cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r node} \<union> (case child of None \<Rightarrow> {} | Some ref \<Rightarrow> {cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r ref})) {} h h'
[PROOF STEP]
have "known_ptrs h3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. known_ptrs h3
[PROOF STEP]
using object_ptr_kinds_M_eq3_h2 known_ptrs_preserved \<open>known_ptrs h2\<close>
[PROOF STATE]
proof (prove)
using this:
object_ptr_kinds h2 = object_ptr_kinds h3
object_ptr_kinds ?h = object_ptr_kinds ?h' \<Longrightarrow> known_ptrs ?h = known_ptrs ?h'
known_ptrs h2
goal (1 subgoal):
1. known_ptrs h3
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
known_ptrs h3
goal (1 subgoal):
1. is_strongly_scdom_component_safe ({ptr, cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r node} \<union> (case child of None \<Rightarrow> {} | Some ref \<Rightarrow> {cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r ref})) {} h h'
[PROOF STEP]
have object_ptr_kinds_M_eq3_h': "object_ptr_kinds h3 = object_ptr_kinds h'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. object_ptr_kinds h3 = object_ptr_kinds h'
[PROOF STEP]
apply(rule writes_small_big[where P="\<lambda>h h'. object_ptr_kinds h = object_ptr_kinds h'",
OF insert_node_writes h'])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
1. \<And>h h' w. \<lbrakk>w \<in> set_child_nodes_locs ptr; h \<turnstile> w \<rightarrow>\<^sub>h h'\<rbrakk> \<Longrightarrow> object_ptr_kinds h = object_ptr_kinds h'
2. reflp (\<lambda>h h'. object_ptr_kinds h = object_ptr_kinds h')
3. transp (\<lambda>h h'. object_ptr_kinds h = object_ptr_kinds h')
[PROOF STEP]
unfolding a_remove_child_locs_def
[PROOF STATE]
proof (prove)
goal (3 subgoals):
1. \<And>h h' w. \<lbrakk>w \<in> set_child_nodes_locs ptr; h \<turnstile> w \<rightarrow>\<^sub>h h'\<rbrakk> \<Longrightarrow> object_ptr_kinds h = object_ptr_kinds h'
2. reflp (\<lambda>h h'. object_ptr_kinds h = object_ptr_kinds h')
3. transp (\<lambda>h h'. object_ptr_kinds h = object_ptr_kinds h')
[PROOF STEP]
using set_child_nodes_pointers_preserved
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?w \<in> set_child_nodes_locs ?object_ptr; ?h \<turnstile> ?w \<rightarrow>\<^sub>h ?h'\<rbrakk> \<Longrightarrow> object_ptr_kinds ?h = object_ptr_kinds ?h'
goal (3 subgoals):
1. \<And>h h' w. \<lbrakk>w \<in> set_child_nodes_locs ptr; h \<turnstile> w \<rightarrow>\<^sub>h h'\<rbrakk> \<Longrightarrow> object_ptr_kinds h = object_ptr_kinds h'
2. reflp (\<lambda>h h'. object_ptr_kinds h = object_ptr_kinds h')
3. transp (\<lambda>h h'. object_ptr_kinds h = object_ptr_kinds h')
[PROOF STEP]
by (auto simp add: reflp_def transp_def)
[PROOF STATE]
proof (state)
this:
object_ptr_kinds h3 = object_ptr_kinds h'
goal (1 subgoal):
1. is_strongly_scdom_component_safe ({ptr, cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r node} \<union> (case child of None \<Rightarrow> {} | Some ref \<Rightarrow> {cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r ref})) {} h h'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
object_ptr_kinds h3 = object_ptr_kinds h'
[PROOF STEP]
have object_ptr_kinds_M_eq_h3:
"\<And>ptrs. h3 \<turnstile> object_ptr_kinds_M \<rightarrow>\<^sub>r ptrs = h' \<turnstile> object_ptr_kinds_M \<rightarrow>\<^sub>r ptrs"
[PROOF STATE]
proof (prove)
using this:
object_ptr_kinds h3 = object_ptr_kinds h'
goal (1 subgoal):
1. \<And>ptrs. h3 \<turnstile> object_ptr_kinds_M \<rightarrow>\<^sub>r ptrs = h' \<turnstile> object_ptr_kinds_M \<rightarrow>\<^sub>r ptrs
[PROOF STEP]
by(simp add: object_ptr_kinds_M_defs)
[PROOF STATE]
proof (state)
this:
h3 \<turnstile> object_ptr_kinds_M \<rightarrow>\<^sub>r ?ptrs = h' \<turnstile> object_ptr_kinds_M \<rightarrow>\<^sub>r ?ptrs
goal (1 subgoal):
1. is_strongly_scdom_component_safe ({ptr, cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r node} \<union> (case child of None \<Rightarrow> {} | Some ref \<Rightarrow> {cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r ref})) {} h h'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
h3 \<turnstile> object_ptr_kinds_M \<rightarrow>\<^sub>r ?ptrs = h' \<turnstile> object_ptr_kinds_M \<rightarrow>\<^sub>r ?ptrs
[PROOF STEP]
have object_ptr_kinds_M_eq2_h3:
"|h3 \<turnstile> object_ptr_kinds_M|\<^sub>r = |h' \<turnstile> object_ptr_kinds_M|\<^sub>r"
[PROOF STATE]
proof (prove)
using this:
h3 \<turnstile> object_ptr_kinds_M \<rightarrow>\<^sub>r ?ptrs = h' \<turnstile> object_ptr_kinds_M \<rightarrow>\<^sub>r ?ptrs
goal (1 subgoal):
1. |h3 \<turnstile> object_ptr_kinds_M|\<^sub>r = |h' \<turnstile> object_ptr_kinds_M|\<^sub>r
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
|h3 \<turnstile> object_ptr_kinds_M|\<^sub>r = |h' \<turnstile> object_ptr_kinds_M|\<^sub>r
goal (1 subgoal):
1. is_strongly_scdom_component_safe ({ptr, cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r node} \<union> (case child of None \<Rightarrow> {} | Some ref \<Rightarrow> {cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r ref})) {} h h'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
|h3 \<turnstile> object_ptr_kinds_M|\<^sub>r = |h' \<turnstile> object_ptr_kinds_M|\<^sub>r
[PROOF STEP]
have node_ptr_kinds_eq2_h3: "|h3 \<turnstile> node_ptr_kinds_M|\<^sub>r = |h' \<turnstile> node_ptr_kinds_M|\<^sub>r"
[PROOF STATE]
proof (prove)
using this:
|h3 \<turnstile> object_ptr_kinds_M|\<^sub>r = |h' \<turnstile> object_ptr_kinds_M|\<^sub>r
goal (1 subgoal):
1. |h3 \<turnstile> node_ptr_kinds_M|\<^sub>r = |h' \<turnstile> node_ptr_kinds_M|\<^sub>r
[PROOF STEP]
using node_ptr_kinds_M_eq
[PROOF STATE]
proof (prove)
using this:
|h3 \<turnstile> object_ptr_kinds_M|\<^sub>r = |h' \<turnstile> object_ptr_kinds_M|\<^sub>r
|?h \<turnstile> object_ptr_kinds_M|\<^sub>r = |?h' \<turnstile> object_ptr_kinds_M|\<^sub>r \<Longrightarrow> |?h \<turnstile> node_ptr_kinds_M|\<^sub>r = |?h' \<turnstile> node_ptr_kinds_M|\<^sub>r
goal (1 subgoal):
1. |h3 \<turnstile> node_ptr_kinds_M|\<^sub>r = |h' \<turnstile> node_ptr_kinds_M|\<^sub>r
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
|h3 \<turnstile> node_ptr_kinds_M|\<^sub>r = |h' \<turnstile> node_ptr_kinds_M|\<^sub>r
goal (1 subgoal):
1. is_strongly_scdom_component_safe ({ptr, cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r node} \<union> (case child of None \<Rightarrow> {} | Some ref \<Rightarrow> {cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r ref})) {} h h'
[PROOF STEP]
have document_ptr_kinds_eq2_h3: "|h3 \<turnstile> document_ptr_kinds_M|\<^sub>r = |h' \<turnstile> document_ptr_kinds_M|\<^sub>r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. |h3 \<turnstile> document_ptr_kinds_M|\<^sub>r = |h' \<turnstile> document_ptr_kinds_M|\<^sub>r
[PROOF STEP]
using object_ptr_kinds_M_eq2_h3 document_ptr_kinds_M_eq
[PROOF STATE]
proof (prove)
using this:
|h3 \<turnstile> object_ptr_kinds_M|\<^sub>r = |h' \<turnstile> object_ptr_kinds_M|\<^sub>r
|?h \<turnstile> object_ptr_kinds_M|\<^sub>r = |?h' \<turnstile> object_ptr_kinds_M|\<^sub>r \<Longrightarrow> |?h \<turnstile> document_ptr_kinds_M|\<^sub>r = |?h' \<turnstile> document_ptr_kinds_M|\<^sub>r
goal (1 subgoal):
1. |h3 \<turnstile> document_ptr_kinds_M|\<^sub>r = |h' \<turnstile> document_ptr_kinds_M|\<^sub>r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
|h3 \<turnstile> document_ptr_kinds_M|\<^sub>r = |h' \<turnstile> document_ptr_kinds_M|\<^sub>r
goal (1 subgoal):
1. is_strongly_scdom_component_safe ({ptr, cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r node} \<union> (case child of None \<Rightarrow> {} | Some ref \<Rightarrow> {cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r ref})) {} h h'
[PROOF STEP]
have "object_ptr_kinds h = object_ptr_kinds h'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. object_ptr_kinds h = object_ptr_kinds h'
[PROOF STEP]
by (simp add: object_ptr_kinds_M_eq3_h object_ptr_kinds_M_eq3_h' object_ptr_kinds_M_eq3_h2)
[PROOF STATE]
proof (state)
this:
object_ptr_kinds h = object_ptr_kinds h'
goal (1 subgoal):
1. is_strongly_scdom_component_safe ({ptr, cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r node} \<union> (case child of None \<Rightarrow> {} | Some ref \<Rightarrow> {cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r ref})) {} h h'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
object_ptr_kinds h = object_ptr_kinds h'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
object_ptr_kinds h = object_ptr_kinds h'
goal (1 subgoal):
1. is_strongly_scdom_component_safe ({ptr, cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r node} \<union> (case child of None \<Rightarrow> {} | Some ref \<Rightarrow> {cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r ref})) {} h h'
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
object_ptr_kinds h = object_ptr_kinds h'
heap_is_wellformed h
type_wf h
known_ptrs h
h \<turnstile> insert_before ptr node child \<rightarrow>\<^sub>h h'
goal (1 subgoal):
1. is_strongly_scdom_component_safe ({ptr, cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r node} \<union> (case child of None \<Rightarrow> {} | Some ref \<Rightarrow> {cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r ref})) {} h h'
[PROOF STEP]
apply(auto simp add: is_strongly_scdom_component_safe_def)[1]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<And>outside_ptr. \<lbrakk>object_ptr_kinds h = object_ptr_kinds h'; heap_is_wellformed h; type_wf h; known_ptrs h; h \<turnstile> insert_before ptr node child \<rightarrow>\<^sub>h h'; outside_ptr |\<in>| object_ptr_kinds h'; \<not> preserved (get_M\<^sub>O\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t outside_ptr id) h h'; outside_ptr \<notin> set |h \<turnstile> local.a_get_scdom_component ptr|\<^sub>r; \<forall>x\<in>case child of None \<Rightarrow> {} | Some ref \<Rightarrow> {cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r ref}. outside_ptr \<notin> set |h \<turnstile> local.a_get_scdom_component x|\<^sub>r\<rbrakk> \<Longrightarrow> outside_ptr \<in> set |h \<turnstile> local.a_get_scdom_component (cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r node)|\<^sub>r
[PROOF STEP]
using insert_before_is_strongly_dom_component_safe_step local.get_scdom_component_impl
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>heap_is_wellformed ?h; type_wf ?h; known_ptrs ?h; ?h \<turnstile> insert_before ?ptr' ?child ?ref \<rightarrow>\<^sub>h ?h'; ?ptr \<notin> set |?h \<turnstile> get_scdom_component ?ptr'|\<^sub>r; ?ptr \<notin> set |?h \<turnstile> get_scdom_component (cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r ?child)|\<^sub>r\<rbrakk> \<Longrightarrow> preserved (get_M\<^sub>O\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t ?ptr ?getter) ?h ?h'
get_scdom_component = local.a_get_scdom_component
goal (1 subgoal):
1. \<And>outside_ptr. \<lbrakk>object_ptr_kinds h = object_ptr_kinds h'; heap_is_wellformed h; type_wf h; known_ptrs h; h \<turnstile> insert_before ptr node child \<rightarrow>\<^sub>h h'; outside_ptr |\<in>| object_ptr_kinds h'; \<not> preserved (get_M\<^sub>O\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t outside_ptr id) h h'; outside_ptr \<notin> set |h \<turnstile> local.a_get_scdom_component ptr|\<^sub>r; \<forall>x\<in>case child of None \<Rightarrow> {} | Some ref \<Rightarrow> {cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r ref}. outside_ptr \<notin> set |h \<turnstile> local.a_get_scdom_component x|\<^sub>r\<rbrakk> \<Longrightarrow> outside_ptr \<in> set |h \<turnstile> local.a_get_scdom_component (cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r node)|\<^sub>r
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
is_strongly_scdom_component_safe ({ptr, cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r node} \<union> (case child of None \<Rightarrow> {} | Some ref \<Rightarrow> {cast\<^sub>n\<^sub>o\<^sub>d\<^sub>e\<^sub>_\<^sub>p\<^sub>t\<^sub>r\<^sub>2\<^sub>o\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t\<^sub>_\<^sub>p\<^sub>t\<^sub>r ref})) {} h h'
goal:
No subgoals!
[PROOF STEP]
qed |
If $f$ converges to $l$ in $X$, then $l$ is in the topological space $X$. |
/- Author: E.W.Ayers
This should be in mathlib. Some simp and extensionality lemmas for comma and over. -/
import category_theory.comma
namespace category_theory
section
universes v₁ v₂ v₃ u₁ u₂ u₃ -- declare the `v`'s first; see `category_theory.category` for an explanation
variables {A : Type u₁} [𝒜 : category.{v₁} A]
variables {B : Type u₂} [ℬ : category.{v₂} B]
variables {T : Type u₃} [𝒯 : category.{v₃} T]
include 𝒜 ℬ 𝒯
variables {L : A ⥤ T} {R : B ⥤ T}
lemma comma.ext : Π {l₁ l₂ : comma L R} (pl : l₁.left = l₂.left) (pr : l₁.right = l₂.right) (pf : l₁.hom == l₂.hom), l₁ = l₂ :=
begin
rintros ⟨_,_,_⟩ ⟨_,_,_⟩ pl pr pf, cases pl, cases pr, cases pf, refl,
end
end
section
open over
universes u v
variables {C : Type u} [𝒞 : category.{v} C] {X : C}
include 𝒞
@[ext] lemma over.ext : Π {o₁ o₂ : over X} (px : o₁.left = o₂.left) (p : o₁.hom == o₂.hom), o₁ = o₂ :=
begin
intros _ _ _ _,
apply comma.ext,
assumption,
rw over.over_right, rw over.over_right,
assumption
end
@[simp] lemma over.mk_hom_id {f : over X} : over.mk(f.hom) = f :=
begin ext, refl, refl, end
end
end category_theory |
Formal statement is: lemma bounded_subset_ballI: "S \<subseteq> ball x r \<Longrightarrow> bounded S" Informal statement is: If $S$ is a subset of the ball of radius $r$ centered at $x$, then $S$ is bounded. |
[STATEMENT]
lemma deriv_no_occurrence:
"x \<notin> atoms r \<Longrightarrow> nderiv x r = Zero"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. x \<notin> atoms r \<Longrightarrow> nderiv x r = Zero
[PROOF STEP]
by (induction r) auto |
5 is polymeric , whereas SbCl
|
[STATEMENT]
lemma codomains_simp:
assumes "arr f"
shows "codomains f = {cod f}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. codomains f = {cod f}
[PROOF STEP]
using assms cod_in_codomains has_codomain_iff_arr codomain_unique
[PROOF STATE]
proof (prove)
using this:
arr f
codomains ?f \<noteq> {} \<Longrightarrow> cod ?f \<in> codomains ?f
(codomains ?f \<noteq> {}) = arr ?f
\<lbrakk>?b \<in> codomains ?f; ?b' \<in> codomains ?f\<rbrakk> \<Longrightarrow> ?b = ?b'
goal (1 subgoal):
1. codomains f = {cod f}
[PROOF STEP]
by auto |
The air is sharp, cold, and biting.
And step out into the early morning air.
White clouds forming in the air above.
Awakening me to a thousand possibilities.
His presence in this present white of snow.
And now an angel lies gentle in the snow.
Crisp, clean, and cleansing to my body, mind, and soul.
In this canopy of cold. |
import turbpy.multiConst as mc
import numpy as np
def bulkRichardson(airTemp, # air temperature (K)
sfcTemp, # surface temperature (K)
windspd, # wind speed (m s-1)
mHeight, # measurement height (m)
):
# -------------------------------------------------------------------------------------------------------
# Local variables
if np.max(airTemp) < 200:
airTemp = airTemp + 273.15
if np.max(sfcTemp) < 200:
sfcTemp = sfcTemp + 273.15
T_grad = airTemp - sfcTemp
T_mean = 0.5 * (airTemp + sfcTemp)
RiMult = (mc.gravity * mHeight) / (windspd**2.)
# compute the Richardson number
RiBulk = (T_grad / T_mean) * RiMult
return (RiBulk) # bulk Richardson number (-)
|
import .set .list
namespace cat
universes u v
class has_hom (obj : Type u) : Type (max u (v + 1)) :=
(hom : obj → obj → Type v)
infixr ` ⟶ `:10 := has_hom.hom -- type as \h
@[inline] def hom (obj : Type u) [has_hom obj] (X : obj) (Y : obj) := @has_hom.hom obj _ X Y
class has_id_comp (obj : Type u) extends has_hom obj :=
(id : Π {X : obj}, X ⟶ X)
(comp : Π {X Y Z : obj}, (X ⟶ Y) → (Y⟶ Z) → (X ⟶Z))
@[inline] def comp (obj : Type u) [has_id_comp obj] {X Y Z : obj} := @has_id_comp.comp obj _ X Y Z
@[reducible] def has_id_comp_id {obj : Type u} [has_id_comp obj] {X : obj} : X ⟶ X := has_id_comp.id obj
@[reducible] def has_id_comp_id_exp {obj : Type u} [has_id_comp obj] (X : obj) : X ⟶ X := has_id_comp.id obj
notation `𝟙` := has_id_comp_id -- type as \b1
notation `𝟙_`X := has_id_comp_id_exp X -- type as \b1
infixr ` ≫ `:80 := has_id_comp.comp -- type as \gg
class category (obj : Type u) extends has_id_comp obj :=
-- (hom : obj → obj → Type v)
-- (id : Π X : obj, hom X X)
-- (comp : Π {X Y Z : obj}, hom X Y → hom Y Z → hom X Z)
(id_comp : ∀ {X Y : obj} (f : X ⟶ Y), 𝟙 ≫ f = f)
(comp_id : ∀ {X Y : obj} (f : X ⟶ Y), f ≫ 𝟙 = f)
(assoc : ∀ {W X Y Z : obj} (f : W ⟶ X) (g : X ⟶ Y) (h : Y ⟶ Z), (f ≫ g) ≫ h = f ≫ (g ≫ h))
attribute [simp] category.id_comp category.comp_id category.assoc
universes u₁ v₁ u₂ v₂ u₃ v₃ u₄ v₄
section iso_epi_mono
variables {C : Type u₁} [𝒞 : category.{u₁ v₁} C] {X Y Z : C}
include 𝒞
def is_epic (f : X ⟶ Y) := ∀ (g₁ g₂ : Y ⟶ Z), f ≫ g₁ = f ≫ g₂ → g₁ = g₂
def is_monic (f : Y ⟶ Z) := ∀ (g₁ g₂ : X ⟶ Y), g₁ ≫ f = g₂ ≫ f → g₁ = g₂
-- idea: make constructive?
def is_iso (f : X ⟶ Y) := ∃ (g : Y ⟶ X), f ≫ g = 𝟙 ∧ g ≫ f = 𝟙
structure iso (X Y : C) :=
(f : X ⟶ Y)
(g : Y ⟶ X)
(fg_id : f ≫ g = 𝟙)
(gf_id : g ≫ f = 𝟙)
infixr ` ⟷ ` :10 := iso
instance : has_coe (@iso C 𝒞 X Y) (X ⟶ Y) := ⟨λ x, x.f⟩
end iso_epi_mono
section
structure functor (C : Type u₁) [category.{u₁ v₁} C] (D : Type u₂) [category.{u₂ v₂} D] : Type (max u₁ v₁ u₂ v₂) :=
(obj : C → D)
(map : Π {X Y : C}, (X ⟶ Y) → ((obj X) ⟶ (obj Y)))
(map_id : ∀ (X : C), map (𝟙 : X ⟶ X) = 𝟙)
(map_comp : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z), map (f ≫ g) = (map f) ≫ (map g))
attribute [simp] functor.map_id functor.map_comp
infixr ` ⥤ `:70 := functor -- type as \func --
instance {C : Type u₁} [category.{u₁ v₁} C] {D : Type u₂} [category.{u₂ v₂} D] : has_coe_to_fun (C ⥤ D) :=
{ F := λ F, C → D,
coe := λ F, F.obj }
end
lemma functor.ext
{C : Type u₁} [category.{u₁ v₁} C] {D : Type u₂} [category.{u₂ v₂} D] :
Π {F G : C ⥤ D}
(oe : F.obj = G.obj)
(me : ((eq.rec_on oe F.map) : Π {X Y : C}, (X ⟶ Y) → ((G.obj X) ⟶ (G.obj Y))) = G.map), F = G
|⟨o,m,_,_⟩ ⟨_,_,_,_⟩ rfl rfl := rfl
namespace functor
section
variables {C : Type u₁} [𝒞 : category.{u₁ v₁} C]
{D : Type u₂} [𝒟 : category.{u₂ v₂} D]
include 𝒞 𝒟
--@[simp] lemma functor_map_id {F : C ⥤ D} {X : C} : F.map (𝟙 X) = 𝟙 (F.obj X) := F.map_id _
variables {E : Type u₃} [ℰ : category.{u₃ v₃} E]
include ℰ
/--
`F ⋙ G` is the composition of a functor `F` and a functor `G` (`F` first, then `G`).
-/
def comp
(F : C ⥤ D) (G : D ⥤ E) : C ⥤ E :=
{ obj := λ X, G (F X)
, map := λ _ _ f, G.map (F.map f)
, map_id := λ X,
calc G.map (F.map (𝟙 : X ⟶ X)) = G.map (𝟙) : by rw [F.map_id]
... = 𝟙 : by rw [G.map_id]
, map_comp := λ X Y Z f g, begin simp [functor.map_comp] end
}
infixr ` ⋙ `:80 := functor.comp
@[simp] lemma comp_obj_expand {F : C ⥤ D} {G : D ⥤ E} {X : C} : (F ⋙ G).obj X = G.obj (F.obj X) := rfl
@[simp] lemma comp_map_expand {F : C ⥤ D} {G : D ⥤ E} {X Y : C} {f : X ⟶ Y}: (F ⋙ G).map f = G.map (F.map f)
:= begin refl end
end
def id (C : Type u₁) [𝒞 : category.{u₁ v₁} C] : C ⥤ C :=
{ obj := λ X, X
, map := λ _ _ f, f
, map_id := λ X, rfl
, map_comp := λ X Y Z f g, rfl
}
@[simp] lemma id_obj_expand (C : Type u₁) [𝒞 : category.{u₁ v₁} C] {X : C} : (functor.id C).obj X = X := rfl
@[simp] lemma id_map_expand (C : Type u₁) [𝒞 : category.{u₁ v₁} C] {X Y : C} {f : X ⟶ Y} : (functor.id C).map f = f := rfl
lemma comp_id
{C : Type u₁} [𝒞 : category.{u₁ v₁} C]
{D : Type u₂} [𝒟 : category.{u₂ v₂} D]
: ∀ (F : C ⥤ D), (F ⋙ (functor.id D)) = F :=
λ F, begin apply functor.ext _ _, reflexivity, reflexivity end
lemma id_comp
{C : Type u₁} [𝒞 : category.{u₁ v₁} C]
{D : Type u₂} [𝒟 : category.{u₂ v₂} D]
: ∀ (F : C ⥤ D), ((functor.id C)⋙F) = F :=
λ F, begin apply functor.ext _ _, reflexivity, reflexivity end
lemma assoc
{C₁ : Type u₁} [𝒞₁ : category.{u₁ v₁} C₁]
{C₂ : Type u₂} [𝒞₂ : category.{u₂ v₂} C₂]
{C₃ : Type u₃} [𝒞₃ : category.{u₃ v₃} C₃]
{C₄ : Type u₄} [𝒞₄ : category.{u₄ v₄} C₄]
: ∀ (F₁₂ : C₁ ⥤ C₂) (F₂₃ : C₂ ⥤ C₃) (F₃₄ : C₃ ⥤ C₄), F₁₂ ⋙ (F₂₃ ⋙ F₃₄) = (F₁₂ ⋙ F₂₃) ⋙ F₃₄ :=
begin intros, apply functor.ext _ _, reflexivity, reflexivity end
end functor
open functor
/-- The category of small categories -/
structure Cat : Type (max (u+1) (v+1)) :=
(ob : Type u) [cat : category.{u v} ob]
instance (𝒞 : Cat) : category (𝒞.ob) := 𝒞.cat
instance Cat_is_category : category.{(max (u+1) (v+1)) (max u v)} Cat :=
{ hom := λ 𝒞 𝒟, 𝒞.ob ⥤ 𝒟.ob
, id := λ 𝒞, functor.id 𝒞.ob
, comp := λ 𝒞 𝒟 ℰ F G, F ⋙ G
, id_comp := λ 𝒞 𝒟 F, functor.id_comp _
, comp_id := λ 𝒞 𝒟 F, functor.comp_id _
, assoc := begin intros, apply functor.assoc end
}
structure nat_trans
{C : Type u₁} {D : Type u₂} [category.{u₁ v₁} C] [category.{u₂ v₂} D]
(F G : C ⥤ D) : Type (max u₁ v₂) :=
(app : Π X : C, (F.obj X) ⟶ (G.obj X))
(naturality : ∀ {X Y : C} (f : X ⟶ Y), (F.map f) ≫ (app Y) = (app X) ≫ (G.map f))
attribute [simp] nat_trans.naturality
infixr ` ⟹ `:50 := nat_trans -- type as \==> or ⟹
namespace nat_trans
variables {C : Type u₁} {D : Type u₂} [𝒞 : category.{u₁ v₁} C] [𝒟 : category.{u₂ v₂} D]
variables {F G H I : C ⥤ D}
include 𝒞 𝒟
instance : has_coe_to_fun (F ⟹ G) :=
{ F := λ _, Π X:C, F X ⟶ G X, coe := λ τ, τ.app}
lemma ext : ∀ {τ σ : F ⟹ G} (p : τ.app = σ.app), τ = σ
|⟨a,_⟩ ⟨_,_⟩ rfl := rfl
def id : F ⟹ F :=
{ app := λ X, 𝟙_(F.obj X)
, naturality := λ X Y f, by simp
}
@[simp] lemma reduce_id {X : C} : nat_trans.id.app X = 𝟙_(F.obj X) := rfl
def vcomp (α : F ⟹ G) (β : G ⟹ H) : F ⟹ H :=
{app := λ X, α.app X ≫ β.app X
, naturality := begin intros, rw [<-category.assoc], rw [naturality], simp end
}
notation α ` ⊟ ` β:80 := vcomp α β -- I usually just use ≫
instance Hom_is_category : category.{(max u₁ v₁ u₂ v₂) (max u₁ v₂)} (C ⥤ D) :=
{ hom := λ F G, F ⟹ G
, id := λ F, nat_trans.id
, comp := λ F G H α β, vcomp α β
, id_comp := begin intros, apply ext, simp[vcomp, id]end
, comp_id := begin intros, apply ext, simp[vcomp, id]end
, assoc := begin intros, apply ext, simp [vcomp] end
}
@[simp] lemma vcomp_reduce {α : F ⟹ G} {β : G ⟹ H} : (α ⊟ β).app = λ X, (α.app X)≫ (β.app X) := rfl
@[simp] lemma nat_trans_comp_reduce {α : F ⟶ G} {β : G ⟶ H} : (α ≫ β).app = λ X, (α.app X)≫ (β.app X) := rfl
@[simp] lemma nat_trans_id_reduce : (𝟙 : F ⟶ F).app = λ X, 𝟙 := rfl
def hcomp
{E : Type u₃} [category.{u₃ v₃} E]
{I J : D ⥤ E}
(α : F ⟹ G) (β : I ⟹ J) : (F ⋙ I) ⟹ (G ⋙ J) :=
{ app := λ X, I.map (α.app X) ≫ β.app (G.obj X)
, naturality := begin intros, simp, rw [<-category.assoc], rw [naturality], rw [category.assoc], rw [<-functor.map_comp], rw [naturality], rw [functor.map_comp] end
}
notation α `◫` β : 80 := hcomp α β
/- [TODO]
- [ ] whiskering
- [ ] hcomp makes Cat a 2-category.
-/
end nat_trans
open nat_trans
section product
variables {C : Type u₁} {D : Type u₂} [𝒞 : category.{u₁ v₁} C] [𝒟 : category.{u₂ v₂} D]
include 𝒞 𝒟
instance product_is_cat
: category.{(max u₁ u₂) (max v₁ v₂)} (C × D) :=
{ hom := λ x y, (x.1 ⟶ y.1) × (x.2 ⟶ y.2)
, id := λ p, ⟨𝟙, 𝟙⟩
, comp := λ x y z f g, ⟨f.1 ≫ g.1, f.2 ≫ g.2⟩
, id_comp := begin intros, simp end
, comp_id := begin intros, simp end
, assoc := begin intros, simp end
}
attribute [reducible] cat.product_is_cat
variables {X : C × D}
--@[simp] lemma product_id_fst : (𝟙_X).1 = 𝟙_(X.1) :=
@[simp] lemma product_id : (𝟙_X) = (𝟙_X.fst, 𝟙_X.snd) := rfl
@[simp] lemma product_comp_fst
{X Y Z: C × D} {f : X ⟶ Y} {g : Y ⟶ Z} : (f ≫ g).fst = f.fst ≫ g.fst := rfl
@[simp] lemma product_comp_snd
{X Y Z: C × D} {f : X ⟶ Y} {g : Y ⟶ Z} : (f ≫ g).snd = f.snd ≫ g.snd := rfl
attribute [simp] cat.product_is_cat
def fst_functor : (C × D) ⥤ C :=
{obj := λ P, P.1, map := λ P Q f, f.1, map_id := λ P, rfl, map_comp := λ P Q R f g , rfl}
end product
section product_coe
variables {C₁ : Type u₁} [𝒞₁ : category.{u₁ v₁} C₁]
{C₂ : Type u₂} [𝒞₂ : category.{u₂ v₂} C₂]
{C₃ : Type u₃} [𝒞₃ : category.{u₃ v₃} C₃]
{C₄ : Type u₄} [𝒞₄ : category.{u₄ v₄} C₄]
include 𝒞₁ 𝒞₂ 𝒞₃ 𝒞₄
def prod_functor_of_functor_prod : ((C₁ ⥤ C₂) × (C₃ ⥤ C₄)) → ((C₁ × C₃) ⥤ (C₂ × C₄)) :=λ F, {
obj := λ p, (F.1.obj p.1, F.2.obj p.2)
, map := λ P Q p, (F.1.map p.1,F.2.map p.2)
, map_id := λ P, begin simp end
, map_comp := begin intros, simp end
}
instance functor_prod
: has_coe ((C₁ ⥤ C₂) × (C₃ ⥤ C₄)) ((C₁ × C₃) ⥤ (C₂ × C₄)) := ⟨prod_functor_of_functor_prod⟩
end product_coe
section product_adj
variables {C : Type u₁} [𝒞 : category.{u₁ v₁} C]
{D : Type u₂} [𝒟 : category.{u₂ v₂} D]
{E : Type u₃} [ℰ : category.{u₃ v₃} E]
include 𝒞 𝒟 ℰ
def product_adj : (C × D) ⥤ E → C ⥤ (D ⥤ E) := λ F,
{ obj := λ c,
{ obj := λ d, F.obj ⟨c,d⟩
, map := λ d₁ d₂ f, F.map (𝟙, f)
, map_id := λ d, begin rw [<-functor.map_id] end
, map_comp := λ d₁ d₂ d₃ f g, begin rw [<-functor.map_comp], apply congr_arg, simp end
}
, map := λ c₁ c₂ f, nat_trans.mk (λ d, F.map ⟨f, 𝟙⟩)
begin intros d₁ d₂ g, simp [functor.map], rw [<-functor.map_comp], rw [<-functor.map_comp], simp end
, map_id := λ c, nat_trans.ext $ funext $ λ d,
show F.map (𝟙 : (c,d) ⟶ (c,d)) = 𝟙_(F.obj (c, d)), by simp
, map_comp := λ c₁ c₂ c₃ f g, nat_trans.ext $ funext $ λ d,
show F.map ((f ≫ g, 𝟙) : (c₁,d) ⟶ (c₃,d)) = F.map ((f, 𝟙): (c₁,d) ⟶ (c₂,d)) ≫ F.map (g, 𝟙),
begin rw <- functor.map_comp, apply congr_arg, simp end
}
end product_adj
section op
def op (C : Type*) := C
variables {C : Type u₁} [𝒞 :category.{u₁ v₁} C]
include 𝒞
instance op_is_cat : category.{u₁ v₁} (op C) :=
{ hom := λ X Y, @hom C (𝒞.to_has_hom) Y X -- just to make sure it's using the correct one
, id := @has_id_comp.id C _
, comp := λ X Y Z f g, @has_id_comp.comp C _ _ _ _ g f
, id_comp := begin intros, simp end
, comp_id := begin intros, simp end
, assoc := begin intros, simp end
}
#check @cat.op_is_cat
attribute [simp] op
attribute [simp] cat.op_is_cat
notation C `ᵒᵖ` := op C
@[inline] def hom_of_op_hom {X Y : op C} : hom (op C) X Y → hom C Y X := λ f, f
@[inline] def op_hom_of_hom {X Y : op C} : hom (C) X Y → hom (op C) Y X := λ f, f
@[simp] lemma op_hom_elim {Y X : op C} :
hom (op C) X Y = hom C Y X := rfl
@[simp] lemma op_comp
{Z Y X : op C} {f : hom (op C) X Y} {g : hom (op C) Y Z}:
(@has_id_comp.comp (op C) _ _ _ _ f g) = @has_id_comp.comp C _ Z Y X (@hom_of_op_hom C _ Y Z g) (@hom_of_op_hom C _ X Y f) := rfl
variables {D : Type u₂} [𝒟 :category.{u₂ v₂} D]
include 𝒟
def functor_op (F : C ⥤ D) : Cᵒᵖ ⥤ (Dᵒᵖ) :=
{ obj := λ c, F.obj c
, map := λ X Y f, F.map (f : hom C Y X)
, map_id := begin intros, apply functor.map_id end
, map_comp := begin intros, apply functor.map_comp end
}
notation F`ᵒᵖ` := functor_op F
end op
section unit
instance unit_is_cat : category (unit) :=
{ hom := λ X Y, unit
, id := λ X, ⟨⟩
, comp := λ _ _ _ _ _, ⟨⟩
, id_comp := begin intros, cases f, refl end
, comp_id := begin intros, cases f, refl end
, assoc := begin intros, cases f, cases g, cases h, refl end
}
inductive equaliser_shape : Type |A|B
inductive span_shape : Type |L | M | R
end unit
instance Sort_is_cat : category.{(u+1) (u)} (Type u) :=
{ hom := λ X Y, X → Y
, id := λ X x, x
, comp := λ X Y Z f g x, g (f x)
, id_comp := λ X Y f, rfl
, comp_id := λ X Y f, rfl
, assoc := λ X Y Z W f g h, rfl
}
@[simp] lemma Sort_is_cat_id {α : Type u} : (𝟙_α) = id := by refl
@[simp] lemma Sort_is_cat_comp {α β γ : Type u} {f : α ⟶ β} {g : β ⟶ γ} : (f ≫ g) = g ∘ f := by refl
def Hom {C : Type u} [𝒞 : category.{u v} C] : ((C ᵒᵖ) × C) ⥤ Type v :=
{ obj := λ P, hom C P.1 P.2
, map := λ P Q fg (p), fg.1 ≫ p ≫ fg.2
, map_id := begin intros, funext, simp, apply category.id_comp end
, map_comp := begin intros, funext, simp, refl end
}
section comma
variables {C : Type u₁} [𝒞 : category.{u₁ v₁} C]
{D : Type u₂} [𝒟 : category.{u₂ v₂} D]
{E : Type u₃} [ℰ : category.{u₃ v₃} E]
include 𝒞 𝒟 ℰ
structure comma (F : C ⥤ E) (G : D ⥤ E) :=
(o1 : C) (o2 : D) (f : F o1 ⟶ G o2)
variables {F : C ⥤ E} {G : D ⥤ E}
structure comma_hom (X Y : comma F G) :=
(g1 : X.o1 ⟶ Y.o1)
(g2 : X.o2 ⟶ Y.o2)
(nat : F.map g1 ≫ Y.f = X.f ≫ G.map g2)
def comma_hom.ext {X Y : comma F G} : Π {f g : comma_hom X Y}, f.g1 = g.g1 → f.g2 = g.g2 → f = g
|⟨g1,g2,_⟩ ⟨_,_,_⟩ rfl rfl := rfl
attribute [simp] comma_hom.nat
instance comma.category : category (comma F G) :=
{ hom := λ X Y, comma_hom X Y
, id := λ X, comma_hom.mk (𝟙) (𝟙) (by simp)
, comp := λ X Y Z a b, ⟨a.g1 ≫ b.g1, a.g2 ≫ b.g2, begin simp, rw [<-category.assoc, comma_hom.nat], simp end⟩
, id_comp := begin intros, simp, apply comma_hom.ext, simp end
, comp_id := begin intros, simp, apply comma_hom.ext, simp end
, assoc := begin intros, apply comma_hom.ext, simp, simp end
}
end comma
section slice
def slice (C : Type u₁) [category.{u₁ v₁} C] (Y : C) := Σ X : C, X ⟶ Y
variables {C : Type u₁} [𝒞 : category.{u₁ v₁} C] {X Y : C}
include 𝒞
notation C `/` X := slice C X
instance slice.category : category (C / Y) :=
{ hom := λ A B, {f : A.1 ⟶ B.1 // f ≫ B.2 = A.2}
, id := λ A, ⟨𝟙_A.1, by simp⟩
, comp := λ f g h p q, ⟨p.1 ≫ q.1, by simp [p.2,q.2]⟩
, id_comp := begin intros, simp end
, comp_id := begin intros, simp end
, assoc := begin intros, simp end
}
--@[simp] lemma slice.category_id {f : C / Y} : (@category.id (C / Y) _ f).1 = 𝟙 (f.1) := rfl
--@[simp] lemma slice.category_comp {f g h : C / Y} {p : f ⟶ g} {q : g ⟶ h} : (p ≫ q).1 = p.1 ≫ q.1 := rfl
def slice.forget : C / X ⥤ C :=
{ obj := λ f, f.1
, map := λ f g p, p.1
, map_id := begin intros, refl end
, map_comp := begin intros, refl end
}
end slice
section adjoint
variables {C : Type u₁} {D : Type u₂} [𝒞 : category.{u₁ v₁} C] [𝒟 :category.{u₂ v₂} D]
include 𝒞 𝒟
class adjunction
(L : C ⥤ D) (R : D ⥤ C) :=
(unit : functor.id C ⟹ (L ⋙ R))
(counit : (R ⋙ L) ⟹ functor.id D)
(triangle_1 : ∀ X : D, (unit (R X)) ≫ (R.map (counit X)) = 𝟙_(R X))
(triangle_2 : ∀ X : C, (L.map (unit X)) ≫ (counit (L X)) = 𝟙_(L X))
attribute [simp] adjunction.triangle_1 adjunction.triangle_2
--def adjunction_alt (L : C ⥤ D) (R : D ⥤ C) := -- [ERROR] This only works in small categories?
-- ((Lᵒᵖ, D) ⋙ Hom) ⟷ ((Cᵒᵖ, D) ⋙ Hom) -- It would be great if the parser could figure this out!
infixr ` ⊣ `:70 := adjunction
variables {L : C ⥤ D} {R : D ⥤ C} [L ⊣ R] {c : C} {d : D}
/--Shorthand for unit of adjoint -/
def adjunction.μ := adjunction.unit L R c
/-- Shorthand for counit of adjoint -/
def adjunction.ε := adjunction.counit L R d
open adjunction
def adjunction.φ : (c ⟶ R d) → (L c ⟶ d) := λ f, (L.map f) ≫ ε
def adjunction.ψ : (L c ⟶ d) → (c ⟶ R d) := λ g, μ ≫ (R.map g)
-- [TODO] show they are isos.
end adjoint
section alternative_adjoint
-- another definition. In theory this one should be pithier but you have to hold the elaborator's hand.
def adj_alt {C D : Type u} [𝒞 : category.{u v} C] [𝒟 : category.{u v} D] (L : C ⥤ D) (R : D ⥤ C)
:=
-- ((Lᵒᵖ, D) ⋙ Hom) ⟷ ((Cᵒᵖ, D) ⋙ Hom) -- It would be great if the parser could figure this out!
have L3 : (((Cᵒᵖ) × D) ⥤ (Type v)) := @functor.comp ((Cᵒᵖ) × D) _ ((Dᵒᵖ) × D) _ (Type v) _ (Lᵒᵖ,functor.id D) (@Hom D 𝒟),
have L4 : (((Cᵒᵖ) × D) ⥤ (Type v)) := @functor.comp ((Cᵒᵖ) × D) _ ((Cᵒᵖ) × C) _ (Type v) _ (functor.id (Cᵒᵖ), R) (@Hom C 𝒞),
have category (((Cᵒᵖ) × D) ⥤ (Type v)) := begin apply @nat_trans.Hom_is_category end,
@iso _ this L3 L4
-- [ERROR] the elaborator can't figure out that ((Cᵒᵖ) × D) ⥤ (Type v) is a category.
-- def adj_of_adj_alt {C D : Type u} [𝒞 : category.{u v} C] [𝒟 : category.{u v} D] {L : C ⥤ D}{R : D ⥤ C}
-- : adj_alt L R → adjunction L R := λ i,
-- { unit := {app := λ X,
-- begin cases i with φ ψ h₁ h₂, simp * at *, simp [has_hom.hom] at φ,
-- have φa : (L.obj X ⟶ L.obj X) → (X ⟶ R.obj (L.obj X)),
-- apply @nat_trans.app,
-- have φa := φ.app (X, L.obj X), end /- i.g.app (X,L.obj X) 𝟙 -/, naturality := sorry}
-- , counit := {app := λ X, i.f.app (R.obj X, X) 𝟙, naturality := sorry}
-- , triangle_1 := sorry
-- , triangle_2 := sorry
-- }
end alternative_adjoint
section simple_limits
variables {C : Type u₁} [𝒞 : category.{u₁ v₁} C] {X Y Z: C}
include 𝒞
notation X` ⇉ ` Y := (X ⟶ Y) × (X ⟶ Y)
structure initial :=
(O : C) (univ : ∀ (X : C), ∃! (o : O ⟶ X), true)
structure equaliser (p: X ⇉ Y) :=
(E : C) (e : E ⟶ X)
(same : e ≫ p.1 = e ≫ p.2)
(univ : ∀ (A : C) (f : A ⟶ X), (f ≫ p.1 = f ≫ p.2) → ∃! (k : A ⟶ E), k ≫ e = f)
structure pullback (f : X ⟶ Z) (g : Y ⟶ Z) :=
(L : C)
(π₁ : L ⟶ X)
(π₂ : L ⟶ Y)
(square : π₁ ≫ f = π₂ ≫ g)
(univ : ∀ (A : C) (a₁ : A ⟶ X) (a₂ : A ⟶ Y), (a₁ ≫ f) = (a₂ ≫ g) → ∃! (k : A ⟶ L), k ≫ π₁ = a₁ ∧ k ≫ π₂ = a₂)
-- COLIMITS. I am just going to copy out the definitions because using Cᵒᵖ is masochistic.
structure terminal :=
(I : C) (univ : ∀ (X : C), ∃! (i : X ⟶ I), true)
end simple_limits
section set_function_cat
/-- The category of functions on sets of α -/
instance cat_of_set {α : Type u} : category (set α) :=
{ hom := λ X Y, {x // x ∈ X} → {y // y ∈ Y}
, id := λ X x, x
, comp := λ X Y Z p q x, q $ p $ x
, comp_id := begin intros, simp end
, id_comp := begin intros, simp end
, assoc := begin intros, simp end
}
end set_function_cat
namespace free_cat
def free (α : Type u) [hh :has_hom.{u v} α] := α
variables {α : Type u} [hh : has_hom.{u v} α]
include hh
inductive fh : free α → free α → Type (max u v)
|basic {a b : free α} : (@has_hom.hom α hh a b) → fh a b
|id : Π {a}, fh a a
|comp {a b c : free α} : fh a b → fh b c → fh a c
open fh
local infix ` ⇢ ` :70 := fh
inductive hom_rel : Π {a b :free α}, (a ⇢ b) → fh a b → Prop
|comp_id {a b} {f : fh a b} : hom_rel (fh.comp f (id)) f
|id_comp {a b} {f : fh a b} : hom_rel (fh.comp id f) f
|assoc {a b c d} {f : fh a b} {g : fh b c} {h : fh c d} : hom_rel (fh.comp (fh.comp f g) h) (fh.comp f (fh.comp g h))
|refl {a b} {f : a ⇢ b} : hom_rel f f
|trans {a b} {f g h : a ⇢ b} : hom_rel f g → hom_rel g h → hom_rel f h
|symm {a b} {f g : a ⇢ b} : hom_rel f g → hom_rel g f
|congr {a b c} {f₁ f₂ : a ⇢ b} {g₁ g₂ : b ⇢ c} : hom_rel f₁ f₂ → hom_rel g₁ g₂ → hom_rel (fh.comp f₁ g₁) (fh.comp f₂ g₂) -- [?] do I actually need this one?
def fhs (a b: free α) : setoid (fh a b) :=
{ r := λ f g, hom_rel f g
, iseqv := ⟨λ f, hom_rel.refl,λ f g, hom_rel.symm,λ f g h, hom_rel.trans⟩
}
/-- The free category over some generating signature of homs. -/
instance free_is_category {α : Type u} [hh : has_hom.{u v} α]: category.{u (max u v)} (free α) :=
{ hom := λ a b, quotient $ fhs a b
, id := λ a, @quotient.mk (fh a a) (fhs a a) (@fh.id _ _ a)
, comp := λ a b c f g, @quotient.lift_on₂ _ _ _ (fhs a b) (fhs b c) f g (λ (f : a⇢b) (g:b⇢c), @quotient.mk _ (fhs a c) $ fh.comp f g)
$ λ a₁ a₂ b₁ b₂ ab₁ ab₂, @quotient.sound _ (fhs a c) _ _ $ hom_rel.congr ab₁ ab₂
--begin apply hom_rel.congr end
, id_comp := begin intros, induction f, apply quotient.sound, apply hom_rel.id_comp, refl end
, comp_id := begin intros, induction f, apply quotient.sound, apply hom_rel.comp_id, refl end
, assoc := begin intros, induction f, induction g, induction h, apply quotient.sound, apply hom_rel.assoc, repeat {refl} end
}
instance {a b : α} : has_coe (@has_hom.hom α hh a b) (@has_hom.hom (free α) (free_cat.free_is_category.to_has_hom) a b)
:= ⟨λ x, @quotient.mk _ (fhs a b) $ fh.basic $ x⟩
--export free [TODO] how to expose free?
end free_cat
namespace shape
/-- The category `∙→∙` of two objects and one arrow. -/
def two := set unit -- either ∅ or {*}
instance : category (two) := cat.cat_of_set
inductive span_sig |A | B | X
open span_sig
inductive span_hom : span_sig → span_sig → Type
|a : span_hom A X
|b : span_hom B X
instance : has_hom (span_sig) := ⟨λ Y Z, span_hom Y Z⟩
def span := free_cat.free (span_sig)
end shape
section limit
variables {J : Type u₁} [𝒥 : category.{u₁ v₁} J] {i j k: J} -- [TODO] non-small categories
variables {C : Type u₂} [𝒞 : category.{u₂ v₂} C] {X Y Z: C}
include 𝒥 𝒞
/-- The constant diagram functor. -/
@[reducible] def Δ : C ⥤ (J ⥤ C) :=
{ obj := λ X,
{ obj := λ i, X
, map := λ _ _ _, 𝟙
, map_id := λ j, rfl
, map_comp := by intros; simp
}
, map := λ X Y f,
{ app := λ _, f
, naturality := λ i j ij, by simp
}
, map_comp := begin intros, apply nat_trans.ext, simp end
, map_id := begin intros, apply nat_trans.ext, simp end
}
--@[simp] lemma wtf : (Δ.obj X: J ⥤ C) = {obj := λ i, X, map := λ i j ij, 𝟙 X, map_id := λ j, rfl, map_comp := by intros; simp} := begin refl end
-- @[simp] lemma Δ_def : (Δ : C ⥤ (J ⥤ C)) = product_adj (fst_functor) := rfl
@[simp] lemma Δ_obj :(Δ.obj X).obj j = X := rfl
@[simp] lemma Δ_map (ij : i ⟶ j) :(Δ.obj X).map ij = 𝟙 := rfl
/-- The limit functor for a particular shape J. This is inhabited when the limit exists for all diagrams. -/
class has_limits (J : Type u₁) [category.{u₁ v₁} J] (C : Type u₂) [category.{u₂ v₂} C]
:= (Lim : (J ⥤ C) ⥤ C) (Δ_adj_Lim : Δ ⊣ Lim)
structure cone (d : J ⥤ C) :=
(peak : C)
(legs : (Δ.obj peak) ⟶ d)
def is_limit {d : J ⥤ C} (c : cone d)
:= ∀ (A : C) (α : (Δ.obj A) ⟶ d), ∃! (e : A ⟶ c.peak), α = ((Δ.map e) ≫ c.legs)
section preserves_etc
variables {D : Type u₃} [𝒟 : category.{u₃ v₃} D]
include 𝒟
open has_limits
def map_cone {d : J ⥤ C} (F : C ⥤ D) (l : cone d) : cone (d ⋙ F) :=
{peak := F.obj l.peak
, legs :=
{ app := λ j, begin cases l with Lc πc, apply F.map, apply πc.app end
, naturality := begin intros i j ij, cases l, simp, rw [<-functor.map_comp, <-nat_trans.naturality], simp end
}}
variables (F : C ⥤ D) (d : J ⥤ C)
def preserves_limits := ∀ (l : cone d) (hl : is_limit l), is_limit (map_cone F l)
def reflects_limits := ∀ (l : cone d) (hl : is_limit (map_cone F l)), is_limit l
def creates_limits := ∀ (l : cone (d ⋙ F)), is_limit l → ∃ l' : cone d, l = map_cone F l'
end preserves_etc
end limit
section nat_cat
instance nat_is_category : category (nat) :=
{ hom := λ n m, {s:unit // n ≤ m}
, id := λ n, ⟨⟨⟩, by refl⟩
, comp := λ i j k f g, ⟨⟨⟩, begin cases f, cases g, transitivity, assumption, assumption end⟩
, id_comp:= λ i k ⟨⟨⟩,f⟩, rfl
, comp_id:= λ i k ⟨⟨⟩,f⟩, rfl
, assoc := λ i j k l ⟨⟨⟩,f⟩ ⟨⟨⟩,g⟩ ⟨⟨⟩,h⟩, rfl
}
end nat_cat
section simplicial
def simplex := nat
open nat
def simp_comp_aux : list nat → list nat → nat → list nat → list nat
|(0 :: t₁) t₂ n acc := simp_comp_aux t₁ t₂ 0 (n::acc)
|((succ h₁) :: t₁) (h₂::t₂) n acc :=
have h₁ < (succ h₁), begin apply lt_succ_of_le, apply le_of_eq, refl end,
simp_comp_aux (h₁::t₁) t₂ (n+h₂) acc
|_ _ n acc := acc
#eval simp_comp_aux [3,0,1] [2,2,1,2] 0 []
instance simplex_has_id_comp : has_id_comp simplex :=
{ hom := λ n m, {l : list nat // l.length = n ∧ list.foldr (+) 0 l = m}
, id := λ n, ⟨list.repeat 1 n, begin split, simp, induction n, simp, simp [n_ih] end⟩
, comp := λ i j k f g, ⟨list.reverse $ simp_comp_aux f g 0 [], begin cases f with f fp, cases g with g gp, simp, sorry end⟩
}
instance simplex_is_category : category (simplex) := {!!}
-- inductive shom : simplex → simplex → Type
-- |d {n} : (fin (succ (succ n))) → shom (succ n) n -- face maps
-- |s {n} : (fin (succ n)) → shom n (succ n) -- degeneracy maps.
-- |i {n} : shom n n
-- |c {i j k} : shom i j → shom j k → shom i k
-- open shom
-- inductive srel {n m : simplex} : shom n m → shom n m → Prop
-- |r1 {n i j}: i < j → srel (c (d i) (d (succ j))) (c (d j) (d i))
-- |r2 {n i j} : i ≤ j → srel (c (s i) (s j)) (c (s (succ j)) (s i))
-- |r3 {n i j} : i < j → srel (c (d (i) (succ j))) (c (s j) (d i))
-- |r4 {n i j} : i = j → srel (c (d (i) (j))) shom.i
-- |r5 {n i j} : i = j + 1 : srel (c (d (succ i) (j))) (c (s j) (d i))
end simplicial
/- [TODO] ideas for wasting time.
Sieves and Grotendiek Topologies
-/
end cat |
lemma closed_Un_complement_component: fixes S :: "'a::real_normed_vector set" assumes S: "closed S" and c: " c \<in> components(-S)" shows "closed (S \<union> c)" |
//
// Copyright Antony Polukhin, 2018.
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#include <boost/type_index/ctti_type_index.hpp>
#include <string>
#include <boost/core/lightweight_test.hpp>
class empty
{
};
int main()
{
std::string name = boost::typeindex::ctti_type_index::type_id<empty>().pretty_name();
BOOST_TEST(name.find("empty") != std::string::npos);
return boost::report_errors();
}
|
Formal statement is: lemma homeomorphic_compactness: "s homeomorphic t \<Longrightarrow> (compact s \<longleftrightarrow> compact t)" Informal statement is: If two topological spaces are homeomorphic, then they are compact if and only if they are compact. |
# Aprendizaje Supervisado con Python: Regresión
----
## Agenda
1- Introducción
* Comunidad de Analítica y temas tratados en el 2017
* Recursos en Github
* Aprendizaje supervisado
* Regresión lineal clásica
* Regresión lineal regularizada
+ LASSO
+ Ridge
+ Elastic Net
<br>
2- Caso de estudio y exploración de los datos
* Caso de estudio
* Pregunta y problemática de negocio
* Contenido y estructura de los datos
<br>
3- Procesamiento y limpieza de los datos
* Limpieza preliminar
* Tratamiento de valores extremos
* Normalización de la variable objetivo
<br>
4- Ingeniería de características
* Imputación de valores perdidos
* Transformación de variables
* Codificación de etiquetas (clases)
* Normalización
* Variables ficticias (dummies)
<br>
5- Modelado, evaluación y predicción
* Regresión lineal clásica
* Regresión lineal regularizada
+ LASSO
+ Ridge
+ Elastic Net
## Comunidad de Analítica y temas tratados en el 2017
[Nuestra Comunidad](https://www.meetup.com/Comunidad-de-Analitica-en-Santo-Domingo-R-Python/)
<br>
[Votación: Temas de Interés en Ciencia de Datos con Python](https://www.meetup.com/Comunidad-de-Analitica-en-Santo-Domingo-R-Python/polls/1252269/)
<br>
## Recursos en Github
[PyRDR](https://github.com/pyrdr/charlas)
### Aprendizaje Automático Supervisado
$$\Huge Y = f(X, \varepsilon)$$
## Regresión
### Regresión lineal clásica (estándar o gaussiana)
$$ $$
$$
\begin{align}
\Large E(Y \hspace{0.1cm} \text{|} \hspace{0.1cm} X_i) = \beta_{0} + \beta_{1} X_{1i} + \beta_{2} X_{2i} ... + \beta_{k} X_{ki} + \varepsilon_i
\end{align}
$$
$$ $$
$$\Large \varepsilon_i \sim \large N$$
#### Supuestos:
* S01: Lineal en sus parámetros
* S02: Los regresores $X$ son fijos en muetras repetidas, es decir, no-estocásticos
* S03: Los disturbios tiene valor medio cero $E(\varepsilon_i | X_i) = 0$
* S04: Homocedasticidad: dados los valores de $X$, la varianza de los disturbios $\varepsilon_i$ es la misma para todas las observaciones: $$var(\varepsilon_i \hspace{0.1cm} \text{|} \hspace{0.1cm} X_i) = E[\varepsilon_i − E(\varepsilon_i \hspace{0.1cm} \text{|} \hspace{0.1cm} X_i)^2] = E(\varepsilon_i^2 \hspace{0.1cm} \text{|} \hspace{0.1cm} X_i ) = \sigma^2$$
* S05: No existe autocorrelación entre los disturbios. Dados dos valores de $X$, $X_i$ y $X_j$ ($i \neq j$), la correlación entre cualquier par $\varepsilon_i$ y $\varepsilon_j$ ($i \neq j$) es cero.
* S07: El número de observaciones $n$ debe ser más grande que el número de parámetros estimados.
* S08: Variabilidad en los valores de $X$: $var(X)$ debe ser un número positivo finito.
* S09: El modelo de regresión está correctamente especificado, es decir, no existe sesgo de especificación.
* S10: No existe multicolinearidad perfecta, es decir, no existen relaciones lineales perfectas entre las variables explicativas.
* S11: Para fines de inferencia, los disturbios siguen una distribución gaussiana ó normal ($\varepsilon_i \sim N$).
* Regresión lineal clásica
* Regresión lineal regularizada
+ LASSO
+ Ridge
+ Elastic Net
https://www.analyticsvidhya.com/blog/2017/06/a-comprehensive-guide-for-linear-ridge-and-lasso-regression/
# Caso de estudio y exploración de los datos
* Caso de estudio (Kaggle)
+ https://www.kaggle.com/c/house-prices-advanced-regression-techniques/data
+ https://www.kaggle.com/juliencs/a-study-on-regression-applied-to-the-ames-dataset
+ https://www.kaggle.com/serigne/stacked-regressions-top-4-on-leaderboard
<br>
* ¿Cuál es la pregunta de negocio que debemos responder? ¿cuál es la problemática de negocios que debemos resolver?
```python
# Librerías
import pandas as pd
import numpy as np
from sklearn.model_selection import cross_val_score, train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import LinearRegression, RidgeCV, LassoCV, ElasticNetCV
from sklearn.metrics import mean_squared_error, make_scorer
from scipy import stats
from scipy.stats import norm, skew
from IPython.display import display
import matplotlib.pyplot as plt
import seaborn as sns
# Opciones
pd.set_option('display.float_format', lambda x: '%.3f' % x)
%matplotlib inline
```
## Contenido y estructura de los datos
```python
# Para verificar los archivos contenidos en el directorio
from subprocess import check_output
print(check_output(["ls", "../python_regression/"]).decode("utf8"))
```
data_description.txt
data_fields.txt
docs
figs
python_regression.ipynb
sample_submission.csv
test.csv
train.csv
```python
# Para leer los datos
train = pd.read_csv("train.csv")
print("train : " + str(train.shape))
test = pd.read_csv('test.csv')
print("test : " + str(test.shape))
```
train : (1460, 81)
test : (1459, 80)
```python
## Despliega las primeras cinco filas del conjunto de datos de entrenamiento
train.head(5)
```
<div>
<style scoped>
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
</style>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>Id</th>
<th>MSSubClass</th>
<th>MSZoning</th>
<th>LotFrontage</th>
<th>LotArea</th>
<th>Street</th>
<th>Alley</th>
<th>LotShape</th>
<th>LandContour</th>
<th>Utilities</th>
<th>...</th>
<th>PoolArea</th>
<th>PoolQC</th>
<th>Fence</th>
<th>MiscFeature</th>
<th>MiscVal</th>
<th>MoSold</th>
<th>YrSold</th>
<th>SaleType</th>
<th>SaleCondition</th>
<th>SalePrice</th>
</tr>
</thead>
<tbody>
<tr>
<th>0</th>
<td>1</td>
<td>60</td>
<td>RL</td>
<td>65.000</td>
<td>8450</td>
<td>Pave</td>
<td>NaN</td>
<td>Reg</td>
<td>Lvl</td>
<td>AllPub</td>
<td>...</td>
<td>0</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>0</td>
<td>2</td>
<td>2008</td>
<td>WD</td>
<td>Normal</td>
<td>208500</td>
</tr>
<tr>
<th>1</th>
<td>2</td>
<td>20</td>
<td>RL</td>
<td>80.000</td>
<td>9600</td>
<td>Pave</td>
<td>NaN</td>
<td>Reg</td>
<td>Lvl</td>
<td>AllPub</td>
<td>...</td>
<td>0</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>0</td>
<td>5</td>
<td>2007</td>
<td>WD</td>
<td>Normal</td>
<td>181500</td>
</tr>
<tr>
<th>2</th>
<td>3</td>
<td>60</td>
<td>RL</td>
<td>68.000</td>
<td>11250</td>
<td>Pave</td>
<td>NaN</td>
<td>IR1</td>
<td>Lvl</td>
<td>AllPub</td>
<td>...</td>
<td>0</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>0</td>
<td>9</td>
<td>2008</td>
<td>WD</td>
<td>Normal</td>
<td>223500</td>
</tr>
<tr>
<th>3</th>
<td>4</td>
<td>70</td>
<td>RL</td>
<td>60.000</td>
<td>9550</td>
<td>Pave</td>
<td>NaN</td>
<td>IR1</td>
<td>Lvl</td>
<td>AllPub</td>
<td>...</td>
<td>0</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>0</td>
<td>2</td>
<td>2006</td>
<td>WD</td>
<td>Abnorml</td>
<td>140000</td>
</tr>
<tr>
<th>4</th>
<td>5</td>
<td>60</td>
<td>RL</td>
<td>84.000</td>
<td>14260</td>
<td>Pave</td>
<td>NaN</td>
<td>IR1</td>
<td>Lvl</td>
<td>AllPub</td>
<td>...</td>
<td>0</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>0</td>
<td>12</td>
<td>2008</td>
<td>WD</td>
<td>Normal</td>
<td>250000</td>
</tr>
</tbody>
</table>
<p>5 rows × 81 columns</p>
</div>
```python
## Describe los datos de entrenamiento
train.describe()
```
<div>
<style scoped>
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
</style>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>Id</th>
<th>MSSubClass</th>
<th>LotFrontage</th>
<th>LotArea</th>
<th>OverallQual</th>
<th>OverallCond</th>
<th>YearBuilt</th>
<th>YearRemodAdd</th>
<th>MasVnrArea</th>
<th>BsmtFinSF1</th>
<th>...</th>
<th>WoodDeckSF</th>
<th>OpenPorchSF</th>
<th>EnclosedPorch</th>
<th>3SsnPorch</th>
<th>ScreenPorch</th>
<th>PoolArea</th>
<th>MiscVal</th>
<th>MoSold</th>
<th>YrSold</th>
<th>SalePrice</th>
</tr>
</thead>
<tbody>
<tr>
<th>count</th>
<td>1460.000</td>
<td>1460.000</td>
<td>1201.000</td>
<td>1460.000</td>
<td>1460.000</td>
<td>1460.000</td>
<td>1460.000</td>
<td>1460.000</td>
<td>1452.000</td>
<td>1460.000</td>
<td>...</td>
<td>1460.000</td>
<td>1460.000</td>
<td>1460.000</td>
<td>1460.000</td>
<td>1460.000</td>
<td>1460.000</td>
<td>1460.000</td>
<td>1460.000</td>
<td>1460.000</td>
<td>1460.000</td>
</tr>
<tr>
<th>mean</th>
<td>730.500</td>
<td>56.897</td>
<td>70.050</td>
<td>10516.828</td>
<td>6.099</td>
<td>5.575</td>
<td>1971.268</td>
<td>1984.866</td>
<td>103.685</td>
<td>443.640</td>
<td>...</td>
<td>94.245</td>
<td>46.660</td>
<td>21.954</td>
<td>3.410</td>
<td>15.061</td>
<td>2.759</td>
<td>43.489</td>
<td>6.322</td>
<td>2007.816</td>
<td>180921.196</td>
</tr>
<tr>
<th>std</th>
<td>421.610</td>
<td>42.301</td>
<td>24.285</td>
<td>9981.265</td>
<td>1.383</td>
<td>1.113</td>
<td>30.203</td>
<td>20.645</td>
<td>181.066</td>
<td>456.098</td>
<td>...</td>
<td>125.339</td>
<td>66.256</td>
<td>61.119</td>
<td>29.317</td>
<td>55.757</td>
<td>40.177</td>
<td>496.123</td>
<td>2.704</td>
<td>1.328</td>
<td>79442.503</td>
</tr>
<tr>
<th>min</th>
<td>1.000</td>
<td>20.000</td>
<td>21.000</td>
<td>1300.000</td>
<td>1.000</td>
<td>1.000</td>
<td>1872.000</td>
<td>1950.000</td>
<td>0.000</td>
<td>0.000</td>
<td>...</td>
<td>0.000</td>
<td>0.000</td>
<td>0.000</td>
<td>0.000</td>
<td>0.000</td>
<td>0.000</td>
<td>0.000</td>
<td>1.000</td>
<td>2006.000</td>
<td>34900.000</td>
</tr>
<tr>
<th>25%</th>
<td>365.750</td>
<td>20.000</td>
<td>59.000</td>
<td>7553.500</td>
<td>5.000</td>
<td>5.000</td>
<td>1954.000</td>
<td>1967.000</td>
<td>0.000</td>
<td>0.000</td>
<td>...</td>
<td>0.000</td>
<td>0.000</td>
<td>0.000</td>
<td>0.000</td>
<td>0.000</td>
<td>0.000</td>
<td>0.000</td>
<td>5.000</td>
<td>2007.000</td>
<td>129975.000</td>
</tr>
<tr>
<th>50%</th>
<td>730.500</td>
<td>50.000</td>
<td>69.000</td>
<td>9478.500</td>
<td>6.000</td>
<td>5.000</td>
<td>1973.000</td>
<td>1994.000</td>
<td>0.000</td>
<td>383.500</td>
<td>...</td>
<td>0.000</td>
<td>25.000</td>
<td>0.000</td>
<td>0.000</td>
<td>0.000</td>
<td>0.000</td>
<td>0.000</td>
<td>6.000</td>
<td>2008.000</td>
<td>163000.000</td>
</tr>
<tr>
<th>75%</th>
<td>1095.250</td>
<td>70.000</td>
<td>80.000</td>
<td>11601.500</td>
<td>7.000</td>
<td>6.000</td>
<td>2000.000</td>
<td>2004.000</td>
<td>166.000</td>
<td>712.250</td>
<td>...</td>
<td>168.000</td>
<td>68.000</td>
<td>0.000</td>
<td>0.000</td>
<td>0.000</td>
<td>0.000</td>
<td>0.000</td>
<td>8.000</td>
<td>2009.000</td>
<td>214000.000</td>
</tr>
<tr>
<th>max</th>
<td>1460.000</td>
<td>190.000</td>
<td>313.000</td>
<td>215245.000</td>
<td>10.000</td>
<td>9.000</td>
<td>2010.000</td>
<td>2010.000</td>
<td>1600.000</td>
<td>5644.000</td>
<td>...</td>
<td>857.000</td>
<td>547.000</td>
<td>552.000</td>
<td>508.000</td>
<td>480.000</td>
<td>738.000</td>
<td>15500.000</td>
<td>12.000</td>
<td>2010.000</td>
<td>755000.000</td>
</tr>
</tbody>
</table>
<p>8 rows × 38 columns</p>
</div>
```python
# Verifica el número de observaciones y atributos
print("The train data size before dropping Id feature is : {} ".format(train.shape))
print("The test data size before dropping Id feature is : {} ".format(test.shape))
# Guarda la columna 'Id'
train_ID = train['Id']
test_ID = test['Id']
# Ahora prescinde de la columna 'Id', ya que es innecesaria para el proceso de predicción
train.drop("Id", axis = 1, inplace = True)
test.drop("Id", axis = 1, inplace = True)
# Verifica de nuevo el tamaño de los datos después de eliminar la variable 'Id'
print("\nThe train data size after dropping Id feature is : {} ".format(train.shape))
print("The test data size after dropping Id feature is : {} ".format(test.shape))
```
The train data size before dropping Id feature is : (1460, 81)
The test data size before dropping Id feature is : (1459, 80)
The train data size after dropping Id feature is : (1460, 80)
The test data size after dropping Id feature is : (1459, 79)
## Procesamiento de datos
### Valores extremos (outliers)
La [documentación](http://ww2.amstat.org/publications/jse/v19n3/Decock/DataDocumentation.txt) de los datos de Ames Housing indica que existen valores extremos (outliers) en los datos de entrenamiento.
Vamos a explorar estos valores.
```python
fig, ax = plt.subplots()
ax.scatter(x = train['GrLivArea'], y = train['SalePrice'])
plt.ylabel('SalePrice', fontsize=13)
plt.xlabel('GrLivArea', fontsize=13)
plt.show()
```
```python
# Eliminamos los outliers
train = train.drop(train[(train['GrLivArea']>4000) & (train['SalePrice']<300000)].index)
# Verificamos de nuevo el gráfico
fig, ax = plt.subplots()
ax.scatter(train['GrLivArea'], train['SalePrice'])
plt.ylabel('SalePrice', fontsize=13)
plt.xlabel('GrLivArea', fontsize=13)
plt.show()
```
### Nota :
Eliminar los valores extremos (outliers) no es siempre lo más apropiado. En nuestro caso procedimos a eliminar estos dos casos, debido a que eran valores muy elevados y que no hacían sentido (áreas extremadamente grandes a precios muy bajos).
Puede que existan otros valores extremos en los datos de entrenamiento. Sin embargo, removerlos todos puede afectar de mala manera nuestro ejercicio de modelado si también encontramos outliers en los datos de comprobación (test). Por eso, en lugar de removerlos todos, preferimos solo manejar aquellos casos que hagan nuestros modelos más robustos.
## Variable Objetivo (Target)
**SalePrice** (el precio de venta) es la variable que necesitamos predecir. Por eso realizamos algunos análisis preliminares sobre dicha variable.
```python
sns.distplot(train['SalePrice'] , fit=norm);
# Obtenemos los parámetros de ajuste utilizados por la función
(mu, sigma) = norm.fit(train['SalePrice'])
print( '\n mu = {:.2f} and sigma = {:.2f}\n'.format(mu, sigma))
# Graficamos la distribución empírica
plt.legend(['Normal dist. ($\mu=$ {:.2f} and $\sigma=$ {:.2f} )'.format(mu, sigma)],
loc='best')
plt.ylabel('Frequency')
plt.title('SalePrice distribution')
# QQ-plot para comprobar la normalidad
fig = plt.figure()
res = stats.probplot(train['SalePrice'], plot=plt)
plt.show()
```
### Transformación logarítmica de la variable objetivo
```python
# Empleamos la función log1p de numpy para obtener el log(1+x) de todos los elementos de la variable objetivo
train["SalePrice"] = np.log1p(train["SalePrice"])
# Verificamos la nueva distribución empírica
sns.distplot(train['SalePrice'] , fit=norm);
# Nuevos parámetros
(mu, sigma) = norm.fit(train['SalePrice'])
print( '\n mu = {:.2f} and sigma = {:.2f}\n'.format(mu, sigma))
# Nuevo gráfico después de la transformación
plt.legend(['Normal dist. ($\mu=$ {:.2f} and $\sigma=$ {:.2f} )'.format(mu, sigma)],
loc='best')
plt.ylabel('Frequency')
plt.title('SalePrice distribution')
# QQ-plot después de la transformación
fig = plt.figure()
res = stats.probplot(train['SalePrice'], plot=plt)
plt.show()
# Registramos la nueva variable target como y_train
y_train = train.SalePrice.values
```
## Ingeniería de atributos (Features engineering)
Vamos primero a concatenar los dos data frames (train y test) a fin de simplicar el trabajo.
```python
ntrain = train.shape[0]
ntest = test.shape[0]
all_data = pd.concat((train, test)).reset_index(drop=True)
all_data.drop(['SalePrice'], axis=1, inplace=True)
print("all_data size is : {}".format(all_data.shape))
```
all_data size is : (2917, 79)
## Valores perdidos (Missing data)
```python
all_data_na = (all_data.isnull().sum() / len(all_data)) * 100
all_data_na = all_data_na.drop(all_data_na[all_data_na == 0].index).sort_values(ascending=False)[:30]
missing_data = pd.DataFrame({'Missing Ratio' :all_data_na})
missing_data.head(30)
```
<div>
<style scoped>
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
</style>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>Missing Ratio</th>
</tr>
</thead>
<tbody>
<tr>
<th>PoolQC</th>
<td>99.691</td>
</tr>
<tr>
<th>MiscFeature</th>
<td>96.400</td>
</tr>
<tr>
<th>Alley</th>
<td>93.212</td>
</tr>
<tr>
<th>Fence</th>
<td>80.425</td>
</tr>
<tr>
<th>FireplaceQu</th>
<td>48.680</td>
</tr>
<tr>
<th>LotFrontage</th>
<td>16.661</td>
</tr>
<tr>
<th>GarageQual</th>
<td>5.451</td>
</tr>
<tr>
<th>GarageCond</th>
<td>5.451</td>
</tr>
<tr>
<th>GarageFinish</th>
<td>5.451</td>
</tr>
<tr>
<th>GarageYrBlt</th>
<td>5.451</td>
</tr>
<tr>
<th>GarageType</th>
<td>5.382</td>
</tr>
<tr>
<th>BsmtExposure</th>
<td>2.811</td>
</tr>
<tr>
<th>BsmtCond</th>
<td>2.811</td>
</tr>
<tr>
<th>BsmtQual</th>
<td>2.777</td>
</tr>
<tr>
<th>BsmtFinType2</th>
<td>2.743</td>
</tr>
<tr>
<th>BsmtFinType1</th>
<td>2.708</td>
</tr>
<tr>
<th>MasVnrType</th>
<td>0.823</td>
</tr>
<tr>
<th>MasVnrArea</th>
<td>0.788</td>
</tr>
<tr>
<th>MSZoning</th>
<td>0.137</td>
</tr>
<tr>
<th>BsmtFullBath</th>
<td>0.069</td>
</tr>
<tr>
<th>BsmtHalfBath</th>
<td>0.069</td>
</tr>
<tr>
<th>Utilities</th>
<td>0.069</td>
</tr>
<tr>
<th>Functional</th>
<td>0.069</td>
</tr>
<tr>
<th>Electrical</th>
<td>0.034</td>
</tr>
<tr>
<th>BsmtUnfSF</th>
<td>0.034</td>
</tr>
<tr>
<th>Exterior1st</th>
<td>0.034</td>
</tr>
<tr>
<th>Exterior2nd</th>
<td>0.034</td>
</tr>
<tr>
<th>TotalBsmtSF</th>
<td>0.034</td>
</tr>
<tr>
<th>GarageArea</th>
<td>0.034</td>
</tr>
<tr>
<th>GarageCars</th>
<td>0.034</td>
</tr>
</tbody>
</table>
</div>
```python
f, ax = plt.subplots(figsize=(15, 12))
plt.xticks(rotation='0')
sns.barplot(x=all_data_na, y=all_data_na.index)
plt.xlabel('Features', fontsize=15)
plt.ylabel('Percent of missing values', fontsize=15)
plt.title('Percent missing data by feature', fontsize=15)
```
### Imputamos los valores perdidos según cada caso
**PoolQC** : la descripción de datos dice que NA signifca "No Pool". Esto hace sentido, dado el enorme porcentaje de valores perdidos (+99%), y el hecho de que, en general, la mayoría de las viviendas no tienen piscina.
```python
all_data["PoolQC"] = all_data["PoolQC"].fillna("None")
```
Casos similares.
```python
all_data["MiscFeature"] = all_data["MiscFeature"].fillna("None")
all_data["Alley"] = all_data["Alley"].fillna("None")
all_data["Fence"] = all_data["Fence"].fillna("None")
all_data["FireplaceQu"] = all_data["FireplaceQu"].fillna("None")
for col in ('GarageType', 'GarageFinish', 'GarageQual', 'GarageCond'):
all_data[col] = all_data[col].fillna('None')
```
**LotFrontage** : Dado que el área de cada calle conectada a la casa, muy probablemente es similar para las otras casas del vecindario, podemos rellenar los valores perdidos con la mediana de LotFrontage del vecindario.
```python
# Agrupamos por vecindario y completamos los valores perdidos con la mediana de LotFrontage para todos los vecindarios
all_data["LotFrontage"] = all_data.groupby("Neighborhood")["LotFrontage"].transform(
lambda x: x.fillna(x.median()))
```
**GarageYrBlt**, **GarageArea** y **GarageCars** : Reemplazamos los datos perdidos con cero, ya que "no garage" equivale a que no hay carros en dicho garage.
```python
for col in ('GarageYrBlt', 'GarageArea', 'GarageCars'):
all_data[col] = all_data[col].fillna(0)
```
**BsmtFinSF1**, **BsmtFinSF2**, **BsmtUnfSF**, **TotalBsmtSF**, **BsmtFullBath**, **BsmtHalfBath** : los valores perdidos muy probablemente son cero por no tener basement.
```python
for col in ('BsmtFinSF1', 'BsmtFinSF2', 'BsmtUnfSF','TotalBsmtSF', 'BsmtFullBath', 'BsmtHalfBath'):
all_data[col] = all_data[col].fillna(0)
```
**BsmtQual**, **BsmtCond**, **BsmtExposure**, **BsmtFinType1**, **BsmtFinType2** : Para todos estos atributos categóricos relacionados con el basement, NaN significa que no hay basement.
```python
for col in ('BsmtQual', 'BsmtCond', 'BsmtExposure', 'BsmtFinType1', 'BsmtFinType2'):
all_data[col] = all_data[col].fillna('None')
```
**MasVnrArea** y **MasVnrType** : NA muy probablemente indica que estas casas no tienen una chapa de albañilería. De manera que podemos reemplazar con cero el área y con None el tipo.
```python
all_data["MasVnrType"] = all_data["MasVnrType"].fillna("None")
all_data["MasVnrArea"] = all_data["MasVnrArea"].fillna(0)
```
**MSZoning** (clasificación general de zonificación) : 'RL' es por mucho el valor más común. De manera que podemos reemplazar los valores perdidos con 'RL'.
```python
all_data['MSZoning'] = all_data['MSZoning'].fillna(all_data['MSZoning'].mode()[0])
```
**Utilities** : Para este atributo categórico todos los registros son "AllPub", excepto por uno "NoSeWa" y 2 NA. Dado que la casa con 'NoSewa' está en el juego de datos de entrenamiento, este atributo no ayudará en el modelado predictivo. Por tanto, podemos eliminarlo sin problema.
```python
all_data = all_data.drop(['Utilities'], axis=1)
```
**Functional**: data description says NA means typical
```python
all_data["Functional"] = all_data["Functional"].fillna("Typ")
```
**Electrical** : Tiene un valor NA. Pero este atributo en su mayoría es 'SBrkr', de manera que podemos reemplazar el valor perdido por 'SBrkr'.
```python
all_data['Electrical'] = all_data['Electrical'].fillna(all_data['Electrical'].mode()[0])
```
**KitchenQual**: Sólo un valor NA, lo sustituimos por 'TA' (el más frecuente).
```python
all_data['KitchenQual'] = all_data['KitchenQual'].fillna(all_data['KitchenQual'].mode()[0])
```
**Exterior1st** y **Exterior2nd** : De nuevo, Exterior 1 & 2 tienen un sólo valor perdido. Sustituimos por el más común.
```python
all_data['Exterior1st'] = all_data['Exterior1st'].fillna(all_data['Exterior1st'].mode()[0])
all_data['Exterior2nd'] = all_data['Exterior2nd'].fillna(all_data['Exterior2nd'].mode()[0])
```
**SaleType** : Rellenamos con el más frecuente ("WD")
```python
all_data['SaleType'] = all_data['SaleType'].fillna(all_data['SaleType'].mode()[0])
```
**MSSubClass** : Na muy probablemente indica clase "no building", por lo que reemplazamos con None
```python
all_data['MSSubClass'] = all_data['MSSubClass'].fillna("None")
```
**Quedan aún valores perdidos?**
```python
# Verificamos si permanecen aún valores perdidos
all_data_na = (all_data.isnull().sum() / len(all_data)) * 100
all_data_na = all_data_na.drop(all_data_na[all_data_na == 0].index).sort_values(ascending=False)
missing_data = pd.DataFrame({'Missing Ratio' :all_data_na})
missing_data.head()
```
<div>
<style scoped>
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
</style>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>Missing Ratio</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
Ya no quedan valores perdidos.
### Más ingeniería de atributos:
#### Transformando algunas variables numéricas que realmente son categóricas
```python
# MSSubClass = El tipo de edificios
all_data['MSSubClass'] = all_data['MSSubClass'].apply(str)
# OverallCond
all_data['OverallCond'] = all_data['OverallCond'].astype(str)
# Año y mes de venta.
all_data['YrSold'] = all_data['YrSold'].astype(str)
all_data['MoSold'] = all_data['MoSold'].astype(str)
```
#### Codifica en cifras los valores nominales de algunas variables categóricas, para un mejor desempeño
https://www.analyticsvidhya.com/blog/2015/11/easy-methods-deal-categorical-variables-predictive-modeling/
```python
from sklearn.preprocessing import LabelEncoder
cols = ('FireplaceQu', 'BsmtQual', 'BsmtCond', 'GarageQual', 'GarageCond',
'ExterQual', 'ExterCond','HeatingQC', 'PoolQC', 'KitchenQual', 'BsmtFinType1',
'BsmtFinType2', 'Functional', 'Fence', 'BsmtExposure', 'GarageFinish', 'LandSlope',
'LotShape', 'PavedDrive', 'Street', 'Alley', 'CentralAir', 'MSSubClass', 'OverallCond',
'YrSold', 'MoSold')
# procesa columnas, applicando LabelEncoder a los atributos categóricos
for c in cols:
lbl = LabelEncoder()
lbl.fit(list(all_data[c].values))
all_data[c] = lbl.transform(list(all_data[c].values))
# Shape
print('Shape all_data: {}'.format(all_data.shape))
```
Shape all_data: (2917, 78)
#### Adicionamos un atributo muy importante
Los atributos relacionados con el área (pies cuadrados, metros cuadrados) son muy importante para determinar los precios de las casas. Vamos a añadir un atributo que equivale al área combinada del basement, más el primer piso y el segundo piso de cada casa.
```python
# Adicionamos el total de pies cuadrados (TotalSF) de la vivienda
all_data['TotalSF'] = all_data['TotalBsmtSF'] + all_data['1stFlrSF'] + all_data['2ndFlrSF']
```
#### Atributos sesgados
```python
numeric_feats = all_data.dtypes[all_data.dtypes != "object"].index
# Verificamos el sesgo de todos los atributos numéricos
skewed_feats = all_data[numeric_feats].apply(lambda x: skew(x.dropna())).sort_values(ascending=False)
print("\nSkew in numerical features: \n")
skewness = pd.DataFrame({'Skew' :skewed_feats})
skewness.head(20)
```
Skew in numerical features:
<div>
<style scoped>
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
</style>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>Skew</th>
</tr>
</thead>
<tbody>
<tr>
<th>MiscVal</th>
<td>21.940</td>
</tr>
<tr>
<th>PoolArea</th>
<td>17.689</td>
</tr>
<tr>
<th>LotArea</th>
<td>13.109</td>
</tr>
<tr>
<th>LowQualFinSF</th>
<td>12.085</td>
</tr>
<tr>
<th>3SsnPorch</th>
<td>11.372</td>
</tr>
<tr>
<th>LandSlope</th>
<td>4.973</td>
</tr>
<tr>
<th>KitchenAbvGr</th>
<td>4.301</td>
</tr>
<tr>
<th>BsmtFinSF2</th>
<td>4.145</td>
</tr>
<tr>
<th>EnclosedPorch</th>
<td>4.002</td>
</tr>
<tr>
<th>ScreenPorch</th>
<td>3.945</td>
</tr>
<tr>
<th>BsmtHalfBath</th>
<td>3.930</td>
</tr>
<tr>
<th>MasVnrArea</th>
<td>2.622</td>
</tr>
<tr>
<th>OpenPorchSF</th>
<td>2.529</td>
</tr>
<tr>
<th>WoodDeckSF</th>
<td>1.845</td>
</tr>
<tr>
<th>1stFlrSF</th>
<td>1.257</td>
</tr>
<tr>
<th>LotFrontage</th>
<td>1.103</td>
</tr>
<tr>
<th>GrLivArea</th>
<td>1.069</td>
</tr>
<tr>
<th>TotalSF</th>
<td>1.009</td>
</tr>
<tr>
<th>BsmtFinSF1</th>
<td>0.981</td>
</tr>
<tr>
<th>BsmtUnfSF</th>
<td>0.920</td>
</tr>
</tbody>
</table>
</div>
##### Transformación Box-Cox de atributos (altamente) sesgados.
Mediante la función $\text{boxcox1p}$ calculamos la transformación Box-Cox de $1 + x$. Debemos notar que configurar $\lambda = 0$ es equivalente a $\text{loglp}$ usado más arriba para la variable target.
* http://onlinestatbook.com/2/transformations/box-cox.html
* https://docs.scipy.org/doc/scipy-0.19.0/reference/generated/scipy.special.boxcox1p.html
```python
skewness = skewness[abs(skewness) > 0.75]
print("There are {} skewed numerical features to Box Cox transform".format(skewness.shape[0]))
from scipy.special import boxcox1p
skewed_features = skewness.index
lam = 0.15
for feat in skewed_features:
#all_data[feat] += 1
all_data[feat] = boxcox1p(all_data[feat], lam)
# all_data[skewed_features] = np.log1p(all_data[skewed_features])
```
There are 59 skewed numerical features to Box Cox transform
#### Variables ficticias (dummies)
```python
all_data = pd.get_dummies(all_data)
print(all_data.shape)
```
(2917, 220)
#### Nuevos conjuntos de datos de entrenamiento y comprobación.
```python
train = all_data[:ntrain]
test = all_data[ntrain:]
```
### Correlación de datos
```python
# Mapa para detectar qué atributos están correlacionados con el precio de venta
corrmat = train.corr()
plt.subplots(figsize=(12,9))
sns.heatmap(corrmat, vmax=0.9, square=True)
```
## Modelado
```python
from sklearn.linear_model import LinearRegression, ElasticNet, Lasso, BayesianRidge, LassoLarsIC
from sklearn.kernel_ridge import KernelRidge
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import RobustScaler
from sklearn.base import BaseEstimator, TransformerMixin, RegressorMixin, clone
from sklearn.model_selection import KFold, cross_val_score, train_test_split
from sklearn.metrics import mean_squared_error
```
### Estrategia de validación cruzada (cross-validation)
Emplearemos la función $\text{cross_val_score}$ de Sklearn. Sin embargo, esta función no tiene un atributo de mezcla aleatoria de datos. De manera que adicionamos previamente una línea de código en orden a realizar dicha mezcla.
```python
# Función de validación cruzada con mezcla aleatoria previa
n_folds = 5
def rmsle_cv(model):
kf = KFold(n_folds, shuffle=True, random_state=42).get_n_splits(train.values)
rmse= np.sqrt(-cross_val_score(model, train.values, y_train, scoring="neg_mean_squared_error", cv = kf))
return(rmse)
```
### Modelos
Aquellos modelos que pueden ser muy sensibles a los valores extremos (outliers), los vamos robustecer utilizando el método Robustscaler() de Sklearn en el pipeline.
**Regresión lineal (clásica)**:
```python
REG = make_pipeline(RobustScaler(), LinearRegression())
```
**Regresión LASSO**:
```python
LASSO = make_pipeline(RobustScaler(), Lasso(alpha =0.0005, random_state=1))
```
**Regresión Elastic Net**:
```python
ENet = make_pipeline(RobustScaler(), ElasticNet(alpha=0.0005, l1_ratio=.9, random_state=3))
```
**Regresión con Kernel Ridge**:
```python
KRR = KernelRidge(alpha=0.6, kernel='polynomial', degree=2, coef0=2.5)
```
## Scores de los modelos
Veamos ahora cómo estos modelos se desempeñan sobre los datos evaluando la métrica [RMSLE](https://www.quora.com/What-is-the-difference-between-an-RMSE-and-RMSLE-logarithmic-error-and-does-a-high-RMSE-imply-low-RMSLE).
[Función de Costo RMSLE](docs/rmslecostfunction-160623032122.pdf)
```python
score = rmsle_cv(REG)
print("Linear regression score: {:.4f} ({:.4f})\n".format(score.mean(), score.std()))
score = rmsle_cv(LASSO)
print("Lasso score: {:.4f} ({:.4f})\n".format(score.mean(), score.std()))
score = rmsle_cv(ENet)
print("ElasticNet score: {:.4f} ({:.4f})\n".format(score.mean(), score.std()))
score = rmsle_cv(KRR)
print("Kernel Ridge score: {:.4f} ({:.4f})\n".format(score.mean(), score.std()))
```
Linear regression score: 0.1238 (0.0109)
Lasso score: 0.1115 (0.0074)
ElasticNet score: 0.1116 (0.0074)
Kernel Ridge score: 0.1153 (0.0075)
```python
# Ajustamos el modelo con el mejor score a los datos y predecimos los valores
LASSO.fit(train, y_train)
y_pred = LASSO.predict(test)
```
|
Load LFindLoad.
From lfind Require Import LFind.
From QuickChick Require Import QuickChick.
From adtind Require Import goal4.
Derive Show for natural.
Derive Arbitrary for natural.
Instance Dec_Eq_natural : Dec_Eq natural.
Proof. dec_eq. Qed.
Derive Show for lst.
Derive Arbitrary for lst.
Instance Dec_Eq_lst : Dec_Eq lst.
Proof. dec_eq. Qed.
Lemma conj15eqsynthconj2 : forall (lv0 : lst), (@eq natural (len lv0) (len (append Nil (append lv0 Nil)))).
Admitted.
QuickChick conj15eqsynthconj2.
|
x <- c(-12, 1, 16)
y <- c(-19, -14, -9, 8)
prob.x <- c(0.35, 0.3, 0.35)
prob.y_x <- c(0.2, 0.33, 0.23, 0.17,
0.25, 0.25, 0.22, 0.28,
0.23, 0.25, 0.23, 0.29)
parametro_a <- -0.41
parametro_b <- 0.56
parametro_c <- 0.15
parametro_d <- 0.35
mat.y_x <- matrix(data = prob.y_x, ncol = length(y), nrow = length(x), byrow = TRUE);
prob.xy <- c()
for( i in 1:length(x) ){
for( j in 1:length(y) ){
prob.xy <- c(prob.xy, mat.y_x[i,j] * prob.x[i]);
}
}
mat.xy <- matrix(data = prob.xy, ncol = length(y), nrow = length(x), byrow = TRUE);
prob.y <- c(sum(mat.xy[1:3,1]),sum(mat.xy[1:3,2]),sum(mat.xy[1:3,3]),sum(mat.xy[1:3,4]))
e.x <- sum(x*prob.x)
e.y <- sum(y*prob.y)
e.xy <- c()
for(i in 1:length(x)) {
for(j in 1:length(y)) {
e.xy <- c(e.xy, mat.xy[i,j]*x[i]*y[j])
}
}
e.xy <- sum(e.xy)
cov <- e.xy - e.x*e.y
cov2 <- cov*parametro_a*parametro_c
var.x <- sum(x^2*prob.x)-e.x^2
var.y <- sum(y^2*prob.y)-e.y^2
ro <- cov/sqrt(var.x*var.y)
sgn.ac <- parametro_a*parametro_c/abs(parametro_a*parametro_c)
cat("X\n")
print(x)
print(prob.x)
cat("\nY\n")
print(y)
print(prob.y)
cat("\nCongiunta\n")
print(mat.xy)
cat("\nE(XY)\n")
print(e.xy)
cat("\nE(X)\n")
print(e.x)
cat("\nE(Y)\n")
print(e.y)
cat("\nCovarianza\n")
print(cov)
cat("\nCovarianza della combinazione lineare\n")
print(cov2)
cat("\nVar(X)\n")
print(var.x)
cat("\nVar(Y)\n")
print(var.y)
cat("\nRo\n")
print(ro)
cat("\nRo della comb. lineare\n")
print(sgn.ac*ro) |
include defs
# error - print message and terminate execution
subroutine error (line)
character line (ARB)
call remark (line)
call endst
end
|
{-# OPTIONS --cubical --safe #-}
module Cubical.Data.Strict2Group.Explicit.ToXModule where
open import Cubical.Foundations.Prelude hiding (comp)
open import Cubical.Data.Group.Base
open import Cubical.Data.XModule.Base
open import Cubical.Data.Group.Action.Base
open import Cubical.Data.Sigma
open import Cubical.Data.Strict2Group.Explicit.Base
open import Cubical.Data.Strict2Group.Explicit.Interface
Strict2GroupExp→XModuleExp : {ℓ : Level} (S : Strict2GroupExp ℓ) → (XModuleExp ℓ)
Strict2GroupExp→XModuleExp (strict2groupexp C₀ C₁ s t i ∘ si ti s∘ t∘ isMorph∘ assoc∘ lUnit∘ rUnit∘) =
record
{ G = C₀ ;
H = ks ;
τ = tₖₛ ;
α = laction
(λ g h → lAction.act lad (id g) h)
(λ h →
ΣPathP (p1 h ,
isProp→PathP
(λ i → snd (P (p1 h i)))
(kerIsNormal {G = C₁} {H = C₀} s (id 1₀) h)
(kerIsNormal {G = C₁} {H = C₀} s 1₁ h))
∙ lAction.identity lad h)
(λ g g' h →
ΣPathP (p2 g g' h ,
isProp→PathP
(λ i → snd (P (p2 g g' h i)))
(kerIsNormal {G = C₁} {H = C₀} s (id (g ∙₀ g')) h)
(kerIsNormal {G = C₁} {H = C₀} s (id g ∙₁ id g') h))
∙ (lAction.coh lad (id g) (id g') h))
λ g h h' → lAction.hom lad (id g) h h' ;
equivar = equivar ;
peiffer = pf }
where
S = strict2groupexp C₀ C₁ s t i ∘ si ti s∘ t∘ isMorph∘ assoc∘ lUnit∘ rUnit∘
open S2GInterface S
-- the kernel of the source map
kers = ker {G = C₁} {H = C₀} s
-- the family of propositions ker(x) ≡ 1
P = Subgroup.typeProp kers
-- kernel coerced to group
ks = Subgroup→Group {G = C₁} kers
-- the left adjoint action of hom on its normal subgroup ker(src)
lad : lAction C₁ ks
lad = lActionAdjSubgroup C₁ kers (kerIsNormal {G = C₁} {H = C₀} s)
-- the target map restricted to ker(src)
tₖₛ = restrictGroupMorph {G = C₁} {H = C₀} t kers
tarₖₛ = fst tₖₛ
tar∙ₖₛ = snd tₖₛ
-- multiplication, inverse in ker src
_∙₁ₖₛ_ = isGroup.comp (Group.groupStruc ks)
ks⁻¹ = isGroup.inv (Group.groupStruc ks)
-- group laws in ker(src)
lUnitₖₛ = isGroup.lUnit (Group.groupStruc ks)
rUnitₖₛ = isGroup.rUnit (Group.groupStruc ks)
rCancelₖₛ = isGroup.rCancel (Group.groupStruc ks)
assocₖₛ = isGroup.assoc (Group.groupStruc ks)
1ₖₛ = isGroup.id (Group.groupStruc ks)
-- Composition restricted to ks×₀ks
∘ₖₛ : (g f : Group.type ks) → (src (fst g) ≡ tarₖₛ f) → Group.type ks
∘ₖₛ g f coh = (⊙' (fst g) (fst f) coh) , ((src⊙' (fst g) (fst f) coh) ∙ snd f)
-- right and left unit law for restricted ∘
abstract
rUnit∘ₖₛ : (h : Group.type ks) →
∘ₖₛ h (id (src (fst h)) , si (src (fst h)) ∙ snd h)
(sym (ti (src (fst h)))) ≡ h
rUnit∘ₖₛ h = ΣPathP (rUnit∘ (fst h) ,
isProp→PathP
(λ i → snd (P (rUnit∘ (fst h) i)))
(src⊙' (fst h) (id (src (fst h))) (sym (ti (src (fst h)))) ∙ si (src (fst h)) ∙ snd h)
(snd h))
abstract
lUnit∘ₖₛ : (h : Group.type ks) →
(⊙ (co (id (tar (fst h))) (fst h) (si (tar (fst h)))) , (src⊙' (id (tar (fst h))) (fst h) (si (tar (fst h)))) ∙ snd h) ≡ h
lUnit∘ₖₛ h = ΣPathP (
lUnit∘ (fst h) ,
isProp→PathP
(λ i → snd (P (lUnit∘ (fst h) i))) (src⊙' (id (tar (fst h))) (fst h) (si (tar (fst h))) ∙ snd h) (snd h))
-- two proofs used in equivariant
abstract
p1 = λ (h : Group.type ks) → cong (λ z → (z ∙₁ fst h) ∙₁ (C₁⁻¹ z)) (morphId {G = C₀} {H = C₁} i)
p2 = λ (g g' : Group.type C₀) (h : Group.type ks) → cong (λ z → (z ∙₁ fst h) ∙₁ (C₁⁻¹ z)) (id∙₀ g g')
equivar = λ g h → tar∙₁ (id g ∙₁ fst h) (C₁⁻¹ (id g)) ∙∙
cong (_∙₀ (tar (C₁⁻¹ (id g)))) (tar∙₁ (id g) (fst h)) ∙∙
cong (((tar (id g)) ∙₀ (tar (fst h))) ∙₀_) (morphInv {G = C₁} {H = C₀} t (id g)) ∙
cong (λ z → (z ∙₀ (tar (fst h))) ∙₀ (C₀⁻¹ z)) (ti g)
-- the peiffer identity, proved according to
-- ixh'ix- ≡ eixh'ix- ≡ hh-ixh'ix- ≡ hh-ixh'ixe
pf : (h h' : Group.type ks) → lAction.act lad (id (tarₖₛ h)) h' ≡ (h ∙₁ₖₛ h') ∙₁ₖₛ (ks⁻¹ h)
pf h h' =
ixh'ix-
≡⟨ sym (lUnitₖₛ ixh'ix-) ⟩
1ₖₛ ∙₁ₖₛ ixh'ix-
≡⟨ cong (_∙₁ₖₛ ixh'ix-) (sym (rCancelₖₛ h)) ⟩
(h ∙₁ₖₛ h-) ∙₁ₖₛ ixh'ix-
≡⟨ assocₖₛ h h- ixh'ix- ⟩
h ∙₁ₖₛ (h- ∙₁ₖₛ ixh'ix-)
≡⟨ cong (h ∙₁ₖₛ_) (
h- ∙₁ₖₛ ixh'ix-
≡⟨ cong (h- ∙₁ₖₛ_) (sym (rUnit∘ₖₛ ixh'ix-)) ⟩
h- ∙₁ₖₛ (∘ₖₛ ixh'ix- (is ixh'ix-) (src≡tarIdSrc (fst ixh'ix-)))
≡⟨ cong (_∙₁ₖₛ (∘ₖₛ ixh'ix- (is ixh'ix-) (src≡tarIdSrc (fst ixh'ix-)))) (sym (lUnit∘ₖₛ h-)) ⟩
(⊙ ix-⊙h-₁ , (src⊙ ix-⊙h-₁) ∙ snd h-) ∙₁ₖₛ ∘ₖₛ ixh'ix- (is ixh'ix-) (src≡tarIdSrc (fst ixh'ix-))
≡⟨ ΣPathP (q3 , isProp→PathP (λ i → snd (P (q3 i))) (snd ((ix-∘h-₁ , (src⊙ ix-⊙h-₁) ∙ snd h-) ∙₁ₖₛ ∘ₖₛ ixh'ix- (is ixh'ix-) (src≡tarIdSrc (fst ixh'ix-)))) (src⊙' (ix- ∙₁ fst ixh'ix-) (h- .fst ∙₁ fst (is ixh'ix-)) q1 ∙ q2)) ⟩
(⊙ (co (ix- ∙₁ fst ixh'ix-) (h- .fst ∙₁ fst (is ixh'ix-)) q1)) , (src⊙' (ix- ∙₁ fst ixh'ix-) (h- .fst ∙₁ fst (is ixh'ix-)) q1) ∙ q2
≡⟨ ΣPathP (q18 , (isProp→PathP (λ j → snd (P (q18 j))) ((src⊙' (ix- ∙₁ fst ixh'ix-) (h- .fst ∙₁ fst (is ixh'ix-)) q1) ∙ q2) ((src⊙' (ix- ∙₁ fst ixh'ix-) (h- .fst ∙₁ 1₁) (q5 ∙ q8)) ∙ q9))) ⟩
(⊙ (co (ix- ∙₁ fst ixh'ix-) (h- .fst ∙₁ 1₁) (q5 ∙ q8))) ,
(src⊙' (ix- ∙₁ fst ixh'ix-) (h- .fst ∙₁ 1₁) (q5 ∙ q8)) ∙ q9
≡⟨ ΣPathP (q17 , (isProp→PathP (λ j → snd (P (q17 j))) ((src⊙' (ix- ∙₁ fst ixh'ix-) (h- .fst ∙₁ 1₁) (q5 ∙ q8)) ∙ q9) ((src⊙' (ix- ∙₁ fst ixh'ix-) (fst h-) q5) ∙ snd h-))) ⟩
(⊙ (co (ix- ∙₁ fst ixh'ix-) (h- .fst) q5)) ,
(src⊙' (ix- ∙₁ fst ixh'ix-) (h- .fst) q5) ∙ snd h-
≡⟨ ΣPathP (q16 , isProp→PathP (λ j → snd (P (q16 j))) ((src⊙' (ix- ∙₁ fst ixh'ix-) (fst h-) q5) ∙ snd h-) ((src⊙' (ix- ∙₁ fst ixh'ix-) (1₁ ∙₁ h- .fst) (q5 ∙ q6)) ∙ q7)) ⟩
(⊙ (co (ix- ∙₁ fst ixh'ix-) (1₁ ∙₁ h- .fst) (q5 ∙ q6))) ,
(src⊙' (ix- ∙₁ fst ixh'ix-) (1₁ ∙₁ h- .fst) (q5 ∙ q6)) ∙ q7
≡⟨ ΣPathP (q15 , (isProp→PathP (λ j → snd (P (q15 j))) ((src⊙' (ix- ∙₁ fst ixh'ix-) (1₁ ∙₁ h- .fst) (q5 ∙ q6)) ∙ q7) ((src⊙' ((fst h') ∙₁ ix-) (1₁ ∙₁ h- .fst) q4) ∙ q7))) ⟩
(⊙ (co ((fst h') ∙₁ ix-) (1₁ ∙₁ h- .fst) q4)) ,
(src⊙' ((fst h') ∙₁ ix-) (1₁ ∙₁ h- .fst) q4) ∙ q7
≡⟨ ΣPathP (q14 , isProp→PathP (λ j → snd (P (q14 j))) ((src⊙' ((fst h') ∙₁ ix-) (1₁ ∙₁ h- .fst) q4) ∙ q7) q12) ⟩
(⊙ (co (fst h') 1₁ ((snd h') ∙ (sym tar1₁≡1₀)))) ∙₁ ix-∘h-₁ , q12
≡⟨ ΣPathP (q11 , isProp→PathP (λ j → snd (P (q11 j))) q12 q13) ⟩
h' .fst ∙₁ ix-∘h-₁ , q13
≡⟨ ΣPathP (q10 , isProp→PathP (λ j → snd (P (q10 j)))
(src∙₁ (fst h') ix-∘h-₁ ∙∙
(λ i₁ → snd h' i₁ ∙₀ src ix-∘h-₁) ∙∙
lUnit₀ (src ix-∘h-₁) ∙∙
src⊙ ix-⊙h-₁ ∙∙
snd h-)
(Subgroup.compClosed kers h' h-)) ⟩
h' .fst ∙₁ h- .fst , Subgroup.compClosed kers h' h- ≡⟨ refl ⟩
(h' ∙₁ₖₛ h-) ≡⟨ refl ⟩ refl ) ⟩
h ∙₁ₖₛ (h' ∙₁ₖₛ h-)
≡⟨ sym (assocₖₛ h h' h-) ⟩
(h ∙₁ₖₛ h') ∙₁ₖₛ h- ≡⟨ refl ⟩ refl
where
-- some abbreviations
h- = ks⁻¹ h -- h⁻¹
x = tarₖₛ h -- target of h
x- = tarₖₛ h- -- target of h⁻¹
x-≡x⁻¹ : x- ≡ C₀⁻¹ x
x-≡x⁻¹ = morphInv {G = ks} {H = C₀} tₖₛ h
ix = id x -- i (t h)
ix- = id x- -- i (t h⁻¹)
ixh'ix- : Group.type ks -- abv. for (ix ∙₁ h') ∙₁ ix-
ixh'ix- = lAction.act lad (id (tarₖₛ h)) h'
is : Group.type ks → Group.type ks -- abv. for i(s _) in ks
is h = id (src (fst h)) , (si (src (fst h))) ∙ snd h
ix-⊙h-₁ = co ix- (fst h-) (si x-)
ix-∘h-₁ = ⊙ ix-⊙h-₁
-- some identities
ix-≡ix⁻¹ : ix- ≡ (C₁⁻¹ ix)
ix-≡ix⁻¹ = (cong id x-≡x⁻¹) ∙ (morphInv {G = C₀} {H = C₁} i x)
ish≡1ₖₛ : (h : Group.type ks) → (is h) ≡ 1ₖₛ
ish≡1ₖₛ h =
ΣPathP
(cong (fst i) (snd h) ∙ id1₀≡1₁ ,
isProp→PathP
(λ j → snd (P (((λ k → id(snd h k)) ∙ id1₀≡1₁) j)))
(si (src (fst h)) ∙ snd h)
(Subgroup.subId kers))
-- t h⁻¹ ≡ (t h)⁻¹
th-≡x- = morphInv {G = ks} {H = C₀} tₖₛ h
-----------------------------------------
-- here comes particles of the main proof
-----------------------------------------
-- coherence condition for the composition
-- ∘ (ix- ∙₁ fst ixh'ix-) (h- .fst ∙₁ fst (is ixh'ix-))
q1 =
src∙₁ ix- (fst ixh'ix-) ∙∙
cong (_∙₀ src (fst ixh'ix-)) (si x-) ∙∙
cong (x- ∙₀_) (snd ixh'ix-) ∙∙
rUnit₀ x- ∙∙
th-≡x- ∙∙
sym (rUnit₀ (C₀⁻¹ x)) ∙∙
cong ((C₀⁻¹ x) ∙₀_) (sym ((ti ((src (fst ixh'ix-)))) ∙ (snd ixh'ix-))) ∙∙
cong (_∙₀ (tar (fst (is ixh'ix-)))) (sym th-≡x-) ∙∙
sym (tar∙₁ (fst h-) (fst (is ixh'ix-)))
-- to show that ∘ q1 is in ks, p2 is proof that f is in ks
q2 = src∙₁ (fst h-) (fst (is ixh'ix-)) ∙∙
cong (_∙₀ (src (fst (is ixh'ix-)))) (snd h-) ∙∙
lUnit₀ (src (fst (is ixh'ix-))) ∙∙
cong (λ z → src (fst z)) (ish≡1ₖₛ ixh'ix-) ∙∙
snd 1ₖₛ
-- (∘ (si x-)) ∙₁ (fst (∘ₖₛ (src≡tarIdSrc (fst ixh'ix-)))) ≡ ∘ q1
q3 =
(ix-∘h-₁ ∙₁ fst (∘ₖₛ ixh'ix- (is ixh'ix-) (src≡tarIdSrc (fst ixh'ix-)))) ≡⟨ refl ⟩
⊙ ix-⊙h-₁ ∙₁ ⊙ co3
≡⟨ sym (isMorph⊙ ix-⊙h-₁ co3) ⟩
⊙ (ix-⊙h-₁ ∙Co co3)
≡⟨ ⊙≡c (ix-⊙h-₁ ∙Co co3) q1 ⟩
⊙ co1 ≡⟨ refl ⟩ refl
where
co1 = co (ix- ∙₁ fst ixh'ix-) (fst h- ∙₁ fst (is ixh'ix-)) q1
co3 = co (fst ixh'ix-) (fst (is ixh'ix-)) (src≡tarIdSrc (fst ixh'ix-))
-- coherence condition for ∘ {g = ?} {f = 1₁ ∙₁ h- .fst} (_∙ q6)
q6 = sym (lUnit₀ (tar (fst h-))) ∙∙
sym (cong (_∙₀ (tar (fst h-))) (morphId {G = C₁} {H = C₀} t)) ∙∙
sym (tar∙₁ 1₁ (fst h-))
-- coherence condition for ∘ {g = (fst h') ∙₁ ix- } {f = 1₁ ∙₁ h- .fst } q4
q4 =
src∙₁ (fst h') ix- ∙∙
(cong (_∙₀ src ix-) (snd h')) ∙∙
lUnit₀ (src ix-) ∙∙
si x- ∙∙
q6
-- coherence condition for ∘ {g = ix- ∙₁ fst ixh'ix- } {f = ?} (q5 ∙ ?)
q5 =
src∙₁ ix- (fst ixh'ix-) ∙∙
cong ((src ix-) ∙₀_) (snd ixh'ix-) ∙∙
rUnit₀ (src ix-) ∙
si x-
-- proof that 1₁ ∙₁ h- .fst : ker s
q7 = src∙₁ 1₁ (fst h-) ∙∙
cong (src 1₁ ∙₀_) (snd h-) ∙∙
rUnit₀ (src 1₁) ∙ src1₁≡1₀
-- proof that s x- ≡ t (h- .fst ∙₁ 1₁)
q8 = sym (rUnit₀ (tar (fst h-))) ∙∙
(sym (cong ((tar (fst h-)) ∙₀_) tar1₁≡1₀)) ∙∙
(sym (tar∙₁ (fst h-) 1₁))
-- proof that h- .fst ∙₁ 1₁ : ker s
q9 = src∙₁ (fst h-) 1₁ ∙∙
cong (_∙₀ (src 1₁)) (snd h-) ∙∙
lUnit₀ (src 1₁) ∙
src1₁≡1₀
-- proof that (h' .fst ∙₁ ix-∘h-₁) ≡ (h' .fst ∙₁ h- .fst)
q10 = cong (h' .fst ∙₁_) (lUnit∘ (fst h-))
-- proof that (h'∘1₁)∙₁ ix-∘h-₁ ≡ h' ∙₁ ix-∘h-₁
q11 = cong (_∙₁ ix-∘h-₁)
(⊙≡ (co (fst h') 1₁ (snd h' ∙ sym tar1₁≡1₀)) (id (src (fst h')) , sym id1₀≡1₁ ∙ sym (cong id (snd h'))) ∙
rUnit⊙c
(fst h')
((snd h' ∙ (λ i₁ → tar1₁≡1₀ (~ i₁))) ∙ cong tar ((λ i₁ → id1₀≡1₁ (~ i₁)) ∙ (λ i₁ → id (snd h' (~ i₁))))))
q12 =
src∙₁ ((⊙ (co (fst h') 1₁ ((snd h') ∙ sym tar1₁≡1₀)))) ix-∘h-₁ ∙∙
cong (_∙₀ (src ix-∘h-₁)) ((src⊙' (fst h') 1₁ ((snd h') ∙ (sym tar1₁≡1₀))) ∙ src1₁≡1₀) ∙∙
lUnit₀ (src ix-∘h-₁) ∙
src⊙' ix- (fst h-) (si x-) ∙ snd h-
q13 = src∙₁ (fst h') ix-∘h-₁ ∙∙
cong (_∙₀ (src ix-∘h-₁)) (snd h') ∙∙
lUnit₀ (src ix-∘h-₁) ∙∙
src⊙' ix- (fst h-) (si x-) ∙∙
snd h-
q14 =
⊙' ((fst h') ∙₁ ix-) (1₁ ∙₁ h- .fst) q4
≡⟨ ⊙≡c~ q4 (𝒸 (co (fst h') 1₁ (snd h' ∙ (λ i₁ → tar1₁≡1₀ (~ i₁))) ∙Co ix-⊙h-₁)) ⟩
⊙' ((fst h') ∙₁ ix-) (1₁ ∙₁ (fst h-)) (𝒸 (co (fst h') 1₁ (snd h' ∙ (λ i₁ → tar1₁≡1₀ (~ i₁))) ∙Co ix-⊙h-₁))
≡⟨ isMorph⊙ (co (fst h') 1₁ (snd h' ∙ (λ i₁ → tar1₁≡1₀ (~ i₁)))) ix-⊙h-₁ ⟩
-- (⊙' (fst h') 1₁ (snd h' ∙ (λ i₁ → tar1₁≡1₀ (~ i₁)))) ∙₁ ix-∘h-₁ ≡⟨ refl ⟩
refl
q15 = ≡⊙c* (q5 ∙ q6)
(cong (ix- ∙₁_) (assoc₁ ix (fst h') (C₁⁻¹ ix)) ∙∙
sym (assoc₁ ix- ix (fst h' ∙₁ C₁⁻¹ ix)) ∙∙
cong (λ z → (z ∙₁ ix) ∙₁ (fst h' ∙₁ C₁⁻¹ ix)) ix-≡ix⁻¹ ∙∙
cong (_∙₁ (fst h' ∙₁ C₁⁻¹ ix)) (lCancel₁ ix) ∙∙
lUnit₁ (fst h' ∙₁ C₁⁻¹ ix) ∙
cong (fst h' ∙₁_) (sym ix-≡ix⁻¹))
q4
{- use this to see what's going on
⊙ co1
≡⟨ ≡⊙c* (q5 ∙ q6)
((cong (ix- ∙₁_) (assoc₁ ix (fst h') (C₁⁻¹ ix))) ∙
sym (assoc₁ ix- ix (fst h' ∙₁ C₁⁻¹ ix)) ∙
cong (λ z → (z ∙₁ ix) ∙₁ (fst h' ∙₁ C₁⁻¹ ix)) ix-≡ix⁻¹ ∙
cong (_∙₁ (fst h' ∙₁ C₁⁻¹ ix)) (lCancel₁ ix) ∙
(lUnit₁ (fst h' ∙₁ C₁⁻¹ ix)) ∙
(cong (fst h' ∙₁_) (sym ix-≡ix⁻¹)))
q4 ⟩
⊙ co2 ≡⟨ refl ⟩ refl
where
co1 = co (ix- ∙₁ (fst ixh'ix-)) (1₁ ∙₁ (fst h-)) (q5 ∙ q6)
co2 = co ((fst h') ∙₁ ix-) (1₁ ∙₁ (fst h-)) q4 -}
q16 = ⊙≡c* q5 (sym (lUnit₁ (fst h-))) (q5 ∙ q6)
{- use this to see what's going on
⊙ co1
≡⟨ ⊙≡c* q5 (sym (lUnit₁ (fst h-))) (q5 ∙ q6) ⟩
⊙ co2 ≡⟨ refl ⟩ refl
where
co1 = co (ix- ∙₁ fst ixh'ix-) (fst h-) q5
co2 = co (ix- ∙₁ fst ixh'ix-) (1₁ ∙₁ fst h-) (q5 ∙ q6) -}
q17 = ⊙≡c* (q5 ∙ q8) (rUnit₁ (fst h-)) q5
{- use this to see what's going on
⊙ co1
≡⟨ ⊙≡c* (q5 ∙ q8) (rUnit₁ (fst h-)) q5 ⟩
⊙ co2 ≡⟨ refl ⟩ refl
where
co1 = co (ix- ∙₁ fst ixh'ix-) (fst h- ∙₁ 1₁) (q5 ∙ q8)
co2 = co (ix- ∙₁ fst ixh'ix-) (fst h-) q5 -}
q18 = ⊙≡c* q1 (cong (fst h- ∙₁_) ((cong id (snd ixh'ix-)) ∙ id1₀≡1₁)) (q5 ∙ q8)
{- use this to see what's going on
⊙ co1 ≡⟨ ⊙≡c* q1 (cong (fst h- ∙₁_)
((cong id (snd ixh'ix-)) ∙ id1₀≡1₁))
(q5 ∙ q8) ⟩
⊙ co2 ≡⟨ refl ⟩ refl
where
co1 = co (ix- ∙₁ fst ixh'ix-) (fst h- ∙₁ (fst (is ixh'ix-))) q1
co2 = co (ix- ∙₁ fst ixh'ix-) (fst h- ∙₁ 1₁) (q5 ∙ q8) -}
|
function g = restrict(f, s)
%RESTRICT Restrict an UNBNDFUN to a subinterval.
% RESCTRICT(F, S) returns a FUN object that is restricted to the subinterval
% [S(1), S(2)] of the domain of F.
%
% If length(S) > 2, i.e., S = [S1, S2, ..., Sn], then RESCTRICT(F, S) returns
% an array of FUN objects, where the cells contain F restricted to each of
% the subintervals defined by S. If there is only one FUN to be returned,
% that is, if length(S) == 2, then the FUN object g is returned. This
% facilitates the use of the result by other functions, e.g. plot etc.
% Copyright 2017 by The University of Oxford and The Chebfun Developers.
% See http://www.chebfun.org/ for Chebfun information.
% Deal with empty case:
if ( isempty(f) )
g = f;
return
end
% Check if the argument s is actually a subinterval:
if ( s(1) < f.domain(1) || s(end) > f.domain(2) || any(diff(s) <= 0) )
error('CHEBFUN:UNBNDFUN:restrict:badInterval', 'Not a valid interval.')
elseif ( numel(s) == 2 && all(s == f.domain) )
% Nothing to do here!
g = f;
return
end
% Number of subdomains:
numSubDom = numel(s) - 1;
% Preallocate the output cell:
g = cell(1, numSubDom);
% Any exponents?
exps = [];
if ( issing(f) )
% Grab the exponents:
exps = get(f, 'exponents');
% If there is a non-trivial exponent:
if ( any(exps) )
% Interior exponents:
interiorExps = zeros(1, numSubDom-1);
% Insert the interior exponents:
exps = [exps(1) interiorExps exps(2)];
% Negate the exponents for infinite endpoint, since the exponents stored
% in SINGFUN are the negated values of those supplied to the UNBNDFUN
% constructor:
if ( s(1) == -Inf )
exps(1) = -exps(1);
elseif ( f.domain(1) == -Inf )
exps(1) = 0;
end
if ( s(end) == Inf )
exps(end) = -exps(end);
elseif ( f.domain(end) == Inf )
exps(end) = 0;
end
end
end
% Grab the vscale:
vscale = get(f, 'vscale');
% Loop over each subdomain:
for k = 1:numSubDom
% Initialize preferences:
pref = chebfunpref();
% Pass the information about exponents through preference:
if ( ~isempty(exps) && any(exps(k:k+1)) )
data.exponents = exps(k:k+1);
if ( (k == 1) || (k == numSubDom) )
pref.techPrefs.extrapolate = 1;
end
else
data.exponents = [];
end
data.domain = s(k:k+1);
data.vscale = vscale;
g{k} = classicfun.constructor(@(x) feval(f, x), data, pref);
end
% When there is only one cell, return the UNBNDFUN instead:
if ( numSubDom == 1 )
g = g{1};
end
end
|
-- Dummy
module System.IO.Handle
|
If $p$ and $q$ are paths in a set $s$ such that $p$ ends where $q$ starts, then the loop $pqp^{-1}$ is homotopic to $q$. |
By mid @-@ morning , German counterattacks on PPCLI positions in the town had begun , involving tanks from the 7th Company of the 26th Panzer Regiment ( 26 . Panzer @-@ Regiment ) , field guns and substantial infantry forces . Throughout the afternoon two infantry companies of the PPCLI fought off several attacks by German forces , eventually managing to push them back to the vineyards on the northern edge of the town . While the PPCLI had taken 68 casualties , German casualties were estimated at 120 . However , three strong German formation surrounded the Canadian positions at Villa Rogatti , rendering further exploitation of the bridgehead unlikely . Col. Ware was advised to be ready to withdraw across the Moro River , should German forces counterattack . In order to allow the Canadian Division a greater concentration of force , on the night of 7 / 8 December , the Indian 21st Infantry Brigade from the Indian 8th Infantry Division amalgamated the western flank of the 1st Canadian Division into their own lines . As a result of the withdrawal , Canadian efforts would focus on achieving a bridgehead at San Leonardo .
|
lemma (in order_topology) order_tendsto_iff: "(f \<longlongrightarrow> x) F \<longleftrightarrow> (\<forall>l<x. eventually (\<lambda>x. l < f x) F) \<and> (\<forall>u>x. eventually (\<lambda>x. f x < u) F)" |
Formal statement is: lemma base_residue: assumes "open s" "z\<in>s" "r>0" and f_holo:"f holomorphic_on (s - {z})" and r_cball:"cball z r \<subseteq> s" shows "(f has_contour_integral 2 * pi * \<i> * (residue f z)) (circlepath z r)" Informal statement is: If $f$ is holomorphic on a punctured neighborhood of $z$, then the contour integral of $f$ around a circle of radius $r$ centered at $z$ is $2\pi i$ times the residue of $f$ at $z$. |
Barker died at Worthing Hospital on 16 February 1973 , aged 77 years . Two funeral services were held – one in Storrington Church and one in Barker 's maisonette . Her ashes were scattered in Storrington churchyard . In 1989 , Frederick Warne , a division of Penguin Books since 1983 , acquired the Flower Fairies properties .
|
function lse = mylogsumexp(b)
% does logsumexp across columns
B = max(b,[],2);
if issparse(b)
lse = log(sum(exp(b-repmat(B,[1 size(b,2)])),2))+B;
else
lse = log(sum(exp(b-repmatC(B,[1 size(b,2)])),2))+B;
end
end |
(* Property from Case-Analysis for Rippling and Inductive Proof,
Moa Johansson, Lucas Dixon and Alan Bundy, ITP 2010.
This Isabelle theory is produced using the TIP tool offered at the following website:
https://github.com/tip-org/tools
This file was originally provided as part of TIP benchmark at the following website:
https://github.com/tip-org/benchmarks
Yutaka Nagashima at CIIRC, CTU changed the TIP output theory file slightly
to make it compatible with Isabelle2017.
Some proofs were added by Yutaka Nagashima.*)
theory TIP_prop_63
imports "../../Test_Base"
begin
datatype 'a list = nil2 | cons2 "'a" "'a list"
datatype Nat = Z | S "Nat"
fun len :: "'a list => Nat" where
"len (nil2) = Z"
| "len (cons2 y xs) = S (len xs)"
fun last :: "Nat list => Nat" where
"last (nil2) = Z"
| "last (cons2 y (nil2)) = y"
| "last (cons2 y (cons2 x2 x3)) = last (cons2 x2 x3)"
fun drop :: "Nat => 'a list => 'a list" where
"drop (Z) y = y"
| "drop (S z) (nil2) = nil2"
| "drop (S z) (cons2 x2 x3) = drop z x3"
fun t2 :: "Nat => Nat => bool" where
"t2 x (Z) = False"
| "t2 (Z) (S z) = True"
| "t2 (S x2) (S z) = t2 x2 z"
theorem property0 :
"((t2 n (len xs)) ==> ((last (drop n xs)) = (last xs)))"
oops
end |
Formal statement is: theorem great_Picard: assumes "open M" "z \<in> M" "a \<noteq> b" and holf: "f holomorphic_on (M - {z})" and fab: "\<And>w. w \<in> M - {z} \<Longrightarrow> f w \<noteq> a \<and> f w \<noteq> b" obtains l where "(f \<longlongrightarrow> l) (at z) \<or> ((inverse \<circ> f) \<longlongrightarrow> l) (at z)" Informal statement is: If $f$ is holomorphic on an open set $M$ and $f$ does not take on the values $a$ and $b$, then either $f$ or $1/f$ has a limit at $z$. |
He was appointed Officer of the Order of the British Empire ( OBE ) in the 2016 New Year Honours for services to drama and to the community in Northern Ireland .
|
/-
Continuous Linear Maps
These are a well-behaved subset of all linear maps. In finite dimensional normed vector spaces, all linear maps are continuous. For a certain type of normed space (which?), continuous linear maps and bounded linear maps are the same.
The derivative of f : E → F is f' : E → continuous_linear_map E F.
-/
import differentiability.normed_space
universes u v w x
-- TODO: maybe continuous should be a structure and not a regular prop
structure is_continuous_linear_map {k : Type u} {E : Type v} {F : Type w} [normed_field k] [normed_space k E] [normed_space k F] (L : E → F) extends is_linear_map L : Prop :=
(continuous : continuous L)
namespace is_continuous_linear_map
variables {k : Type u} {E : Type v} {F : Type w} {G : Type x}
variables [normed_field k] [normed_space k E] [normed_space k F] [normed_space k G]
variable {L : E → F}
include k
section
variable (hL : is_continuous_linear_map L)
include hL
-- linear map simp lemmas
-- TODO: should there be an smul lemma
@[simp] lemma zero : L 0 = 0 := hL.to_is_linear_map.zero
@[simp] lemma neg (v : E) : L (- v) = - L v := hL.to_is_linear_map.neg _
@[simp] lemma sub (v w : E) : L (v - w) = L v - L w := hL.to_is_linear_map.sub _ _
@[simp] lemma sum {ι : Type x} {t : finset ι} {f : ι → E} : L (t.sum f) = t.sum (λi, L (f i)) := hL.to_is_linear_map.sum
end
-- TODO: is_linear_map and continuous have different order conventions for this theorem. adopting is_linear_map's
lemma comp {M : G → E} : is_continuous_linear_map L → is_continuous_linear_map M → is_continuous_linear_map (L ∘ M)
| ⟨L_lin, L_cont⟩ ⟨M_lin, M_cont⟩ := ⟨is_linear_map.comp L_lin M_lin, continuous.comp M_cont L_cont⟩
lemma id : is_continuous_linear_map (id : E → E) := ⟨is_linear_map.id, continuous_id⟩
-- no inverse thm except for special circumstances
lemma map_zero : is_continuous_linear_map (λv, 0 : E → F) := ⟨is_linear_map.map_zero, continuous_const⟩
-- TODO: could move hypothesis to the left if continuous was a structure b/c then I could use to_is_continuous
lemma map_neg : is_continuous_linear_map L → is_continuous_linear_map (λv, - L v)
| ⟨lin, cont⟩ := ⟨is_linear_map.map_neg lin, continuous_neg cont⟩
lemma map_add {M : E → F} : is_continuous_linear_map L → is_continuous_linear_map M → is_continuous_linear_map (λv, L v + M v)
| ⟨L_lin, L_cont⟩ ⟨M_lin, M_cont⟩ := ⟨is_linear_map.map_add L_lin M_lin, continuous_add L_cont M_cont⟩
-- TODO: I don't understand this lemma so I don't want to translate it
/- lemma map_sum [decidable_eq δ] {t : finset δ} {f : δ → β → γ} :
(∀d∈t, is_linear_map (f d)) → is_linear_map (λb, t.sum $ λd, f d b) -/
lemma map_sub {M : E → F} : is_continuous_linear_map L → is_continuous_linear_map M → is_continuous_linear_map (λv, L v - M v)
| ⟨L_lin, L_cont⟩ ⟨M_lin, M_cont⟩ := ⟨is_linear_map.map_sub L_lin M_lin, continuous_sub L_cont M_cont⟩
-- TODO: this requires topological vector spaces
lemma map_smul_right {c : k} : is_continuous_linear_map L →
is_continuous_linear_map (λv, c • L v)
| ⟨lin, cont⟩ := ⟨is_linear_map.map_smul_right lin, sorry⟩
-- TODO: this requires topological vector spaces and normed_field.to_normed_space (see ring.to_module in module.lean)
lemma map_smul_left {L : E → k} {v : F} : is_continuous_linear_map L → is_continuous_linear_map (λc, L c • v)
| ⟨lin, cont⟩ := sorry
end is_continuous_linear_map
-- begins diverging from homeos approach
-- draw from linear_map_module and poly
-- TODO: convert poly-like theorems
def continuous_linear_map {k : Type u} (E : Type v) (F : Type w) [normed_field k] [normed_space k E] [normed_space k F] :=
subtype (@is_continuous_linear_map k E F _ _ _)
namespace continuous_linear_map
variables {k : Type u} {E : Type v} {F : Type w} {G : Type x}
variables [normed_field k] [normed_space k E] [normed_space k F] [normed_space k G]
variables {c : k} {v w : E} {L M : continuous_linear_map E F}
include k
instance : has_coe_to_fun (continuous_linear_map E F) := ⟨_, subtype.val⟩
@[extensionality]
theorem ext {M : continuous_linear_map E F} (h : ∀ v, L v = M v) : L = M := subtype.eq $ funext h
lemma is_clm (L : continuous_linear_map E F) : is_continuous_linear_map L := L.property
def subst (L : continuous_linear_map E F) (M : E → F) (e : ∀ v, L v = M v) : continuous_linear_map E F :=
⟨M, by rw ← (funext e : coe_fn L = M); exact L.is_clm⟩
def comp (L :continuous_linear_map F G) (M : continuous_linear_map E F) : continuous_linear_map E G := ⟨λv, L (M v), is_continuous_linear_map.comp L.is_clm M.is_clm⟩
@[simp] lemma map_add : L (v + w) = L v + L w := L.is_clm.add v w
@[simp] lemma map_zero : L 0 = 0 := L.is_clm.zero
@[simp] lemma map_smul : L (c • v) = c • L v := L.is_clm.smul c v
@[simp] lemma map_neg : L (-v) = -L v := L.is_clm.neg _
@[simp] lemma map_sub : L (v - w) = L v - L w := L.is_clm.sub _ _
section add_comm_group
def add : continuous_linear_map E F → continuous_linear_map E F → continuous_linear_map E F := λ L M, ⟨L + M, is_continuous_linear_map.map_add L.is_clm M.is_clm⟩
def zero : continuous_linear_map E F := ⟨λv, 0, is_continuous_linear_map.map_zero⟩
def neg : continuous_linear_map E F → continuous_linear_map E F := λ L, ⟨λv, -(L v), is_continuous_linear_map.map_neg L.is_clm⟩
instance : has_add (continuous_linear_map E F) := ⟨add⟩
instance : has_zero (continuous_linear_map E F) := ⟨zero⟩
instance : has_neg (continuous_linear_map E F) := ⟨neg⟩
@[simp] lemma add_app : (L + M) v = L v + M v := rfl
@[simp] lemma zero_app : (0 : continuous_linear_map E F) v = 0 := rfl
@[simp] lemma neg_app : (-L) v = -L v := rfl
instance : add_comm_group (continuous_linear_map E F) :=
by refine {add := (+), zero := 0, neg := has_neg.neg, ..}; { intros, apply ext, simp }
end add_comm_group
section module
-- TODO: need to prove topological vector space stuff
def smul : k → continuous_linear_map E F → continuous_linear_map E F := λ c L, ⟨λ v, c•(L v), is_continuous_linear_map.smul_right c L.is_clm⟩
instance : has_scalar k (continuous_linear_map E F) := ⟨smul⟩
@[simp] lemma smul_app : (c • L) v = c • (L v) := rfl
instance : module k (continuous_linear_map E F) :=
by refine {smul := (•), ..continuous_linear_map.add_comm_group, ..};
{ intros, apply ext, simp [smul_add, add_smul, mul_smul] }
end module
section metric_space
-- TODO!
end metric_space
section normed_space
-- TODO!
end normed_space
end continuous_linear_map
|
Formal statement is: lemma sets_null_measure[simp, measurable_cong]: "sets (null_measure M) = sets M" Informal statement is: The sets of a null measure are the same as the sets of the underlying measure space. |
Payments for Search Engine Optimization, Internet Marketing and Social Media Optimization services are nonrefundable, and eNet Web Services does not issue refunds for fees paid in advance. Once a payment or deposit is made, it is non-refundable. All set-up fees are non-refundable as it is applied to costs immediately incurred by eNet Web Services in initiating services. If a project is cancelled or postponed, all money paid are retained by eNet Web Services and if applicable, a fee for all work completed beyond what was already paid for shall be paid by the client.
If we receive a chargeback or payment dispute (i.e. PayPal Dispute) from a credit card company or bank, your service and/or project will be suspended without notice. A $50 chargeback fee (issued to recover fees passed on to us by the credit company), plus any outstanding balances accrued as a result of the chargeback(s) must be paid in full before service is restored, files delivered, or any further work is done. Instead of issuing a chargeback, please contact us to address any billing issues. Requesting a chargeback or opening a PayPal dispute for a valid charge from us is fraud, and is never an appropriate or legal means of obtaining a refund.
Payments for custom design projects are made to us in increments as a courtesy to the client. Once a payment or deposit is made, it is non-refundable. If a project is cancelled or postponed, all money paid are retained by eNet Web Services and if applicable, a fee for all work completed beyond what was already paid for shall be paid by the client.
Payments for past months of web hosting are non-refundable. Hosting accounts are set up at the time of order and are allotted a specific amount of server resources, according to the plan purchased. If client did not make use of the account, payment for services is still due. Hosting accounts are not cancelled until notice is received from the client in writing, or until 15 days after due date of payment not received. If client paid for hosting account for 6 or 12 months ahead and cancels service before plan expiration date, a refund may be given for the months not yet elapsed. If client received free products and/or services with their hosting plan purchase, the value of the free services will be deducted from the refund amount. eNet Web Services reserves the right to disable and/or terminate a user�s account if a user is found in violation of the terms. Accounts terminated due to policy violations will not be refunded. |
module Replica.App.Clock
import Control.App
import public System.Clock
%default total
public export
interface SystemClock e where
threadClock : App e (Clock Thread)
export
PrimIO e => SystemClock e where
threadClock = primIO $ clockTime Thread
export
showDuration : Clock Duration -> String
showDuration (MkClock seconds nanoseconds) = let
ns = div nanoseconds 10000
in "\{show seconds}.\{show ns}s"
export
durationOf : SystemClock e => App e a -> App e (Clock Duration, a)
durationOf x = do
start <- threadClock
res <- x
end <- threadClock
pure (timeDifference end start, res)
|
State Before: α : Type u_1
β : Type u_2
γ : Type u_3
ι : Sort ?u.275320
ι' : Sort ?u.275323
ι₂ : Sort ?u.275326
κ : ι → Sort ?u.275331
κ₁ : ι → Sort ?u.275336
κ₂ : ι → Sort ?u.275341
κ' : ι' → Sort ?u.275346
f : α → β → γ
s : Set α
t : Set β
⊢ image2 f s t = seq (f '' s) t State After: case h
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Sort ?u.275320
ι' : Sort ?u.275323
ι₂ : Sort ?u.275326
κ : ι → Sort ?u.275331
κ₁ : ι → Sort ?u.275336
κ₂ : ι → Sort ?u.275341
κ' : ι' → Sort ?u.275346
f : α → β → γ
s : Set α
t : Set β
x✝ : γ
⊢ x✝ ∈ image2 f s t ↔ x✝ ∈ seq (f '' s) t Tactic: ext State Before: case h
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Sort ?u.275320
ι' : Sort ?u.275323
ι₂ : Sort ?u.275326
κ : ι → Sort ?u.275331
κ₁ : ι → Sort ?u.275336
κ₂ : ι → Sort ?u.275341
κ' : ι' → Sort ?u.275346
f : α → β → γ
s : Set α
t : Set β
x✝ : γ
⊢ x✝ ∈ image2 f s t ↔ x✝ ∈ seq (f '' s) t State After: no goals Tactic: simp |
/-
Copyright (c) 2020 Simon Hudon. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Simon Hudon
-/
import tactic.apply
import control.fix
import order.omega_complete_partial_order
/-!
# Lawful fixed point operators
This module defines the laws required of a `has_fix` instance, using the theory of
omega complete partial orders (ωCPO). Proofs of the lawfulness of all `has_fix` instances in
`control.fix` are provided.
## Main definition
* class `lawful_fix`
-/
universes u v
open_locale classical
variables {α : Type*} {β : α → Type*}
open omega_complete_partial_order
/-- Intuitively, a fixed point operator `fix` is lawful if it satisfies `fix f = f (fix f)` for all
`f`, but this is inconsistent / uninteresting in most cases due to the existence of "exotic"
functions `f`, such as the function that is defined iff its argument is not, familiar from the
halting problem. Instead, this requirement is limited to only functions that are `continuous` in the
sense of `ω`-complete partial orders, which excludes the example because it is not monotone
(making the input argument less defined can make `f` more defined). -/
class lawful_fix (α : Type*) [omega_complete_partial_order α] extends has_fix α :=
(fix_eq : ∀ {f : α →ₘ α}, continuous f → has_fix.fix f = f (has_fix.fix f))
lemma lawful_fix.fix_eq' {α} [omega_complete_partial_order α] [lawful_fix α]
{f : α → α} (hf : continuous' f) :
has_fix.fix f = f (has_fix.fix f) :=
lawful_fix.fix_eq (hf.to_bundled _)
namespace part
open part nat nat.upto
namespace fix
variables (f : (Π a, part $ β a) →ₘ (Π a, part $ β a))
lemma approx_mono' {i : ℕ} : fix.approx f i ≤ fix.approx f (succ i) :=
begin
induction i, dsimp [approx], apply @bot_le _ _ _ (f ⊥),
intro, apply f.monotone, apply i_ih
end
lemma approx_mono ⦃i j : ℕ⦄ (hij : i ≤ j) : approx f i ≤ approx f j :=
begin
induction j, cases hij, refine @le_refl _ _ _,
cases hij, apply @le_refl _ _ _,
apply @le_trans _ _ _ (approx f j_n) _ (j_ih ‹_›),
apply approx_mono' f
end
lemma mem_iff (a : α) (b : β a) : b ∈ part.fix f a ↔ ∃ i, b ∈ approx f i a :=
begin
by_cases h₀ : ∃ (i : ℕ), (approx f i a).dom,
{ simp only [part.fix_def f h₀],
split; intro hh, exact ⟨_,hh⟩,
have h₁ := nat.find_spec h₀,
rw [dom_iff_mem] at h₁,
cases h₁ with y h₁,
replace h₁ := approx_mono' f _ _ h₁,
suffices : y = b, subst this, exact h₁,
cases hh with i hh,
revert h₁, generalize : (succ (nat.find h₀)) = j, intro,
wlog : i ≤ j := le_total i j using [i j b y,j i y b],
replace hh := approx_mono f case _ _ hh,
apply part.mem_unique h₁ hh },
{ simp only [fix_def' ⇑f h₀, not_exists, false_iff, not_mem_none],
simp only [dom_iff_mem, not_exists] at h₀,
intro, apply h₀ }
end
lemma approx_le_fix (i : ℕ) : approx f i ≤ part.fix f :=
assume a b hh,
by { rw [mem_iff f], exact ⟨_,hh⟩ }
lemma exists_fix_le_approx (x : α) : ∃ i, part.fix f x ≤ approx f i x :=
begin
by_cases hh : ∃ i b, b ∈ approx f i x,
{ rcases hh with ⟨i,b,hb⟩, existsi i,
intros b' h',
have hb' := approx_le_fix f i _ _ hb,
have hh := part.mem_unique h' hb',
subst hh, exact hb },
{ simp only [not_exists] at hh, existsi 0,
intros b' h',
simp only [mem_iff f] at h',
cases h' with i h',
cases hh _ _ h' }
end
include f
/-- The series of approximations of `fix f` (see `approx`) as a `chain` -/
def approx_chain : chain (Π a, part $ β a) := ⟨approx f, approx_mono f⟩
lemma le_f_of_mem_approx {x} (hx : x ∈ approx_chain f) : x ≤ f x :=
begin
revert hx, simp [(∈)],
intros i hx, subst x,
apply approx_mono'
end
lemma approx_mem_approx_chain {i} : approx f i ∈ approx_chain f :=
stream.mem_of_nth_eq rfl
end fix
open fix
variables {α}
variables (f : (Π a, part $ β a) →ₘ (Π a, part $ β a))
open omega_complete_partial_order
open part (hiding ωSup) nat
open nat.upto omega_complete_partial_order
lemma fix_eq_ωSup : part.fix f = ωSup (approx_chain f) :=
begin
apply le_antisymm,
{ intro x, cases exists_fix_le_approx f x with i hx,
transitivity' approx f i.succ x,
{ transitivity', apply hx, apply approx_mono' f },
apply' le_ωSup_of_le i.succ,
dsimp [approx], refl', },
{ apply ωSup_le _ _ _,
simp only [fix.approx_chain, preorder_hom.coe_fun_mk],
intros y x, apply approx_le_fix f },
end
lemma fix_le {X : Π a, part $ β a} (hX : f X ≤ X) : part.fix f ≤ X :=
begin
rw fix_eq_ωSup f,
apply ωSup_le _ _ _,
simp only [fix.approx_chain, preorder_hom.coe_fun_mk],
intros i,
induction i, dsimp [fix.approx], apply' bot_le,
transitivity' f X, apply f.monotone i_ih,
apply hX
end
variables {f} (hc : continuous f)
include hc
lemma fix_eq : part.fix f = f (part.fix f) :=
begin
rw [fix_eq_ωSup f,hc],
apply le_antisymm,
{ apply ωSup_le_ωSup_of_le _,
intros i, existsi [i], intro x, -- intros x y hx,
apply le_f_of_mem_approx _ ⟨i, rfl⟩, },
{ apply ωSup_le_ωSup_of_le _,
intros i, existsi i.succ, refl', }
end
end part
namespace part
/-- `to_unit` as a monotone function -/
@[simps]
def to_unit_mono (f : part α →ₘ part α) : (unit → part α) →ₘ (unit → part α) :=
{ to_fun := λ x u, f (x u),
monotone' := λ x y (h : x ≤ y) u, f.monotone $ h u }
lemma to_unit_cont (f : part α →ₘ part α) (hc : continuous f) : continuous (to_unit_mono f)
| c := begin
ext ⟨⟩ : 1,
dsimp [omega_complete_partial_order.ωSup],
erw [hc, chain.map_comp], refl
end
noncomputable instance : lawful_fix (part α) :=
⟨λ f hc, show part.fix (to_unit_mono f) () = _, by rw part.fix_eq (to_unit_cont f hc); refl⟩
end part
open sigma
namespace pi
noncomputable instance {β} : lawful_fix (α → part β) := ⟨λ f, part.fix_eq⟩
variables {γ : Π a : α, β a → Type*}
section monotone
variables (α β γ)
/-- `sigma.curry` as a monotone function. -/
@[simps]
def monotone_curry [∀ x y, preorder $ γ x y] :
(Π x : Σ a, β a, γ x.1 x.2) →ₘ (Π a (b : β a), γ a b) :=
{ to_fun := curry,
monotone' := λ x y h a b, h ⟨a,b⟩ }
/-- `sigma.uncurry` as a monotone function. -/
@[simps]
def monotone_uncurry [∀ x y, preorder $ γ x y] :
(Π a (b : β a), γ a b) →ₘ (Π x : Σ a, β a, γ x.1 x.2) :=
{ to_fun := uncurry,
monotone' := λ x y h a, h a.1 a.2 }
variables [∀ x y, omega_complete_partial_order $ γ x y]
open omega_complete_partial_order.chain
lemma continuous_curry : continuous $ monotone_curry α β γ :=
λ c, by { ext x y, dsimp [curry,ωSup], rw [map_comp,map_comp], refl }
lemma continuous_uncurry : continuous $ monotone_uncurry α β γ :=
λ c, by { ext x y, dsimp [uncurry,ωSup], rw [map_comp,map_comp], refl }
end monotone
open has_fix
instance [has_fix $ Π x : sigma β, γ x.1 x.2] : has_fix (Π x (y : β x), γ x y) :=
⟨ λ f, curry (fix $ uncurry ∘ f ∘ curry) ⟩
variables [∀ x y, omega_complete_partial_order $ γ x y]
section curry
variables {f : (Π x (y : β x), γ x y) →ₘ (Π x (y : β x), γ x y)}
variables (hc : continuous f)
lemma uncurry_curry_continuous :
continuous $ (monotone_uncurry α β γ).comp $ f.comp $ monotone_curry α β γ :=
continuous_comp _ _
(continuous_comp _ _ (continuous_curry _ _ _) hc)
(continuous_uncurry _ _ _)
end curry
instance pi.lawful_fix' [lawful_fix $ Π x : sigma β, γ x.1 x.2] : lawful_fix (Π x y, γ x y) :=
{ fix_eq := λ f hc,
begin
dsimp [fix],
conv { to_lhs, erw [lawful_fix.fix_eq (uncurry_curry_continuous hc)] },
refl,
end, }
end pi
|
`is_element/young_partitions` := (k,n) -> proc(lambda)
local i;
if not(type(lambda,list(nonnegint))) then
return false;
fi;
if nops(lambda) <> k then
return false;
fi;
if k > 0 and lambda[1] > n-k then
return false;
fi;
for i from 1 to k-1 do
if lambda[i] < lambda[i+1] then
return false;
fi;
od;
return true;
end:
`young_partition/from_set` := (n,k) -> proc(P)
local i;
return [seq(n-k+i-P[i],i=1..k)];
end:
`list_elements/young_partitions` := proc(n,k)
map(`young_partition/from_set`(n,k),combinat[choose](n,k));
end:
`random_element/young_partitions` := (n,k) -> proc()
if k > n then return FAIL; fi;
`young_partition/from_set`(n,k)(combinat[randcomb](n,k));
end:
`count_elements/young_partitions` := (n,k) -> binomial(n,k);
`weight/young_partitions` := (lambda) -> `+`(op(lambda)):
`length/young_partitions` := (lambda) -> nops(lambda):
`cell_dim/young_partitions` := (n,k) ->
k * (n - k) - `weight/young_partitions`(lambda):
`matrix/young_partitions` := (n,k) -> (lambda) -> proc(a)
local A,P,S,u,i,j;
A := Matrix(k,n);
P := [seq(n-k+i-lambda[i],i=1..k)];
S := {op(P)};
u := 1;
for i from 1 to k do
for j from 1 to P[i] - 1 do
if not(member(j,S)) then
A[i,j] := a[u];
u := u+1;
fi;
od:
A[i,P[i]] := 1;
od:
return A;
end:
`giambelli_matrix/young_partitions` := proc(lambda)
local i,j,k,f;
k := nops(lambda);
f := (i) -> `if`(i < 0,0,`if`(i = 0,1,c[i]));
Matrix([seq([seq(f(lambda[i]-i+j),j=1..k)],i=1..k)]);
end:
`schur_function/young_partitions` := (lambda) ->
Determinant(`giambelli_matrix/young_partitions`(lambda)):
|
-- @@stderr --
dtrace: failed to compile script test/unittest/actions/printf/err.D_SYNTAX.missing_fmt-2.d: [D_SYNTAX] line 19: format conversion #1 name expected before end of format string
|
# Run code for previous steps
include("neid_solar_1_read.jl")
# Don't import Plots if make_plots set to false
make_plots = isdefined(Main,:make_plots) ? make_plots : true
if make_plots
using Plots
end
order_list_timeseries = RvSpectML.make_order_list_timeseries(solar_data)
order_list_timeseries = RvSpectML.filter_bad_chunks(order_list_timeseries)
RvSpectML.normalize_spectra!(order_list_timeseries,solar_data);
if make_plots
order_idx = 20:22
plt = RvSpectML.plot_spectrum_chunks(order_list_timeseries, order_idx)
end
using DataFrames, CSV, Query
using Statistics
vald_filename = joinpath(ancilary_solar_data_path,"VALD_Fe1_DP_rejectTelluricSlope0.0_badLineFilterESPRESSO-strict-NEID-BIS_overlapcutoff6e-05_depthcutoff0.05_allowBlends0_wavesReiners_depthssolar_nbin1depth0.mas")
vald_df = RvSpectML.read_mask_vald(vald_filename)
lambda_range_with_data = (min = maximum(d->minimum(d.λ),solar_data), max = minimum(d->maximum(d.λ),solar_data) )
orig_chunk_list_df = vald_df |>
@filter(lambda_range_with_data.min <= _.lambda ) |>
@filter( _.lambda < lambda_range_with_data.max) |>
# @filter( _.lambda < 6000.0 ) |> # Avoid tellurics at redder wavelengths
# @filter( _.lambda >6157 || _.lambda < 6155 ) |> # Avoid "line" w/ large variability
DataFrame
find_overlapping_chunks(orig_chunk_list_df)
chunk_list_df = RvSpectML.merge_chunks(orig_chunk_list_df)
@assert find_overlapping_chunks(chunk_list_df) == nothing
# TODO: FIX: Problem with ESPRESSO mask having lots of lines getting meged into humongous chunks that don't fit into the order!
chunk_list_timeseries = RvSpectML.make_chunk_list_timeseries(solar_data,chunk_list_df)
# Check that no NaN's included
(chunk_list_timeseries, chunk_list_df) = RvSpectML.filter_bad_chunks(chunk_list_timeseries,chunk_list_df)
println(size(chunk_list_df), " vs ", num_chunks(chunk_list_timeseries) )
using Plots
if make_plots
#order_idx = 20:22
# plt = RvSpectML.plot_spectrum_chunks(order_list_timeseries, order_idx)
chunk_idx = 23
for c in chunk_idx
t = 1
#if(sum(chunk_list_df.line_depths[c])<0.25) continue end
λ_mid = sqrt(chunk_list_df.lambda_hi[c]*chunk_list_df.lambda_lo[c])
println("c= ",c , " λs= ",chunk_list_df.lambda[c]," depths= ",chunk_list_df.depth[c])
flush(stdout)
end
plt = RvSpectML.plot_spectrum_chunks(chunk_list_timeseries, chunk_idx, plt=plot(), color=:black)
display(plt)
end
|
function [RSS, XYproj] = Residuals_ellipse(XY,ParG)
%
% Projecting a given set of points onto an ellipse
% and computing the distances from the points to the ellipse
%
% This is a modified version of an iterative algorithm published by D. Eberly
% Internet publication: "Distance from a point to an ellipse in 2D" (2004)
% Geometric Tools, LLC, www.geometrictools.com
% Book publication: "3D Game Engine Design", 2nd edition.
% Morgan Kaufmann Publishers, San Francisco, CA, 2007.
% (see Section 14.13.1)
%
% Input: XY(n,2) is the array of coordinates of n points x(i)=XY(i,1), y(i)=XY(i,2)
% ParG is a vector 5x1 of the ellipse parameters
% ParG = [Center(1:2), Axes(1:2), Angle]'
% Center - the coordinates of the ellipse's center
% Axes - the axes (major, minor)
% Angle - the angle of tilt of the ellipse
%
% Output: RSS is the Residual Sum of Squares (the sum of squares of the distances)
% XYproj is the array of coordinates of projections
%
% The algorithm is proven to converge and reaches an accuracy of 7-8 significant digit
% It takes 4-5 iterations per point, on average.
Center = ParG(1:2); Axes = ParG(3:4); Angle = ParG(5);
n = size(XY,1);
XYproj = zeros(n,2);
tolerance = 1e-9;
% First handling the circle case
if abs((Axes(1)-Axes(2))/Axes(1))<tolerance
phiall = angle(XY(:,1)-Center(1) + sqrt(-1)*(XY(:,2)-Center(2)));
XYproj = [Axes(1)*cos(phiall)+Center(1) Axes(2)*sin(phiall)+Center(2)];
RSS = norm(XY-XYproj,'fro')^2;
return;
end
% Now dealing with proper ellipses
a = Axes(1); b = Axes(2);
aa = a^2; bb = b^2;
tol_a = tolerance*a;
tol_b = tolerance*b;
tol_aa = tolerance*aa;
% Matrix Q for rotating the points and the ellipse to the canonical system
s = sin(Angle); c = cos(Angle);
Q = [c -s; s c];
% data points in canonical coordinates
XY0 = [XY(:,1)-Center(1) XY(:,2)-Center(2)]*Q;
XYA = abs(XY0);
Tini = max(a*(XYA(:,1)-a),b*(XYA(:,2)-b));
% main loop over the data points
for i=1:n
u = XYA(i,1); v = XYA(i,2);
ua = u*a; vb = v*b;
if (u == 0)
z1 = 1;
else
z1 = sign(XY0(i,1));
end
if (v == 0)
z2 = 1;
else
z2 = sign(XY0(i,2));
end
% does the point lie on the minor axis?
if u<tol_a
if XY0(i,2)<0
XYproj(i,:) = [0 -b];
else
XYproj(i,:) = [0 b];
end
continue;
end
% does the point lie on the major axis?
if v<tol_b
if u<a-bb/a
xproj = aa*u/(aa-bb);
XYproj(i,:) = [z1*xproj z2*b*sqrt(1-(xproj/a)^2)];
else
XYproj(i,:) = [z1*a 0];
end
continue;
end
% generic case: start the iterative procedure
T = Tini(i);
for iter=1:100
Taa = T + aa;
Tbb = T + bb;
PP1 = (ua/Taa)^2;
PP2 = (vb/Tbb)^2;
F = PP1 + PP2 - 1;
if F<0; break; end;
Fder = 2*(PP1/Taa + PP2/Tbb);
Ratio = F/Fder;
if (Ratio<tol_aa); break; end;
T = T + Ratio;
end
% compute the projection of the point onto the ellipse
xproj = XY0(i,1)*aa/Taa;
XYproj(i,:) = [xproj sign(XY0(i,2))*b*sqrt(1-(xproj/a)^2)];
end % end the main loop
% rotate back to the original system
XYproj = XYproj*Q';
XYproj = [XYproj(:,1)+Center(1) XYproj(:,2)+Center(2)];
RSS = norm(XY-XYproj,'fro')^2;
end % Residuals_ellipse
|
{-# LANGUAGE ScopedTypeVariables #-}
module Main (main) where
import Data.Complex
import Data.Monoid ((<>))
import Text.PrettyPrint.Mainland
import Control.Monad.IO.Class (liftIO)
import Spiral
import Spiral.Exp
import Spiral.FFT.CooleyTukey
import Spiral.SPL
import Spiral.Util.Pretty.Maple
main :: IO ()
main = defaultMain $ \args -> do
n <- case args of
[s] -> return (read s)
_ -> return 4
let dft_n :: SPL (Exp (Complex Double))
dft_n = dit n
--liftIO $ check dft_n
liftIO $ putDocLn $ text "with(LinearAlgebra);"
liftIO $ putDocLn $ text "A :=" <+> ppr (DFT n :: SPL (Exp (Complex Double))) <> semi
liftIO $ putDocLn $ text "B :=" <+> ppr dft_n <> semi
|
-- @@stderr --
dtrace: failed to compile script test/unittest/typedef/err.D_SYNTAX.BadExistingTypedef.d: [D_SYNTAX] line 19: syntax error near "new_int;"
|
theory MultiplicationRusse
imports Main
begin
record 's algorithm =
init :: 's
trans :: "('s \<times> 's) set"
inductive
reachable :: "'s algorithm \<Rightarrow> 's \<Rightarrow> bool"
for A :: "'s algorithm"
where
reachable_0: "reachable A (init A)"
| reachable_n: "\<lbrakk> reachable A s; (s,t) \<in> (trans A) \<rbrakk>
\<Longrightarrow> reachable A t"
definition invariant where
"invariant A P \<equiv> (\<forall> s . reachable A s \<longrightarrow> P s)"
theorem invariantI:
fixes A P
assumes "P (init A)"
and "\<And> s t . \<lbrakk>reachable A s; P s; (s,t) \<in> trans A\<rbrakk>
\<Longrightarrow> P t"
shows "invariant A P"
proof (auto simp add:invariant_def)
fix s
assume "reachable A s"
thus "P s"
proof (induct rule:reachable.induct)
show "P (init A)" using assms by auto
next
fix s t
assume "reachable A s" and "P s"
and "(s, t) \<in> trans A"
thus "P t" using assms(2) by simp
qed
qed
theorem invariant_imp:
fixes A P Q
assumes "invariant A P"
and "\<And> s . P s \<Longrightarrow> Q s"
shows "invariant A Q"
using assms
by (auto simp add:invariant_def)
datatype ligne = l1 | l2 | l3 | l4 | l5
record MultVars =
ligne :: ligne
x :: nat
y :: nat
r :: nat
sledgehammer_params[timeout=600]
locale Mult =
fixes a b :: nat
begin
definition MultRusse where
"MultRusse \<equiv> \<lparr>
init = \<lparr>ligne = l1, x = a, y = b, r = 0\<rparr>,
trans = { (s,t) .
ligne s = l1
\<and> (if (x s \<noteq> 0)
then t = s\<lparr>ligne := l2\<rparr>
else t = s\<lparr>ligne := l5\<rparr>)
\<or> ligne s = l2
\<and> (if (x s mod 2 = 1)
then t = s\<lparr>ligne := l3, r := (r s) + (y s)\<rparr>
else t = s\<lparr>ligne := l3\<rparr>)
\<or> ligne s = l3 \<and> t = s\<lparr>ligne := l4, x := (x s) div 2\<rparr>
\<or> ligne s = l4 \<and> t = s\<lparr>ligne := l1, y := (y s) * 2\<rparr>
}
\<rparr>"
definition valide :: "MultVars \<Rightarrow> bool" where
"valide s \<equiv>
ligne s = l5 \<longrightarrow> r s = a*b"
definition ind :: "MultVars \<Rightarrow> bool" where
"ind s \<equiv>
(ligne s \<in> {l1,l2,l5} \<longrightarrow> r s + (x s)*(y s) = a*b)
\<and> (ligne s = l3 \<longrightarrow> r s + (x s)*(y s) =
(if ((x s) mod 2 = 0) then a*b else a*b + (y s)))
\<and> (ligne s = l4 \<longrightarrow> r s + 2*(x s)*(y s) = a*b)
\<and> (ligne s = l5 \<longrightarrow> x s = 0)"
declare
MultRusse_def [simp]
valide_def [simp]
ind_def [simp]
split_if [split]
split_if_asm [split]
lemma "ind s \<Longrightarrow> valide s"
by auto
lemma ind_inv:
"invariant MultRusse ind"
proof (rule invariantI)
show "ind (init MultRusse)" by auto
next
fix s t
assume 1:"ind s"
and 2:"(s,t) \<in> trans MultRusse"
show "ind t"
proof (cases "ligne s")
case l1
hence 3:"if (x s \<noteq> 0)
then t = s\<lparr>ligne := l2\<rparr>
else t = s\<lparr>ligne := l5\<rparr>"
using 2 by force
show ?thesis
proof (cases "x s \<noteq> 0")
case True
with 3 have "t = s\<lparr>ligne := l2\<rparr>" by auto
with 1 l1 show ?thesis by auto
next
case False
with 3 have "t = s\<lparr>ligne := l5\<rparr>" by auto
with 1 l1 False show ?thesis by auto
qed
next
case l2
hence 3:
"if (x s mod 2 = 1)
then t = s\<lparr>ligne := l3, r := (r s) + (y s)\<rparr>
else t = s\<lparr>ligne := l3\<rparr>"
using 2 by force
show ?thesis
proof (cases "x s mod 2 = 1")
case True
have "t = s\<lparr>ligne := l3, r := (r s) + (y s)\<rparr>"
using True 3 by auto
thus ?thesis using 1 l2 True by auto
next
case False
have "t = s\<lparr>ligne := l3\<rparr>"
using False 3 by auto
thus ?thesis using 1 l2 False by auto
qed
next
case l3
hence 3:"t = s\<lparr>ligne := l4, x := (x s) div 2\<rparr>"
using 2 by force
show ?thesis
proof (cases "x s mod 2 = 0")
case True
thus ?thesis using 1 3 l3 by auto
next
case False
have "x s \<noteq> 0" using False by linarith
hence 4:"2*(x s div 2)*(y s) = (x s)*(y s) - (y s)"
by (metis False diff_mult_distrib2 mult.commute mult_numeral_1_right numeral_One parity semiring_numeral_div_class.mult_div_cancel)
hence "r s + (2*(x s div 2)*(y s)) = r s + ((x s)*(y s) - (y s))" by metis
hence "r s + 2*(x s div 2)*(y s) = r s + ((x s)*(y s) - (y s))" by metis
also have "... = r s + (x s)*(y s) - (y s)" using `x s \<noteq> 0` by fastforce
finally have "r s + 2*(x s div 2)*(y s) = r s + (x s)*(y s) - (y s)" .
moreover have "r s + (x s)*(y s) = a*b + y s" using 1 l3 False by auto
ultimately have "r s + 2*(x s div 2)*(y s) = a*b" by auto
thus ?thesis using 1 3 l3 False by auto
qed
next
case l4
hence 3:"t = s\<lparr>ligne := l1, y := (y s) * 2\<rparr>"
using 2 by force
thus ?thesis using 1 l4 by auto
next
case l5
thus ?thesis using 2 by force
qed
qed
end
end
|
{-# OPTIONS --without-K --rewriting #-}
open import lib.Basics
open import lib.NType2
open import lib.types.Int
open import lib.types.Group
open import lib.types.List
open import lib.types.Word
open import lib.groups.Homomorphism
open import lib.groups.Isomorphism
open import lib.groups.FreeAbelianGroup
open import lib.groups.GeneratedGroup
open import lib.types.SetQuotient
module lib.groups.Int where
ℤ-group-structure : GroupStructure ℤ
ℤ-group-structure = record
{ ident = 0
; inv = ℤ~
; comp = _ℤ+_
; unit-l = ℤ+-unit-l
; assoc = ℤ+-assoc
; inv-l = ℤ~-inv-l
}
ℤ-group : Group₀
ℤ-group = group _ ℤ-group-structure
ℤ-group-is-abelian : is-abelian ℤ-group
ℤ-group-is-abelian = ℤ+-comm
ℤ-abgroup : AbGroup₀
ℤ-abgroup = ℤ-group , ℤ-group-is-abelian
private
module OneGeneratorFreeAbGroup = FreeAbelianGroup Unit
OneGenFreeAbGroup : AbGroup lzero
OneGenFreeAbGroup = OneGeneratorFreeAbGroup.FreeAbGroup
private
module OneGenFreeAbGroup = AbGroup OneGenFreeAbGroup
ℤ-iso-FreeAbGroup-Unit : ℤ-group ≃ᴳ OneGenFreeAbGroup.grp
ℤ-iso-FreeAbGroup-Unit = ≃-to-≃ᴳ (equiv to from to-from from-to) to-pres-comp where
open OneGeneratorFreeAbGroup
module F = Freeness ℤ-abgroup
to : Group.El ℤ-group → OneGenFreeAbGroup.El
to = OneGenFreeAbGroup.exp qw[ inl unit :: nil ]
from : OneGenFreeAbGroup.El → Group.El ℤ-group
from = GroupHom.f (F.extend (λ _ → 1))
abstract
to-pres-comp = OneGenFreeAbGroup.exp-+ qw[ inl unit :: nil ]
to-from' : ∀ l → to (Word-extendᴳ ℤ-group (λ _ → 1) l) == qw[ l ]
to-from' nil = idp
to-from' (inl unit :: nil) = idp
to-from' (inl unit :: l@(_ :: _)) =
OneGenFreeAbGroup.exp-succ qw[ inl unit :: nil ] (Word-extendᴳ ℤ-group (λ _ → 1) l)
∙ ap (OneGenFreeAbGroup.comp qw[ inl unit :: nil ]) (to-from' l)
to-from' (inr unit :: nil) = idp
to-from' (inr unit :: l@(_ :: _)) =
OneGenFreeAbGroup.exp-pred qw[ inl unit :: nil ] (Word-extendᴳ ℤ-group (λ _ → 1) l)
∙ ap (OneGenFreeAbGroup.comp qw[ inr unit :: nil ]) (to-from' l)
to-from : ∀ fs → to (from fs) == fs
to-from = QuotWord-elim to-from' (λ _ → prop-has-all-paths-↓)
from-to : ∀ z → from (to z) == z
from-to (pos 0) = idp
from-to (pos 1) = idp
from-to (negsucc 0) = idp
from-to (pos (S (S n))) =
GroupHom.pres-comp (F.extend (λ _ → 1))
qw[ inl unit :: nil ] (OneGenFreeAbGroup.exp qw[ inl unit :: nil ] (pos (S n)))
∙ ap succ (from-to (pos (S n)))
from-to (negsucc (S n)) =
GroupHom.pres-comp (F.extend (λ _ → 1))
qw[ inr unit :: nil ] (OneGenFreeAbGroup.exp qw[ inl unit :: nil ] (negsucc n))
∙ ap pred (from-to (negsucc n))
exp-shom : ∀ {i} {GEl : Type i} (GS : GroupStructure GEl) (g : GEl) → ℤ-group-structure →ᴳˢ GS
exp-shom GS g = group-structure-hom (GroupStructure.exp GS g) (GroupStructure.exp-+ GS g)
exp-hom : ∀ {i} (G : Group i) (g : Group.El G) → ℤ-group →ᴳ G
exp-hom G g = group-hom (Group.exp G g) (Group.exp-+ G g)
|
/-
Copyright (c) 2017 Johannes Hölzl. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl, Jeremy Avigad
-/
import Mathlib.PrePort
import Mathlib.Lean3Lib.init.default
import Mathlib.order.zorn
import Mathlib.order.copy
import Mathlib.data.set.finite
import Mathlib.tactic.monotonicity.default
import Mathlib.PostPort
universes u_1 l u v x w u_2 u_3 u_4
namespace Mathlib
/-!
# Theory of filters on sets
## Main definitions
* `filter` : filters on a set;
* `at_top`, `at_bot`, `cofinite`, `principal` : specific filters;
* `map`, `comap`, `prod` : operations on filters;
* `tendsto` : limit with respect to filters;
* `eventually` : `f.eventually p` means `{x | p x} ∈ f`;
* `frequently` : `f.frequently p` means `{x | ¬p x} ∉ f`;
* `filter_upwards [h₁, ..., hₙ]` : takes a list of proofs `hᵢ : sᵢ ∈ f`, and replaces a goal `s ∈ f`
with `∀ x, x ∈ s₁ → ... → x ∈ sₙ → x ∈ s`;
* `ne_bot f` : an utility class stating that `f` is a non-trivial filter.
Filters on a type `X` are sets of sets of `X` satisfying three conditions. They are mostly used to
abstract two related kinds of ideas:
* *limits*, including finite or infinite limits of sequences, finite or infinite limits of functions
at a point or at infinity, etc...
* *things happening eventually*, including things happening for large enough `n : ℕ`, or near enough
a point `x`, or for close enough pairs of points, or things happening almost everywhere in the
sense of measure theory. Dually, filters can also express the idea of *things happening often*:
for arbitrarily large `n`, or at a point in any neighborhood of given a point etc...
In this file, we define the type `filter X` of filters on `X`, and endow it with a complete lattice
structure. This structure is lifted from the lattice structure on `set (set X)` using the Galois
insertion which maps a filter to its elements in one direction, and an arbitrary set of sets to
the smallest filter containing it in the other direction.
We also prove `filter` is a monadic functor, with a push-forward operation
`filter.map` and a pull-back operation `filter.comap` that form a Galois connections for the
order on filters.
Finally we describe a product operation `filter X → filter Y → filter (X × Y)`.
The examples of filters appearing in the description of the two motivating ideas are:
* `(at_top : filter ℕ)` : made of sets of `ℕ` containing `{n | n ≥ N}` for some `N`
* `𝓝 x` : made of neighborhoods of `x` in a topological space (defined in topology.basic)
* `𝓤 X` : made of entourages of a uniform space (those space are generalizations of metric spaces
defined in topology.uniform_space.basic)
* `μ.ae` : made of sets whose complement has zero measure with respect to `μ` (defined in
`measure_theory.measure_space`)
The general notion of limit of a map with respect to filters on the source and target types
is `filter.tendsto`. It is defined in terms of the order and the push-forward operation.
The predicate "happening eventually" is `filter.eventually`, and "happening often" is
`filter.frequently`, whose definitions are immediate after `filter` is defined (but they come
rather late in this file in order to immediately relate them to the lattice structure).
For instance, anticipating on topology.basic, the statement: "if a sequence `u` converges to
some `x` and `u n` belongs to a set `M` for `n` large enough then `x` is in the closure of
`M`" is formalized as: `tendsto u at_top (𝓝 x) → (∀ᶠ n in at_top, u n ∈ M) → x ∈ closure M`,
which is a special case of `mem_closure_of_tendsto` from topology.basic.
## Notations
* `∀ᶠ x in f, p x` : `f.eventually p`;
* `∃ᶠ x in f, p x` : `f.frequently p`;
* `f =ᶠ[l] g` : `∀ᶠ x in l, f x = g x`;
* `f ≤ᶠ[l] g` : `∀ᶠ x in l, f x ≤ g x`;
* `f ×ᶠ g` : `filter.prod f g`, localized in `filter`;
* `𝓟 s` : `principal s`, localized in `filter`.
## References
* [N. Bourbaki, *General Topology*][bourbaki1966]
Important note: Bourbaki requires that a filter on `X` cannot contain all sets of `X`, which
we do *not* require. This gives `filter X` better formal properties, in particular a bottom element
`⊥` for its lattice structure, at the cost of including the assumption
`[ne_bot f]` in a number of lemmas and definitions.
-/
/-- A filter `F` on a type `α` is a collection of sets of `α` which contains the whole `α`,
is upwards-closed, and is stable under intersection. We do not forbid this collection to be
all sets of `α`. -/
structure filter (α : Type u_1) where
sets : set (set α)
univ_sets : set.univ ∈ sets
sets_of_superset : ∀ {x y : set α}, x ∈ sets → x ⊆ y → y ∈ sets
inter_sets : ∀ {x y : set α}, x ∈ sets → y ∈ sets → x ∩ y ∈ sets
/-- If `F` is a filter on `α`, and `U` a subset of `α` then we can write `U ∈ F` as on paper. -/
protected instance filter.has_mem {α : Type u_1} : has_mem (set α) (filter α) :=
has_mem.mk fun (U : set α) (F : filter α) => U ∈ filter.sets F
namespace filter
@[simp] protected theorem mem_mk {α : Type u} {s : set α} {t : set (set α)} {h₁ : set.univ ∈ t}
{h₂ : ∀ {x y : set α}, x ∈ t → x ⊆ y → y ∈ t}
{h₃ : ∀ {x y : set α}, x ∈ t → y ∈ t → x ∩ y ∈ t} : s ∈ mk t h₁ h₂ h₃ ↔ s ∈ t :=
iff.rfl
@[simp] protected theorem mem_sets {α : Type u} {f : filter α} {s : set α} : s ∈ sets f ↔ s ∈ f :=
iff.rfl
protected instance inhabited_mem {α : Type u} {f : filter α} :
Inhabited (Subtype fun (s : set α) => s ∈ f) :=
{ default := { val := set.univ, property := univ_sets f } }
theorem filter_eq {α : Type u} {f : filter α} {g : filter α} : sets f = sets g → f = g := sorry
theorem filter_eq_iff {α : Type u} {f : filter α} {g : filter α} : f = g ↔ sets f = sets g :=
{ mp := congr_arg fun {f : filter α} => sets f, mpr := filter_eq }
protected theorem ext_iff {α : Type u} {f : filter α} {g : filter α} :
f = g ↔ ∀ (s : set α), s ∈ f ↔ s ∈ g :=
sorry
protected theorem ext {α : Type u} {f : filter α} {g : filter α} :
(∀ (s : set α), s ∈ f ↔ s ∈ g) → f = g :=
iff.mpr filter.ext_iff
@[simp] theorem univ_mem_sets {α : Type u} {f : filter α} : set.univ ∈ f := univ_sets f
theorem mem_sets_of_superset {α : Type u} {f : filter α} {x : set α} {y : set α} :
x ∈ f → x ⊆ y → y ∈ f :=
sets_of_superset f
theorem inter_mem_sets {α : Type u} {f : filter α} {s : set α} {t : set α} :
s ∈ f → t ∈ f → s ∩ t ∈ f :=
inter_sets f
@[simp] theorem inter_mem_sets_iff {α : Type u} {f : filter α} {s : set α} {t : set α} :
s ∩ t ∈ f ↔ s ∈ f ∧ t ∈ f :=
sorry
theorem univ_mem_sets' {α : Type u} {f : filter α} {s : set α} (h : ∀ (a : α), a ∈ s) : s ∈ f :=
mem_sets_of_superset univ_mem_sets fun (x : α) (_x : x ∈ set.univ) => h x
theorem mp_sets {α : Type u} {f : filter α} {s : set α} {t : set α} (hs : s ∈ f)
(h : (set_of fun (x : α) => x ∈ s → x ∈ t) ∈ f) : t ∈ f :=
sorry
theorem congr_sets {α : Type u} {f : filter α} {s : set α} {t : set α}
(h : (set_of fun (x : α) => x ∈ s ↔ x ∈ t) ∈ f) : s ∈ f ↔ t ∈ f :=
{ mp := fun (hs : s ∈ f) => mp_sets hs (mem_sets_of_superset h fun (x : α) => iff.mp),
mpr := fun (hs : t ∈ f) => mp_sets hs (mem_sets_of_superset h fun (x : α) => iff.mpr) }
@[simp] theorem bInter_mem_sets {α : Type u} {f : filter α} {β : Type v} {s : β → set α}
{is : set β} (hf : set.finite is) :
(set.Inter fun (i : β) => set.Inter fun (H : i ∈ is) => s i) ∈ f ↔
∀ (i : β), i ∈ is → s i ∈ f :=
sorry
@[simp] theorem bInter_finset_mem_sets {α : Type u} {f : filter α} {β : Type v} {s : β → set α}
(is : finset β) :
(set.Inter fun (i : β) => set.Inter fun (H : i ∈ is) => s i) ∈ f ↔
∀ (i : β), i ∈ is → s i ∈ f :=
bInter_mem_sets (finset.finite_to_set is)
protected theorem Mathlib.finset.Inter_mem_sets {α : Type u} {f : filter α} {β : Type v}
{s : β → set α} (is : finset β) :
(set.Inter fun (i : β) => set.Inter fun (H : i ∈ is) => s i) ∈ f ↔
∀ (i : β), i ∈ is → s i ∈ f :=
bInter_finset_mem_sets
@[simp] theorem sInter_mem_sets {α : Type u} {f : filter α} {s : set (set α)}
(hfin : set.finite s) : ⋂₀s ∈ f ↔ ∀ (U : set α), U ∈ s → U ∈ f :=
sorry
@[simp] theorem Inter_mem_sets {α : Type u} {f : filter α} {β : Type v} {s : β → set α}
[fintype β] : (set.Inter fun (i : β) => s i) ∈ f ↔ ∀ (i : β), s i ∈ f :=
sorry
theorem exists_sets_subset_iff {α : Type u} {f : filter α} {s : set α} :
(∃ (t : set α), ∃ (H : t ∈ f), t ⊆ s) ↔ s ∈ f :=
sorry
theorem monotone_mem_sets {α : Type u} {f : filter α} : monotone fun (s : set α) => s ∈ f :=
fun (s t : set α) (hst : s ≤ t) (h : s ∈ f) => mem_sets_of_superset h hst
end filter
namespace tactic.interactive
/-- `filter_upwards [h1, ⋯, hn]` replaces a goal of the form `s ∈ f`
and terms `h1 : t1 ∈ f, ⋯, hn : tn ∈ f` with `∀x, x ∈ t1 → ⋯ → x ∈ tn → x ∈ s`.
`filter_upwards [h1, ⋯, hn] e` is a short form for `{ filter_upwards [h1, ⋯, hn], exact e }`.
-/
end tactic.interactive
namespace filter
/-- The principal filter of `s` is the collection of all supersets of `s`. -/
def principal {α : Type u} (s : set α) : filter α :=
mk (set_of fun (t : set α) => s ⊆ t) (set.subset_univ s) sorry sorry
protected instance inhabited {α : Type u} : Inhabited (filter α) := { default := principal ∅ }
@[simp] theorem mem_principal_sets {α : Type u} {s : set α} {t : set α} : s ∈ principal t ↔ t ⊆ s :=
iff.rfl
theorem mem_principal_self {α : Type u} (s : set α) : s ∈ principal s := set.subset.refl s
/-- The join of a filter of filters is defined by the relation `s ∈ join f ↔ {t | s ∈ t} ∈ f`. -/
def join {α : Type u} (f : filter (filter α)) : filter α :=
mk (set_of fun (s : set α) => (set_of fun (t : filter α) => s ∈ t) ∈ f) sorry sorry sorry
@[simp] theorem mem_join_sets {α : Type u} {s : set α} {f : filter (filter α)} :
s ∈ join f ↔ (set_of fun (t : filter α) => s ∈ t) ∈ f :=
iff.rfl
protected instance partial_order {α : Type u} : partial_order (filter α) :=
partial_order.mk (fun (f g : filter α) => ∀ {U : set α}, U ∈ g → U ∈ f)
(preorder.lt._default fun (f g : filter α) => ∀ {U : set α}, U ∈ g → U ∈ f) sorry sorry sorry
theorem le_def {α : Type u} {f : filter α} {g : filter α} : f ≤ g ↔ ∀ (x : set α), x ∈ g → x ∈ f :=
iff.rfl
/-- `generate_sets g s`: `s` is in the filter closure of `g`. -/
inductive generate_sets {α : Type u} (g : set (set α)) : set α → Prop where
| basic : ∀ {s : set α}, s ∈ g → generate_sets g s
| univ : generate_sets g set.univ
| superset : ∀ {s t : set α}, generate_sets g s → s ⊆ t → generate_sets g t
| inter : ∀ {s t : set α}, generate_sets g s → generate_sets g t → generate_sets g (s ∩ t)
/-- `generate g` is the smallest filter containing the sets `g`. -/
def generate {α : Type u} (g : set (set α)) : filter α :=
mk (generate_sets g) generate_sets.univ sorry sorry
theorem sets_iff_generate {α : Type u} {s : set (set α)} {f : filter α} :
f ≤ generate s ↔ s ⊆ sets f :=
sorry
theorem mem_generate_iff {α : Type u} {s : set (set α)} {U : set α} :
U ∈ generate s ↔ ∃ (t : set (set α)), ∃ (H : t ⊆ s), set.finite t ∧ ⋂₀t ⊆ U :=
sorry
/-- `mk_of_closure s hs` constructs a filter on `α` whose elements set is exactly
`s : set (set α)`, provided one gives the assumption `hs : (generate s).sets = s`. -/
protected def mk_of_closure {α : Type u} (s : set (set α)) (hs : sets (generate s) = s) :
filter α :=
mk s sorry sorry sorry
theorem mk_of_closure_sets {α : Type u} {s : set (set α)} {hs : sets (generate s) = s} :
filter.mk_of_closure s hs = generate s :=
filter.ext
fun (u : set α) =>
(fun (this : u ∈ sets (filter.mk_of_closure s hs) ↔ u ∈ sets (generate s)) => this)
(Eq.symm hs ▸ iff.rfl)
/-- Galois insertion from sets of sets into filters. -/
def gi_generate (α : Type u_1) : galois_insertion generate sets :=
galois_insertion.mk
(fun (s : set (set α)) (hs : sets (generate s) ≤ s) => filter.mk_of_closure s sorry) sorry sorry
sorry
/-- The infimum of filters is the filter generated by intersections
of elements of the two filters. -/
protected instance has_inf {α : Type u} : has_inf (filter α) :=
has_inf.mk
fun (f g : filter α) =>
mk
(set_of
fun (s : set α) => ∃ (a : set α), ∃ (H : a ∈ f), ∃ (b : set α), ∃ (H : b ∈ g), a ∩ b ⊆ s)
sorry sorry sorry
@[simp] theorem mem_inf_sets {α : Type u} {f : filter α} {g : filter α} {s : set α} :
s ∈ f ⊓ g ↔ ∃ (t₁ : set α), ∃ (H : t₁ ∈ f), ∃ (t₂ : set α), ∃ (H : t₂ ∈ g), t₁ ∩ t₂ ⊆ s :=
iff.rfl
theorem mem_inf_sets_of_left {α : Type u} {f : filter α} {g : filter α} {s : set α} (h : s ∈ f) :
s ∈ f ⊓ g :=
Exists.intro s
(Exists.intro h
(Exists.intro set.univ (Exists.intro univ_mem_sets (set.inter_subset_left s set.univ))))
theorem mem_inf_sets_of_right {α : Type u} {f : filter α} {g : filter α} {s : set α} (h : s ∈ g) :
s ∈ f ⊓ g :=
Exists.intro set.univ
(Exists.intro univ_mem_sets
(Exists.intro s (Exists.intro h (set.inter_subset_right set.univ s))))
theorem inter_mem_inf_sets {α : Type u} {f : filter α} {g : filter α} {s : set α} {t : set α}
(hs : s ∈ f) (ht : t ∈ g) : s ∩ t ∈ f ⊓ g :=
inter_mem_sets (mem_inf_sets_of_left hs) (mem_inf_sets_of_right ht)
protected instance has_top {α : Type u} : has_top (filter α) :=
has_top.mk (mk (set_of fun (s : set α) => ∀ (x : α), x ∈ s) sorry sorry sorry)
theorem mem_top_sets_iff_forall {α : Type u} {s : set α} : s ∈ ⊤ ↔ ∀ (x : α), x ∈ s := iff.rfl
@[simp] theorem mem_top_sets {α : Type u} {s : set α} : s ∈ ⊤ ↔ s = set.univ :=
eq.mpr (id (Eq._oldrec (Eq.refl (s ∈ ⊤ ↔ s = set.univ)) (propext mem_top_sets_iff_forall)))
(eq.mpr
(id
(Eq._oldrec (Eq.refl ((∀ (x : α), x ∈ s) ↔ s = set.univ)) (propext set.eq_univ_iff_forall)))
(iff.refl (∀ (x : α), x ∈ s)))
/- We lift the complete lattice along the Galois connection `generate` / `sets`. Unfortunately,
we want to have different definitional equalities for the lattice operations. So we define them
upfront and change the lattice operations for the complete lattice instance. -/
protected instance complete_lattice {α : Type u} : complete_lattice (filter α) :=
complete_lattice.copy original_complete_lattice partial_order.le sorry ⊤ sorry
complete_lattice.bot sorry complete_lattice.sup sorry has_inf.inf sorry (join ∘ principal) sorry
complete_lattice.Inf sorry
/-- A filter is `ne_bot` if it is not equal to `⊥`, or equivalently the empty set
does not belong to the filter. Bourbaki include this assumption in the definition
of a filter but we prefer to have a `complete_lattice` structure on filter, so
we use a typeclass argument in lemmas instead. -/
def ne_bot {α : Type u} (f : filter α) := f ≠ ⊥
theorem ne_bot.ne {α : Type u} {f : filter α} (hf : ne_bot f) : f ≠ ⊥ := hf
@[simp] theorem not_ne_bot {α : Type u_1} {f : filter α} : ¬ne_bot f ↔ f = ⊥ := not_not
theorem ne_bot.mono {α : Type u} {f : filter α} {g : filter α} (hf : ne_bot f) (hg : f ≤ g) :
ne_bot g :=
ne_bot_of_le_ne_bot hf hg
theorem ne_bot_of_le {α : Type u} {f : filter α} {g : filter α} [hf : ne_bot f] (hg : f ≤ g) :
ne_bot g :=
ne_bot.mono hf hg
theorem bot_sets_eq {α : Type u} : sets ⊥ = set.univ := rfl
theorem sup_sets_eq {α : Type u} {f : filter α} {g : filter α} : sets (f ⊔ g) = sets f ∩ sets g :=
galois_connection.u_inf (galois_insertion.gc (gi_generate α))
theorem Sup_sets_eq {α : Type u} {s : set (filter α)} :
sets (Sup s) = set.Inter fun (f : filter α) => set.Inter fun (H : f ∈ s) => sets f :=
galois_connection.u_Inf (galois_insertion.gc (gi_generate α))
theorem supr_sets_eq {α : Type u} {ι : Sort x} {f : ι → filter α} :
sets (supr f) = set.Inter fun (i : ι) => sets (f i) :=
galois_connection.u_infi (galois_insertion.gc (gi_generate α))
theorem generate_empty {α : Type u} : generate ∅ = ⊤ :=
galois_connection.l_bot (galois_insertion.gc (gi_generate α))
theorem generate_univ {α : Type u} : generate set.univ = ⊥ := Eq.symm mk_of_closure_sets
theorem generate_union {α : Type u} {s : set (set α)} {t : set (set α)} :
generate (s ∪ t) = generate s ⊓ generate t :=
galois_connection.l_sup (galois_insertion.gc (gi_generate α))
theorem generate_Union {α : Type u} {ι : Sort x} {s : ι → set (set α)} :
generate (set.Union fun (i : ι) => s i) = infi fun (i : ι) => generate (s i) :=
galois_connection.l_supr (galois_insertion.gc (gi_generate α))
@[simp] theorem mem_bot_sets {α : Type u} {s : set α} : s ∈ ⊥ := trivial
@[simp] theorem mem_sup_sets {α : Type u} {f : filter α} {g : filter α} {s : set α} :
s ∈ f ⊔ g ↔ s ∈ f ∧ s ∈ g :=
iff.rfl
theorem union_mem_sup {α : Type u} {f : filter α} {g : filter α} {s : set α} {t : set α}
(hs : s ∈ f) (ht : t ∈ g) : s ∪ t ∈ f ⊔ g :=
{ left := mem_sets_of_superset hs (set.subset_union_left s t),
right := mem_sets_of_superset ht (set.subset_union_right s t) }
@[simp] theorem mem_Sup_sets {α : Type u} {x : set α} {s : set (filter α)} :
x ∈ Sup s ↔ ∀ (f : filter α), f ∈ s → x ∈ f :=
iff.rfl
@[simp] theorem mem_supr_sets {α : Type u} {ι : Sort x} {x : set α} {f : ι → filter α} :
x ∈ supr f ↔ ∀ (i : ι), x ∈ f i :=
sorry
theorem infi_eq_generate {α : Type u} {ι : Sort x} (s : ι → filter α) :
infi s = generate (set.Union fun (i : ι) => sets (s i)) :=
sorry
theorem mem_infi_iff {α : Type u} {ι : Type u_1} {s : ι → filter α} {U : set α} :
(U ∈ infi fun (i : ι) => s i) ↔
∃ (I : set ι),
set.finite I ∧
∃ (V : ↥(set_of fun (i : ι) => i ∈ I) → set α),
(∀ (i : ↥(set_of fun (i : ι) => i ∈ I)), V i ∈ s ↑i) ∧
(set.Inter fun (i : ↥(set_of fun (i : ι) => i ∈ I)) => V i) ⊆ U :=
sorry
@[simp] theorem le_principal_iff {α : Type u} {s : set α} {f : filter α} :
f ≤ principal s ↔ s ∈ f :=
(fun (this : (∀ {t : set α}, s ⊆ t → t ∈ f) ↔ s ∈ f) => this)
{ mp := fun (h : ∀ {t : set α}, s ⊆ t → t ∈ f) => h (set.subset.refl s),
mpr := fun (hs : s ∈ f) (t : set α) (ht : s ⊆ t) => mem_sets_of_superset hs ht }
theorem principal_mono {α : Type u} {s : set α} {t : set α} : principal s ≤ principal t ↔ s ⊆ t :=
sorry
theorem monotone_principal {α : Type u} : monotone principal :=
fun (_x _x_1 : set α) => iff.mpr principal_mono
@[simp] theorem principal_eq_iff_eq {α : Type u} {s : set α} {t : set α} :
principal s = principal t ↔ s = t :=
sorry
@[simp] theorem join_principal_eq_Sup {α : Type u} {s : set (filter α)} :
join (principal s) = Sup s :=
rfl
@[simp] theorem principal_univ {α : Type u} : principal set.univ = ⊤ := sorry
@[simp] theorem principal_empty {α : Type u} : principal ∅ = ⊥ :=
bot_unique fun (s : set α) (_x : s ∈ ⊥) => set.empty_subset s
/-! ### Lattice equations -/
theorem empty_in_sets_eq_bot {α : Type u} {f : filter α} : ∅ ∈ f ↔ f = ⊥ :=
{ mp :=
fun (h : ∅ ∈ f) =>
bot_unique fun (s : set α) (_x : s ∈ ⊥) => mem_sets_of_superset h (set.empty_subset s),
mpr := fun (this : f = ⊥) => Eq.symm this ▸ mem_bot_sets }
theorem nonempty_of_mem_sets {α : Type u} {f : filter α} [hf : ne_bot f] {s : set α} (hs : s ∈ f) :
set.nonempty s :=
or.elim (set.eq_empty_or_nonempty s)
(fun (h : s = ∅) => absurd hs (Eq.symm h ▸ mt (iff.mp empty_in_sets_eq_bot) hf)) id
theorem ne_bot.nonempty_of_mem {α : Type u} {f : filter α} (hf : ne_bot f) {s : set α}
(hs : s ∈ f) : set.nonempty s :=
nonempty_of_mem_sets hs
@[simp] theorem empty_nmem_sets {α : Type u} (f : filter α) [ne_bot f] : ¬∅ ∈ f :=
fun (h : ∅ ∈ f) => set.nonempty.ne_empty (nonempty_of_mem_sets h) rfl
theorem nonempty_of_ne_bot {α : Type u} (f : filter α) [ne_bot f] : Nonempty α :=
nonempty_of_exists (nonempty_of_mem_sets univ_mem_sets)
theorem compl_not_mem_sets {α : Type u} {f : filter α} {s : set α} [ne_bot f] (h : s ∈ f) :
¬sᶜ ∈ f :=
fun (hsc : sᶜ ∈ f) =>
set.nonempty.ne_empty (nonempty_of_mem_sets (inter_mem_sets h hsc)) (set.inter_compl_self s)
theorem filter_eq_bot_of_not_nonempty {α : Type u} (f : filter α) (ne : ¬Nonempty α) : f = ⊥ :=
iff.mp empty_in_sets_eq_bot (univ_mem_sets' fun (x : α) => false.elim (ne (Nonempty.intro x)))
theorem forall_sets_nonempty_iff_ne_bot {α : Type u} {f : filter α} :
(∀ (s : set α), s ∈ f → set.nonempty s) ↔ ne_bot f :=
sorry
theorem nontrivial_iff_nonempty {α : Type u} : nontrivial (filter α) ↔ Nonempty α := sorry
theorem mem_sets_of_eq_bot {α : Type u} {f : filter α} {s : set α} (h : f ⊓ principal (sᶜ) = ⊥) :
s ∈ f :=
sorry
theorem eq_Inf_of_mem_sets_iff_exists_mem {α : Type u} {S : set (filter α)} {l : filter α}
(h : ∀ {s : set α}, s ∈ l ↔ ∃ (f : filter α), ∃ (H : f ∈ S), s ∈ f) : l = Inf S :=
sorry
theorem eq_infi_of_mem_sets_iff_exists_mem {α : Type u} {ι : Sort x} {f : ι → filter α}
{l : filter α} (h : ∀ {s : set α}, s ∈ l ↔ ∃ (i : ι), s ∈ f i) : l = infi f :=
eq_Inf_of_mem_sets_iff_exists_mem fun (s : set α) => iff.trans h (iff.symm set.exists_range_iff)
theorem eq_binfi_of_mem_sets_iff_exists_mem {α : Type u} {ι : Sort x} {f : ι → filter α}
{p : ι → Prop} {l : filter α} (h : ∀ {s : set α}, s ∈ l ↔ ∃ (i : ι), ∃ (_x : p i), s ∈ f i) :
l = infi fun (i : ι) => infi fun (_x : p i) => f i :=
sorry
theorem infi_sets_eq {α : Type u} {ι : Sort x} {f : ι → filter α} (h : directed ge f)
[ne : Nonempty ι] : sets (infi f) = set.Union fun (i : ι) => sets (f i) :=
sorry
theorem mem_infi {α : Type u} {ι : Sort x} {f : ι → filter α} (h : directed ge f) [Nonempty ι]
(s : set α) : s ∈ infi f ↔ ∃ (i : ι), s ∈ f i :=
sorry
theorem mem_binfi {α : Type u} {β : Type v} {f : β → filter α} {s : set β}
(h : directed_on (f ⁻¹'o ge) s) (ne : set.nonempty s) {t : set α} :
(t ∈ infi fun (i : β) => infi fun (H : i ∈ s) => f i) ↔ ∃ (i : β), ∃ (H : i ∈ s), t ∈ f i :=
sorry
theorem binfi_sets_eq {α : Type u} {β : Type v} {f : β → filter α} {s : set β}
(h : directed_on (f ⁻¹'o ge) s) (ne : set.nonempty s) :
sets (infi fun (i : β) => infi fun (H : i ∈ s) => f i) =
set.Union fun (i : β) => set.Union fun (H : i ∈ s) => sets (f i) :=
sorry
theorem infi_sets_eq_finite {α : Type u} {ι : Type u_1} (f : ι → filter α) :
sets (infi fun (i : ι) => f i) =
set.Union fun (t : finset ι) => sets (infi fun (i : ι) => infi fun (H : i ∈ t) => f i) :=
sorry
theorem infi_sets_eq_finite' {α : Type u} {ι : Sort x} (f : ι → filter α) :
sets (infi fun (i : ι) => f i) =
set.Union
fun (t : finset (plift ι)) =>
sets (infi fun (i : plift ι) => infi fun (H : i ∈ t) => f (plift.down i)) :=
sorry
theorem mem_infi_finite {α : Type u} {ι : Type u_1} {f : ι → filter α} (s : set α) :
s ∈ infi f ↔ ∃ (t : finset ι), s ∈ infi fun (i : ι) => infi fun (H : i ∈ t) => f i :=
iff.trans (iff.mp set.ext_iff (infi_sets_eq_finite f) s) set.mem_Union
theorem mem_infi_finite' {α : Type u} {ι : Sort x} {f : ι → filter α} (s : set α) :
s ∈ infi f ↔
∃ (t : finset (plift ι)),
s ∈ infi fun (i : plift ι) => infi fun (H : i ∈ t) => f (plift.down i) :=
iff.trans (iff.mp set.ext_iff (infi_sets_eq_finite' f) s) set.mem_Union
@[simp] theorem sup_join {α : Type u} {f₁ : filter (filter α)} {f₂ : filter (filter α)} :
join f₁ ⊔ join f₂ = join (f₁ ⊔ f₂) :=
sorry
@[simp] theorem supr_join {α : Type u} {ι : Sort w} {f : ι → filter (filter α)} :
(supr fun (x : ι) => join (f x)) = join (supr fun (x : ι) => f x) :=
sorry
protected instance bounded_distrib_lattice {α : Type u} : bounded_distrib_lattice (filter α) :=
bounded_distrib_lattice.mk complete_lattice.sup complete_lattice.le complete_lattice.lt sorry
sorry sorry sorry sorry sorry complete_lattice.inf sorry sorry sorry sorry complete_lattice.top
sorry complete_lattice.bot sorry
/- the complementary version with ⨆i, f ⊓ g i does not hold! -/
theorem infi_sup_left {α : Type u} {ι : Sort x} {f : filter α} {g : ι → filter α} :
(infi fun (x : ι) => f ⊔ g x) = f ⊔ infi g :=
sorry
theorem infi_sup_right {α : Type u} {ι : Sort x} {f : filter α} {g : ι → filter α} :
(infi fun (x : ι) => g x ⊔ f) = infi g ⊔ f :=
sorry
theorem binfi_sup_right {α : Type u} {ι : Sort x} (p : ι → Prop) (f : ι → filter α) (g : filter α) :
(infi fun (i : ι) => infi fun (h : p i) => f i ⊔ g) =
(infi fun (i : ι) => infi fun (h : p i) => f i) ⊔ g :=
sorry
theorem binfi_sup_left {α : Type u} {ι : Sort x} (p : ι → Prop) (f : ι → filter α) (g : filter α) :
(infi fun (i : ι) => infi fun (h : p i) => g ⊔ f i) =
g ⊔ infi fun (i : ι) => infi fun (h : p i) => f i :=
sorry
theorem mem_infi_sets_finset {α : Type u} {β : Type v} {s : finset α} {f : α → filter β}
(t : set β) :
(t ∈ infi fun (a : α) => infi fun (H : a ∈ s) => f a) ↔
∃ (p : α → set β),
(∀ (a : α), a ∈ s → p a ∈ f a) ∧
(set.Inter fun (a : α) => set.Inter fun (H : a ∈ s) => p a) ⊆ t :=
sorry
/-- If `f : ι → filter α` is directed, `ι` is not empty, and `∀ i, f i ≠ ⊥`, then `infi f ≠ ⊥`.
See also `infi_ne_bot_of_directed` for a version assuming `nonempty α` instead of `nonempty ι`. -/
theorem infi_ne_bot_of_directed' {α : Type u} {ι : Sort x} {f : ι → filter α} [Nonempty ι]
(hd : directed ge f) (hb : ∀ (i : ι), ne_bot (f i)) : ne_bot (infi f) :=
sorry
/-- If `f : ι → filter α` is directed, `α` is not empty, and `∀ i, f i ≠ ⊥`, then `infi f ≠ ⊥`.
See also `infi_ne_bot_of_directed'` for a version assuming `nonempty ι` instead of `nonempty α`. -/
theorem infi_ne_bot_of_directed {α : Type u} {ι : Sort x} {f : ι → filter α} [hn : Nonempty α]
(hd : directed ge f) (hb : ∀ (i : ι), ne_bot (f i)) : ne_bot (infi f) :=
sorry
theorem infi_ne_bot_iff_of_directed' {α : Type u} {ι : Sort x} {f : ι → filter α} [Nonempty ι]
(hd : directed ge f) : ne_bot (infi f) ↔ ∀ (i : ι), ne_bot (f i) :=
{ mp := fun (H : ne_bot (infi f)) (i : ι) => ne_bot.mono H (infi_le f i),
mpr := infi_ne_bot_of_directed' hd }
theorem infi_ne_bot_iff_of_directed {α : Type u} {ι : Sort x} {f : ι → filter α} [Nonempty α]
(hd : directed ge f) : ne_bot (infi f) ↔ ∀ (i : ι), ne_bot (f i) :=
{ mp := fun (H : ne_bot (infi f)) (i : ι) => ne_bot.mono H (infi_le f i),
mpr := infi_ne_bot_of_directed hd }
theorem mem_infi_sets {α : Type u} {ι : Sort x} {f : ι → filter α} (i : ι) {s : set α} :
s ∈ f i → s ∈ infi fun (i : ι) => f i :=
(fun (this : (infi fun (i : ι) => f i) ≤ f i) => this) (infi_le (fun (i : ι) => f i) i)
theorem infi_sets_induct {α : Type u} {ι : Sort x} {f : ι → filter α} {s : set α} (hs : s ∈ infi f)
{p : set α → Prop} (uni : p set.univ)
(ins : ∀ {i : ι} {s₁ s₂ : set α}, s₁ ∈ f i → p s₂ → p (s₁ ∩ s₂))
(upw : ∀ {s₁ s₂ : set α}, s₁ ⊆ s₂ → p s₁ → p s₂) : p s :=
sorry
/- principal equations -/
@[simp] theorem inf_principal {α : Type u} {s : set α} {t : set α} :
principal s ⊓ principal t = principal (s ∩ t) :=
sorry
@[simp] theorem sup_principal {α : Type u} {s : set α} {t : set α} :
principal s ⊔ principal t = principal (s ∪ t) :=
sorry
@[simp] theorem supr_principal {α : Type u} {ι : Sort w} {s : ι → set α} :
(supr fun (x : ι) => principal (s x)) = principal (set.Union fun (i : ι) => s i) :=
sorry
@[simp] theorem principal_eq_bot_iff {α : Type u} {s : set α} : principal s = ⊥ ↔ s = ∅ :=
iff.trans (iff.symm empty_in_sets_eq_bot) (iff.trans mem_principal_sets set.subset_empty_iff)
@[simp] theorem principal_ne_bot_iff {α : Type u} {s : set α} :
ne_bot (principal s) ↔ set.nonempty s :=
iff.trans (not_congr principal_eq_bot_iff) set.ne_empty_iff_nonempty
theorem is_compl_principal {α : Type u} (s : set α) : is_compl (principal s) (principal (sᶜ)) :=
sorry
theorem inf_principal_eq_bot {α : Type u} {f : filter α} {s : set α} (hs : sᶜ ∈ f) :
f ⊓ principal s = ⊥ :=
sorry
theorem mem_inf_principal {α : Type u} {f : filter α} {s : set α} {t : set α} :
s ∈ f ⊓ principal t ↔ (set_of fun (x : α) => x ∈ t → x ∈ s) ∈ f :=
sorry
theorem diff_mem_inf_principal_compl {α : Type u} {f : filter α} {s : set α} (hs : s ∈ f)
(t : set α) : s \ t ∈ f ⊓ principal (tᶜ) :=
eq.mpr (id (Eq._oldrec (Eq.refl (s \ t ∈ f ⊓ principal (tᶜ))) (propext mem_inf_principal)))
(mp_sets hs
(univ_mem_sets'
(id fun (a : α) (has : a ∈ s) (hat : a ∈ (tᶜ)) => { left := has, right := hat })))
theorem principal_le_iff {α : Type u} {s : set α} {f : filter α} :
principal s ≤ f ↔ ∀ (V : set α), V ∈ f → s ⊆ V :=
sorry
@[simp] theorem infi_principal_finset {α : Type u} {ι : Type w} (s : finset ι) (f : ι → set α) :
(infi fun (i : ι) => infi fun (H : i ∈ s) => principal (f i)) =
principal (set.Inter fun (i : ι) => set.Inter fun (H : i ∈ s) => f i) :=
sorry
@[simp] theorem infi_principal_fintype {α : Type u} {ι : Type w} [fintype ι] (f : ι → set α) :
(infi fun (i : ι) => principal (f i)) = principal (set.Inter fun (i : ι) => f i) :=
sorry
theorem join_mono {α : Type u} {f₁ : filter (filter α)} {f₂ : filter (filter α)} (h : f₁ ≤ f₂) :
join f₁ ≤ join f₂ :=
fun (s : set α) (hs : s ∈ join f₂) => h hs
/-! ### Eventually -/
/-- `f.eventually p` or `∀ᶠ x in f, p x` mean that `{x | p x} ∈ f`. E.g., `∀ᶠ x in at_top, p x`
means that `p` holds true for sufficiently large `x`. -/
protected def eventually {α : Type u} (p : α → Prop) (f : filter α) :=
(set_of fun (x : α) => p x) ∈ f
theorem eventually_iff {α : Type u} {f : filter α} {P : α → Prop} :
filter.eventually (fun (x : α) => P x) f ↔ (set_of fun (x : α) => P x) ∈ f :=
iff.rfl
protected theorem ext' {α : Type u} {f₁ : filter α} {f₂ : filter α}
(h :
∀ (p : α → Prop),
filter.eventually (fun (x : α) => p x) f₁ ↔ filter.eventually (fun (x : α) => p x) f₂) :
f₁ = f₂ :=
filter.ext h
theorem eventually.filter_mono {α : Type u} {f₁ : filter α} {f₂ : filter α} (h : f₁ ≤ f₂)
{p : α → Prop} (hp : filter.eventually (fun (x : α) => p x) f₂) :
filter.eventually (fun (x : α) => p x) f₁ :=
h hp
theorem eventually_of_mem {α : Type u} {f : filter α} {P : α → Prop} {U : set α} (hU : U ∈ f)
(h : ∀ (x : α), x ∈ U → P x) : filter.eventually (fun (x : α) => P x) f :=
mem_sets_of_superset hU h
protected theorem eventually.and {α : Type u} {p : α → Prop} {q : α → Prop} {f : filter α} :
filter.eventually p f →
filter.eventually q f → filter.eventually (fun (x : α) => p x ∧ q x) f :=
inter_mem_sets
@[simp] theorem eventually_true {α : Type u} (f : filter α) :
filter.eventually (fun (x : α) => True) f :=
univ_mem_sets
theorem eventually_of_forall {α : Type u} {p : α → Prop} {f : filter α} (hp : ∀ (x : α), p x) :
filter.eventually (fun (x : α) => p x) f :=
univ_mem_sets' hp
@[simp] theorem eventually_false_iff_eq_bot {α : Type u} {f : filter α} :
filter.eventually (fun (x : α) => False) f ↔ f = ⊥ :=
empty_in_sets_eq_bot
@[simp] theorem eventually_const {α : Type u} {f : filter α} [ne_bot f] {p : Prop} :
filter.eventually (fun (x : α) => p) f ↔ p :=
sorry
theorem eventually_iff_exists_mem {α : Type u} {p : α → Prop} {f : filter α} :
filter.eventually (fun (x : α) => p x) f ↔
∃ (v : set α), ∃ (H : v ∈ f), ∀ (y : α), y ∈ v → p y :=
iff.symm exists_sets_subset_iff
theorem eventually.exists_mem {α : Type u} {p : α → Prop} {f : filter α}
(hp : filter.eventually (fun (x : α) => p x) f) :
∃ (v : set α), ∃ (H : v ∈ f), ∀ (y : α), y ∈ v → p y :=
iff.mp eventually_iff_exists_mem hp
theorem eventually.mp {α : Type u} {p : α → Prop} {q : α → Prop} {f : filter α}
(hp : filter.eventually (fun (x : α) => p x) f)
(hq : filter.eventually (fun (x : α) => p x → q x) f) :
filter.eventually (fun (x : α) => q x) f :=
mp_sets hp hq
theorem eventually.mono {α : Type u} {p : α → Prop} {q : α → Prop} {f : filter α}
(hp : filter.eventually (fun (x : α) => p x) f) (hq : ∀ (x : α), p x → q x) :
filter.eventually (fun (x : α) => q x) f :=
eventually.mp hp (eventually_of_forall hq)
@[simp] theorem eventually_and {α : Type u} {p : α → Prop} {q : α → Prop} {f : filter α} :
filter.eventually (fun (x : α) => p x ∧ q x) f ↔
filter.eventually (fun (x : α) => p x) f ∧ filter.eventually (fun (x : α) => q x) f :=
inter_mem_sets_iff
theorem eventually.congr {α : Type u} {f : filter α} {p : α → Prop} {q : α → Prop}
(h' : filter.eventually (fun (x : α) => p x) f)
(h : filter.eventually (fun (x : α) => p x ↔ q x) f) :
filter.eventually (fun (x : α) => q x) f :=
eventually.mp h' (eventually.mono h fun (x : α) (hx : p x ↔ q x) => iff.mp hx)
theorem eventually_congr {α : Type u} {f : filter α} {p : α → Prop} {q : α → Prop}
(h : filter.eventually (fun (x : α) => p x ↔ q x) f) :
filter.eventually (fun (x : α) => p x) f ↔ filter.eventually (fun (x : α) => q x) f :=
sorry
@[simp] theorem eventually_all {α : Type u} {ι : Type u_1} [fintype ι] {l : filter α}
{p : ι → α → Prop} :
filter.eventually (fun (x : α) => ∀ (i : ι), p i x) l ↔
∀ (i : ι), filter.eventually (fun (x : α) => p i x) l :=
sorry
@[simp] theorem eventually_all_finite {α : Type u} {ι : Type u_1} {I : set ι} (hI : set.finite I)
{l : filter α} {p : ι → α → Prop} :
filter.eventually (fun (x : α) => ∀ (i : ι), i ∈ I → p i x) l ↔
∀ (i : ι), i ∈ I → filter.eventually (fun (x : α) => p i x) l :=
sorry
protected theorem Mathlib.set.finite.eventually_all {α : Type u} {ι : Type u_1} {I : set ι}
(hI : set.finite I) {l : filter α} {p : ι → α → Prop} :
filter.eventually (fun (x : α) => ∀ (i : ι), i ∈ I → p i x) l ↔
∀ (i : ι), i ∈ I → filter.eventually (fun (x : α) => p i x) l :=
eventually_all_finite
@[simp] theorem eventually_all_finset {α : Type u} {ι : Type u_1} (I : finset ι) {l : filter α}
{p : ι → α → Prop} :
filter.eventually (fun (x : α) => ∀ (i : ι), i ∈ I → p i x) l ↔
∀ (i : ι), i ∈ I → filter.eventually (fun (x : α) => p i x) l :=
set.finite.eventually_all (finset.finite_to_set I)
protected theorem Mathlib.finset.eventually_all {α : Type u} {ι : Type u_1} (I : finset ι)
{l : filter α} {p : ι → α → Prop} :
filter.eventually (fun (x : α) => ∀ (i : ι), i ∈ I → p i x) l ↔
∀ (i : ι), i ∈ I → filter.eventually (fun (x : α) => p i x) l :=
eventually_all_finset
@[simp] theorem eventually_or_distrib_left {α : Type u} {f : filter α} {p : Prop} {q : α → Prop} :
filter.eventually (fun (x : α) => p ∨ q x) f ↔ p ∨ filter.eventually (fun (x : α) => q x) f :=
sorry
@[simp] theorem eventually_or_distrib_right {α : Type u} {f : filter α} {p : α → Prop} {q : Prop} :
filter.eventually (fun (x : α) => p x ∨ q) f ↔ filter.eventually (fun (x : α) => p x) f ∨ q :=
sorry
@[simp] theorem eventually_imp_distrib_left {α : Type u} {f : filter α} {p : Prop} {q : α → Prop} :
filter.eventually (fun (x : α) => p → q x) f ↔ p → filter.eventually (fun (x : α) => q x) f :=
sorry
@[simp] theorem eventually_bot {α : Type u} {p : α → Prop} :
filter.eventually (fun (x : α) => p x) ⊥ :=
True.intro
@[simp] theorem eventually_top {α : Type u} {p : α → Prop} :
filter.eventually (fun (x : α) => p x) ⊤ ↔ ∀ (x : α), p x :=
iff.rfl
@[simp] theorem eventually_sup {α : Type u} {p : α → Prop} {f : filter α} {g : filter α} :
filter.eventually (fun (x : α) => p x) (f ⊔ g) ↔
filter.eventually (fun (x : α) => p x) f ∧ filter.eventually (fun (x : α) => p x) g :=
iff.rfl
@[simp] theorem eventually_Sup {α : Type u} {p : α → Prop} {fs : set (filter α)} :
filter.eventually (fun (x : α) => p x) (Sup fs) ↔
∀ (f : filter α), f ∈ fs → filter.eventually (fun (x : α) => p x) f :=
iff.rfl
@[simp] theorem eventually_supr {α : Type u} {β : Type v} {p : α → Prop} {fs : β → filter α} :
filter.eventually (fun (x : α) => p x) (supr fun (b : β) => fs b) ↔
∀ (b : β), filter.eventually (fun (x : α) => p x) (fs b) :=
mem_supr_sets
@[simp] theorem eventually_principal {α : Type u} {a : set α} {p : α → Prop} :
filter.eventually (fun (x : α) => p x) (principal a) ↔ ∀ (x : α), x ∈ a → p x :=
iff.rfl
theorem eventually_inf_principal {α : Type u} {f : filter α} {p : α → Prop} {s : set α} :
filter.eventually (fun (x : α) => p x) (f ⊓ principal s) ↔
filter.eventually (fun (x : α) => x ∈ s → p x) f :=
mem_inf_principal
/-! ### Frequently -/
/-- `f.frequently p` or `∃ᶠ x in f, p x` mean that `{x | ¬p x} ∉ f`. E.g., `∃ᶠ x in at_top, p x`
means that there exist arbitrarily large `x` for which `p` holds true. -/
protected def frequently {α : Type u} (p : α → Prop) (f : filter α) :=
¬filter.eventually (fun (x : α) => ¬p x) f
theorem eventually.frequently {α : Type u} {f : filter α} [ne_bot f] {p : α → Prop}
(h : filter.eventually (fun (x : α) => p x) f) : filter.frequently (fun (x : α) => p x) f :=
compl_not_mem_sets h
theorem frequently_of_forall {α : Type u} {f : filter α} [ne_bot f] {p : α → Prop}
(h : ∀ (x : α), p x) : filter.frequently (fun (x : α) => p x) f :=
eventually.frequently (eventually_of_forall h)
theorem frequently.mp {α : Type u} {p : α → Prop} {q : α → Prop} {f : filter α}
(h : filter.frequently (fun (x : α) => p x) f)
(hpq : filter.eventually (fun (x : α) => p x → q x) f) :
filter.frequently (fun (x : α) => q x) f :=
sorry
theorem frequently.mono {α : Type u} {p : α → Prop} {q : α → Prop} {f : filter α}
(h : filter.frequently (fun (x : α) => p x) f) (hpq : ∀ (x : α), p x → q x) :
filter.frequently (fun (x : α) => q x) f :=
frequently.mp h (eventually_of_forall hpq)
theorem frequently.and_eventually {α : Type u} {p : α → Prop} {q : α → Prop} {f : filter α}
(hp : filter.frequently (fun (x : α) => p x) f)
(hq : filter.eventually (fun (x : α) => q x) f) :
filter.frequently (fun (x : α) => p x ∧ q x) f :=
sorry
theorem frequently.exists {α : Type u} {p : α → Prop} {f : filter α}
(hp : filter.frequently (fun (x : α) => p x) f) : ∃ (x : α), p x :=
decidable.by_contradiction
fun (H : ¬∃ (x : α), p x) => hp (eventually_of_forall (iff.mp not_exists H))
theorem eventually.exists {α : Type u} {p : α → Prop} {f : filter α} [ne_bot f]
(hp : filter.eventually (fun (x : α) => p x) f) : ∃ (x : α), p x :=
frequently.exists (eventually.frequently hp)
theorem frequently_iff_forall_eventually_exists_and {α : Type u} {p : α → Prop} {f : filter α} :
filter.frequently (fun (x : α) => p x) f ↔
∀ {q : α → Prop}, filter.eventually (fun (x : α) => q x) f → ∃ (x : α), p x ∧ q x :=
sorry
theorem frequently_iff {α : Type u} {f : filter α} {P : α → Prop} :
filter.frequently (fun (x : α) => P x) f ↔
∀ {U : set α}, U ∈ f → ∃ (x : α), ∃ (H : x ∈ U), P x :=
sorry
@[simp] theorem not_eventually {α : Type u} {p : α → Prop} {f : filter α} :
¬filter.eventually (fun (x : α) => p x) f ↔ filter.frequently (fun (x : α) => ¬p x) f :=
sorry
@[simp] theorem not_frequently {α : Type u} {p : α → Prop} {f : filter α} :
¬filter.frequently (fun (x : α) => p x) f ↔ filter.eventually (fun (x : α) => ¬p x) f :=
sorry
@[simp] theorem frequently_true_iff_ne_bot {α : Type u} (f : filter α) :
filter.frequently (fun (x : α) => True) f ↔ ne_bot f :=
sorry
@[simp] theorem frequently_false {α : Type u} (f : filter α) :
¬filter.frequently (fun (x : α) => False) f :=
sorry
@[simp] theorem frequently_const {α : Type u} {f : filter α} [ne_bot f] {p : Prop} :
filter.frequently (fun (x : α) => p) f ↔ p :=
sorry
@[simp] theorem frequently_or_distrib {α : Type u} {f : filter α} {p : α → Prop} {q : α → Prop} :
filter.frequently (fun (x : α) => p x ∨ q x) f ↔
filter.frequently (fun (x : α) => p x) f ∨ filter.frequently (fun (x : α) => q x) f :=
sorry
theorem frequently_or_distrib_left {α : Type u} {f : filter α} [ne_bot f] {p : Prop}
{q : α → Prop} :
filter.frequently (fun (x : α) => p ∨ q x) f ↔ p ∨ filter.frequently (fun (x : α) => q x) f :=
sorry
theorem frequently_or_distrib_right {α : Type u} {f : filter α} [ne_bot f] {p : α → Prop}
{q : Prop} :
filter.frequently (fun (x : α) => p x ∨ q) f ↔ filter.frequently (fun (x : α) => p x) f ∨ q :=
sorry
@[simp] theorem frequently_imp_distrib {α : Type u} {f : filter α} {p : α → Prop} {q : α → Prop} :
filter.frequently (fun (x : α) => p x → q x) f ↔
filter.eventually (fun (x : α) => p x) f → filter.frequently (fun (x : α) => q x) f :=
sorry
theorem frequently_imp_distrib_left {α : Type u} {f : filter α} [ne_bot f] {p : Prop}
{q : α → Prop} :
filter.frequently (fun (x : α) => p → q x) f ↔ p → filter.frequently (fun (x : α) => q x) f :=
sorry
theorem frequently_imp_distrib_right {α : Type u} {f : filter α} [ne_bot f] {p : α → Prop}
{q : Prop} :
filter.frequently (fun (x : α) => p x → q) f ↔ filter.eventually (fun (x : α) => p x) f → q :=
sorry
@[simp] theorem eventually_imp_distrib_right {α : Type u} {f : filter α} {p : α → Prop} {q : Prop} :
filter.eventually (fun (x : α) => p x → q) f ↔ filter.frequently (fun (x : α) => p x) f → q :=
sorry
@[simp] theorem frequently_bot {α : Type u} {p : α → Prop} :
¬filter.frequently (fun (x : α) => p x) ⊥ :=
eq.mpr (id (Eq.trans (propext not_frequently) (propext (iff_true_intro eventually_bot)))) trivial
@[simp] theorem frequently_top {α : Type u} {p : α → Prop} :
filter.frequently (fun (x : α) => p x) ⊤ ↔ ∃ (x : α), p x :=
sorry
@[simp] theorem frequently_principal {α : Type u} {a : set α} {p : α → Prop} :
filter.frequently (fun (x : α) => p x) (principal a) ↔ ∃ (x : α), ∃ (H : x ∈ a), p x :=
sorry
theorem frequently_sup {α : Type u} {p : α → Prop} {f : filter α} {g : filter α} :
filter.frequently (fun (x : α) => p x) (f ⊔ g) ↔
filter.frequently (fun (x : α) => p x) f ∨ filter.frequently (fun (x : α) => p x) g :=
sorry
@[simp] theorem frequently_Sup {α : Type u} {p : α → Prop} {fs : set (filter α)} :
filter.frequently (fun (x : α) => p x) (Sup fs) ↔
∃ (f : filter α), ∃ (H : f ∈ fs), filter.frequently (fun (x : α) => p x) f :=
sorry
@[simp] theorem frequently_supr {α : Type u} {β : Type v} {p : α → Prop} {fs : β → filter α} :
filter.frequently (fun (x : α) => p x) (supr fun (b : β) => fs b) ↔
∃ (b : β), filter.frequently (fun (x : α) => p x) (fs b) :=
sorry
/-!
### Relation “eventually equal”
-/
/-- Two functions `f` and `g` are *eventually equal* along a filter `l` if the set of `x` such that
`f x = g x` belongs to `l`. -/
def eventually_eq {α : Type u} {β : Type v} (l : filter α) (f : α → β) (g : α → β) :=
filter.eventually (fun (x : α) => f x = g x) l
theorem eventually_eq.eventually {α : Type u} {β : Type v} {l : filter α} {f : α → β} {g : α → β}
(h : eventually_eq l f g) : filter.eventually (fun (x : α) => f x = g x) l :=
h
theorem eventually_eq.rw {α : Type u} {β : Type v} {l : filter α} {f : α → β} {g : α → β}
(h : eventually_eq l f g) (p : α → β → Prop)
(hf : filter.eventually (fun (x : α) => p x (f x)) l) :
filter.eventually (fun (x : α) => p x (g x)) l :=
eventually.congr hf (eventually.mono h fun (x : α) (hx : f x = g x) => hx ▸ iff.rfl)
theorem eventually_eq_set {α : Type u} {s : set α} {t : set α} {l : filter α} :
eventually_eq l s t ↔ filter.eventually (fun (x : α) => x ∈ s ↔ x ∈ t) l :=
eventually_congr (eventually_of_forall fun (x : α) => { mp := eq.to_iff, mpr := iff.to_eq })
theorem eventually.set_eq {α : Type u} {s : set α} {t : set α} {l : filter α} :
filter.eventually (fun (x : α) => x ∈ s ↔ x ∈ t) l → eventually_eq l s t :=
iff.mpr eventually_eq_set
theorem eventually_eq.exists_mem {α : Type u} {β : Type v} {l : filter α} {f : α → β} {g : α → β}
(h : eventually_eq l f g) : ∃ (s : set α), ∃ (H : s ∈ l), set.eq_on f g s :=
eventually.exists_mem h
theorem eventually_eq_of_mem {α : Type u} {β : Type v} {l : filter α} {f : α → β} {g : α → β}
{s : set α} (hs : s ∈ l) (h : set.eq_on f g s) : eventually_eq l f g :=
eventually_of_mem hs h
theorem eventually_eq_iff_exists_mem {α : Type u} {β : Type v} {l : filter α} {f : α → β}
{g : α → β} : eventually_eq l f g ↔ ∃ (s : set α), ∃ (H : s ∈ l), set.eq_on f g s :=
eventually_iff_exists_mem
theorem eventually_eq.filter_mono {α : Type u} {β : Type v} {l : filter α} {l' : filter α}
{f : α → β} {g : α → β} (h₁ : eventually_eq l f g) (h₂ : l' ≤ l) : eventually_eq l' f g :=
h₂ h₁
theorem eventually_eq.refl {α : Type u} {β : Type v} (l : filter α) (f : α → β) :
eventually_eq l f f :=
eventually_of_forall fun (x : α) => rfl
theorem eventually_eq.rfl {α : Type u} {β : Type v} {l : filter α} {f : α → β} :
eventually_eq l f f :=
eventually_eq.refl l f
theorem eventually_eq.symm {α : Type u} {β : Type v} {f : α → β} {g : α → β} {l : filter α}
(H : eventually_eq l f g) : eventually_eq l g f :=
eventually.mono H fun (_x : α) => Eq.symm
theorem eventually_eq.trans {α : Type u} {β : Type v} {f : α → β} {g : α → β} {h : α → β}
{l : filter α} (H₁ : eventually_eq l f g) (H₂ : eventually_eq l g h) : eventually_eq l f h :=
eventually_eq.rw H₂ (fun (x : α) (y : β) => f x = y) H₁
theorem eventually_eq.prod_mk {α : Type u} {β : Type v} {γ : Type w} {l : filter α} {f : α → β}
{f' : α → β} (hf : eventually_eq l f f') {g : α → γ} {g' : α → γ} (hg : eventually_eq l g g') :
eventually_eq l (fun (x : α) => (f x, g x)) fun (x : α) => (f' x, g' x) :=
sorry
theorem eventually_eq.fun_comp {α : Type u} {β : Type v} {γ : Type w} {f : α → β} {g : α → β}
{l : filter α} (H : eventually_eq l f g) (h : β → γ) : eventually_eq l (h ∘ f) (h ∘ g) :=
eventually.mono H fun (x : α) (hx : f x = g x) => congr_arg h hx
theorem eventually_eq.comp₂ {α : Type u} {β : Type v} {γ : Type w} {δ : Type u_1} {f : α → β}
{f' : α → β} {g : α → γ} {g' : α → γ} {l : filter α} (Hf : eventually_eq l f f') (h : β → γ → δ)
(Hg : eventually_eq l g g') :
eventually_eq l (fun (x : α) => h (f x) (g x)) fun (x : α) => h (f' x) (g' x) :=
eventually_eq.fun_comp (eventually_eq.prod_mk Hf Hg) (function.uncurry h)
theorem eventually_eq.add {α : Type u} {β : Type v} [Add β] {f : α → β} {f' : α → β} {g : α → β}
{g' : α → β} {l : filter α} (h : eventually_eq l f g) (h' : eventually_eq l f' g') :
eventually_eq l (fun (x : α) => f x + f' x) fun (x : α) => g x + g' x :=
eventually_eq.comp₂ h Add.add h'
theorem eventually_eq.neg {α : Type u} {β : Type v} [Neg β] {f : α → β} {g : α → β} {l : filter α}
(h : eventually_eq l f g) : eventually_eq l (fun (x : α) => -f x) fun (x : α) => -g x :=
eventually_eq.fun_comp h Neg.neg
theorem eventually_eq.div {α : Type u} {β : Type v} [group_with_zero β] {f : α → β} {f' : α → β}
{g : α → β} {g' : α → β} {l : filter α} (h : eventually_eq l f g) (h' : eventually_eq l f' g') :
eventually_eq l (fun (x : α) => f x / f' x) fun (x : α) => g x / g' x :=
sorry
theorem eventually_eq.sub {α : Type u} {β : Type v} [add_group β] {f : α → β} {f' : α → β}
{g : α → β} {g' : α → β} {l : filter α} (h : eventually_eq l f g) (h' : eventually_eq l f' g') :
eventually_eq l (fun (x : α) => f x - f' x) fun (x : α) => g x - g' x :=
sorry
theorem eventually_eq.inter {α : Type u} {s : set α} {t : set α} {s' : set α} {t' : set α}
{l : filter α} (h : eventually_eq l s t) (h' : eventually_eq l s' t') :
eventually_eq l (s ∩ s') (t ∩ t') :=
eventually_eq.comp₂ h And h'
theorem eventually_eq.union {α : Type u} {s : set α} {t : set α} {s' : set α} {t' : set α}
{l : filter α} (h : eventually_eq l s t) (h' : eventually_eq l s' t') :
eventually_eq l (s ∪ s') (t ∪ t') :=
eventually_eq.comp₂ h Or h'
theorem eventually_eq.compl {α : Type u} {s : set α} {t : set α} {l : filter α}
(h : eventually_eq l s t) : eventually_eq l (sᶜ) (tᶜ) :=
eventually_eq.fun_comp h Not
theorem eventually_eq.diff {α : Type u} {s : set α} {t : set α} {s' : set α} {t' : set α}
{l : filter α} (h : eventually_eq l s t) (h' : eventually_eq l s' t') :
eventually_eq l (s \ s') (t \ t') :=
eventually_eq.inter h (eventually_eq.compl h')
theorem eventually_eq_empty {α : Type u} {s : set α} {l : filter α} :
eventually_eq l s ∅ ↔ filter.eventually (fun (x : α) => ¬x ∈ s) l :=
sorry
@[simp] theorem eventually_eq_principal {α : Type u} {β : Type v} {s : set α} {f : α → β}
{g : α → β} : eventually_eq (principal s) f g ↔ set.eq_on f g s :=
iff.rfl
theorem eventually_eq_inf_principal_iff {α : Type u} {β : Type v} {F : filter α} {s : set α}
{f : α → β} {g : α → β} :
eventually_eq (F ⊓ principal s) f g ↔ filter.eventually (fun (x : α) => x ∈ s → f x = g x) F :=
eventually_inf_principal
/-- A function `f` is eventually less than or equal to a function `g` at a filter `l`. -/
def eventually_le {α : Type u} {β : Type v} [HasLessEq β] (l : filter α) (f : α → β) (g : α → β) :=
filter.eventually (fun (x : α) => f x ≤ g x) l
theorem eventually_le.congr {α : Type u} {β : Type v} [HasLessEq β] {l : filter α} {f : α → β}
{f' : α → β} {g : α → β} {g' : α → β} (H : eventually_le l f g) (hf : eventually_eq l f f')
(hg : eventually_eq l g g') : eventually_le l f' g' :=
sorry
theorem eventually_le_congr {α : Type u} {β : Type v} [HasLessEq β] {l : filter α} {f : α → β}
{f' : α → β} {g : α → β} {g' : α → β} (hf : eventually_eq l f f') (hg : eventually_eq l g g') :
eventually_le l f g ↔ eventually_le l f' g' :=
{ mp := fun (H : eventually_le l f g) => eventually_le.congr H hf hg,
mpr :=
fun (H : eventually_le l f' g') =>
eventually_le.congr H (eventually_eq.symm hf) (eventually_eq.symm hg) }
theorem eventually_eq.le {α : Type u} {β : Type v} [preorder β] {l : filter α} {f : α → β}
{g : α → β} (h : eventually_eq l f g) : eventually_le l f g :=
eventually.mono h fun (x : α) => le_of_eq
theorem eventually_le.refl {α : Type u} {β : Type v} [preorder β] (l : filter α) (f : α → β) :
eventually_le l f f :=
eventually_eq.le eventually_eq.rfl
theorem eventually_le.rfl {α : Type u} {β : Type v} [preorder β] {l : filter α} {f : α → β} :
eventually_le l f f :=
eventually_le.refl l f
theorem eventually_le.trans {α : Type u} {β : Type v} [preorder β] {l : filter α} {f : α → β}
{g : α → β} {h : α → β} (H₁ : eventually_le l f g) (H₂ : eventually_le l g h) :
eventually_le l f h :=
eventually.mp H₂ (eventually.mono H₁ fun (x : α) => le_trans)
theorem eventually_eq.trans_le {α : Type u} {β : Type v} [preorder β] {l : filter α} {f : α → β}
{g : α → β} {h : α → β} (H₁ : eventually_eq l f g) (H₂ : eventually_le l g h) :
eventually_le l f h :=
eventually_le.trans (eventually_eq.le H₁) H₂
theorem eventually_le.trans_eq {α : Type u} {β : Type v} [preorder β] {l : filter α} {f : α → β}
{g : α → β} {h : α → β} (H₁ : eventually_le l f g) (H₂ : eventually_eq l g h) :
eventually_le l f h :=
eventually_le.trans H₁ (eventually_eq.le H₂)
theorem eventually_le.antisymm {α : Type u} {β : Type v} [partial_order β] {l : filter α}
{f : α → β} {g : α → β} (h₁ : eventually_le l f g) (h₂ : eventually_le l g f) :
eventually_eq l f g :=
eventually.mp h₂ (eventually.mono h₁ fun (x : α) => le_antisymm)
theorem eventually_le_antisymm_iff {α : Type u} {β : Type v} [partial_order β] {l : filter α}
{f : α → β} {g : α → β} : eventually_eq l f g ↔ eventually_le l f g ∧ eventually_le l g f :=
sorry
theorem eventually_le.le_iff_eq {α : Type u} {β : Type v} [partial_order β] {l : filter α}
{f : α → β} {g : α → β} (h : eventually_le l f g) : eventually_le l g f ↔ eventually_eq l g f :=
{ mp := fun (h' : eventually_le l g f) => eventually_le.antisymm h' h, mpr := eventually_eq.le }
theorem eventually_le.inter {α : Type u} {s : set α} {t : set α} {s' : set α} {t' : set α}
{l : filter α} (h : eventually_le l s t) (h' : eventually_le l s' t') :
eventually_le l (s ∩ s') (t ∩ t') :=
eventually.mp h' (eventually.mono h fun (x : α) => and.imp)
theorem eventually_le.union {α : Type u} {s : set α} {t : set α} {s' : set α} {t' : set α}
{l : filter α} (h : eventually_le l s t) (h' : eventually_le l s' t') :
eventually_le l (s ∪ s') (t ∪ t') :=
eventually.mp h' (eventually.mono h fun (x : α) => or.imp)
theorem eventually_le.compl {α : Type u} {s : set α} {t : set α} {l : filter α}
(h : eventually_le l s t) : eventually_le l (tᶜ) (sᶜ) :=
eventually.mono h fun (x : α) => mt
theorem eventually_le.diff {α : Type u} {s : set α} {t : set α} {s' : set α} {t' : set α}
{l : filter α} (h : eventually_le l s t) (h' : eventually_le l t' s') :
eventually_le l (s \ s') (t \ t') :=
eventually_le.inter h (eventually_le.compl h')
theorem join_le {α : Type u} {f : filter (filter α)} {l : filter α}
(h : filter.eventually (fun (m : filter α) => m ≤ l) f) : join f ≤ l :=
fun (s : set α) (hs : s ∈ l) => eventually.mono h fun (m : filter α) (hm : m ≤ l) => hm hs
/-! ### Push-forwards, pull-backs, and the monad structure -/
/-- The forward map of a filter -/
def map {α : Type u} {β : Type v} (m : α → β) (f : filter α) : filter β :=
mk (set.preimage m ⁻¹' sets f) univ_mem_sets sorry sorry
@[simp] theorem map_principal {α : Type u} {β : Type v} {s : set α} {f : α → β} :
map f (principal s) = principal (f '' s) :=
filter_eq (set.ext fun (a : set β) => iff.symm set.image_subset_iff)
@[simp] theorem eventually_map {α : Type u} {β : Type v} {f : filter α} {m : α → β} {P : β → Prop} :
filter.eventually (fun (b : β) => P b) (map m f) ↔
filter.eventually (fun (a : α) => P (m a)) f :=
iff.rfl
@[simp] theorem frequently_map {α : Type u} {β : Type v} {f : filter α} {m : α → β} {P : β → Prop} :
filter.frequently (fun (b : β) => P b) (map m f) ↔
filter.frequently (fun (a : α) => P (m a)) f :=
iff.rfl
@[simp] theorem mem_map {α : Type u} {β : Type v} {f : filter α} {m : α → β} {t : set β} :
t ∈ map m f ↔ (set_of fun (x : α) => m x ∈ t) ∈ f :=
iff.rfl
theorem image_mem_map {α : Type u} {β : Type v} {f : filter α} {m : α → β} {s : set α}
(hs : s ∈ f) : m '' s ∈ map m f :=
sets_of_superset f hs (set.subset_preimage_image m s)
theorem image_mem_map_iff {α : Type u} {β : Type v} {f : filter α} {m : α → β} {s : set α}
(hf : function.injective m) : m '' s ∈ map m f ↔ s ∈ f :=
{ mp :=
fun (h : m '' s ∈ map m f) =>
eq.mpr (id (Eq._oldrec (Eq.refl (s ∈ f)) (Eq.symm (set.preimage_image_eq s hf)))) h,
mpr := image_mem_map }
theorem range_mem_map {α : Type u} {β : Type v} {f : filter α} {m : α → β} :
set.range m ∈ map m f :=
eq.mpr (id (Eq._oldrec (Eq.refl (set.range m ∈ map m f)) (Eq.symm set.image_univ)))
(image_mem_map univ_mem_sets)
theorem mem_map_sets_iff {α : Type u} {β : Type v} {f : filter α} {m : α → β} {t : set β} :
t ∈ map m f ↔ ∃ (s : set α), ∃ (H : s ∈ f), m '' s ⊆ t :=
sorry
@[simp] theorem map_id {α : Type u} {f : filter α} : map id f = f := filter_eq rfl
@[simp] theorem map_id' {α : Type u} {f : filter α} : map (fun (x : α) => x) f = f := map_id
@[simp] theorem map_compose {α : Type u} {β : Type v} {γ : Type w} {m : α → β} {m' : β → γ} :
map m' ∘ map m = map (m' ∘ m) :=
funext fun (_x : filter α) => filter_eq rfl
@[simp] theorem map_map {α : Type u} {β : Type v} {γ : Type w} {f : filter α} {m : α → β}
{m' : β → γ} : map m' (map m f) = map (m' ∘ m) f :=
congr_fun map_compose f
/-- If functions `m₁` and `m₂` are eventually equal at a filter `f`, then
they map this filter to the same filter. -/
theorem map_congr {α : Type u} {β : Type v} {m₁ : α → β} {m₂ : α → β} {f : filter α}
(h : eventually_eq f m₁ m₂) : map m₁ f = map m₂ f :=
sorry
/-- The inverse map of a filter -/
def comap {α : Type u} {β : Type v} (m : α → β) (f : filter β) : filter α :=
mk (set_of fun (s : set α) => ∃ (t : set β), ∃ (H : t ∈ f), m ⁻¹' t ⊆ s) sorry sorry sorry
@[simp] theorem eventually_comap {α : Type u} {β : Type v} {f : filter β} {φ : α → β}
{P : α → Prop} :
filter.eventually (fun (a : α) => P a) (comap φ f) ↔
filter.eventually (fun (b : β) => ∀ (a : α), φ a = b → P a) f :=
sorry
@[simp] theorem frequently_comap {α : Type u} {β : Type v} {f : filter β} {φ : α → β}
{P : α → Prop} :
filter.frequently (fun (a : α) => P a) (comap φ f) ↔
filter.frequently (fun (b : β) => ∃ (a : α), φ a = b ∧ P a) f :=
sorry
/-- The monadic bind operation on filter is defined the usual way in terms of `map` and `join`.
Unfortunately, this `bind` does not result in the expected applicative. See `filter.seq` for the
applicative instance. -/
def bind {α : Type u} {β : Type v} (f : filter α) (m : α → filter β) : filter β := join (map m f)
/-- The applicative sequentiation operation. This is not induced by the bind operation. -/
def seq {α : Type u} {β : Type v} (f : filter (α → β)) (g : filter α) : filter β :=
mk
(set_of
fun (s : set β) =>
∃ (u : set (α → β)),
∃ (H : u ∈ f),
∃ (t : set α), ∃ (H : t ∈ g), ∀ (m : α → β), m ∈ u → ∀ (x : α), x ∈ t → m x ∈ s)
sorry sorry sorry
/-- `pure x` is the set of sets that contain `x`. It is equal to `𝓟 {x}` but
with this definition we have `s ∈ pure a` defeq `a ∈ s`. -/
protected instance has_pure : Pure filter :=
{ pure := fun (α : Type u) (x : α) => mk (set_of fun (s : set α) => x ∈ s) trivial sorry sorry }
protected instance has_bind : Bind filter := { bind := bind }
protected instance has_seq : Seq filter := { seq := seq }
protected instance functor : Functor filter :=
{ map := map, mapConst := fun (α β : Type u_1) => map ∘ function.const β }
theorem pure_sets {α : Type u} (a : α) : sets (pure a) = set_of fun (s : set α) => a ∈ s := rfl
@[simp] theorem mem_pure_sets {α : Type u} {a : α} {s : set α} : s ∈ pure a ↔ a ∈ s := iff.rfl
@[simp] theorem eventually_pure {α : Type u} {a : α} {p : α → Prop} :
filter.eventually (fun (x : α) => p x) (pure a) ↔ p a :=
iff.rfl
@[simp] theorem principal_singleton {α : Type u} (a : α) : principal (singleton a) = pure a := sorry
@[simp] theorem map_pure {α : Type u} {β : Type v} (f : α → β) (a : α) :
map f (pure a) = pure (f a) :=
rfl
@[simp] theorem join_pure {α : Type u} (f : filter α) : join (pure f) = f :=
filter.ext fun (s : set α) => iff.rfl
@[simp] theorem pure_bind {α : Type u} {β : Type v} (a : α) (m : α → filter β) :
bind (pure a) m = m a :=
sorry
-- this section needs to be before applicative, otherwise the wrong instance will be chosen
/-- The monad structure on filters. -/
protected def monad : Monad filter :=
{ toApplicative :=
{ toFunctor := { map := map, mapConst := fun (α β : Type u_1) => map ∘ function.const β },
toPure := filter.has_pure,
toSeq :=
{ seq :=
fun (α β : Type u_1) (f : filter (α → β)) (x : filter α) =>
do
let _x ← f
map _x x },
toSeqLeft :=
{ seqLeft :=
fun (α β : Type u_1) (a : filter α) (b : filter β) =>
(fun (α β : Type u_1) (f : filter (α → β)) (x : filter α) =>
do
let _x ← f
map _x x)
β α (map (function.const β) a) b },
toSeqRight :=
{ seqRight :=
fun (α β : Type u_1) (a : filter α) (b : filter β) =>
(fun (α β : Type u_1) (f : filter (α → β)) (x : filter α) =>
do
let _x ← f
map _x x)
β β (map (function.const α id) a) b } },
toBind := filter.has_bind }
protected theorem is_lawful_monad : is_lawful_monad filter :=
is_lawful_monad.mk (fun (α β : Type u_1) => pure_bind)
fun (α β γ : Type u_1) (f : filter α) (m₁ : α → filter β) (m₂ : β → filter γ) => filter_eq rfl
protected instance applicative : Applicative filter :=
{ toFunctor := { map := map, mapConst := fun (α β : Type u_1) => map ∘ function.const β },
toPure := filter.has_pure, toSeq := { seq := seq },
toSeqLeft :=
{ seqLeft :=
fun (α β : Type u_1) (a : filter α) (b : filter β) => seq (map (function.const β) a) b },
toSeqRight :=
{ seqRight :=
fun (α β : Type u_1) (a : filter α) (b : filter β) =>
seq (map (function.const α id) a) b } }
protected instance alternative : alternative filter := alternative.mk fun (α : Type u_1) => ⊥
@[simp] theorem map_def {α : Type u_1} {β : Type u_1} (m : α → β) (f : filter α) :
m <$> f = map m f :=
rfl
@[simp] theorem bind_def {α : Type u_1} {β : Type u_1} (f : filter α) (m : α → filter β) :
f >>= m = bind f m :=
rfl
/- map and comap equations -/
@[simp] theorem mem_comap_sets {α : Type u} {β : Type v} {g : filter β} {m : α → β} {s : set α} :
s ∈ comap m g ↔ ∃ (t : set β), ∃ (H : t ∈ g), m ⁻¹' t ⊆ s :=
iff.rfl
theorem preimage_mem_comap {α : Type u} {β : Type v} {g : filter β} {m : α → β} {t : set β}
(ht : t ∈ g) : m ⁻¹' t ∈ comap m g :=
Exists.intro t (Exists.intro ht (set.subset.refl (m ⁻¹' t)))
theorem comap_id {α : Type u} {f : filter α} : comap id f = f := sorry
theorem comap_const_of_not_mem {α : Type u} {x : α} {f : filter α} {V : set α} (hV : V ∈ f)
(hx : ¬x ∈ V) : comap (fun (y : α) => x) f = ⊥ :=
sorry
theorem comap_const_of_mem {α : Type u} {x : α} {f : filter α} (h : ∀ (V : set α), V ∈ f → x ∈ V) :
comap (fun (y : α) => x) f = ⊤ :=
sorry
theorem comap_comap {α : Type u} {β : Type v} {γ : Type w} {f : filter α} {m : γ → β} {n : β → α} :
comap m (comap n f) = comap (n ∘ m) f :=
sorry
@[simp] theorem comap_principal {α : Type u} {β : Type v} {m : α → β} {t : set β} :
comap m (principal t) = principal (m ⁻¹' t) :=
sorry
@[simp] theorem comap_pure {α : Type u} {β : Type v} {m : α → β} {b : β} :
comap m (pure b) = principal (m ⁻¹' singleton b) :=
sorry
theorem map_le_iff_le_comap {α : Type u} {β : Type v} {f : filter α} {g : filter β} {m : α → β} :
map m f ≤ g ↔ f ≤ comap m g :=
sorry
theorem gc_map_comap {α : Type u} {β : Type v} (m : α → β) : galois_connection (map m) (comap m) :=
fun (f : filter α) (g : filter β) => map_le_iff_le_comap
theorem map_mono {α : Type u} {β : Type v} {m : α → β} : monotone (map m) :=
galois_connection.monotone_l (gc_map_comap m)
theorem comap_mono {α : Type u} {β : Type v} {m : α → β} : monotone (comap m) :=
galois_connection.monotone_u (gc_map_comap m)
@[simp] theorem map_bot {α : Type u} {β : Type v} {m : α → β} : map m ⊥ = ⊥ :=
galois_connection.l_bot (gc_map_comap m)
@[simp] theorem map_sup {α : Type u} {β : Type v} {f₁ : filter α} {f₂ : filter α} {m : α → β} :
map m (f₁ ⊔ f₂) = map m f₁ ⊔ map m f₂ :=
galois_connection.l_sup (gc_map_comap m)
@[simp] theorem map_supr {α : Type u} {β : Type v} {ι : Sort x} {m : α → β} {f : ι → filter α} :
map m (supr fun (i : ι) => f i) = supr fun (i : ι) => map m (f i) :=
galois_connection.l_supr (gc_map_comap m)
@[simp] theorem comap_top {α : Type u} {β : Type v} {m : α → β} : comap m ⊤ = ⊤ :=
galois_connection.u_top (gc_map_comap m)
@[simp] theorem comap_inf {α : Type u} {β : Type v} {g₁ : filter β} {g₂ : filter β} {m : α → β} :
comap m (g₁ ⊓ g₂) = comap m g₁ ⊓ comap m g₂ :=
galois_connection.u_inf (gc_map_comap m)
@[simp] theorem comap_infi {α : Type u} {β : Type v} {ι : Sort x} {m : α → β} {f : ι → filter β} :
comap m (infi fun (i : ι) => f i) = infi fun (i : ι) => comap m (f i) :=
galois_connection.u_infi (gc_map_comap m)
theorem le_comap_top {α : Type u} {β : Type v} (f : α → β) (l : filter α) : l ≤ comap f ⊤ :=
eq.mpr (id (Eq._oldrec (Eq.refl (l ≤ comap f ⊤)) comap_top)) le_top
theorem map_comap_le {α : Type u} {β : Type v} {g : filter β} {m : α → β} : map m (comap m g) ≤ g :=
galois_connection.l_u_le (gc_map_comap m) g
theorem le_comap_map {α : Type u} {β : Type v} {f : filter α} {m : α → β} : f ≤ comap m (map m f) :=
galois_connection.le_u_l (gc_map_comap m) f
@[simp] theorem comap_bot {α : Type u} {β : Type v} {m : α → β} : comap m ⊥ = ⊥ := sorry
theorem comap_supr {α : Type u} {β : Type v} {ι : Sort u_1} {f : ι → filter β} {m : α → β} :
comap m (supr f) = supr fun (i : ι) => comap m (f i) :=
sorry
theorem comap_Sup {α : Type u} {β : Type v} {s : set (filter β)} {m : α → β} :
comap m (Sup s) = supr fun (f : filter β) => supr fun (H : f ∈ s) => comap m f :=
sorry
theorem comap_sup {α : Type u} {β : Type v} {g₁ : filter β} {g₂ : filter β} {m : α → β} :
comap m (g₁ ⊔ g₂) = comap m g₁ ⊔ comap m g₂ :=
sorry
theorem map_comap {α : Type u} {β : Type v} {f : filter β} {m : α → β} (hf : set.range m ∈ f) :
map m (comap m f) = f :=
sorry
theorem image_mem_sets {α : Type u} {β : Type v} {f : filter α} {c : β → α} (h : set.range c ∈ f)
{W : set β} (W_in : W ∈ comap c f) : c '' W ∈ f :=
eq.mpr (id (Eq._oldrec (Eq.refl (c '' W ∈ f)) (Eq.symm (map_comap h)))) (image_mem_map W_in)
theorem image_coe_mem_sets {α : Type u} {f : filter α} {U : set α} (h : U ∈ f) {W : set ↥U}
(W_in : W ∈ comap coe f) : coe '' W ∈ f :=
sorry
theorem comap_map {α : Type u} {β : Type v} {f : filter α} {m : α → β} (h : function.injective m) :
comap m (map m f) = f :=
sorry
theorem mem_comap_iff {α : Type u} {β : Type v} {f : filter β} {m : α → β}
(inj : function.injective m) (large : set.range m ∈ f) {S : set α} :
S ∈ comap m f ↔ m '' S ∈ f :=
eq.mpr
(id
(Eq._oldrec (Eq.refl (S ∈ comap m f ↔ m '' S ∈ f))
(Eq.symm (propext (image_mem_map_iff inj)))))
(eq.mpr (id (Eq._oldrec (Eq.refl (m '' S ∈ map m (comap m f) ↔ m '' S ∈ f)) (map_comap large)))
(iff.refl (m '' S ∈ f)))
theorem le_of_map_le_map_inj' {α : Type u} {β : Type v} {f : filter α} {g : filter α} {m : α → β}
{s : set α} (hsf : s ∈ f) (hsg : s ∈ g)
(hm : ∀ (x : α), x ∈ s → ∀ (y : α), y ∈ s → m x = m y → x = y) (h : map m f ≤ map m g) :
f ≤ g :=
sorry
theorem le_of_map_le_map_inj_iff {α : Type u} {β : Type v} {f : filter α} {g : filter α} {m : α → β}
{s : set α} (hsf : s ∈ f) (hsg : s ∈ g)
(hm : ∀ (x : α), x ∈ s → ∀ (y : α), y ∈ s → m x = m y → x = y) : map m f ≤ map m g ↔ f ≤ g :=
{ mp := le_of_map_le_map_inj' hsf hsg hm, mpr := fun (h : f ≤ g) => map_mono h }
theorem eq_of_map_eq_map_inj' {α : Type u} {β : Type v} {f : filter α} {g : filter α} {m : α → β}
{s : set α} (hsf : s ∈ f) (hsg : s ∈ g)
(hm : ∀ (x : α), x ∈ s → ∀ (y : α), y ∈ s → m x = m y → x = y) (h : map m f = map m g) :
f = g :=
le_antisymm (le_of_map_le_map_inj' hsf hsg hm (le_of_eq h))
(le_of_map_le_map_inj' hsg hsf hm (le_of_eq (Eq.symm h)))
theorem map_inj {α : Type u} {β : Type v} {f : filter α} {g : filter α} {m : α → β}
(hm : ∀ (x y : α), m x = m y → x = y) (h : map m f = map m g) : f = g :=
sorry
theorem le_map_comap_of_surjective' {α : Type u} {β : Type v} {f : α → β} {l : filter β} {u : set β}
(ul : u ∈ l) (hf : ∀ (y : β), y ∈ u → ∃ (x : α), f x = y) : l ≤ map f (comap f l) :=
sorry
theorem map_comap_of_surjective' {α : Type u} {β : Type v} {f : α → β} {l : filter β} {u : set β}
(ul : u ∈ l) (hf : ∀ (y : β), y ∈ u → ∃ (x : α), f x = y) : map f (comap f l) = l :=
le_antisymm map_comap_le (le_map_comap_of_surjective' ul hf)
theorem le_map_comap_of_surjective {α : Type u} {β : Type v} {f : α → β}
(hf : function.surjective f) (l : filter β) : l ≤ map f (comap f l) :=
le_map_comap_of_surjective' univ_mem_sets fun (y : β) (_x : y ∈ set.univ) => hf y
theorem map_comap_of_surjective {α : Type u} {β : Type v} {f : α → β} (hf : function.surjective f)
(l : filter β) : map f (comap f l) = l :=
le_antisymm map_comap_le (le_map_comap_of_surjective hf l)
theorem subtype_coe_map_comap {α : Type u} (s : set α) (f : filter α) :
map coe (comap coe f) = f ⊓ principal s :=
sorry
theorem subtype_coe_map_comap_prod {α : Type u} (s : set α) (f : filter (α × α)) :
map coe (comap coe f) = f ⊓ principal (set.prod s s) :=
sorry
theorem comap_ne_bot_iff {α : Type u} {β : Type v} {f : filter β} {m : α → β} :
ne_bot (comap m f) ↔ ∀ (t : set β), t ∈ f → ∃ (a : α), m a ∈ t :=
sorry
theorem comap_ne_bot {α : Type u} {β : Type v} {f : filter β} {m : α → β}
(hm : ∀ (t : set β), t ∈ f → ∃ (a : α), m a ∈ t) : ne_bot (comap m f) :=
iff.mpr comap_ne_bot_iff hm
theorem comap_ne_bot_iff_frequently {α : Type u} {β : Type v} {f : filter β} {m : α → β} :
ne_bot (comap m f) ↔ filter.frequently (fun (y : β) => y ∈ set.range m) f :=
sorry
theorem comap_ne_bot_iff_compl_range {α : Type u} {β : Type v} {f : filter β} {m : α → β} :
ne_bot (comap m f) ↔ ¬set.range mᶜ ∈ f :=
comap_ne_bot_iff_frequently
theorem ne_bot.comap_of_range_mem {α : Type u} {β : Type v} {f : filter β} {m : α → β}
(hf : ne_bot f) (hm : set.range m ∈ f) : ne_bot (comap m f) :=
iff.mpr comap_ne_bot_iff_frequently (eventually.frequently hm)
theorem comap_inf_principal_ne_bot_of_image_mem {α : Type u} {β : Type v} {f : filter β} {m : α → β}
(hf : ne_bot f) {s : set α} (hs : m '' s ∈ f) : ne_bot (comap m f ⊓ principal s) :=
sorry
theorem ne_bot.comap_of_surj {α : Type u} {β : Type v} {f : filter β} {m : α → β} (hf : ne_bot f)
(hm : function.surjective m) : ne_bot (comap m f) :=
ne_bot.comap_of_range_mem hf (univ_mem_sets' hm)
theorem ne_bot.comap_of_image_mem {α : Type u} {β : Type v} {f : filter β} {m : α → β}
(hf : ne_bot f) {s : set α} (hs : m '' s ∈ f) : ne_bot (comap m f) :=
ne_bot.comap_of_range_mem hf (mem_sets_of_superset hs (set.image_subset_range m s))
@[simp] theorem map_eq_bot_iff {α : Type u} {β : Type v} {f : filter α} {m : α → β} :
map m f = ⊥ ↔ f = ⊥ :=
sorry
theorem map_ne_bot_iff {α : Type u} {β : Type v} (f : α → β) {F : filter α} :
ne_bot (map f F) ↔ ne_bot F :=
not_congr map_eq_bot_iff
theorem ne_bot.map {α : Type u} {β : Type v} {f : filter α} (hf : ne_bot f) (m : α → β) :
ne_bot (map m f) :=
iff.mpr (map_ne_bot_iff m) hf
protected instance map_ne_bot {α : Type u} {β : Type v} {f : filter α} {m : α → β} [hf : ne_bot f] :
ne_bot (map m f) :=
ne_bot.map hf m
theorem sInter_comap_sets {α : Type u} {β : Type v} (f : α → β) (F : filter β) :
⋂₀sets (comap f F) = set.Inter fun (U : set β) => set.Inter fun (H : U ∈ F) => f ⁻¹' U :=
sorry
-- this is a generic rule for monotone functions:
theorem map_infi_le {α : Type u} {β : Type v} {ι : Sort x} {f : ι → filter α} {m : α → β} :
map m (infi f) ≤ infi fun (i : ι) => map m (f i) :=
le_infi fun (i : ι) => map_mono (infi_le f i)
theorem map_infi_eq {α : Type u} {β : Type v} {ι : Sort x} {f : ι → filter α} {m : α → β}
(hf : directed ge f) [Nonempty ι] : map m (infi f) = infi fun (i : ι) => map m (f i) :=
sorry
theorem map_binfi_eq {α : Type u} {β : Type v} {ι : Type w} {f : ι → filter α} {m : α → β}
{p : ι → Prop} (h : directed_on (f ⁻¹'o ge) (set_of fun (x : ι) => p x)) (ne : ∃ (x : ι), p x) :
map m (infi fun (i : ι) => infi fun (h : p i) => f i) =
infi fun (i : ι) => infi fun (h : p i) => map m (f i) :=
sorry
theorem map_inf_le {α : Type u} {β : Type v} {f : filter α} {g : filter α} {m : α → β} :
map m (f ⊓ g) ≤ map m f ⊓ map m g :=
monotone.map_inf_le map_mono f g
theorem map_inf' {α : Type u} {β : Type v} {f : filter α} {g : filter α} {m : α → β} {t : set α}
(htf : t ∈ f) (htg : t ∈ g) (h : ∀ (x : α), x ∈ t → ∀ (y : α), y ∈ t → m x = m y → x = y) :
map m (f ⊓ g) = map m f ⊓ map m g :=
sorry
theorem map_inf {α : Type u} {β : Type v} {f : filter α} {g : filter α} {m : α → β}
(h : function.injective m) : map m (f ⊓ g) = map m f ⊓ map m g :=
map_inf' univ_mem_sets univ_mem_sets
fun (x : α) (_x : x ∈ set.univ) (y : α) (_x : y ∈ set.univ) (hxy : m x = m y) => h hxy
theorem map_eq_comap_of_inverse {α : Type u} {β : Type v} {f : filter α} {m : α → β} {n : β → α}
(h₁ : m ∘ n = id) (h₂ : n ∘ m = id) : map m f = comap n f :=
sorry
theorem map_swap_eq_comap_swap {α : Type u} {β : Type v} {f : filter (α × β)} :
prod.swap <$> f = comap prod.swap f :=
map_eq_comap_of_inverse prod.swap_swap_eq prod.swap_swap_eq
theorem le_map {α : Type u} {β : Type v} {f : filter α} {m : α → β} {g : filter β}
(h : ∀ (s : set α), s ∈ f → m '' s ∈ g) : g ≤ map m f :=
fun (s : set β) (hs : s ∈ map m f) =>
mem_sets_of_superset (h (m ⁻¹' s) hs) (set.image_preimage_subset m s)
protected theorem push_pull {α : Type u} {β : Type v} (f : α → β) (F : filter α) (G : filter β) :
map f (F ⊓ comap f G) = map f F ⊓ G :=
sorry
protected theorem push_pull' {α : Type u} {β : Type v} (f : α → β) (F : filter α) (G : filter β) :
map f (comap f G ⊓ F) = G ⊓ map f F :=
sorry
theorem singleton_mem_pure_sets {α : Type u} {a : α} : singleton a ∈ pure a := set.mem_singleton a
theorem pure_injective {α : Type u} : function.injective pure :=
fun (a b : α) (hab : pure a = pure b) =>
iff.mp (iff.mp filter.ext_iff hab (set_of fun (x : α) => a = x)) rfl
protected instance pure_ne_bot {α : Type u} {a : α} : ne_bot (pure a) :=
mt (iff.mpr empty_in_sets_eq_bot) (set.not_mem_empty a)
@[simp] theorem le_pure_iff {α : Type u} {f : filter α} {a : α} : f ≤ pure a ↔ singleton a ∈ f :=
sorry
theorem mem_seq_sets_def {α : Type u} {β : Type v} {f : filter (α → β)} {g : filter α} {s : set β} :
s ∈ seq f g ↔
∃ (u : set (α → β)),
∃ (H : u ∈ f),
∃ (t : set α), ∃ (H : t ∈ g), ∀ (x : α → β), x ∈ u → ∀ (y : α), y ∈ t → x y ∈ s :=
iff.rfl
theorem mem_seq_sets_iff {α : Type u} {β : Type v} {f : filter (α → β)} {g : filter α} {s : set β} :
s ∈ seq f g ↔
∃ (u : set (α → β)), ∃ (H : u ∈ f), ∃ (t : set α), ∃ (H : t ∈ g), set.seq u t ⊆ s :=
sorry
theorem mem_map_seq_iff {α : Type u} {β : Type v} {γ : Type w} {f : filter α} {g : filter β}
{m : α → β → γ} {s : set γ} :
s ∈ seq (map m f) g ↔
∃ (t : set β),
∃ (u : set α), t ∈ g ∧ u ∈ f ∧ ∀ (x : α), x ∈ u → ∀ (y : β), y ∈ t → m x y ∈ s :=
sorry
theorem seq_mem_seq_sets {α : Type u} {β : Type v} {f : filter (α → β)} {g : filter α}
{s : set (α → β)} {t : set α} (hs : s ∈ f) (ht : t ∈ g) : set.seq s t ∈ seq f g :=
sorry
theorem le_seq {α : Type u} {β : Type v} {f : filter (α → β)} {g : filter α} {h : filter β}
(hh : ∀ (t : set (α → β)), t ∈ f → ∀ (u : set α), u ∈ g → set.seq t u ∈ h) : h ≤ seq f g :=
sorry
theorem seq_mono {α : Type u} {β : Type v} {f₁ : filter (α → β)} {f₂ : filter (α → β)}
{g₁ : filter α} {g₂ : filter α} (hf : f₁ ≤ f₂) (hg : g₁ ≤ g₂) : seq f₁ g₁ ≤ seq f₂ g₂ :=
le_seq
fun (s : set (α → β)) (hs : s ∈ f₂) (t : set α) (ht : t ∈ g₂) =>
seq_mem_seq_sets (hf hs) (hg ht)
@[simp] theorem pure_seq_eq_map {α : Type u} {β : Type v} (g : α → β) (f : filter α) :
seq (pure g) f = map g f :=
sorry
@[simp] theorem seq_pure {α : Type u} {β : Type v} (f : filter (α → β)) (a : α) :
seq f (pure a) = map (fun (g : α → β) => g a) f :=
sorry
@[simp] theorem seq_assoc {α : Type u} {β : Type v} {γ : Type w} (x : filter α) (g : filter (α → β))
(h : filter (β → γ)) : seq h (seq g x) = seq (seq (map function.comp h) g) x :=
sorry
theorem prod_map_seq_comm {α : Type u} {β : Type v} (f : filter α) (g : filter β) :
seq (map Prod.mk f) g = seq (map (fun (b : β) (a : α) => (a, b)) g) f :=
sorry
protected instance is_lawful_functor : is_lawful_functor filter :=
is_lawful_functor.mk (fun (α : Type u) (f : filter α) => map_id)
fun (α β γ : Type u) (f : α → β) (g : β → γ) (a : filter α) => Eq.symm map_map
protected instance is_lawful_applicative : is_lawful_applicative filter :=
is_lawful_applicative.mk (fun (α β : Type u) => pure_seq_eq_map) (fun (α β : Type u) => map_pure)
(fun (α β : Type u) => seq_pure) fun (α β γ : Type u) => seq_assoc
protected instance is_comm_applicative : is_comm_applicative filter :=
is_comm_applicative.mk fun (α β : Type u) (f : filter α) (g : filter β) => prod_map_seq_comm f g
theorem seq_eq_filter_seq {α : Type l} {β : Type l} (f : filter (α → β)) (g : filter α) :
f <*> g = seq f g :=
rfl
/- bind equations -/
@[simp] theorem eventually_bind {α : Type u} {β : Type v} {f : filter α} {m : α → filter β}
{p : β → Prop} :
filter.eventually (fun (y : β) => p y) (bind f m) ↔
filter.eventually (fun (x : α) => filter.eventually (fun (y : β) => p y) (m x)) f :=
iff.rfl
@[simp] theorem eventually_eq_bind {α : Type u} {β : Type v} {γ : Type w} {f : filter α}
{m : α → filter β} {g₁ : β → γ} {g₂ : β → γ} :
eventually_eq (bind f m) g₁ g₂ ↔
filter.eventually (fun (x : α) => eventually_eq (m x) g₁ g₂) f :=
iff.rfl
@[simp] theorem eventually_le_bind {α : Type u} {β : Type v} {γ : Type w} [HasLessEq γ]
{f : filter α} {m : α → filter β} {g₁ : β → γ} {g₂ : β → γ} :
eventually_le (bind f m) g₁ g₂ ↔
filter.eventually (fun (x : α) => eventually_le (m x) g₁ g₂) f :=
iff.rfl
theorem mem_bind_sets' {α : Type u} {β : Type v} {s : set β} {f : filter α} {m : α → filter β} :
s ∈ bind f m ↔ (set_of fun (a : α) => s ∈ m a) ∈ f :=
iff.rfl
@[simp] theorem mem_bind_sets {α : Type u} {β : Type v} {s : set β} {f : filter α}
{m : α → filter β} : s ∈ bind f m ↔ ∃ (t : set α), ∃ (H : t ∈ f), ∀ (x : α), x ∈ t → s ∈ m x :=
iff.trans (iff.trans iff.rfl (iff.symm exists_sets_subset_iff)) iff.rfl
theorem bind_le {α : Type u} {β : Type v} {f : filter α} {g : α → filter β} {l : filter β}
(h : filter.eventually (fun (x : α) => g x ≤ l) f) : bind f g ≤ l :=
join_le (iff.mpr eventually_map h)
theorem bind_mono {α : Type u} {β : Type v} {f₁ : filter α} {f₂ : filter α} {g₁ : α → filter β}
{g₂ : α → filter β} (hf : f₁ ≤ f₂) (hg : eventually_le f₁ g₁ g₂) : bind f₁ g₁ ≤ bind f₂ g₂ :=
sorry
theorem bind_inf_principal {α : Type u} {β : Type v} {f : filter α} {g : α → filter β} {s : set β} :
(bind f fun (x : α) => g x ⊓ principal s) = bind f g ⊓ principal s :=
sorry
theorem sup_bind {α : Type u} {β : Type v} {f : filter α} {g : filter α} {h : α → filter β} :
bind (f ⊔ g) h = bind f h ⊔ bind g h :=
sorry
theorem principal_bind {α : Type u} {β : Type v} {s : set α} {f : α → filter β} :
bind (principal s) f = supr fun (x : α) => supr fun (H : x ∈ s) => f x :=
sorry
/- This is a separate section in order to open `list`, but mostly because of universe
equality requirements in `traverse` -/
theorem sequence_mono {α : Type u} (as : List (filter α)) (bs : List (filter α)) :
list.forall₂ LessEq as bs → sequence as ≤ sequence bs :=
sorry
theorem mem_traverse_sets {α' : Type u} {β' : Type u} {γ' : Type u} {f : β' → filter α'}
{s : γ' → set α'} (fs : List β') (us : List γ') :
list.forall₂ (fun (b : β') (c : γ') => s c ∈ f b) fs us → traverse s us ∈ traverse f fs :=
sorry
theorem mem_traverse_sets_iff {α' : Type u} {β' : Type u} {f : β' → filter α'} (fs : List β')
(t : set (List α')) :
t ∈ traverse f fs ↔
∃ (us : List (set α')),
list.forall₂ (fun (b : β') (s : set α') => s ∈ f b) fs us ∧ sequence us ⊆ t :=
sorry
/-! ### Limits -/
/-- `tendsto` is the generic "limit of a function" predicate.
`tendsto f l₁ l₂` asserts that for every `l₂` neighborhood `a`,
the `f`-preimage of `a` is an `l₁` neighborhood. -/
def tendsto {α : Type u} {β : Type v} (f : α → β) (l₁ : filter α) (l₂ : filter β) := map f l₁ ≤ l₂
theorem tendsto_def {α : Type u} {β : Type v} {f : α → β} {l₁ : filter α} {l₂ : filter β} :
tendsto f l₁ l₂ ↔ ∀ (s : set β), s ∈ l₂ → f ⁻¹' s ∈ l₁ :=
iff.rfl
theorem tendsto_iff_eventually {α : Type u} {β : Type v} {f : α → β} {l₁ : filter α}
{l₂ : filter β} :
tendsto f l₁ l₂ ↔
∀ {p : β → Prop},
filter.eventually (fun (y : β) => p y) l₂ →
filter.eventually (fun (x : α) => p (f x)) l₁ :=
iff.rfl
theorem tendsto.eventually {α : Type u} {β : Type v} {f : α → β} {l₁ : filter α} {l₂ : filter β}
{p : β → Prop} (hf : tendsto f l₁ l₂) (h : filter.eventually (fun (y : β) => p y) l₂) :
filter.eventually (fun (x : α) => p (f x)) l₁ :=
hf h
theorem tendsto.frequently {α : Type u} {β : Type v} {f : α → β} {l₁ : filter α} {l₂ : filter β}
{p : β → Prop} (hf : tendsto f l₁ l₂) (h : filter.frequently (fun (x : α) => p (f x)) l₁) :
filter.frequently (fun (y : β) => p y) l₂ :=
mt (tendsto.eventually hf) h
@[simp] theorem tendsto_bot {α : Type u} {β : Type v} {f : α → β} {l : filter β} : tendsto f ⊥ l :=
sorry
@[simp] theorem tendsto_top {α : Type u} {β : Type v} {f : α → β} {l : filter α} : tendsto f l ⊤ :=
le_top
theorem le_map_of_right_inverse {α : Type u} {β : Type v} {mab : α → β} {mba : β → α} {f : filter α}
{g : filter β} (h₁ : eventually_eq g (mab ∘ mba) id) (h₂ : tendsto mba g f) : g ≤ map mab f :=
eq.mpr (id (Eq._oldrec (Eq.refl (g ≤ map mab f)) (Eq.symm map_id)))
(eq.mpr (id (Eq._oldrec (Eq.refl (map id g ≤ map mab f)) (Eq.symm (map_congr h₁))))
(eq.mpr (id (Eq._oldrec (Eq.refl (map (mab ∘ mba) g ≤ map mab f)) (Eq.symm map_map)))
(map_mono h₂)))
theorem tendsto_of_not_nonempty {α : Type u} {β : Type v} {f : α → β} {la : filter α}
{lb : filter β} (h : ¬Nonempty α) : tendsto f la lb :=
sorry
theorem eventually_eq_of_left_inv_of_right_inv {α : Type u} {β : Type v} {f : α → β} {g₁ : β → α}
{g₂ : β → α} {fa : filter α} {fb : filter β}
(hleft : filter.eventually (fun (x : α) => g₁ (f x) = x) fa)
(hright : filter.eventually (fun (y : β) => f (g₂ y) = y) fb) (htendsto : tendsto g₂ fb fa) :
eventually_eq fb g₁ g₂ :=
eventually.mp (tendsto.eventually htendsto hleft)
(eventually.mono hright
fun (y : β) (hr : f (g₂ y) = y) (hl : g₁ (f (g₂ y)) = g₂ y) =>
Eq.trans (congr_arg g₁ (Eq.symm hr)) hl)
theorem tendsto_iff_comap {α : Type u} {β : Type v} {f : α → β} {l₁ : filter α} {l₂ : filter β} :
tendsto f l₁ l₂ ↔ l₁ ≤ comap f l₂ :=
map_le_iff_le_comap
theorem tendsto.le_comap {α : Type u} {β : Type v} {f : α → β} {l₁ : filter α} {l₂ : filter β} :
tendsto f l₁ l₂ → l₁ ≤ comap f l₂ :=
iff.mp tendsto_iff_comap
theorem tendsto_congr' {α : Type u} {β : Type v} {f₁ : α → β} {f₂ : α → β} {l₁ : filter α}
{l₂ : filter β} (hl : eventually_eq l₁ f₁ f₂) : tendsto f₁ l₁ l₂ ↔ tendsto f₂ l₁ l₂ :=
eq.mpr
(id
(Eq._oldrec (Eq.refl (tendsto f₁ l₁ l₂ ↔ tendsto f₂ l₁ l₂))
(tendsto.equations._eqn_1 f₁ l₁ l₂)))
(eq.mpr
(id
(Eq._oldrec (Eq.refl (map f₁ l₁ ≤ l₂ ↔ tendsto f₂ l₁ l₂))
(tendsto.equations._eqn_1 f₂ l₁ l₂)))
(eq.mpr (id (Eq._oldrec (Eq.refl (map f₁ l₁ ≤ l₂ ↔ map f₂ l₁ ≤ l₂)) (map_congr hl)))
(iff.refl (map f₂ l₁ ≤ l₂))))
theorem tendsto.congr' {α : Type u} {β : Type v} {f₁ : α → β} {f₂ : α → β} {l₁ : filter α}
{l₂ : filter β} (hl : eventually_eq l₁ f₁ f₂) (h : tendsto f₁ l₁ l₂) : tendsto f₂ l₁ l₂ :=
iff.mp (tendsto_congr' hl) h
theorem tendsto_congr {α : Type u} {β : Type v} {f₁ : α → β} {f₂ : α → β} {l₁ : filter α}
{l₂ : filter β} (h : ∀ (x : α), f₁ x = f₂ x) : tendsto f₁ l₁ l₂ ↔ tendsto f₂ l₁ l₂ :=
tendsto_congr' (univ_mem_sets' h)
theorem tendsto.congr {α : Type u} {β : Type v} {f₁ : α → β} {f₂ : α → β} {l₁ : filter α}
{l₂ : filter β} (h : ∀ (x : α), f₁ x = f₂ x) : tendsto f₁ l₁ l₂ → tendsto f₂ l₁ l₂ :=
iff.mp (tendsto_congr h)
theorem tendsto_id' {α : Type u} {x : filter α} {y : filter α} : x ≤ y → tendsto id x y := sorry
theorem tendsto_id {α : Type u} {x : filter α} : tendsto id x x := tendsto_id' (le_refl x)
theorem tendsto.comp {α : Type u} {β : Type v} {γ : Type w} {f : α → β} {g : β → γ} {x : filter α}
{y : filter β} {z : filter γ} (hg : tendsto g y z) (hf : tendsto f x y) : tendsto (g ∘ f) x z :=
sorry
theorem tendsto.mono_left {α : Type u} {β : Type v} {f : α → β} {x : filter α} {y : filter α}
{z : filter β} (hx : tendsto f x z) (h : y ≤ x) : tendsto f y z :=
le_trans (map_mono h) hx
theorem tendsto.mono_right {α : Type u} {β : Type v} {f : α → β} {x : filter α} {y : filter β}
{z : filter β} (hy : tendsto f x y) (hz : y ≤ z) : tendsto f x z :=
le_trans hy hz
theorem tendsto.ne_bot {α : Type u} {β : Type v} {f : α → β} {x : filter α} {y : filter β}
(h : tendsto f x y) [hx : ne_bot x] : ne_bot y :=
ne_bot.mono (ne_bot.map hx f) h
theorem tendsto_map {α : Type u} {β : Type v} {f : α → β} {x : filter α} : tendsto f x (map f x) :=
le_refl (map f x)
theorem tendsto_map' {α : Type u} {β : Type v} {γ : Type w} {f : β → γ} {g : α → β} {x : filter α}
{y : filter γ} (h : tendsto (f ∘ g) x y) : tendsto f (map g x) y :=
eq.mpr
(id (Eq._oldrec (Eq.refl (tendsto f (map g x) y)) (tendsto.equations._eqn_1 f (map g x) y)))
(eq.mpr (id (Eq._oldrec (Eq.refl (map f (map g x) ≤ y)) map_map)) h)
theorem tendsto_map'_iff {α : Type u} {β : Type v} {γ : Type w} {f : β → γ} {g : α → β}
{x : filter α} {y : filter γ} : tendsto f (map g x) y ↔ tendsto (f ∘ g) x y :=
sorry
theorem tendsto_comap {α : Type u} {β : Type v} {f : α → β} {x : filter β} :
tendsto f (comap f x) x :=
map_comap_le
theorem tendsto_comap_iff {α : Type u} {β : Type v} {γ : Type w} {f : α → β} {g : β → γ}
{a : filter α} {c : filter γ} : tendsto f a (comap g c) ↔ tendsto (g ∘ f) a c :=
sorry
theorem tendsto_comap'_iff {α : Type u} {β : Type v} {γ : Type w} {m : α → β} {f : filter α}
{g : filter β} {i : γ → α} (h : set.range i ∈ f) :
tendsto (m ∘ i) (comap i f) g ↔ tendsto m f g :=
sorry
theorem comap_eq_of_inverse {α : Type u} {β : Type v} {f : filter α} {g : filter β} {φ : α → β}
(ψ : β → α) (eq : ψ ∘ φ = id) (hφ : tendsto φ f g) (hψ : tendsto ψ g f) : comap φ g = f :=
sorry
theorem map_eq_of_inverse {α : Type u} {β : Type v} {f : filter α} {g : filter β} {φ : α → β}
(ψ : β → α) (eq : φ ∘ ψ = id) (hφ : tendsto φ f g) (hψ : tendsto ψ g f) : map φ f = g :=
sorry
theorem tendsto_inf {α : Type u} {β : Type v} {f : α → β} {x : filter α} {y₁ : filter β}
{y₂ : filter β} : tendsto f x (y₁ ⊓ y₂) ↔ tendsto f x y₁ ∧ tendsto f x y₂ :=
sorry
theorem tendsto_inf_left {α : Type u} {β : Type v} {f : α → β} {x₁ : filter α} {x₂ : filter α}
{y : filter β} (h : tendsto f x₁ y) : tendsto f (x₁ ⊓ x₂) y :=
le_trans (map_mono inf_le_left) h
theorem tendsto_inf_right {α : Type u} {β : Type v} {f : α → β} {x₁ : filter α} {x₂ : filter α}
{y : filter β} (h : tendsto f x₂ y) : tendsto f (x₁ ⊓ x₂) y :=
le_trans (map_mono inf_le_right) h
theorem tendsto.inf {α : Type u} {β : Type v} {f : α → β} {x₁ : filter α} {x₂ : filter α}
{y₁ : filter β} {y₂ : filter β} (h₁ : tendsto f x₁ y₁) (h₂ : tendsto f x₂ y₂) :
tendsto f (x₁ ⊓ x₂) (y₁ ⊓ y₂) :=
iff.mpr tendsto_inf { left := tendsto_inf_left h₁, right := tendsto_inf_right h₂ }
@[simp] theorem tendsto_infi {α : Type u} {β : Type v} {ι : Sort x} {f : α → β} {x : filter α}
{y : ι → filter β} : tendsto f x (infi fun (i : ι) => y i) ↔ ∀ (i : ι), tendsto f x (y i) :=
sorry
theorem tendsto_infi' {α : Type u} {β : Type v} {ι : Sort x} {f : α → β} {x : ι → filter α}
{y : filter β} (i : ι) (hi : tendsto f (x i) y) : tendsto f (infi fun (i : ι) => x i) y :=
tendsto.mono_left hi (infi_le (fun (i : ι) => x i) i)
theorem tendsto_sup {α : Type u} {β : Type v} {f : α → β} {x₁ : filter α} {x₂ : filter α}
{y : filter β} : tendsto f (x₁ ⊔ x₂) y ↔ tendsto f x₁ y ∧ tendsto f x₂ y :=
sorry
theorem tendsto.sup {α : Type u} {β : Type v} {f : α → β} {x₁ : filter α} {x₂ : filter α}
{y : filter β} : tendsto f x₁ y → tendsto f x₂ y → tendsto f (x₁ ⊔ x₂) y :=
fun (h₁ : tendsto f x₁ y) (h₂ : tendsto f x₂ y) => iff.mpr tendsto_sup { left := h₁, right := h₂ }
@[simp] theorem tendsto_principal {α : Type u} {β : Type v} {f : α → β} {l : filter α} {s : set β} :
tendsto f l (principal s) ↔ filter.eventually (fun (a : α) => f a ∈ s) l :=
sorry
@[simp] theorem tendsto_principal_principal {α : Type u} {β : Type v} {f : α → β} {s : set α}
{t : set β} : tendsto f (principal s) (principal t) ↔ ∀ (a : α), a ∈ s → f a ∈ t :=
sorry
@[simp] theorem tendsto_pure {α : Type u} {β : Type v} {f : α → β} {a : filter α} {b : β} :
tendsto f a (pure b) ↔ filter.eventually (fun (x : α) => f x = b) a :=
sorry
theorem tendsto_pure_pure {α : Type u} {β : Type v} (f : α → β) (a : α) :
tendsto f (pure a) (pure (f a)) :=
iff.mpr tendsto_pure rfl
theorem tendsto_const_pure {α : Type u} {β : Type v} {a : filter α} {b : β} :
tendsto (fun (x : α) => b) a (pure b) :=
iff.mpr tendsto_pure (univ_mem_sets' fun (_x : α) => rfl)
theorem pure_le_iff {α : Type u} {a : α} {l : filter α} :
pure a ≤ l ↔ ∀ (s : set α), s ∈ l → a ∈ s :=
iff.rfl
theorem tendsto_pure_left {α : Type u} {β : Type v} {f : α → β} {a : α} {l : filter β} :
tendsto f (pure a) l ↔ ∀ (s : set β), s ∈ l → f a ∈ s :=
iff.rfl
/-- If two filters are disjoint, then a function cannot tend to both of them along a non-trivial
filter. -/
theorem tendsto.not_tendsto {α : Type u} {β : Type v} {f : α → β} {a : filter α} {b₁ : filter β}
{b₂ : filter β} (hf : tendsto f a b₁) [ne_bot a] (hb : disjoint b₁ b₂) : ¬tendsto f a b₂ :=
fun (hf' : tendsto f a b₂) =>
tendsto.ne_bot (iff.mpr tendsto_inf { left := hf, right := hf' }) (disjoint.eq_bot hb)
theorem tendsto_if {α : Type u} {β : Type v} {l₁ : filter α} {l₂ : filter β} {f : α → β} {g : α → β}
{p : α → Prop} [decidable_pred p] (h₀ : tendsto f (l₁ ⊓ principal p) l₂)
(h₁ : tendsto g (l₁ ⊓ principal (set_of fun (x : α) => ¬p x)) l₂) :
tendsto (fun (x : α) => ite (p x) (f x) (g x)) l₁ l₂ :=
sorry
/-! ### Products of filters -/
/- The product filter cannot be defined using the monad structure on filters. For example:
F := do {x ← seq, y ← top, return (x, y)}
hence:
s ∈ F ↔ ∃n, [n..∞] × univ ⊆ s
G := do {y ← top, x ← seq, return (x, y)}
hence:
s ∈ G ↔ ∀i:ℕ, ∃n, [n..∞] × {i} ⊆ s
Now ⋃i, [i..∞] × {i} is in G but not in F.
As product filter we want to have F as result.
-/
/-- Product of filters. This is the filter generated by cartesian products
of elements of the component filters. -/
protected def prod {α : Type u} {β : Type v} (f : filter α) (g : filter β) : filter (α × β) :=
comap prod.fst f ⊓ comap prod.snd g
theorem prod_mem_prod {α : Type u} {β : Type v} {s : set α} {t : set β} {f : filter α}
{g : filter β} (hs : s ∈ f) (ht : t ∈ g) : set.prod s t ∈ filter.prod f g :=
inter_mem_inf_sets (preimage_mem_comap hs) (preimage_mem_comap ht)
theorem mem_prod_iff {α : Type u} {β : Type v} {s : set (α × β)} {f : filter α} {g : filter β} :
s ∈ filter.prod f g ↔
∃ (t₁ : set α), ∃ (H : t₁ ∈ f), ∃ (t₂ : set β), ∃ (H : t₂ ∈ g), set.prod t₁ t₂ ⊆ s :=
sorry
theorem comap_prod {α : Type u} {β : Type v} {γ : Type w} (f : α → β × γ) (b : filter β)
(c : filter γ) : comap f (filter.prod b c) = comap (prod.fst ∘ f) b ⊓ comap (prod.snd ∘ f) c :=
sorry
theorem eventually_prod_iff {α : Type u} {β : Type v} {p : α × β → Prop} {f : filter α}
{g : filter β} :
filter.eventually (fun (x : α × β) => p x) (filter.prod f g) ↔
∃ (pa : α → Prop),
∃ (ha : filter.eventually (fun (x : α) => pa x) f),
∃ (pb : β → Prop),
∃ (hb : filter.eventually (fun (y : β) => pb y) g),
∀ {x : α}, pa x → ∀ {y : β}, pb y → p (x, y) :=
sorry
theorem tendsto_fst {α : Type u} {β : Type v} {f : filter α} {g : filter β} :
tendsto prod.fst (filter.prod f g) f :=
tendsto_inf_left tendsto_comap
theorem tendsto_snd {α : Type u} {β : Type v} {f : filter α} {g : filter β} :
tendsto prod.snd (filter.prod f g) g :=
tendsto_inf_right tendsto_comap
theorem tendsto.prod_mk {α : Type u} {β : Type v} {γ : Type w} {f : filter α} {g : filter β}
{h : filter γ} {m₁ : α → β} {m₂ : α → γ} (h₁ : tendsto m₁ f g) (h₂ : tendsto m₂ f h) :
tendsto (fun (x : α) => (m₁ x, m₂ x)) f (filter.prod g h) :=
iff.mpr tendsto_inf
{ left := iff.mpr tendsto_comap_iff h₁, right := iff.mpr tendsto_comap_iff h₂ }
theorem eventually.prod_inl {α : Type u} {β : Type v} {la : filter α} {p : α → Prop}
(h : filter.eventually (fun (x : α) => p x) la) (lb : filter β) :
filter.eventually (fun (x : α × β) => p (prod.fst x)) (filter.prod la lb) :=
tendsto.eventually tendsto_fst h
theorem eventually.prod_inr {α : Type u} {β : Type v} {lb : filter β} {p : β → Prop}
(h : filter.eventually (fun (x : β) => p x) lb) (la : filter α) :
filter.eventually (fun (x : α × β) => p (prod.snd x)) (filter.prod la lb) :=
tendsto.eventually tendsto_snd h
theorem eventually.prod_mk {α : Type u} {β : Type v} {la : filter α} {pa : α → Prop}
(ha : filter.eventually (fun (x : α) => pa x) la) {lb : filter β} {pb : β → Prop}
(hb : filter.eventually (fun (y : β) => pb y) lb) :
filter.eventually (fun (p : α × β) => pa (prod.fst p) ∧ pb (prod.snd p)) (filter.prod la lb) :=
eventually.and (eventually.prod_inl ha lb) (eventually.prod_inr hb la)
theorem eventually.curry {α : Type u} {β : Type v} {la : filter α} {lb : filter β}
{p : α × β → Prop} (h : filter.eventually (fun (x : α × β) => p x) (filter.prod la lb)) :
filter.eventually (fun (x : α) => filter.eventually (fun (y : β) => p (x, y)) lb) la :=
sorry
theorem prod_infi_left {α : Type u} {β : Type v} {ι : Sort x} [Nonempty ι] {f : ι → filter α}
{g : filter β} :
filter.prod (infi fun (i : ι) => f i) g = infi fun (i : ι) => filter.prod (f i) g :=
sorry
theorem prod_infi_right {α : Type u} {β : Type v} {ι : Sort x} [Nonempty ι] {f : filter α}
{g : ι → filter β} :
filter.prod f (infi fun (i : ι) => g i) = infi fun (i : ι) => filter.prod f (g i) :=
sorry
theorem prod_mono {α : Type u} {β : Type v} {f₁ : filter α} {f₂ : filter α} {g₁ : filter β}
{g₂ : filter β} (hf : f₁ ≤ f₂) (hg : g₁ ≤ g₂) : filter.prod f₁ g₁ ≤ filter.prod f₂ g₂ :=
inf_le_inf (comap_mono hf) (comap_mono hg)
theorem prod_comap_comap_eq {α₁ : Type u} {α₂ : Type v} {β₁ : Type w} {β₂ : Type x} {f₁ : filter α₁}
{f₂ : filter α₂} {m₁ : β₁ → α₁} {m₂ : β₂ → α₂} :
filter.prod (comap m₁ f₁) (comap m₂ f₂) =
comap (fun (p : β₁ × β₂) => (m₁ (prod.fst p), m₂ (prod.snd p))) (filter.prod f₁ f₂) :=
sorry
theorem prod_comm' {α : Type u} {β : Type v} {f : filter α} {g : filter β} :
filter.prod f g = comap prod.swap (filter.prod g f) :=
sorry
theorem prod_comm {α : Type u} {β : Type v} {f : filter α} {g : filter β} :
filter.prod f g = map (fun (p : β × α) => (prod.snd p, prod.fst p)) (filter.prod g f) :=
sorry
theorem prod_map_map_eq {α₁ : Type u} {α₂ : Type v} {β₁ : Type w} {β₂ : Type x} {f₁ : filter α₁}
{f₂ : filter α₂} {m₁ : α₁ → β₁} {m₂ : α₂ → β₂} :
filter.prod (map m₁ f₁) (map m₂ f₂) =
map (fun (p : α₁ × α₂) => (m₁ (prod.fst p), m₂ (prod.snd p))) (filter.prod f₁ f₂) :=
sorry
theorem prod_map_map_eq' {α₁ : Type u_1} {α₂ : Type u_2} {β₁ : Type u_3} {β₂ : Type u_4}
(f : α₁ → α₂) (g : β₁ → β₂) (F : filter α₁) (G : filter β₁) :
filter.prod (map f F) (map g G) = map (prod.map f g) (filter.prod F G) :=
eq.mpr
(id
(Eq._oldrec (Eq.refl (filter.prod (map f F) (map g G) = map (prod.map f g) (filter.prod F G)))
prod_map_map_eq))
(Eq.refl (map (fun (p : α₁ × β₁) => (f (prod.fst p), g (prod.snd p))) (filter.prod F G)))
theorem tendsto.prod_map {α : Type u} {β : Type v} {γ : Type w} {δ : Type u_1} {f : α → γ}
{g : β → δ} {a : filter α} {b : filter β} {c : filter γ} {d : filter δ} (hf : tendsto f a c)
(hg : tendsto g b d) : tendsto (prod.map f g) (filter.prod a b) (filter.prod c d) :=
sorry
theorem map_prod {α : Type u} {β : Type v} {γ : Type w} (m : α × β → γ) (f : filter α)
(g : filter β) : map m (filter.prod f g) = seq (map (fun (a : α) (b : β) => m (a, b)) f) g :=
sorry
theorem prod_eq {α : Type u} {β : Type v} {f : filter α} {g : filter β} :
filter.prod f g = seq (map Prod.mk f) g :=
(fun (h : map id (filter.prod f g) = seq (map (fun (a : α) (b : β) => id (a, b)) f) g) =>
eq.mp
(Eq._oldrec
(Eq.refl (map id (filter.prod f g) = seq (map (fun (a : α) (b : β) => id (a, b)) f) g))
map_id)
h)
(map_prod id f g)
theorem prod_inf_prod {α : Type u} {β : Type v} {f₁ : filter α} {f₂ : filter α} {g₁ : filter β}
{g₂ : filter β} : filter.prod f₁ g₁ ⊓ filter.prod f₂ g₂ = filter.prod (f₁ ⊓ f₂) (g₁ ⊓ g₂) :=
sorry
@[simp] theorem prod_bot {α : Type u} {β : Type v} {f : filter α} : filter.prod f ⊥ = ⊥ := sorry
@[simp] theorem bot_prod {α : Type u} {β : Type v} {g : filter β} : filter.prod ⊥ g = ⊥ := sorry
@[simp] theorem prod_principal_principal {α : Type u} {β : Type v} {s : set α} {t : set β} :
filter.prod (principal s) (principal t) = principal (set.prod s t) :=
sorry
@[simp] theorem pure_prod {α : Type u} {β : Type v} {a : α} {f : filter β} :
filter.prod (pure a) f = map (Prod.mk a) f :=
sorry
@[simp] theorem prod_pure {α : Type u} {β : Type v} {f : filter α} {b : β} :
filter.prod f (pure b) = map (fun (a : α) => (a, b)) f :=
sorry
theorem prod_pure_pure {α : Type u} {β : Type v} {a : α} {b : β} :
filter.prod (pure a) (pure b) = pure (a, b) :=
sorry
theorem prod_eq_bot {α : Type u} {β : Type v} {f : filter α} {g : filter β} :
filter.prod f g = ⊥ ↔ f = ⊥ ∨ g = ⊥ :=
sorry
theorem prod_ne_bot {α : Type u} {β : Type v} {f : filter α} {g : filter β} :
ne_bot (filter.prod f g) ↔ ne_bot f ∧ ne_bot g :=
iff.trans (not_congr prod_eq_bot) not_or_distrib
theorem ne_bot.prod {α : Type u} {β : Type v} {f : filter α} {g : filter β} (hf : ne_bot f)
(hg : ne_bot g) : ne_bot (filter.prod f g) :=
iff.mpr prod_ne_bot { left := hf, right := hg }
protected instance prod_ne_bot' {α : Type u} {β : Type v} {f : filter α} {g : filter β}
[hf : ne_bot f] [hg : ne_bot g] : ne_bot (filter.prod f g) :=
ne_bot.prod hf hg
theorem tendsto_prod_iff {α : Type u} {β : Type v} {γ : Type w} {f : α × β → γ} {x : filter α}
{y : filter β} {z : filter γ} :
tendsto f (filter.prod x y) z ↔
∀ (W : set γ) (H : W ∈ z),
∃ (U : set α),
∃ (H : U ∈ x),
∃ (V : set β), ∃ (H : V ∈ y), ∀ (x : α) (y : β), x ∈ U → y ∈ V → f (x, y) ∈ W :=
sorry
end filter
theorem set.eq_on.eventually_eq {α : Type u_1} {β : Type u_2} {s : set α} {f : α → β} {g : α → β}
(h : set.eq_on f g s) : filter.eventually_eq (filter.principal s) f g :=
h
theorem set.eq_on.eventually_eq_of_mem {α : Type u_1} {β : Type u_2} {s : set α} {l : filter α}
{f : α → β} {g : α → β} (h : set.eq_on f g s) (hl : s ∈ l) : filter.eventually_eq l f g :=
filter.eventually_eq.filter_mono (set.eq_on.eventually_eq h) (iff.mpr filter.le_principal_iff hl)
theorem set.subset.eventually_le {α : Type u_1} {l : filter α} {s : set α} {t : set α} (h : s ⊆ t) :
filter.eventually_le l s t :=
filter.eventually_of_forall h
end Mathlib |
3 :
|
SUBROUTINE OAGSPC ( gltln, slat, slon, number, dscomp, dsunif,
+ iret )
C************************************************************************
C* OAGSPC *
C* *
C* This subroutine computes the average minimum station spacing *
C* and the uniform station spacing. *
C* *
C* OAGSPC ( GLTLN, SLAT, SLON, NUMBER, DSCOMP, DSUNIF, IRET ) *
C* *
C* Input parameters: *
C* GLTLN (4) REAL Grid bounds *
C* SLAT (NUMBER) REAL Station latitudes *
C* SLON (NUMBER) REAL Station longitudes *
C* NUMBER INTEGER Number of stations *
C* *
C* Output parameters: *
C* DSCOMP REAL Average min station spacing *
C* DSUNIF REAL Uniform station spacing *
C* IRET INTEGER Return code *
C* 0 = normal return *
C* -9 = insufficient stations *
C** *
C* Log: *
C* M. desJardins/GSFC 8/85 *
C* M. desJardins/GSFC 11/88 GEMPAK 4.1 *
C************************************************************************
INCLUDE 'GEMPRM.PRM'
INCLUDE 'oagcmn.cmn'
C*
REAL slat (*), slon (*), gltln (*)
C*
PARAMETER ( EPS = 1.E-10, DIST = 8., BIG = 100000. )
C*
C------------------------------------------------------------------------
iret = 0
C
C* Check for insufficient stations.
C
IF ( number .lt. 4 ) THEN
iret = -9
CALL ER_WMSG ( 'OAGRID', iret, ' ', ier )
RETURN
END IF
C
C* Check each station and find the closest station.
C
ns = 0
dsum = 0.
C*
DO i = 1, number
tlat = slat (i)
tlon = slon (i)
amind = big
tlatp = tlat + DIST
tlatm = tlat - DIST
tlonp = tlon + DIST
tlonm = tlon - DIST
DO j = 1, number
IF ( i .ne. j ) THEN
ulat = slat (j)
ulon = slon (j)
IF ( ( ulat .gt. tlatm ) .and. ( ulat .lt. tlatp )
+ .and. ( ulon .gt. tlonm ) .and.
+ ( ulon .lt. tlonp ) ) THEN
dc = COS ( ( ( tlat + ulat ) / 2. ) * DTR )
d = ( tlat - ulat ) ** 2 +
+ ( dc * ( tlon - ulon ) ) ** 2
IF ( ( d .lt. amind ) .and.
+ ( d .gt. EPS ) ) amind = d
END IF
END IF
END DO
C
C* Check that information is not missing.
C
IF ( amind .lt. BIG ) THEN
dsum = dsum + SQRT ( amind )
ns = ns + 1
END IF
END DO
C
C* Check that there are enough stations.
C
IF ( ns .lt. 2 ) THEN
iret = -9
CALL ER_WMSG ( 'OAGRID', iret, ' ', ier )
ELSE
C
C* Compute the computed station spacing.
C
dscomp = dsum / ns
C
C* Compute the uniform station spacing.
C
dn = COS ( ( gltln (3) + gltln (1) ) * DTR / 2. )
d1 = gltln (3) - gltln (1)
d2 = ( gltln (4) - gltln (2) ) * dn
a = 1 - number
b = d1 + d2
c = d1 * d2
ds = SQRT ( b**2 - 4.*a*c )
dsunif = ( -b - ds ) / ( 2. * a )
END IF
C*
RETURN
END
|
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
x : G
⊢ Memℒp (↑↑(condexpIndSMul hm hs hμs x)) 1
[PROOFSTEP]
rw [memℒp_one_iff_integrable]
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
x : G
⊢ Integrable ↑↑(condexpIndSMul hm hs hμs x)
[PROOFSTEP]
apply integrable_condexpIndSMul
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
x y : G
⊢ condexpIndL1Fin hm hs hμs (x + y) = condexpIndL1Fin hm hs hμs x + condexpIndL1Fin hm hs hμs y
[PROOFSTEP]
ext1
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
x y : G
⊢ ↑↑(condexpIndL1Fin hm hs hμs (x + y)) =ᵐ[μ] ↑↑(condexpIndL1Fin hm hs hμs x + condexpIndL1Fin hm hs hμs y)
[PROOFSTEP]
refine' (Memℒp.coeFn_toLp q).trans _
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
x y : G
⊢ ↑↑(condexpIndSMul hm hs hμs (x + y)) =ᵐ[μ] ↑↑(condexpIndL1Fin hm hs hμs x + condexpIndL1Fin hm hs hμs y)
[PROOFSTEP]
refine' EventuallyEq.trans _ (Lp.coeFn_add _ _).symm
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
x y : G
⊢ ↑↑(condexpIndSMul hm hs hμs (x + y)) =ᵐ[μ] ↑↑(condexpIndL1Fin hm hs hμs x) + ↑↑(condexpIndL1Fin hm hs hμs y)
[PROOFSTEP]
refine' EventuallyEq.trans _ (EventuallyEq.add (Memℒp.coeFn_toLp q).symm (Memℒp.coeFn_toLp q).symm)
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
x y : G
⊢ ↑↑(condexpIndSMul hm hs hμs (x + y)) =ᵐ[μ] fun x_1 =>
↑↑(condexpIndSMul hm hs hμs x) x_1 + ↑↑(condexpIndSMul hm hs hμs y) x_1
[PROOFSTEP]
rw [condexpIndSMul_add]
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
x y : G
⊢ ↑↑(condexpIndSMul hm hs hμs x + condexpIndSMul hm hs hμs y) =ᵐ[μ] fun x_1 =>
↑↑(condexpIndSMul hm hs hμs x) x_1 + ↑↑(condexpIndSMul hm hs hμs y) x_1
[PROOFSTEP]
refine' (Lp.coeFn_add _ _).trans (eventually_of_forall fun a => _)
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
x y : G
a : α
⊢ (↑↑(condexpIndSMul hm hs hμs x) + ↑↑(condexpIndSMul hm hs hμs y)) a =
(fun x_1 => ↑↑(condexpIndSMul hm hs hμs x) x_1 + ↑↑(condexpIndSMul hm hs hμs y) x_1) a
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
c : ℝ
x : G
⊢ condexpIndL1Fin hm hs hμs (c • x) = c • condexpIndL1Fin hm hs hμs x
[PROOFSTEP]
ext1
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
c : ℝ
x : G
⊢ ↑↑(condexpIndL1Fin hm hs hμs (c • x)) =ᵐ[μ] ↑↑(c • condexpIndL1Fin hm hs hμs x)
[PROOFSTEP]
refine' (Memℒp.coeFn_toLp q).trans _
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
c : ℝ
x : G
⊢ ↑↑(condexpIndSMul hm hs hμs (c • x)) =ᵐ[μ] ↑↑(c • condexpIndL1Fin hm hs hμs x)
[PROOFSTEP]
refine' EventuallyEq.trans _ (Lp.coeFn_smul _ _).symm
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
c : ℝ
x : G
⊢ ↑↑(condexpIndSMul hm hs hμs (c • x)) =ᵐ[μ] c • ↑↑(condexpIndL1Fin hm hs hμs x)
[PROOFSTEP]
rw [condexpIndSMul_smul hs hμs c x]
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
c : ℝ
x : G
⊢ ↑↑(c • condexpIndSMul hm hs hμs x) =ᵐ[μ] c • ↑↑(condexpIndL1Fin hm hs hμs x)
[PROOFSTEP]
refine' (Lp.coeFn_smul _ _).trans _
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
c : ℝ
x : G
⊢ c • ↑↑(condexpIndSMul hm hs hμs x) =ᵐ[μ] c • ↑↑(condexpIndL1Fin hm hs hμs x)
[PROOFSTEP]
refine' (condexpIndL1Fin_ae_eq_condexpIndSMul hm hs hμs x).mono fun y hy => _
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
c : ℝ
x : G
y : α
hy : ↑↑(condexpIndL1Fin hm hs hμs x) y = ↑↑(condexpIndSMul hm hs hμs x) y
⊢ (c • ↑↑(condexpIndSMul hm hs hμs x)) y = (c • ↑↑(condexpIndL1Fin hm hs hμs x)) y
[PROOFSTEP]
rw [Pi.smul_apply, Pi.smul_apply, hy]
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹⁴ : IsROrC 𝕜
inst✝¹³ : NormedAddCommGroup F
inst✝¹² : NormedSpace 𝕜 F
inst✝¹¹ : NormedAddCommGroup F'
inst✝¹⁰ : NormedSpace 𝕜 F'
inst✝⁹ : NormedSpace ℝ F'
inst✝⁸ : CompleteSpace F'
inst✝⁷ : NormedAddCommGroup G
inst✝⁶ : NormedAddCommGroup G'
inst✝⁵ : NormedSpace ℝ G'
inst✝⁴ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝³ : NormedSpace ℝ G
hm : m ≤ m0
inst✝² : SigmaFinite (Measure.trim μ hm)
inst✝¹ : NormedSpace ℝ F
inst✝ : SMulCommClass ℝ 𝕜 F
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
c : 𝕜
x : F
⊢ condexpIndL1Fin hm hs hμs (c • x) = c • condexpIndL1Fin hm hs hμs x
[PROOFSTEP]
ext1
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹⁴ : IsROrC 𝕜
inst✝¹³ : NormedAddCommGroup F
inst✝¹² : NormedSpace 𝕜 F
inst✝¹¹ : NormedAddCommGroup F'
inst✝¹⁰ : NormedSpace 𝕜 F'
inst✝⁹ : NormedSpace ℝ F'
inst✝⁸ : CompleteSpace F'
inst✝⁷ : NormedAddCommGroup G
inst✝⁶ : NormedAddCommGroup G'
inst✝⁵ : NormedSpace ℝ G'
inst✝⁴ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝³ : NormedSpace ℝ G
hm : m ≤ m0
inst✝² : SigmaFinite (Measure.trim μ hm)
inst✝¹ : NormedSpace ℝ F
inst✝ : SMulCommClass ℝ 𝕜 F
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
c : 𝕜
x : F
⊢ ↑↑(condexpIndL1Fin hm hs hμs (c • x)) =ᵐ[μ] ↑↑(c • condexpIndL1Fin hm hs hμs x)
[PROOFSTEP]
refine' (Memℒp.coeFn_toLp q).trans _
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹⁴ : IsROrC 𝕜
inst✝¹³ : NormedAddCommGroup F
inst✝¹² : NormedSpace 𝕜 F
inst✝¹¹ : NormedAddCommGroup F'
inst✝¹⁰ : NormedSpace 𝕜 F'
inst✝⁹ : NormedSpace ℝ F'
inst✝⁸ : CompleteSpace F'
inst✝⁷ : NormedAddCommGroup G
inst✝⁶ : NormedAddCommGroup G'
inst✝⁵ : NormedSpace ℝ G'
inst✝⁴ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝³ : NormedSpace ℝ G
hm : m ≤ m0
inst✝² : SigmaFinite (Measure.trim μ hm)
inst✝¹ : NormedSpace ℝ F
inst✝ : SMulCommClass ℝ 𝕜 F
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
c : 𝕜
x : F
⊢ ↑↑(condexpIndSMul hm hs hμs (c • x)) =ᵐ[μ] ↑↑(c • condexpIndL1Fin hm hs hμs x)
[PROOFSTEP]
refine' EventuallyEq.trans _ (Lp.coeFn_smul _ _).symm
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹⁴ : IsROrC 𝕜
inst✝¹³ : NormedAddCommGroup F
inst✝¹² : NormedSpace 𝕜 F
inst✝¹¹ : NormedAddCommGroup F'
inst✝¹⁰ : NormedSpace 𝕜 F'
inst✝⁹ : NormedSpace ℝ F'
inst✝⁸ : CompleteSpace F'
inst✝⁷ : NormedAddCommGroup G
inst✝⁶ : NormedAddCommGroup G'
inst✝⁵ : NormedSpace ℝ G'
inst✝⁴ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝³ : NormedSpace ℝ G
hm : m ≤ m0
inst✝² : SigmaFinite (Measure.trim μ hm)
inst✝¹ : NormedSpace ℝ F
inst✝ : SMulCommClass ℝ 𝕜 F
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
c : 𝕜
x : F
⊢ ↑↑(condexpIndSMul hm hs hμs (c • x)) =ᵐ[μ] c • ↑↑(condexpIndL1Fin hm hs hμs x)
[PROOFSTEP]
rw [condexpIndSMul_smul' hs hμs c x]
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹⁴ : IsROrC 𝕜
inst✝¹³ : NormedAddCommGroup F
inst✝¹² : NormedSpace 𝕜 F
inst✝¹¹ : NormedAddCommGroup F'
inst✝¹⁰ : NormedSpace 𝕜 F'
inst✝⁹ : NormedSpace ℝ F'
inst✝⁸ : CompleteSpace F'
inst✝⁷ : NormedAddCommGroup G
inst✝⁶ : NormedAddCommGroup G'
inst✝⁵ : NormedSpace ℝ G'
inst✝⁴ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝³ : NormedSpace ℝ G
hm : m ≤ m0
inst✝² : SigmaFinite (Measure.trim μ hm)
inst✝¹ : NormedSpace ℝ F
inst✝ : SMulCommClass ℝ 𝕜 F
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
c : 𝕜
x : F
⊢ ↑↑(c • condexpIndSMul hm hs hμs x) =ᵐ[μ] c • ↑↑(condexpIndL1Fin hm hs hμs x)
[PROOFSTEP]
refine' (Lp.coeFn_smul _ _).trans _
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹⁴ : IsROrC 𝕜
inst✝¹³ : NormedAddCommGroup F
inst✝¹² : NormedSpace 𝕜 F
inst✝¹¹ : NormedAddCommGroup F'
inst✝¹⁰ : NormedSpace 𝕜 F'
inst✝⁹ : NormedSpace ℝ F'
inst✝⁸ : CompleteSpace F'
inst✝⁷ : NormedAddCommGroup G
inst✝⁶ : NormedAddCommGroup G'
inst✝⁵ : NormedSpace ℝ G'
inst✝⁴ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝³ : NormedSpace ℝ G
hm : m ≤ m0
inst✝² : SigmaFinite (Measure.trim μ hm)
inst✝¹ : NormedSpace ℝ F
inst✝ : SMulCommClass ℝ 𝕜 F
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
c : 𝕜
x : F
⊢ c • ↑↑(condexpIndSMul hm hs hμs x) =ᵐ[μ] c • ↑↑(condexpIndL1Fin hm hs hμs x)
[PROOFSTEP]
refine' (condexpIndL1Fin_ae_eq_condexpIndSMul hm hs hμs x).mono fun y hy => _
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹⁴ : IsROrC 𝕜
inst✝¹³ : NormedAddCommGroup F
inst✝¹² : NormedSpace 𝕜 F
inst✝¹¹ : NormedAddCommGroup F'
inst✝¹⁰ : NormedSpace 𝕜 F'
inst✝⁹ : NormedSpace ℝ F'
inst✝⁸ : CompleteSpace F'
inst✝⁷ : NormedAddCommGroup G
inst✝⁶ : NormedAddCommGroup G'
inst✝⁵ : NormedSpace ℝ G'
inst✝⁴ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝³ : NormedSpace ℝ G
hm : m ≤ m0
inst✝² : SigmaFinite (Measure.trim μ hm)
inst✝¹ : NormedSpace ℝ F
inst✝ : SMulCommClass ℝ 𝕜 F
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
c : 𝕜
x : F
y : α
hy : ↑↑(condexpIndL1Fin hm hs hμs x) y = ↑↑(condexpIndSMul hm hs hμs x) y
⊢ (c • ↑↑(condexpIndSMul hm hs hμs x)) y = (c • ↑↑(condexpIndL1Fin hm hs hμs x)) y
[PROOFSTEP]
rw [Pi.smul_apply, Pi.smul_apply, hy]
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
x : G
⊢ ‖condexpIndL1Fin hm hs hμs x‖ ≤ ENNReal.toReal (↑↑μ s) * ‖x‖
[PROOFSTEP]
have : 0 ≤ ∫ a : α, ‖condexpIndL1Fin hm hs hμs x a‖ ∂μ := integral_nonneg fun a => norm_nonneg _
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
x : G
this : 0 ≤ ∫ (a : α), ‖↑↑(condexpIndL1Fin hm hs hμs x) a‖ ∂μ
⊢ ‖condexpIndL1Fin hm hs hμs x‖ ≤ ENNReal.toReal (↑↑μ s) * ‖x‖
[PROOFSTEP]
rw [L1.norm_eq_integral_norm, ← ENNReal.toReal_ofReal (norm_nonneg x), ← ENNReal.toReal_mul, ←
ENNReal.toReal_ofReal this,
ENNReal.toReal_le_toReal ENNReal.ofReal_ne_top (ENNReal.mul_ne_top hμs ENNReal.ofReal_ne_top),
ofReal_integral_norm_eq_lintegral_nnnorm]
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
x : G
this : 0 ≤ ∫ (a : α), ‖↑↑(condexpIndL1Fin hm hs hμs x) a‖ ∂μ
⊢ ∫⁻ (x_1 : α), ↑‖↑↑(condexpIndL1Fin hm hs hμs x) x_1‖₊ ∂μ ≤ ↑↑μ s * ENNReal.ofReal ‖x‖
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
x : G
this : 0 ≤ ∫ (a : α), ‖↑↑(condexpIndL1Fin hm hs hμs x) a‖ ∂μ
⊢ Integrable fun a => ↑↑(condexpIndL1Fin hm hs hμs x) a
[PROOFSTEP]
swap
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
x : G
this : 0 ≤ ∫ (a : α), ‖↑↑(condexpIndL1Fin hm hs hμs x) a‖ ∂μ
⊢ Integrable fun a => ↑↑(condexpIndL1Fin hm hs hμs x) a
[PROOFSTEP]
rw [← memℒp_one_iff_integrable]
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
x : G
this : 0 ≤ ∫ (a : α), ‖↑↑(condexpIndL1Fin hm hs hμs x) a‖ ∂μ
⊢ Memℒp (fun a => ↑↑(condexpIndL1Fin hm hs hμs x) a) 1
[PROOFSTEP]
exact Lp.memℒp _
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
x : G
this : 0 ≤ ∫ (a : α), ‖↑↑(condexpIndL1Fin hm hs hμs x) a‖ ∂μ
⊢ ∫⁻ (x_1 : α), ↑‖↑↑(condexpIndL1Fin hm hs hμs x) x_1‖₊ ∂μ ≤ ↑↑μ s * ENNReal.ofReal ‖x‖
[PROOFSTEP]
have h_eq : ∫⁻ a, ‖condexpIndL1Fin hm hs hμs x a‖₊ ∂μ = ∫⁻ a, ‖condexpIndSMul hm hs hμs x a‖₊ ∂μ :=
by
refine' lintegral_congr_ae _
refine' (condexpIndL1Fin_ae_eq_condexpIndSMul hm hs hμs x).mono fun z hz => _
dsimp only
rw [hz]
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
x : G
this : 0 ≤ ∫ (a : α), ‖↑↑(condexpIndL1Fin hm hs hμs x) a‖ ∂μ
⊢ ∫⁻ (a : α), ↑‖↑↑(condexpIndL1Fin hm hs hμs x) a‖₊ ∂μ = ∫⁻ (a : α), ↑‖↑↑(condexpIndSMul hm hs hμs x) a‖₊ ∂μ
[PROOFSTEP]
refine' lintegral_congr_ae _
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
x : G
this : 0 ≤ ∫ (a : α), ‖↑↑(condexpIndL1Fin hm hs hμs x) a‖ ∂μ
⊢ (fun a => ↑‖↑↑(condexpIndL1Fin hm hs hμs x) a‖₊) =ᵐ[μ] fun a => ↑‖↑↑(condexpIndSMul hm hs hμs x) a‖₊
[PROOFSTEP]
refine' (condexpIndL1Fin_ae_eq_condexpIndSMul hm hs hμs x).mono fun z hz => _
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
x : G
this : 0 ≤ ∫ (a : α), ‖↑↑(condexpIndL1Fin hm hs hμs x) a‖ ∂μ
z : α
hz : ↑↑(condexpIndL1Fin hm hs hμs x) z = ↑↑(condexpIndSMul hm hs hμs x) z
⊢ (fun a => ↑‖↑↑(condexpIndL1Fin hm hs hμs x) a‖₊) z = (fun a => ↑‖↑↑(condexpIndSMul hm hs hμs x) a‖₊) z
[PROOFSTEP]
dsimp only
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
x : G
this : 0 ≤ ∫ (a : α), ‖↑↑(condexpIndL1Fin hm hs hμs x) a‖ ∂μ
z : α
hz : ↑↑(condexpIndL1Fin hm hs hμs x) z = ↑↑(condexpIndSMul hm hs hμs x) z
⊢ ↑‖↑↑(condexpIndL1Fin hm hs hμs x) z‖₊ = ↑‖↑↑(condexpIndSMul hm hs hμs x) z‖₊
[PROOFSTEP]
rw [hz]
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
x : G
this : 0 ≤ ∫ (a : α), ‖↑↑(condexpIndL1Fin hm hs hμs x) a‖ ∂μ
h_eq : ∫⁻ (a : α), ↑‖↑↑(condexpIndL1Fin hm hs hμs x) a‖₊ ∂μ = ∫⁻ (a : α), ↑‖↑↑(condexpIndSMul hm hs hμs x) a‖₊ ∂μ
⊢ ∫⁻ (x_1 : α), ↑‖↑↑(condexpIndL1Fin hm hs hμs x) x_1‖₊ ∂μ ≤ ↑↑μ s * ENNReal.ofReal ‖x‖
[PROOFSTEP]
rw [h_eq, ofReal_norm_eq_coe_nnnorm]
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
x : G
this : 0 ≤ ∫ (a : α), ‖↑↑(condexpIndL1Fin hm hs hμs x) a‖ ∂μ
h_eq : ∫⁻ (a : α), ↑‖↑↑(condexpIndL1Fin hm hs hμs x) a‖₊ ∂μ = ∫⁻ (a : α), ↑‖↑↑(condexpIndSMul hm hs hμs x) a‖₊ ∂μ
⊢ ∫⁻ (a : α), ↑‖↑↑(condexpIndSMul hm hs hμs x) a‖₊ ∂μ ≤ ↑↑μ s * ↑‖x‖₊
[PROOFSTEP]
exact lintegral_nnnorm_condexpIndSMul_le hm hs hμs x
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
ht : MeasurableSet t
hμs : ↑↑μ s ≠ ⊤
hμt : ↑↑μ t ≠ ⊤
hst : s ∩ t = ∅
x : G
⊢ condexpIndL1Fin hm (_ : MeasurableSet (s ∪ t)) (_ : ↑↑μ (s ∪ t) ≠ ⊤) x =
condexpIndL1Fin hm hs hμs x + condexpIndL1Fin hm ht hμt x
[PROOFSTEP]
ext1
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
ht : MeasurableSet t
hμs : ↑↑μ s ≠ ⊤
hμt : ↑↑μ t ≠ ⊤
hst : s ∩ t = ∅
x : G
⊢ ↑↑(condexpIndL1Fin hm (_ : MeasurableSet (s ∪ t)) (_ : ↑↑μ (s ∪ t) ≠ ⊤) x) =ᵐ[μ]
↑↑(condexpIndL1Fin hm hs hμs x + condexpIndL1Fin hm ht hμt x)
[PROOFSTEP]
have hμst := ((measure_union_le s t).trans_lt (lt_top_iff_ne_top.mpr (ENNReal.add_ne_top.mpr ⟨hμs, hμt⟩))).ne
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
ht : MeasurableSet t
hμs : ↑↑μ s ≠ ⊤
hμt : ↑↑μ t ≠ ⊤
hst : s ∩ t = ∅
x : G
hμst : ↑↑μ (s ∪ t) ≠ ⊤
⊢ ↑↑(condexpIndL1Fin hm (_ : MeasurableSet (s ∪ t)) (_ : ↑↑μ (s ∪ t) ≠ ⊤) x) =ᵐ[μ]
↑↑(condexpIndL1Fin hm hs hμs x + condexpIndL1Fin hm ht hμt x)
[PROOFSTEP]
refine' (condexpIndL1Fin_ae_eq_condexpIndSMul hm (hs.union ht) hμst x).trans _
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
ht : MeasurableSet t
hμs : ↑↑μ s ≠ ⊤
hμt : ↑↑μ t ≠ ⊤
hst : s ∩ t = ∅
x : G
hμst : ↑↑μ (s ∪ t) ≠ ⊤
⊢ ↑↑(condexpIndSMul hm (_ : MeasurableSet (s ∪ t)) hμst x) =ᵐ[μ]
↑↑(condexpIndL1Fin hm hs hμs x + condexpIndL1Fin hm ht hμt x)
[PROOFSTEP]
refine' EventuallyEq.trans _ (Lp.coeFn_add _ _).symm
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
ht : MeasurableSet t
hμs : ↑↑μ s ≠ ⊤
hμt : ↑↑μ t ≠ ⊤
hst : s ∩ t = ∅
x : G
hμst : ↑↑μ (s ∪ t) ≠ ⊤
⊢ ↑↑(condexpIndSMul hm (_ : MeasurableSet (s ∪ t)) hμst x) =ᵐ[μ]
↑↑(condexpIndL1Fin hm hs hμs x) + ↑↑(condexpIndL1Fin hm ht hμt x)
[PROOFSTEP]
have hs_eq := condexpIndL1Fin_ae_eq_condexpIndSMul hm hs hμs x
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
ht : MeasurableSet t
hμs : ↑↑μ s ≠ ⊤
hμt : ↑↑μ t ≠ ⊤
hst : s ∩ t = ∅
x : G
hμst : ↑↑μ (s ∪ t) ≠ ⊤
hs_eq : ↑↑(condexpIndL1Fin hm hs hμs x) =ᵐ[μ] ↑↑(condexpIndSMul hm hs hμs x)
⊢ ↑↑(condexpIndSMul hm (_ : MeasurableSet (s ∪ t)) hμst x) =ᵐ[μ]
↑↑(condexpIndL1Fin hm hs hμs x) + ↑↑(condexpIndL1Fin hm ht hμt x)
[PROOFSTEP]
have ht_eq := condexpIndL1Fin_ae_eq_condexpIndSMul hm ht hμt x
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
ht : MeasurableSet t
hμs : ↑↑μ s ≠ ⊤
hμt : ↑↑μ t ≠ ⊤
hst : s ∩ t = ∅
x : G
hμst : ↑↑μ (s ∪ t) ≠ ⊤
hs_eq : ↑↑(condexpIndL1Fin hm hs hμs x) =ᵐ[μ] ↑↑(condexpIndSMul hm hs hμs x)
ht_eq : ↑↑(condexpIndL1Fin hm ht hμt x) =ᵐ[μ] ↑↑(condexpIndSMul hm ht hμt x)
⊢ ↑↑(condexpIndSMul hm (_ : MeasurableSet (s ∪ t)) hμst x) =ᵐ[μ]
↑↑(condexpIndL1Fin hm hs hμs x) + ↑↑(condexpIndL1Fin hm ht hμt x)
[PROOFSTEP]
refine' EventuallyEq.trans _ (EventuallyEq.add hs_eq.symm ht_eq.symm)
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
ht : MeasurableSet t
hμs : ↑↑μ s ≠ ⊤
hμt : ↑↑μ t ≠ ⊤
hst : s ∩ t = ∅
x : G
hμst : ↑↑μ (s ∪ t) ≠ ⊤
hs_eq : ↑↑(condexpIndL1Fin hm hs hμs x) =ᵐ[μ] ↑↑(condexpIndSMul hm hs hμs x)
ht_eq : ↑↑(condexpIndL1Fin hm ht hμt x) =ᵐ[μ] ↑↑(condexpIndSMul hm ht hμt x)
⊢ ↑↑(condexpIndSMul hm (_ : MeasurableSet (s ∪ t)) hμst x) =ᵐ[μ] fun x_1 =>
↑↑(condexpIndSMul hm hs hμs x) x_1 + ↑↑(condexpIndSMul hm ht hμt x) x_1
[PROOFSTEP]
rw [condexpIndSMul]
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
ht : MeasurableSet t
hμs : ↑↑μ s ≠ ⊤
hμt : ↑↑μ t ≠ ⊤
hst : s ∩ t = ∅
x : G
hμst : ↑↑μ (s ∪ t) ≠ ⊤
hs_eq : ↑↑(condexpIndL1Fin hm hs hμs x) =ᵐ[μ] ↑↑(condexpIndSMul hm hs hμs x)
ht_eq : ↑↑(condexpIndL1Fin hm ht hμt x) =ᵐ[μ] ↑↑(condexpIndSMul hm ht hμt x)
⊢ ↑↑(↑(compLpL 2 μ (toSpanSingleton ℝ x))
↑(↑(condexpL2 ℝ ℝ hm) (indicatorConstLp 2 (_ : MeasurableSet (s ∪ t)) hμst 1))) =ᵐ[μ]
fun x_1 => ↑↑(condexpIndSMul hm hs hμs x) x_1 + ↑↑(condexpIndSMul hm ht hμt x) x_1
[PROOFSTEP]
rw [indicatorConstLp_disjoint_union hs ht hμs hμt hst (1 : ℝ)]
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
ht : MeasurableSet t
hμs : ↑↑μ s ≠ ⊤
hμt : ↑↑μ t ≠ ⊤
hst : s ∩ t = ∅
x : G
hμst : ↑↑μ (s ∪ t) ≠ ⊤
hs_eq : ↑↑(condexpIndL1Fin hm hs hμs x) =ᵐ[μ] ↑↑(condexpIndSMul hm hs hμs x)
ht_eq : ↑↑(condexpIndL1Fin hm ht hμt x) =ᵐ[μ] ↑↑(condexpIndSMul hm ht hμt x)
⊢ ↑↑(↑(compLpL 2 μ (toSpanSingleton ℝ x))
↑(↑(condexpL2 ℝ ℝ hm) (indicatorConstLp 2 hs hμs 1 + indicatorConstLp 2 ht hμt 1))) =ᵐ[μ]
fun x_1 => ↑↑(condexpIndSMul hm hs hμs x) x_1 + ↑↑(condexpIndSMul hm ht hμt x) x_1
[PROOFSTEP]
rw [(condexpL2 ℝ ℝ hm).map_add]
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
ht : MeasurableSet t
hμs : ↑↑μ s ≠ ⊤
hμt : ↑↑μ t ≠ ⊤
hst : s ∩ t = ∅
x : G
hμst : ↑↑μ (s ∪ t) ≠ ⊤
hs_eq : ↑↑(condexpIndL1Fin hm hs hμs x) =ᵐ[μ] ↑↑(condexpIndSMul hm hs hμs x)
ht_eq : ↑↑(condexpIndL1Fin hm ht hμt x) =ᵐ[μ] ↑↑(condexpIndSMul hm ht hμt x)
⊢ ↑↑(↑(compLpL 2 μ (toSpanSingleton ℝ x))
↑(↑(condexpL2 ℝ ℝ hm) (indicatorConstLp 2 hs hμs 1) +
↑(condexpL2 ℝ ℝ hm) (indicatorConstLp 2 ht hμt 1))) =ᵐ[μ]
fun x_1 => ↑↑(condexpIndSMul hm hs hμs x) x_1 + ↑↑(condexpIndSMul hm ht hμt x) x_1
[PROOFSTEP]
push_cast
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
ht : MeasurableSet t
hμs : ↑↑μ s ≠ ⊤
hμt : ↑↑μ t ≠ ⊤
hst : s ∩ t = ∅
x : G
hμst : ↑↑μ (s ∪ t) ≠ ⊤
hs_eq : ↑↑(condexpIndL1Fin hm hs hμs x) =ᵐ[μ] ↑↑(condexpIndSMul hm hs hμs x)
ht_eq : ↑↑(condexpIndL1Fin hm ht hμt x) =ᵐ[μ] ↑↑(condexpIndSMul hm ht hμt x)
⊢ ↑↑(↑(compLpL 2 μ (toSpanSingleton ℝ x))
(↑(↑(condexpL2 ℝ ℝ hm) (indicatorConstLp 2 hs hμs 1)) +
↑(↑(condexpL2 ℝ ℝ hm) (indicatorConstLp 2 ht hμt 1)))) =ᵐ[μ]
fun x_1 => ↑↑(condexpIndSMul hm hs hμs x) x_1 + ↑↑(condexpIndSMul hm ht hμt x) x_1
[PROOFSTEP]
rw [((toSpanSingleton ℝ x).compLpL 2 μ).map_add]
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
ht : MeasurableSet t
hμs : ↑↑μ s ≠ ⊤
hμt : ↑↑μ t ≠ ⊤
hst : s ∩ t = ∅
x : G
hμst : ↑↑μ (s ∪ t) ≠ ⊤
hs_eq : ↑↑(condexpIndL1Fin hm hs hμs x) =ᵐ[μ] ↑↑(condexpIndSMul hm hs hμs x)
ht_eq : ↑↑(condexpIndL1Fin hm ht hμt x) =ᵐ[μ] ↑↑(condexpIndSMul hm ht hμt x)
⊢ ↑↑(↑(compLpL 2 μ (toSpanSingleton ℝ x)) ↑(↑(condexpL2 ℝ ℝ hm) (indicatorConstLp 2 hs hμs 1)) +
↑(compLpL 2 μ (toSpanSingleton ℝ x)) ↑(↑(condexpL2 ℝ ℝ hm) (indicatorConstLp 2 ht hμt 1))) =ᵐ[μ]
fun x_1 => ↑↑(condexpIndSMul hm hs hμs x) x_1 + ↑↑(condexpIndSMul hm ht hμt x) x_1
[PROOFSTEP]
refine' (Lp.coeFn_add _ _).trans _
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
ht : MeasurableSet t
hμs : ↑↑μ s ≠ ⊤
hμt : ↑↑μ t ≠ ⊤
hst : s ∩ t = ∅
x : G
hμst : ↑↑μ (s ∪ t) ≠ ⊤
hs_eq : ↑↑(condexpIndL1Fin hm hs hμs x) =ᵐ[μ] ↑↑(condexpIndSMul hm hs hμs x)
ht_eq : ↑↑(condexpIndL1Fin hm ht hμt x) =ᵐ[μ] ↑↑(condexpIndSMul hm ht hμt x)
⊢ ↑↑(↑(compLpL 2 μ (toSpanSingleton ℝ x)) ↑(↑(condexpL2 ℝ ℝ hm) (indicatorConstLp 2 hs hμs 1))) +
↑↑(↑(compLpL 2 μ (toSpanSingleton ℝ x)) ↑(↑(condexpL2 ℝ ℝ hm) (indicatorConstLp 2 ht hμt 1))) =ᵐ[μ]
fun x_1 => ↑↑(condexpIndSMul hm hs hμs x) x_1 + ↑↑(condexpIndSMul hm ht hμt x) x_1
[PROOFSTEP]
refine' eventually_of_forall fun y => _
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
ht : MeasurableSet t
hμs : ↑↑μ s ≠ ⊤
hμt : ↑↑μ t ≠ ⊤
hst : s ∩ t = ∅
x : G
hμst : ↑↑μ (s ∪ t) ≠ ⊤
hs_eq : ↑↑(condexpIndL1Fin hm hs hμs x) =ᵐ[μ] ↑↑(condexpIndSMul hm hs hμs x)
ht_eq : ↑↑(condexpIndL1Fin hm ht hμt x) =ᵐ[μ] ↑↑(condexpIndSMul hm ht hμt x)
y : α
⊢ (↑↑(↑(compLpL 2 μ (toSpanSingleton ℝ x)) ↑(↑(condexpL2 ℝ ℝ hm) (indicatorConstLp 2 hs hμs 1))) +
↑↑(↑(compLpL 2 μ (toSpanSingleton ℝ x)) ↑(↑(condexpL2 ℝ ℝ hm) (indicatorConstLp 2 ht hμt 1))))
y =
(fun x_1 => ↑↑(condexpIndSMul hm hs hμs x) x_1 + ↑↑(condexpIndSMul hm ht hμt x) x_1) y
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
x : G
⊢ condexpIndL1 hm μ s x = condexpIndL1Fin hm hs hμs x
[PROOFSTEP]
simp only [condexpIndL1, And.intro hs hμs, dif_pos, Ne.def, not_false_iff, and_self_iff]
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hμs : ↑↑μ s = ⊤
x : G
⊢ condexpIndL1 hm μ s x = 0
[PROOFSTEP]
simp only [condexpIndL1, hμs, eq_self_iff_true, not_true, Ne.def, dif_neg, not_false_iff, and_false_iff]
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : ¬MeasurableSet s
x : G
⊢ condexpIndL1 hm μ s x = 0
[PROOFSTEP]
simp only [condexpIndL1, hs, dif_neg, not_false_iff, false_and_iff]
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
x y : G
⊢ condexpIndL1 hm μ s (x + y) = condexpIndL1 hm μ s x + condexpIndL1 hm μ s y
[PROOFSTEP]
by_cases hs : MeasurableSet s
[GOAL]
case pos
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
x y : G
hs : MeasurableSet s
⊢ condexpIndL1 hm μ s (x + y) = condexpIndL1 hm μ s x + condexpIndL1 hm μ s y
case neg
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
x y : G
hs : ¬MeasurableSet s
⊢ condexpIndL1 hm μ s (x + y) = condexpIndL1 hm μ s x + condexpIndL1 hm μ s y
[PROOFSTEP]
swap
[GOAL]
case neg
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
x y : G
hs : ¬MeasurableSet s
⊢ condexpIndL1 hm μ s (x + y) = condexpIndL1 hm μ s x + condexpIndL1 hm μ s y
[PROOFSTEP]
simp_rw [condexpIndL1_of_not_measurableSet hs]
[GOAL]
case neg
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
x y : G
hs : ¬MeasurableSet s
⊢ 0 = 0 + 0
[PROOFSTEP]
rw [zero_add]
[GOAL]
case pos
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
x y : G
hs : MeasurableSet s
⊢ condexpIndL1 hm μ s (x + y) = condexpIndL1 hm μ s x + condexpIndL1 hm μ s y
[PROOFSTEP]
by_cases hμs : μ s = ∞
[GOAL]
case pos
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
x y : G
hs : MeasurableSet s
hμs : ↑↑μ s = ⊤
⊢ condexpIndL1 hm μ s (x + y) = condexpIndL1 hm μ s x + condexpIndL1 hm μ s y
[PROOFSTEP]
simp_rw [condexpIndL1_of_measure_eq_top hμs]
[GOAL]
case pos
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
x y : G
hs : MeasurableSet s
hμs : ↑↑μ s = ⊤
⊢ 0 = 0 + 0
[PROOFSTEP]
rw [zero_add]
[GOAL]
case neg
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
x y : G
hs : MeasurableSet s
hμs : ¬↑↑μ s = ⊤
⊢ condexpIndL1 hm μ s (x + y) = condexpIndL1 hm μ s x + condexpIndL1 hm μ s y
[PROOFSTEP]
simp_rw [condexpIndL1_of_measurableSet_of_measure_ne_top hs hμs]
[GOAL]
case neg
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
x y : G
hs : MeasurableSet s
hμs : ¬↑↑μ s = ⊤
⊢ condexpIndL1Fin hm hs hμs (x + y) = condexpIndL1Fin hm hs hμs x + condexpIndL1Fin hm hs hμs y
[PROOFSTEP]
exact condexpIndL1Fin_add hs hμs x y
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
c : ℝ
x : G
⊢ condexpIndL1 hm μ s (c • x) = c • condexpIndL1 hm μ s x
[PROOFSTEP]
by_cases hs : MeasurableSet s
[GOAL]
case pos
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
c : ℝ
x : G
hs : MeasurableSet s
⊢ condexpIndL1 hm μ s (c • x) = c • condexpIndL1 hm μ s x
case neg
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
c : ℝ
x : G
hs : ¬MeasurableSet s
⊢ condexpIndL1 hm μ s (c • x) = c • condexpIndL1 hm μ s x
[PROOFSTEP]
swap
[GOAL]
case neg
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
c : ℝ
x : G
hs : ¬MeasurableSet s
⊢ condexpIndL1 hm μ s (c • x) = c • condexpIndL1 hm μ s x
[PROOFSTEP]
simp_rw [condexpIndL1_of_not_measurableSet hs]
[GOAL]
case neg
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
c : ℝ
x : G
hs : ¬MeasurableSet s
⊢ 0 = c • 0
[PROOFSTEP]
rw [smul_zero]
[GOAL]
case pos
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
c : ℝ
x : G
hs : MeasurableSet s
⊢ condexpIndL1 hm μ s (c • x) = c • condexpIndL1 hm μ s x
[PROOFSTEP]
by_cases hμs : μ s = ∞
[GOAL]
case pos
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
c : ℝ
x : G
hs : MeasurableSet s
hμs : ↑↑μ s = ⊤
⊢ condexpIndL1 hm μ s (c • x) = c • condexpIndL1 hm μ s x
[PROOFSTEP]
simp_rw [condexpIndL1_of_measure_eq_top hμs]
[GOAL]
case pos
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
c : ℝ
x : G
hs : MeasurableSet s
hμs : ↑↑μ s = ⊤
⊢ 0 = c • 0
[PROOFSTEP]
rw [smul_zero]
[GOAL]
case neg
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
c : ℝ
x : G
hs : MeasurableSet s
hμs : ¬↑↑μ s = ⊤
⊢ condexpIndL1 hm μ s (c • x) = c • condexpIndL1 hm μ s x
[PROOFSTEP]
simp_rw [condexpIndL1_of_measurableSet_of_measure_ne_top hs hμs]
[GOAL]
case neg
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
c : ℝ
x : G
hs : MeasurableSet s
hμs : ¬↑↑μ s = ⊤
⊢ condexpIndL1Fin hm hs hμs (c • x) = c • condexpIndL1Fin hm hs hμs x
[PROOFSTEP]
exact condexpIndL1Fin_smul hs hμs c x
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹⁴ : IsROrC 𝕜
inst✝¹³ : NormedAddCommGroup F
inst✝¹² : NormedSpace 𝕜 F
inst✝¹¹ : NormedAddCommGroup F'
inst✝¹⁰ : NormedSpace 𝕜 F'
inst✝⁹ : NormedSpace ℝ F'
inst✝⁸ : CompleteSpace F'
inst✝⁷ : NormedAddCommGroup G
inst✝⁶ : NormedAddCommGroup G'
inst✝⁵ : NormedSpace ℝ G'
inst✝⁴ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝³ : NormedSpace ℝ G
hm : m ≤ m0
inst✝² : SigmaFinite (Measure.trim μ hm)
inst✝¹ : NormedSpace ℝ F
inst✝ : SMulCommClass ℝ 𝕜 F
c : 𝕜
x : F
⊢ condexpIndL1 hm μ s (c • x) = c • condexpIndL1 hm μ s x
[PROOFSTEP]
by_cases hs : MeasurableSet s
[GOAL]
case pos
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹⁴ : IsROrC 𝕜
inst✝¹³ : NormedAddCommGroup F
inst✝¹² : NormedSpace 𝕜 F
inst✝¹¹ : NormedAddCommGroup F'
inst✝¹⁰ : NormedSpace 𝕜 F'
inst✝⁹ : NormedSpace ℝ F'
inst✝⁸ : CompleteSpace F'
inst✝⁷ : NormedAddCommGroup G
inst✝⁶ : NormedAddCommGroup G'
inst✝⁵ : NormedSpace ℝ G'
inst✝⁴ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝³ : NormedSpace ℝ G
hm : m ≤ m0
inst✝² : SigmaFinite (Measure.trim μ hm)
inst✝¹ : NormedSpace ℝ F
inst✝ : SMulCommClass ℝ 𝕜 F
c : 𝕜
x : F
hs : MeasurableSet s
⊢ condexpIndL1 hm μ s (c • x) = c • condexpIndL1 hm μ s x
case neg
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹⁴ : IsROrC 𝕜
inst✝¹³ : NormedAddCommGroup F
inst✝¹² : NormedSpace 𝕜 F
inst✝¹¹ : NormedAddCommGroup F'
inst✝¹⁰ : NormedSpace 𝕜 F'
inst✝⁹ : NormedSpace ℝ F'
inst✝⁸ : CompleteSpace F'
inst✝⁷ : NormedAddCommGroup G
inst✝⁶ : NormedAddCommGroup G'
inst✝⁵ : NormedSpace ℝ G'
inst✝⁴ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝³ : NormedSpace ℝ G
hm : m ≤ m0
inst✝² : SigmaFinite (Measure.trim μ hm)
inst✝¹ : NormedSpace ℝ F
inst✝ : SMulCommClass ℝ 𝕜 F
c : 𝕜
x : F
hs : ¬MeasurableSet s
⊢ condexpIndL1 hm μ s (c • x) = c • condexpIndL1 hm μ s x
[PROOFSTEP]
swap
[GOAL]
case neg
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹⁴ : IsROrC 𝕜
inst✝¹³ : NormedAddCommGroup F
inst✝¹² : NormedSpace 𝕜 F
inst✝¹¹ : NormedAddCommGroup F'
inst✝¹⁰ : NormedSpace 𝕜 F'
inst✝⁹ : NormedSpace ℝ F'
inst✝⁸ : CompleteSpace F'
inst✝⁷ : NormedAddCommGroup G
inst✝⁶ : NormedAddCommGroup G'
inst✝⁵ : NormedSpace ℝ G'
inst✝⁴ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝³ : NormedSpace ℝ G
hm : m ≤ m0
inst✝² : SigmaFinite (Measure.trim μ hm)
inst✝¹ : NormedSpace ℝ F
inst✝ : SMulCommClass ℝ 𝕜 F
c : 𝕜
x : F
hs : ¬MeasurableSet s
⊢ condexpIndL1 hm μ s (c • x) = c • condexpIndL1 hm μ s x
[PROOFSTEP]
simp_rw [condexpIndL1_of_not_measurableSet hs]
[GOAL]
case neg
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹⁴ : IsROrC 𝕜
inst✝¹³ : NormedAddCommGroup F
inst✝¹² : NormedSpace 𝕜 F
inst✝¹¹ : NormedAddCommGroup F'
inst✝¹⁰ : NormedSpace 𝕜 F'
inst✝⁹ : NormedSpace ℝ F'
inst✝⁸ : CompleteSpace F'
inst✝⁷ : NormedAddCommGroup G
inst✝⁶ : NormedAddCommGroup G'
inst✝⁵ : NormedSpace ℝ G'
inst✝⁴ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝³ : NormedSpace ℝ G
hm : m ≤ m0
inst✝² : SigmaFinite (Measure.trim μ hm)
inst✝¹ : NormedSpace ℝ F
inst✝ : SMulCommClass ℝ 𝕜 F
c : 𝕜
x : F
hs : ¬MeasurableSet s
⊢ 0 = c • 0
[PROOFSTEP]
rw [smul_zero]
[GOAL]
case pos
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹⁴ : IsROrC 𝕜
inst✝¹³ : NormedAddCommGroup F
inst✝¹² : NormedSpace 𝕜 F
inst✝¹¹ : NormedAddCommGroup F'
inst✝¹⁰ : NormedSpace 𝕜 F'
inst✝⁹ : NormedSpace ℝ F'
inst✝⁸ : CompleteSpace F'
inst✝⁷ : NormedAddCommGroup G
inst✝⁶ : NormedAddCommGroup G'
inst✝⁵ : NormedSpace ℝ G'
inst✝⁴ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝³ : NormedSpace ℝ G
hm : m ≤ m0
inst✝² : SigmaFinite (Measure.trim μ hm)
inst✝¹ : NormedSpace ℝ F
inst✝ : SMulCommClass ℝ 𝕜 F
c : 𝕜
x : F
hs : MeasurableSet s
⊢ condexpIndL1 hm μ s (c • x) = c • condexpIndL1 hm μ s x
[PROOFSTEP]
by_cases hμs : μ s = ∞
[GOAL]
case pos
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹⁴ : IsROrC 𝕜
inst✝¹³ : NormedAddCommGroup F
inst✝¹² : NormedSpace 𝕜 F
inst✝¹¹ : NormedAddCommGroup F'
inst✝¹⁰ : NormedSpace 𝕜 F'
inst✝⁹ : NormedSpace ℝ F'
inst✝⁸ : CompleteSpace F'
inst✝⁷ : NormedAddCommGroup G
inst✝⁶ : NormedAddCommGroup G'
inst✝⁵ : NormedSpace ℝ G'
inst✝⁴ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝³ : NormedSpace ℝ G
hm : m ≤ m0
inst✝² : SigmaFinite (Measure.trim μ hm)
inst✝¹ : NormedSpace ℝ F
inst✝ : SMulCommClass ℝ 𝕜 F
c : 𝕜
x : F
hs : MeasurableSet s
hμs : ↑↑μ s = ⊤
⊢ condexpIndL1 hm μ s (c • x) = c • condexpIndL1 hm μ s x
[PROOFSTEP]
simp_rw [condexpIndL1_of_measure_eq_top hμs]
[GOAL]
case pos
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹⁴ : IsROrC 𝕜
inst✝¹³ : NormedAddCommGroup F
inst✝¹² : NormedSpace 𝕜 F
inst✝¹¹ : NormedAddCommGroup F'
inst✝¹⁰ : NormedSpace 𝕜 F'
inst✝⁹ : NormedSpace ℝ F'
inst✝⁸ : CompleteSpace F'
inst✝⁷ : NormedAddCommGroup G
inst✝⁶ : NormedAddCommGroup G'
inst✝⁵ : NormedSpace ℝ G'
inst✝⁴ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝³ : NormedSpace ℝ G
hm : m ≤ m0
inst✝² : SigmaFinite (Measure.trim μ hm)
inst✝¹ : NormedSpace ℝ F
inst✝ : SMulCommClass ℝ 𝕜 F
c : 𝕜
x : F
hs : MeasurableSet s
hμs : ↑↑μ s = ⊤
⊢ 0 = c • 0
[PROOFSTEP]
rw [smul_zero]
[GOAL]
case neg
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹⁴ : IsROrC 𝕜
inst✝¹³ : NormedAddCommGroup F
inst✝¹² : NormedSpace 𝕜 F
inst✝¹¹ : NormedAddCommGroup F'
inst✝¹⁰ : NormedSpace 𝕜 F'
inst✝⁹ : NormedSpace ℝ F'
inst✝⁸ : CompleteSpace F'
inst✝⁷ : NormedAddCommGroup G
inst✝⁶ : NormedAddCommGroup G'
inst✝⁵ : NormedSpace ℝ G'
inst✝⁴ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝³ : NormedSpace ℝ G
hm : m ≤ m0
inst✝² : SigmaFinite (Measure.trim μ hm)
inst✝¹ : NormedSpace ℝ F
inst✝ : SMulCommClass ℝ 𝕜 F
c : 𝕜
x : F
hs : MeasurableSet s
hμs : ¬↑↑μ s = ⊤
⊢ condexpIndL1 hm μ s (c • x) = c • condexpIndL1 hm μ s x
[PROOFSTEP]
simp_rw [condexpIndL1_of_measurableSet_of_measure_ne_top hs hμs]
[GOAL]
case neg
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹⁴ : IsROrC 𝕜
inst✝¹³ : NormedAddCommGroup F
inst✝¹² : NormedSpace 𝕜 F
inst✝¹¹ : NormedAddCommGroup F'
inst✝¹⁰ : NormedSpace 𝕜 F'
inst✝⁹ : NormedSpace ℝ F'
inst✝⁸ : CompleteSpace F'
inst✝⁷ : NormedAddCommGroup G
inst✝⁶ : NormedAddCommGroup G'
inst✝⁵ : NormedSpace ℝ G'
inst✝⁴ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝³ : NormedSpace ℝ G
hm : m ≤ m0
inst✝² : SigmaFinite (Measure.trim μ hm)
inst✝¹ : NormedSpace ℝ F
inst✝ : SMulCommClass ℝ 𝕜 F
c : 𝕜
x : F
hs : MeasurableSet s
hμs : ¬↑↑μ s = ⊤
⊢ condexpIndL1Fin hm hs hμs (c • x) = c • condexpIndL1Fin hm hs hμs x
[PROOFSTEP]
exact condexpIndL1Fin_smul' hs hμs c x
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
x : G
⊢ ‖condexpIndL1 hm μ s x‖ ≤ ENNReal.toReal (↑↑μ s) * ‖x‖
[PROOFSTEP]
by_cases hs : MeasurableSet s
[GOAL]
case pos
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
x : G
hs : MeasurableSet s
⊢ ‖condexpIndL1 hm μ s x‖ ≤ ENNReal.toReal (↑↑μ s) * ‖x‖
case neg
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
x : G
hs : ¬MeasurableSet s
⊢ ‖condexpIndL1 hm μ s x‖ ≤ ENNReal.toReal (↑↑μ s) * ‖x‖
[PROOFSTEP]
swap
[GOAL]
case neg
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
x : G
hs : ¬MeasurableSet s
⊢ ‖condexpIndL1 hm μ s x‖ ≤ ENNReal.toReal (↑↑μ s) * ‖x‖
[PROOFSTEP]
simp_rw [condexpIndL1_of_not_measurableSet hs]
[GOAL]
case neg
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
x : G
hs : ¬MeasurableSet s
⊢ ‖0‖ ≤ ENNReal.toReal (↑↑μ s) * ‖x‖
[PROOFSTEP]
rw [Lp.norm_zero]
[GOAL]
case neg
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
x : G
hs : ¬MeasurableSet s
⊢ 0 ≤ ENNReal.toReal (↑↑μ s) * ‖x‖
[PROOFSTEP]
exact mul_nonneg ENNReal.toReal_nonneg (norm_nonneg _)
[GOAL]
case pos
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
x : G
hs : MeasurableSet s
⊢ ‖condexpIndL1 hm μ s x‖ ≤ ENNReal.toReal (↑↑μ s) * ‖x‖
[PROOFSTEP]
by_cases hμs : μ s = ∞
[GOAL]
case pos
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
x : G
hs : MeasurableSet s
hμs : ↑↑μ s = ⊤
⊢ ‖condexpIndL1 hm μ s x‖ ≤ ENNReal.toReal (↑↑μ s) * ‖x‖
[PROOFSTEP]
rw [condexpIndL1_of_measure_eq_top hμs x, Lp.norm_zero]
[GOAL]
case pos
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
x : G
hs : MeasurableSet s
hμs : ↑↑μ s = ⊤
⊢ 0 ≤ ENNReal.toReal (↑↑μ s) * ‖x‖
[PROOFSTEP]
exact mul_nonneg ENNReal.toReal_nonneg (norm_nonneg _)
[GOAL]
case neg
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
x : G
hs : MeasurableSet s
hμs : ¬↑↑μ s = ⊤
⊢ ‖condexpIndL1 hm μ s x‖ ≤ ENNReal.toReal (↑↑μ s) * ‖x‖
[PROOFSTEP]
rw [condexpIndL1_of_measurableSet_of_measure_ne_top hs hμs x]
[GOAL]
case neg
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
x : G
hs : MeasurableSet s
hμs : ¬↑↑μ s = ⊤
⊢ ‖condexpIndL1Fin hm hs hμs x‖ ≤ ENNReal.toReal (↑↑μ s) * ‖x‖
[PROOFSTEP]
exact norm_condexpIndL1Fin_le hs hμs x
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
ht : MeasurableSet t
hμs : ↑↑μ s ≠ ⊤
hμt : ↑↑μ t ≠ ⊤
hst : s ∩ t = ∅
x : G
⊢ condexpIndL1 hm μ (s ∪ t) x = condexpIndL1 hm μ s x + condexpIndL1 hm μ t x
[PROOFSTEP]
have hμst : μ (s ∪ t) ≠ ∞ :=
((measure_union_le s t).trans_lt (lt_top_iff_ne_top.mpr (ENNReal.add_ne_top.mpr ⟨hμs, hμt⟩))).ne
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
ht : MeasurableSet t
hμs : ↑↑μ s ≠ ⊤
hμt : ↑↑μ t ≠ ⊤
hst : s ∩ t = ∅
x : G
hμst : ↑↑μ (s ∪ t) ≠ ⊤
⊢ condexpIndL1 hm μ (s ∪ t) x = condexpIndL1 hm μ s x + condexpIndL1 hm μ t x
[PROOFSTEP]
rw [condexpIndL1_of_measurableSet_of_measure_ne_top hs hμs x, condexpIndL1_of_measurableSet_of_measure_ne_top ht hμt x,
condexpIndL1_of_measurableSet_of_measure_ne_top (hs.union ht) hμst x]
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
ht : MeasurableSet t
hμs : ↑↑μ s ≠ ⊤
hμt : ↑↑μ t ≠ ⊤
hst : s ∩ t = ∅
x : G
hμst : ↑↑μ (s ∪ t) ≠ ⊤
⊢ condexpIndL1Fin hm (_ : MeasurableSet (s ∪ t)) hμst x = condexpIndL1Fin hm hs hμs x + condexpIndL1Fin hm ht hμt x
[PROOFSTEP]
exact condexpIndL1Fin_disjoint_union hs ht hμs hμt hst x
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
x : G
⊢ ↑↑(↑(condexpInd G hm μ s) x) =ᵐ[μ] ↑↑(condexpIndSMul hm hs hμs x)
[PROOFSTEP]
refine' EventuallyEq.trans _ (condexpIndL1Fin_ae_eq_condexpIndSMul hm hs hμs x)
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
x : G
⊢ ↑↑(↑(condexpInd G hm μ s) x) =ᵐ[μ] ↑↑(condexpIndL1Fin hm hs hμs x)
[PROOFSTEP]
simp [condexpInd, condexpIndL1, hs, hμs]
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
x : G
⊢ ↑↑(condexpIndL1Fin hm (_ : MeasurableSet s) (_ : ↑↑μ s ≠ ⊤) x) =ᵐ[μ] ↑↑(condexpIndL1Fin hm hs hμs x)
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
⊢ condexpInd G hm μ ∅ = 0
[PROOFSTEP]
ext1 x
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
x : G
⊢ ↑(condexpInd G hm μ ∅) x = ↑0 x
[PROOFSTEP]
ext1
[GOAL]
case h.h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
x : G
⊢ ↑↑(↑(condexpInd G hm μ ∅) x) =ᵐ[μ] ↑↑(↑0 x)
[PROOFSTEP]
refine' (condexpInd_ae_eq_condexpIndSMul hm MeasurableSet.empty (by simp) x).trans _
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
x : G
⊢ ↑↑μ ∅ ≠ ⊤
[PROOFSTEP]
simp
[GOAL]
case h.h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
x : G
⊢ ↑↑(condexpIndSMul hm (_ : MeasurableSet ∅) (_ : ↑↑μ ∅ ≠ ⊤) x) =ᵐ[μ] ↑↑(↑0 x)
[PROOFSTEP]
rw [condexpIndSMul_empty]
[GOAL]
case h.h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
x : G
⊢ ↑↑0 =ᵐ[μ] ↑↑(↑0 x)
[PROOFSTEP]
refine' (Lp.coeFn_zero G 2 μ).trans _
[GOAL]
case h.h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
x : G
⊢ 0 =ᵐ[μ] ↑↑(↑0 x)
[PROOFSTEP]
refine' EventuallyEq.trans _ (Lp.coeFn_zero G 1 μ).symm
[GOAL]
case h.h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
x : G
⊢ 0 =ᵐ[μ] 0
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
ht : MeasurableSet t
hμs : ↑↑μ s ≠ ⊤
hμt : ↑↑μ t ≠ ⊤
hst : s ∩ t = ∅
⊢ condexpInd G hm μ (s ∪ t) = condexpInd G hm μ s + condexpInd G hm μ t
[PROOFSTEP]
ext1 x
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
ht : MeasurableSet t
hμs : ↑↑μ s ≠ ⊤
hμt : ↑↑μ t ≠ ⊤
hst : s ∩ t = ∅
x : G
⊢ ↑(condexpInd G hm μ (s ∪ t)) x = ↑(condexpInd G hm μ s + condexpInd G hm μ t) x
[PROOFSTEP]
push_cast
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
ht : MeasurableSet t
hμs : ↑↑μ s ≠ ⊤
hμt : ↑↑μ t ≠ ⊤
hst : s ∩ t = ∅
x : G
⊢ ↑(condexpInd G hm μ (s ∪ t)) x = (↑(condexpInd G hm μ s) + ↑(condexpInd G hm μ t)) x
[PROOFSTEP]
exact condexpInd_disjoint_union_apply hs ht hμs hμt hst x
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
c : G
⊢ ↑(condexpInd G hm μ s) c = indicatorConstLp 1 (_ : MeasurableSet s) hμs c
[PROOFSTEP]
ext1
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
c : G
⊢ ↑↑(↑(condexpInd G hm μ s) c) =ᵐ[μ] ↑↑(indicatorConstLp 1 (_ : MeasurableSet s) hμs c)
[PROOFSTEP]
refine' EventuallyEq.trans _ indicatorConstLp_coeFn.symm
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
c : G
⊢ ↑↑(↑(condexpInd G hm μ s) c) =ᵐ[μ] Set.indicator s fun x => c
[PROOFSTEP]
refine' (condexpInd_ae_eq_condexpIndSMul hm (hm s hs) hμs c).trans _
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
c : G
⊢ ↑↑(condexpIndSMul hm (_ : MeasurableSet s) hμs c) =ᵐ[μ] Set.indicator s fun x => c
[PROOFSTEP]
refine' (condexpIndSMul_ae_eq_smul hm (hm s hs) hμs c).trans _
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
c : G
⊢ (fun a => ↑↑↑(↑(condexpL2 ℝ ℝ hm) (indicatorConstLp 2 (_ : MeasurableSet s) hμs 1)) a • c) =ᵐ[μ]
Set.indicator s fun x => c
[PROOFSTEP]
rw [lpMeas_coe, condexpL2_indicator_of_measurable hm hs hμs (1 : ℝ)]
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
c : G
⊢ (fun a => ↑↑(indicatorConstLp 2 (_ : MeasurableSet s) hμs 1) a • c) =ᵐ[μ] Set.indicator s fun x => c
[PROOFSTEP]
refine' (@indicatorConstLp_coeFn α _ _ 2 μ _ s (hm s hs) hμs (1 : ℝ)).mono fun x hx => _
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
c : G
x : α
hx : ↑↑(indicatorConstLp 2 (_ : MeasurableSet s) hμs 1) x = Set.indicator s (fun x => 1) x
⊢ (fun a => ↑↑(indicatorConstLp 2 (_ : MeasurableSet s) hμs 1) a • c) x = Set.indicator s (fun x => c) x
[PROOFSTEP]
dsimp only
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
c : G
x : α
hx : ↑↑(indicatorConstLp 2 (_ : MeasurableSet s) hμs 1) x = Set.indicator s (fun x => 1) x
⊢ ↑↑(indicatorConstLp 2 (_ : MeasurableSet s) hμs 1) x • c = Set.indicator s (fun x => c) x
[PROOFSTEP]
rw [hx]
[GOAL]
case h
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
c : G
x : α
hx : ↑↑(indicatorConstLp 2 (_ : MeasurableSet s) hμs 1) x = Set.indicator s (fun x => 1) x
⊢ Set.indicator s (fun x => 1) x • c = Set.indicator s (fun x => c) x
[PROOFSTEP]
by_cases hx_mem : x ∈ s
[GOAL]
case pos
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
c : G
x : α
hx : ↑↑(indicatorConstLp 2 (_ : MeasurableSet s) hμs 1) x = Set.indicator s (fun x => 1) x
hx_mem : x ∈ s
⊢ Set.indicator s (fun x => 1) x • c = Set.indicator s (fun x => c) x
[PROOFSTEP]
simp [hx_mem]
[GOAL]
case neg
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹² : IsROrC 𝕜
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
inst✝⁹ : NormedAddCommGroup F'
inst✝⁸ : NormedSpace 𝕜 F'
inst✝⁷ : NormedSpace ℝ F'
inst✝⁶ : CompleteSpace F'
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedAddCommGroup G'
inst✝³ : NormedSpace ℝ G'
inst✝² : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝¹ : NormedSpace ℝ G
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
c : G
x : α
hx : ↑↑(indicatorConstLp 2 (_ : MeasurableSet s) hμs 1) x = Set.indicator s (fun x => 1) x
hx_mem : ¬x ∈ s
⊢ Set.indicator s (fun x => 1) x • c = Set.indicator s (fun x => c) x
[PROOFSTEP]
simp [hx_mem]
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹⁵ : IsROrC 𝕜
inst✝¹⁴ : NormedAddCommGroup F
inst✝¹³ : NormedSpace 𝕜 F
inst✝¹² : NormedAddCommGroup F'
inst✝¹¹ : NormedSpace 𝕜 F'
inst✝¹⁰ : NormedSpace ℝ F'
inst✝⁹ : CompleteSpace F'
inst✝⁸ : NormedAddCommGroup G
inst✝⁷ : NormedAddCommGroup G'
inst✝⁶ : NormedSpace ℝ G'
inst✝⁵ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝⁴ : NormedSpace ℝ G
hm : m ≤ m0
inst✝³ : SigmaFinite (Measure.trim μ hm)
E : Type u_8
inst✝² : NormedLatticeAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : OrderedSMul ℝ E
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
x : E
hx : 0 ≤ x
⊢ 0 ≤ ↑(condexpInd E hm μ s) x
[PROOFSTEP]
rw [← coeFn_le]
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹⁵ : IsROrC 𝕜
inst✝¹⁴ : NormedAddCommGroup F
inst✝¹³ : NormedSpace 𝕜 F
inst✝¹² : NormedAddCommGroup F'
inst✝¹¹ : NormedSpace 𝕜 F'
inst✝¹⁰ : NormedSpace ℝ F'
inst✝⁹ : CompleteSpace F'
inst✝⁸ : NormedAddCommGroup G
inst✝⁷ : NormedAddCommGroup G'
inst✝⁶ : NormedSpace ℝ G'
inst✝⁵ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝⁴ : NormedSpace ℝ G
hm : m ≤ m0
inst✝³ : SigmaFinite (Measure.trim μ hm)
E : Type u_8
inst✝² : NormedLatticeAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : OrderedSMul ℝ E
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
x : E
hx : 0 ≤ x
⊢ ↑↑0 ≤ᵐ[μ] ↑↑(↑(condexpInd E hm μ s) x)
[PROOFSTEP]
refine' EventuallyLE.trans_eq _ (condexpInd_ae_eq_condexpIndSMul hm hs hμs x).symm
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹⁵ : IsROrC 𝕜
inst✝¹⁴ : NormedAddCommGroup F
inst✝¹³ : NormedSpace 𝕜 F
inst✝¹² : NormedAddCommGroup F'
inst✝¹¹ : NormedSpace 𝕜 F'
inst✝¹⁰ : NormedSpace ℝ F'
inst✝⁹ : CompleteSpace F'
inst✝⁸ : NormedAddCommGroup G
inst✝⁷ : NormedAddCommGroup G'
inst✝⁶ : NormedSpace ℝ G'
inst✝⁵ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝⁴ : NormedSpace ℝ G
hm : m ≤ m0
inst✝³ : SigmaFinite (Measure.trim μ hm)
E : Type u_8
inst✝² : NormedLatticeAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : OrderedSMul ℝ E
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
x : E
hx : 0 ≤ x
⊢ ↑↑0 ≤ᵐ[μ] ↑↑(condexpIndSMul hm hs hμs x)
[PROOFSTEP]
exact (coeFn_zero E 1 μ).trans_le (condexpIndSMul_nonneg hs hμs x hx)
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
c : 𝕜
f : { x // x ∈ Lp F' 1 }
⊢ ↑(condexpL1Clm F' hm μ) (c • f) = c • ↑(condexpL1Clm F' hm μ) f
[PROOFSTEP]
refine' L1.setToL1_smul (dominatedFinMeasAdditive_condexpInd F' hm μ) _ c f
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
c : 𝕜
f : { x // x ∈ Lp F' 1 }
⊢ ∀ (c : 𝕜) (s : Set α) (x : F'), ↑(condexpInd F' hm μ s) (c • x) = c • ↑(condexpInd F' hm μ s) x
[PROOFSTEP]
exact fun c s x => condexpInd_smul' c x
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f g : α → F'
s : Set α
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
x : F'
⊢ ↑(condexpL1Clm F' hm μ) ↑(simpleFunc.indicatorConst 1 hs hμs x) = ↑(condexpInd F' hm μ s) x
[PROOFSTEP]
rw [Lp.simpleFunc.coe_indicatorConst]
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f g : α → F'
s : Set α
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
x : F'
⊢ ↑(condexpL1Clm F' hm μ) (indicatorConstLp 1 hs hμs x) = ↑(condexpInd F' hm μ s) x
[PROOFSTEP]
exact condexpL1Clm_indicatorConstLp hs hμs x
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : { x // x ∈ Lp F' 1 }
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
⊢ ∫ (x : α) in s, ↑↑(↑(condexpL1Clm F' hm μ) f) x ∂μ = ∫ (x : α) in s, ↑↑f x ∂μ
[PROOFSTEP]
refine'
@Lp.induction _ _ _ _ _ _ _ ENNReal.one_ne_top
(fun f : α →₁[μ] F' => ∫ x in s, condexpL1Clm F' hm μ f x ∂μ = ∫ x in s, f x ∂μ) _ _ (isClosed_eq _ _) f
[GOAL]
case refine'_1
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : { x // x ∈ Lp F' 1 }
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
⊢ ∀ (c : F') {s_1 : Set α} (hs : MeasurableSet s_1) (hμs : ↑↑μ s_1 < ⊤),
(fun f => ∫ (x : α) in s, ↑↑(↑(condexpL1Clm F' hm μ) f) x ∂μ = ∫ (x : α) in s, ↑↑f x ∂μ)
↑(simpleFunc.indicatorConst 1 hs (_ : ↑↑μ s_1 ≠ ⊤) c)
[PROOFSTEP]
intro x t ht hμt
[GOAL]
case refine'_1
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : { x // x ∈ Lp F' 1 }
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
x : F'
t : Set α
ht : MeasurableSet t
hμt : ↑↑μ t < ⊤
⊢ ∫ (x_1 : α) in s, ↑↑(↑(condexpL1Clm F' hm μ) ↑(simpleFunc.indicatorConst 1 ht (_ : ↑↑μ t ≠ ⊤) x)) x_1 ∂μ =
∫ (x_1 : α) in s, ↑↑↑(simpleFunc.indicatorConst 1 ht (_ : ↑↑μ t ≠ ⊤) x) x_1 ∂μ
[PROOFSTEP]
simp_rw [condexpL1Clm_indicatorConst ht hμt.ne x]
[GOAL]
case refine'_1
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : { x // x ∈ Lp F' 1 }
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
x : F'
t : Set α
ht : MeasurableSet t
hμt : ↑↑μ t < ⊤
⊢ ∫ (x_1 : α) in s, ↑↑(↑(condexpInd F' hm μ t) x) x_1 ∂μ =
∫ (x_1 : α) in s, ↑↑↑(simpleFunc.indicatorConst 1 ht (_ : ↑↑μ t ≠ ⊤) x) x_1 ∂μ
[PROOFSTEP]
rw [Lp.simpleFunc.coe_indicatorConst, set_integral_indicatorConstLp (hm _ hs)]
[GOAL]
case refine'_1
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : { x // x ∈ Lp F' 1 }
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
x : F'
t : Set α
ht : MeasurableSet t
hμt : ↑↑μ t < ⊤
⊢ ∫ (x_1 : α) in s, ↑↑(↑(condexpInd F' hm μ t) x) x_1 ∂μ = ENNReal.toReal (↑↑μ (t ∩ s)) • x
[PROOFSTEP]
exact set_integral_condexpInd hs ht hμs hμt.ne x
[GOAL]
case refine'_2
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : { x // x ∈ Lp F' 1 }
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
⊢ ∀ ⦃f g : α → F'⦄ (hf : Memℒp f 1) (hg : Memℒp g 1),
Disjoint (Function.support f) (Function.support g) →
(fun f => ∫ (x : α) in s, ↑↑(↑(condexpL1Clm F' hm μ) f) x ∂μ = ∫ (x : α) in s, ↑↑f x ∂μ) (Memℒp.toLp f hf) →
(fun f => ∫ (x : α) in s, ↑↑(↑(condexpL1Clm F' hm μ) f) x ∂μ = ∫ (x : α) in s, ↑↑f x ∂μ) (Memℒp.toLp g hg) →
(fun f => ∫ (x : α) in s, ↑↑(↑(condexpL1Clm F' hm μ) f) x ∂μ = ∫ (x : α) in s, ↑↑f x ∂μ)
(Memℒp.toLp f hf + Memℒp.toLp g hg)
[PROOFSTEP]
intro f g hf_Lp hg_Lp _ hf hg
[GOAL]
case refine'_2
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝¹ g✝ : α → F'
s : Set α
f✝ : { x // x ∈ Lp F' 1 }
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
f g : α → F'
hf_Lp : Memℒp f 1
hg_Lp : Memℒp g 1
a✝ : Disjoint (Function.support f) (Function.support g)
hf : ∫ (x : α) in s, ↑↑(↑(condexpL1Clm F' hm μ) (Memℒp.toLp f hf_Lp)) x ∂μ = ∫ (x : α) in s, ↑↑(Memℒp.toLp f hf_Lp) x ∂μ
hg : ∫ (x : α) in s, ↑↑(↑(condexpL1Clm F' hm μ) (Memℒp.toLp g hg_Lp)) x ∂μ = ∫ (x : α) in s, ↑↑(Memℒp.toLp g hg_Lp) x ∂μ
⊢ ∫ (x : α) in s, ↑↑(↑(condexpL1Clm F' hm μ) (Memℒp.toLp f hf_Lp + Memℒp.toLp g hg_Lp)) x ∂μ =
∫ (x : α) in s, ↑↑(Memℒp.toLp f hf_Lp + Memℒp.toLp g hg_Lp) x ∂μ
[PROOFSTEP]
simp_rw [(condexpL1Clm F' hm μ).map_add]
[GOAL]
case refine'_2
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝¹ g✝ : α → F'
s : Set α
f✝ : { x // x ∈ Lp F' 1 }
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
f g : α → F'
hf_Lp : Memℒp f 1
hg_Lp : Memℒp g 1
a✝ : Disjoint (Function.support f) (Function.support g)
hf : ∫ (x : α) in s, ↑↑(↑(condexpL1Clm F' hm μ) (Memℒp.toLp f hf_Lp)) x ∂μ = ∫ (x : α) in s, ↑↑(Memℒp.toLp f hf_Lp) x ∂μ
hg : ∫ (x : α) in s, ↑↑(↑(condexpL1Clm F' hm μ) (Memℒp.toLp g hg_Lp)) x ∂μ = ∫ (x : α) in s, ↑↑(Memℒp.toLp g hg_Lp) x ∂μ
⊢ ∫ (x : α) in s, ↑↑(↑(condexpL1Clm F' hm μ) (Memℒp.toLp f hf_Lp) + ↑(condexpL1Clm F' hm μ) (Memℒp.toLp g hg_Lp)) x ∂μ =
∫ (x : α) in s, ↑↑(Memℒp.toLp f hf_Lp + Memℒp.toLp g hg_Lp) x ∂μ
[PROOFSTEP]
rw [set_integral_congr_ae (hm s hs)
((Lp.coeFn_add (condexpL1Clm F' hm μ (hf_Lp.toLp f)) (condexpL1Clm F' hm μ (hg_Lp.toLp g))).mono fun x hx _ => hx)]
[GOAL]
case refine'_2
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝¹ g✝ : α → F'
s : Set α
f✝ : { x // x ∈ Lp F' 1 }
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
f g : α → F'
hf_Lp : Memℒp f 1
hg_Lp : Memℒp g 1
a✝ : Disjoint (Function.support f) (Function.support g)
hf : ∫ (x : α) in s, ↑↑(↑(condexpL1Clm F' hm μ) (Memℒp.toLp f hf_Lp)) x ∂μ = ∫ (x : α) in s, ↑↑(Memℒp.toLp f hf_Lp) x ∂μ
hg : ∫ (x : α) in s, ↑↑(↑(condexpL1Clm F' hm μ) (Memℒp.toLp g hg_Lp)) x ∂μ = ∫ (x : α) in s, ↑↑(Memℒp.toLp g hg_Lp) x ∂μ
⊢ ∫ (x : α) in s,
(↑↑(↑(condexpL1Clm F' hm μ) (Memℒp.toLp f hf_Lp)) + ↑↑(↑(condexpL1Clm F' hm μ) (Memℒp.toLp g hg_Lp))) x ∂μ =
∫ (x : α) in s, ↑↑(Memℒp.toLp f hf_Lp + Memℒp.toLp g hg_Lp) x ∂μ
[PROOFSTEP]
rw [set_integral_congr_ae (hm s hs) ((Lp.coeFn_add (hf_Lp.toLp f) (hg_Lp.toLp g)).mono fun x hx _ => hx)]
[GOAL]
case refine'_2
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝¹ g✝ : α → F'
s : Set α
f✝ : { x // x ∈ Lp F' 1 }
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
f g : α → F'
hf_Lp : Memℒp f 1
hg_Lp : Memℒp g 1
a✝ : Disjoint (Function.support f) (Function.support g)
hf : ∫ (x : α) in s, ↑↑(↑(condexpL1Clm F' hm μ) (Memℒp.toLp f hf_Lp)) x ∂μ = ∫ (x : α) in s, ↑↑(Memℒp.toLp f hf_Lp) x ∂μ
hg : ∫ (x : α) in s, ↑↑(↑(condexpL1Clm F' hm μ) (Memℒp.toLp g hg_Lp)) x ∂μ = ∫ (x : α) in s, ↑↑(Memℒp.toLp g hg_Lp) x ∂μ
⊢ ∫ (x : α) in s,
(↑↑(↑(condexpL1Clm F' hm μ) (Memℒp.toLp f hf_Lp)) + ↑↑(↑(condexpL1Clm F' hm μ) (Memℒp.toLp g hg_Lp))) x ∂μ =
∫ (x : α) in s, (↑↑(Memℒp.toLp f hf_Lp) + ↑↑(Memℒp.toLp g hg_Lp)) x ∂μ
[PROOFSTEP]
simp_rw [Pi.add_apply]
[GOAL]
case refine'_2
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝¹ g✝ : α → F'
s : Set α
f✝ : { x // x ∈ Lp F' 1 }
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
f g : α → F'
hf_Lp : Memℒp f 1
hg_Lp : Memℒp g 1
a✝ : Disjoint (Function.support f) (Function.support g)
hf : ∫ (x : α) in s, ↑↑(↑(condexpL1Clm F' hm μ) (Memℒp.toLp f hf_Lp)) x ∂μ = ∫ (x : α) in s, ↑↑(Memℒp.toLp f hf_Lp) x ∂μ
hg : ∫ (x : α) in s, ↑↑(↑(condexpL1Clm F' hm μ) (Memℒp.toLp g hg_Lp)) x ∂μ = ∫ (x : α) in s, ↑↑(Memℒp.toLp g hg_Lp) x ∂μ
⊢ ∫ (x : α) in s,
↑↑(↑(condexpL1Clm F' hm μ) (Memℒp.toLp f hf_Lp)) x + ↑↑(↑(condexpL1Clm F' hm μ) (Memℒp.toLp g hg_Lp)) x ∂μ =
∫ (x : α) in s, ↑↑(Memℒp.toLp f hf_Lp) x + ↑↑(Memℒp.toLp g hg_Lp) x ∂μ
[PROOFSTEP]
rw [integral_add (L1.integrable_coeFn _).integrableOn (L1.integrable_coeFn _).integrableOn,
integral_add (L1.integrable_coeFn _).integrableOn (L1.integrable_coeFn _).integrableOn, hf, hg]
[GOAL]
case refine'_3
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : { x // x ∈ Lp F' 1 }
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
⊢ Continuous fun f => ∫ (x : α) in s, ↑↑(↑(condexpL1Clm F' hm μ) f) x ∂μ
[PROOFSTEP]
exact (continuous_set_integral s).comp (condexpL1Clm F' hm μ).continuous
[GOAL]
case refine'_4
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : { x // x ∈ Lp F' 1 }
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
⊢ Continuous fun f => ∫ (x : α) in s, ↑↑f x ∂μ
[PROOFSTEP]
exact continuous_set_integral s
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : { x // x ∈ Lp F' 1 }
hs : MeasurableSet s
⊢ ∫ (x : α) in s, ↑↑(↑(condexpL1Clm F' hm μ) f) x ∂μ = ∫ (x : α) in s, ↑↑f x ∂μ
[PROOFSTEP]
let S := spanningSets (μ.trim hm)
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : { x // x ∈ Lp F' 1 }
hs : MeasurableSet s
S : ℕ → Set α := spanningSets (Measure.trim μ hm)
⊢ ∫ (x : α) in s, ↑↑(↑(condexpL1Clm F' hm μ) f) x ∂μ = ∫ (x : α) in s, ↑↑f x ∂μ
[PROOFSTEP]
have hS_meas : ∀ i, MeasurableSet[m] (S i) := measurable_spanningSets (μ.trim hm)
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : { x // x ∈ Lp F' 1 }
hs : MeasurableSet s
S : ℕ → Set α := spanningSets (Measure.trim μ hm)
hS_meas : ∀ (i : ℕ), MeasurableSet (S i)
⊢ ∫ (x : α) in s, ↑↑(↑(condexpL1Clm F' hm μ) f) x ∂μ = ∫ (x : α) in s, ↑↑f x ∂μ
[PROOFSTEP]
have hS_meas0 : ∀ i, MeasurableSet (S i) := fun i => hm _ (hS_meas i)
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : { x // x ∈ Lp F' 1 }
hs : MeasurableSet s
S : ℕ → Set α := spanningSets (Measure.trim μ hm)
hS_meas : ∀ (i : ℕ), MeasurableSet (S i)
hS_meas0 : ∀ (i : ℕ), MeasurableSet (S i)
⊢ ∫ (x : α) in s, ↑↑(↑(condexpL1Clm F' hm μ) f) x ∂μ = ∫ (x : α) in s, ↑↑f x ∂μ
[PROOFSTEP]
have hs_eq : s = ⋃ i, S i ∩ s := by
simp_rw [Set.inter_comm]
rw [← Set.inter_iUnion, iUnion_spanningSets (μ.trim hm), Set.inter_univ]
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : { x // x ∈ Lp F' 1 }
hs : MeasurableSet s
S : ℕ → Set α := spanningSets (Measure.trim μ hm)
hS_meas : ∀ (i : ℕ), MeasurableSet (S i)
hS_meas0 : ∀ (i : ℕ), MeasurableSet (S i)
⊢ s = ⋃ (i : ℕ), S i ∩ s
[PROOFSTEP]
simp_rw [Set.inter_comm]
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : { x // x ∈ Lp F' 1 }
hs : MeasurableSet s
S : ℕ → Set α := spanningSets (Measure.trim μ hm)
hS_meas : ∀ (i : ℕ), MeasurableSet (S i)
hS_meas0 : ∀ (i : ℕ), MeasurableSet (S i)
⊢ s = ⋃ (i : ℕ), s ∩ spanningSets (Measure.trim μ hm) i
[PROOFSTEP]
rw [← Set.inter_iUnion, iUnion_spanningSets (μ.trim hm), Set.inter_univ]
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : { x // x ∈ Lp F' 1 }
hs : MeasurableSet s
S : ℕ → Set α := spanningSets (Measure.trim μ hm)
hS_meas : ∀ (i : ℕ), MeasurableSet (S i)
hS_meas0 : ∀ (i : ℕ), MeasurableSet (S i)
hs_eq : s = ⋃ (i : ℕ), S i ∩ s
⊢ ∫ (x : α) in s, ↑↑(↑(condexpL1Clm F' hm μ) f) x ∂μ = ∫ (x : α) in s, ↑↑f x ∂μ
[PROOFSTEP]
have hS_finite : ∀ i, μ (S i ∩ s) < ∞ :=
by
refine' fun i => (measure_mono (Set.inter_subset_left _ _)).trans_lt _
have hS_finite_trim := measure_spanningSets_lt_top (μ.trim hm) i
rwa [trim_measurableSet_eq hm (hS_meas i)] at hS_finite_trim
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : { x // x ∈ Lp F' 1 }
hs : MeasurableSet s
S : ℕ → Set α := spanningSets (Measure.trim μ hm)
hS_meas : ∀ (i : ℕ), MeasurableSet (S i)
hS_meas0 : ∀ (i : ℕ), MeasurableSet (S i)
hs_eq : s = ⋃ (i : ℕ), S i ∩ s
⊢ ∀ (i : ℕ), ↑↑μ (S i ∩ s) < ⊤
[PROOFSTEP]
refine' fun i => (measure_mono (Set.inter_subset_left _ _)).trans_lt _
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : { x // x ∈ Lp F' 1 }
hs : MeasurableSet s
S : ℕ → Set α := spanningSets (Measure.trim μ hm)
hS_meas : ∀ (i : ℕ), MeasurableSet (S i)
hS_meas0 : ∀ (i : ℕ), MeasurableSet (S i)
hs_eq : s = ⋃ (i : ℕ), S i ∩ s
i : ℕ
⊢ ↑↑μ (S i) < ⊤
[PROOFSTEP]
have hS_finite_trim := measure_spanningSets_lt_top (μ.trim hm) i
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : { x // x ∈ Lp F' 1 }
hs : MeasurableSet s
S : ℕ → Set α := spanningSets (Measure.trim μ hm)
hS_meas : ∀ (i : ℕ), MeasurableSet (S i)
hS_meas0 : ∀ (i : ℕ), MeasurableSet (S i)
hs_eq : s = ⋃ (i : ℕ), S i ∩ s
i : ℕ
hS_finite_trim : ↑↑(Measure.trim μ hm) (spanningSets (Measure.trim μ hm) i) < ⊤
⊢ ↑↑μ (S i) < ⊤
[PROOFSTEP]
rwa [trim_measurableSet_eq hm (hS_meas i)] at hS_finite_trim
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : { x // x ∈ Lp F' 1 }
hs : MeasurableSet s
S : ℕ → Set α := spanningSets (Measure.trim μ hm)
hS_meas : ∀ (i : ℕ), MeasurableSet (S i)
hS_meas0 : ∀ (i : ℕ), MeasurableSet (S i)
hs_eq : s = ⋃ (i : ℕ), S i ∩ s
hS_finite : ∀ (i : ℕ), ↑↑μ (S i ∩ s) < ⊤
⊢ ∫ (x : α) in s, ↑↑(↑(condexpL1Clm F' hm μ) f) x ∂μ = ∫ (x : α) in s, ↑↑f x ∂μ
[PROOFSTEP]
have h_mono : Monotone fun i => S i ∩ s := by
intro i j hij x
simp_rw [Set.mem_inter_iff]
exact fun h => ⟨monotone_spanningSets (μ.trim hm) hij h.1, h.2⟩
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : { x // x ∈ Lp F' 1 }
hs : MeasurableSet s
S : ℕ → Set α := spanningSets (Measure.trim μ hm)
hS_meas : ∀ (i : ℕ), MeasurableSet (S i)
hS_meas0 : ∀ (i : ℕ), MeasurableSet (S i)
hs_eq : s = ⋃ (i : ℕ), S i ∩ s
hS_finite : ∀ (i : ℕ), ↑↑μ (S i ∩ s) < ⊤
⊢ Monotone fun i => S i ∩ s
[PROOFSTEP]
intro i j hij x
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : { x // x ∈ Lp F' 1 }
hs : MeasurableSet s
S : ℕ → Set α := spanningSets (Measure.trim μ hm)
hS_meas : ∀ (i : ℕ), MeasurableSet (S i)
hS_meas0 : ∀ (i : ℕ), MeasurableSet (S i)
hs_eq : s = ⋃ (i : ℕ), S i ∩ s
hS_finite : ∀ (i : ℕ), ↑↑μ (S i ∩ s) < ⊤
i j : ℕ
hij : i ≤ j
x : α
⊢ x ∈ (fun i => S i ∩ s) i → x ∈ (fun i => S i ∩ s) j
[PROOFSTEP]
simp_rw [Set.mem_inter_iff]
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : { x // x ∈ Lp F' 1 }
hs : MeasurableSet s
S : ℕ → Set α := spanningSets (Measure.trim μ hm)
hS_meas : ∀ (i : ℕ), MeasurableSet (S i)
hS_meas0 : ∀ (i : ℕ), MeasurableSet (S i)
hs_eq : s = ⋃ (i : ℕ), S i ∩ s
hS_finite : ∀ (i : ℕ), ↑↑μ (S i ∩ s) < ⊤
i j : ℕ
hij : i ≤ j
x : α
⊢ x ∈ spanningSets (Measure.trim μ hm) i ∧ x ∈ s → x ∈ spanningSets (Measure.trim μ hm) j ∧ x ∈ s
[PROOFSTEP]
exact fun h => ⟨monotone_spanningSets (μ.trim hm) hij h.1, h.2⟩
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : { x // x ∈ Lp F' 1 }
hs : MeasurableSet s
S : ℕ → Set α := spanningSets (Measure.trim μ hm)
hS_meas : ∀ (i : ℕ), MeasurableSet (S i)
hS_meas0 : ∀ (i : ℕ), MeasurableSet (S i)
hs_eq : s = ⋃ (i : ℕ), S i ∩ s
hS_finite : ∀ (i : ℕ), ↑↑μ (S i ∩ s) < ⊤
h_mono : Monotone fun i => S i ∩ s
⊢ ∫ (x : α) in s, ↑↑(↑(condexpL1Clm F' hm μ) f) x ∂μ = ∫ (x : α) in s, ↑↑f x ∂μ
[PROOFSTEP]
have h_eq_forall : (fun i => ∫ x in S i ∩ s, condexpL1Clm F' hm μ f x ∂μ) = fun i => ∫ x in S i ∩ s, f x ∂μ :=
funext fun i =>
set_integral_condexpL1Clm_of_measure_ne_top f (@MeasurableSet.inter α m _ _ (hS_meas i) hs) (hS_finite i).ne
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : { x // x ∈ Lp F' 1 }
hs : MeasurableSet s
S : ℕ → Set α := spanningSets (Measure.trim μ hm)
hS_meas : ∀ (i : ℕ), MeasurableSet (S i)
hS_meas0 : ∀ (i : ℕ), MeasurableSet (S i)
hs_eq : s = ⋃ (i : ℕ), S i ∩ s
hS_finite : ∀ (i : ℕ), ↑↑μ (S i ∩ s) < ⊤
h_mono : Monotone fun i => S i ∩ s
h_eq_forall :
(fun i => ∫ (x : α) in S i ∩ s, ↑↑(↑(condexpL1Clm F' hm μ) f) x ∂μ) = fun i => ∫ (x : α) in S i ∩ s, ↑↑f x ∂μ
⊢ ∫ (x : α) in s, ↑↑(↑(condexpL1Clm F' hm μ) f) x ∂μ = ∫ (x : α) in s, ↑↑f x ∂μ
[PROOFSTEP]
have h_right : Tendsto (fun i => ∫ x in S i ∩ s, f x ∂μ) atTop (𝓝 (∫ x in s, f x ∂μ)) :=
by
have h :=
tendsto_set_integral_of_monotone (fun i => (hS_meas0 i).inter (hm s hs)) h_mono (L1.integrable_coeFn f).integrableOn
rwa [← hs_eq] at h
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : { x // x ∈ Lp F' 1 }
hs : MeasurableSet s
S : ℕ → Set α := spanningSets (Measure.trim μ hm)
hS_meas : ∀ (i : ℕ), MeasurableSet (S i)
hS_meas0 : ∀ (i : ℕ), MeasurableSet (S i)
hs_eq : s = ⋃ (i : ℕ), S i ∩ s
hS_finite : ∀ (i : ℕ), ↑↑μ (S i ∩ s) < ⊤
h_mono : Monotone fun i => S i ∩ s
h_eq_forall :
(fun i => ∫ (x : α) in S i ∩ s, ↑↑(↑(condexpL1Clm F' hm μ) f) x ∂μ) = fun i => ∫ (x : α) in S i ∩ s, ↑↑f x ∂μ
⊢ Tendsto (fun i => ∫ (x : α) in S i ∩ s, ↑↑f x ∂μ) atTop (𝓝 (∫ (x : α) in s, ↑↑f x ∂μ))
[PROOFSTEP]
have h :=
tendsto_set_integral_of_monotone (fun i => (hS_meas0 i).inter (hm s hs)) h_mono (L1.integrable_coeFn f).integrableOn
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : { x // x ∈ Lp F' 1 }
hs : MeasurableSet s
S : ℕ → Set α := spanningSets (Measure.trim μ hm)
hS_meas : ∀ (i : ℕ), MeasurableSet (S i)
hS_meas0 : ∀ (i : ℕ), MeasurableSet (S i)
hs_eq : s = ⋃ (i : ℕ), S i ∩ s
hS_finite : ∀ (i : ℕ), ↑↑μ (S i ∩ s) < ⊤
h_mono : Monotone fun i => S i ∩ s
h_eq_forall :
(fun i => ∫ (x : α) in S i ∩ s, ↑↑(↑(condexpL1Clm F' hm μ) f) x ∂μ) = fun i => ∫ (x : α) in S i ∩ s, ↑↑f x ∂μ
h : Tendsto (fun i => ∫ (a : α) in S i ∩ s, ↑↑f a ∂μ) atTop (𝓝 (∫ (a : α) in ⋃ (n : ℕ), S n ∩ s, ↑↑f a ∂μ))
⊢ Tendsto (fun i => ∫ (x : α) in S i ∩ s, ↑↑f x ∂μ) atTop (𝓝 (∫ (x : α) in s, ↑↑f x ∂μ))
[PROOFSTEP]
rwa [← hs_eq] at h
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : { x // x ∈ Lp F' 1 }
hs : MeasurableSet s
S : ℕ → Set α := spanningSets (Measure.trim μ hm)
hS_meas : ∀ (i : ℕ), MeasurableSet (S i)
hS_meas0 : ∀ (i : ℕ), MeasurableSet (S i)
hs_eq : s = ⋃ (i : ℕ), S i ∩ s
hS_finite : ∀ (i : ℕ), ↑↑μ (S i ∩ s) < ⊤
h_mono : Monotone fun i => S i ∩ s
h_eq_forall :
(fun i => ∫ (x : α) in S i ∩ s, ↑↑(↑(condexpL1Clm F' hm μ) f) x ∂μ) = fun i => ∫ (x : α) in S i ∩ s, ↑↑f x ∂μ
h_right : Tendsto (fun i => ∫ (x : α) in S i ∩ s, ↑↑f x ∂μ) atTop (𝓝 (∫ (x : α) in s, ↑↑f x ∂μ))
⊢ ∫ (x : α) in s, ↑↑(↑(condexpL1Clm F' hm μ) f) x ∂μ = ∫ (x : α) in s, ↑↑f x ∂μ
[PROOFSTEP]
have h_left :
Tendsto (fun i => ∫ x in S i ∩ s, condexpL1Clm F' hm μ f x ∂μ) atTop (𝓝 (∫ x in s, condexpL1Clm F' hm μ f x ∂μ)) :=
by
have h :=
tendsto_set_integral_of_monotone (fun i => (hS_meas0 i).inter (hm s hs)) h_mono
(L1.integrable_coeFn (condexpL1Clm F' hm μ f)).integrableOn
rwa [← hs_eq] at h
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : { x // x ∈ Lp F' 1 }
hs : MeasurableSet s
S : ℕ → Set α := spanningSets (Measure.trim μ hm)
hS_meas : ∀ (i : ℕ), MeasurableSet (S i)
hS_meas0 : ∀ (i : ℕ), MeasurableSet (S i)
hs_eq : s = ⋃ (i : ℕ), S i ∩ s
hS_finite : ∀ (i : ℕ), ↑↑μ (S i ∩ s) < ⊤
h_mono : Monotone fun i => S i ∩ s
h_eq_forall :
(fun i => ∫ (x : α) in S i ∩ s, ↑↑(↑(condexpL1Clm F' hm μ) f) x ∂μ) = fun i => ∫ (x : α) in S i ∩ s, ↑↑f x ∂μ
h_right : Tendsto (fun i => ∫ (x : α) in S i ∩ s, ↑↑f x ∂μ) atTop (𝓝 (∫ (x : α) in s, ↑↑f x ∂μ))
⊢ Tendsto (fun i => ∫ (x : α) in S i ∩ s, ↑↑(↑(condexpL1Clm F' hm μ) f) x ∂μ) atTop
(𝓝 (∫ (x : α) in s, ↑↑(↑(condexpL1Clm F' hm μ) f) x ∂μ))
[PROOFSTEP]
have h :=
tendsto_set_integral_of_monotone (fun i => (hS_meas0 i).inter (hm s hs)) h_mono
(L1.integrable_coeFn (condexpL1Clm F' hm μ f)).integrableOn
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : { x // x ∈ Lp F' 1 }
hs : MeasurableSet s
S : ℕ → Set α := spanningSets (Measure.trim μ hm)
hS_meas : ∀ (i : ℕ), MeasurableSet (S i)
hS_meas0 : ∀ (i : ℕ), MeasurableSet (S i)
hs_eq : s = ⋃ (i : ℕ), S i ∩ s
hS_finite : ∀ (i : ℕ), ↑↑μ (S i ∩ s) < ⊤
h_mono : Monotone fun i => S i ∩ s
h_eq_forall :
(fun i => ∫ (x : α) in S i ∩ s, ↑↑(↑(condexpL1Clm F' hm μ) f) x ∂μ) = fun i => ∫ (x : α) in S i ∩ s, ↑↑f x ∂μ
h_right : Tendsto (fun i => ∫ (x : α) in S i ∩ s, ↑↑f x ∂μ) atTop (𝓝 (∫ (x : α) in s, ↑↑f x ∂μ))
h :
Tendsto (fun i => ∫ (a : α) in S i ∩ s, ↑↑(↑(condexpL1Clm F' hm μ) f) a ∂μ) atTop
(𝓝 (∫ (a : α) in ⋃ (n : ℕ), S n ∩ s, ↑↑(↑(condexpL1Clm F' hm μ) f) a ∂μ))
⊢ Tendsto (fun i => ∫ (x : α) in S i ∩ s, ↑↑(↑(condexpL1Clm F' hm μ) f) x ∂μ) atTop
(𝓝 (∫ (x : α) in s, ↑↑(↑(condexpL1Clm F' hm μ) f) x ∂μ))
[PROOFSTEP]
rwa [← hs_eq] at h
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : { x // x ∈ Lp F' 1 }
hs : MeasurableSet s
S : ℕ → Set α := spanningSets (Measure.trim μ hm)
hS_meas : ∀ (i : ℕ), MeasurableSet (S i)
hS_meas0 : ∀ (i : ℕ), MeasurableSet (S i)
hs_eq : s = ⋃ (i : ℕ), S i ∩ s
hS_finite : ∀ (i : ℕ), ↑↑μ (S i ∩ s) < ⊤
h_mono : Monotone fun i => S i ∩ s
h_eq_forall :
(fun i => ∫ (x : α) in S i ∩ s, ↑↑(↑(condexpL1Clm F' hm μ) f) x ∂μ) = fun i => ∫ (x : α) in S i ∩ s, ↑↑f x ∂μ
h_right : Tendsto (fun i => ∫ (x : α) in S i ∩ s, ↑↑f x ∂μ) atTop (𝓝 (∫ (x : α) in s, ↑↑f x ∂μ))
h_left :
Tendsto (fun i => ∫ (x : α) in S i ∩ s, ↑↑(↑(condexpL1Clm F' hm μ) f) x ∂μ) atTop
(𝓝 (∫ (x : α) in s, ↑↑(↑(condexpL1Clm F' hm μ) f) x ∂μ))
⊢ ∫ (x : α) in s, ↑↑(↑(condexpL1Clm F' hm μ) f) x ∂μ = ∫ (x : α) in s, ↑↑f x ∂μ
[PROOFSTEP]
rw [h_eq_forall] at h_left
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : { x // x ∈ Lp F' 1 }
hs : MeasurableSet s
S : ℕ → Set α := spanningSets (Measure.trim μ hm)
hS_meas : ∀ (i : ℕ), MeasurableSet (S i)
hS_meas0 : ∀ (i : ℕ), MeasurableSet (S i)
hs_eq : s = ⋃ (i : ℕ), S i ∩ s
hS_finite : ∀ (i : ℕ), ↑↑μ (S i ∩ s) < ⊤
h_mono : Monotone fun i => S i ∩ s
h_eq_forall :
(fun i => ∫ (x : α) in S i ∩ s, ↑↑(↑(condexpL1Clm F' hm μ) f) x ∂μ) = fun i => ∫ (x : α) in S i ∩ s, ↑↑f x ∂μ
h_right : Tendsto (fun i => ∫ (x : α) in S i ∩ s, ↑↑f x ∂μ) atTop (𝓝 (∫ (x : α) in s, ↑↑f x ∂μ))
h_left :
Tendsto (fun i => ∫ (x : α) in S i ∩ s, ↑↑f x ∂μ) atTop (𝓝 (∫ (x : α) in s, ↑↑(↑(condexpL1Clm F' hm μ) f) x ∂μ))
⊢ ∫ (x : α) in s, ↑↑(↑(condexpL1Clm F' hm μ) f) x ∂μ = ∫ (x : α) in s, ↑↑f x ∂μ
[PROOFSTEP]
exact tendsto_nhds_unique h_left h_right
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : { x // x ∈ Lp F' 1 }
⊢ AEStronglyMeasurable' m (↑↑(↑(condexpL1Clm F' hm μ) f)) μ
[PROOFSTEP]
refine'
@Lp.induction _ _ _ _ _ _ _ ENNReal.one_ne_top
(fun f : α →₁[μ] F' => AEStronglyMeasurable' m (condexpL1Clm F' hm μ f) μ) _ _ _ f
[GOAL]
case refine'_1
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : { x // x ∈ Lp F' 1 }
⊢ ∀ (c : F') {s : Set α} (hs : MeasurableSet s) (hμs : ↑↑μ s < ⊤),
(fun f => AEStronglyMeasurable' m (↑↑(↑(condexpL1Clm F' hm μ) f)) μ)
↑(simpleFunc.indicatorConst 1 hs (_ : ↑↑μ s ≠ ⊤) c)
[PROOFSTEP]
intro c s hs hμs
[GOAL]
case refine'_1
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s✝ : Set α
f : { x // x ∈ Lp F' 1 }
c : F'
s : Set α
hs : MeasurableSet s
hμs : ↑↑μ s < ⊤
⊢ AEStronglyMeasurable' m (↑↑(↑(condexpL1Clm F' hm μ) ↑(simpleFunc.indicatorConst 1 hs (_ : ↑↑μ s ≠ ⊤) c))) μ
[PROOFSTEP]
rw [condexpL1Clm_indicatorConst hs hμs.ne c]
[GOAL]
case refine'_1
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s✝ : Set α
f : { x // x ∈ Lp F' 1 }
c : F'
s : Set α
hs : MeasurableSet s
hμs : ↑↑μ s < ⊤
⊢ AEStronglyMeasurable' m (↑↑(↑(condexpInd F' hm μ s) c)) μ
[PROOFSTEP]
exact aestronglyMeasurable'_condexpInd hs hμs.ne c
[GOAL]
case refine'_2
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : { x // x ∈ Lp F' 1 }
⊢ ∀ ⦃f g : α → F'⦄ (hf : Memℒp f 1) (hg : Memℒp g 1),
Disjoint (Function.support f) (Function.support g) →
(fun f => AEStronglyMeasurable' m (↑↑(↑(condexpL1Clm F' hm μ) f)) μ) (Memℒp.toLp f hf) →
(fun f => AEStronglyMeasurable' m (↑↑(↑(condexpL1Clm F' hm μ) f)) μ) (Memℒp.toLp g hg) →
(fun f => AEStronglyMeasurable' m (↑↑(↑(condexpL1Clm F' hm μ) f)) μ) (Memℒp.toLp f hf + Memℒp.toLp g hg)
[PROOFSTEP]
intro f g hf hg _ hfm hgm
[GOAL]
case refine'_2
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝¹ g✝ : α → F'
s : Set α
f✝ : { x // x ∈ Lp F' 1 }
f g : α → F'
hf : Memℒp f 1
hg : Memℒp g 1
a✝ : Disjoint (Function.support f) (Function.support g)
hfm : AEStronglyMeasurable' m (↑↑(↑(condexpL1Clm F' hm μ) (Memℒp.toLp f hf))) μ
hgm : AEStronglyMeasurable' m (↑↑(↑(condexpL1Clm F' hm μ) (Memℒp.toLp g hg))) μ
⊢ AEStronglyMeasurable' m (↑↑(↑(condexpL1Clm F' hm μ) (Memℒp.toLp f hf + Memℒp.toLp g hg))) μ
[PROOFSTEP]
rw [(condexpL1Clm F' hm μ).map_add]
[GOAL]
case refine'_2
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝¹ g✝ : α → F'
s : Set α
f✝ : { x // x ∈ Lp F' 1 }
f g : α → F'
hf : Memℒp f 1
hg : Memℒp g 1
a✝ : Disjoint (Function.support f) (Function.support g)
hfm : AEStronglyMeasurable' m (↑↑(↑(condexpL1Clm F' hm μ) (Memℒp.toLp f hf))) μ
hgm : AEStronglyMeasurable' m (↑↑(↑(condexpL1Clm F' hm μ) (Memℒp.toLp g hg))) μ
⊢ AEStronglyMeasurable' m (↑↑(↑(condexpL1Clm F' hm μ) (Memℒp.toLp f hf) + ↑(condexpL1Clm F' hm μ) (Memℒp.toLp g hg))) μ
[PROOFSTEP]
refine' AEStronglyMeasurable'.congr _ (coeFn_add _ _).symm
[GOAL]
case refine'_2
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝¹ g✝ : α → F'
s : Set α
f✝ : { x // x ∈ Lp F' 1 }
f g : α → F'
hf : Memℒp f 1
hg : Memℒp g 1
a✝ : Disjoint (Function.support f) (Function.support g)
hfm : AEStronglyMeasurable' m (↑↑(↑(condexpL1Clm F' hm μ) (Memℒp.toLp f hf))) μ
hgm : AEStronglyMeasurable' m (↑↑(↑(condexpL1Clm F' hm μ) (Memℒp.toLp g hg))) μ
⊢ AEStronglyMeasurable' m
(↑↑(↑(condexpL1Clm F' hm μ) (Memℒp.toLp f hf)) + ↑↑(↑(condexpL1Clm F' hm μ) (Memℒp.toLp g hg))) μ
[PROOFSTEP]
exact AEStronglyMeasurable'.add hfm hgm
[GOAL]
case refine'_3
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : { x // x ∈ Lp F' 1 }
⊢ IsClosed {f | (fun f => AEStronglyMeasurable' m (↑↑(↑(condexpL1Clm F' hm μ) f)) μ) f}
[PROOFSTEP]
have :
{f : Lp F' 1 μ | AEStronglyMeasurable' m (condexpL1Clm F' hm μ f) μ} =
condexpL1Clm F' hm μ ⁻¹' {f | AEStronglyMeasurable' m f μ} :=
by rfl
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : { x // x ∈ Lp F' 1 }
⊢ {f | AEStronglyMeasurable' m (↑↑(↑(condexpL1Clm F' hm μ) f)) μ} =
↑(condexpL1Clm F' hm μ) ⁻¹' {f | AEStronglyMeasurable' m (↑↑f) μ}
[PROOFSTEP]
rfl
[GOAL]
case refine'_3
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : { x // x ∈ Lp F' 1 }
this :
{f | AEStronglyMeasurable' m (↑↑(↑(condexpL1Clm F' hm μ) f)) μ} =
↑(condexpL1Clm F' hm μ) ⁻¹' {f | AEStronglyMeasurable' m (↑↑f) μ}
⊢ IsClosed {f | (fun f => AEStronglyMeasurable' m (↑↑(↑(condexpL1Clm F' hm μ) f)) μ) f}
[PROOFSTEP]
rw [this]
[GOAL]
case refine'_3
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : { x // x ∈ Lp F' 1 }
this :
{f | AEStronglyMeasurable' m (↑↑(↑(condexpL1Clm F' hm μ) f)) μ} =
↑(condexpL1Clm F' hm μ) ⁻¹' {f | AEStronglyMeasurable' m (↑↑f) μ}
⊢ IsClosed (↑(condexpL1Clm F' hm μ) ⁻¹' {f | AEStronglyMeasurable' m (↑↑f) μ})
[PROOFSTEP]
refine' IsClosed.preimage (condexpL1Clm F' hm μ).continuous _
[GOAL]
case refine'_3
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : { x // x ∈ Lp F' 1 }
this :
{f | AEStronglyMeasurable' m (↑↑(↑(condexpL1Clm F' hm μ) f)) μ} =
↑(condexpL1Clm F' hm μ) ⁻¹' {f | AEStronglyMeasurable' m (↑↑f) μ}
⊢ IsClosed {f | AEStronglyMeasurable' m (↑↑f) μ}
[PROOFSTEP]
exact isClosed_aeStronglyMeasurable' hm
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : { x // x ∈ lpMeas F' ℝ m 1 μ }
⊢ ↑(condexpL1Clm F' hm μ) ↑f = ↑f
[PROOFSTEP]
let g := lpMeasToLpTrimLie F' ℝ 1 μ hm f
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g✝ : α → F'
s : Set α
f : { x // x ∈ lpMeas F' ℝ m 1 μ }
g : { x // x ∈ Lp F' 1 } := ↑(lpMeasToLpTrimLie F' ℝ 1 μ hm) f
⊢ ↑(condexpL1Clm F' hm μ) ↑f = ↑f
[PROOFSTEP]
have hfg : f = (lpMeasToLpTrimLie F' ℝ 1 μ hm).symm g := by simp only [LinearIsometryEquiv.symm_apply_apply]
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g✝ : α → F'
s : Set α
f : { x // x ∈ lpMeas F' ℝ m 1 μ }
g : { x // x ∈ Lp F' 1 } := ↑(lpMeasToLpTrimLie F' ℝ 1 μ hm) f
⊢ f = ↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) g
[PROOFSTEP]
simp only [LinearIsometryEquiv.symm_apply_apply]
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g✝ : α → F'
s : Set α
f : { x // x ∈ lpMeas F' ℝ m 1 μ }
g : { x // x ∈ Lp F' 1 } := ↑(lpMeasToLpTrimLie F' ℝ 1 μ hm) f
hfg : f = ↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) g
⊢ ↑(condexpL1Clm F' hm μ) ↑f = ↑f
[PROOFSTEP]
rw [hfg]
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g✝ : α → F'
s : Set α
f : { x // x ∈ lpMeas F' ℝ m 1 μ }
g : { x // x ∈ Lp F' 1 } := ↑(lpMeasToLpTrimLie F' ℝ 1 μ hm) f
hfg : f = ↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) g
⊢ ↑(condexpL1Clm F' hm μ) ↑(↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) g) =
↑(↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) g)
[PROOFSTEP]
refine'
@Lp.induction α F' m _ 1 (μ.trim hm) _ ENNReal.coe_ne_top
(fun g : α →₁[μ.trim hm] F' =>
condexpL1Clm F' hm μ ((lpMeasToLpTrimLie F' ℝ 1 μ hm).symm g : α →₁[μ] F') =
↑((lpMeasToLpTrimLie F' ℝ 1 μ hm).symm g))
_ _ _ g
[GOAL]
case refine'_1
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g✝ : α → F'
s : Set α
f : { x // x ∈ lpMeas F' ℝ m 1 μ }
g : { x // x ∈ Lp F' 1 } := ↑(lpMeasToLpTrimLie F' ℝ 1 μ hm) f
hfg : f = ↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) g
⊢ ∀ (c : F') {s : Set α} (hs : MeasurableSet s) (hμs : ↑↑(Measure.trim μ hm) s < ⊤),
(fun g =>
↑(condexpL1Clm F' hm μ) ↑(↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) g) =
↑(↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) g))
↑(simpleFunc.indicatorConst 1 hs (_ : ↑↑(Measure.trim μ hm) s ≠ ⊤) c)
[PROOFSTEP]
intro c s hs hμs
[GOAL]
case refine'_1
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g✝ : α → F'
s✝ : Set α
f : { x // x ∈ lpMeas F' ℝ m 1 μ }
g : { x // x ∈ Lp F' 1 } := ↑(lpMeasToLpTrimLie F' ℝ 1 μ hm) f
hfg : f = ↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) g
c : F'
s : Set α
hs : MeasurableSet s
hμs : ↑↑(Measure.trim μ hm) s < ⊤
⊢ ↑(condexpL1Clm F' hm μ)
↑(↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm))
↑(simpleFunc.indicatorConst 1 hs (_ : ↑↑(Measure.trim μ hm) s ≠ ⊤) c)) =
↑(↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm))
↑(simpleFunc.indicatorConst 1 hs (_ : ↑↑(Measure.trim μ hm) s ≠ ⊤) c))
[PROOFSTEP]
rw [@Lp.simpleFunc.coe_indicatorConst _ _ m, lpMeasToLpTrimLie_symm_indicator hs hμs.ne c,
condexpL1Clm_indicatorConstLp]
[GOAL]
case refine'_1
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g✝ : α → F'
s✝ : Set α
f : { x // x ∈ lpMeas F' ℝ m 1 μ }
g : { x // x ∈ Lp F' 1 } := ↑(lpMeasToLpTrimLie F' ℝ 1 μ hm) f
hfg : f = ↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) g
c : F'
s : Set α
hs : MeasurableSet s
hμs : ↑↑(Measure.trim μ hm) s < ⊤
⊢ ↑(condexpInd F' hm μ s) c = indicatorConstLp 1 (_ : MeasurableSet s) (_ : ↑↑μ s ≠ ⊤) c
[PROOFSTEP]
exact condexpInd_of_measurable hs ((le_trim hm).trans_lt hμs).ne c
[GOAL]
case refine'_2
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g✝ : α → F'
s : Set α
f : { x // x ∈ lpMeas F' ℝ m 1 μ }
g : { x // x ∈ Lp F' 1 } := ↑(lpMeasToLpTrimLie F' ℝ 1 μ hm) f
hfg : f = ↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) g
⊢ ∀ ⦃f g : α → F'⦄ (hf : Memℒp f 1) (hg : Memℒp g 1),
Disjoint (Function.support f) (Function.support g) →
(fun g =>
↑(condexpL1Clm F' hm μ) ↑(↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) g) =
↑(↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) g))
(Memℒp.toLp f hf) →
(fun g =>
↑(condexpL1Clm F' hm μ) ↑(↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) g) =
↑(↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) g))
(Memℒp.toLp g hg) →
(fun g =>
↑(condexpL1Clm F' hm μ) ↑(↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) g) =
↑(↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) g))
(Memℒp.toLp f hf + Memℒp.toLp g hg)
[PROOFSTEP]
intro f g hf hg _ hf_eq hg_eq
[GOAL]
case refine'_2
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝¹ g✝¹ : α → F'
s : Set α
f✝ : { x // x ∈ lpMeas F' ℝ m 1 μ }
g✝ : { x // x ∈ Lp F' 1 } := ↑(lpMeasToLpTrimLie F' ℝ 1 μ hm) f✝
hfg : f✝ = ↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) g✝
f g : α → F'
hf : Memℒp f 1
hg : Memℒp g 1
a✝ : Disjoint (Function.support f) (Function.support g)
hf_eq :
↑(condexpL1Clm F' hm μ) ↑(↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) (Memℒp.toLp f hf)) =
↑(↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) (Memℒp.toLp f hf))
hg_eq :
↑(condexpL1Clm F' hm μ) ↑(↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) (Memℒp.toLp g hg)) =
↑(↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) (Memℒp.toLp g hg))
⊢ ↑(condexpL1Clm F' hm μ)
↑(↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) (Memℒp.toLp f hf + Memℒp.toLp g hg)) =
↑(↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) (Memℒp.toLp f hf + Memℒp.toLp g hg))
[PROOFSTEP]
rw [LinearIsometryEquiv.map_add]
[GOAL]
case refine'_2
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝¹ g✝¹ : α → F'
s : Set α
f✝ : { x // x ∈ lpMeas F' ℝ m 1 μ }
g✝ : { x // x ∈ Lp F' 1 } := ↑(lpMeasToLpTrimLie F' ℝ 1 μ hm) f✝
hfg : f✝ = ↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) g✝
f g : α → F'
hf : Memℒp f 1
hg : Memℒp g 1
a✝ : Disjoint (Function.support f) (Function.support g)
hf_eq :
↑(condexpL1Clm F' hm μ) ↑(↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) (Memℒp.toLp f hf)) =
↑(↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) (Memℒp.toLp f hf))
hg_eq :
↑(condexpL1Clm F' hm μ) ↑(↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) (Memℒp.toLp g hg)) =
↑(↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) (Memℒp.toLp g hg))
⊢ ↑(condexpL1Clm F' hm μ)
↑(↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) (Memℒp.toLp f hf) +
↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) (Memℒp.toLp g hg)) =
↑(↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) (Memℒp.toLp f hf) +
↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) (Memℒp.toLp g hg))
[PROOFSTEP]
push_cast
[GOAL]
case refine'_2
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝¹ g✝¹ : α → F'
s : Set α
f✝ : { x // x ∈ lpMeas F' ℝ m 1 μ }
g✝ : { x // x ∈ Lp F' 1 } := ↑(lpMeasToLpTrimLie F' ℝ 1 μ hm) f✝
hfg : f✝ = ↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) g✝
f g : α → F'
hf : Memℒp f 1
hg : Memℒp g 1
a✝ : Disjoint (Function.support f) (Function.support g)
hf_eq :
↑(condexpL1Clm F' hm μ) ↑(↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) (Memℒp.toLp f hf)) =
↑(↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) (Memℒp.toLp f hf))
hg_eq :
↑(condexpL1Clm F' hm μ) ↑(↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) (Memℒp.toLp g hg)) =
↑(↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) (Memℒp.toLp g hg))
⊢ ↑(condexpL1Clm F' hm μ)
(↑(↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) (Memℒp.toLp f hf)) +
↑(↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) (Memℒp.toLp g hg))) =
↑(↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) (Memℒp.toLp f hf)) +
↑(↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) (Memℒp.toLp g hg))
[PROOFSTEP]
rw [map_add, hf_eq, hg_eq]
[GOAL]
case refine'_3
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g✝ : α → F'
s : Set α
f : { x // x ∈ lpMeas F' ℝ m 1 μ }
g : { x // x ∈ Lp F' 1 } := ↑(lpMeasToLpTrimLie F' ℝ 1 μ hm) f
hfg : f = ↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) g
⊢ IsClosed
{f |
(fun g =>
↑(condexpL1Clm F' hm μ) ↑(↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) g) =
↑(↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) g))
f}
[PROOFSTEP]
refine' isClosed_eq _ _
[GOAL]
case refine'_3.refine'_1
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g✝ : α → F'
s : Set α
f : { x // x ∈ lpMeas F' ℝ m 1 μ }
g : { x // x ∈ Lp F' 1 } := ↑(lpMeasToLpTrimLie F' ℝ 1 μ hm) f
hfg : f = ↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) g
⊢ Continuous fun f => ↑(condexpL1Clm F' hm μ) ↑(↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) f)
[PROOFSTEP]
refine' (condexpL1Clm F' hm μ).continuous.comp (continuous_induced_dom.comp _)
[GOAL]
case refine'_3.refine'_1
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g✝ : α → F'
s : Set α
f : { x // x ∈ lpMeas F' ℝ m 1 μ }
g : { x // x ∈ Lp F' 1 } := ↑(lpMeasToLpTrimLie F' ℝ 1 μ hm) f
hfg : f = ↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) g
⊢ Continuous fun f => ↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) f
[PROOFSTEP]
exact LinearIsometryEquiv.continuous _
[GOAL]
case refine'_3.refine'_2
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g✝ : α → F'
s : Set α
f : { x // x ∈ lpMeas F' ℝ m 1 μ }
g : { x // x ∈ Lp F' 1 } := ↑(lpMeasToLpTrimLie F' ℝ 1 μ hm) f
hfg : f = ↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) g
⊢ Continuous fun f => ↑(↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) f)
[PROOFSTEP]
refine' continuous_induced_dom.comp _
[GOAL]
case refine'_3.refine'_2
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g✝ : α → F'
s : Set α
f : { x // x ∈ lpMeas F' ℝ m 1 μ }
g : { x // x ∈ Lp F' 1 } := ↑(lpMeasToLpTrimLie F' ℝ 1 μ hm) f
hfg : f = ↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) g
⊢ Continuous fun f => ↑(LinearIsometryEquiv.symm (lpMeasToLpTrimLie F' ℝ 1 μ hm)) f
[PROOFSTEP]
exact LinearIsometryEquiv.continuous _
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : α → F'
⊢ AEStronglyMeasurable' m (↑↑(condexpL1 hm μ f)) μ
[PROOFSTEP]
by_cases hf : Integrable f μ
[GOAL]
case pos
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : α → F'
hf : Integrable f
⊢ AEStronglyMeasurable' m (↑↑(condexpL1 hm μ f)) μ
[PROOFSTEP]
rw [condexpL1_eq hf]
[GOAL]
case pos
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : α → F'
hf : Integrable f
⊢ AEStronglyMeasurable' m (↑↑(↑(condexpL1Clm F' hm μ) (Integrable.toL1 f hf))) μ
[PROOFSTEP]
exact aestronglyMeasurable'_condexpL1Clm _
[GOAL]
case neg
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : α → F'
hf : ¬Integrable f
⊢ AEStronglyMeasurable' m (↑↑(condexpL1 hm μ f)) μ
[PROOFSTEP]
rw [condexpL1_undef hf]
[GOAL]
case neg
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : α → F'
hf : ¬Integrable f
⊢ AEStronglyMeasurable' m (↑↑0) μ
[PROOFSTEP]
refine AEStronglyMeasurable'.congr ?_ (coeFn_zero _ _ _).symm
[GOAL]
case neg
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
f : α → F'
hf : ¬Integrable f
⊢ AEStronglyMeasurable' m 0 μ
[PROOFSTEP]
exact StronglyMeasurable.aeStronglyMeasurable' (@stronglyMeasurable_zero _ _ m _ _)
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f g : α → F'
s : Set α
hf : Integrable f
hs : MeasurableSet s
⊢ ∫ (x : α) in s, ↑↑(condexpL1 hm μ f) x ∂μ = ∫ (x : α) in s, f x ∂μ
[PROOFSTEP]
simp_rw [condexpL1_eq hf]
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f g : α → F'
s : Set α
hf : Integrable f
hs : MeasurableSet s
⊢ ∫ (x : α) in s, ↑↑(↑(condexpL1Clm F' hm μ) (Integrable.toL1 f hf)) x ∂μ = ∫ (x : α) in s, f x ∂μ
[PROOFSTEP]
rw [set_integral_condexpL1Clm (hf.toL1 f) hs]
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f g : α → F'
s : Set α
hf : Integrable f
hs : MeasurableSet s
⊢ ∫ (x : α) in s, ↑↑(Integrable.toL1 f hf) x ∂μ = ∫ (x : α) in s, f x ∂μ
[PROOFSTEP]
exact set_integral_congr_ae (hm s hs) (hf.coeFn_toL1.mono fun x hx _ => hx)
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
c : 𝕜
f : α → F'
⊢ condexpL1 hm μ (c • f) = c • condexpL1 hm μ f
[PROOFSTEP]
refine' setToFun_smul _ _ c f
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f✝ g : α → F'
s : Set α
c : 𝕜
f : α → F'
⊢ ∀ (c : 𝕜) (s : Set α) (x : F'), ↑(condexpInd F' hm μ s) (c • x) = c • ↑(condexpInd F' hm μ s) x
[PROOFSTEP]
exact fun c _ x => condexpInd_smul' c x
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f g : α → F'
s : Set α
hfm : AEStronglyMeasurable' m f μ
hfi : Integrable f
⊢ ↑↑(condexpL1 hm μ f) =ᵐ[μ] f
[PROOFSTEP]
rw [condexpL1_eq hfi]
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f g : α → F'
s : Set α
hfm : AEStronglyMeasurable' m f μ
hfi : Integrable f
⊢ ↑↑(↑(condexpL1Clm F' hm μ) (Integrable.toL1 f hfi)) =ᵐ[μ] f
[PROOFSTEP]
refine' EventuallyEq.trans _ (Integrable.coeFn_toL1 hfi)
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f g : α → F'
s : Set α
hfm : AEStronglyMeasurable' m f μ
hfi : Integrable f
⊢ ↑↑(↑(condexpL1Clm F' hm μ) (Integrable.toL1 f hfi)) =ᵐ[μ] ↑↑(Integrable.toL1 f hfi)
[PROOFSTEP]
rw [condexpL1Clm_of_aestronglyMeasurable']
[GOAL]
case hfm
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹¹ : IsROrC 𝕜
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
inst✝⁸ : NormedAddCommGroup F'
inst✝⁷ : NormedSpace 𝕜 F'
inst✝⁶ : NormedSpace ℝ F'
inst✝⁵ : CompleteSpace F'
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace ℝ G'
inst✝¹ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f g : α → F'
s : Set α
hfm : AEStronglyMeasurable' m f μ
hfi : Integrable f
⊢ AEStronglyMeasurable' m (↑↑(Integrable.toL1 f hfi)) μ
[PROOFSTEP]
exact AEStronglyMeasurable'.congr hfm (Integrable.coeFn_toL1 hfi).symm
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹⁵ : IsROrC 𝕜
inst✝¹⁴ : NormedAddCommGroup F
inst✝¹³ : NormedSpace 𝕜 F
inst✝¹² : NormedAddCommGroup F'
inst✝¹¹ : NormedSpace 𝕜 F'
inst✝¹⁰ : NormedSpace ℝ F'
inst✝⁹ : CompleteSpace F'
inst✝⁸ : NormedAddCommGroup G
inst✝⁷ : NormedAddCommGroup G'
inst✝⁶ : NormedSpace ℝ G'
inst✝⁵ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝⁴ : SigmaFinite (Measure.trim μ hm)
f✝ g✝ : α → F'
s : Set α
E : Type u_8
inst✝³ : NormedLatticeAddCommGroup E
inst✝² : CompleteSpace E
inst✝¹ : NormedSpace ℝ E
inst✝ : OrderedSMul ℝ E
f g : α → E
hf : Integrable f
hg : Integrable g
hfg : f ≤ᵐ[μ] g
⊢ ↑↑(condexpL1 hm μ f) ≤ᵐ[μ] ↑↑(condexpL1 hm μ g)
[PROOFSTEP]
rw [coeFn_le]
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹⁵ : IsROrC 𝕜
inst✝¹⁴ : NormedAddCommGroup F
inst✝¹³ : NormedSpace 𝕜 F
inst✝¹² : NormedAddCommGroup F'
inst✝¹¹ : NormedSpace 𝕜 F'
inst✝¹⁰ : NormedSpace ℝ F'
inst✝⁹ : CompleteSpace F'
inst✝⁸ : NormedAddCommGroup G
inst✝⁷ : NormedAddCommGroup G'
inst✝⁶ : NormedSpace ℝ G'
inst✝⁵ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝⁴ : SigmaFinite (Measure.trim μ hm)
f✝ g✝ : α → F'
s : Set α
E : Type u_8
inst✝³ : NormedLatticeAddCommGroup E
inst✝² : CompleteSpace E
inst✝¹ : NormedSpace ℝ E
inst✝ : OrderedSMul ℝ E
f g : α → E
hf : Integrable f
hg : Integrable g
hfg : f ≤ᵐ[μ] g
⊢ condexpL1 hm μ f ≤ condexpL1 hm μ g
[PROOFSTEP]
have h_nonneg : ∀ s, MeasurableSet s → μ s < ∞ → ∀ x : E, 0 ≤ x → 0 ≤ condexpInd E hm μ s x := fun s hs hμs x hx =>
condexpInd_nonneg hs hμs.ne x hx
[GOAL]
α : Type u_1
β : Type u_2
F : Type u_3
F' : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹⁵ : IsROrC 𝕜
inst✝¹⁴ : NormedAddCommGroup F
inst✝¹³ : NormedSpace 𝕜 F
inst✝¹² : NormedAddCommGroup F'
inst✝¹¹ : NormedSpace 𝕜 F'
inst✝¹⁰ : NormedSpace ℝ F'
inst✝⁹ : CompleteSpace F'
inst✝⁸ : NormedAddCommGroup G
inst✝⁷ : NormedAddCommGroup G'
inst✝⁶ : NormedSpace ℝ G'
inst✝⁵ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
inst✝⁴ : SigmaFinite (Measure.trim μ hm)
f✝ g✝ : α → F'
s : Set α
E : Type u_8
inst✝³ : NormedLatticeAddCommGroup E
inst✝² : CompleteSpace E
inst✝¹ : NormedSpace ℝ E
inst✝ : OrderedSMul ℝ E
f g : α → E
hf : Integrable f
hg : Integrable g
hfg : f ≤ᵐ[μ] g
h_nonneg : ∀ (s : Set α), MeasurableSet s → ↑↑μ s < ⊤ → ∀ (x : E), 0 ≤ x → 0 ≤ ↑(condexpInd E hm μ s) x
⊢ condexpL1 hm μ f ≤ condexpL1 hm μ g
[PROOFSTEP]
exact setToFun_mono (dominatedFinMeasAdditive_condexpInd E hm μ) h_nonneg hf hg hfg
|
Address(Biscayne Bay Place) is a residential Culdesacs culdesac in West Davis that branches off from Marina Circle.
|
(* Title: HOL/Auth/n_german_lemma_inv__8_on_rules.thy
Author: Yongjian Li and Kaiqiang Duan, State Key Lab of Computer Science, Institute of Software, Chinese Academy of Sciences
Copyright 2016 State Key Lab of Computer Science, Institute of Software, Chinese Academy of Sciences
*)
header{*The n_german Protocol Case Study*}
theory n_german_lemma_inv__8_on_rules imports n_german_lemma_on_inv__8
begin
section{*All lemmas on causal relation between inv__8*}
lemma lemma_inv__8_on_rules:
assumes b1: "r \<in> rules N" and b2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__8 p__Inv2)"
shows "invHoldForRule s f r (invariants N)"
proof -
have c1: "(\<exists> i d. i\<le>N\<and>d\<le>N\<and>r=n_Store i d)\<or>
(\<exists> i. i\<le>N\<and>r=n_SendReqS i)\<or>
(\<exists> i. i\<le>N\<and>r=n_SendReqE__part__0 i)\<or>
(\<exists> i. i\<le>N\<and>r=n_SendReqE__part__1 i)\<or>
(\<exists> i. i\<le>N\<and>r=n_RecvReqS N i)\<or>
(\<exists> i. i\<le>N\<and>r=n_RecvReqE N i)\<or>
(\<exists> i. i\<le>N\<and>r=n_SendInv__part__0 i)\<or>
(\<exists> i. i\<le>N\<and>r=n_SendInv__part__1 i)\<or>
(\<exists> i. i\<le>N\<and>r=n_SendInvAck i)\<or>
(\<exists> i. i\<le>N\<and>r=n_RecvInvAck i)\<or>
(\<exists> i. i\<le>N\<and>r=n_SendGntS i)\<or>
(\<exists> i. i\<le>N\<and>r=n_SendGntE N i)\<or>
(\<exists> i. i\<le>N\<and>r=n_RecvGntS i)\<or>
(\<exists> i. i\<le>N\<and>r=n_RecvGntE i)"
apply (cut_tac b1, auto) done
moreover {
assume d1: "(\<exists> i d. i\<le>N\<and>d\<le>N\<and>r=n_Store i d)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_StoreVsinv__8) done
}
moreover {
assume d1: "(\<exists> i. i\<le>N\<and>r=n_SendReqS i)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_SendReqSVsinv__8) done
}
moreover {
assume d1: "(\<exists> i. i\<le>N\<and>r=n_SendReqE__part__0 i)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_SendReqE__part__0Vsinv__8) done
}
moreover {
assume d1: "(\<exists> i. i\<le>N\<and>r=n_SendReqE__part__1 i)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_SendReqE__part__1Vsinv__8) done
}
moreover {
assume d1: "(\<exists> i. i\<le>N\<and>r=n_RecvReqS N i)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_RecvReqSVsinv__8) done
}
moreover {
assume d1: "(\<exists> i. i\<le>N\<and>r=n_RecvReqE N i)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_RecvReqEVsinv__8) done
}
moreover {
assume d1: "(\<exists> i. i\<le>N\<and>r=n_SendInv__part__0 i)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_SendInv__part__0Vsinv__8) done
}
moreover {
assume d1: "(\<exists> i. i\<le>N\<and>r=n_SendInv__part__1 i)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_SendInv__part__1Vsinv__8) done
}
moreover {
assume d1: "(\<exists> i. i\<le>N\<and>r=n_SendInvAck i)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_SendInvAckVsinv__8) done
}
moreover {
assume d1: "(\<exists> i. i\<le>N\<and>r=n_RecvInvAck i)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_RecvInvAckVsinv__8) done
}
moreover {
assume d1: "(\<exists> i. i\<le>N\<and>r=n_SendGntS i)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_SendGntSVsinv__8) done
}
moreover {
assume d1: "(\<exists> i. i\<le>N\<and>r=n_SendGntE N i)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_SendGntEVsinv__8) done
}
moreover {
assume d1: "(\<exists> i. i\<le>N\<and>r=n_RecvGntS i)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_RecvGntSVsinv__8) done
}
moreover {
assume d1: "(\<exists> i. i\<le>N\<and>r=n_RecvGntE i)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_RecvGntEVsinv__8) done
}
ultimately show "invHoldForRule s f r (invariants N)"
by satx
qed
end
|
Formal statement is: lemma divide_poly_field: fixes f g :: "'a::field poly" defines "f' \<equiv> smult ((1 / coeff g (degree g)) ^ (Suc (degree f) - degree g)) f" shows "f div g = fst (pseudo_divmod f' g)" Informal statement is: The quotient of two polynomials is equal to the first component of the pseudo-division of the first polynomial by the second. |
State Before: α : Type u_2
β : Type ?u.276922
γ : Type ?u.276925
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal
ho : o ≠ 0
c : α
⊢ (brange o fun x x => c) = {c} State After: α : Type u_2
β : Type ?u.276922
γ : Type ?u.276925
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal
ho : o ≠ 0
c : α
⊢ range (familyOfBFamily o fun x x => c) = {c} Tactic: rw [← range_familyOfBFamily] State Before: α : Type u_2
β : Type ?u.276922
γ : Type ?u.276925
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal
ho : o ≠ 0
c : α
⊢ range (familyOfBFamily o fun x x => c) = {c} State After: no goals Tactic: exact @Set.range_const _ o.out.α (out_nonempty_iff_ne_zero.2 ho) c |
#' Pacote \code{curvacolina}
#'
#' Conjunto De Funcoes Para Processamento De Curvas Colina
#'
#' @docType package
#' @name curvacolina
#'
#' @useDynLib curvacolina, .registration = TRUE
#' @importFrom Rcpp sourceCpp
#'
#' @import stats
NULL |
from scipy import stats
array1 = []
array2 = []
lang = "javascript"
metric = "mrr"
fin = open("../MatchZoo_data/ttest/" + lang + "_" + metric + "_xue.txt", "r")
for line in fin:
array1.append(float(line.strip("\n")))
fin = open("../MatchZoo_data/ttest/" + lang + "_" + metric + "_drmm.txt", "r")
for line in fin:
array2.append(float(line.strip("\n")))
print stats.ttest_ind(array1, array2)
|
-- {-# OPTIONS -v tc.meta:20 #-}
module UnifyWithIrrelevantArgument where
data _≡_ {A : Set}(a : A) : A -> Set where
refl : a ≡ a
fail : (A : Set) ->
let X : .A -> A
X = _
in (x : A) -> X x ≡ x
fail A x = refl
-- error: X cannot depend on its first argument
|
header{* End Results in Locale-Free Form *}
theory Encodings
imports G T E
begin
text{* This section contains the outcome of our type-encoding results,
presented in a locale-free fashion. It is not very useful
from an Isabelle development point of view, where the locale theorems are fine.
Rather, this is aimed as a quasi-self-contained formal documentation of
the overall results for the non-Isabelle-experts. *}
subsection {* Soundness *}
text{* In the soundness theorems below, we employ the following Isabelle types:
\\- type variables (parameters):
\\--- @{text "'tp"}, of types
\\--- @{text "'fsym"}, of function symbols
\\--- @{text "'psym"}, of predicate symbols
%
\\- a fixed countable universe @{text "univ"} for the carrier of the models
%
\\
and various operators on these types:
(1) the constitutive parts of FOL signatures:
\\---- the boolean predicates
@{text "wtFsym"} and @{text "wtPsym"}, indicating the ``well-typed'' function and predicate
symbols; these are just means to select only subsets of these symbols
for consideration in the signature
\\---- the operators arOf and resOf, giving the arity and the result type
of function symbols
\\---- the operator parOf, giving the arity of predicate symbols
(2) the problem, @{text "\<Phi>"}, which is a set of clauses over the considered signature
(3) a partition of the types in:
\\--- @{text "tpD"}, the types that should be decorated in any case
\\--- @{text "tpFD"}, the types that should be decorated in a featherweight fashion
\\--- for guards only, a further refinement of @{text "tpD"}, indicating, as @{text "tpCD"},
the types that should be classically (i.e., traditionally) decorated
(these partitionings are meant to provide a uniform treatment of the
three styles of encodings:
traditional, lightweight and featherweight)
(4) the constitutive parts of a structure over the considered signature:
\\---- @{text "intT"}, the interpretation of each type as a unary predicate (essentially, a set)
over an arbitrary type 'univ
\\---- @{text "intF"} and @{text "intP"}, the interpretations of the function and predicate symbols
as actual functions and predicates over @{text "univ"}.
*}
text{* \ \\ \bf Soundness of the tag encodings: \ \\ *}
text{* The assumptions of the tag soundness theorems are the following:
(a) @{text "ProblemIkTpart wtFsym wtPsym arOf resOf parOf \<Phi> infTp tpD tpFD"},
stating that:
\\--- @{text "(wtFsym, wtPsym, arOf, resOf, parOf)"} form a countable signature
\\--- @{text "\<Phi>"} is a well-typed problem over this signature
\\--- @{text "infTp"} is an indication of the types that the problem guarantees as infinite
in all models
\\--- @{text "tpD"} and @{text "tpFD"} are disjoint and all types that are not
marked as @{text "tpD"} or @{text "tpFD"}
are deemed safe by the monotonicity calculus from @{text "Mcalc"}
(b) @{text "CM.Model wtFsym wtPsym arOf resOf parOf \<Phi> intT intF intP"}
says that @{text "(intT, intF, intP)"} is a model for @{text "\<Phi>"} (hence @{text "\<Phi>"} is satisfiable)
The conclusion says that we obtain a model of the untyped version of the problem
(after suitable tags and axioms have been added): *}
text{* Because of the assumptions on tpD and tpFD, we have the following particular cases
of our parameterized tag encoding:
\\-- if @{text "tpD"} is taked to be everywhere true (hence @{text "tpFD"} becomes everywhere false), we
obtain the traditional tag encoding
\\-- if @{text "tpD"} is taken to be true precisely when the monotonicity calculus fails,
we obtain the lightweight tag encoding
\\-- if @{text "tpFD"} is taken to be true precisely when the monotonicity calculus fails,
we obtain the featherweight tag encoding
*}
theorem tags_soundness:
fixes wtFsym :: "'fsym \<Rightarrow> bool" and wtPsym :: "'psym \<Rightarrow> bool"
and arOf :: "'fsym \<Rightarrow> 'tp list" and resOf :: "'fsym \<Rightarrow> 'tp" and parOf :: "'psym \<Rightarrow> 'tp list"
and \<Phi> :: "('fsym, 'psym) prob" and infTp :: "'tp \<Rightarrow> bool"
and tpD :: "'tp \<Rightarrow> bool" and tpFD :: "'tp \<Rightarrow> bool"
and intT :: "'tp \<Rightarrow> univ \<Rightarrow> bool"
and intF :: "'fsym \<Rightarrow> univ list \<Rightarrow> univ" and intP :: "'psym \<Rightarrow> univ list \<Rightarrow> bool"
-- {* The problem translation: *}
-- {* First the addition of tags (``TE'' stands for ``tag encoding''): *}
defines "TE_wtFsym \<equiv> ProblemIkTpart.TE_wtFsym wtFsym resOf"
and "TE_arOf \<equiv> ProblemIkTpart.TE_arOf arOf"
and "TE_resOf \<equiv> ProblemIkTpart.TE_resOf resOf"
defines "TE_\<Phi> \<equiv> ProblemIkTpart.tPB wtFsym arOf resOf \<Phi> tpD tpFD"
-- {* Then the deletion of types (``U'' stands for ``untyped''): *}
and "U_arOf \<equiv> length \<circ> TE_arOf"
and "U_parOf \<equiv> length \<circ> parOf"
defines "U_\<Phi> \<equiv> TE_\<Phi>"
-- {* The forward model translation: *}
-- {* First, using monotonicity, we build an infinite model of @{text"\<Phi>"}
(``I'' stands for ``infinite''): *}
defines "intTI \<equiv> MonotProblem.intTI TE_wtFsym wtPsym TE_arOf TE_resOf parOf TE_\<Phi>"
and "intFI \<equiv> MonotProblem.intFI TE_wtFsym wtPsym TE_arOf TE_resOf parOf TE_\<Phi>"
and "intPI \<equiv> MonotProblem.intPI TE_wtFsym wtPsym TE_arOf TE_resOf parOf TE_\<Phi>"
-- {* Then, by isomorphic transfer of the lattter model, we build a model of @{text"\<Phi>"}
that has all types interpeted as @{text "univ"} (``F'' stands for ``full"): *}
defines "intFF \<equiv> InfModel.intFF TE_arOf TE_resOf intTI intFI"
and "intPF \<equiv> InfModel.intPF parOf intTI intPI"
-- {* Then we build a model of @{text "U_\<Phi>"}: *}
defines "U_intT \<equiv> InfModel.intTF (any::'tp)"
-- {* Assumptions of the theorem: *}
assumes
P: "ProblemIkTpart wtFsym wtPsym arOf resOf parOf \<Phi> infTp tpD tpFD"
and M: "CM.Model wtFsym wtPsym arOf resOf parOf \<Phi> intT intF intP"
-- {* Conclusion of the theorem: *}
shows "CU.Model TE_wtFsym wtPsym U_arOf U_parOf U_\<Phi> U_intT intFF intPF"
unfolding U_arOf_def U_parOf_def U_\<Phi>_def
unfolding U_intT_def intTI_def intFI_def intPI_def intFF_def intPF_def
apply(rule M_MonotModel.M_U_soundness)
unfolding M_MonotModel_def MonotModel_def apply safe
unfolding TE_wtFsym_def TE_arOf_def TE_resOf_def TE_\<Phi>_def
apply(rule ProblemIkTpart.T_monotonic)
apply(rule P)
apply(rule ModelIkTpart.T_soundness) unfolding ModelIkTpart_def apply safe
apply(rule P)
apply(rule M)
done
text{* \ \\ \bf Soundness of the guard encodings: \ \\ *}
text{* Here the assumptions and conclusion have a similar shapes as those
for the tag encodings. The difference is in the first assumption,
@{text "ProblemIkTpartG wtFsym wtPsym arOf resOf parOf \<Phi> infTp tpD tpFD tpCD"},
which consists of @{text "ProblemIkTpart wtFsym wtPsym arOf resOf parOf \<Phi> infTp tpD tpFD"} together
with the following assumptions about @{text "tpCD"}:
\\-- @{text "tpCD"} is included in @{text "tpD"}
\\-- if a result type of an operation symbol is in @{text "tpD"}, then so are all the types in its arity
*}
text{* We have the following particular cases of our parameterized guard encoding:
\\-- if @{text "tpD"} and @{text "tpCD"} are taked to be everywhere true
(hence @{text "tpFD"} becomes everywhere false),
we obtain the traditional guard encoding
\\-- if @{text "tpCD"} is taken to be false and @{text "tpD"} is taken to be true precisely when the
monotonicity calculus fails,
we obtain the lightweight tag encoding
\\-- if @{text "tpFD"} is taken to be true precisely when the monotonicity calculus fails,
we obtain the featherweight tag encoding
*}
theorem guards_soundness:
fixes wtFsym :: "'fsym \<Rightarrow> bool" and wtPsym :: "'psym \<Rightarrow> bool"
and arOf :: "'fsym \<Rightarrow> 'tp list" and resOf :: "'fsym \<Rightarrow> 'tp" and parOf :: "'psym \<Rightarrow> 'tp list"
and \<Phi> :: "('fsym, 'psym) prob" and infTp :: "'tp \<Rightarrow> bool"
and tpD :: "'tp \<Rightarrow> bool" and tpFD :: "'tp \<Rightarrow> bool" and tpCD :: "'tp \<Rightarrow> bool"
and intT :: "'tp \<Rightarrow> univ \<Rightarrow> bool"
and intF :: "'fsym \<Rightarrow> univ list \<Rightarrow> univ"
and intP :: "'psym \<Rightarrow> univ list \<Rightarrow> bool"
-- {* The problem translation: *}
defines "GE_wtFsym \<equiv> ProblemIkTpartG.GE_wtFsym wtFsym resOf tpCD"
and "GE_wtPsym \<equiv> ProblemIkTpartG.GE_wtPsym wtPsym tpD tpFD"
and "GE_arOf \<equiv> ProblemIkTpartG.GE_arOf arOf"
and "GE_resOf \<equiv> ProblemIkTpartG.GE_resOf resOf"
and "GE_parOf \<equiv> ProblemIkTpartG.GE_parOf parOf"
defines "GE_\<Phi> \<equiv> ProblemIkTpartG.gPB wtFsym arOf resOf \<Phi> tpD tpFD tpCD"
and "U_arOf \<equiv> length \<circ> GE_arOf"
and "U_parOf \<equiv> length \<circ> GE_parOf"
defines "U_\<Phi> \<equiv> GE_\<Phi>"
-- {* The model forward translation: *}
defines "intTI \<equiv> MonotProblem.intTI GE_wtFsym GE_wtPsym GE_arOf GE_resOf GE_parOf GE_\<Phi>"
and "intFI \<equiv> MonotProblem.intFI GE_wtFsym GE_wtPsym GE_arOf GE_resOf GE_parOf GE_\<Phi>"
and "intPI \<equiv> MonotProblem.intPI GE_wtFsym GE_wtPsym GE_arOf GE_resOf GE_parOf GE_\<Phi>"
defines "intFF \<equiv> InfModel.intFF GE_arOf GE_resOf intTI intFI"
and "intPF \<equiv> InfModel.intPF GE_parOf intTI intPI"
defines "U_intT \<equiv> InfModel.intTF (any::'tp)"
assumes
P: "ProblemIkTpartG wtFsym wtPsym arOf resOf parOf \<Phi> infTp tpD tpFD tpCD"
and M: "CM.Model wtFsym wtPsym arOf resOf parOf \<Phi> intT intF intP"
shows "CU.Model GE_wtFsym GE_wtPsym U_arOf U_parOf U_\<Phi> U_intT intFF intPF"
unfolding U_arOf_def U_parOf_def U_\<Phi>_def
unfolding U_intT_def intTI_def intFI_def intPI_def intFF_def intPF_def
apply(rule M_MonotModel.M_U_soundness)
unfolding M_MonotModel_def MonotModel_def apply safe
unfolding GE_wtFsym_def GE_wtPsym_def GE_arOf_def GE_resOf_def GE_parOf_def GE_\<Phi>_def
apply(rule ProblemIkTpartG.G_monotonic)
apply(rule P)
apply(rule ModelIkTpartG.G_soundness)
unfolding ModelIkTpartG_def ModelIkTpart_def apply safe
apply(rule P)
using P unfolding ProblemIkTpartG_def apply fastforce
apply(rule M)
done
subsection {* Completeness *}
text{* The setting is similar to the one for completeness, except for the following point:
(3) The constitutive parts of a structure over the untyped signature
resulted from the addition of the tags or guards followed by
the deletion of the types: @{text "(D, eintF, eintP)"}
*}
text{* \ \\ \bf Completeness of the tag encodings \ \\ *}
theorem tags_completeness:
fixes wtFsym :: "'fsym \<Rightarrow> bool" and wtPsym :: "'psym \<Rightarrow> bool"
and arOf :: "'fsym \<Rightarrow> 'tp list" and resOf :: "'fsym \<Rightarrow> 'tp" and parOf :: "'psym \<Rightarrow> 'tp list"
and \<Phi> :: "('fsym, 'psym) prob" and infTp :: "'tp \<Rightarrow> bool"
and tpD :: "'tp \<Rightarrow> bool" and tpFD :: "'tp \<Rightarrow> bool"
and D :: "univ \<Rightarrow> bool"
and eintF :: "('fsym,'tp) T.efsym \<Rightarrow> univ list \<Rightarrow> univ"
and eintP :: "'psym \<Rightarrow> univ list \<Rightarrow> bool"
-- {* The problem translation (the same as in the case of soundness): *}
defines "TE_wtFsym \<equiv> ProblemIkTpart.TE_wtFsym wtFsym resOf"
and "TE_arOf \<equiv> ProblemIkTpart.TE_arOf arOf"
and "TE_resOf \<equiv> ProblemIkTpart.TE_resOf resOf"
defines "TE_\<Phi> \<equiv> ProblemIkTpart.tPB wtFsym arOf resOf \<Phi> tpD tpFD"
and "U_arOf \<equiv> length \<circ> TE_arOf"
and "U_parOf \<equiv> length \<circ> parOf"
defines "U_\<Phi> \<equiv> TE_\<Phi>"
-- {* The backward model translation: *}
defines "intT \<equiv> ProblemIkTpart_TEModel.intT tpD tpFD (\<lambda>\<sigma>::'tp. D) eintF"
and "intF \<equiv> ProblemIkTpart_TEModel.intF arOf resOf tpD tpFD (\<lambda>\<sigma>::'tp. D) eintF"
and "intP \<equiv> ProblemIkTpart_TEModel.intP parOf tpD tpFD (\<lambda>\<sigma>::'tp. D) eintF eintP"
assumes
P: "ProblemIkTpart wtFsym wtPsym arOf resOf parOf \<Phi> infTp tpD tpFD" and
M: "CU.Model TE_wtFsym wtPsym (length o TE_arOf)
(length o parOf) TE_\<Phi> D eintF eintP"
shows "CM.Model wtFsym wtPsym arOf resOf parOf \<Phi> intT intF intP"
proof-
have UM: "UM_Model TE_wtFsym wtPsym TE_arOf TE_resOf parOf TE_\<Phi> D eintF eintP"
unfolding UM_Model_def UM_Struct_def
using M unfolding CU.Model_def CU.Struct_def U.Model_def
using ProblemIkTpart.T_monotonic[OF P,
unfolded TE_wtFsym_def[symmetric] TE_arOf_def[symmetric]
TE_resOf_def[symmetric] TE_\<Phi>_def[symmetric]]
by (auto simp: MonotProblem_def M_Problem_def M_Signature_def M.Problem_def)
show ?thesis
unfolding intT_def intF_def intP_def
apply(rule ProblemIkTpart_TEModel.T_completeness)
unfolding ProblemIkTpart_TEModel_def apply safe
apply(rule P)
apply(rule UM_Model.M_U_completeness)
apply(rule UM[unfolded TE_wtFsym_def TE_arOf_def TE_resOf_def TE_\<Phi>_def])
done
qed
text{* \ \\ \bf Completeness of the guard encodings \ \\ *}
theorem guards_completeness:
fixes wtFsym :: "'fsym \<Rightarrow> bool" and wtPsym :: "'psym \<Rightarrow> bool"
and arOf :: "'fsym \<Rightarrow> 'tp list" and resOf :: "'fsym \<Rightarrow> 'tp" and parOf :: "'psym \<Rightarrow> 'tp list"
and \<Phi> :: "('fsym, 'psym) prob" and infTp :: "'tp \<Rightarrow> bool"
and tpD :: "'tp \<Rightarrow> bool" and tpFD :: "'tp \<Rightarrow> bool" and tpCD :: "'tp \<Rightarrow> bool"
and D :: "univ \<Rightarrow> bool"
and eintF :: "('fsym,'tp) G.efsym \<Rightarrow> univ list \<Rightarrow> univ"
and eintP :: "('psym,'tp) G.epsym \<Rightarrow> univ list \<Rightarrow> bool"
-- {* The problem translation (the same as in the case of soundness): *}
defines "GE_wtFsym \<equiv> ProblemIkTpartG.GE_wtFsym wtFsym resOf tpCD"
and "GE_wtPsym \<equiv> ProblemIkTpartG.GE_wtPsym wtPsym tpD tpFD"
and "GE_arOf \<equiv> ProblemIkTpartG.GE_arOf arOf"
and "GE_resOf \<equiv> ProblemIkTpartG.GE_resOf resOf"
and "GE_parOf \<equiv> ProblemIkTpartG.GE_parOf parOf"
defines "GE_\<Phi> \<equiv> ProblemIkTpartG.gPB wtFsym arOf resOf \<Phi> tpD tpFD tpCD"
and "U_arOf \<equiv> length \<circ> GE_arOf"
and "U_parOf \<equiv> length \<circ> GE_parOf"
defines "U_\<Phi> \<equiv> GE_\<Phi>"
-- {* The backward model translation: *}
defines "intT \<equiv> ProblemIkTpartG_GEModel.intT tpD tpFD (\<lambda>\<sigma>::'tp. D) eintP"
and "intF \<equiv> ProblemIkTpartG_GEModel.intF eintF"
and "intP \<equiv> ProblemIkTpartG_GEModel.intP eintP"
assumes
P: "ProblemIkTpartG wtFsym wtPsym arOf resOf parOf \<Phi> infTp tpD tpFD tpCD" and
M: "CU.Model GE_wtFsym GE_wtPsym (length o GE_arOf)
(length o GE_parOf) GE_\<Phi> D eintF eintP"
shows "CM.Model wtFsym wtPsym arOf resOf parOf \<Phi> intT intF intP"
proof-
have UM: "UM_Model GE_wtFsym GE_wtPsym GE_arOf GE_resOf GE_parOf GE_\<Phi> D eintF eintP"
unfolding UM_Model_def UM_Struct_def
using M unfolding CU.Model_def CU.Struct_def U.Model_def
using ProblemIkTpartG.G_monotonic[OF P,
unfolded GE_wtFsym_def[symmetric] GE_arOf_def[symmetric]
GE_wtPsym_def[symmetric] GE_parOf_def[symmetric]
GE_resOf_def[symmetric] GE_\<Phi>_def[symmetric]]
by (auto simp: MonotProblem_def M_Problem_def M_Signature_def M.Problem_def)
show ?thesis
unfolding intT_def intF_def intP_def
apply(rule ProblemIkTpartG_GEModel.G_completeness)
unfolding ProblemIkTpartG_GEModel_def apply safe
apply(rule P)
apply(rule UM_Model.M_U_completeness)
apply(rule UM[unfolded GE_wtFsym_def GE_wtPsym_def GE_parOf_def
GE_arOf_def GE_resOf_def GE_\<Phi>_def])
done
qed
end
|
section "Stack Machine and Compilation"
theory ASM
imports AExp
begin
subsection "Stack Machine"
datatype instr = LOADI val | LOAD vname | ADD
type_synonym stack = "val list"
fun exec1 :: "instr \<Rightarrow> state \<Rightarrow> stack \<Rightarrow> stack" where
"exec1 (LOADI n) _ stk = n # stk" |
"exec1 (LOAD x) s stk = s(x) # stk" |
"exec1 ADD _ (j#i#stk) = (i + j) # stk"
fun exec :: "instr list \<Rightarrow> state \<Rightarrow> stack \<Rightarrow> stack" where
"exec [] _ stk = stk" |
"exec (i#is) s stk = exec is s (exec1 i s stk)"
value "exec [LOADI 5, LOAD ''y'', ADD] <''x'' := 42, ''y'' := 43> [50]"
lemma exec_append[simp]:
"exec (is1 @ is2) s stk = exec is2 s (exec is1 s stk)"
apply(induction is1 arbitrary: stk)
apply (auto)
done
subsection "Compilation"
fun comp :: "aexp \<Rightarrow> instr list" where
"comp (N n) = [LOADI n]" |
"comp (V x) = [LOAD x]" |
"comp (Plus e\<^sub>1 e\<^sub>2) = comp e\<^sub>1 @ comp e\<^sub>2 @ [ADD]"
value "comp (Plus (Plus (V ''x'') (N 1)) (V ''z''))"
theorem exec_comp: "exec (comp a) s stk = aval a s # stk"
apply(induction a arbitrary: stk)
apply (auto)
done
end
|
using FMMLIB2D
using Test
@testset "Laplace FMM 2D" begin
include("laplace.jl")
end
@testset "Helmholtz FMM 2D" begin
include("helmholtz.jl")
end
@testset "Complex FMM 2D" begin
include("complex.jl")
end
|
(*
Copyright (C) 2017 M.A.L. Marques
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
*)
(* type: gga_exc *)
(* prefix:
gga_x_sogga11_params *params;
assert(p->params != NULL);
params = (gga_x_sogga11_params * )(p->params);
*)
sogga11_alpha := params_a_mu*X2S*X2S/params_a_kappa:
sogga11_f0 := x -> 1 - 1/(1 + sogga11_alpha*x^2):
sogga11_f1 := x -> 1 - exp(-sogga11_alpha*x^2):
sogga11_f := x -> add(params_a_a[i]*sogga11_f0(x)^(i-1), i=1..6) + add(params_a_b[i]*sogga11_f1(x)^(i-1), i=1..6):
f := (rs, zeta, xt, xs0, xs1) -> gga_exchange(sogga11_f, rs, zeta, xs0, xs1):
|
a <= not '0';
B <= not '1';
c <= d and '0';
Z <= '0' and f;
g <= h and '1';
i <= '1' and j;
k <= l or '0';
m <= '0' or n;
o <= p or '1';
q <= '1' or r;
s <= t and t;
u <= v or v;
w <= x or not x;
y <= z or (z and a);
b <= (c and d) or c;
e <= f and (f or g);
h <= (i or j) and j;
|
(* Title: ZF/Resid/Redex.thy
Author: Ole Rasmussen, University of Cambridge
*)
theory Redex imports Main begin
consts
redexes :: i
datatype
"redexes" = Var ("n \<in> nat")
| Fun ("t \<in> redexes")
| App ("b \<in> bool","f \<in> redexes", "a \<in> redexes")
consts
Ssub :: "i"
Scomp :: "i"
Sreg :: "i"
abbreviation
Ssub_rel (infixl "\<Longleftarrow>" 70) where
"a \<Longleftarrow> b == <a,b> \<in> Ssub"
abbreviation
Scomp_rel (infixl "\<sim>" 70) where
"a \<sim> b == <a,b> \<in> Scomp"
abbreviation
"regular(a) == a \<in> Sreg"
consts union_aux :: "i=>i"
primrec (*explicit lambda is required because both arguments of "\<squnion>" vary*)
"union_aux(Var(n)) =
(\<lambda>t \<in> redexes. redexes_case(%j. Var(n), %x. 0, %b x y.0, t))"
"union_aux(Fun(u)) =
(\<lambda>t \<in> redexes. redexes_case(%j. 0, %y. Fun(union_aux(u)`y),
%b y z. 0, t))"
"union_aux(App(b,f,a)) =
(\<lambda>t \<in> redexes.
redexes_case(%j. 0, %y. 0,
%c z u. App(b or c, union_aux(f)`z, union_aux(a)`u), t))"
definition
union (infixl "\<squnion>" 70) where
"u \<squnion> v == union_aux(u)`v"
inductive
domains "Ssub" \<subseteq> "redexes*redexes"
intros
Sub_Var: "n \<in> nat ==> Var(n) \<Longleftarrow> Var(n)"
Sub_Fun: "[|u \<Longleftarrow> v|]==> Fun(u) \<Longleftarrow> Fun(v)"
Sub_App1: "[|u1 \<Longleftarrow> v1; u2 \<Longleftarrow> v2; b \<in> bool|]==>
App(0,u1,u2) \<Longleftarrow> App(b,v1,v2)"
Sub_App2: "[|u1 \<Longleftarrow> v1; u2 \<Longleftarrow> v2|]==> App(1,u1,u2) \<Longleftarrow> App(1,v1,v2)"
type_intros redexes.intros bool_typechecks
inductive
domains "Scomp" \<subseteq> "redexes*redexes"
intros
Comp_Var: "n \<in> nat ==> Var(n) \<sim> Var(n)"
Comp_Fun: "[|u \<sim> v|]==> Fun(u) \<sim> Fun(v)"
Comp_App: "[|u1 \<sim> v1; u2 \<sim> v2; b1 \<in> bool; b2 \<in> bool|]
==> App(b1,u1,u2) \<sim> App(b2,v1,v2)"
type_intros redexes.intros bool_typechecks
inductive
domains "Sreg" \<subseteq> redexes
intros
Reg_Var: "n \<in> nat ==> regular(Var(n))"
Reg_Fun: "[|regular(u)|]==> regular(Fun(u))"
Reg_App1: "[|regular(Fun(u)); regular(v) |]==>regular(App(1,Fun(u),v))"
Reg_App2: "[|regular(u); regular(v) |]==>regular(App(0,u,v))"
type_intros redexes.intros bool_typechecks
declare redexes.intros [simp]
(* ------------------------------------------------------------------------- *)
(* Specialisation of comp-rules *)
(* ------------------------------------------------------------------------- *)
lemmas compD1 [simp] = Scomp.dom_subset [THEN subsetD, THEN SigmaD1]
lemmas compD2 [simp] = Scomp.dom_subset [THEN subsetD, THEN SigmaD2]
lemmas regD [simp] = Sreg.dom_subset [THEN subsetD]
(* ------------------------------------------------------------------------- *)
(* Equality rules for union *)
(* ------------------------------------------------------------------------- *)
lemma union_Var [simp]: "n \<in> nat ==> Var(n) \<squnion> Var(n)=Var(n)"
by (simp add: union_def)
lemma union_Fun [simp]: "v \<in> redexes ==> Fun(u) \<squnion> Fun(v) = Fun(u \<squnion> v)"
by (simp add: union_def)
lemma union_App [simp]:
"[|b2 \<in> bool; u2 \<in> redexes; v2 \<in> redexes|]
==> App(b1,u1,v1) \<squnion> App(b2,u2,v2)=App(b1 or b2,u1 \<squnion> u2,v1 \<squnion> v2)"
by (simp add: union_def)
lemma or_1_right [simp]: "a or 1 = 1"
by (simp add: or_def cond_def)
lemma or_0_right [simp]: "a \<in> bool \<Longrightarrow> a or 0 = a"
by (simp add: or_def cond_def bool_def, auto)
declare Ssub.intros [simp]
declare bool_typechecks [simp]
declare Sreg.intros [simp]
declare Scomp.intros [simp]
declare Scomp.intros [intro]
inductive_cases [elim!]:
"regular(App(b,f,a))"
"regular(Fun(b))"
"regular(Var(b))"
"Fun(u) \<sim> Fun(t)"
"u \<sim> Fun(t)"
"u \<sim> Var(n)"
"u \<sim> App(b,t,a)"
"Fun(t) \<sim> v"
"App(b,f,a) \<sim> v"
"Var(n) \<sim> u"
(* ------------------------------------------------------------------------- *)
(* comp proofs *)
(* ------------------------------------------------------------------------- *)
lemma comp_refl [simp]: "u \<in> redexes ==> u \<sim> u"
by (erule redexes.induct, blast+)
lemma comp_sym: "u \<sim> v ==> v \<sim> u"
by (erule Scomp.induct, blast+)
lemma comp_sym_iff: "u \<sim> v \<longleftrightarrow> v \<sim> u"
by (blast intro: comp_sym)
lemma comp_trans [rule_format]: "u \<sim> v ==> \<forall>w. v \<sim> w\<longrightarrow>u \<sim> w"
by (erule Scomp.induct, blast+)
(* ------------------------------------------------------------------------- *)
(* union proofs *)
(* ------------------------------------------------------------------------- *)
lemma union_l: "u \<sim> v \<Longrightarrow> u \<Longleftarrow> (u \<squnion> v)"
apply (erule Scomp.induct)
apply (erule_tac [3] boolE, simp_all)
done
lemma union_r: "u \<sim> v \<Longrightarrow> v \<Longleftarrow> (u \<squnion> v)"
apply (erule Scomp.induct)
apply (erule_tac [3] c = b2 in boolE, simp_all)
done
lemma union_sym: "u \<sim> v \<Longrightarrow> u \<squnion> v = v \<squnion> u"
by (erule Scomp.induct, simp_all add: or_commute)
(* ------------------------------------------------------------------------- *)
(* regular proofs *)
(* ------------------------------------------------------------------------- *)
lemma union_preserve_regular [rule_format]:
"u \<sim> v \<Longrightarrow> regular(u) \<longrightarrow> regular(v) \<longrightarrow> regular(u \<squnion> v)"
by (erule Scomp.induct, auto)
end
|
[STATEMENT]
lemma evaluate_dec_prelude:
"evaluate_dec t [] env empty_state cake_dt_prelude (empty_state_with_types, Rval empty_sem_env)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. evaluate_dec t [] env empty_state cake_dt_prelude (empty_state_with_types, Rval empty_sem_env)
[PROOF STEP]
unfolding cake_dt_prelude_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. evaluate_dec t [] env empty_state (Dtype empty_locs as_cake_type_def) (empty_state_with_types, Rval empty_sem_env)
[PROOF STEP]
proof (rule evaluate_type, intro conjI)
[PROOF STATE]
proof (state)
goal (4 subgoals):
1. check_dup_ctors as_cake_type_def
2. cake_all_types = type_defs_to_new_tdecs [] as_cake_type_def
3. disjnt cake_all_types (defined_types empty_state)
4. allDistinct (map (\<lambda>x. case x of (tvs, tn, ctors) \<Rightarrow> tn) as_cake_type_def)
[PROOF STEP]
show "check_dup_ctors as_cake_type_def"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. check_dup_ctors as_cake_type_def
[PROOF STEP]
using distinct_ctr'
[PROOF STATE]
proof (prove)
using this:
distinct (map as_string all_constructors)
goal (1 subgoal):
1. check_dup_ctors as_cake_type_def
[PROOF STEP]
unfolding check_dup_ctors_alt_def List.bind_def as_cake_type_def_def all_constructors_def
[PROOF STATE]
proof (prove)
using this:
distinct (map as_string (concat (map (\<lambda>(uu_, Cs). map fst (sorted_list_of_fmap (constructors Cs))) (sorted_list_of_fmap C_info))))
goal (1 subgoal):
1. distinct (concat (map (\<lambda>(_, uu_, y). map fst y) (map (\<lambda>(name, dt_def). (map as_string (tparams dt_def), as_string name, map (\<lambda>(C, params). (as_string C, map typ_to_t params)) (sorted_list_of_fmap (constructors dt_def)))) (sorted_list_of_fmap C_info))))
[PROOF STEP]
by (auto simp: comp_def split_beta map_concat)
[PROOF STATE]
proof (state)
this:
check_dup_ctors as_cake_type_def
goal (3 subgoals):
1. cake_all_types = type_defs_to_new_tdecs [] as_cake_type_def
2. disjnt cake_all_types (defined_types empty_state)
3. allDistinct (map (\<lambda>x. case x of (tvs, tn, ctors) \<Rightarrow> tn) as_cake_type_def)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
1. cake_all_types = type_defs_to_new_tdecs [] as_cake_type_def
2. disjnt cake_all_types (defined_types empty_state)
3. allDistinct (map (\<lambda>x. case x of (tvs, tn, ctors) \<Rightarrow> tn) as_cake_type_def)
[PROOF STEP]
show "allDistinct (map (\<lambda>x. case x of (tvs, tn, ctors) \<Rightarrow> tn) as_cake_type_def)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. allDistinct (map (\<lambda>x. case x of (tvs, tn, ctors) \<Rightarrow> tn) as_cake_type_def)
[PROOF STEP]
unfolding all_distinct_alt_def as_cake_type_def_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. distinct (map (\<lambda>x. case x of (tvs, tn, ctors) \<Rightarrow> tn) (map (\<lambda>(name, dt_def). (map as_string (tparams dt_def), as_string name, map (\<lambda>(C, params). (as_string C, map typ_to_t params)) (sorted_list_of_fmap (constructors dt_def)))) (sorted_list_of_fmap C_info)))
[PROOF STEP]
apply (auto simp: comp_def case_prod_twice)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. distinct (map (\<lambda>x. case x of (name, dt_def) \<Rightarrow> as_string name) (sorted_list_of_fmap C_info))
[PROOF STEP]
apply (rule name_as_string.fst_distinct)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. distinct (map fst (sorted_list_of_fmap C_info))
[PROOF STEP]
unfolding sorted_list_of_fmap_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. distinct (map fst (map (\<lambda>k. (k, option.the (fmlookup C_info k))) (sorted_list_of_fset (fmdom C_info))))
[PROOF STEP]
by (auto simp: comp_def)
[PROOF STATE]
proof (state)
this:
allDistinct (map (\<lambda>x. case x of (tvs, tn, ctors) \<Rightarrow> tn) as_cake_type_def)
goal (2 subgoals):
1. cake_all_types = type_defs_to_new_tdecs [] as_cake_type_def
2. disjnt cake_all_types (defined_types empty_state)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
1. cake_all_types = type_defs_to_new_tdecs [] as_cake_type_def
2. disjnt cake_all_types (defined_types empty_state)
[PROOF STEP]
show "cake_all_types = type_defs_to_new_tdecs [] as_cake_type_def"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. cake_all_types = type_defs_to_new_tdecs [] as_cake_type_def
[PROOF STEP]
unfolding cake_all_types_def type_defs_to_new_tdecs all_tdefs_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (TypeId \<circ> Short \<circ> as_string) ` fset (fmdom C_info) = set (map (\<lambda>name. TypeId (Short (as_string name))) (sorted_list_of_fset (fmdom C_info)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cake_all_types = type_defs_to_new_tdecs [] as_cake_type_def
goal (1 subgoal):
1. disjnt cake_all_types (defined_types empty_state)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. disjnt cake_all_types (defined_types empty_state)
[PROOF STEP]
show "disjnt cake_all_types (defined_types empty_state)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. disjnt cake_all_types (defined_types empty_state)
[PROOF STEP]
unfolding empty_state_def disjnt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. cake_all_types \<inter> defined_types (make_state 0 [] empty_ffi_state {} {}) = {}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
disjnt cake_all_types (defined_types empty_state)
goal:
No subgoals!
[PROOF STEP]
qed |
module Minecraft.Base.PreClassic.Air.Export
import public Minecraft.Base.PreClassic.Air.Block.Export
%default total
|
section \<open>Framework Graph Lifting for Noninterference\<close>
theory LiftingIntra
imports NonInterferenceIntra Slicing.CDepInstantiations
begin
text \<open>In this section, we show how a valid CFG from the slicing framework in
\<^cite>\<open>"Wasserrab:08"\<close> can be lifted to fulfil all properties of the
\<open>NonInterferenceIntraGraph\<close> locale. Basically, we redefine the
hitherto existing \<open>Entry\<close> and \<open>Exit\<close> nodes as new
\<open>High\<close> and \<open>Low\<close> nodes, and introduce two new nodes
\<open>NewEntry\<close> and \<open>NewExit\<close>. Then, we have to lift all functions
to operate on this new graph.\<close>
subsection \<open>Liftings\<close>
subsubsection \<open>The datatypes\<close>
datatype 'node LDCFG_node = Node 'node
| NewEntry
| NewExit
type_synonym ('edge,'node,'state) LDCFG_edge =
"'node LDCFG_node \<times> ('state edge_kind) \<times> 'node LDCFG_node"
subsubsection \<open>Lifting @{term valid_edge}\<close>
inductive lift_valid_edge :: "('edge \<Rightarrow> bool) \<Rightarrow> ('edge \<Rightarrow> 'node) \<Rightarrow> ('edge \<Rightarrow> 'node) \<Rightarrow>
('edge \<Rightarrow> 'state edge_kind) \<Rightarrow> 'node \<Rightarrow> 'node \<Rightarrow> ('edge,'node,'state) LDCFG_edge \<Rightarrow>
bool"
for valid_edge::"'edge \<Rightarrow> bool" and src::"'edge \<Rightarrow> 'node" and trg::"'edge \<Rightarrow> 'node"
and knd::"'edge \<Rightarrow> 'state edge_kind" and E::'node and X::'node
where lve_edge:
"\<lbrakk>valid_edge a; src a \<noteq> E \<or> trg a \<noteq> X;
e = (Node (src a),knd a,Node (trg a))\<rbrakk>
\<Longrightarrow> lift_valid_edge valid_edge src trg knd E X e"
| lve_Entry_edge:
"e = (NewEntry,(\<lambda>s. True)\<^sub>\<surd>,Node E)
\<Longrightarrow> lift_valid_edge valid_edge src trg knd E X e"
| lve_Exit_edge:
"e = (Node X,(\<lambda>s. True)\<^sub>\<surd>,NewExit)
\<Longrightarrow> lift_valid_edge valid_edge src trg knd E X e"
| lve_Entry_Exit_edge:
"e = (NewEntry,(\<lambda>s. False)\<^sub>\<surd>,NewExit)
\<Longrightarrow> lift_valid_edge valid_edge src trg knd E X e"
subsubsection \<open>Lifting @{term Def} and @{term Use} sets\<close>
inductive_set lift_Def_set :: "('node \<Rightarrow> 'var set) \<Rightarrow> 'node \<Rightarrow> 'node \<Rightarrow>
'var set \<Rightarrow> 'var set \<Rightarrow> ('node LDCFG_node \<times> 'var) set"
for Def::"('node \<Rightarrow> 'var set)" and E::'node and X::'node
and H::"'var set" and L::"'var set"
where lift_Def_node:
"V \<in> Def n \<Longrightarrow> (Node n,V) \<in> lift_Def_set Def E X H L"
| lift_Def_High:
"V \<in> H \<Longrightarrow> (Node E,V) \<in> lift_Def_set Def E X H L"
abbreviation lift_Def :: "('node \<Rightarrow> 'var set) \<Rightarrow> 'node \<Rightarrow> 'node \<Rightarrow>
'var set \<Rightarrow> 'var set \<Rightarrow> 'node LDCFG_node \<Rightarrow> 'var set"
where "lift_Def Def E X H L n \<equiv> {V. (n,V) \<in> lift_Def_set Def E X H L}"
inductive_set lift_Use_set :: "('node \<Rightarrow> 'var set) \<Rightarrow> 'node \<Rightarrow> 'node \<Rightarrow>
'var set \<Rightarrow> 'var set \<Rightarrow> ('node LDCFG_node \<times> 'var) set"
for Use::"'node \<Rightarrow> 'var set" and E::'node and X::'node
and H::"'var set" and L::"'var set"
where
lift_Use_node:
"V \<in> Use n \<Longrightarrow> (Node n,V) \<in> lift_Use_set Use E X H L"
| lift_Use_High:
"V \<in> H \<Longrightarrow> (Node E,V) \<in> lift_Use_set Use E X H L"
| lift_Use_Low:
"V \<in> L \<Longrightarrow> (Node X,V) \<in> lift_Use_set Use E X H L"
abbreviation lift_Use :: "('node \<Rightarrow> 'var set) \<Rightarrow> 'node \<Rightarrow> 'node \<Rightarrow>
'var set \<Rightarrow> 'var set \<Rightarrow> 'node LDCFG_node \<Rightarrow> 'var set"
where "lift_Use Use E X H L n \<equiv> {V. (n,V) \<in> lift_Use_set Use E X H L}"
subsection \<open>The lifting lemmas\<close>
subsubsection \<open>Lifting the basic locales\<close>
abbreviation src :: "('edge,'node,'state) LDCFG_edge \<Rightarrow> 'node LDCFG_node"
where "src a \<equiv> fst a"
abbreviation trg :: "('edge,'node,'state) LDCFG_edge \<Rightarrow> 'node LDCFG_node"
where "trg a \<equiv> snd(snd a)"
definition knd :: "('edge,'node,'state) LDCFG_edge \<Rightarrow> 'state edge_kind"
where "knd a \<equiv> fst(snd a)"
lemma lift_CFG:
assumes wf:"CFGExit_wf sourcenode targetnode kind valid_edge Entry Def Use
state_val Exit"
shows "CFG src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit) NewEntry"
proof -
interpret CFGExit_wf sourcenode targetnode kind valid_edge Entry Def Use
state_val Exit
by(rule wf)
show ?thesis
proof
fix a assume "lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit a"
and "trg a = NewEntry"
thus False by(fastforce elim:lift_valid_edge.cases)
next
fix a a'
assume "lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit a"
and "lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit a'"
and "src a = src a'" and "trg a = trg a'"
thus "a = a'"
proof(induct rule:lift_valid_edge.induct)
case lve_edge thus ?case by -(erule lift_valid_edge.cases,auto dest:edge_det)
qed(auto elim:lift_valid_edge.cases)
qed
qed
lemma lift_CFG_wf:
assumes wf:"CFGExit_wf sourcenode targetnode kind valid_edge Entry Def Use
state_val Exit"
shows "CFG_wf src trg knd
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit) NewEntry
(lift_Def Def Entry Exit H L) (lift_Use Use Entry Exit H L) state_val"
proof -
interpret CFGExit_wf sourcenode targetnode kind valid_edge Entry Def Use
state_val Exit
by(rule wf)
interpret CFG:CFG src trg knd
"lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit" NewEntry
by(fastforce intro:lift_CFG wf)
show ?thesis
proof
show "lift_Def Def Entry Exit H L NewEntry = {} \<and>
lift_Use Use Entry Exit H L NewEntry = {}"
by(fastforce elim:lift_Use_set.cases lift_Def_set.cases)
next
fix a V s
assume "lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit a"
and "V \<notin> lift_Def Def Entry Exit H L (src a)" and "pred (knd a) s"
thus "state_val (transfer (knd a) s) V = state_val s V"
proof(induct rule:lift_valid_edge.induct)
case lve_edge
thus ?case by(fastforce intro:CFG_edge_no_Def_equal dest:lift_Def_node[of _ Def]
simp:knd_def)
qed(auto simp:knd_def)
next
fix a s s'
assume assms:"lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit a"
"\<forall>V\<in>lift_Use Use Entry Exit H L (src a). state_val s V = state_val s' V"
"pred (knd a) s" "pred (knd a) s'"
show "\<forall>V\<in>lift_Def Def Entry Exit H L (src a).
state_val (transfer (knd a) s) V = state_val (transfer (knd a) s') V"
proof
fix V assume "V \<in> lift_Def Def Entry Exit H L (src a)"
with assms
show "state_val (transfer (knd a) s) V = state_val (transfer (knd a) s') V"
proof(induct rule:lift_valid_edge.induct)
case (lve_edge a e)
show ?case
proof (cases "Node (sourcenode a) = Node Entry")
case True
hence "sourcenode a = Entry" by simp
from Entry_Exit_edge obtain a' where "valid_edge a'"
and "sourcenode a' = Entry" and "targetnode a' = Exit"
and "kind a' = (\<lambda>s. False)\<^sub>\<surd>" by blast
have "\<exists>Q. kind a = (Q)\<^sub>\<surd>"
proof(cases "targetnode a = Exit")
case True
with \<open>valid_edge a\<close> \<open>valid_edge a'\<close> \<open>sourcenode a = Entry\<close>
\<open>sourcenode a' = Entry\<close> \<open>targetnode a' = Exit\<close>
have "a = a'" by(fastforce dest:edge_det)
with \<open>kind a' = (\<lambda>s. False)\<^sub>\<surd>\<close> show ?thesis by simp
next
case False
with \<open>valid_edge a\<close> \<open>valid_edge a'\<close> \<open>sourcenode a = Entry\<close>
\<open>sourcenode a' = Entry\<close> \<open>targetnode a' = Exit\<close>
show ?thesis by(auto dest:deterministic)
qed
from True \<open>V \<in> lift_Def Def Entry Exit H L (src e)\<close> Entry_empty
\<open>e = (Node (sourcenode a), kind a, Node (targetnode a))\<close>
have "V \<in> H" by(fastforce elim:lift_Def_set.cases)
from True \<open>e = (Node (sourcenode a), kind a, Node (targetnode a))\<close>
\<open>sourcenode a \<noteq> Entry \<or> targetnode a \<noteq> Exit\<close>
have "\<forall>V\<in>H. V \<in> lift_Use Use Entry Exit H L (src e)"
by(fastforce intro:lift_Use_High)
with \<open>\<forall>V\<in>lift_Use Use Entry Exit H L (src e).
state_val s V = state_val s' V\<close> \<open>V \<in> H\<close>
have "state_val s V = state_val s' V" by simp
with \<open>e = (Node (sourcenode a), kind a, Node (targetnode a))\<close>
\<open>\<exists>Q. kind a = (Q)\<^sub>\<surd>\<close>
show ?thesis by(fastforce simp:knd_def)
next
case False
{ fix V' assume "V' \<in> Use (sourcenode a)"
with \<open>e = (Node (sourcenode a), kind a, Node (targetnode a))\<close>
have "V' \<in> lift_Use Use Entry Exit H L (src e)"
by(fastforce intro:lift_Use_node)
}
with \<open>\<forall>V\<in>lift_Use Use Entry Exit H L (src e).
state_val s V = state_val s' V\<close>
have "\<forall>V\<in>Use (sourcenode a). state_val s V = state_val s' V"
by fastforce
from \<open>valid_edge a\<close> this \<open>pred (knd e) s\<close> \<open>pred (knd e) s'\<close>
\<open>e = (Node (sourcenode a), kind a, Node (targetnode a))\<close>
have "\<forall>V \<in> Def (sourcenode a). state_val (transfer (kind a) s) V =
state_val (transfer (kind a) s') V"
by -(erule CFG_edge_transfer_uses_only_Use,auto simp:knd_def)
from \<open>V \<in> lift_Def Def Entry Exit H L (src e)\<close> False
\<open>e = (Node (sourcenode a), kind a, Node (targetnode a))\<close>
have "V \<in> Def (sourcenode a)" by(fastforce elim:lift_Def_set.cases)
with \<open>\<forall>V \<in> Def (sourcenode a). state_val (transfer (kind a) s) V =
state_val (transfer (kind a) s') V\<close>
\<open>e = (Node (sourcenode a), kind a, Node (targetnode a))\<close>
show ?thesis by(simp add:knd_def)
qed
next
case (lve_Entry_edge e)
from \<open>V \<in> lift_Def Def Entry Exit H L (src e)\<close>
\<open>e = (NewEntry, (\<lambda>s. True)\<^sub>\<surd>, Node Entry)\<close>
have False by(fastforce elim:lift_Def_set.cases)
thus ?case by simp
next
case (lve_Exit_edge e)
from \<open>V \<in> lift_Def Def Entry Exit H L (src e)\<close>
\<open>e = (Node Exit, (\<lambda>s. True)\<^sub>\<surd>, NewExit)\<close>
have False
by(fastforce elim:lift_Def_set.cases intro!:Entry_noteq_Exit simp:Exit_empty)
thus ?case by simp
qed(simp add:knd_def)
qed
next
fix a s s'
assume "lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit a"
and "pred (knd a) s"
and "\<forall>V\<in>lift_Use Use Entry Exit H L (src a). state_val s V = state_val s' V"
thus "pred (knd a) s'"
by(induct rule:lift_valid_edge.induct,
auto elim!:CFG_edge_Uses_pred_equal dest:lift_Use_node simp:knd_def)
next
fix a a'
assume "lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit a"
and "lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit a'"
and "src a = src a'" and "trg a \<noteq> trg a'"
thus "\<exists>Q Q'. knd a = (Q)\<^sub>\<surd> \<and> knd a' = (Q')\<^sub>\<surd> \<and>
(\<forall>s. (Q s \<longrightarrow> \<not> Q' s) \<and> (Q' s \<longrightarrow> \<not> Q s))"
proof(induct rule:lift_valid_edge.induct)
case (lve_edge a e)
from \<open>lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit a'\<close>
\<open>valid_edge a\<close> \<open>e = (Node (sourcenode a), kind a, Node (targetnode a))\<close>
\<open>src e = src a'\<close> \<open>trg e \<noteq> trg a'\<close>
show ?case
proof(induct rule:lift_valid_edge.induct)
case lve_edge thus ?case by(auto dest:deterministic simp:knd_def)
next
case (lve_Exit_edge e')
from \<open>e = (Node (sourcenode a), kind a, Node (targetnode a))\<close>
\<open>e' = (Node Exit, (\<lambda>s. True)\<^sub>\<surd>, NewExit)\<close> \<open>src e = src e'\<close>
have "sourcenode a = Exit" by simp
with \<open>valid_edge a\<close> have False by(rule Exit_source)
thus ?case by simp
qed auto
qed (fastforce elim:lift_valid_edge.cases simp:knd_def)+
qed
qed
lemma lift_CFGExit:
assumes wf:"CFGExit_wf sourcenode targetnode kind valid_edge Entry Def Use
state_val Exit"
shows "CFGExit src trg knd
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
NewEntry NewExit"
proof -
interpret CFGExit_wf sourcenode targetnode kind valid_edge Entry Def Use
state_val Exit
by(rule wf)
interpret CFG:CFG src trg knd
"lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit" NewEntry
by(fastforce intro:lift_CFG wf)
show ?thesis
proof
fix a assume "lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit a"
and "src a = NewExit"
thus False by(fastforce elim:lift_valid_edge.cases)
next
from lve_Entry_Exit_edge
show "\<exists>a. lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit a \<and>
src a = NewEntry \<and> trg a = NewExit \<and> knd a = (\<lambda>s. False)\<^sub>\<surd>"
by(fastforce simp:knd_def)
qed
qed
lemma lift_CFGExit_wf:
assumes wf:"CFGExit_wf sourcenode targetnode kind valid_edge Entry Def Use
state_val Exit"
shows "CFGExit_wf src trg knd
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit) NewEntry
(lift_Def Def Entry Exit H L) (lift_Use Use Entry Exit H L) state_val NewExit"
proof -
interpret CFGExit_wf sourcenode targetnode kind valid_edge Entry Def Use
state_val Exit
by(rule wf)
interpret CFGExit:CFGExit src trg knd
"lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit"
NewEntry NewExit
by(fastforce intro:lift_CFGExit wf)
interpret CFG_wf:CFG_wf src trg knd
"lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit"
NewEntry "lift_Def Def Entry Exit H L" "lift_Use Use Entry Exit H L" state_val
by(fastforce intro:lift_CFG_wf wf)
show ?thesis
proof
show "lift_Def Def Entry Exit H L NewExit = {} \<and>
lift_Use Use Entry Exit H L NewExit = {}"
by(fastforce elim:lift_Use_set.cases lift_Def_set.cases)
qed
qed
subsubsection \<open>Lifting @{term wod_backward_slice}\<close>
lemma lift_wod_backward_slice:
fixes valid_edge and sourcenode and targetnode and kind and Entry and Exit
and Def and Use and H and L
defines lve:"lve \<equiv> lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit"
and lDef:"lDef \<equiv> lift_Def Def Entry Exit H L"
and lUse:"lUse \<equiv> lift_Use Use Entry Exit H L"
assumes wf:"CFGExit_wf sourcenode targetnode kind valid_edge Entry Def Use
state_val Exit"
and "H \<inter> L = {}" and "H \<union> L = UNIV"
shows "NonInterferenceIntraGraph src trg knd lve NewEntry lDef lUse state_val
(CFG_wf.wod_backward_slice src trg lve lDef lUse)
NewExit H L (Node Entry) (Node Exit)"
proof -
interpret CFGExit_wf sourcenode targetnode kind valid_edge Entry Def Use
state_val Exit
by(rule wf)
interpret CFGExit_wf:
CFGExit_wf src trg knd lve NewEntry lDef lUse state_val NewExit
by(fastforce intro:lift_CFGExit_wf wf simp:lve lDef lUse)
from wf lve have CFG:"CFG src trg lve NewEntry"
by(fastforce intro:lift_CFG)
from wf lve lDef lUse have CFG_wf:"CFG_wf src trg knd lve NewEntry
lDef lUse state_val"
by(fastforce intro:lift_CFG_wf)
show ?thesis
proof
fix n S
assume "n \<in> CFG_wf.wod_backward_slice src trg lve lDef lUse S"
with CFG_wf show "CFG.valid_node src trg lve n"
by -(rule CFG_wf.wod_backward_slice_valid_node)
next
fix n S assume "CFG.valid_node src trg lve n" and "n \<in> S"
with CFG_wf show "n \<in> CFG_wf.wod_backward_slice src trg lve lDef lUse S"
by -(rule CFG_wf.refl)
next
fix n' S n V
assume "n' \<in> CFG_wf.wod_backward_slice src trg lve lDef lUse S"
and "CFG_wf.data_dependence src trg lve lDef lUse n V n'"
with CFG_wf show "n \<in> CFG_wf.wod_backward_slice src trg lve lDef lUse S"
by -(rule CFG_wf.dd_closed)
next
fix n S
from CFG_wf
have "(\<exists>m. (CFG.obs src trg lve n
(CFG_wf.wod_backward_slice src trg lve lDef lUse S)) = {m}) \<or>
CFG.obs src trg lve n (CFG_wf.wod_backward_slice src trg lve lDef lUse S) = {}"
by(rule CFG_wf.obs_singleton)
thus "finite
(CFG.obs src trg lve n (CFG_wf.wod_backward_slice src trg lve lDef lUse S))"
by fastforce
next
fix n S
from CFG_wf
have "(\<exists>m. (CFG.obs src trg lve n
(CFG_wf.wod_backward_slice src trg lve lDef lUse S)) = {m}) \<or>
CFG.obs src trg lve n (CFG_wf.wod_backward_slice src trg lve lDef lUse S) = {}"
by(rule CFG_wf.obs_singleton)
thus "card (CFG.obs src trg lve n
(CFG_wf.wod_backward_slice src trg lve lDef lUse S)) \<le> 1"
by fastforce
next
fix a assume "lve a" and "src a = NewEntry"
with lve show "trg a = NewExit \<or> trg a = Node Entry"
by(fastforce elim:lift_valid_edge.cases)
next
from lve_Entry_edge lve
show "\<exists>a. lve a \<and> src a = NewEntry \<and> trg a = Node Entry \<and> knd a = (\<lambda>s. True)\<^sub>\<surd>"
by(fastforce simp:knd_def)
next
fix a assume "lve a" and "trg a = Node Entry"
with lve show "src a = NewEntry" by(fastforce elim:lift_valid_edge.cases)
next
fix a assume "lve a" and "trg a = NewExit"
with lve show "src a = NewEntry \<or> src a = Node Exit"
by(fastforce elim:lift_valid_edge.cases)
next
from lve_Exit_edge lve
show "\<exists>a. lve a \<and> src a = Node Exit \<and> trg a = NewExit \<and> knd a = (\<lambda>s. True)\<^sub>\<surd>"
by(fastforce simp:knd_def)
next
fix a assume "lve a" and "src a = Node Exit"
with lve show "trg a = NewExit" by(fastforce elim:lift_valid_edge.cases)
next
from lDef show "lDef (Node Entry) = H"
by(fastforce elim:lift_Def_set.cases intro:lift_Def_High)
next
from Entry_noteq_Exit lUse show "lUse (Node Entry) = H"
by(fastforce elim:lift_Use_set.cases intro:lift_Use_High)
next
from Entry_noteq_Exit lUse show "lUse (Node Exit) = L"
by(fastforce elim:lift_Use_set.cases intro:lift_Use_Low)
next
from \<open>H \<inter> L = {}\<close> show "H \<inter> L = {}" .
next
from \<open>H \<union> L = UNIV\<close> show "H \<union> L = UNIV" .
qed
qed
subsubsection \<open>Lifting \<open>PDG_BS\<close> with \<open>standard_control_dependence\<close>\<close>
lemma lift_Postdomination:
assumes wf:"CFGExit_wf sourcenode targetnode kind valid_edge Entry Def Use
state_val Exit"
and pd:"Postdomination sourcenode targetnode kind valid_edge Entry Exit"
and inner:"CFGExit.inner_node sourcenode targetnode valid_edge Entry Exit nx"
shows "Postdomination src trg knd
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit) NewEntry NewExit"
proof -
interpret Postdomination sourcenode targetnode kind valid_edge Entry Exit
by(rule pd)
interpret CFGExit_wf:CFGExit_wf src trg knd
"lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit" NewEntry
"lift_Def Def Entry Exit H L" "lift_Use Use Entry Exit H L" state_val NewExit
by(fastforce intro:lift_CFGExit_wf wf)
from wf have CFG:"CFG src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit) NewEntry"
by(rule lift_CFG)
show ?thesis
proof
fix n assume "CFG.valid_node src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit) n"
show "\<exists>as. CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
NewEntry as n"
proof(cases n)
case NewEntry
have "lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit
(NewEntry,(\<lambda>s. False)\<^sub>\<surd>,NewExit)" by(fastforce intro:lve_Entry_Exit_edge)
with NewEntry have "CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
NewEntry [] n"
by(fastforce intro:CFG.empty_path[OF CFG] simp:CFG.valid_node_def[OF CFG])
thus ?thesis by blast
next
case NewExit
have "lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit
(NewEntry,(\<lambda>s. False)\<^sub>\<surd>,NewExit)" by(fastforce intro:lve_Entry_Exit_edge)
with NewExit have "CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
NewEntry [(NewEntry,(\<lambda>s. False)\<^sub>\<surd>,NewExit)] n"
by(fastforce intro:CFG.Cons_path[OF CFG] CFG.empty_path[OF CFG]
simp:CFG.valid_node_def[OF CFG])
thus ?thesis by blast
next
case (Node m)
with Entry_Exit_edge \<open>CFG.valid_node src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit) n\<close>
have "valid_node m"
by(auto elim:lift_valid_edge.cases
simp:CFG.valid_node_def[OF CFG] valid_node_def)
thus ?thesis
proof(cases m rule:valid_node_cases)
case Entry
have "lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit
(NewEntry,(\<lambda>s. True)\<^sub>\<surd>,Node Entry)" by(fastforce intro:lve_Entry_edge)
with Entry Node have "CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
NewEntry [(NewEntry,(\<lambda>s. True)\<^sub>\<surd>,Node Entry)] n"
by(fastforce intro:CFG.Cons_path[OF CFG] CFG.empty_path[OF CFG]
simp:CFG.valid_node_def[OF CFG])
thus ?thesis by blast
next
case Exit
from inner obtain ax where "valid_edge ax" and "inner_node (sourcenode ax)"
and "targetnode ax = Exit" by(erule inner_node_Exit_edge)
hence "lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit
(Node (sourcenode ax),kind ax,Node Exit)"
by(auto intro:lift_valid_edge.lve_edge simp:inner_node_def)
hence path:"CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
(Node (sourcenode ax)) [(Node (sourcenode ax),kind ax,Node Exit)]
(Node Exit)"
by(fastforce intro:CFG.Cons_path[OF CFG] CFG.empty_path[OF CFG]
simp:CFG.valid_node_def[OF CFG])
have edge:"lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit
(NewEntry,(\<lambda>s. True)\<^sub>\<surd>,Node Entry)" by(fastforce intro:lve_Entry_edge)
from \<open>inner_node (sourcenode ax)\<close> have "valid_node (sourcenode ax)"
by(rule inner_is_valid)
then obtain asx where "Entry -asx\<rightarrow>* sourcenode ax"
by(fastforce dest:Entry_path)
from this \<open>valid_edge ax\<close> have "\<exists>es. CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
(Node Entry) es (Node (sourcenode ax))"
proof(induct asx arbitrary:ax rule:rev_induct)
case Nil
from \<open>Entry -[]\<rightarrow>* sourcenode ax\<close> have "sourcenode ax = Entry" by fastforce
hence "CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
(Node Entry) [] (Node (sourcenode ax))"
apply simp apply(rule CFG.empty_path[OF CFG])
by(auto intro:lve_Entry_edge simp:CFG.valid_node_def[OF CFG])
thus ?case by blast
next
case (snoc x xs)
note IH = \<open>\<And>ax. \<lbrakk>Entry -xs\<rightarrow>* sourcenode ax; valid_edge ax\<rbrakk> \<Longrightarrow>
\<exists>es. CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
(Node Entry) es (Node (sourcenode ax))\<close>
from \<open>Entry -xs@[x]\<rightarrow>* sourcenode ax\<close>
have "Entry -xs\<rightarrow>* sourcenode x" and "valid_edge x"
and "targetnode x = sourcenode ax" by(auto elim:path_split_snoc)
{ assume "targetnode x = Exit"
with \<open>valid_edge ax\<close> \<open>targetnode x = sourcenode ax\<close>
have False by -(rule Exit_source,simp+) }
hence "targetnode x \<noteq> Exit" by clarsimp
with \<open>valid_edge x\<close> \<open>targetnode x = sourcenode ax\<close>[THEN sym]
have "lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit
(Node (sourcenode x),kind x,Node (sourcenode ax))"
by(fastforce intro:lift_valid_edge.lve_edge)
hence path:"CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
(Node (sourcenode x)) [(Node (sourcenode x),kind x,Node (sourcenode ax))]
(Node (sourcenode ax))"
by(fastforce intro:CFG.Cons_path[OF CFG] CFG.empty_path[OF CFG]
simp:CFG.valid_node_def[OF CFG])
from IH[OF \<open>Entry -xs\<rightarrow>* sourcenode x\<close> \<open>valid_edge x\<close>] obtain es
where "CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
(Node Entry) es (Node (sourcenode x))" by blast
with path have "CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
(Node Entry) (es@[(Node (sourcenode x),kind x,Node (sourcenode ax))])
(Node (sourcenode ax))"
by -(rule CFG.path_Append[OF CFG])
thus ?case by blast
qed
then obtain es where "CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
(Node Entry) es (Node (sourcenode ax))" by blast
with path have "CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
(Node Entry) (es@ [(Node (sourcenode ax),kind ax,Node Exit)]) (Node Exit)"
by -(rule CFG.path_Append[OF CFG])
with edge have "CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
NewEntry ((NewEntry,(\<lambda>s. True)\<^sub>\<surd>,Node Entry)#
(es@ [(Node (sourcenode ax),kind ax,Node Exit)])) (Node Exit)"
by(fastforce intro:CFG.Cons_path[OF CFG])
with Node Exit show ?thesis by fastforce
next
case inner
from \<open>valid_node m\<close> obtain as where "Entry -as\<rightarrow>* m"
by(fastforce dest:Entry_path)
with inner have "\<exists>es. CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
(Node Entry) es (Node m)"
proof(induct arbitrary:m rule:rev_induct)
case Nil
from \<open>Entry -[]\<rightarrow>* m\<close>
have "m = Entry" by fastforce
with lve_Entry_edge have "CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
(Node Entry) [] (Node m)"
by(fastforce intro:CFG.empty_path[OF CFG] simp:CFG.valid_node_def[OF CFG])
thus ?case by blast
next
case (snoc x xs)
note IH = \<open>\<And>m. \<lbrakk>inner_node m; Entry -xs\<rightarrow>* m\<rbrakk>
\<Longrightarrow> \<exists>es. CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
(Node Entry) es (Node m)\<close>
from \<open>Entry -xs@[x]\<rightarrow>* m\<close> have "Entry -xs\<rightarrow>* sourcenode x"
and "valid_edge x" and "m = targetnode x" by(auto elim:path_split_snoc)
with \<open>inner_node m\<close>
have edge:"lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit
(Node (sourcenode x),kind x,Node m)"
by(fastforce intro:lve_edge simp:inner_node_def)
hence path:"CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
(Node (sourcenode x)) [(Node (sourcenode x),kind x,Node m)] (Node m)"
by(fastforce intro:CFG.Cons_path[OF CFG] CFG.empty_path[OF CFG]
simp:CFG.valid_node_def[OF CFG])
from \<open>valid_edge x\<close> have "valid_node (sourcenode x)" by simp
thus ?case
proof(cases "sourcenode x" rule:valid_node_cases)
case Entry
with edge have "CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
(Node Entry) [(Node Entry,kind x,Node m)] (Node m)"
apply - apply(rule CFG.Cons_path[OF CFG])
apply(rule CFG.empty_path[OF CFG])
by(auto simp:CFG.valid_node_def[OF CFG])
thus ?thesis by blast
next
case Exit
with \<open>valid_edge x\<close> have False by(rule Exit_source)
thus ?thesis by simp
next
case inner
from IH[OF this \<open>Entry -xs\<rightarrow>* sourcenode x\<close>] obtain es
where "CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
(Node Entry) es (Node (sourcenode x))" by blast
with path have "CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
(Node Entry) (es@[(Node (sourcenode x),kind x,Node m)]) (Node m)"
by -(rule CFG.path_Append[OF CFG])
thus ?thesis by blast
qed
qed
then obtain es where path:"CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
(Node Entry) es (Node m)" by blast
have "lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit
(NewEntry,(\<lambda>s. True)\<^sub>\<surd>,Node Entry)" by(fastforce intro:lve_Entry_edge)
from this path Node have "CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
NewEntry ((NewEntry,(\<lambda>s. True)\<^sub>\<surd>,Node Entry)#es) n"
by(fastforce intro:CFG.Cons_path[OF CFG])
thus ?thesis by blast
qed
qed
next
fix n assume "CFG.valid_node src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit) n"
show "\<exists>as. CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
n as NewExit"
proof(cases n)
case NewEntry
have "lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit
(NewEntry,(\<lambda>s. False)\<^sub>\<surd>,NewExit)" by(fastforce intro:lve_Entry_Exit_edge)
with NewEntry have "CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
n [(NewEntry,(\<lambda>s. False)\<^sub>\<surd>,NewExit)] NewExit"
by(fastforce intro:CFG.Cons_path[OF CFG] CFG.empty_path[OF CFG]
simp:CFG.valid_node_def[OF CFG])
thus ?thesis by blast
next
case NewExit
have "lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit
(NewEntry,(\<lambda>s. False)\<^sub>\<surd>,NewExit)" by(fastforce intro:lve_Entry_Exit_edge)
with NewExit have "CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
n [] NewExit"
by(fastforce intro:CFG.empty_path[OF CFG] simp:CFG.valid_node_def[OF CFG])
thus ?thesis by blast
next
case (Node m)
with Entry_Exit_edge \<open>CFG.valid_node src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit) n\<close>
have "valid_node m"
by(auto elim:lift_valid_edge.cases
simp:CFG.valid_node_def[OF CFG] valid_node_def)
thus ?thesis
proof(cases m rule:valid_node_cases)
case Entry
from inner obtain ax where "valid_edge ax" and "inner_node (targetnode ax)"
and "sourcenode ax = Entry" by(erule inner_node_Entry_edge)
hence edge:"lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit
(Node Entry,kind ax,Node (targetnode ax))"
by(auto intro:lift_valid_edge.lve_edge simp:inner_node_def)
have "lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit
(Node Exit,(\<lambda>s. True)\<^sub>\<surd>,NewExit)" by(fastforce intro:lve_Exit_edge)
hence path:"CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
(Node Exit) [(Node Exit,(\<lambda>s. True)\<^sub>\<surd>,NewExit)] (NewExit)"
by(fastforce intro:CFG.Cons_path[OF CFG] CFG.empty_path[OF CFG]
simp:CFG.valid_node_def[OF CFG])
from \<open>inner_node (targetnode ax)\<close> have "valid_node (targetnode ax)"
by(rule inner_is_valid)
then obtain asx where "targetnode ax -asx\<rightarrow>* Exit" by(fastforce dest:Exit_path)
from this \<open>valid_edge ax\<close> have "\<exists>es. CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
(Node (targetnode ax)) es (Node Exit)"
proof(induct asx arbitrary:ax)
case Nil
from \<open>targetnode ax -[]\<rightarrow>* Exit\<close> have "targetnode ax = Exit" by fastforce
hence "CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
(Node (targetnode ax)) [] (Node Exit)"
apply simp apply(rule CFG.empty_path[OF CFG])
by(auto intro:lve_Exit_edge simp:CFG.valid_node_def[OF CFG])
thus ?case by blast
next
case (Cons x xs)
note IH = \<open>\<And>ax. \<lbrakk>targetnode ax -xs\<rightarrow>* Exit; valid_edge ax\<rbrakk> \<Longrightarrow>
\<exists>es. CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
(Node (targetnode ax)) es (Node Exit)\<close>
from \<open>targetnode ax -x#xs\<rightarrow>* Exit\<close>
have "targetnode x -xs\<rightarrow>* Exit" and "valid_edge x"
and "sourcenode x = targetnode ax" by(auto elim:path_split_Cons)
{ assume "sourcenode x = Entry"
with \<open>valid_edge ax\<close> \<open>sourcenode x = targetnode ax\<close>
have False by -(rule Entry_target,simp+) }
hence "sourcenode x \<noteq> Entry" by clarsimp
with \<open>valid_edge x\<close> \<open>sourcenode x = targetnode ax\<close>[THEN sym]
have edge:"lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit
(Node (targetnode ax),kind x,Node (targetnode x))"
by(fastforce intro:lift_valid_edge.lve_edge)
from IH[OF \<open>targetnode x -xs\<rightarrow>* Exit\<close> \<open>valid_edge x\<close>] obtain es
where "CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
(Node (targetnode x)) es (Node Exit)" by blast
with edge have "CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
(Node (targetnode ax))
((Node (targetnode ax),kind x,Node (targetnode x))#es) (Node Exit)"
by(fastforce intro:CFG.Cons_path[OF CFG])
thus ?case by blast
qed
then obtain es where "CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
(Node (targetnode ax)) es (Node Exit)" by blast
with edge have "CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
(Node Entry) ((Node Entry, kind ax, Node (targetnode ax))#es) (Node Exit)"
by(fastforce intro:CFG.Cons_path[OF CFG])
with path have "CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
(Node Entry) (((Node Entry,kind ax,Node (targetnode ax))#es)@
[(Node Exit, (\<lambda>s. True)\<^sub>\<surd>, NewExit)]) NewExit"
by -(rule CFG.path_Append[OF CFG])
with Node Entry show ?thesis by fastforce
next
case Exit
have "lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit
(Node Exit,(\<lambda>s. True)\<^sub>\<surd>,NewExit)" by(fastforce intro:lve_Exit_edge)
with Exit Node have "CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
n [(Node Exit,(\<lambda>s. True)\<^sub>\<surd>,NewExit)] NewExit"
by(fastforce intro:CFG.Cons_path[OF CFG] CFG.empty_path[OF CFG]
simp:CFG.valid_node_def[OF CFG])
thus ?thesis by blast
next
case inner
from \<open>valid_node m\<close> obtain as where "m -as\<rightarrow>* Exit"
by(fastforce dest:Exit_path)
with inner have "\<exists>es. CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
(Node m) es (Node Exit)"
proof(induct as arbitrary:m)
case Nil
from \<open>m -[]\<rightarrow>* Exit\<close>
have "m = Exit" by fastforce
with lve_Exit_edge have "CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
(Node m) [] (Node Exit)"
by(fastforce intro:CFG.empty_path[OF CFG] simp:CFG.valid_node_def[OF CFG])
thus ?case by blast
next
case (Cons x xs)
note IH = \<open>\<And>m. \<lbrakk>inner_node m; m -xs\<rightarrow>* Exit\<rbrakk>
\<Longrightarrow> \<exists>es. CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
(Node m) es (Node Exit)\<close>
from \<open>m -x#xs\<rightarrow>* Exit\<close> have "targetnode x -xs\<rightarrow>* Exit"
and "valid_edge x" and "m = sourcenode x" by(auto elim:path_split_Cons)
with \<open>inner_node m\<close>
have edge:"lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit
(Node m,kind x,Node (targetnode x))"
by(fastforce intro:lve_edge simp:inner_node_def)
from \<open>valid_edge x\<close> have "valid_node (targetnode x)" by simp
thus ?case
proof(cases "targetnode x" rule:valid_node_cases)
case Entry
with \<open>valid_edge x\<close> have False by(rule Entry_target)
thus ?thesis by simp
next
case Exit
with edge have "CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
(Node m) [(Node m,kind x,Node Exit)] (Node Exit)"
apply - apply(rule CFG.Cons_path[OF CFG])
apply(rule CFG.empty_path[OF CFG])
by(auto simp:CFG.valid_node_def[OF CFG])
thus ?thesis by blast
next
case inner
from IH[OF this \<open>targetnode x -xs\<rightarrow>* Exit\<close>] obtain es
where "CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
(Node (targetnode x)) es (Node Exit)" by blast
with edge have "CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
(Node m) ((Node m,kind x,Node (targetnode x))#es) (Node Exit)"
by(fastforce intro:CFG.Cons_path[OF CFG])
thus ?thesis by blast
qed
qed
then obtain es where path:"CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
(Node m) es (Node Exit)" by blast
have "lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit
(Node Exit,(\<lambda>s. True)\<^sub>\<surd>,NewExit)" by(fastforce intro:lve_Exit_edge)
hence "CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
(Node Exit) [(Node Exit,(\<lambda>s. True)\<^sub>\<surd>,NewExit)] NewExit"
by(fastforce intro:CFG.Cons_path[OF CFG] CFG.empty_path[OF CFG]
simp:CFG.valid_node_def[OF CFG])
with path Node have "CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
n (es@[(Node Exit, (\<lambda>s. True)\<^sub>\<surd>, NewExit)]) NewExit"
by(fastforce intro:CFG.path_Append[OF CFG])
thus ?thesis by blast
qed
qed
qed
qed
lemma lift_PDG_scd:
assumes PDG:"PDG sourcenode targetnode kind valid_edge Entry Def Use state_val Exit
(Postdomination.standard_control_dependence sourcenode targetnode valid_edge Exit)"
and pd:"Postdomination sourcenode targetnode kind valid_edge Entry Exit"
and inner:"CFGExit.inner_node sourcenode targetnode valid_edge Entry Exit nx"
shows "PDG src trg knd
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit) NewEntry
(lift_Def Def Entry Exit H L) (lift_Use Use Entry Exit H L) state_val NewExit
(Postdomination.standard_control_dependence src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit) NewExit)"
proof -
interpret PDG sourcenode targetnode kind valid_edge Entry Def Use state_val Exit
"Postdomination.standard_control_dependence sourcenode targetnode
valid_edge Exit"
by(rule PDG)
have wf:"CFGExit_wf sourcenode targetnode kind valid_edge Entry Def Use
state_val Exit" by(unfold_locales)
from wf pd inner have pd':"Postdomination src trg knd
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
NewEntry NewExit"
by(rule lift_Postdomination)
from wf have CFG:"CFG src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit) NewEntry"
by(rule lift_CFG)
from wf have CFG_wf:"CFG_wf src trg knd
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit) NewEntry
(lift_Def Def Entry Exit H L) (lift_Use Use Entry Exit H L) state_val"
by(rule lift_CFG_wf)
from wf have CFGExit:"CFGExit src trg knd
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
NewEntry NewExit"
by(rule lift_CFGExit)
from wf have CFGExit_wf:"CFGExit_wf src trg knd
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit) NewEntry
(lift_Def Def Entry Exit H L) (lift_Use Use Entry Exit H L) state_val NewExit"
by(rule lift_CFGExit_wf)
show ?thesis
proof
fix a assume "lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit a"
and "trg a = NewEntry"
with CFG show False by(rule CFG.Entry_target)
next
fix a a'
assume "lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit a"
and "lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit a'"
and "src a = src a'" and "trg a = trg a'"
with CFG show "a = a'" by(rule CFG.edge_det)
next
from CFG_wf
show "lift_Def Def Entry Exit H L NewEntry = {} \<and>
lift_Use Use Entry Exit H L NewEntry = {}"
by(rule CFG_wf.Entry_empty)
next
fix a V s
assume "lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit a"
and "V \<notin> lift_Def Def Entry Exit H L (src a)" and "pred (knd a) s"
with CFG_wf show "state_val (transfer (knd a) s) V = state_val s V"
by(rule CFG_wf.CFG_edge_no_Def_equal)
next
fix a s s'
assume assms:"lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit a"
"\<forall>V\<in>lift_Use Use Entry Exit H L (src a). state_val s V = state_val s' V"
"pred (knd a) s" "pred (knd a) s'"
with CFG_wf show "\<forall>V\<in>lift_Def Def Entry Exit H L (src a).
state_val (transfer (knd a) s) V = state_val (transfer (knd a) s') V"
by(rule CFG_wf.CFG_edge_transfer_uses_only_Use)
next
fix a s s'
assume "lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit a"
and "pred (knd a) s"
and "\<forall>V\<in>lift_Use Use Entry Exit H L (src a). state_val s V = state_val s' V"
with CFG_wf show "pred (knd a) s'" by(rule CFG_wf.CFG_edge_Uses_pred_equal)
next
fix a a'
assume "lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit a"
and "lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit a'"
and "src a = src a'" and "trg a \<noteq> trg a'"
with CFG_wf show "\<exists>Q Q'. knd a = (Q)\<^sub>\<surd> \<and> knd a' = (Q')\<^sub>\<surd> \<and>
(\<forall>s. (Q s \<longrightarrow> \<not> Q' s) \<and> (Q' s \<longrightarrow> \<not> Q s))"
by(rule CFG_wf.deterministic)
next
fix a assume "lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit a"
and "src a = NewExit"
with CFGExit show False by(rule CFGExit.Exit_source)
next
from CFGExit
show "\<exists>a. lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit a \<and>
src a = NewEntry \<and> trg a = NewExit \<and> knd a = (\<lambda>s. False)\<^sub>\<surd>"
by(rule CFGExit.Entry_Exit_edge)
next
from CFGExit_wf
show "lift_Def Def Entry Exit H L NewExit = {} \<and>
lift_Use Use Entry Exit H L NewExit = {}"
by(rule CFGExit_wf.Exit_empty)
next
fix n n'
assume scd:"Postdomination.standard_control_dependence src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit) NewExit n n'"
show "n' \<noteq> NewExit"
proof(rule ccontr)
assume "\<not> n' \<noteq> NewExit"
hence "n' = NewExit" by simp
with scd pd' show False
by(fastforce intro:Postdomination.Exit_not_standard_control_dependent)
qed
next
fix n n'
assume "Postdomination.standard_control_dependence src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit) NewExit n n'"
thus "\<exists>as. CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
n as n' \<and> as \<noteq> []"
by(fastforce simp:Postdomination.standard_control_dependence_def[OF pd'])
qed
qed
lemma lift_PDG_standard_backward_slice:
fixes valid_edge and sourcenode and targetnode and kind and Entry and Exit
and Def and Use and H and L
defines lve:"lve \<equiv> lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit"
and lDef:"lDef \<equiv> lift_Def Def Entry Exit H L"
and lUse:"lUse \<equiv> lift_Use Use Entry Exit H L"
assumes PDG:"PDG sourcenode targetnode kind valid_edge Entry Def Use state_val Exit
(Postdomination.standard_control_dependence sourcenode targetnode valid_edge Exit)"
and pd:"Postdomination sourcenode targetnode kind valid_edge Entry Exit"
and inner:"CFGExit.inner_node sourcenode targetnode valid_edge Entry Exit nx"
and "H \<inter> L = {}" and "H \<union> L = UNIV"
shows "NonInterferenceIntraGraph src trg knd lve NewEntry lDef lUse state_val
(PDG.PDG_BS src trg lve lDef lUse
(Postdomination.standard_control_dependence src trg lve NewExit))
NewExit H L (Node Entry) (Node Exit)"
proof -
interpret PDG sourcenode targetnode kind valid_edge Entry Def Use state_val Exit
"Postdomination.standard_control_dependence sourcenode targetnode
valid_edge Exit"
by(rule PDG)
have wf:"CFGExit_wf sourcenode targetnode kind valid_edge Entry Def Use
state_val Exit" by(unfold_locales)
interpret wf':CFGExit_wf src trg knd lve NewEntry lDef lUse state_val NewExit
by(fastforce intro:lift_CFGExit_wf wf simp:lve lDef lUse)
from PDG pd inner lve lDef lUse have PDG':"PDG src trg knd
lve NewEntry lDef lUse state_val NewExit
(Postdomination.standard_control_dependence src trg lve NewExit)"
by(fastforce intro:lift_PDG_scd)
from wf pd inner have pd':"Postdomination src trg knd
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
NewEntry NewExit"
by(rule lift_Postdomination)
from wf lve have CFG:"CFG src trg lve NewEntry"
by(fastforce intro:lift_CFG)
from wf lve lDef lUse
have CFG_wf:"CFG_wf src trg knd lve NewEntry lDef lUse state_val"
by(fastforce intro:lift_CFG_wf)
from wf lve have CFGExit:"CFGExit src trg knd lve NewEntry NewExit"
by(fastforce intro:lift_CFGExit)
from wf lve lDef lUse
have CFGExit_wf:"CFGExit_wf src trg knd lve NewEntry lDef lUse state_val NewExit"
by(fastforce intro:lift_CFGExit_wf)
show ?thesis
proof
fix n S
assume "n \<in> PDG.PDG_BS src trg lve lDef lUse
(Postdomination.standard_control_dependence src trg lve NewExit) S"
with PDG' show "CFG.valid_node src trg lve n"
by(rule PDG.PDG_BS_valid_node)
next
fix n S assume "CFG.valid_node src trg lve n" and "n \<in> S"
thus "n \<in> PDG.PDG_BS src trg lve lDef lUse
(Postdomination.standard_control_dependence src trg lve NewExit) S"
by(fastforce intro:PDG.PDG_path_Nil[OF PDG'] simp:PDG.PDG_BS_def[OF PDG'])
next
fix n' S n V
assume "n' \<in> PDG.PDG_BS src trg lve lDef lUse
(Postdomination.standard_control_dependence src trg lve NewExit) S"
and "CFG_wf.data_dependence src trg lve lDef lUse n V n'"
thus "n \<in> PDG.PDG_BS src trg lve lDef lUse
(Postdomination.standard_control_dependence src trg lve NewExit) S"
by(fastforce intro:PDG.PDG_path_Append[OF PDG'] PDG.PDG_path_ddep[OF PDG']
PDG.PDG_ddep_edge[OF PDG'] simp:PDG.PDG_BS_def[OF PDG']
split:if_split_asm)
next
fix n S
interpret PDGx:PDG src trg knd lve NewEntry lDef lUse state_val NewExit
"Postdomination.standard_control_dependence src trg lve NewExit"
by(rule PDG')
interpret pdx:Postdomination src trg knd lve NewEntry NewExit
by(fastforce intro:pd' simp:lve)
have scd:"StandardControlDependencePDG src trg knd lve NewEntry
lDef lUse state_val NewExit" by(unfold_locales)
from StandardControlDependencePDG.obs_singleton[OF scd]
have "(\<exists>m. CFG.obs src trg lve n
(PDG.PDG_BS src trg lve lDef lUse
(Postdomination.standard_control_dependence src trg lve NewExit) S) = {m}) \<or>
CFG.obs src trg lve n
(PDG.PDG_BS src trg lve lDef lUse
(Postdomination.standard_control_dependence src trg lve NewExit) S) = {}"
by(fastforce simp:StandardControlDependencePDG.PDG_BS_s_def[OF scd])
thus "finite (CFG.obs src trg lve n
(PDG.PDG_BS src trg lve lDef lUse
(Postdomination.standard_control_dependence src trg lve NewExit) S))"
by fastforce
next
fix n S
interpret PDGx:PDG src trg knd lve NewEntry lDef lUse state_val NewExit
"Postdomination.standard_control_dependence src trg lve NewExit"
by(rule PDG')
interpret pdx:Postdomination src trg knd lve NewEntry NewExit
by(fastforce intro:pd' simp:lve)
have scd:"StandardControlDependencePDG src trg knd lve NewEntry
lDef lUse state_val NewExit" by(unfold_locales)
from StandardControlDependencePDG.obs_singleton[OF scd]
have "(\<exists>m. CFG.obs src trg lve n
(PDG.PDG_BS src trg lve lDef lUse
(Postdomination.standard_control_dependence src trg lve NewExit) S) = {m}) \<or>
CFG.obs src trg lve n
(PDG.PDG_BS src trg lve lDef lUse
(Postdomination.standard_control_dependence src trg lve NewExit) S) = {}"
by(fastforce simp:StandardControlDependencePDG.PDG_BS_s_def[OF scd])
thus "card (CFG.obs src trg lve n
(PDG.PDG_BS src trg lve lDef lUse
(Postdomination.standard_control_dependence src trg lve NewExit) S)) \<le> 1"
by fastforce
next
fix a assume "lve a" and "src a = NewEntry"
with lve show "trg a = NewExit \<or> trg a = Node Entry"
by(fastforce elim:lift_valid_edge.cases)
next
from lve_Entry_edge lve
show "\<exists>a. lve a \<and> src a = NewEntry \<and> trg a = Node Entry \<and> knd a = (\<lambda>s. True)\<^sub>\<surd>"
by(fastforce simp:knd_def)
next
fix a assume "lve a" and "trg a = Node Entry"
with lve show "src a = NewEntry" by(fastforce elim:lift_valid_edge.cases)
next
fix a assume "lve a" and "trg a = NewExit"
with lve show "src a = NewEntry \<or> src a = Node Exit"
by(fastforce elim:lift_valid_edge.cases)
next
from lve_Exit_edge lve
show "\<exists>a. lve a \<and> src a = Node Exit \<and> trg a = NewExit \<and> knd a = (\<lambda>s. True)\<^sub>\<surd>"
by(fastforce simp:knd_def)
next
fix a assume "lve a" and "src a = Node Exit"
with lve show "trg a = NewExit" by(fastforce elim:lift_valid_edge.cases)
next
from lDef show "lDef (Node Entry) = H"
by(fastforce elim:lift_Def_set.cases intro:lift_Def_High)
next
from Entry_noteq_Exit lUse show "lUse (Node Entry) = H"
by(fastforce elim:lift_Use_set.cases intro:lift_Use_High)
next
from Entry_noteq_Exit lUse show "lUse (Node Exit) = L"
by(fastforce elim:lift_Use_set.cases intro:lift_Use_Low)
next
from \<open>H \<inter> L = {}\<close> show "H \<inter> L = {}" .
next
from \<open>H \<union> L = UNIV\<close> show "H \<union> L = UNIV" .
qed
qed
subsubsection \<open>Lifting \<open>PDG_BS\<close> with \<open>weak_control_dependence\<close>\<close>
lemma lift_StrongPostdomination:
assumes wf:"CFGExit_wf sourcenode targetnode kind valid_edge Entry Def Use
state_val Exit"
and spd:"StrongPostdomination sourcenode targetnode kind valid_edge Entry Exit"
and inner:"CFGExit.inner_node sourcenode targetnode valid_edge Entry Exit nx"
shows "StrongPostdomination src trg knd
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit) NewEntry NewExit"
proof -
interpret StrongPostdomination sourcenode targetnode kind valid_edge Entry Exit
by(rule spd)
have pd:"Postdomination sourcenode targetnode kind valid_edge Entry Exit"
by(unfold_locales)
interpret pd':Postdomination src trg knd
"lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit"
NewEntry NewExit
by(fastforce intro:wf inner lift_Postdomination pd)
interpret CFGExit_wf:CFGExit_wf src trg knd
"lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit" NewEntry
"lift_Def Def Entry Exit H L" "lift_Use Use Entry Exit H L" state_val NewExit
by(fastforce intro:lift_CFGExit_wf wf)
from wf have CFG:"CFG src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit) NewEntry"
by(rule lift_CFG)
show ?thesis
proof
fix n assume "CFG.valid_node src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit) n"
show "finite
{n'. \<exists>a'. lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit a' \<and>
src a' = n \<and> trg a' = n'}"
proof(cases n)
case NewEntry
hence "{n'. \<exists>a'. lift_valid_edge valid_edge sourcenode targetnode kind
Entry Exit a' \<and> src a' = n \<and> trg a' = n'} = {NewExit,Node Entry}"
by(auto elim:lift_valid_edge.cases intro:lift_valid_edge.intros)
thus ?thesis by simp
next
case NewExit
hence "{n'. \<exists>a'. lift_valid_edge valid_edge sourcenode targetnode kind
Entry Exit a' \<and> src a' = n \<and> trg a' = n'} = {}"
by fastforce
thus ?thesis by simp
next
case (Node m)
with Entry_Exit_edge \<open>CFG.valid_node src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit) n\<close>
have "valid_node m"
by(auto elim:lift_valid_edge.cases
simp:CFG.valid_node_def[OF CFG] valid_node_def)
hence "finite {m'. \<exists>a'. valid_edge a' \<and> sourcenode a' = m \<and> targetnode a' = m'}"
by(rule successor_set_finite)
have "{m'. \<exists>a'. lift_valid_edge valid_edge sourcenode targetnode kind
Entry Exit a' \<and> src a' = Node m \<and> trg a' = Node m'} \<subseteq>
{m'. \<exists>a'. valid_edge a' \<and> sourcenode a' = m \<and> targetnode a' = m'}"
by(fastforce elim:lift_valid_edge.cases)
with \<open>finite {m'. \<exists>a'. valid_edge a' \<and> sourcenode a' = m \<and> targetnode a' = m'}\<close>
have "finite {m'. \<exists>a'. lift_valid_edge valid_edge sourcenode targetnode kind
Entry Exit a' \<and> src a' = Node m \<and> trg a' = Node m'}"
by -(rule finite_subset)
hence "finite (Node ` {m'. \<exists>a'. lift_valid_edge valid_edge sourcenode
targetnode kind Entry Exit a' \<and> src a' = Node m \<and> trg a' = Node m'})"
by fastforce
hence fin:"finite ((Node ` {m'. \<exists>a'. lift_valid_edge valid_edge sourcenode
targetnode kind Entry Exit a' \<and> src a' = Node m \<and> trg a' = Node m'}) \<union>
{NewEntry,NewExit})" by fastforce
with Node have "{n'. \<exists>a'. lift_valid_edge valid_edge sourcenode targetnode kind
Entry Exit a' \<and> src a' = n \<and> trg a' = n'} \<subseteq>
(Node ` {m'. \<exists>a'. lift_valid_edge valid_edge sourcenode
targetnode kind Entry Exit a' \<and> src a' = Node m \<and> trg a' = Node m'}) \<union>
{NewEntry,NewExit}" by auto (case_tac x,auto)
with fin show ?thesis by -(rule finite_subset)
qed
qed
qed
lemma lift_PDG_wcd:
assumes PDG:"PDG sourcenode targetnode kind valid_edge Entry Def Use state_val Exit
(StrongPostdomination.weak_control_dependence sourcenode targetnode
valid_edge Exit)"
and spd:"StrongPostdomination sourcenode targetnode kind valid_edge Entry Exit"
and inner:"CFGExit.inner_node sourcenode targetnode valid_edge Entry Exit nx"
shows "PDG src trg knd
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit) NewEntry
(lift_Def Def Entry Exit H L) (lift_Use Use Entry Exit H L) state_val NewExit
(StrongPostdomination.weak_control_dependence src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit) NewExit)"
proof -
interpret PDG sourcenode targetnode kind valid_edge Entry Def Use state_val Exit
"StrongPostdomination.weak_control_dependence sourcenode targetnode
valid_edge Exit"
by(rule PDG)
have wf:"CFGExit_wf sourcenode targetnode kind valid_edge Entry Def Use
state_val Exit" by(unfold_locales)
from wf spd inner have spd':"StrongPostdomination src trg knd
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
NewEntry NewExit"
by(rule lift_StrongPostdomination)
from wf have CFG:"CFG src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit) NewEntry"
by(rule lift_CFG)
from wf have CFG_wf:"CFG_wf src trg knd
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit) NewEntry
(lift_Def Def Entry Exit H L) (lift_Use Use Entry Exit H L) state_val"
by(rule lift_CFG_wf)
from wf have CFGExit:"CFGExit src trg knd
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
NewEntry NewExit"
by(rule lift_CFGExit)
from wf have CFGExit_wf:"CFGExit_wf src trg knd
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit) NewEntry
(lift_Def Def Entry Exit H L) (lift_Use Use Entry Exit H L) state_val NewExit"
by(rule lift_CFGExit_wf)
show ?thesis
proof
fix a assume "lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit a"
and "trg a = NewEntry"
with CFG show False by(rule CFG.Entry_target)
next
fix a a'
assume "lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit a"
and "lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit a'"
and "src a = src a'" and "trg a = trg a'"
with CFG show "a = a'" by(rule CFG.edge_det)
next
from CFG_wf
show "lift_Def Def Entry Exit H L NewEntry = {} \<and>
lift_Use Use Entry Exit H L NewEntry = {}"
by(rule CFG_wf.Entry_empty)
next
fix a V s
assume "lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit a"
and "V \<notin> lift_Def Def Entry Exit H L (src a)" and "pred (knd a) s"
with CFG_wf show "state_val (transfer (knd a) s) V = state_val s V"
by(rule CFG_wf.CFG_edge_no_Def_equal)
next
fix a s s'
assume assms:"lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit a"
"\<forall>V\<in>lift_Use Use Entry Exit H L (src a). state_val s V = state_val s' V"
"pred (knd a) s" "pred (knd a) s'"
with CFG_wf show "\<forall>V\<in>lift_Def Def Entry Exit H L (src a).
state_val (transfer (knd a) s) V = state_val (transfer (knd a) s') V"
by(rule CFG_wf.CFG_edge_transfer_uses_only_Use)
next
fix a s s'
assume "lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit a"
and "pred (knd a) s"
and "\<forall>V\<in>lift_Use Use Entry Exit H L (src a). state_val s V = state_val s' V"
with CFG_wf show "pred (knd a) s'" by(rule CFG_wf.CFG_edge_Uses_pred_equal)
next
fix a a'
assume "lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit a"
and "lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit a'"
and "src a = src a'" and "trg a \<noteq> trg a'"
with CFG_wf show "\<exists>Q Q'. knd a = (Q)\<^sub>\<surd> \<and> knd a' = (Q')\<^sub>\<surd> \<and>
(\<forall>s. (Q s \<longrightarrow> \<not> Q' s) \<and> (Q' s \<longrightarrow> \<not> Q s))"
by(rule CFG_wf.deterministic)
next
fix a assume "lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit a"
and "src a = NewExit"
with CFGExit show False by(rule CFGExit.Exit_source)
next
from CFGExit
show "\<exists>a. lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit a \<and>
src a = NewEntry \<and> trg a = NewExit \<and> knd a = (\<lambda>s. False)\<^sub>\<surd>"
by(rule CFGExit.Entry_Exit_edge)
next
from CFGExit_wf
show "lift_Def Def Entry Exit H L NewExit = {} \<and>
lift_Use Use Entry Exit H L NewExit = {}"
by(rule CFGExit_wf.Exit_empty)
next
fix n n'
assume wcd:"StrongPostdomination.weak_control_dependence src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit) NewExit n n'"
show "n' \<noteq> NewExit"
proof(rule ccontr)
assume "\<not> n' \<noteq> NewExit"
hence "n' = NewExit" by simp
with wcd spd' show False
by(fastforce intro:StrongPostdomination.Exit_not_weak_control_dependent)
qed
next
fix n n'
assume "StrongPostdomination.weak_control_dependence src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit) NewExit n n'"
thus "\<exists>as. CFG.path src trg
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
n as n' \<and> as \<noteq> []"
by(fastforce simp:StrongPostdomination.weak_control_dependence_def[OF spd'])
qed
qed
lemma lift_PDG_weak_backward_slice:
fixes valid_edge and sourcenode and targetnode and kind and Entry and Exit
and Def and Use and H and L
defines lve:"lve \<equiv> lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit"
and lDef:"lDef \<equiv> lift_Def Def Entry Exit H L"
and lUse:"lUse \<equiv> lift_Use Use Entry Exit H L"
assumes PDG:"PDG sourcenode targetnode kind valid_edge Entry Def Use state_val Exit
(StrongPostdomination.weak_control_dependence sourcenode targetnode
valid_edge Exit)"
and spd:"StrongPostdomination sourcenode targetnode kind valid_edge Entry Exit"
and inner:"CFGExit.inner_node sourcenode targetnode valid_edge Entry Exit nx"
and "H \<inter> L = {}" and "H \<union> L = UNIV"
shows "NonInterferenceIntraGraph src trg knd lve NewEntry lDef lUse state_val
(PDG.PDG_BS src trg lve lDef lUse
(StrongPostdomination.weak_control_dependence src trg lve NewExit))
NewExit H L (Node Entry) (Node Exit)"
proof -
interpret PDG sourcenode targetnode kind valid_edge Entry Def Use state_val Exit
"StrongPostdomination.weak_control_dependence sourcenode targetnode
valid_edge Exit"
by(rule PDG)
have wf:"CFGExit_wf sourcenode targetnode kind valid_edge Entry Def Use
state_val Exit" by(unfold_locales)
interpret wf':CFGExit_wf src trg knd lve NewEntry lDef lUse state_val NewExit
by(fastforce intro:lift_CFGExit_wf wf simp:lve lDef lUse)
from PDG spd inner lve lDef lUse have PDG':"PDG src trg knd
lve NewEntry lDef lUse state_val NewExit
(StrongPostdomination.weak_control_dependence src trg lve NewExit)"
by(fastforce intro:lift_PDG_wcd)
from wf spd inner have spd':"StrongPostdomination src trg knd
(lift_valid_edge valid_edge sourcenode targetnode kind Entry Exit)
NewEntry NewExit"
by(rule lift_StrongPostdomination)
from wf lve have CFG:"CFG src trg lve NewEntry"
by(fastforce intro:lift_CFG)
from wf lve lDef lUse
have CFG_wf:"CFG_wf src trg knd lve NewEntry lDef lUse state_val"
by(fastforce intro:lift_CFG_wf)
from wf lve have CFGExit:"CFGExit src trg knd lve NewEntry NewExit"
by(fastforce intro:lift_CFGExit)
from wf lve lDef lUse
have CFGExit_wf:"CFGExit_wf src trg knd lve NewEntry lDef lUse state_val NewExit"
by(fastforce intro:lift_CFGExit_wf)
show ?thesis
proof
fix n S
assume "n \<in> PDG.PDG_BS src trg lve lDef lUse
(StrongPostdomination.weak_control_dependence src trg lve NewExit) S"
with PDG' show "CFG.valid_node src trg lve n"
by(rule PDG.PDG_BS_valid_node)
next
fix n S assume "CFG.valid_node src trg lve n" and "n \<in> S"
thus "n \<in> PDG.PDG_BS src trg lve lDef lUse
(StrongPostdomination.weak_control_dependence src trg lve NewExit) S"
by(fastforce intro:PDG.PDG_path_Nil[OF PDG'] simp:PDG.PDG_BS_def[OF PDG'])
next
fix n' S n V
assume "n' \<in> PDG.PDG_BS src trg lve lDef lUse
(StrongPostdomination.weak_control_dependence src trg lve NewExit) S"
and "CFG_wf.data_dependence src trg lve lDef lUse n V n'"
thus "n \<in> PDG.PDG_BS src trg lve lDef lUse
(StrongPostdomination.weak_control_dependence src trg lve NewExit) S"
by(fastforce intro:PDG.PDG_path_Append[OF PDG'] PDG.PDG_path_ddep[OF PDG']
PDG.PDG_ddep_edge[OF PDG'] simp:PDG.PDG_BS_def[OF PDG']
split:if_split_asm)
next
fix n S
interpret PDGx:PDG src trg knd lve NewEntry lDef lUse state_val NewExit
"StrongPostdomination.weak_control_dependence src trg lve NewExit"
by(rule PDG')
interpret spdx:StrongPostdomination src trg knd lve NewEntry NewExit
by(fastforce intro:spd' simp:lve)
have wcd:"WeakControlDependencePDG src trg knd lve NewEntry
lDef lUse state_val NewExit" by(unfold_locales)
from WeakControlDependencePDG.obs_singleton[OF wcd]
have "(\<exists>m. CFG.obs src trg lve n
(PDG.PDG_BS src trg lve lDef lUse
(StrongPostdomination.weak_control_dependence src trg lve NewExit) S) = {m}) \<or>
CFG.obs src trg lve n
(PDG.PDG_BS src trg lve lDef lUse
(StrongPostdomination.weak_control_dependence src trg lve NewExit) S) = {}"
by(fastforce simp:WeakControlDependencePDG.PDG_BS_w_def[OF wcd])
thus "finite (CFG.obs src trg lve n
(PDG.PDG_BS src trg lve lDef lUse
(StrongPostdomination.weak_control_dependence src trg lve NewExit) S))"
by fastforce
next
fix n S
interpret PDGx:PDG src trg knd lve NewEntry lDef lUse state_val NewExit
"StrongPostdomination.weak_control_dependence src trg lve NewExit"
by(rule PDG')
interpret spdx:StrongPostdomination src trg knd lve NewEntry NewExit
by(fastforce intro:spd' simp:lve)
have wcd:"WeakControlDependencePDG src trg knd lve NewEntry
lDef lUse state_val NewExit" by(unfold_locales)
from WeakControlDependencePDG.obs_singleton[OF wcd]
have "(\<exists>m. CFG.obs src trg lve n
(PDG.PDG_BS src trg lve lDef lUse
(StrongPostdomination.weak_control_dependence src trg lve NewExit) S) = {m}) \<or>
CFG.obs src trg lve n
(PDG.PDG_BS src trg lve lDef lUse
(StrongPostdomination.weak_control_dependence src trg lve NewExit) S) = {}"
by(fastforce simp:WeakControlDependencePDG.PDG_BS_w_def[OF wcd])
thus "card (CFG.obs src trg lve n
(PDG.PDG_BS src trg lve lDef lUse
(StrongPostdomination.weak_control_dependence src trg lve NewExit) S)) \<le> 1"
by fastforce
next
fix a assume "lve a" and "src a = NewEntry"
with lve show "trg a = NewExit \<or> trg a = Node Entry"
by(fastforce elim:lift_valid_edge.cases)
next
from lve_Entry_edge lve
show "\<exists>a. lve a \<and> src a = NewEntry \<and> trg a = Node Entry \<and> knd a = (\<lambda>s. True)\<^sub>\<surd>"
by(fastforce simp:knd_def)
next
fix a assume "lve a" and "trg a = Node Entry"
with lve show "src a = NewEntry" by(fastforce elim:lift_valid_edge.cases)
next
fix a assume "lve a" and "trg a = NewExit"
with lve show "src a = NewEntry \<or> src a = Node Exit"
by(fastforce elim:lift_valid_edge.cases)
next
from lve_Exit_edge lve
show "\<exists>a. lve a \<and> src a = Node Exit \<and> trg a = NewExit \<and> knd a = (\<lambda>s. True)\<^sub>\<surd>"
by(fastforce simp:knd_def)
next
fix a assume "lve a" and "src a = Node Exit"
with lve show "trg a = NewExit" by(fastforce elim:lift_valid_edge.cases)
next
from lDef show "lDef (Node Entry) = H"
by(fastforce elim:lift_Def_set.cases intro:lift_Def_High)
next
from Entry_noteq_Exit lUse show "lUse (Node Entry) = H"
by(fastforce elim:lift_Use_set.cases intro:lift_Use_High)
next
from Entry_noteq_Exit lUse show "lUse (Node Exit) = L"
by(fastforce elim:lift_Use_set.cases intro:lift_Use_Low)
next
from \<open>H \<inter> L = {}\<close> show "H \<inter> L = {}" .
next
from \<open>H \<union> L = UNIV\<close> show "H \<union> L = UNIV" .
qed
qed
end
|
State Before: α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p✝ : Perm α
x✝ : α
p : Perm α
x y : α
hy : y ∈ toList p x
⊢ next (toList p x) y hy = ↑p y State After: α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p✝ : Perm α
x✝ : α
p : Perm α
x y : α
hy✝ : y ∈ toList p x
hy : SameCycle p x y ∧ x ∈ support p
⊢ next (toList p x) y hy✝ = ↑p y Tactic: rw [mem_toList_iff] at hy State Before: α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p✝ : Perm α
x✝ : α
p : Perm α
x y : α
hy✝ : y ∈ toList p x
hy : SameCycle p x y ∧ x ∈ support p
⊢ next (toList p x) y hy✝ = ↑p y State After: case intro.intro
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p✝ : Perm α
x✝ : α
p : Perm α
x y : α
hy✝ : y ∈ toList p x
hy : SameCycle p x y ∧ x ∈ support p
k : ℕ
hk : k < Finset.card (support (cycleOf p x))
hk' : ↑(p ^ k) x = y
⊢ next (toList p x) y hy✝ = ↑p y Tactic: obtain ⟨k, hk, hk'⟩ := hy.left.exists_pow_eq_of_mem_support hy.right State Before: case intro.intro
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p✝ : Perm α
x✝ : α
p : Perm α
x y : α
hy✝ : y ∈ toList p x
hy : SameCycle p x y ∧ x ∈ support p
k : ℕ
hk : k < Finset.card (support (cycleOf p x))
hk' : ↑(p ^ k) x = y
⊢ next (toList p x) y hy✝ = ↑p y State After: case intro.intro
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p✝ : Perm α
x✝ : α
p : Perm α
x y : α
hy✝ : y ∈ toList p x
hy : SameCycle p x y ∧ x ∈ support p
k : ℕ
hk : k < Finset.card (support (cycleOf p x))
hk'✝ : ↑(p ^ k) x = y
hk' : nthLe (toList p x) k (_ : k < length (toList p x)) = y
⊢ next (toList p x) y hy✝ = ↑p y Tactic: rw [← nthLe_toList p x k (by simpa using hk)] at hk' State Before: case intro.intro
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p✝ : Perm α
x✝ : α
p : Perm α
x y : α
hy✝ : y ∈ toList p x
hy : SameCycle p x y ∧ x ∈ support p
k : ℕ
hk : k < Finset.card (support (cycleOf p x))
hk'✝ : ↑(p ^ k) x = y
hk' : nthLe (toList p x) k (_ : k < length (toList p x)) = y
⊢ next (toList p x) y hy✝ = ↑p y State After: case intro.intro
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p✝ : Perm α
x✝ : α
p : Perm α
x y : α
hy✝ : y ∈ toList p x
hy : SameCycle p x y ∧ x ∈ support p
k : ℕ
hk : k < Finset.card (support (cycleOf p x))
hk'✝ : ↑(p ^ k) x = y
hk' : nthLe (toList p x) k (_ : k < length (toList p x)) = y
⊢ next (toList p x) (nthLe (toList p x) k (_ : k < length (toList p x)))
(_ : nthLe (toList p x) k (_ : k < length (toList p x)) ∈ toList p x) =
↑p (nthLe (toList p x) k (_ : k < length (toList p x))) Tactic: simp_rw [← hk'] State Before: case intro.intro
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p✝ : Perm α
x✝ : α
p : Perm α
x y : α
hy✝ : y ∈ toList p x
hy : SameCycle p x y ∧ x ∈ support p
k : ℕ
hk : k < Finset.card (support (cycleOf p x))
hk'✝ : ↑(p ^ k) x = y
hk' : nthLe (toList p x) k (_ : k < length (toList p x)) = y
⊢ next (toList p x) (nthLe (toList p x) k (_ : k < length (toList p x)))
(_ : nthLe (toList p x) k (_ : k < length (toList p x)) ∈ toList p x) =
↑p (nthLe (toList p x) k (_ : k < length (toList p x))) State After: case intro.intro
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p✝ : Perm α
x✝ : α
p : Perm α
x y : α
hy✝ : y ∈ toList p x
hy : SameCycle p x y ∧ x ∈ support p
k : ℕ
hk : k < Finset.card (support (cycleOf p x))
hk'✝ : ↑(p ^ k) x = y
hk' : nthLe (toList p x) k (_ : k < length (toList p x)) = y
⊢ IsCycle (cycleOf p x) Tactic: rw [next_nthLe _ (nodup_toList _ _), nthLe_toList, nthLe_toList, ← mul_apply, ← pow_succ,
length_toList, pow_apply_eq_pow_mod_orderOf_cycleOf_apply p (k + 1), IsCycle.orderOf] State Before: case intro.intro
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p✝ : Perm α
x✝ : α
p : Perm α
x y : α
hy✝ : y ∈ toList p x
hy : SameCycle p x y ∧ x ∈ support p
k : ℕ
hk : k < Finset.card (support (cycleOf p x))
hk'✝ : ↑(p ^ k) x = y
hk' : nthLe (toList p x) k (_ : k < length (toList p x)) = y
⊢ IsCycle (cycleOf p x) State After: no goals Tactic: exact isCycle_cycleOf _ (mem_support.mp hy.right) State Before: α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p✝ : Perm α
x✝ : α
p : Perm α
x y : α
hy✝ : y ∈ toList p x
hy : SameCycle p x y ∧ x ∈ support p
k : ℕ
hk : k < Finset.card (support (cycleOf p x))
hk' : ↑(p ^ k) x = y
⊢ k < length (toList p x) State After: no goals Tactic: simpa using hk |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.