Datasets:
AI4M
/

text
stringlengths
0
3.34M
\section{Mage Guard} asdf
Property owners have a fundamental responsibility to keep visitors safe. When you suffer a serious injury at a store, mall or even residential property, you may consider taking legal action to hold the property owner accountable. At Bizzieri Law Offices, we have helped personal injury accident victims in the Chicago area to seek compensation since 2009. If you suffered an injury on someone else's property, a premises liability claim allows you to hold negligent owners liable to offset the costs of your injury. We will investigate your accident and advise on the legal process ahead to pursue the financial relief you need. Personal injury accidents that occurred on residential, commercial or public property may fall under premises liability. The duty of care that property owners have toward protecting visitors varies depending on if the injury victim was a guest, customer or trespasser. Often injuries falling under premises liability occur at the homes of friends and relatives, leaving victims reluctant to seek an attorney. However, the necessity of compensation to cover injury-related expenses outweighs the passing awkwardness of filing a claim. Also, the property owner's insurance covers most claims, rather than property owner. When you face mounting medical expenses, uncertainty over when you can return to work, a significant recovery period and more, damages can provide the relief you need. Injury victims have a limited period to file a premises liability claim. Learn more about how we can assist you by contacting our Chicago office. To get started with a free case evaluation with a lawyer, call our office at 773-917-6096 or send us an email.
import algebra.direct_limit import algebra.category.fgModule.basic import .defs import .direct_lim open_locale tensor_product universes u v variables {R : Type u} [comm_ring R] variables (M : Type u) [add_comm_group M] [module R M] variable (I : ideal R) @[ext] structure fg_subideal := (to_ideal : ideal R) (fg : to_ideal.fg) (le : to_ideal ≤ I) instance hmmm0 : Π (i : fg_subideal I), add_comm_group $ i.to_ideal ⊗[R] M := λ _, infer_instance instance hmmm1 : Π (i : fg_subideal I), module R (i.to_ideal ⊗[R] M) := λ _, tensor_product.left_module instance : preorder (fg_subideal I) := preorder.lift fg_subideal.to_ideal instance : is_directed (fg_subideal I) (≤) := { directed := λ J J', ⟨⟨J.to_ideal ⊔ J'.to_ideal, submodule.fg.sup J.fg J'.fg, sup_le_iff.mpr ⟨J.le, J'.le⟩⟩, ⟨@le_sup_left (ideal R) _ J.to_ideal J'.to_ideal, @le_sup_right (ideal R) _ J.to_ideal J'.to_ideal⟩⟩ } instance : inhabited (fg_subideal I) := ⟨⟨⊥, submodule.fg_bot, bot_le⟩⟩ variables {I} @[simps] def principal_fg_subideal (i : I) : fg_subideal I := { to_ideal := ideal.span {i}, fg := submodule.fg_span_singleton _, le := submodule.span_le.mpr $ λ x hx, (set.mem_singleton_iff.mp hx).symm ▸ i.2 } lemma principal_fg_subideal_smul (r : R) (i : I) : principal_fg_subideal (r • i) ≤ principal_fg_subideal i := submodule.span_le.mpr $ λ x hx, (set.mem_singleton_iff.mp hx).symm ▸ submodule.mem_span_singleton.mpr ⟨r, rfl⟩ lemma mem_principal_fg_subideal (i : I) : (i : R) ∈ (principal_fg_subideal i).to_ideal := submodule.mem_span_singleton_self _ @[simps] def doubleton_fg_subideal (i j : I) : fg_subideal I := { to_ideal := ideal.span {i, j}, fg := submodule.fg_span $ by simp only [set.finite.insert, set.finite_singleton], le := submodule.span_le.mpr $ λ x hx, begin simp only [set.mem_insert_iff, set.mem_singleton_iff] at hx, rcases hx with rfl|rfl, { exact i.2 }, { exact j.2 } end } lemma mem_left_doubleton_fg_subideal (i j : I) : (i : R) ∈ (doubleton_fg_subideal i j).to_ideal := submodule.subset_span $ by simp lemma mem_right_doubleton_fg_subideal (i j : I) : (j : R) ∈ (doubleton_fg_subideal i j).to_ideal := submodule.subset_span $ by simp lemma left_le_doubleton_fg_subideal (i j : I) : principal_fg_subideal i ≤ doubleton_fg_subideal i j := submodule.span_le.mpr $ λ x hx, (set.mem_singleton_iff.mpr hx).symm ▸ submodule.subset_span (by simp) lemma right_le_doubleton_fg_subideal (i j : I) : principal_fg_subideal j ≤ doubleton_fg_subideal i j := submodule.span_le.mpr $ λ x hx, (set.mem_singleton_iff.mpr hx).symm ▸ submodule.subset_span (by simp) lemma add_le_doubleton_fg_subideal (i j : I) : principal_fg_subideal (i + j) ≤ doubleton_fg_subideal i j := submodule.span_le.mpr $ λ x hx, begin rw set.mem_singleton_iff at hx, rw hx, change (i : R) + (j : R) ∈ _, refine (doubleton_fg_subideal i j).to_ideal.add_mem _ _, { apply mem_left_doubleton_fg_subideal, }, { apply mem_right_doubleton_fg_subideal, }, end variable (I) variable [decidable_eq $ fg_subideal I] namespace ideal instance : Π (i : fg_subideal I), add_comm_group $ i.to_ideal := λ _, infer_instance @[reducible] def as_direct_limit := module.direct_limit (λ (i : fg_subideal I), i.to_ideal) $ λ i j hij, (submodule.of_le hij : i.to_ideal →ₗ[R] j.to_ideal) @[reducible] def from_as_direct_limit : I.as_direct_limit →ₗ[R] I := module.direct_limit.lift R _ _ _ (λ i, submodule.of_le i.le) $ λ i j hij r, rfl @[simps] def to_as_direct_limit : I →ₗ[R] I.as_direct_limit := { to_fun := λ r, module.direct_limit.of R (fg_subideal I) (λ i, i.to_ideal) (λ _ _ h, submodule.of_le h) (principal_fg_subideal r) ⟨r, mem_principal_fg_subideal r⟩, map_add' := λ i i', begin set ι : fg_subideal I := doubleton_fg_subideal i i' with ι_eq, rw ←@module.direct_limit.of_f R _ (fg_subideal I) _ _ (λ i, i.to_ideal) _ _ (λ _ _ h, submodule.of_le h) _ _ (add_le_doubleton_fg_subideal i i'), simp_rw [submodule.of_le_apply, subtype.coe_mk], erw show (⟨i + i', _⟩ : (doubleton_fg_subideal i i').to_ideal) = ⟨i, mem_left_doubleton_fg_subideal _ _⟩ + ⟨i', mem_right_doubleton_fg_subideal _ _⟩, from rfl, rw map_add, congr' 1, { rw ←@module.direct_limit.of_f R _ (fg_subideal I) _ _ (λ i, i.to_ideal) _ _ (λ _ _ h, submodule.of_le h) _ _ (left_le_doubleton_fg_subideal i i'), refl, }, { rw ←@module.direct_limit.of_f R _ (fg_subideal I) _ _ (λ i, i.to_ideal) _ _ (λ _ _ h, submodule.of_le h) _ _ (right_le_doubleton_fg_subideal i i'), refl, }, end, map_smul' := λ r i, begin rw ←@module.direct_limit.of_f R _ (fg_subideal I) _ _ (λ i, i.to_ideal) _ _ (λ _ _ h, submodule.of_le h) _ _ (principal_fg_subideal_smul r i), simpa only [submodule.of_le_apply, ring_hom.id_apply, ←map_smul], end } example : true := trivial lemma from_to_as_direct_limit : function.left_inverse I.from_as_direct_limit I.to_as_direct_limit := begin intros z, rw to_as_direct_limit_apply, rw module.direct_limit.lift_of, rw submodule.of_le_apply, simp_rw subtype.coe_mk, ext, rw subtype.coe_mk, end lemma to_from_as_direct_limit : function.right_inverse I.from_as_direct_limit I.to_as_direct_limit := begin intros z, induction z using module.direct_limit.induction_on with i z, rw module.direct_limit.lift_of, rw submodule.of_le_apply, rw to_as_direct_limit_apply, simp_rw subtype.coe_mk, rw ←module.direct_limit.of_f, work_on_goal 2 { show _ ≤ i, begin erw submodule.span_le, intros r hr, rw set.mem_singleton_iff at hr, rw subtype.coe_mk at hr, rw hr, exact z.2, end, }, rw submodule.of_le_apply, simp_rw subtype.coe_mk, congr' 1, ext1, refl, end @[simps] def iso_as_direct_limit : I ≃ₗ[R] I.as_direct_limit := { to_fun := I.to_as_direct_limit, map_add' := map_add _, map_smul' := map_smul _, inv_fun := I.from_as_direct_limit, left_inv := I.from_to_as_direct_limit, right_inv := I.to_from_as_direct_limit } -- instance hmmm2 : module R (I.as_direct_limit ⊗[R] M) := tensor_product.left_module @[simps] def tensor_iso_direct_limit : I ⊗[R] M ≃ₗ[R] I.as_direct_limit ⊗[R] M := { inv_fun := (tensor_product.map I.from_as_direct_limit linear_map.id : I.as_direct_limit ⊗[R] M →ₗ[R] I ⊗[R] M), left_inv := λ z, begin simp only [linear_map.to_fun_eq_coe], rw ←linear_map.comp_apply, rw ←tensor_product.map_comp, rw linear_map.comp_id, convert linear_map.id_apply _, convert tensor_product.map_id, ext1 z, rw linear_map.comp_apply, rw I.from_to_as_direct_limit, rw linear_map.id_apply, end, right_inv := λ z, begin simp only [linear_map.to_fun_eq_coe], rw ←linear_map.comp_apply, rw ←tensor_product.map_comp, rw linear_map.comp_id, convert linear_map.id_apply _, convert tensor_product.map_id, refine linear_map.ext (λ z, _), rw linear_map.comp_apply, rw I.to_from_as_direct_limit, rw linear_map.id_apply, end, ..(tensor_product.map I.to_as_direct_limit linear_map.id : I ⊗[R] M →ₗ[R] I.as_direct_limit ⊗[R] M) } @[reducible] def as_direct_limit_tensor := module.direct_limit (λ (i : fg_subideal I), i.to_ideal ⊗[R] M) (λ i j hij, tensor_product.map (submodule.of_le hij) linear_map.id) @[reducible] def iso_as_direct_limit_tensor_aux1 : I.as_direct_limit_tensor M ≃ₗ[R] I.as_direct_limit ⊗[R] M := @module.direct_limit_of_tensor_product_iso_tensor_product_with_direct_limit R _ (fg_subideal I) _ _ (λ i, i.to_ideal) _ _ (λ _ _ h, submodule.of_le h) M _ _ _ _ end ideal @[reducible] def tensor_embedding' : module.direct_limit (λ (i : fg_subideal I), (i.to_ideal ⊗[R] M)) (λ i j hij, tensor_product.map (submodule.of_le hij) linear_map.id : Π (i j : fg_subideal I) (hij : i ≤ j), (i.to_ideal ⊗[R] M) →ₗ[R] (j.to_ideal ⊗[R] M)) →ₗ[R] R ⊗[R] M := module.direct_limit.lift _ _ _ _ (λ i, Module.tensor_embedding M i.to_ideal) $ λ i j hij z, begin induction z using tensor_product.induction_on with ii m x y hx hy, { simp only [map_zero] }, { simp only [tensor_product.map_tmul, linear_map.coe_mk, submodule.of_le_apply, linear_map.id_apply, subtype.coe_mk], }, { simp only [map_add, hx, hy] }, end lemma tensor_embedding_eq : (Module.tensor_embedding M I : I ⊗[R] M →ₗ[R] R ⊗[R] M) = linear_map.comp (tensor_embedding' M I) (linear_map.comp (I.iso_as_direct_limit_tensor_aux1 M).symm.to_linear_map ((I.tensor_iso_direct_limit M).to_linear_map)) := linear_map.ext $ λ z, begin induction z using tensor_product.induction_on with i m x y hx hy, { simp only [map_zero] }, { simp only [tensor_product.map_tmul, linear_map.comp_apply, linear_map.coe_mk, id, linear_equiv.coe_to_linear_map, ideal.tensor_iso_direct_limit_apply, module.direct_limit_of_tensor_product_iso_tensor_product_with_direct_limit_symm_apply, linear_map.to_fun_eq_coe, ideal.to_as_direct_limit_apply, module.direct_limit.lift_of, tensor_product.lift.tmul, linear_map.id_apply, subtype.coe_mk], }, { simp only [map_add, hx, hy] } end lemma tensor_embedding_inj_of_fg_inj (hinj : ∀ (I : ideal R), I.fg → function.injective (Module.tensor_embedding M I)) : function.injective $ Module.tensor_embedding M I := begin rw tensor_embedding_eq, refine function.injective.comp _ (function.injective.comp (function.injective.comp _ _) _), { refine module.lift_inj R (fg_subideal I) _ _ _ _ _, exact λ i, hinj i.to_ideal i.fg, }, { exact linear_equiv.injective _, }, { exact linear_equiv.injective _, }, { exact function.injective_id, }, end
/* @copyright Louis Dionne 2014 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) */ #include <boost/hana/ext/boost/mpl/vector.hpp> #include <boost/hana/detail/assert.hpp> #include <boost/mpl/vector.hpp> using namespace boost::hana; namespace mpl = boost::mpl; struct x0; struct x1; int main() { BOOST_HANA_CONSTANT_ASSERT(equal(mpl::vector<>{}, mpl::vector<>{})); BOOST_HANA_CONSTANT_ASSERT(!equal(mpl::vector<x0>{}, mpl::vector<>{})); BOOST_HANA_CONSTANT_ASSERT(!equal(mpl::vector<>{}, mpl::vector<x0>{})); BOOST_HANA_CONSTANT_ASSERT(equal(mpl::vector<x0>{}, mpl::vector<x0>{})); BOOST_HANA_CONSTANT_ASSERT(!equal(mpl::vector<x0, x1>{}, mpl::vector<x0>{})); BOOST_HANA_CONSTANT_ASSERT(!equal(mpl::vector<x0>{}, mpl::vector<x0, x1>{})); BOOST_HANA_CONSTANT_ASSERT(equal(mpl::vector<x0, x1>{}, mpl::vector<x0, x1>{})); }
lemma limpt_of_closure: "x islimpt closure S \<longleftrightarrow> x islimpt S" for x :: "'a::metric_space"
module cwf where open import Nat open import Base open import univ open import help -- Category with Families infix 40 _─→_ infixl 50 _,_ _,,_ infixl 70 _∘_ _∙_ infixl 60 _/_ _//_ Con : Set Con = S _─→_ : Con -> Con -> Set Γ ─→ Δ = El (pi Γ (K Δ)) p─→ : {Γ Δ : Con}(σ : Γ ─→ Δ){x y : El Γ} -> x == y -> σ # x == σ # y p─→ σ {x}{y} x=y = chain> σ # x === refS << σ # y by pFun σ x=y === σ # y by ref<< (σ # y) where open module C13 = Chain _==_ (ref {_}) (trans {_}) id : {Γ : Con} -> Γ ─→ Γ id = el < (\x -> x) , (\{x}{y} -> prf x y) > where prf : (x y : El _)(x=y : x == y) -> x == refS << y prf x y x=y = chain> x === refS << x by sym (ref<< x) === refS << y by p<< refS x=y where open module C0 = Chain _==_ (ref {_}) (trans {_}) _∘_ : {Γ Δ Θ : Con} -> (Δ ─→ Θ) -> (Γ ─→ Δ) -> Γ ─→ Θ σ ∘ δ = el < (\x -> σ # (δ # x)) , (\{x}{y} -> prf x y) > where prf : (x y : El _)(x=y : x == y) -> σ # (δ # x) == _ << σ # (δ # y) prf x y x=y = chain> σ # (δ # x) === σ # (δ # y) by p─→ σ (p─→ δ x=y) === _ << σ # (δ # y) by sym (castref _ _) where open module C1 = Chain _==_ (ref {_}) (trans {_}) Type : Con -> Set Type Γ = Fam Γ data _=Ty_ {Γ : Con}(A B : Type Γ) : Set where eqTy : A =Fam B -> A =Ty B symTy : {Γ : Con}{A B : Type Γ} -> A =Ty B -> B =Ty A symTy {Γ}{A}{B} (eqTy A=B) = eqTy (symFam {Γ}{A}{B} A=B) _/_ : {Γ Δ : Con} -> Type Γ -> (Δ ─→ Γ) -> Type Δ _/_ {Γ}{Δ} A (el < σ , pσ >) = fam B pB where B : El Δ -> S B x = A ! σ x σ' : Δ ─→ Γ σ' = el < σ , (\{x}{y} -> pσ) > pB : Map _==_ _=S_ B pB {x}{y} x=y = pFam A (p─→ σ' x=y) lem-/id : {Γ : Con}{A : Type Γ} -> A / id =Ty A lem-/id {Γ}{A} = eqTy \x -> refS data Elem (Γ : Con)(A : Type Γ) : Set where elem : El (pi Γ A) -> Elem Γ A _=El'_ : {Γ : Con}{A : Type Γ} -> Elem Γ A -> Elem Γ A -> Set elem u =El' elem v = u == v data _=El_ {Γ : Con}{A : Type Γ}(u v : Elem Γ A) : Set where eqEl : u =El' v -> u =El v castElem : {Γ : Con}{A B : Type Γ} -> B =Ty A -> Elem Γ A -> Elem Γ B castElem {Γ}{A}{B} (eqTy B=A) (elem u) = elem (ΓB=ΓA << u) where ΓB=ΓA : pi Γ B =S pi Γ A ΓB=ΓA = eqS < refS , Bx=Acx > where Bx=Acx : (x : El Γ) -> B ! x =S A ! (refS << x) Bx=Acx x = chain> B ! x === A ! x by B=A x === A ! (refS << x) by pFam A (sym (ref<< x)) where open module C2-5 = Chain _=S_ refS transS _//_ : {Γ Δ : Con}{A : Type Γ} -> Elem Γ A -> (σ : Δ ─→ Γ) -> Elem Δ (A / σ) _//_ {Γ}{Δ}{A} (elem t) (el < σ , pσ >) = elem (el < tσ , (\{x}{y} -> prf x y) >) where tσ : (x : El Δ) -> El (A ! σ x) tσ x = t # σ x σ' : Δ ─→ Γ σ' = el < σ , (\{x}{y} -> pσ) > prf : (x y : El Δ)(x=y : x == y) -> t # σ x == _ << t # σ y prf x y x=y = chain> t # σ x === _ << t # σ y by pFun t (p─→ σ' x=y) === _ << t # σ y by pfi _ _ _ where open module C3 = Chain _==_ (ref {_}) (trans {_}) _,_ : (Γ : Con)(A : Type Γ) -> Con Γ , A = sigma Γ A wk : {Γ : Con}{A : Type Γ} -> Γ , A ─→ Γ wk {Γ}{A} = el < f , (\{x}{y} -> pf x y) > where f : El (Γ , A) -> El Γ f (el < x , _ >) = x pf : (x y : El (Γ , A))(x=y : x == y) -> f x == _ << f y pf (el < x , _ >) (el < y , _ >) (eq < x=y , _ >) = chain> x === y by x=y === _ << y by sym (castref _ _) where open module C4 = Chain _==_ (ref {_}) (trans {_}) vz : {Γ : Con}{A : Type Γ} -> Elem (Γ , A) (A / wk) vz {Γ}{A} = elem (el < f , (\{x}{y} -> pf x y) >) where f : (x : El (Γ , A)) -> El ((A / wk) ! x) f (el < _ , z >) = z pf : (x y : El (Γ , A))(x=y : x == y) -> f x == _ << f y pf (el < _ , x >)(el < _ , y >)(eq < _ , x=y >) = chain> x === _ << y by x=y === _ << y by pfi _ _ _ where open module C5 = Chain _==_ (ref {_}) (trans {_}) _,,_ : {Γ Δ : Con}{A : Type Γ}(σ : Δ ─→ Γ)(u : Elem Δ (A / σ)) -> Δ ─→ Γ , A _,,_ {Γ}{Δ}{A} (el < σ , pσ >) (elem (el < u , pu >)) = build δ pδ where -- We need to generalise to be able to infer the proof of Γ, A =S Γ, A Ok : (f : El Δ -> El (Γ , A)) -> Set Ok f = (x y : El Δ)(p : Γ , A =S Γ , A)(x=y : x == y) -> f x == p << f y build : (f : El Δ -> El (Γ , A)) -> Ok f -> Δ ─→ Γ , A build f p = el < f , (\{x}{y} -> p x y _) > δ : El Δ -> El (Γ , A) δ x = el {Γ , A} < σ x , u x > pδ : Ok δ pδ x y (eqS < Γ=Γ , A=A >) x=y = eq < σx=cσy , ux=ccuy > where σx=cσy = trans (pσ x=y) (pfi _ _ _) ux=ccuy = chain> u x === _ << u y by pu x=y === _ << _ << u y by sym (casttrans _ _ _ _) where open module C6 = Chain _==_ (ref {_}) (trans {_}) {- TODO: Prove wk ∘ (σ ,, u) = σ vz / (σ ,, u) = u (σ ,, u) ∘ δ = (σ ∘ δ ,, u) wk ,, vz = id -} [_] : {Γ : Con}{A : Type Γ} -> Elem Γ A -> Γ ─→ Γ , A [_] {Γ}{A} u = id ,, castElem lem-/id u Π : {Γ : Con}(A : Type Γ)(B : Type (Γ , A)) -> Type Γ Π {Γ} A B = fam F pF where F : El Γ -> S F x = pi (A ! x) (curryFam B x) pF : Map _==_ _=S_ F pF {y}{z} y=z = eqS < pFam A (sym y=z) , (\x -> pFam B (eq < y=z , trans (sym (castref _ _)) (trans<< _ _ _) > ) ) > {- TODO: Prove (Π A B) / σ = Π (A / σ) (B / (σ / wk ,, vz)) -} ƛ : {Γ : Con}{A : Type Γ}{B : Type (Γ , A)} -> Elem (Γ , A) B -> Elem Γ (Π A B) ƛ {Γ}{A}{B} (elem u) = elem (mkFun f pf) where f : (x : El Γ) -> El (Π A B ! x) f x = el < g , (\{x}{y} -> pg) > where g : (y : El (A ! x)) -> El (B ! el < x , y >) g y = u # el < x , y > pg : {y z : El (A ! x)}(y=z : y == z) -> g y == _ << g z pg {y}{z} y=z = chain> u # el < x , y > === _ << u # el < x , z > by pFun u (eqSnd y=z) === _ << u # el < x , z > by pfi _ _ _ where open module C7 = Chain _==_ (ref {_}) (trans {_}) pf : IsFun {F = Π A B} f pf {y}{z} (eqS < Ay=Az , B'=B' >) y=z = eq prf where prf : (x : El (A ! y)) -> _ == _ prf x = chain> u # el < y , x > === _ << u # el < z , _ << x > by pFun u (eq < y=z , sym (castref2 _ _ _) >) === _ << u # el < z , _ << x > by pfi _ _ _ where open module C8 = Chain _==_ (ref {_}) (trans {_}) _∙_ : {Γ : Con}{A : Type Γ}{B : Type (Γ , A)} (w : Elem Γ (Π A B))(u : Elem Γ A) -> Elem Γ (B / [ u ]) _∙_ {Γ}{A}{B} (elem w) (elem u) = elem (el < f , (\{x}{y} -> pf) >) where f : (x : El Γ) -> El ((B / [ elem u ]) ! x) f x = p u << y where y : El (B ! el < x , u # x >) y = (w # x) # (u # x) p : (u : El (pi Γ A)) -> (B / [ elem u ]) ! x =S B ! el < x , u # x > p (el < u , pu >) = pFam B ( chain> el < x , _ << u (refS << x) > === el < x , _ << _ << u x > by eqSnd (p<< _ (pu (ref<< _))) === el < x , u x > by eqSnd (castref2 _ _ _) ) where open module C9 = Chain _==_ (ref {_}) (trans {_}) pf : {x y : El Γ}(x=y : x == y) -> f x == _ << f y pf {x}{y} x=y = chain> q1 << (w # x) # (u # x) === q1 << (q3 << w # y) ## (u # x) by p<< q1 (p# (pFun w x=y)) === q1 << q4 << (w # y) # (q5 << u # x) by p<< q1 (distr<<# (w # y) q3) === q7 << (w # y) # (q5 << u # x) by sym (trans<< q1 q4 _) === q7 << q8 << (w # y) # (q5 << q9 << u # y) by p<< q7 (pFun (w # y) (p<< q5 (pFun u x=y))) === qA << (w # y) # (q5 << q9 << u # y) by sym (trans<< q7 q8 _) === qA << qB << (w # y) # (u # y) by p<< qA (pFun (w # y) (castref2 q5 q9 _)) === q2 << q6 << (w # y) # (u # y) by pfi2 qA q2 qB q6 _ where open module C10 = Chain _==_ (ref {_}) (trans {_}) q1 = _ q2 = _ q3 = _ q4 = _ q5 = _ q6 = _ q7 = _ q8 = _ q9 = _ qA = _ qB = _ infixl 150 _##_ _##_ = _#_ {F = curryFam B x} {- TODO: Prove (ƛ v) ∙ u = v // [ u ] (β) w = ƛ ((w // wk) ∙ vz) (η) ƛ v // σ = ƛ (v // (σ ∘ wk ,, vz)) w ∙ u // σ = (w // σ) ∙ (u // σ) -}
@testset "arb_types" begin mag = Arblib.mag_struct() arf = Arblib.arf_struct() arb = Arblib.arb_struct() acb = Arblib.acb_struct() prec = 256 for x in (arf, arb, acb) @test precision(x) == prec @test precision(Ptr{typeof(x)}()) == prec @test precision(typeof(x)) == prec @test precision(Ptr{typeof(x)}) == prec end end
Thank you for visiting at this website. Listed below is a fantastic graphic for Free Disney Coloring Pages Pdf. We have been searching for this image through on-line and it came from trustworthy resource. If youre searching for any new fresh plan for your own home then the Free Disney Coloring Pages Pdf image needs to be on top of resource or you might use it for an alternative concept. This picture has been published by admin tagged in category field. And we also trust it can be the most well liked vote in google vote or event in facebook share. Hopefully you like it as we do. If possible share this Free Disney Coloring Pages Pdf image to your mates, family through google plus, facebook, twitter, instagram or any other social media site.
--{-# OPTIONS -v tc.pos:100 #-} open import Agda.Builtin.Equality data ⊥ : Set where postulate A : Set R : A → Set magic : ⊥ → A magic () test : (a : ⊥) → magic a ≡ magic _ test a = refl
function ar=lpczz2ar(zz) %LPCZZ2AR Convert z-place poles to ar coefficients AR=(ZZ) % The complex poles must occur in complex conjugate pairs % but the order is unimportant. % Copyright (C) Mike Brookes 1997 % Version: $Id: lpczz2ar.m,v 1.4 2007/05/04 07:01:39 dmb Exp $ % % VOICEBOX is a MATLAB toolbox for speech processing. % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % This program is free software; you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software Foundation; either version 2 of the License, or % (at your option) any later version. % % This program is distributed in the hope that it will be useful, % but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You can obtain a copy of the GNU General Public License from % http://www.gnu.org/copyleft/gpl.html or by writing to % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% [nf,p]=size(zz); ar=zeros(nf,p+1); for k=1:nf ar(k,:)=real(poly(zz(k,:))); end
(* Property from Productive Use of Failure in Inductive Proof, Andrew Ireland and Alan Bundy, JAR 1996. 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.*) theory TIP_prop_43 imports "../../Test_Base" begin datatype 'a list = nil2 | cons2 "'a" "'a list" datatype Nat = Z | S "Nat" fun y :: "Nat => Nat => bool" where "y (Z) (Z) = True" | "y (Z) (S z2) = False" | "y (S x2) (Z) = False" | "y (S x2) (S y22) = y x2 y22" fun x :: "bool => bool => bool" where "x True y2 = True" | "x False y2 = y2" fun elem :: "Nat => Nat list => bool" where "elem z (nil2) = False" | "elem z (cons2 z2 xs) = x (y z z2) (elem z xs)" fun union :: "Nat list => Nat list => Nat list" where "union (nil2) y2 = y2" | "union (cons2 z2 xs) y2 = (if elem z2 y2 then union xs y2 else cons2 z2 (union xs y2))" theorem property0 : "((elem z y2) ==> (elem z (union z2 y2)))" oops end
function p = legendre(n,var) %LEGENDRE Legendre polynomial % % p = legendre(n,var) % %Computed by recursion % p(0,x) = 1 % p(1,x) = x % p(n,x) = (2*n-1)/n * x * p(n-1,x) - (n-1)/n * p(n-2,x) for n>1 % %Parameter var for dependent variable optional (default 'x') % % written 07/30/02 S.M. Rump % modified 04/04/04 S.M. Rump set round to nearest for safety % modified 04/06/05 S.M. Rump rounding unchanged % modified 09/28/08 S.M. Rump check for rounding to nearest improved % e = 1e-30; if 1+e==1-e % fast check for rounding to nearest rndold = 0; else rndold = getround; setround(0) end if nargin==1 var = 'x'; else if ~ischar(var) error('variable must be string') end end if n==0 p = polynom(1,var); elseif n==1 p = polynom([1 0],var); else t1 = [1 zeros(1,n)]; t2 = [0 1 zeros(1,n-1)]; for i=3:n+1 t3 = (2*i-3)/(i-1)*[0 t2(1:n)] - (i-2)/(i-1)*t1; t1 = t2; t2 = t3; end p = polynom(fliplr(t3),var); end if rndold setround(rndold) end
-- MIT License -- Copyright (c) 2021 Luca Ciccone and Luca Padovani -- 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. open import Level open import Axiom.ExcludedMiddle open import Axiom.Extensionality.Propositional open import Relation.Nullary open import Relation.Binary.PropositionalEquality using (_≡_; refl) module Common where postulate excluded-middle : ExcludedMiddle Level.zero extensionality : Extensionality Level.zero (Level.suc Level.zero) record Message (ℙ : Set) : Set where infix 4 _?=_ field _?=_ : (x y : ℙ) -> Dec (x ≡ y)
/- Copyright (c) 2022 Yaël Dillies. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yaël Dillies ! This file was ported from Lean 3 source module order.category.HeytAlg ! leanprover-community/mathlib commit e8ac6315bcfcbaf2d19a046719c3b553206dac75 ! Please do not edit these lines, except to modify the commit id ! if you have ported upstream changes. -/ import Mathbin.Order.Category.BddDistLat import Mathbin.Order.Heyting.Hom /-! # The category of Heyting algebras This file defines `HeytAlg`, the category of Heyting algebras. -/ universe u open CategoryTheory Opposite Order /-- The category of Heyting algebras. -/ def HeytAlg := Bundled HeytingAlgebra #align HeytAlg HeytAlg namespace HeytAlg instance : CoeSort HeytAlg (Type _) := Bundled.hasCoeToSort instance (X : HeytAlg) : HeytingAlgebra X := X.str /-- Construct a bundled `HeytAlg` from a `heyting_algebra`. -/ def of (α : Type _) [HeytingAlgebra α] : HeytAlg := Bundled.of α #align HeytAlg.of HeytAlg.of @[simp] theorem coe_of (α : Type _) [HeytingAlgebra α] : ↥(of α) = α := rfl #align HeytAlg.coe_of HeytAlg.coe_of instance : Inhabited HeytAlg := ⟨of PUnit⟩ instance bundledHom : BundledHom HeytingHom where toFun α β [HeytingAlgebra α] [HeytingAlgebra β] := (coeFn : HeytingHom α β → α → β) id := HeytingHom.id comp := @HeytingHom.comp hom_ext α β [HeytingAlgebra α] [HeytingAlgebra β] := FunLike.coe_injective #align HeytAlg.bundled_hom HeytAlg.bundledHom deriving instance LargeCategory, ConcreteCategory for HeytAlg @[simps] instance hasForgetToLat : HasForget₂ HeytAlg BddDistLat where forget₂ := { obj := fun X => BddDistLat.of X map := fun X Y f => (f : BoundedLatticeHom X Y) } #align HeytAlg.has_forget_to_Lat HeytAlg.hasForgetToLat /-- Constructs an isomorphism of Heyting algebras from an order isomorphism between them. -/ @[simps] def Iso.mk {α β : HeytAlg.{u}} (e : α ≃o β) : α ≅ β where Hom := e inv := e.symm hom_inv_id' := by ext exact e.symm_apply_apply _ inv_hom_id' := by ext exact e.apply_symm_apply _ #align HeytAlg.iso.mk HeytAlg.Iso.mk end HeytAlg
Formal statement is: lemma sets_vimage_algebra_space: "X \<in> sets (vimage_algebra X f M)" Informal statement is: The set $X$ is in the $\sigma$-algebra generated by the image of $f$.
If $f$ converges to $l$ and $l \neq 0$, then $\text{sgn}(f)$ converges to $\text{sgn}(l)$.
module TypeFuns import Data.Strings %default total StringOrInt : Bool -> Type StringOrInt False = String StringOrInt True = Int getStringOrInt : (isInt : Bool) -> StringOrInt isInt getStringOrInt False = "Hello" getStringOrInt True = 100 valToString : (isInt : Bool) -> StringOrInt isInt -> String valToString False s = trim s valToString True i = cast i -- we can have practically any valid form in the type signature valToStringCase : (isInt : Bool) -> (case isInt of False => String True => Int) -> String valToStringCase False s = trim s valToStringCase True i = cast i
/- Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import set_theory.cardinal.ordinal /-! # Cardinality of continuum In this file we define `cardinal.continuum` (notation: `𝔠`, localized in `cardinal`) to be `2 ^ ℵ₀`. We also prove some `simp` lemmas about cardinal arithmetic involving `𝔠`. ## Notation - `𝔠` : notation for `cardinal.continuum` in locale `cardinal`. -/ namespace cardinal universes u v open_locale cardinal /-- Cardinality of continuum. -/ def continuum : cardinal.{u} := 2 ^ aleph_0.{u} localized "notation `𝔠` := cardinal.continuum" in cardinal @[simp] lemma two_power_aleph_0 : 2 ^ aleph_0.{u} = continuum.{u} := rfl @[simp] lemma lift_continuum : lift.{v} 𝔠 = 𝔠 := by rw [←two_power_aleph_0, lift_two_power, lift_aleph_0, two_power_aleph_0] /-! ### Inequalities -/ lemma aleph_0_lt_continuum : ℵ₀ < 𝔠 := cantor ℵ₀ lemma aleph_0_le_continuum : ℵ₀ ≤ 𝔠 := aleph_0_lt_continuum.le lemma nat_lt_continuum (n : ℕ) : ↑n < 𝔠 := (nat_lt_aleph_0 n).trans aleph_0_lt_continuum lemma mk_set_nat : #(set ℕ) = 𝔠 := by simp lemma continuum_pos : 0 < 𝔠 := nat_lt_continuum 0 lemma continuum_ne_zero : 𝔠 ≠ 0 := continuum_pos.ne' lemma aleph_one_le_continuum : aleph 1 ≤ 𝔠 := by { rw ←succ_aleph_0, exact order.succ_le_of_lt aleph_0_lt_continuum } /-! ### Addition -/ @[simp] lemma aleph_0_add_continuum : ℵ₀ + 𝔠 = 𝔠 := add_eq_right aleph_0_le_continuum aleph_0_le_continuum @[simp] lemma continuum_add_aleph_0 : 𝔠 + ℵ₀ = 𝔠 := (add_comm _ _).trans aleph_0_add_continuum @[simp] lemma continuum_add_self : 𝔠 + 𝔠 = 𝔠 := add_eq_right aleph_0_le_continuum le_rfl @[simp] lemma nat_add_continuum (n : ℕ) : ↑n + 𝔠 = 𝔠 := add_eq_right aleph_0_le_continuum (nat_lt_continuum n).le @[simp] lemma continuum_add_nat (n : ℕ) : 𝔠 + n = 𝔠 := (add_comm _ _).trans (nat_add_continuum n) /-! ### Multiplication -/ @[simp] @[simp] lemma continuum_mul_aleph_0 : 𝔠 * ℵ₀ = 𝔠 := mul_eq_left aleph_0_le_continuum aleph_0_le_continuum aleph_0_ne_zero @[simp] lemma aleph_0_mul_continuum : ℵ₀ * 𝔠 = 𝔠 := (mul_comm _ _).trans continuum_mul_aleph_0 @[simp] lemma nat_mul_continuum {n : ℕ} (hn : n ≠ 0) : ↑n * 𝔠 = 𝔠 := mul_eq_right aleph_0_le_continuum (nat_lt_continuum n).le (nat.cast_ne_zero.2 hn) @[simp] lemma continuum_mul_nat {n : ℕ} (hn : n ≠ 0) : 𝔠 * n = 𝔠 := (mul_comm _ _).trans (nat_mul_continuum hn) /-! ### Power -/ @[simp] lemma aleph_0_power_aleph_0 : aleph_0.{u} ^ aleph_0.{u} = 𝔠 := power_self_eq le_rfl @[simp] lemma nat_power_aleph_0 {n : ℕ} (hn : 2 ≤ n) : (n ^ aleph_0.{u} : cardinal.{u}) = 𝔠 := nat_power_eq le_rfl hn @[simp] lemma continuum_power_aleph_0 : continuum.{u} ^ aleph_0.{u} = 𝔠 := by rw [←two_power_aleph_0, ←power_mul, mul_eq_left le_rfl le_rfl aleph_0_ne_zero] end cardinal
(*Inductive eq2 (A:Type) (x:A) : A -> Prop := eq_refl2 : eq2 A x x.*) Inductive eq2 (A:Type) : A -> A -> Prop := eq_refl2 : forall (x:A), eq2 A x x. Definition eq_symm (A:Type) (x y:A) (H:eq x y) : eq y x := match H in eq _ z return eq z x with | eq_refl _ => eq_refl x end. Print eq_ind. Print eq_sym. Print eq.
theory Chap2_3 imports Main begin datatype 'a tree = Tip | Node "'a tree" 'a "'a tree" fun contents :: "'a tree \<Rightarrow> 'a list" where "contents Tip = []" | "contents (Node l a r) = a # contents l @ contents r" fun sum_tree :: "nat tree \<Rightarrow> nat" where "sum_tree Tip = 0" | "sum_tree (Node l a r) = a + sum_tree l + sum_tree r" lemma "sum_tree t = sum_list (contents t)" apply (induction t) by auto definition pre_order :: "'a tree \<Rightarrow> 'a list" where "pre_order t = contents t" fun post_order :: "'a tree \<Rightarrow> 'a list" where "post_order Tip = []" | "post_order (Node l a r) = post_order l @ post_order r @ [a]" fun mirror :: "'a tree \<Rightarrow> 'a tree" where "mirror Tip = Tip" | "mirror (Node l a r) = Node (mirror r) a (mirror l)" lemma "pre_order (mirror t) = rev (post_order t)" apply (induction t) by (auto simp add: pre_order_def) fun intersperse :: "'a \<Rightarrow> 'a list \<Rightarrow> 'a list" where "intersperse a [] = []" | "intersperse a [x] = [x]" | "intersperse a (x#y#xs) = x#a#y#(intersperse a xs)" lemma "map f (intersperse a xs) = intersperse (f a) (map f xs)" apply (induction xs rule: intersperse.induct) by simp+ end
[STATEMENT] lemma set_shuffles: "zs \<in> shuffles xs ys \<Longrightarrow> set zs = set xs \<union> set ys" [PROOF STATE] proof (prove) goal (1 subgoal): 1. zs \<in> shuffles xs ys \<Longrightarrow> set zs = set xs \<union> set ys [PROOF STEP] by (induction xs ys arbitrary: zs rule: shuffles.induct) auto
lemma bounded_plus: fixes S ::"'a::real_normed_vector set" assumes "bounded S" "bounded T" shows "bounded ((\<lambda>(x,y). x + y) ` (S \<times> T))"
[STATEMENT] lemma real_is_int_add_int_of_real: "real_is_int a \<Longrightarrow> real_is_int b \<Longrightarrow> (int_of_real (a+b)) = (int_of_real a) + (int_of_real b)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. \<lbrakk>real_is_int a; real_is_int b\<rbrakk> \<Longrightarrow> int_of_real (a + b) = int_of_real a + int_of_real b [PROOF STEP] by (auto simp add: int_of_real_def real_is_int_def)
Require Import Bool.Bvector. Require Import ZArith. Require Import QArith. Require Import ZArith.Znumtheory. Require Import ZArith.BinInt. Require Import QArith.Qabs. Require Import Vectors.Fin. Require Import Vectors.VectorDef. Require Import Vectors.VectorSpec. Require Import Vectors.Vector. Open Scope nat_scope. Definition div_eucl_z := BinIntDef.Z.div_eucl. Fixpoint getAcc (n:nat) : Q := match n with |O => 1#1 |S m => Qmult (1#10) (getAcc m) end. (*double*) Definition lenExp : nat := 11. Definition lenSign : nat :=52. Definition sqrtEps : Q := getAcc 50. (*single*) (* Definition lenExp : nat := 8. Definition lenSign : nat :=23. (*1e-10*) Definition sqrtEps : Q := getAcc 25. *) Fixpoint getPowerTwo (power : nat) := match power with |O => 1 |S m => 2* (getPowerTwo m) end. Fixpoint getMaxExp (lenExp : nat) : nat := match lenExp with |O => O |S m => let result := getPowerTwo m in match result with |O => O |S n => n end end. Fixpoint getAllFalseVector (len : nat) : Bvector len := match len with |O => Vector.nil bool |S m => Vector.cons bool false m (getAllFalseVector m) end. Fixpoint getAllTrueVector (len : nat) : Bvector len := match len with |O => Vector.nil bool |S m => Vector.cons bool true m (getAllTrueVector m) end. Fixpoint getNotAllFalseVector (len:nat) : Bvector len := match len with |O => Vector.nil bool |S m => Vector.cons bool true m (getAllFalseVector m) end. Fixpoint getBiasVector (len:nat) : Bvector len := match len with |O => Vector.nil bool |S m => Vector.cons bool false m (getAllTrueVector m) end. Definition shiftExp : nat := getMaxExp lenExp. Definition maxExp : nat := getMaxExp lenExp. Definition allTrueExp : Bvector lenExp := getAllTrueVector lenExp. Definition allFalseExp : Bvector lenExp := getAllFalseVector lenExp. Definition zeroExp : Bvector lenExp := getBiasVector lenExp. Definition bias : Bvector lenExp := getBiasVector lenExp. Definition allFalseSignificant : Bvector lenSign := getAllFalseVector lenSign. Definition notAllFalseSignificant : Bvector lenSign := getNotAllFalseVector lenSign. Record fp_num : Set := mkFp { sign : bool; exp : Bvector lenExp; significant : Bvector lenSign }. Definition NaN : fp_num := mkFp true allTrueExp notAllFalseSignificant. Definition plusInfinity : fp_num := mkFp false allTrueExp allFalseSignificant. Definition minusInfinity : fp_num := mkFp true allTrueExp allFalseSignificant. Definition plusZero : fp_num := mkFp false allFalseExp allFalseSignificant. Definition minusZero : fp_num := mkFp true allFalseExp allFalseSignificant. (* BEGIN *) (* determine type number *) Fixpoint isVectAllTrue (n:nat) (v : Bvector n) : bool := match v with | Vector.nil => true | Vector.cons h m w => if h then (isVectAllTrue m w) else false end. Fixpoint isVectAllFalse (n:nat) (v : Bvector n) : bool := match v with | Vector.nil => true | Vector.cons h m w => if h then false else (isVectAllFalse m w) end. Fixpoint isExpforZero (v : Bvector lenExp) : bool := isVectAllFalse lenExp v. Fixpoint isNaN (fp : fp_num) : bool := if isVectAllTrue lenExp fp.(exp) then negb (isVectAllFalse lenSign fp.(significant) ) else false. Fixpoint isInfinite (fp : fp_num) : bool := if isVectAllTrue lenExp fp.(exp) then isVectAllFalse lenSign fp.(significant) else false. Fixpoint isFinite (fp : fp_num) : bool := negb (isNaN fp || isInfinite fp). Fixpoint isZero (fp : fp_num) : bool := (isExpforZero fp.(exp) && isVectAllFalse lenSign fp.(significant)). (* determine type number *) (* END *) (* BEGIN *) (* compare fp_num *) Fixpoint compareSys (n:nat) (m:nat) (v1 : Bvector n) (v2 : Bvector m) : comparison := match v1 with | Vector.nil => Eq | Vector.cons h1 m1 w1 => match v2 with | Vector.nil => Eq | Vector.cons h2 m2 w2 => if eqb h1 h2 then compareSys m1 m2 w1 w2 else if h1 then Gt else Lt end end. Fixpoint compareVect (n:nat) (v1 v2 : Bvector n) : comparison := compareSys n n v1 v2. Fixpoint compareExp (fp1 fp2 : fp_num) : comparison := compareVect lenExp fp1.(exp) fp2.(exp). Fixpoint compareSignificant (fp1 : fp_num) (fp2 : fp_num) : comparison := compareVect lenSign fp1.(significant) fp2.(significant). Fixpoint compareSign (fp1 fp2 : fp_num) : comparison := if eqb fp1.(sign) fp2.(sign) then Eq else if fp1.(sign) then Lt else Gt. Fixpoint compareAbs (fp1 fp2 : fp_num) : comparison := match compareExp fp1 fp2 with | Lt => Lt | Gt => Gt | Eq => compareSignificant fp1 fp2 end. Fixpoint compare (fp1 fp2 : fp_num) : comparison := match compareSign fp1 fp2 with | Lt => Lt | Gt => Gt | Eq => match compareExp fp1 fp2 with | Lt => Lt | Gt => Gt | Eq => compareSignificant fp1 fp2 end end. (*<*) Fixpoint isLt (c:comparison) : bool := match c with |Lt => true |_ => false end. (*==*) Fixpoint isEq (c:comparison) : bool := match c with |Eq => true |_ => false end. (*>*) Fixpoint isGt (c:comparison) : bool := match c with |Gt => true |_ => false end. (*<=*) Fixpoint isLE (c:comparison) : bool := match c with |Gt => false |_ => true end. (*!=*) Fixpoint isNE (c:comparison) : bool := match c with |Eq => false |_ => true end. (*>=*) Fixpoint isGE (c:comparison) : bool := match c with |Lt => false |_ => true end. Fixpoint isGeFp_bool (x y :fp_num) : bool := isGE (compare x y). Fixpoint isNeFp_bool (x y :fp_num) : bool := isNE (compare x y). Fixpoint isLeFp_bool (x y :fp_num) : bool := isLE (compare x y). Fixpoint isGtFp_bool (x y :fp_num) : bool := isGt (compare x y). Fixpoint isLtFp_bool (x y :fp_num) : bool := isLt (compare x y). Fixpoint isEqFp_bool (x y :fp_num) : bool := isEq (compare x y). (* compare fp_num *) (* END *) (* compare Q*) (* BEGIN *) Fixpoint isGeQ_bool (x y :Q) : bool := isGE (Qcompare x y). Fixpoint isNeQ_bool (x y :Q) : bool := isNE (Qcompare x y). Fixpoint isLeQ_bool (x y :Q) : bool := isLE (Qcompare x y). Fixpoint isGtQ_bool (x y :Q) : bool := isGt (Qcompare x y). Fixpoint isLtQ_bool (x y :Q) : bool := isLt (Qcompare x y). Fixpoint isEqQ_bool (x y :Q) : bool := isEq (Qcompare x y). (* compare Q*) (* END *) Definition invertV (n : nat) := nat_rect (fun n => Bvector n -> Bvector n) (fun v => Bnil) (fun k x v => Bcons (Vector.last v) _ (x (Vector.shiftout v))). Definition neg (fp : fp_num) : fp_num := mkFp (negb fp.(sign)) fp.(exp) fp.(significant). Fixpoint abs (fp:fp_num) : fp_num := mkFp false fp.(exp) fp.(significant). Definition sumDigits (carry a b : bool) : bool * bool := if carry then if a then if b then (true,true) else (true,false) else if b then (true,false) else (false,true) else if a then if b then (true,false) else (false,true) else if b then (false,true) else (false,false). (* a -(b+carry) *) Definition diffDigits (carry a b : bool) : bool * bool := if carry then if b then if a then (true,true) else (true,false) else if a then (false,false) else (true,true) else if b then if a then (false,false) else (true,true) else if a then (false,true) else (false,false). Fixpoint plusBoolInvV (n:nat) (b:bool) (v :Bvector n) : Bvector n := if b then match v with | Vector.nil => [] | Vector.cons h m w => let res := sumDigits b h false in if fst res then Vector.cons bool (snd res) m (plusBoolInvV m (fst res) w) else Vector.cons bool (snd res) m w end else v. Fixpoint minusBoolInvV (n:nat) (b:bool) (v :Bvector n) : Bvector n := if b then match v with | Vector.nil => [] | Vector.cons h m w => let res:=diffDigits b h false in if fst res then Vector.cons bool (snd res) m (minusBoolInvV m (fst res) w) else Vector.cons bool (snd res) m w end else v. Fixpoint plusBoolV (n:nat) (b:bool) (v :Bvector n) : Bvector n := invertV n n (plusBoolInvV n b (invertV n n v)). Fixpoint minusBoolV (n:nat) (b:bool) (v :Bvector n) : Bvector n := invertV n n (minusBoolInvV n b (invertV n n v)). Fixpoint plusTrueToExp (fp : fp_num) : fp_num := mkFp fp.(sign) (plusBoolV lenExp true fp.(exp) ) fp.(significant). Fixpoint minusTrueFromExp (fp : fp_num) : fp_num := mkFp fp.(sign) (minusBoolV lenExp true fp.(exp) ) fp.(significant). (* remove last shift right add head *) Definition shiftReplaceR (val : bool) : forall n : nat, (Bvector n -> Bvector n) := nat_rect (fun n => (Bvector n -> Bvector n)) (fun x => Bnil) (fun k x w => Bcons val _ (Vector.shiftout w)). (* remove head shift left add last *) Definition shiftReplaceL (val : bool) (n:nat) (v : Bvector n) : Bvector n := invertV n n (shiftReplaceR val n (invertV n n v)). Definition shiftSignificantR (val : bool) (fp:fp_num) : fp_num := mkFp fp.(sign) fp.(exp) (shiftReplaceR val lenSign fp.(significant)). Definition shiftSignificantL (val : bool) (fp:fp_num) : fp_num := mkFp fp.(sign) fp.(exp) (shiftReplaceL val lenSign fp.(significant)). Fixpoint vect2NatSys (pow :nat) (n:nat) (v:Bvector n) : nat := match v with |Vector.nil => O |Vector.cons h m w => if h then pow + (vect2NatSys (2*pow) m w)%nat else vect2NatSys (2*pow) m w end. Fixpoint vect2Nat (n:nat) (v:Bvector n) : nat := vect2NatSys 1 n (invertV n n v). Fixpoint exp2Nat (fp: fp_num) : nat := vect2Nat lenExp fp.(exp). Fixpoint nat2Vect (n len:nat) (v:Bvector len) (minus:bool) :Bvector len := match n with |O => v |S m => let newV := if minus then minusBoolV len true v else plusBoolV len true v in nat2Vect m len newV minus end. (* fp1.(exp) < fp2.(exp) *) Fixpoint difExp (fp1 fp2 : fp_num) : nat :=(exp2Nat fp2 - exp2Nat fp1)%nat. Fixpoint countZero (n:nat) (v: Bvector n) : nat := match v with |Vector.nil => O |Vector.cons h m w => if h then O else S (countZero m w) end. Fixpoint alignmentExpSys (n:nat) (val:bool) (fp: fp_num) : fp_num := match n with | O => fp | S m => alignmentExpSys m false (shiftSignificantR val (plusTrueToExp fp)) end. Fixpoint normalizeFpSys (n:nat) (val:bool) (fp: fp_num) : fp_num := match n with | O => fp | S m => normalizeFpSys m false (shiftSignificantL val (minusTrueFromExp fp)) end. (* fp1.(exp) < fp2.(exp)*) Fixpoint alignmentExp (fp1 fp2 :fp_num) : fp_num := alignmentExpSys (difExp fp1 fp2) true fp1. Fixpoint normalizeFp (count:nat) (fp : fp_num) : fp_num := normalizeFpSys count false fp. Fixpoint sumVectors (n : nat) := Vector.rect2 (n:=n) (fun n l r => prod bool (Bvector n)) (false, []) (fun n l r prev a b => let (carry, result) := (sumDigits (fst prev) a b) in (carry, result :: (snd prev))). (* abs fp1 > abs fp2 *) Fixpoint diffVectors (n : nat) := Vector.rect2 (n:=n) (fun n l r => prod bool (Bvector n)) (false, []) (fun n l r prev a b => let (carry, result) := (diffDigits (fst prev) a b) in (carry, result :: (snd prev))). (* fp1.(exp) < fp2.(exp) *) Fixpoint sumOneSignFpSysNotEq (fp1 : fp_num) (fp2 : fp_num) : fp_num := let sumRes := sumVectors lenSign (alignmentExp fp1 fp2).(significant) fp2.(significant) in if fst sumRes then mkFp fp1.(sign) (plusBoolV lenExp true fp2.(exp) ) (shiftReplaceR false lenSign (snd sumRes)) else mkFp fp2.(sign) fp2.(exp) (snd sumRes). (* fp1.(exp) = fp2.(exp) *) Fixpoint sumOneSignFpSysEq (fp1 : fp_num) (fp2 : fp_num) : fp_num := let sumRes := sumVectors lenSign fp1.(significant) fp2.(significant) in if fst sumRes then mkFp fp1.(sign) (plusBoolV lenExp true fp1.(exp) ) (shiftReplaceR true lenSign (snd sumRes)) else mkFp fp1.(sign) (plusBoolV lenExp true fp1.(exp) ) (shiftReplaceR false lenSign (snd sumRes)). Fixpoint sumOneSignFp (fp1 : fp_num) (fp2 : fp_num) : fp_num := match compareExp fp1 fp2 with |Lt => sumOneSignFpSysNotEq fp1 fp2 |Gt => sumOneSignFpSysNotEq fp2 fp1 |Eq => sumOneSignFpSysEq fp2 fp1 end. (* abs fp1 > abs fp2 *) Fixpoint diffNotEqExpFp (fp1 : fp_num) (fp2 : fp_num) : fp_num := let res := diffVectors lenSign fp1.(significant) (alignmentExp fp2 fp1).(significant) in if fst res then normalizeFp (S (countZero lenSign (snd res))) (mkFp fp1.(sign) fp1.(exp) (snd res)) else normalizeFp (countZero lenSign (snd res)) (mkFp fp1.(sign) fp1.(exp) (snd res)). (* abs fp1 > abs fp2 *) Fixpoint diffEqExpFp (fp1 : fp_num) (fp2 : fp_num) : fp_num := let res := diffVectors lenSign fp1.(significant) fp2.(significant) in normalizeFp (S (countZero lenSign (snd res))) (mkFp fp1.(sign) fp1.(exp) (snd res)). (* abs fp1 > abs fp2 *) Fixpoint diffFpSys (fp1 : fp_num) (fp2 : fp_num) : fp_num := match compareExp fp1 fp2 with |Lt => diffNotEqExpFp fp2 fp1 |Gt => diffNotEqExpFp fp1 fp2 |Eq => diffEqExpFp fp1 fp2 end. Fixpoint diffFp2 (fp1 : fp_num) (fp2 : fp_num) : fp_num := match compareAbs fp1 fp2 with | Lt => diffFpSys fp2 fp1 | Gt => diffFpSys fp1 fp2 | Eq => if fp1.(sign) then minusZero else plusZero end. Fixpoint sumFinite (fp1 : fp_num) (fp2 : fp_num) : fp_num := if isZero fp1 then fp2 else if isZero fp2 then fp1 else match compareSign fp1 fp2 with |Eq => sumOneSignFp fp1 fp2 | _ => diffFp2 fp1 fp2 end. Fixpoint sumInfinite (fp1 : fp_num) (fp2 : fp_num) : fp_num := if isInfinite fp1 then if isInfinite fp2 then match compareSign fp1 fp2 with | Eq => fp1 | _ => NaN end else fp1 else fp2. Fixpoint sumFp (fp1 fp2 : fp_num) : fp_num := if isNaN fp1 || isNaN fp2 then NaN else if isInfinite fp1 || isInfinite fp2 then sumInfinite fp1 fp2 else sumFinite fp1 fp2. Fixpoint diffFp (fp1 fp2 : fp_num) : fp_num := sumFp fp1 (neg fp2). Fixpoint minusExponents (v1:Bvector lenExp) (v2 : Bvector lenExp) : Bvector lenExp := let v2New := Vector.cons bool false lenExp v2 in let v1New := Vector.cons bool false lenExp v1 in let biasNew := Vector.cons bool false lenExp bias in let tmp := snd (sumVectors (S lenExp) v1New biasNew) in let result := snd (diffVectors (S lenExp) tmp v2New) in Vector.tl result. Fixpoint SSVector (lenV:nat) (w:Bvector 2) (v:Bvector lenV) : Bvector (S (S lenV)) := let v1 := Vector.cons bool (Vector.last w) lenV v in Vector.cons bool (Vector.hd w) (S lenV) v1. Fixpoint PPVector (v:Bvector (S (S lenSign))) : (Bvector 2)*(Bvector lenSign) := let v1 := Vector.tl v in ([(Vector.hd v);(Vector.hd v1)],(Vector.tl v1)). Fixpoint divBit (n:nat) (div1:Bvector n) (div2:Bvector n) :bool*(Bvector n):= match compareVect n div1 div2 with |Lt => let w := shiftReplaceL false n div1 in (false,w) |_ => let tmp := snd (diffVectors n div1 div2) in (true,(shiftReplaceL false n tmp)) end. (*head - number before floating point last - for accuracy*) Fixpoint divSys (m:nat) (div1:Bvector m) (div2:Bvector m) (result:Bvector m) (n:nat): Bvector m := let res := divBit m div1 div2 in match n with |O => shiftReplaceL (fst res) m result |S l => divSys m (snd res) div2 (shiftReplaceL (fst res) m result) l end. Fixpoint removeLast (n:nat) (v:Bvector (S n)) : Bvector n := let vv := invertV (S n) (S n) v in invertV n n (Vector.tl vv). Fixpoint divFinite (fp1 fp2: fp_num) : fp_num := let n := S (S lenSign) in let v1 := SSVector lenSign [false;true] fp1.(significant) in let v2 := SSVector lenSign [false;true] fp2.(significant) in let zeroRes := SSVector lenSign [false;false] allFalseSignificant in let res:= divSys n v1 v2 zeroRes (S lenSign) in let resExp:= minusExponents fp1.(exp) fp2.(exp) in let leftPart := Vector.hd res in if leftPart then let significantRes := removeLast lenSign (Vector.tl res) in mkFp (xorb fp1.(sign) fp2.(sign)) resExp significantRes else let significantRes := Vector.tl (Vector.tl res) in mkFp (xorb fp1.(sign) fp2.(sign)) (minusBoolV lenExp true resExp) significantRes. Fixpoint divideFp (fp1 fp2: fp_num) : fp_num := if((isNaN fp1) || (isNaN fp2)) then NaN else if (isZero fp1 && isZero fp2) then NaN else if isZero fp2 then mkFp (xorb fp2.(sign) fp1.(sign)) plusInfinity.(exp) plusInfinity.(significant) else if isZero fp1 then fp1 else divFinite fp1 fp2. (**********************************MULTIPLICATION**********************************) Fixpoint sumExponents (v1:Bvector lenExp) (v2 : Bvector lenExp) : Bvector lenExp := let v2New := Vector.cons bool false lenExp v2 in let v1New := Vector.cons bool false lenExp v1 in let biasNew := Vector.cons bool false lenExp bias in let tmp := snd (sumVectors (S lenExp) v1New v2New) in let result := snd (diffVectors (S lenExp) tmp biasNew) in Vector.tl result. (*num*bit+result leftPoint,significant *) Fixpoint multOnBitSignificant (num:Bvector lenSign) (bit:bool) (result:Bvector lenSign) (leftPoint:Bvector 2) :(Bvector 2)*(Bvector lenSign) := let shiftResult := shiftReplaceR (Vector.last leftPoint) lenSign result in match bit with |false => ([false;Vector.hd leftPoint],shiftResult) |true => let sum := sumVectors lenSign shiftResult num in let resultLeft := sumDigits true (fst sum) (Vector.hd leftPoint) in ([fst resultLeft;snd resultLeft],snd sum) end. (* num1*num2 num2 - reverse*) Fixpoint multSignificantSysR (num1:Bvector lenSign) (n:nat) (num2:Bvector n) (result:Bvector lenSign) (leftPoint:Bvector 2) : (Bvector 2)*(Bvector lenSign) := match num2 with |Vector.nil => multOnBitSignificant num1 true result leftPoint |Vector.cons h m w => let nextResult := multOnBitSignificant num1 h result leftPoint in multSignificantSysR num1 m w (snd nextResult) (fst nextResult) end. Fixpoint getAllFalseVect (n:nat) : Bvector n := match n with |O => [] |S m => Vector.cons bool false m (getAllFalseVect m) end. Fixpoint multSignificant (num1 num2 : Bvector lenSign):Bvector (S (S lenSign)):= let num2R:= invertV lenSign lenSign num2 in let res := multSignificantSysR num1 lenSign num2R allFalseSignificant [false;false] in SSVector lenSign (fst res) (snd res). Fixpoint multFinite (fp1 fp2 : fp_num) : fp_num:= let signRes := xorb fp1.(sign) fp2.(sign) in let expRes := sumExponents fp1.(exp) fp2.(exp) in let multRes := multSignificant fp1.(significant) fp2.(significant) in let newRes := Vector.tl multRes in let needShift := Vector.hd multRes in if needShift then let newExpRes := plusBoolV lenExp true expRes in let newSignificant := shiftReplaceR (Vector.hd newRes) lenSign (Vector.tl newRes) in mkFp signRes newExpRes newSignificant else mkFp signRes expRes (Vector.tl newRes). Fixpoint multFp (fp1 fp2 :fp_num) : fp_num := if (isNaN fp1) || (isNaN fp2) then NaN else if(isInfinite fp1) then if(isInfinite fp2) then mkFp (xorb fp1.(sign) fp2.(sign)) fp1.(exp) fp1.(significant) else if(isZero fp2) then NaN else fp1 else if(isInfinite fp2) then if(isZero fp1) then NaN else fp2 else if isZero fp1 || isZero fp2 then plusZero else multFinite fp1 fp2. (*******************************SQRT*******************************) Fixpoint expSqrt (v:Bvector lenExp) : bool*(Bvector lenExp) := match compareVect lenExp v bias with |Lt => let res := diffVectors lenExp bias v in let tmp := shiftReplaceR false lenExp (snd res) in let newRes := diffVectors lenExp bias tmp in if (Vector.last v) then (false,snd newRes) else (true,minusBoolV lenExp true (snd newRes)) |_ => let res := diffVectors lenExp v bias in let tmp := shiftReplaceR false lenExp (snd res) in let newRes := sumVectors lenExp bias tmp in if (Vector.last v) then (false,snd newRes) else (true,snd newRes) end. Fixpoint setValToNPositionVect (n:nat) (val:bool) (lenV:nat) (v:Bvector lenV) : Bvector lenV := match nat_compare lenV n with |Lt => v |Eq => match v with |Vector.nil => [] |Vector.cons h m w => Vector.cons bool val m w end |Gt => match v with |Vector.nil => [] |Vector.cons h m w => let ww:= setValToNPositionVect n val m w in Vector.cons bool h m ww end end. Fixpoint setTrueToNPositionVect (n:nat) (lenV:nat) (v:Bvector lenV) : Bvector lenV := setValToNPositionVect n true lenV v. Fixpoint significantSqrtSys (evenExp:bool) (stepNum:nat) (num res:Bvector lenSign) : Bvector lenSign := match stepNum with |O=> res |S m => let newRes := setTrueToNPositionVect (S m) lenSign res in let tmp := multSignificant newRes newRes in let head := Vector.hd tmp in let tmp2 := Vector.tl tmp in if eqb head evenExp then let squaredRes := shiftReplaceR (Vector.hd tmp2) lenSign (Vector.tl tmp2) in match compareVect lenSign num squaredRes with |Lt => significantSqrtSys evenExp m num res |_ => significantSqrtSys evenExp m num newRes end else if(evenExp) then significantSqrtSys evenExp m num newRes else significantSqrtSys evenExp m num res end. Fixpoint significantSqrt (evenExp:bool) (significant:Bvector lenSign) : Bvector lenSign := significantSqrtSys evenExp lenSign significant allFalseSignificant. Fixpoint sqrtFpPos (fp:fp_num) : fp_num := let newExp := expSqrt fp.(exp) in let evenExp := fst newExp in let newSignificant := significantSqrt evenExp fp.(significant) in mkFp false (snd newExp) newSignificant. Fixpoint sqrtFp(fp:fp_num) : fp_num := if isNaN fp then fp else if isZero fp then fp else if fp.(sign) then NaN else if isInfinite fp then fp else sqrtFpPos fp. (***************************CONVERSATION***************************) Open Scope Z_scope. Open Scope positive_scope. Open Scope Q_scope. Fixpoint Qgcd (q:Q) : Q := let qnum := q.(Qnum) in let qden := Zpos q.(Qden) in let gcdRes := Z.gcd qnum qden in match Z.compare gcdRes 1 with |Eq => q |_ => let newNum := fst (div_eucl_z qnum gcdRes) in let newDen := fst (div_eucl_z qden gcdRes) in Qmake newNum (Z.to_pos newDen) end. Close Scope Z_scope. Close Scope positive_scope. Fixpoint vector2QSys (res:Q) (pow:Q) (n:nat) (v: Bvector n) : Q := match v with |Vector.nil => res |Vector.cons h m w => let newPow := Qmult (1#2) pow in let newRes := if h then Qplus res newPow else res in if h then vector2QSys (Qgcd newRes) newPow m w else vector2QSys newRes newPow m w end. Fixpoint vector2Q (n:nat) (v:Bvector n) : Q := vector2QSys 1 1 n v. Fixpoint significant2Q (fp : fp_num) : Q := vector2Q lenSign fp.(significant). Fixpoint power (base: Q) (pow:nat) : Q := match pow with |O => 1 |S m => Qmult base (power base m) end. Fixpoint exp2Q (fp: fp_num) : Q := if isExpforZero fp.(exp) then 0#1 else let expNat := exp2Nat fp in let biasNat := vect2Nat lenExp bias in match nat_compare expNat biasNat with |Lt => power (1#2) (biasNat - expNat) |_ => power (2#1) (expNat-biasNat) end. Fixpoint fp2Q (fp:fp_num) : Q := let qsign := significant2Q fp in let qexp := exp2Q fp in let res := Qgcd (Qmult qsign qexp) in if fp.(sign) then Qmult (-1#1) res else res. Fixpoint getSignificantFromQSys (num curPow:Q) (iter:nat) : Bvector iter := let newPow := Qmult (1#2) curPow in match iter with |O => [] |S m => match Qcompare num curPow with |Lt => Vector.cons bool false m (getSignificantFromQSys num newPow m) |_ => let newNum := Qgcd (Qminus num curPow) in Vector.cons bool true m (getSignificantFromQSys newNum newPow m) end end. Fixpoint getSignificantFromQ (num:Q) : Bvector lenSign := getSignificantFromQSys num (1#2) lenSign. Fixpoint computeExpSmallSys (num:Q) (iter:nat) :nat*Q := match iter with |O => (O,num) |S m => let newNum := Qmult num (2#1) in match Qcompare newNum (1#1) with |Lt => let res := computeExpSmallSys newNum m in (S (fst res),snd res) |_ => (S O, newNum) end end. Fixpoint computeExpSmall (num:Q) : (Bvector lenExp)*Q := let res := computeExpSmallSys num shiftExp in let secondRes := nat2Vect (fst res) lenExp bias true in (secondRes,snd res). Fixpoint computeExpBigSys (num:Q) (iter:nat) :nat*Q := match iter with |O => (O,num) |S m => let newNum := Qmult num (1#2) in match Qcompare newNum (2#1) with |Lt => (S O,newNum) | _ => let res := computeExpBigSys newNum m in (S (fst res),snd res) end end. Fixpoint computeExpBig (num:Q) : (Bvector lenExp)*Q := let res :=computeExpBigSys num shiftExp in let secondRes := nat2Vect (fst res) lenExp bias false in (secondRes,snd res). Fixpoint getExp (num:Q) : (Bvector lenExp)*Q := let newNum := Qabs num in match Qcompare newNum (2#1) with |Lt => match Qcompare newNum (1#1) with |Lt => computeExpSmall newNum | _ => (bias,num) end | _ => computeExpBig newNum end. Fixpoint Q2Fp (num:Q): fp_num := match Qcompare num (0#1) with |Eq => plusZero |_ => let sign := match Qcompare num (0#1) with |Lt => true | _ => false end in let res := getExp num in let significant := getSignificantFromQ (Qminus (snd res) (1#1)) in mkFp sign (fst res) significant end. Fixpoint sqrtStepQ (a res eps : Q) (step:nat) : Q := let gcdRes := Qgcd res in match step with |O => gcdRes |S m => let sq:=Qabs (gcdRes*gcdRes-a) in match Qcompare sq eps with |Lt => gcdRes | _ => let newRes := (1#2)*(gcdRes + a/gcdRes) in sqrtStepQ a newRes eps m end end. Fixpoint sqrtAccQ ( acc a : Q) : Q := match Qcompare a (0#1) with |Lt => (-1#1) | _ => match Qcompare acc (0#1) with |Gt => sqrtStepQ a a acc lenSign | _ => (-1#1) end end. Definition sqrtQ(a:Q) : Q := sqrtAccQ sqrtEps a. Definition sqrtAccFp (acc:Q) (fp:fp_num) : fp_num:= sqrtFp fp. Fixpoint reflectQ (num:Q) : Q := num. Fixpoint max (n m:nat) : nat := match n, m with | O, _ => m | S n', O => n | S n', S m' => S (max n' m') end. Record ApproxArith := mkApproxArith { Num : Set; sum : Num -> Num -> Num; diff : Num -> Num -> Num; mult : Num -> Num -> Num; div : Num -> Num -> Num; sqrt : Num -> Num; from_rational : Q -> Num; to_rational : Num -> Q; lt : Num -> Num -> bool; le : Num -> Num -> bool; eq : Num -> Num -> bool; ge : Num -> Num -> bool; gt : Num -> Num -> bool }. Definition approxFp := mkApproxArith fp_num sumFp diffFp multFp divideFp sqrtFp Q2Fp fp2Q isLtFp_bool isLeFp_bool isEqFp_bool isGeFp_bool isGtFp_bool. Definition approxQ := mkApproxArith Q Qplus Qminus Qmult Qdiv sqrtQ reflectQ reflectQ isLtQ_bool isLeQ_bool isEqQ_bool isGeQ_bool isGtQ_bool. Inductive ArithExp (n: nat):= |Get (i: Fin.t n) |Const (c: Q) |Add(a b :ArithExp n) |Diff(a b:ArithExp n) |Mult(a b:ArithExp n) |Div(a b:ArithExp n) |Sqrt(a :ArithExp n) |Noting |If(cond:BoolExp n) (onTrue: ArithExp n) (onFalse: ArithExp n) with BoolExp(n:nat) := |And (a b : BoolExp n) |Or (a b :BoolExp n) |Eq (a b : ArithExp n) |Gt (a b : ArithExp n) |Ge (a b : ArithExp n) |Lt (a b : ArithExp n) |Le (a b : ArithExp n). Close Scope Q_scope. (*result_code,result*) (*result_code: 0-ok,1-don't put,x>1 - error *) Definition ok_code: nat := 0. Definition nothing_code : nat := 1. Definition error_code : nat := 2. Fixpoint computeExp (n:nat) (arith: ApproxArith) (exp: ArithExp n) (init : t (Num arith) n) : nat*(Num arith) := let error:= from_rational arith (-1#1) in let zero := from_rational arith 0 in match exp with |Get x => (0,nth init x) |Const x => (0,from_rational arith x) |Add x1 x2 => let res1 := computeExp n arith x1 init in let code_1 := fst res1 in let result_1 := snd res1 in let res2 := computeExp n arith x2 init in let code_2 := fst res2 in let result_2 := snd res2 in if andb (leb code_1 ok_code) (leb code_2 ok_code) then (ok_code, sum arith result_1 result_2) else (max code_1 code_2,error) |Diff x1 x2 => let res1 := computeExp n arith x1 init in let code_1 := fst res1 in let result_1 := snd res1 in let res2 := computeExp n arith x2 init in let code_2 := fst res2 in let result_2 := snd res2 in if andb (leb code_1 ok_code) (leb code_2 ok_code) then (ok_code, diff arith result_1 result_2) else (max code_1 code_2,error) |Mult x1 x2 => let res1 := computeExp n arith x1 init in let code_1 := fst res1 in let result_1 := snd res1 in let res2 := computeExp n arith x2 init in let code_2 := fst res2 in let result_2 := snd res2 in if andb (leb code_1 ok_code) (leb code_2 ok_code) then (ok_code, mult arith result_1 result_2) else (max code_1 code_2,error) |Div x1 x2 => let res1 := computeExp n arith x1 init in let code_1 := fst res1 in let result_1 := snd res1 in let res2 := computeExp n arith x2 init in let code_2 := fst res2 in let result_2 := snd res2 in if andb (leb code_1 ok_code) (leb code_2 ok_code) then if (eq arith result_2 zero) then (error_code,error) else (ok_code, div arith result_1 result_2) else (max code_1 code_2,error) |Sqrt x => let res := computeExp n arith x init in let code := fst res in let result := snd res in if (leb code ok_code) then if (ge arith result zero) then (ok_code,sqrt arith result) else (error_code,error) else (code,error) |If cond onTrue onFalse => let cond_res := computeBoolExp n arith cond init in let cond_code := fst cond_res in let cond_val := snd cond_res in if (leb cond_code ok_code) then if cond_val then computeExp n arith onTrue init else computeExp n arith onFalse init else (error_code,error) |Nothing => (nothing_code,error) end with computeBoolExp (n:nat) (arith: ApproxArith) (exp: BoolExp n) (init : t (Num arith) n) : nat*bool := match exp with |And x y => let res1 := computeBoolExp n arith x init in let res2 := computeBoolExp n arith y init in let code_1 := fst res1 in let code_2 := fst res2 in let result_1 := snd res1 in let result_2 := snd res2 in if andb (leb code_1 ok_code) (leb code_2 ok_code) then (ok_code,andb result_1 result_2) else (error_code,false) |Or x y => let res1 := computeBoolExp n arith x init in let res2 := computeBoolExp n arith y init in let code_1 := fst res1 in let code_2 := fst res2 in let result_1 := snd res1 in let result_2 := snd res2 in if andb (leb code_1 ok_code) (leb code_2 ok_code) then (ok_code,orb result_1 result_2) else (error_code,false) |Eq x y => let res1 := computeExp n arith x init in let code_1 := fst res1 in let result_1 := snd res1 in let res2 := computeExp n arith y init in let code_2 := fst res2 in let result_2 := snd res2 in if andb (leb code_1 ok_code) (leb code_2 ok_code) then (ok_code, eq arith result_1 result_2) else (error_code,false) |Gt x y => let res1 := computeExp n arith x init in let code_1 := fst res1 in let result_1 := snd res1 in let res2 := computeExp n arith y init in let code_2 := fst res2 in let result_2 := snd res2 in if andb (leb code_1 ok_code) (leb code_2 ok_code) then (ok_code, gt arith result_1 result_2) else (error_code,false) |Ge x y => let res1 := computeExp n arith x init in let code_1 := fst res1 in let result_1 := snd res1 in let res2 := computeExp n arith y init in let code_2 := fst res2 in let result_2 := snd res2 in if andb (leb code_1 ok_code) (leb code_2 ok_code) then (ok_code, ge arith result_1 result_2) else (error_code,false) |Lt x y => let res1 := computeExp n arith x init in let code_1 := fst res1 in let result_1 := snd res1 in let res2 := computeExp n arith y init in let code_2 := fst res2 in let result_2 := snd res2 in if andb (leb code_1 ok_code) (leb code_2 ok_code) then (ok_code, lt arith result_1 result_2) else (error_code,false) |Le x y => let res1 := computeExp n arith x init in let code_1 := fst res1 in let result_1 := snd res1 in let res2 := computeExp n arith y init in let code_2 := fst res2 in let result_2 := snd res2 in if andb (leb code_1 ok_code) (leb code_2 ok_code) then (ok_code, le arith result_1 result_2) else (error_code,false) end. Fixpoint interp (n:nat) (arith :ApproxArith) (prog : list ((Fin.t n) *(ArithExp n))) (init: t (Num arith) n) : nat*(t (Num arith) n) := match prog with |List.nil => (ok_code,init) |List.cons h tl => let pos := fst h in let exp := snd h in let res := computeExp n arith exp init in let code := fst res in let val := snd res in if leb code ok_code then interp n arith tl (replace init pos val) else if leb code nothing_code then interp n arith tl init else (error_code,init) end.
If $S$ is Lebesgue measurable, then the Lebesgue measure on $S$ is a finite measure.
[STATEMENT] lemma ik_hfs_form: "t \<in> parts ik_hfs \<Longrightarrow> \<exists> t' . t = Hash t'" [PROOF STATE] proof (prove) goal (1 subgoal): 1. t \<in> parts ik_hfs \<Longrightarrow> \<exists>t'. t = Hash t' [PROOF STEP] by(auto 3 4 simp add: auth_seg2_def dest: auth_properties)
next.perm <- function(p) { n <- length(p) i <- n - 1 r = TRUE for(i in (n-1):1) { if(p[i] < p[i+1]) { r = FALSE break } } j <- i + 1 k <- n while(j < k) { x <- p[j] p[j] <- p[k] p[k] <- x j <- j + 1 k <- k - 1 } if(r) return(NULL) j <- n while(p[j] > p[i]) j <- j - 1 j <- j + 1 x <- p[i] p[i] <- p[j] p[j] <- x return(p) } print.perms <- function(n) { p <- 1:n while(!is.null(p)) { cat(p,"\n") p <- next.perm(p) } } print.perms(3) # 1 2 3 # 1 3 2 # 2 1 3 # 2 3 1 # 3 1 2 # 3 2 1
[STATEMENT] lemma decseq_imp_monoseq: "decseq X \<Longrightarrow> monoseq X" [PROOF STATE] proof (prove) goal (1 subgoal): 1. decseq X \<Longrightarrow> monoseq X [PROOF STEP] by (simp add: decseq_def monoseq_def)
lemma sum_delta'': fixes s::"'a::real_vector set" assumes "finite s" shows "(\<Sum>x\<in>s. (if y = x then f x else 0) *\<^sub>R x) = (if y\<in>s then (f y) *\<^sub>R y else 0)"
lemma continuous_on_inversediff: fixes z:: "'a::real_normed_field" shows "z \<notin> S \<Longrightarrow> continuous_on S (\<lambda>w. 1 / (w - z))"
[STATEMENT] lemma [code]: "0 = vec_to_bfun 0" [PROOF STATE] proof (prove) goal (1 subgoal): 1. 0 = vec_to_bfun 0 [PROOF STEP] by (auto simp: vec_to_bfun_def)
module Anderson using LinearAlgebra, Parameters include("qrtools.jl") include("function_iteration.jl") include("anderson_lowalloc.jl") end # module
-- Andreas, 2013-03-22 module Issue473a where data D : Set where d : D data P : D → Set where p : P d record Rc : Set where constructor c field f : D works : {r : Rc} → P (Rc.f r) → Set works p = D works' : (r : Rc) → P (Rc.f r) → Set works' (c .d) p = D -- We remove the constructor: record R : Set where field f : D test : {r : R} → P (R.f r) → Set test p = D
Formal statement is: lemma power_eq_imp_eq_norm: fixes w :: "'a::real_normed_div_algebra" assumes eq: "w ^ n = z ^ n" and "n > 0" shows "norm w = norm z" Informal statement is: If $w^n = z^n$ for some $n > 0$, then $|w| = |z|$.
\chapter{The \acl{SM}} \label{chap:intro:sm} The \acf{SM} is a quantum field theory that describes the interactions of three of the four fundamental forces of nature, electromagnetism, the weak force, and the strong force, with a set of fundamental particles. The \ac{SM} makes many predictions, from the spectral lines of the hydrogen atom to the rate of the \BsTomumu\ decay, and so far no experimental results have provided conclusive proof that such predictions are, fundamentally, incorrect. The absence of a description of the fourth fundamental force, gravity, the non-zero masses of neutrinos, and several astronomical observations indicate that, at the very least, the \ac{SM} is not a complete description of the universe. It does not describe the observed matter-antimatter asymmetry, nor can it account for the apparent presence of dark matter. The purpose of the \ac{LHC} is to provide experiments with enough data to be able to find minute deviations from the predictions of the \ac{SM}, which could point to particular extensions of theory. In this \lcnamecref{chap:intro:sm}, the forces and particles described by the \ac{SM} are summarised. Particular emphasis is given to the phenomenology of the weak force, which the \lhcb\ detector is optimised to study. The \ac{SM} is a powerful predictive model partly due to its use of symmetries, which, through Noether's theorem, give rise to conserved currents. For example, the symmetry of physical laws to rotations in space and translations in time leads to the conservation of total angular momentum and energy, respectively. In a quantum field theory, each of these currents are quantised in units of a quantum charge. Interactions with a field only occur if the particles are charged under that field, such as the familiar electric charge for the electromagnetic field, and all interactions conserve the total charge of the system. Interactions with fields are mediated via the exchange of bosons, particles with integer spin, such as the photon, the force carrier of the electromagnetic field. Fermions are particles with half-integer spins; the quarks, leptons, and neutrinos constitute the fundamental fermions. The known fundamental particles of the \ac{SM}, along with their measured electric charges and spins, are shown in \cref{tab:intro:sm:particles}. \begin{table} \centering \caption{% Properties of the fundamental particles of the \acl{SM}~\cite{PDG2014}. The electric charge is given in units of the electron charge. } \label{tab:intro:sm:particles} \input{tables/introduction/fundamental_particles} \end{table} The strong force acts on particles with colour charge, quarks and gluons, via the exchange of gluons. The fact that gluons are charged under the force they mediate significantly complicates the theory of strong interactions. At low energies, the self interaction leads to the phenomenon of confinement, whereby free colour-charged objects cannot be observed, as the attractive force between two colour-charged objects is approximately constant at large separations, and so an infinite amount of energy is required to separate such objects completely. Conversely, at higher energies, these particles become asymptotically free, eventually forming a quark-gluon plasma. The energy scale at which the transition between these two regimes occurs is denoted \qcdscale. Theoretical studies of the strong force use the framework of \ac{QCD}, which can either be used perturbatively, when the energy scale of the process under consideration is much larger than \qcdscale, or non-perturbatively, when the opposite is true. It is feasible to make predictions using perturbative \ac{QCD}, although the computations become more challenging as the order in the perturbative expansions increases. Predictions requiring non-perturbative \ac{QCD} are generally not possible to perform analytically with today's understanding, although lattice \ac{QCD} can offer an alternate means of computation for some problems. In most cases, experimental input is necessary to constrain the theory. One such example of a non-perturbative problem is the prediction of \pp\ cross-sections at the \ac{LHC}, which will be discussed in more detail in \cref{chap:prod:theory}. Through confinement, the six quarks (\Pup, \Pdown, \Pcharm, \Pstrange, \Ptop, and \Pbottom) cannot be observed as free states. The five lightest quarks bind together to form hadrons, colourless states of two or more quarks bound together with a `sea' of gluons. The top quark decays too quickly to form such states. When quarks and gluons act as outgoing objects in interactions, the observed final state is a shower of colourless particles, where the initial quark or gluon `fragments' into additional coloured objects. These eventually form colourless bound states through the process of hadronisation. Mesons are hadrons comprising a quark-anti-quark pair, and baryons contain three quarks or three anti-quarks. More exotic states, such as tetra- or penta-quarks, also exist~\cite{Choi:2007wga,Aaij:2014jqa,Aaij:2015tga}, but have not been observed outside of particle collider experiments. The behaviour of hadrons can be studied with a particle detector to infer the behaviour of the quarks and gluons. In particular, the \lhcb\ detector is optimised to select and reconstruct the decays of mesons and baryons containing \Pcharm and \Pbottom quarks, in order to probe the nature of the weak force. These include the charm mesons \PDzero~($\Pcharm\APup$) and \PDp~($\Pcharm\APdown$), beauty mesons \PBzero~($\Pdown\APbottom$) and \PBp~($\Pup\APbottom$), and the charm and beauty baryons \PLambdac~($\Pup\Pdown\Pcharm$) and \PLambdab~($\Pup\Pdown\Pbottom$). The decays of these hadrons to sets of comparatively long-lived particles, such as charged pions~($\Pup\APdown$) and kaons~($\Pup\APstrange$), protons~($\Pup\Pup\Pdown$), and leptons, allow the properties of the heavy flavour hadrons to be inferred through the interactions of the decay products with the detector.\footnotemark\ \footnotetext{% Throughout this thesis, charge conjugation is implied unless stated otherwise. } % and the carriers are the two charged \PWpm bosons and the neutral \PZ boson. The weak force interacts with particles with a left-handed chirality and with a non-zero weak isospin \wisospin. The chirality can be considered as a Lorentz-invariant version of the helicity (the projection of a particle's spin vector along its momentum vector), and as such encodes the intrinsic `handedness' of a particle. The symmetry under the parity transformation \Ptransform, which changes the sign of the spatial coordinates, is maximally violated by the weak force only coupling to particles with a left-handed chirality. The discovery of \Ptransform\ violation~\cite{Wu:1957my} was soon followed by the discovery of \CP\ violation~\cite{Christenson:1964fg}, the breaking of the symmetry of the \CP\ transformation which simultaneously changes the handedness of particles (\Ptransform) and transforms particles into their anti-particles. (\Ctransform). The weak force is particularly interesting to study because it is the only force to have been observed to break the \Ptransform\ and \CP\ symmetries. In addition, at high energies the weak field unifies with the electromagnetic field to form the electroweak field. Prior to the process of electroweak symmetry breaking, where the two component fields become physically distinguishable, the electroweak field has four massless degrees of freedom. After the symmetry is broken, two degrees of freedom are observed experimentally as the massive \PWp and \PWm bosons, whereas the other two degrees of freedom, $\PW^{0}$ and $\PB^{0}$, mix to form the observed massive \PZ boson and the massless photon. The `spontaneous' breaking of the electroweak unification at low energies is caused by the so-called Higgs mechanism, wherein an additional field, the Higgs field, contributes four additional degrees of freedom to the theory. Three degrees of freedom of the Higgs field mix with three degrees of freedom of the electroweak field to give masses to the \PWpm and \PZ bosons, whilst the fourth degree of freedom can be interpreted a new boson \PH, the Higgs particle. The study of the Higgs particle has only become possible with the \ac{LHC}, at which the Higgs boson was discovered by the \atlas\ and \cms\ collaborations~\cite{Aad:2012tfa,Chatrchyan:2012xdj}. Studies continue to measure the properties of the Higgs~\cite{Khachatryan:2016vau}, to see whether it behaves in a way predicted by the \ac{SM}. Deviations in the behaviour of this particle can indicate the presence of particles not predicted by the \ac{SM}, observations of which would be considered a major breakthrough in high energy physics. Observations of large \CP-violating effects would be of similar interest, but can relate to different phenomena. \section{\texorpdfstring{\CP}{CP} violation} \label{chap:intro:sm:cp} As the measurement of \CP\ violation in charm and beauty hadron decays is a cornerstone of the \lhcb\ physics programme, and indeed of \cref{chap:cpv} of this thesis, its mechanism will be describe here in more detail. The weak interaction eigenstates $(\Pdown', \Pstrange', \Pbottom')$ are different to the quark mass eigenstates $(\Pdown, \Pstrange, \Pbottom)$. The weak eigenstates are a superposition of the mass eigenstates, the linear coefficients of which are given by the \ac{CKM} matrix \begin{equation} \begin{pmatrix} \Pdown' \\ \Pstrange' \\ \Pbottom' \end{pmatrix} = V_{\text{CKM}}\begin{pmatrix} \Pdown \\ \Pstrange \\ \Pbottom \end{pmatrix} = \begin{pmatrix} \Vud & \Vus & \Vub \\ \Vcd & \Vcs & \Vcb \\ \Vtd & \Vts & \Vtb \end{pmatrix} \begin{pmatrix} \Pdown \\ \Pstrange \\ \Pbottom \end{pmatrix}, \end{equation} where $V_{ij}$ is the coupling of the $i$ to $j$ transition, e.g.\ $|\Vud|^{2}$ is the relative probability of the transition \decay{\Pdown}{\Pup}. The values of the \ac{CKM} matrix elements are not predicted by the \ac{SM} and so must be determined experimentally. There are several methods for determining the coupling constants, depending on the quarks involved, but each generally involves the measurement of one or more decay rates involving a particular quark transition, and require some theoretical input to disentangle the contributions from the strong and weak forces. One example measurement is that of $\beta$ decay, used as input to compute \Vud. Given that the up and down quarks are the most abundant, \Vud\ is particularly well known, with a fractional uncertainty of the order of \num{e-5}. The element \Vub\ is the least well known, with a fractional uncertainty around \SI{2}{\percent}, measured using the decays of beauty hadrons~\cite{Charles:2004jd}. By exploiting the predicated unitarity of the \ac{CKM} matrix, it can be represented using only three mixing angles and a complex phase $\delta$ \begin{equation} V_{\textrm{CKM}} = \begin{pmatrix} c_{12}c_{13} & s_{12}c_{13} & s_{13}e^{-i\delta} \\ -s_{12}c_{23} - c_{12}s_{23}s_{13}e^{-i\delta} & c_{12}c_{23} - s_{12}s_{23}s_{13}e^{-i\delta} & s_{23}c_{13} \\ s_{12}c_{23} - c_{12}c_{23}s_{13}e^{-i\delta} & -c_{12}s_{23} - s_{12}c_{23}s_{13}e^{-i\delta} & c_{23}c_{13} \end{pmatrix}, \end{equation} where $s_{ij} = \sin{\theta_{ij}}$ and $c_{ij} = \cos{\theta_{ij}}$. In alternative formulations~\cite{Wolfenstein:1983yz}, the three angles are parameterised as $\alpha$, $\beta$, and $\gamma$ and can be visualised as a triangle on the complex plane, as shown in \cref{fig:intro:sm:ckm_angles}. One of the key measurements of \lhcb\ is that of the angle $\gamma$, which is the least well-measured of the three angles, with the precision on the world average around \SI{9}{\percent}~\cite{LHCb-CONF-2016-001}. This is to be compared with the ultimate precision that could be obtained, given the finite uncertainty on some of the theoretical inputs required to translate the measurements into estimates of the CKM elements, estimated to be up to \SI{4}{\degree}, depending on the assumptions~\cite{Brod:2013sga,Brod:2014bfa}. The closure of the $(\alpha, \beta, \gamma)$ triangle is equivalent to the prediction of the unitarity of the CKM matrix, and hence measuring a value of $\gamma$ which does not form a triangle would be a sign of physics beyond the \ac{SM}. The current world averages of the various measurements are presented in the complex plane in \cref{fig:intro:sm:ckm_angles}, where some of experimental inputs and their associated uncertainties are shown as bands. The \lhcb\ experiment has performed measurements of most of the inputs shown, with the exception of $\varepsilon_{\PK}$ which is related to neutral kaon oscillations. It is the phase in the \ac{CKM} matrix that permits \CP\ violation. Consider a decay \decay{P}{f} and the \CP\ conjugate process \decay{\bar{P}}{\bar{f}}. The corresponding decay amplitudes $\mathcal{M}_{f}$ and $\bar{\mathcal{M}}_{\bar{f}}$ can have some phase $\phi$, and the \ac{CKM} mechanism can add an additional phase $\theta$ which changes sign under \CP, giving \begin{equation} \mathcal{M}_{f} = |a| e^{i(\phi + \theta)}, \quad \bar{\mathcal{M}}_{\bar{f}} = |a| e^{i(\phi - \theta)}, \label{eqn:intro:sm:weak:amplitudes_one} \end{equation} where $|a|$ is the magnitude of matrix element. The observable rates of these processes, $|M_{f}|^{2}$ and $|\bar{M}_{\bar{f}}|^{2}$, are equal, and so the decay is symmetric under \CP\@. However, for a process that can proceed via two channels, for example, such as in \cref{fig:intro:sm:weak_feynman}, the total matrix elements are $\mathcal{M}_{f} = \mathcal{M}_{f,1} + \mathcal{M}_{f,2}$ and $\bar{\mathcal{M}}_{\bar{f}} = \bar{\mathcal{M}}_{\bar{f},1} + \bar{\mathcal{M}}_{\bar{f},2}$ with \begin{align*} \mathcal{M}_{f,1} &= |a_{1}| e^{i(\phi_{1} + \theta_{1})}, & \mathcal{M}_{f,2} &= |a_{2}| e^{i(\phi_{2} + \theta_{2})},\\ \bar{\mathcal{M}}_{\bar{f},1} &= |a_{1}| e^{i(\phi_{1} - \theta_{1})}, & \bar{\mathcal{M}}_{\bar{f},2} &= |a_{2}| e^{i(\phi_{2} - \theta_{2})}. \end{align*} It then follows that \begin{equation*} |\mathcal{M}_{f}|^{2} - |\bar{\mathcal{M}}_{\bar{f}}|^{2} = -4|\mathcal{M}_{1}||\mathcal{M}_{2}|\sin(\phi_{1} - \phi_{2})\sin(\theta_{1} - \theta_{2}). \end{equation*} This is non-zero, provided that $\theta_{1} \neq \theta_{2}$ and $\phi_{1} \neq \phi_{2}$, and hence introduces a possible \CP\ asymmetry. It is then the interference between channels that permits \CP\ symmetry breaking in weak interactions. The breaking of the \CP\ symmetry was first observed in kaon decays in 1964~\cite{Christenson:1964fg}, and in 2001 \CP\ violation was first observed in beauty decays~\cite{Aubert:2001nu,Abe:2001xe}. Observing \CP\ violation in charm decays would provide a more complete picture of what is possible in the \ac{SM}, but it will not solve the problem of the observed baryon asymmetry in the universe, which the \ac{SM} cannot account for. In the \ac{LHC} era, it is hoped that signs of physics \acl{BSM} will point to specific, new theories, that themselves may have explanations for this great mystery. \begin{figure} % The relative widths of the subfigures here have been % roughly tweaked to produce equally sized fonts \begin{subfigure}{0.40\textwidth} \centering \includegraphics[width=\textwidth]{introduction/weak_tree} \caption{Tree diagram} \label{fig:intro:sm:weak_feynman:tree} \end{subfigure} \begin{subfigure}{0.55\textwidth} \centering \includegraphics[width=\textwidth]{introduction/weak_penguin} \caption{Penguin diagram} \label{fig:intro:sm:weak_feynman:penguin} \end{subfigure} \caption{% Two possible Feynman diagrams for the decay \decay{\PBzero}{\PKplus\Ppiminus}. } \label{fig:intro:sm:weak_feynman} \end{figure} \begin{figure} \centering \includegraphics[width=\textwidth]{introduction/ckmfitter_rho_eta_plane} \caption{% A representation of the three angles, parameterised as $\alpha$, $\beta$, and $\gamma$, of the CKM matrix shown the complex plane. The various bands show the experimental inputs to the determination of the angles, with the width of the bands corresponding to the uncertainties on the measurements. The angles and the measurements correspond to the world averages as of mid-2016~\cite{Charles:2004jd}. } \label{fig:intro:sm:ckm_angles} \end{figure}
#' Standard and reverse geocoding for US cities/populated places. #' @name citygeocoder #' @docType package #' @author Caleb Jenkins (@@cjtexas) #' @import data.table # @exportPattern ^[[:alpha:]]+ NULL
lemma is_pole_cong: assumes "eventually (\<lambda>x. f x = g x) (at a)" "a=b" shows "is_pole f a \<longleftrightarrow> is_pole g b"
theory T50 imports Main begin lemma "( (\<forall> x::nat. \<forall> y::nat. meet(x, y) = meet(y, x)) & (\<forall> x::nat. \<forall> y::nat. join(x, y) = join(y, x)) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. meet(x, meet(y, z)) = meet(meet(x, y), z)) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. join(x, join(y, z)) = join(join(x, y), z)) & (\<forall> x::nat. \<forall> y::nat. meet(x, join(x, y)) = x) & (\<forall> x::nat. \<forall> y::nat. join(x, meet(x, y)) = x) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. mult(x, join(y, z)) = join(mult(x, y), mult(x, z))) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. mult(join(x, y), z) = join(mult(x, z), mult(y, z))) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. meet(x, over(join(mult(x, y), z), y)) = x) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. meet(y, undr(x, join(mult(x, y), z))) = y) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. join(mult(over(x, y), y), x) = x) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. join(mult(y, undr(y, x)), x) = x) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. mult(x, meet(y, z)) = meet(mult(x, y), mult(x, z))) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. over(join(x, y), z) = join(over(x, z), over(y, z))) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. undr(meet(x, y), z) = join(undr(x, z), undr(y, z))) & (\<forall> x::nat. \<forall> y::nat. invo(join(x, y)) = meet(invo(x), invo(y))) & (\<forall> x::nat. \<forall> y::nat. invo(meet(x, y)) = join(invo(x), invo(y))) & (\<forall> x::nat. invo(invo(x)) = x) ) \<longrightarrow> (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. mult(meet(x, y), z) = meet(mult(x, z), mult(y, z))) " nitpick[card nat=10,timeout=86400] oops end
section\<open>The main theorem\<close> theory Forcing_Main imports Internal_ZFC_Axioms Choice_Axiom Ordinals_In_MG Succession_Poset begin subsection\<open>The generic extension is countable\<close> (* \<comment> \<open>Useful missing lemma\<close> lemma surj_imp_well_ord: assumes "well_ord(A,r)" "h \<in> surj(A,B)" shows "\<exists>s. well_ord(B,r)" *) definition minimum :: "i \<Rightarrow> i \<Rightarrow> i" where "minimum(r,B) \<equiv> THE b. b\<in>B \<and> (\<forall>y\<in>B. y \<noteq> b \<longrightarrow> \<langle>b, y\<rangle> \<in> r)" lemma well_ord_imp_min: assumes "well_ord(A,r)" "B \<subseteq> A" "B \<noteq> 0" shows "minimum(r,B) \<in> B" proof - from \<open>well_ord(A,r)\<close> have "wf[A](r)" using well_ord_is_wf[OF \<open>well_ord(A,r)\<close>] by simp with \<open>B\<subseteq>A\<close> have "wf[B](r)" using Sigma_mono Int_mono wf_subset unfolding wf_on_def by simp then have "\<forall> x. x \<in> B \<longrightarrow> (\<exists>z\<in>B. \<forall>y. \<langle>y, z\<rangle> \<in> r\<inter>B\<times>B \<longrightarrow> y \<notin> B)" unfolding wf_on_def using wf_eq_minimal by blast with \<open>B\<noteq>0\<close> obtain z where B: "z\<in>B \<and> (\<forall>y. \<langle>y,z\<rangle>\<in>r\<inter>B\<times>B \<longrightarrow> y\<notin>B)" by blast then have "z\<in>B \<and> (\<forall>y\<in>B. y \<noteq> z \<longrightarrow> \<langle>z, y\<rangle> \<in> r)" proof - { fix y assume "y\<in>B" "y\<noteq>z" with \<open>well_ord(A,r)\<close> B \<open>B\<subseteq>A\<close> have "\<langle>z,y\<rangle>\<in>r|\<langle>y,z\<rangle>\<in>r|y=z" unfolding well_ord_def tot_ord_def linear_def by auto with B \<open>y\<in>B\<close> \<open>y\<noteq>z\<close> have "\<langle>z,y\<rangle>\<in>r" by (cases;auto) } with B show ?thesis by blast qed have "v = z" if "v\<in>B \<and> (\<forall>y\<in>B. y \<noteq> v \<longrightarrow> \<langle>v, y\<rangle> \<in> r)" for v using that B by auto with \<open>z\<in>B \<and> (\<forall>y\<in>B. y \<noteq> z \<longrightarrow> \<langle>z, y\<rangle> \<in> r)\<close> show ?thesis unfolding minimum_def using the_equality2[OF ex1I[of "\<lambda>x .x\<in>B \<and> (\<forall>y\<in>B. y \<noteq> x \<longrightarrow> \<langle>x, y\<rangle> \<in> r)" z]] by auto qed lemma well_ord_surj_imp_lepoll: assumes "well_ord(A,r)" "h \<in> surj(A,B)" shows "B \<lesssim> A" proof - let ?f="\<lambda>b\<in>B. minimum(r, {a\<in>A. h`a=b})" have "b \<in> B \<Longrightarrow> minimum(r, {a \<in> A . h ` a = b}) \<in> {a\<in>A. h`a=b}" for b proof - fix b assume "b\<in>B" with \<open>h \<in> surj(A,B)\<close> have "\<exists>a\<in>A. h`a=b" unfolding surj_def by blast then have "{a\<in>A. h`a=b} \<noteq> 0" by auto with assms show "minimum(r,{a\<in>A. h`a=b}) \<in> {a\<in>A. h`a=b}" using well_ord_imp_min by blast qed moreover from this have "?f : B \<rightarrow> A" using lam_type[of B _ "\<lambda>_.A"] by simp moreover have "?f ` w = ?f ` x \<Longrightarrow> w = x" if "w\<in>B" "x\<in>B" for w x proof - from calculation(1)[OF that(1)] calculation(1)[OF that(2)] have "w = h ` minimum(r, {a \<in> A . h ` a = w})" "x = h ` minimum(r, {a \<in> A . h ` a = x})" by simp_all moreover assume "?f ` w = ?f ` x" moreover from this and that have "minimum(r, {a \<in> A . h ` a = w}) = minimum(r, {a \<in> A . h ` a = x})" by simp_all moreover from calculation(1,2,4) show "w=x" by simp qed ultimately show ?thesis unfolding lepoll_def inj_def by blast qed lemma (in forcing_data) surj_nat_MG : "\<exists>f. f \<in> surj(nat,M[G])" proof - let ?f="\<lambda>n\<in>nat. val(G,enum`n)" have "x \<in> nat \<Longrightarrow> val(G, enum ` x)\<in> M[G]" for x using GenExtD[THEN iffD2, of _ G] bij_is_fun[OF M_countable] by force then have "?f: nat \<rightarrow> M[G]" using lam_type[of nat "\<lambda>n. val(G,enum`n)" "\<lambda>_.M[G]"] by simp moreover have "\<exists>n\<in>nat. ?f`n = x" if "x\<in>M[G]" for x using that GenExtD[of _ G] bij_is_surj[OF M_countable] unfolding surj_def by auto ultimately show ?thesis unfolding surj_def by blast qed lemma (in G_generic) MG_eqpoll_nat: "M[G] \<approx> nat" proof - interpret MG: M_ZF_trans "M[G]" using Transset_MG generic pairing_in_MG Union_MG extensionality_in_MG power_in_MG foundation_in_MG strong_replacement_in_MG[simplified] separation_in_MG[simplified] infinity_in_MG by unfold_locales simp_all obtain f where "f \<in> surj(nat,M[G])" using surj_nat_MG by blast then have "M[G] \<lesssim> nat" using well_ord_surj_imp_lepoll well_ord_Memrel[of nat] by simp moreover have "nat \<lesssim> M[G]" using MG.nat_into_M subset_imp_lepoll by auto ultimately show ?thesis using eqpollI by simp qed subsection\<open>The main result\<close> theorem extensions_of_ctms: assumes "M \<approx> nat" "Transset(M)" "M \<Turnstile> ZF" shows "\<exists>N. M \<subseteq> N \<and> N \<approx> nat \<and> Transset(N) \<and> N \<Turnstile> ZF \<and> M\<noteq>N \<and> (\<forall>\<alpha>. Ord(\<alpha>) \<longrightarrow> (\<alpha> \<in> M \<longleftrightarrow> \<alpha> \<in> N)) \<and> (M, []\<Turnstile> AC \<longrightarrow> N \<Turnstile> ZFC)" proof - from \<open>M \<approx> nat\<close> obtain enum where "enum \<in> bij(nat,M)" using eqpoll_sym unfolding eqpoll_def by blast with assms interpret M_ctm M enum using M_ZF_iff_M_satT by intro_locales (simp_all add:M_ctm_axioms_def) interpret ctm_separative "2^<\<omega>" seqle 0 M enum proof (unfold_locales) fix f let ?q="seq_upd(f,0)" and ?r="seq_upd(f,1)" assume "f \<in> 2^<\<omega>" then have "?q \<preceq>s f \<and> ?r \<preceq>s f \<and> ?q \<bottom>s ?r" using upd_leI seqspace_separative by auto moreover from calculation have "?q \<in> 2^<\<omega>" "?r \<in> 2^<\<omega>" using seq_upd_type[of f 2] by auto ultimately show "\<exists>q\<in>2^<\<omega>. \<exists>r\<in>2^<\<omega>. q \<preceq>s f \<and> r \<preceq>s f \<and> q \<bottom>s r" by (rule_tac bexI)+ \<comment> \<open>why the heck auto-tools don't solve this?\<close> next show "2^<\<omega> \<in> M" using nat_into_M seqspace_closed by simp next show "seqle \<in> M" using seqle_in_M . qed from cohen_extension_is_proper obtain G where "M_generic(G)" "M \<noteq> GenExt(G)" (is "M\<noteq>?N") by blast then interpret G_generic "2^<\<omega>" seqle 0 _ enum G by unfold_locales interpret MG: M_ZF "?N" using generic pairing_in_MG Union_MG extensionality_in_MG power_in_MG foundation_in_MG strong_replacement_in_MG[simplified] separation_in_MG[simplified] infinity_in_MG by unfold_locales simp_all have "?N \<Turnstile> ZF" using M_ZF_iff_M_satT[of ?N] MG.M_ZF_axioms by simp moreover have "M, []\<Turnstile> AC \<Longrightarrow> ?N \<Turnstile> ZFC" proof - assume "M, [] \<Turnstile> AC" then have "choice_ax(##M)" unfolding ZF_choice_fm_def using ZF_choice_auto by simp then have "choice_ax(##?N)" using choice_in_MG by simp with \<open>?N \<Turnstile> ZF\<close> show "?N \<Turnstile> ZFC" using ZF_choice_auto sats_ZFC_iff_sats_ZF_AC unfolding ZF_choice_fm_def by simp qed moreover note \<open>M \<noteq> ?N\<close> moreover have "Transset(?N)" using Transset_MG . moreover have "M \<subseteq> ?N" using M_subset_MG[OF one_in_G] generic by simp ultimately show ?thesis using Ord_MG_iff MG_eqpoll_nat by (rule_tac x="?N" in exI, simp) qed end
theory T142 imports Main begin lemma "( (\<forall> x::nat. \<forall> y::nat. meet(x, y) = meet(y, x)) & (\<forall> x::nat. \<forall> y::nat. join(x, y) = join(y, x)) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. meet(x, meet(y, z)) = meet(meet(x, y), z)) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. join(x, join(y, z)) = join(join(x, y), z)) & (\<forall> x::nat. \<forall> y::nat. meet(x, join(x, y)) = x) & (\<forall> x::nat. \<forall> y::nat. join(x, meet(x, y)) = x) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. mult(x, join(y, z)) = join(mult(x, y), mult(x, z))) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. mult(join(x, y), z) = join(mult(x, z), mult(y, z))) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. meet(x, over(join(mult(x, y), z), y)) = x) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. meet(y, undr(x, join(mult(x, y), z))) = y) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. join(mult(over(x, y), y), x) = x) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. join(mult(y, undr(y, x)), x) = x) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. mult(x, meet(y, z)) = meet(mult(x, y), mult(x, z))) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. undr(x, join(y, z)) = join(undr(x, y), undr(x, z))) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. over(join(x, y), z) = join(over(x, z), over(y, z))) & (\<forall> x::nat. \<forall> y::nat. invo(join(x, y)) = meet(invo(x), invo(y))) & (\<forall> x::nat. \<forall> y::nat. invo(meet(x, y)) = join(invo(x), invo(y))) & (\<forall> x::nat. invo(invo(x)) = x) ) \<longrightarrow> (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. over(x, meet(y, z)) = join(over(x, y), over(x, z))) " nitpick[card nat=4,timeout=86400] oops end
C Copyright(C) 1999-2020 National Technology & Engineering Solutions C of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with C NTESS, the U.S. Government retains certain rights in this software. C C See packages/seacas/LICENSE for details SUBROUTINE LSWAP (MXND, LXK, KXL, K1, L1, K2, L2, ERR) C*********************************************************************** C SUBROUTINE LSWAP = EXCHANGE LINE L1 IN ELEMENT K1 WITH LINE L2 IN C ELEMENT K2 C*********************************************************************** DIMENSION LXK (4, MXND), KXL (2, 3*MXND) LOGICAL ERR ERR = .TRUE. C INSERT L2 FOR L1 DO 130 I = 1, 4 IF (LXK (I, K1) .EQ. L1) THEN LXK (I, K1) = L2 C INSERT L1 FOR L2 DO 120 J = 1, 4 IF (LXK (J, K2) .EQ. L2) THEN LXK (J, K2) = L1 C INSERT K2 FOR K1 DO 110 K = 1, 2 IF (KXL (K, L1) .EQ. K1) THEN KXL (K, L1) = K2 C INSERT K1 FOR K2 DO 100 L = 1, 2 IF (KXL (L, L2) .EQ. K2) THEN KXL (L, L2) = K1 C EVERYTHING INSERTED OK ERR = .FALSE. RETURN ENDIF 100 CONTINUE WRITE ( * , 10000)K1, L1, K2, L2 RETURN ENDIF 110 CONTINUE WRITE ( * , 10000)K1, L1, K2, L2 RETURN ENDIF 120 CONTINUE WRITE ( * , 10000)K1, L1, K2, L2 RETURN ENDIF 130 CONTINUE WRITE ( * , 10000)K1, L1, K2, L2 RETURN 10000 FORMAT (' ERROR IN LSWAP. K1, L1, K2, L2 :', 4I5) END
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Bhavik Mehta -/ import category_theory.monad.basic import category_theory.adjunction.basic import category_theory.functor.epi_mono /-! # Eilenberg-Moore (co)algebras for a (co)monad This file defines Eilenberg-Moore (co)algebras for a (co)monad, and provides the category instance for them. Further it defines the adjoint pair of free and forgetful functors, respectively from and to the original category, as well as the adjoint pair of forgetful and cofree functors, respectively from and to the original category. ## References * [Riehl, *Category theory in context*, Section 5.2.4][riehl2017] -/ namespace category_theory open category universes v₁ u₁ -- morphism levels before object levels. See note [category_theory universes]. variables {C : Type u₁} [category.{v₁} C] namespace monad /-- An Eilenberg-Moore algebra for a monad `T`. cf Definition 5.2.3 in [Riehl][riehl2017]. -/ structure algebra (T : monad C) : Type (max u₁ v₁) := (A : C) (a : (T : C ⥤ C).obj A ⟶ A) (unit' : T.η.app A ≫ a = 𝟙 A . obviously) (assoc' : T.μ.app A ≫ a = (T : C ⥤ C).map a ≫ a . obviously) restate_axiom algebra.unit' restate_axiom algebra.assoc' attribute [reassoc] algebra.unit algebra.assoc namespace algebra variables {T : monad C} /-- A morphism of Eilenberg–Moore algebras for the monad `T`. -/ @[ext] structure hom (A B : algebra T) := (f : A.A ⟶ B.A) (h' : (T : C ⥤ C).map f ≫ B.a = A.a ≫ f . obviously) restate_axiom hom.h' attribute [simp, reassoc] hom.h namespace hom /-- The identity homomorphism for an Eilenberg–Moore algebra. -/ def id (A : algebra T) : hom A A := { f := 𝟙 A.A } instance (A : algebra T) : inhabited (hom A A) := ⟨{ f := 𝟙 _ }⟩ /-- Composition of Eilenberg–Moore algebra homomorphisms. -/ def comp {P Q R : algebra T} (f : hom P Q) (g : hom Q R) : hom P R := { f := f.f ≫ g.f } end hom instance : category_struct (algebra T) := { hom := hom, id := hom.id, comp := @hom.comp _ _ _ } @[simp] lemma comp_eq_comp {A A' A'' : algebra T} (f : A ⟶ A') (g : A' ⟶ A'') : algebra.hom.comp f g = f ≫ g := rfl @[simp] lemma id_eq_id (A : algebra T) : algebra.hom.id A = 𝟙 A := rfl @[simp] /-- The category of Eilenberg-Moore algebras for a monad. cf Definition 5.2.4 in [Riehl][riehl2017]. -/ instance EilenbergMoore : category (algebra T) := {}. /-- To construct an isomorphism of algebras, it suffices to give an isomorphism of the carriers which commutes with the structure morphisms. -/ @[simps] def iso_mk {A B : algebra T} (h : A.A ≅ B.A) (w : (T : C ⥤ C).map h.hom ≫ B.a = A.a ≫ h.hom) : A ≅ B := { hom := { f := h.hom }, inv := { f := h.inv, h' := by { rw [h.eq_comp_inv, category.assoc, ←w, ←functor.map_comp_assoc], simp } } } end algebra variables (T : monad C) /-- The forgetful functor from the Eilenberg-Moore category, forgetting the algebraic structure. -/ @[simps] def forget : algebra T ⥤ C := { obj := λ A, A.A, map := λ A B f, f.f } /-- The free functor from the Eilenberg-Moore category, constructing an algebra for any object. -/ @[simps] def free : C ⥤ algebra T := { obj := λ X, { A := T.obj X, a := T.μ.app X, assoc' := (T.assoc _).symm }, map := λ X Y f, { f := T.map f, h' := T.μ.naturality _ } } instance [inhabited C] : inhabited (algebra T) := ⟨(free T).obj default⟩ /-- The adjunction between the free and forgetful constructions for Eilenberg-Moore algebras for a monad. cf Lemma 5.2.8 of [Riehl][riehl2017]. -/ -- The other two `simps` projection lemmas can be derived from these two, so `simp_nf` complains if -- those are added too @[simps unit counit] def adj : T.free ⊣ T.forget := adjunction.mk_of_hom_equiv { hom_equiv := λ X Y, { to_fun := λ f, T.η.app X ≫ f.f, inv_fun := λ f, { f := T.map f ≫ Y.a, h' := by { dsimp, simp [←Y.assoc, ←T.μ.naturality_assoc] } }, left_inv := λ f, by { ext, dsimp, simp }, right_inv := λ f, begin dsimp only [forget_obj, monad_to_functor_eq_coe], rw [←T.η.naturality_assoc, Y.unit], apply category.comp_id, end }} /-- Given an algebra morphism whose carrier part is an isomorphism, we get an algebra isomorphism. -/ lemma algebra_iso_of_iso {A B : algebra T} (f : A ⟶ B) [is_iso f.f] : is_iso f := ⟨⟨{ f := inv f.f, h' := by { rw [is_iso.eq_comp_inv f.f, category.assoc, ← f.h], simp } }, by tidy⟩⟩ instance forget_reflects_iso : reflects_isomorphisms T.forget := { reflects := λ A B, algebra_iso_of_iso T } instance forget_faithful : faithful T.forget := {} /-- Given an algebra morphism whose carrier part is an epimorphism, we get an algebra epimorphism. -/ lemma algebra_epi_of_epi {X Y : algebra T} (f : X ⟶ Y) [h : epi f.f] : epi f := (forget T).epi_of_epi_map h /-- Given an algebra morphism whose carrier part is a monomorphism, we get an algebra monomorphism. -/ lemma algebra_mono_of_mono {X Y : algebra T} (f : X ⟶ Y) [h : mono f.f] : mono f := (forget T).mono_of_mono_map h instance : is_right_adjoint T.forget := ⟨T.free, T.adj⟩ @[simp] lemma left_adjoint_forget : left_adjoint T.forget = T.free := rfl @[simp] lemma of_right_adjoint_forget : adjunction.of_right_adjoint T.forget = T.adj := rfl /-- Given a monad morphism from `T₂` to `T₁`, we get a functor from the algebras of `T₁` to algebras of `T₂`. -/ @[simps] def algebra_functor_of_monad_hom {T₁ T₂ : monad C} (h : T₂ ⟶ T₁) : algebra T₁ ⥤ algebra T₂ := { obj := λ A, { A := A.A, a := h.app A.A ≫ A.a, unit' := by { dsimp, simp [A.unit] }, assoc' := by { dsimp, simp [A.assoc] } }, map := λ A₁ A₂ f, { f := f.f } } /-- The identity monad morphism induces the identity functor from the category of algebras to itself. -/ @[simps {rhs_md := semireducible}] def algebra_functor_of_monad_hom_id {T₁ : monad C} : algebra_functor_of_monad_hom (𝟙 T₁) ≅ 𝟭 _ := nat_iso.of_components (λ X, algebra.iso_mk (iso.refl _) (by { dsimp, simp, })) (λ X Y f, by { ext, dsimp, simp }) /-- A composition of monad morphisms gives the composition of corresponding functors. -/ @[simps {rhs_md := semireducible}] def algebra_functor_of_monad_hom_comp {T₁ T₂ T₃ : monad C} (f : T₁ ⟶ T₂) (g : T₂ ⟶ T₃) : algebra_functor_of_monad_hom (f ≫ g) ≅ algebra_functor_of_monad_hom g ⋙ algebra_functor_of_monad_hom f := nat_iso.of_components (λ X, algebra.iso_mk (iso.refl _) (by { dsimp, simp })) (λ X Y f, by { ext, dsimp, simp }) /-- If `f` and `g` are two equal morphisms of monads, then the functors of algebras induced by them are isomorphic. We define it like this as opposed to using `eq_to_iso` so that the components are nicer to prove lemmas about. -/ @[simps {rhs_md := semireducible}] def algebra_functor_of_monad_hom_eq {T₁ T₂ : monad C} {f g : T₁ ⟶ T₂} (h : f = g) : algebra_functor_of_monad_hom f ≅ algebra_functor_of_monad_hom g := nat_iso.of_components (λ X, algebra.iso_mk (iso.refl _) (by { dsimp, simp [h] })) (λ X Y f, by { ext, dsimp, simp }) /-- Isomorphic monads give equivalent categories of algebras. Furthermore, they are equivalent as categories over `C`, that is, we have `algebra_equiv_of_iso_monads h ⋙ forget = forget`. -/ @[simps] def algebra_equiv_of_iso_monads {T₁ T₂ : monad C} (h : T₁ ≅ T₂) : algebra T₁ ≌ algebra T₂ := { functor := algebra_functor_of_monad_hom h.inv, inverse := algebra_functor_of_monad_hom h.hom, unit_iso := algebra_functor_of_monad_hom_id.symm ≪≫ algebra_functor_of_monad_hom_eq (by simp) ≪≫ algebra_functor_of_monad_hom_comp _ _, counit_iso := (algebra_functor_of_monad_hom_comp _ _).symm ≪≫ algebra_functor_of_monad_hom_eq (by simp) ≪≫ algebra_functor_of_monad_hom_id } @[simp] lemma algebra_equiv_of_iso_monads_comp_forget {T₁ T₂ : monad C} (h : T₁ ⟶ T₂) : algebra_functor_of_monad_hom h ⋙ forget _ = forget _ := rfl end monad namespace comonad /-- An Eilenberg-Moore coalgebra for a comonad `T`. -/ @[nolint has_nonempty_instance] structure coalgebra (G : comonad C) : Type (max u₁ v₁) := (A : C) (a : A ⟶ (G : C ⥤ C).obj A) (counit' : a ≫ G.ε.app A = 𝟙 A . obviously) (coassoc' : a ≫ G.δ.app A = a ≫ G.map a . obviously) restate_axiom coalgebra.counit' restate_axiom coalgebra.coassoc' attribute [reassoc] coalgebra.counit coalgebra.coassoc namespace coalgebra variables {G : comonad C} /-- A morphism of Eilenberg-Moore coalgebras for the comonad `G`. -/ @[ext, nolint has_nonempty_instance] structure hom (A B : coalgebra G) := (f : A.A ⟶ B.A) (h' : A.a ≫ (G : C ⥤ C).map f = f ≫ B.a . obviously) restate_axiom hom.h' attribute [simp, reassoc] hom.h namespace hom /-- The identity homomorphism for an Eilenberg–Moore coalgebra. -/ def id (A : coalgebra G) : hom A A := { f := 𝟙 A.A } /-- Composition of Eilenberg–Moore coalgebra homomorphisms. -/ def comp {P Q R : coalgebra G} (f : hom P Q) (g : hom Q R) : hom P R := { f := f.f ≫ g.f } end hom /-- The category of Eilenberg-Moore coalgebras for a comonad. -/ instance : category_struct (coalgebra G) := { hom := hom, id := hom.id, comp := @hom.comp _ _ _ } @[simp] lemma comp_eq_comp {A A' A'' : coalgebra G} (f : A ⟶ A') (g : A' ⟶ A'') : coalgebra.hom.comp f g = f ≫ g := rfl @[simp] lemma id_eq_id (A : coalgebra G) : coalgebra.hom.id A = 𝟙 A := rfl @[simp] lemma id_f (A : coalgebra G) : (𝟙 A : A ⟶ A).f = 𝟙 A.A := rfl @[simp] lemma comp_f {A A' A'' : coalgebra G} (f : A ⟶ A') (g : A' ⟶ A'') : (f ≫ g).f = f.f ≫ g.f := rfl /-- The category of Eilenberg-Moore coalgebras for a comonad. -/ instance EilenbergMoore : category (coalgebra G) := {}. /-- To construct an isomorphism of coalgebras, it suffices to give an isomorphism of the carriers which commutes with the structure morphisms. -/ @[simps] def iso_mk {A B : coalgebra G} (h : A.A ≅ B.A) (w : A.a ≫ (G : C ⥤ C).map h.hom = h.hom ≫ B.a) : A ≅ B := { hom := { f := h.hom }, inv := { f := h.inv, h' := by { rw [h.eq_inv_comp, ←reassoc_of w, ←functor.map_comp], simp } } } end coalgebra variables (G : comonad C) /-- The forgetful functor from the Eilenberg-Moore category, forgetting the coalgebraic structure. -/ @[simps] def forget : coalgebra G ⥤ C := { obj := λ A, A.A, map := λ A B f, f.f } /-- The cofree functor from the Eilenberg-Moore category, constructing a coalgebra for any object. -/ @[simps] def cofree : C ⥤ coalgebra G := { obj := λ X, { A := G.obj X, a := G.δ.app X, coassoc' := (G.coassoc _).symm }, map := λ X Y f, { f := G.map f, h' := (G.δ.naturality _).symm } } /-- The adjunction between the cofree and forgetful constructions for Eilenberg-Moore coalgebras for a comonad. -/ -- The other two `simps` projection lemmas can be derived from these two, so `simp_nf` complains if -- those are added too @[simps unit counit] def adj : G.forget ⊣ G.cofree := adjunction.mk_of_hom_equiv { hom_equiv := λ X Y, { to_fun := λ f, { f := X.a ≫ G.map f, h' := by { dsimp, simp [←coalgebra.coassoc_assoc] } }, inv_fun := λ g, g.f ≫ G.ε.app Y, left_inv := λ f, by { dsimp, rw [category.assoc, G.ε.naturality, functor.id_map, X.counit_assoc] }, right_inv := λ g, begin ext1, dsimp, rw [functor.map_comp, g.h_assoc, cofree_obj_a, comonad.right_counit], apply comp_id, end }} /-- Given a coalgebra morphism whose carrier part is an isomorphism, we get a coalgebra isomorphism. -/ lemma coalgebra_iso_of_iso {A B : coalgebra G} (f : A ⟶ B) [is_iso f.f] : is_iso f := ⟨⟨{ f := inv f.f, h' := by { rw [is_iso.eq_inv_comp f.f, ←f.h_assoc], simp } }, by tidy⟩⟩ instance forget_reflects_iso : reflects_isomorphisms G.forget := { reflects := λ A B, coalgebra_iso_of_iso G } instance forget_faithful : faithful (forget G) := {} /-- Given a coalgebra morphism whose carrier part is an epimorphism, we get an algebra epimorphism. -/ lemma algebra_epi_of_epi {X Y : coalgebra G} (f : X ⟶ Y) [h : epi f.f] : epi f := (forget G).epi_of_epi_map h /-- Given a coalgebra morphism whose carrier part is a monomorphism, we get an algebra monomorphism. -/ lemma algebra_mono_of_mono {X Y : coalgebra G} (f : X ⟶ Y) [h : mono f.f] : mono f := (forget G).mono_of_mono_map h instance : is_left_adjoint G.forget := ⟨_, G.adj⟩ @[simp] lemma right_adjoint_forget : right_adjoint G.forget = G.cofree := rfl @[simp] lemma of_left_adjoint_forget : adjunction.of_left_adjoint G.forget = G.adj := rfl end comonad end category_theory
/* movstat/qqracc.c * * Moving window QQR accumulator * * Copyright (C) 2018 Patrick Alken * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or (at * your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include <config.h> #include <gsl/gsl_math.h> #include <gsl/gsl_vector.h> #include <gsl/gsl_errno.h> #include <gsl/gsl_movstat.h> #include <gsl/gsl_sort.h> #include <gsl/gsl_statistics.h> typedef double qqracc_type_t; typedef qqracc_type_t ringbuf_type_t; #include "ringbuf.c" typedef struct { qqracc_type_t *window; /* linear array for current window */ ringbuf *rbuf; /* ring buffer storing current window */ } qqracc_state_t; static size_t qqracc_size(const size_t n) { size_t size = 0; size += sizeof(qqracc_state_t); size += n * sizeof(qqracc_type_t); size += ringbuf_size(n); return size; } static int qqracc_init(const size_t n, void * vstate) { qqracc_state_t * state = (qqracc_state_t *) vstate; state->window = (qqracc_type_t *) ((unsigned char *) vstate + sizeof(qqracc_state_t)); state->rbuf = (ringbuf *) ((unsigned char *) state->window + n * sizeof(qqracc_type_t)); ringbuf_init(n, state->rbuf); return GSL_SUCCESS; } static int qqracc_insert(const qqracc_type_t x, void * vstate) { qqracc_state_t * state = (qqracc_state_t *) vstate; /* add new element to ring buffer */ ringbuf_insert(x, state->rbuf); return GSL_SUCCESS; } static int qqracc_delete(void * vstate) { qqracc_state_t * state = (qqracc_state_t *) vstate; if (!ringbuf_is_empty(state->rbuf)) ringbuf_pop_back(state->rbuf); return GSL_SUCCESS; } /* FIXME XXX: this is inefficient - could be improved by maintaining a sorted ring buffer */ static int qqracc_get(void * params, qqracc_type_t * result, const void * vstate) { const qqracc_state_t * state = (const qqracc_state_t *) vstate; double q = *(double *) params; size_t n = ringbuf_copy(state->window, state->rbuf); double quant1, quant2; gsl_sort(state->window, 1, n); /* compute q-quantile and (1-q)-quantile */ quant1 = gsl_stats_quantile_from_sorted_data(state->window, 1, n, q); quant2 = gsl_stats_quantile_from_sorted_data(state->window, 1, n, 1.0 - q); /* compute q-quantile range */ *result = quant2 - quant1; return GSL_SUCCESS; } static const gsl_movstat_accum qqr_accum_type = { qqracc_size, qqracc_init, qqracc_insert, qqracc_delete, qqracc_get }; const gsl_movstat_accum *gsl_movstat_accum_qqr = &qqr_accum_type;
(* 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 *) gamma_ss := 0.2: cc_ss := [0.0136823, 0.268920, -0.550769, 1.03947, 0.0]: gamma_ab := 0.006: cc_ab := [0.836897, 1.72051, -2.78498, -4.57504, 0.0]: $include "lda_c_vwn.mpl" $include "b97.mpl" f := (rs, z, xt, xs0, xs1) -> b97_f(f_vwn, gamma_ss, cc_ss, gamma_ab, cc_ab, rs, z, xs0, xs1):
If $f$ and $g$ are functions that tend to $a$ and $b$ respectively, and $b \neq 0$, then the function $f/g$ tends to $a/b$.
theory Short_Theory_13_15 imports "HOL-IMP.Abs_Int1" begin datatype sign' = Neg | Zero | Pos type_synonym sign = "sign' set" lemma sign_ext: "UNIV = {Neg, Zero, Pos}" proof auto fix x show "\<lbrakk>x \<noteq> Neg; x \<noteq> Zero\<rbrakk> \<Longrightarrow> x = Pos" proof (cases x, auto) qed qed lemma card_sign' [simp]: "card (UNIV :: sign) = 3" by (auto simp: sign_ext) lemma finite_sign' [simp, intro!]: "finite (UNIV :: sign' set)" by (auto simp: sign_ext) lemma finite_sign [simp, intro!]: "finite (UNIV :: sign set)" by (simp add: Finite_Set.finite_set) text\<open>Instantiation of class \<^class>\<open>order\<close> with type \<^typ>\<open>sign\<close>:\<close> text\<open>Instantiation of class \<^class>\<open>semilattice_sup_top\<close> with type \<^typ>\<open>sign\<close>:\<close> instantiation set :: (type) semilattice_sup_top begin instance .. end text\<open>Now we define the functions used for instantiating the abstract interpretation locales. Note that the Isabelle terminology is \emph{interpretation}, not \emph{instantiation} of locales, but we use instantiation to avoid confusion with abstract interpretation.\<close> fun \<gamma>_sign' :: "sign' \<Rightarrow> val set" where "\<gamma>_sign' Neg = {i. i < 0}" | "\<gamma>_sign' Zero = {0}" | "\<gamma>_sign' Pos = {i. 0 < i}" fun \<gamma>_sign :: "sign \<Rightarrow> val set" where "\<gamma>_sign S = {i. \<exists>s\<in>S. i \<in> \<gamma>_sign' s}" fun num_sign :: "val \<Rightarrow> sign" where "num_sign i = (if i < 0 then {Neg} else if 0 < i then {Pos} else {Zero})" fun plus_sign' :: "sign' \<Rightarrow> sign' \<Rightarrow> sign" where "plus_sign' Neg Pos = UNIV" | "plus_sign' Pos Neg = UNIV" | "plus_sign' Zero s = {s}" | "plus_sign' s _ = {s}" fun plus_sign :: "sign \<Rightarrow> sign \<Rightarrow> sign" where "plus_sign S1 S2 = {s. \<exists>s1\<in>S1. \<exists>s2\<in>S2. s \<in> plus_sign' s1 s2}" text\<open>First we instantiate the abstract value interface and prove that the functions on type \<^typ>\<open>sign\<close> have all the necessary properties:\<close> lemma val_tricho_0: fixes x :: val obtains (BNeg) "x < 0" | (BZero) "x = 0" | (BPos) "x > 0" by (rule linorder_cases) lemma \<gamma>_sign_top [simp]: "\<gamma>_sign UNIV = UNIV" proof auto fix x :: val show "\<exists>s. x \<in> \<gamma>_sign' s" proof (cases rule: val_tricho_0 [of x]) case BNeg then have "x \<in> \<gamma>_sign' Neg" by auto then show ?thesis by blast next case BZero then have "x \<in> \<gamma>_sign' Zero" by auto then show ?thesis by blast next case BPos then have "x \<in> \<gamma>_sign' Pos" by auto then show ?thesis by blast qed qed lemma Neg_\<gamma>_sign [dest]: "\<lbrakk>x < 0; x \<in> \<gamma>_sign S\<rbrakk> \<Longrightarrow> Neg \<in> S" proof auto fix s assume assm: "s \<in> S" "x < 0" "x \<in> \<gamma>_sign' s" from assm(2, 3) have "s = Neg" by (cases s) auto with assm(1) show "Neg \<in> S" by simp qed lemma Zero_\<gamma>_sign [dest]: "\<lbrakk>x = 0; x \<in> \<gamma>_sign S\<rbrakk> \<Longrightarrow> Zero \<in> S" proof auto fix s assume assm: "s \<in> S" "0 \<in> \<gamma>_sign' s" from assm(2) have "s = Zero" by (cases s) auto with assm(1) show "Zero \<in> S" by simp qed lemma Pos_\<gamma>_sign [dest]: "\<lbrakk>0 < x; x \<in> \<gamma>_sign S\<rbrakk> \<Longrightarrow> Pos \<in> S" proof auto fix s assume assm: "s \<in> S" "0 < x" "x \<in> \<gamma>_sign' s" from assm(2, 3) have "s = Pos" by (cases s) auto with assm(1) show "Pos \<in> S" by simp qed global_interpretation Val_semilattice where \<gamma> = \<gamma>_sign and num' = num_sign and plus' = plus_sign proof (standard, goal_cases) case (1 a b) then show ?case by auto next case 2 then show ?case proof auto fix x :: val show "\<exists>s. x \<in> \<gamma>_sign' s" proof (cases rule: val_tricho_0 [of x]) case BNeg then have "x \<in> \<gamma>_sign' Neg" by auto then show ?thesis by blast next case BZero then have "x \<in> \<gamma>_sign' Zero" by auto then show ?thesis by blast next case BPos then have "x \<in> \<gamma>_sign' Pos" by auto then show ?thesis by blast qed qed next case (3 i) then show ?case by auto next case (4 i1 a1 i2 a2) show ?case proof (cases rule: val_tricho_0 [of i1]; cases rule: val_tricho_0 [of i2]; cases rule: val_tricho_0 [of "i1 + i2"]; linarith?) { assume "i1 < 0" with 4(1) have H1: "Neg \<in> a1" by (simp add: Neg_\<gamma>_sign) { assume "i2 < 0" with 4(2) have H2: "Neg \<in> a2" by (simp add: Neg_\<gamma>_sign) from H1 H2 have "Neg \<in> plus_sign a1 a2" by force moreover assume "i1 + i2 < 0" ultimately show "i1 + i2 \<in> \<gamma>_sign (plus_sign a1 a2)" by fastforce } { assume "i2 = 0" with 4(2) have H2: "Zero \<in> a2" by (simp add: Zero_\<gamma>_sign) from H1 H2 have "Neg \<in> plus_sign a1 a2" by force moreover assume "i1 + i2 < 0" ultimately show "i1 + i2 \<in> \<gamma>_sign (plus_sign a1 a2)" by fastforce } { assume "i2 > 0" with 4(2) have H2: "Pos \<in> a2" by (simp add: Pos_\<gamma>_sign) from H1 H2 have "plus_sign a1 a2 = UNIV" by force then have "\<gamma>_sign (plus_sign a1 a2) = UNIV" using \<gamma>_sign_top by auto then show "i1 + i2 \<in> \<gamma>_sign (plus_sign a1 a2)" by auto then show "i1 + i2 \<in> \<gamma>_sign (plus_sign a1 a2)" . then show "i1 + i2 \<in> \<gamma>_sign (plus_sign a1 a2)" . } } { assume "i1 = 0" with 4(1) have H1: "Zero \<in> a1" by (simp add: Zero_\<gamma>_sign) { assume "i2 < 0" with 4(2) have H2: "Neg \<in> a2" by (simp add: Neg_\<gamma>_sign) from H1 H2 have "Neg \<in> plus_sign a1 a2" by force moreover assume "i1 + i2 < 0" ultimately show "i1 + i2 \<in> \<gamma>_sign (plus_sign a1 a2)" by fastforce } { assume "i2 = 0" with 4(2) have H2: "Zero \<in> a2" by (simp add: Zero_\<gamma>_sign) from H1 H2 have "Zero \<in> plus_sign a1 a2" by force moreover assume "i1 + i2 = 0" ultimately show "i1 + i2 \<in> \<gamma>_sign (plus_sign a1 a2)" by fastforce } { assume "i2 > 0" with 4(2) have H2: "Pos \<in> a2" by (simp add: Pos_\<gamma>_sign) from H1 H2 have "Pos \<in> plus_sign a1 a2" by force moreover assume "0 < i1 + i2" ultimately show "i1 + i2 \<in> \<gamma>_sign (plus_sign a1 a2)" by fastforce } } { assume "0 < i1" with 4(1) have H1: "Pos \<in> a1" by (simp add: Pos_\<gamma>_sign) { assume "i2 < 0" with 4(2) have H2: "Neg \<in> a2" by (simp add: Neg_\<gamma>_sign) from H1 H2 have "plus_sign a1 a2 = UNIV" by force then have "\<gamma>_sign (plus_sign a1 a2) = UNIV" using \<gamma>_sign_top by auto then show "i1 + i2 \<in> \<gamma>_sign (plus_sign a1 a2)" by auto then show "i1 + i2 \<in> \<gamma>_sign (plus_sign a1 a2)" . then show "i1 + i2 \<in> \<gamma>_sign (plus_sign a1 a2)" . } { assume "i2 = 0" with 4(2) have H2: "Zero \<in> a2" by (simp add: Zero_\<gamma>_sign) from H1 H2 have "Pos \<in> plus_sign a1 a2" by force moreover assume "0 < i1 + i2" ultimately show "i1 + i2 \<in> \<gamma>_sign (plus_sign a1 a2)" by fastforce } { assume "0 < i2" with 4(2) have H2: "Pos \<in> a2" by (simp add: Pos_\<gamma>_sign) from H1 H2 have "Pos \<in> plus_sign a1 a2" by force moreover assume "0 < i1 + i2" ultimately show "i1 + i2 \<in> \<gamma>_sign (plus_sign a1 a2)" by fastforce } } qed qed text\<open>In case 4 we needed to refer to particular variables. Writing (i x y z) fixes the names of the variables in case i to be x, y and z in the left-to-right order in which the variables occur in the subgoal. Underscores are anonymous placeholders for variable names we don't care to fix.\<close> text\<open>Instantiating the abstract interpretation locale requires no more proofs (they happened in the instatiation above) but delivers the instantiated abstract interpreter which we call \<open>AI_parity\<close>:\<close> global_interpretation Abs_Int where \<gamma> = \<gamma>_sign and num' = num_sign and plus' = plus_sign defines aval_sign = aval' and step_sign = step' and AI_sign = AI .. global_interpretation Abs_Int_mono where \<gamma> = \<gamma>_sign and num' = num_sign and plus' = plus_sign proof (standard, goal_cases) case (1 a1 b1 a2 b2) thus ?case by(induct b1 b2 rule: plus_sign.induct) auto qed definition m_sign :: "sign \<Rightarrow> nat" where "m_sign x = 3 - card x" global_interpretation Abs_Int_measure where \<gamma> = \<gamma>_sign and num' = num_sign and plus' = plus_sign and m = m_sign and h = "3" proof (standard, goal_cases) case (1 x) thus ?case by(auto simp add: m_sign_def) next case (2 x y) have "y \<subseteq> UNIV" by auto then show ?case unfolding m_sign_def by (metis "2" card_sign' diff_less_mono2 finite_sign' finite_subset less_le_trans psubset_card_mono) qed thm AI_Some_measure end
[STATEMENT] lemma arith_sum1:"(t::nat) + (i + k + d) = t + i + k + d" [PROOF STATE] proof (prove) goal (1 subgoal): 1. t + (i + k + d) = t + i + k + d [PROOF STEP] by arith
[STATEMENT] lemma valid_decomp_Nil: "valid_decomp X []" [PROOF STATE] proof (prove) goal (1 subgoal): 1. valid_decomp X [] [PROOF STEP] by (simp add: valid_decomp_def)
theory Short_Theory_ASM imports "HOL-IMP.AExp" begin datatype instr = LOADI val | LOAD vname | ADD type_synonym stack = "val list" fun exec1 :: "instr \<Rightarrow> state \<Rightarrow> stack \<Rightarrow> stack option" where "exec1 (LOADI n) _ stk = Some (n # stk)" | "exec1 (LOAD x) s stk = Some (s x # stk)" | "exec1 ADD _ (j # i # stk) = Some ((i + j) # stk)" | "exec1 ADD _ _ = None" fun exec :: "instr list \<Rightarrow> state \<Rightarrow> stack \<Rightarrow> stack option" where "exec [] _ stk = Some stk" | "exec (i # is) s stk = (case exec1 i s stk of Some stk\<^sub>i \<Rightarrow> exec is s stk\<^sub>i | None \<Rightarrow> None)" 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]" lemma exec_app: "exec (is\<^sub>1 @ is\<^sub>2) s stk = (case exec is\<^sub>1 s stk of Some stk\<^sub>1 \<Rightarrow> exec is\<^sub>2 s stk\<^sub>1 | None \<Rightarrow> None)" apply (induction is\<^sub>1 arbitrary: stk) apply (auto split: option.split) done lemma "exec (comp a) s stk = Some (aval a s # stk)" apply (induction a arbitrary: stk) apply (auto simp add: exec_app) done end
State Before: m n✝ n : ℕ ⊢ Even (n * (n + 1)) State After: m n✝ n : ℕ ⊢ Even n ∨ ¬Even n Tactic: rw [even_mul, even_add_one] State Before: m n✝ n : ℕ ⊢ Even n ∨ ¬Even n State After: no goals Tactic: exact em _
[STATEMENT] lemma [code_unfold]: "p dvd q \<longleftrightarrow> dvd_int_poly p q" [PROOF STATE] proof (prove) goal (1 subgoal): 1. (p dvd q) = dvd_int_poly p q [PROOF STEP] by simp
theory Lens imports Iso begin locale lens = fixes get :: "'s \<Rightarrow> 'a" and set :: "'a \<Rightarrow> 's \<Rightarrow> 's" assumes set_get[simp]: "get (set a s) = a" assumes get_set[simp]: "set (get s) s = s" assumes set_set[simp]: "set a (set a' s) = set a s" begin definition modify :: "('a \<Rightarrow> 'a) \<Rightarrow> 's \<Rightarrow> 's" where [optics]: "modify f s = set (f (get s)) s" lemma modify_id[simp]: "modify id = id" unfolding modify_def[abs_def] id_def by auto lemma modify_comp[simp]: "modify (f \<circ> g) = modify f \<circ> modify g" unfolding modify_def[abs_def] comp_def by auto end context iso begin definition set where [optics]: "set a _ = back a" sublocale lens: lens get set by unfold_locales (auto simp: set_def) lemma lens_modify_eq[simp]: "lens.modify = modify" unfolding lens.modify_def[abs_def] modify_def[abs_def] set_def by auto end locale compose_lens_lens = one: lens f g + two: lens h i for f :: "'s \<Rightarrow> 'a" and g and h :: "'a \<Rightarrow> 'b" and i begin definition [optics]: "get = h \<circ> f" definition set where [optics]: "set b s = g (i b (f s)) s" sublocale lens get set by unfold_locales (auto simp: get_def set_def) end context compose_iso_iso begin sublocale lens_lens: compose_lens_lens f "iso.set g" h "iso.set i" .. lemma get_eq[simp]: "lens_lens.get = get" unfolding lens_lens.get_def get_def .. lemma set_eq[simp]: "lens_lens.set = set" unfolding lens_lens.set_def[abs_def] one.set_def two.set_def local.set_def[abs_def] by (simp add: back_def) end end
SUBROUTINE DM_WSTR ( iflno, isword, nchar, string, iret ) C************************************************************************ C* DM_WSTR * C* * C* This subroutine writes a string to a DM file. * C* * C* DM_WSTR ( IFLNO, ISWORD, NCHAR, STRING, IRET ) * C* * C* Input parameters: * C* IFLNO INTEGER File number * C* ISWORD INTEGER Start word * C* NCHAR INTEGER Number of characters * C* STRING CHAR* String to write * C* * C* Output parameters: * C* IRET INTEGER Return code * C* 0 = normal return * C* -6 = write error * C* -7 = read error * C** * C* Log: * C* M. desJardins/GSFC 4/87 * C* M. desJardins/GSFC 4/91 Write to files from other machines * C************************************************************************ INCLUDE 'GEMPRM.PRM' INCLUDE 'dmcmn.cmn' C CHARACTER*(*) string C------------------------------------------------------------------------ C* Set machine type to actual machine so strings will not be C* translated. C mmsave = kmachn ( iflno ) kmachn ( iflno ) = MTMACH C C* Check the number of characters to move against actual length C* of string. C lstr = LEN ( string ) IF ( nchar .le. 0 ) THEN iret = 0 RETURN ELSE IF ( lstr .lt. nchar ) THEN num = lstr ELSE num = nchar END IF C C* Loop through, moving the string into an integer array and C* writing out to the file. C iwrite = isword istart = 1 DO WHILE ( istart .le. num ) iend = istart + MMSPCE * 4 - 1 IF ( iend .gt. num ) iend = num knt = iend - istart + 1 CALL ST_STOI ( string (istart:), num, nval, intarr, ier ) CALL DM_WINT ( iflno, iwrite, nval, intarr, iret ) IF ( iret .ne. 0 ) THEN istart = num + 1 ELSE istart = istart + MMSPCE * 4 iwrite = iwrite + nval END IF END DO C C* Reset machine type. C kmachn ( iflno ) = mmsave C* RETURN END
SUBROUTINE FORSAV(TIME,DELDIP,IPT,N3,FMATRX, COORD,NVAR) IMPLICIT DOUBLE PRECISION (A-H,O-Z) INCLUDE 'SIZES/NOLIST' DIMENSION FMATRX(*), DELDIP(3,*), COORD(*) ************************************************************************** * * FORSAV SAVES AND RESTORES DATA USED IN THE FORCE CALCULATION. * * ON INPUT TIME = TOTAL TIME ELAPSED SINCE THE START OF THE CALCULATION. * IPT = LINE OF FORCE MATRIX REACHED, IF IN WRITE MODE, * = 0 IF IN READ MODE. * FMATRX = FORCE MATRIX ************************************************************************** COMMON /DENSTY/ P(MPACK), PA(MPACK), PB(MPACK) COMMON /MOLKST/ NUMAT,NAT(NUMATM),NFIRST(NUMATM),NMIDLE(NUMATM), + NLAST(NUMATM), NORBS, NELECS, 1 NALPHA, NBETA, NCLOSE, NOPEN IR=9 IW=9 REWIND 10 REWIND IR IF( IPT .EQ. 0 ) THEN C C READ IN FORCE DATA C READ(IR)TIME,IPT LINEAR=(NVAR*(NVAR+1))/2 READ(IR)(COORD(I),I=1,MAXPAR) READ(IR)(FMATRX(I),I=1,LINEAR) READ(IR)((DELDIP(J,I),J=1,3),I=1,IPT) LINEAR=(NORBS*(NORBS+1))/2 READ(10)(PA(I),I=1,LINEAR) IF(NALPHA.NE.0)READ(10)(PB(I),I=1,LINEAR) RETURN ELSE C C WRITE FORCE DATA C REWIND IW WRITE(IW)TIME,IPT LINEAR=(NVAR*(NVAR+1))/2 WRITE(IW)(COORD(I),I=1,MAXPAR) WRITE(IW)(FMATRX(I),I=1,LINEAR) WRITE(IW)((DELDIP(J,I),J=1,3),I=1,IPT) LINEAR=(NORBS*(NORBS+1))/2 WRITE(10)(PA(I),I=1,LINEAR) IF(NALPHA.NE.0)WRITE(10)(PB(I),I=1,LINEAR) IF(IPT.EQ.N3) THEN WRITE(6,'(//10X,''FORCE MATRIX WRITTEN TO DISK'')') ELSE STOP ENDIF ENDIF END
[STATEMENT] lemma update_swap: "k \<noteq> k' \<Longrightarrow> map_of (update k v (update k' v' al)) = map_of (update k' v' (update k v al))" [PROOF STATE] proof (prove) goal (1 subgoal): 1. k \<noteq> k' \<Longrightarrow> map_of (update k v (update k' v' al)) = map_of (update k' v' (update k v al)) [PROOF STEP] by (simp add: update_conv' fun_eq_iff)
{-# OPTIONS --safe #-} module Cubical.Algebra.Monoid.Base where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Equiv open import Cubical.Foundations.Equiv.HalfAdjoint open import Cubical.Foundations.Function open import Cubical.Foundations.HLevels open import Cubical.Foundations.Isomorphism open import Cubical.Foundations.Univalence open import Cubical.Foundations.Transport open import Cubical.Foundations.SIP open import Cubical.Data.Sigma open import Cubical.Algebra.Semigroup open import Cubical.Displayed.Base open import Cubical.Displayed.Auto open import Cubical.Displayed.Record open import Cubical.Displayed.Universe open import Cubical.Reflection.RecordEquiv open Iso private variable ℓ : Level record IsMonoid {A : Type ℓ} (ε : A) (_·_ : A → A → A) : Type ℓ where constructor ismonoid field isSemigroup : IsSemigroup _·_ identity : (x : A) → (x · ε ≡ x) × (ε · x ≡ x) open IsSemigroup isSemigroup public lid : (x : A) → ε · x ≡ x lid x = identity x .snd rid : (x : A) → x · ε ≡ x rid x = identity x .fst unquoteDecl IsMonoidIsoΣ = declareRecordIsoΣ IsMonoidIsoΣ (quote IsMonoid) record MonoidStr (A : Type ℓ) : Type ℓ where constructor monoidstr field ε : A _·_ : A → A → A isMonoid : IsMonoid ε _·_ infixl 7 _·_ open IsMonoid isMonoid public Monoid : ∀ ℓ → Type (ℓ-suc ℓ) Monoid ℓ = TypeWithStr ℓ MonoidStr monoid : (A : Type ℓ) (ε : A) (_·_ : A → A → A) (h : IsMonoid ε _·_) → Monoid ℓ monoid A ε _·_ h = A , monoidstr ε _·_ h -- Easier to use constructors makeIsMonoid : {M : Type ℓ} {ε : M} {_·_ : M → M → M} (is-setM : isSet M) (assoc : (x y z : M) → x · (y · z) ≡ (x · y) · z) (rid : (x : M) → x · ε ≡ x) (lid : (x : M) → ε · x ≡ x) → IsMonoid ε _·_ IsMonoid.isSemigroup (makeIsMonoid is-setM assoc rid lid) = issemigroup is-setM assoc IsMonoid.identity (makeIsMonoid is-setM assoc rid lid) = λ x → rid x , lid x makeMonoid : {M : Type ℓ} (ε : M) (_·_ : M → M → M) (is-setM : isSet M) (assoc : (x y z : M) → x · (y · z) ≡ (x · y) · z) (rid : (x : M) → x · ε ≡ x) (lid : (x : M) → ε · x ≡ x) → Monoid ℓ makeMonoid ε _·_ is-setM assoc rid lid = monoid _ ε _·_ (makeIsMonoid is-setM assoc rid lid) record IsMonoidEquiv {A : Type ℓ} {B : Type ℓ} (M : MonoidStr A) (e : A ≃ B) (N : MonoidStr B) : Type ℓ where constructor monoidequiv -- Shorter qualified names private module M = MonoidStr M module N = MonoidStr N field presε : equivFun e M.ε ≡ N.ε isHom : (x y : A) → equivFun e (x M.· y) ≡ equivFun e x N.· equivFun e y MonoidEquiv : (M N : Monoid ℓ) → Type ℓ MonoidEquiv M N = Σ[ e ∈ ⟨ M ⟩ ≃ ⟨ N ⟩ ] IsMonoidEquiv (M .snd) e (N .snd) -- We now extract the important results from the above module isPropIsMonoid : {M : Type ℓ} (ε : M) (_·_ : M → M → M) → isProp (IsMonoid ε _·_) isPropIsMonoid ε _·_ = isOfHLevelRetractFromIso 1 IsMonoidIsoΣ (isPropΣ (isPropIsSemigroup _·_) (λ semi → isPropΠ λ _ → isProp× (semi .is-set _ _) (semi .is-set _ _))) where open IsSemigroup 𝒮ᴰ-Monoid : DUARel (𝒮-Univ ℓ) MonoidStr ℓ 𝒮ᴰ-Monoid = 𝒮ᴰ-Record (𝒮-Univ _) IsMonoidEquiv (fields: data[ ε ∣ autoDUARel _ _ ∣ presε ] data[ _·_ ∣ autoDUARel _ _ ∣ isHom ] prop[ isMonoid ∣ (λ _ _ → isPropIsMonoid _ _) ]) where open MonoidStr open IsMonoidEquiv MonoidPath : (M N : Monoid ℓ) → MonoidEquiv M N ≃ (M ≡ N) MonoidPath = ∫ 𝒮ᴰ-Monoid .UARel.ua module MonoidTheory {ℓ} (M : Monoid ℓ) where open MonoidStr (snd M) -- Added for its use in groups -- If there exists a inverse of an element it is unique inv-lemma : (x y z : ⟨ M ⟩) → y · x ≡ ε → x · z ≡ ε → y ≡ z inv-lemma x y z left-inverse right-inverse = y ≡⟨ sym (rid y) ⟩ y · ε ≡⟨ cong (λ - → y · -) (sym right-inverse) ⟩ y · (x · z) ≡⟨ assoc y x z ⟩ (y · x) · z ≡⟨ cong (λ - → - · z) left-inverse ⟩ ε · z ≡⟨ lid z ⟩ z ∎
import dadi import dadi.DFE import dadi.NLopt_mod import pickle, glob, nlopt import os, time import numpy as np from src.Pdfs import get_dadi_pdf def infer_dfe(fs, output, cache1d, cache2d, sele_dist, sele_dist2, ns_s, popt, p0, upper_bounds, lower_bounds, fixed_params, misid, cuda): ts = time.time() seed = int(ts) + int(os.getpid()) np.random.seed(seed) fs = dadi.Spectrum.from_file(fs) popt = np.array(open(popt, 'r').readline().rstrip().split(), dtype=float) theta = ns_s * popt[-1] if cache1d != None: spectra1d = pickle.load(open(cache1d, 'rb')) func = spectra1d.integrate if cache2d != None: spectra2d = pickle.load(open(cache2d, 'rb')) func = spectra2d.integrate if sele_dist != None: sele_dist = get_dadi_pdf(sele_dist) if sele_dist2 != None: sele_dist2 = get_dadi_pdf(sele_dist2) if (sele_dist == None) and (sele_dist2 != None): sele_dist = sele_dist2 if (cache1d != None) and (cache2d != None): func = dadi.DFE.Cache2D_mod.mixture func_args = [spectra1d, spectra2d, sele_dist, sele_dist2, theta] else: func_args = [sele_dist, theta] if misid: func = dadi.Numerics.make_anc_state_misid_func(func) # Fit a DFE to the data # Initial guess and bounds p0 = dadi.Misc.perturb_params(p0, lower_bound=lower_bounds, upper_bound=upper_bounds) popt = dadi.Inference.optimize_log(p0, fs, func, pts=None, func_args=func_args, fixed_params=fixed_params, lower_bound=lower_bounds, upper_bound=upper_bounds, verbose=0, maxiter=200, multinom=False) #print('Optimized parameters: {0}'.format(popt)) # Get expected SFS for MLE if (cache1d != None) and (cache2d != None): model = func(popt, None, spectra1d, spectra2d, sele_dist, sele_dist2, theta, None) else: model = func(popt, None, sele_dist, theta, None) # Likelihood of the data given the model AFS. ll_model = dadi.Inference.ll_multinom(model, fs) #print('Maximum log composite likelihood: {0}'.format(ll_model)) with open(output, 'w') as f: f.write(str(ll_model)) for p in popt: f.write("\t") f.write(str(p)) f.write("\n")
import tactic import subgroup.lattice /-! Group homomorphisms Definition file -- not for beginner mathematicians -/ -- We're always overwriting group theory here so we always work in -- a namespace namespace mygroup /- homomorphisms of groups -/ /-- Bundled group homomorphisms -/ structure group_hom (G H : Type) [group G] [group H] := (to_fun : G → H) (map_mul' : ∀ x y, to_fun (x * y) = to_fun x * to_fun y) -- notation infixr ` →* `:25 := group_hom -- coercion to a function instance {G H : Type} [group G] [group H] : has_coe_to_fun (G →* H) := ⟨_, group_hom.to_fun⟩ @[simp] lemma to_fun_eq_coe {G H : Type} [group G] [group H] (f : G →* H) : f.to_fun = f := rfl @[ext] lemma ext_hom {G H : Type} [group G] [group H] (φ ψ : G →* H) : φ = ψ ↔ φ.to_fun = ψ.to_fun := begin split, cc, intro h, cases φ with φ1 φ2, cases ψ with ψ1 ψ2, simp * at *, end @[ext] lemma ext {G H : Type} [group G] [group H] (φ ψ : G →* H) (h : ∀ g : G, φ g = ψ g) : φ = ψ := begin rw ext_hom, ext g, exact h g, end -- the identity homomorphism def id_hom {G : Type} [group G] : G →* G := ⟨id, λ x y, rfl⟩ /-- Group isomorphism as a bijective group homomorphism -/ structure group_iso (G H : Type) [group G] [group H] extends group_hom G H := (is_bijective : function.bijective to_fun) notation G ` ≅ ` H := group_iso G H -- Coercion from `group_iso` to `group_hom` instance {G H : Type} [group G] [group H] : has_coe_t (G ≅ H) (G →* H) := ⟨group_iso.to_group_hom⟩ instance coe_iso_to_fun {G H : Type} [group G] [group H] : has_coe_to_fun (G ≅ H) := ⟨_, group_iso.to_group_hom⟩ -- Should we define it this way or as an extension of equiv that preserves mul? /- Alternative definition structure group_equiv (G H : Type) [group G] [group H] extends G ≃ H := (map_mul' : ∀ x y : G, to_fun (x * y) = to_fun x * to_fun y) notation G ` ≅ ` H := group_equiv G H -- Coercion from `group_equiv` to `group_hom` instance {G H : Type} [group G] [group H] : has_coe (G ≅ H) (G →* H) := ⟨λ f, ⟨f.to_fun, f.map_mul'⟩⟩ -/ namespace group_hom variables {G H K : Type} [group G] [group H] [group K] /-- If f is a group homomorphism then f (a * b) = f a * f b. -/ @[simp] lemma map_mul (f : G →* H) (a b : G) : f (a * b) = f a * f b := f.map_mul' a b /-- The composition of two group homomorphisms form a group homomorphism -/ def map_comp (f : G →* H) (g : H →* K) : G →* K := { to_fun := g ∘ f, map_mul' := λ x y, by simp } notation g ` ∘* ` f := map_comp f g @[simp] lemma coe_map_comp (f : G →* H) (g : H →* K) : ((g ∘* f) : G → K) = g ∘ f := rfl /-- A group is isomorphic to itself by the identity homomorphism -/ def iso_refl : G ≅ G := { is_bijective := function.bijective_id, .. id_hom } /-- The composition of two group isomorphisms form a group isomorphism -/ def iso_comp (f : G ≅ H) (g : H ≅ K) : G ≅ K := { is_bijective := function.bijective.comp g.is_bijective f.is_bijective, .. (g : group_hom H K) ∘* (f : group_hom G H) } /-- An equiv between two groups that preserves multiplication forms an isomorphism -/ def iso_of_mul_equiv (f : G ≃* H) : G ≅ H := { to_fun := f, map_mul' := f.map_mul', is_bijective := equiv.bijective f.to_equiv } /-- An isomorphism between two groups from an mul_equiv -/ noncomputable def mul_equiv_of_iso (f : G ≅ H) : G ≃* H := { map_mul' := map_mul f, .. equiv.of_bijective _ f.is_bijective } /-- If the group `G` is isomorphic to the group `H`, then `H` is isomorphic to `G`-/ noncomputable def iso_symm (f : G ≅ H) : H ≅ G := iso_of_mul_equiv $ mul_equiv.symm $ mul_equiv_of_iso f def to_prod (H : subgroup G) (N : normal G) : H →* H ⨯ N := { to_fun := λ h, ⟨h.1, h.1, h.2, 1, subgroup.one_mem N, (group.mul_one _).symm⟩, map_mul' := λ ⟨x, hx⟩ ⟨y, hy⟩, subtype.val_injective rfl } @[simp] lemma to_prod_apply (H : subgroup G) (N : normal G) (h : H) : to_prod H N h = ⟨h.1, h.1, h.2, 1, subgroup.one_mem N, (group.mul_one _).symm⟩ := rfl @[simp] lemma to_prod_mul {H : subgroup G} {K : normal G} (x y : H) : (to_prod H K x) * (to_prod H K y) = to_prod H K (x * y) := rfl def to_prod' (H : subgroup G) (N : normal G) : N.to_subgroup →* H ⨯ N := { to_fun := λ n, ⟨n.1, 1, H.one_mem, n.1, n.2, (group.one_mul _).symm⟩, map_mul' := λ ⟨x, hx⟩ ⟨y, hy⟩, subtype.val_injective rfl } end group_hom -- namespace for group homs end mygroup -- namespace for the project
Formal statement is: lemma Bfun_inverse: fixes a :: "'a::real_normed_div_algebra" assumes f: "(f \<longlongrightarrow> a) F" assumes a: "a \<noteq> 0" shows "Bfun (\<lambda>x. inverse (f x)) F" Informal statement is: If $f$ is a function that converges to a nonzero number $a$, then the function $1/f$ is bounded.
\chapter{{\tt Perm}: Permutation Object} \par The {\tt Perm} object is used to store a pair of permutation vectors. The main function of this object is to read and write permutations from and to files.
(* Property from Productive Use of Failure in Inductive Proof, Andrew Ireland and Alan Bundy, JAR 1996. 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_45 imports "../../Test_Base" begin datatype 'a list = nil2 | cons2 "'a" "'a list" datatype Nat = Z | S "Nat" fun y :: "Nat => Nat => bool" where "y (Z) (Z) = True" | "y (Z) (S z2) = False" | "y (S x2) (Z) = False" | "y (S x2) (S y22) = y x2 y22" fun x :: "bool => bool => bool" where "x True y2 = True" | "x False y2 = y2" fun elem :: "Nat => Nat list => bool" where "elem z (nil2) = False" | "elem z (cons2 z2 xs) = x (y z z2) (elem z xs)" fun t2 :: "Nat => Nat => bool" where "t2 (Z) y2 = True" | "t2 (S z2) (Z) = False" | "t2 (S z2) (S x2) = t2 z2 x2" fun insert :: "Nat => Nat list => Nat list" where "insert z (nil2) = cons2 z (nil2)" | "insert z (cons2 z2 xs) = (if t2 z z2 then cons2 z (cons2 z2 xs) else cons2 z2 (insert z xs))" theorem property0 : "elem z (insert z y2)" oops end
[STATEMENT] lemma shconfD: "\<lbrakk> P,h \<turnstile>\<^sub>s sh \<surd>; sh C = Some(sfs,i) \<rbrakk> \<Longrightarrow> P,h,C \<turnstile>\<^sub>s sfs \<surd>" [PROOF STATE] proof (prove) goal (1 subgoal): 1. \<lbrakk>P,h \<turnstile>\<^sub>s sh \<surd>; sh C = \<lfloor>(sfs, i)\<rfloor>\<rbrakk> \<Longrightarrow> P,h,C \<turnstile>\<^sub>s sfs \<surd> [PROOF STEP] (*<*) [PROOF STATE] proof (prove) goal (1 subgoal): 1. \<lbrakk>P,h \<turnstile>\<^sub>s sh \<surd>; sh C = \<lfloor>(sfs, i)\<rfloor>\<rbrakk> \<Longrightarrow> P,h,C \<turnstile>\<^sub>s sfs \<surd> [PROOF STEP] by (unfold shconf_def) fast
/- 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, Yaël Dillies ! This file was ported from Lean 3 source module order.complete_boolean_algebra ! leanprover-community/mathlib commit 71b36b6f3bbe3b44e6538673819324d3ee9fcc96 ! Please do not edit these lines, except to modify the commit id ! if you have ported upstream changes. -/ import Mathbin.Order.CompleteLattice import Mathbin.Order.Directed import Mathbin.Logic.Equiv.Set /-! # Frames, completely distributive lattices and Boolean algebras > THIS FILE IS SYNCHRONIZED WITH MATHLIB4. > Any changes to this file require a corresponding PR to mathlib4. In this file we define and provide API for frames, completely distributive lattices and completely distributive Boolean algebras. ## Typeclasses * `order.frame`: Frame: A complete lattice whose `⊓` distributes over `⨆`. * `order.coframe`: Coframe: A complete lattice whose `⊔` distributes over `⨅`. * `complete_distrib_lattice`: Completely distributive lattices: A complete lattice whose `⊓` and `⊔` distribute over `⨆` and `⨅` respectively. * `complete_boolean_algebra`: Completely distributive Boolean algebra: A Boolean algebra whose `⊓` and `⊔` distribute over `⨆` and `⨅` respectively. A set of opens gives rise to a topological space precisely if it forms a frame. Such a frame is also completely distributive, but not all frames are. `filter` is a coframe but not a completely distributive lattice. ## TODO Add instances for `prod` ## References * [Wikipedia, *Complete Heyting algebra*](https://en.wikipedia.org/wiki/Complete_Heyting_algebra) * [Francis Borceux, *Handbook of Categorical Algebra III*][borceux-vol3] -/ open Function Set universe u v w variable {α : Type u} {β : Type v} {ι : Sort w} {κ : ι → Sort _} #print Order.Frame /- /-- A frame, aka complete Heyting algebra, is a complete lattice whose `⊓` distributes over `⨆`. -/ class Order.Frame (α : Type _) extends CompleteLattice α where inf_sup_le_supᵢ_inf (a : α) (s : Set α) : a ⊓ Sup s ≤ ⨆ b ∈ s, a ⊓ b #align order.frame Order.Frame -/ #print Order.Coframe /- /-- A coframe, aka complete Brouwer algebra or complete co-Heyting algebra, is a complete lattice whose `⊔` distributes over `⨅`. -/ class Order.Coframe (α : Type _) extends CompleteLattice α where infᵢ_sup_le_sup_inf (a : α) (s : Set α) : (⨅ b ∈ s, a ⊔ b) ≤ a ⊔ Inf s #align order.coframe Order.Coframe -/ open Order #print CompleteDistribLattice /- /-- A completely distributive lattice is a complete lattice whose `⊔` and `⊓` respectively distribute over `⨅` and `⨆`. -/ class CompleteDistribLattice (α : Type _) extends Frame α where infᵢ_sup_le_sup_inf : ∀ a s, (⨅ b ∈ s, a ⊔ b) ≤ a ⊔ Inf s #align complete_distrib_lattice CompleteDistribLattice -/ #print CompleteDistribLattice.toCoframe /- -- See note [lower instance priority] instance (priority := 100) CompleteDistribLattice.toCoframe [CompleteDistribLattice α] : Coframe α := { ‹CompleteDistribLattice α› with } #align complete_distrib_lattice.to_coframe CompleteDistribLattice.toCoframe -/ section Frame variable [Frame α] {s t : Set α} {a b : α} #print OrderDual.coframe /- instance OrderDual.coframe : Coframe αᵒᵈ := { OrderDual.completeLattice α with infᵢ_sup_le_sup_inf := Frame.inf_sup_le_supᵢ_inf } #align order_dual.coframe OrderDual.coframe -/ /- warning: inf_Sup_eq -> inf_supₛ_eq is a dubious translation: lean 3 declaration is forall {α : Type.{u1}} [_inst_1 : Order.Frame.{u1} α] {s : Set.{u1} α} {a : α}, Eq.{succ u1} α (Inf.inf.{u1} α (SemilatticeInf.toHasInf.{u1} α (Lattice.toSemilatticeInf.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)))) a (SupSet.supₛ.{u1} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) s)) (supᵢ.{u1, succ u1} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) α (fun (b : α) => supᵢ.{u1, 0} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) b s) (fun (H : Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) b s) => Inf.inf.{u1} α (SemilatticeInf.toHasInf.{u1} α (Lattice.toSemilatticeInf.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)))) a b))) but is expected to have type forall {α : Type.{u1}} [_inst_1 : Order.Frame.{u1} α] {s : Set.{u1} α} {a : α}, Eq.{succ u1} α (Inf.inf.{u1} α (Lattice.toInf.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) a (SupSet.supₛ.{u1} α (CompleteLattice.toSupSet.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)) s)) (supᵢ.{u1, succ u1} α (CompleteLattice.toSupSet.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)) α (fun (b : α) => supᵢ.{u1, 0} α (CompleteLattice.toSupSet.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)) (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) b s) (fun (H : Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) b s) => Inf.inf.{u1} α (Lattice.toInf.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) a b))) Case conversion may be inaccurate. Consider using '#align inf_Sup_eq inf_supₛ_eqₓ'. -/ theorem inf_supₛ_eq : a ⊓ supₛ s = ⨆ b ∈ s, a ⊓ b := (Frame.inf_sup_le_supᵢ_inf _ _).antisymm supᵢ_inf_le_inf_supₛ #align inf_Sup_eq inf_supₛ_eq /- warning: Sup_inf_eq -> supₛ_inf_eq is a dubious translation: lean 3 declaration is forall {α : Type.{u1}} [_inst_1 : Order.Frame.{u1} α] {s : Set.{u1} α} {b : α}, Eq.{succ u1} α (Inf.inf.{u1} α (SemilatticeInf.toHasInf.{u1} α (Lattice.toSemilatticeInf.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)))) (SupSet.supₛ.{u1} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) s) b) (supᵢ.{u1, succ u1} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) α (fun (a : α) => supᵢ.{u1, 0} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) (fun (H : Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) => Inf.inf.{u1} α (SemilatticeInf.toHasInf.{u1} α (Lattice.toSemilatticeInf.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)))) a b))) but is expected to have type forall {α : Type.{u1}} [_inst_1 : Order.Frame.{u1} α] {s : Set.{u1} α} {b : α}, Eq.{succ u1} α (Inf.inf.{u1} α (Lattice.toInf.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (SupSet.supₛ.{u1} α (CompleteLattice.toSupSet.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)) s) b) (supᵢ.{u1, succ u1} α (CompleteLattice.toSupSet.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)) α (fun (a : α) => supᵢ.{u1, 0} α (CompleteLattice.toSupSet.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)) (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) a s) (fun (H : Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) a s) => Inf.inf.{u1} α (Lattice.toInf.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) a b))) Case conversion may be inaccurate. Consider using '#align Sup_inf_eq supₛ_inf_eqₓ'. -/ theorem supₛ_inf_eq : supₛ s ⊓ b = ⨆ a ∈ s, a ⊓ b := by simpa only [inf_comm] using @inf_supₛ_eq α _ s b #align Sup_inf_eq supₛ_inf_eq /- warning: supr_inf_eq -> supᵢ_inf_eq is a dubious translation: lean 3 declaration is forall {α : Type.{u1}} {ι : Sort.{u2}} [_inst_1 : Order.Frame.{u1} α] (f : ι -> α) (a : α), Eq.{succ u1} α (Inf.inf.{u1} α (SemilatticeInf.toHasInf.{u1} α (Lattice.toSemilatticeInf.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)))) (supᵢ.{u1, u2} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) ι (fun (i : ι) => f i)) a) (supᵢ.{u1, u2} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) ι (fun (i : ι) => Inf.inf.{u1} α (SemilatticeInf.toHasInf.{u1} α (Lattice.toSemilatticeInf.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)))) (f i) a)) but is expected to have type forall {α : Type.{u1}} {ι : Sort.{u2}} [_inst_1 : Order.Frame.{u1} α] (f : ι -> α) (a : α), Eq.{succ u1} α (Inf.inf.{u1} α (Lattice.toInf.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (supᵢ.{u1, u2} α (CompleteLattice.toSupSet.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)) ι (fun (i : ι) => f i)) a) (supᵢ.{u1, u2} α (CompleteLattice.toSupSet.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)) ι (fun (i : ι) => Inf.inf.{u1} α (Lattice.toInf.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (f i) a)) Case conversion may be inaccurate. Consider using '#align supr_inf_eq supᵢ_inf_eqₓ'. -/ theorem supᵢ_inf_eq (f : ι → α) (a : α) : (⨆ i, f i) ⊓ a = ⨆ i, f i ⊓ a := by rw [supᵢ, supₛ_inf_eq, supᵢ_range] #align supr_inf_eq supᵢ_inf_eq /- warning: inf_supr_eq -> inf_supᵢ_eq is a dubious translation: lean 3 declaration is forall {α : Type.{u1}} {ι : Sort.{u2}} [_inst_1 : Order.Frame.{u1} α] (a : α) (f : ι -> α), Eq.{succ u1} α (Inf.inf.{u1} α (SemilatticeInf.toHasInf.{u1} α (Lattice.toSemilatticeInf.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)))) a (supᵢ.{u1, u2} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) ι (fun (i : ι) => f i))) (supᵢ.{u1, u2} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) ι (fun (i : ι) => Inf.inf.{u1} α (SemilatticeInf.toHasInf.{u1} α (Lattice.toSemilatticeInf.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)))) a (f i))) but is expected to have type forall {α : Type.{u1}} {ι : Sort.{u2}} [_inst_1 : Order.Frame.{u1} α] (a : α) (f : ι -> α), Eq.{succ u1} α (Inf.inf.{u1} α (Lattice.toInf.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) a (supᵢ.{u1, u2} α (CompleteLattice.toSupSet.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)) ι (fun (i : ι) => f i))) (supᵢ.{u1, u2} α (CompleteLattice.toSupSet.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)) ι (fun (i : ι) => Inf.inf.{u1} α (Lattice.toInf.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) a (f i))) Case conversion may be inaccurate. Consider using '#align inf_supr_eq inf_supᵢ_eqₓ'. -/ theorem inf_supᵢ_eq (a : α) (f : ι → α) : (a ⊓ ⨆ i, f i) = ⨆ i, a ⊓ f i := by simpa only [inf_comm] using supᵢ_inf_eq f a #align inf_supr_eq inf_supᵢ_eq /- warning: bsupr_inf_eq -> supᵢ₂_inf_eq is a dubious translation: lean 3 declaration is forall {α : Type.{u1}} {ι : Sort.{u2}} {κ : ι -> Sort.{u3}} [_inst_1 : Order.Frame.{u1} α] {f : forall (i : ι), (κ i) -> α} (a : α), Eq.{succ u1} α (Inf.inf.{u1} α (SemilatticeInf.toHasInf.{u1} α (Lattice.toSemilatticeInf.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)))) (supᵢ.{u1, u2} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) ι (fun (i : ι) => supᵢ.{u1, u3} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (κ i) (fun (j : κ i) => f i j))) a) (supᵢ.{u1, u2} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) ι (fun (i : ι) => supᵢ.{u1, u3} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (κ i) (fun (j : κ i) => Inf.inf.{u1} α (SemilatticeInf.toHasInf.{u1} α (Lattice.toSemilatticeInf.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)))) (f i j) a))) but is expected to have type forall {α : Type.{u2}} {ι : Sort.{u3}} {κ : ι -> Sort.{u1}} [_inst_1 : Order.Frame.{u2} α] {f : forall (i : ι), (κ i) -> α} (a : α), Eq.{succ u2} α (Inf.inf.{u2} α (Lattice.toInf.{u2} α (CompleteLattice.toLattice.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1))) (supᵢ.{u2, u3} α (CompleteLattice.toSupSet.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1)) ι (fun (i : ι) => supᵢ.{u2, u1} α (CompleteLattice.toSupSet.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1)) (κ i) (fun (j : κ i) => f i j))) a) (supᵢ.{u2, u3} α (CompleteLattice.toSupSet.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1)) ι (fun (i : ι) => supᵢ.{u2, u1} α (CompleteLattice.toSupSet.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1)) (κ i) (fun (j : κ i) => Inf.inf.{u2} α (Lattice.toInf.{u2} α (CompleteLattice.toLattice.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1))) (f i j) a))) Case conversion may be inaccurate. Consider using '#align bsupr_inf_eq supᵢ₂_inf_eqₓ'. -/ /- ./././Mathport/Syntax/Translate/Expr.lean:107:6: warning: expanding binder group (i j) -/ /- ./././Mathport/Syntax/Translate/Expr.lean:107:6: warning: expanding binder group (i j) -/ theorem supᵢ₂_inf_eq {f : ∀ i, κ i → α} (a : α) : (⨆ (i) (j), f i j) ⊓ a = ⨆ (i) (j), f i j ⊓ a := by simp only [supᵢ_inf_eq] #align bsupr_inf_eq supᵢ₂_inf_eq /- warning: inf_bsupr_eq -> inf_supᵢ₂_eq is a dubious translation: lean 3 declaration is forall {α : Type.{u1}} {ι : Sort.{u2}} {κ : ι -> Sort.{u3}} [_inst_1 : Order.Frame.{u1} α] {f : forall (i : ι), (κ i) -> α} (a : α), Eq.{succ u1} α (Inf.inf.{u1} α (SemilatticeInf.toHasInf.{u1} α (Lattice.toSemilatticeInf.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)))) a (supᵢ.{u1, u2} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) ι (fun (i : ι) => supᵢ.{u1, u3} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (κ i) (fun (j : κ i) => f i j)))) (supᵢ.{u1, u2} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) ι (fun (i : ι) => supᵢ.{u1, u3} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (κ i) (fun (j : κ i) => Inf.inf.{u1} α (SemilatticeInf.toHasInf.{u1} α (Lattice.toSemilatticeInf.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)))) a (f i j)))) but is expected to have type forall {α : Type.{u2}} {ι : Sort.{u3}} {κ : ι -> Sort.{u1}} [_inst_1 : Order.Frame.{u2} α] {f : forall (i : ι), (κ i) -> α} (a : α), Eq.{succ u2} α (Inf.inf.{u2} α (Lattice.toInf.{u2} α (CompleteLattice.toLattice.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1))) a (supᵢ.{u2, u3} α (CompleteLattice.toSupSet.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1)) ι (fun (i : ι) => supᵢ.{u2, u1} α (CompleteLattice.toSupSet.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1)) (κ i) (fun (j : κ i) => f i j)))) (supᵢ.{u2, u3} α (CompleteLattice.toSupSet.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1)) ι (fun (i : ι) => supᵢ.{u2, u1} α (CompleteLattice.toSupSet.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1)) (κ i) (fun (j : κ i) => Inf.inf.{u2} α (Lattice.toInf.{u2} α (CompleteLattice.toLattice.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1))) a (f i j)))) Case conversion may be inaccurate. Consider using '#align inf_bsupr_eq inf_supᵢ₂_eqₓ'. -/ /- ./././Mathport/Syntax/Translate/Expr.lean:107:6: warning: expanding binder group (i j) -/ /- ./././Mathport/Syntax/Translate/Expr.lean:107:6: warning: expanding binder group (i j) -/ theorem inf_supᵢ₂_eq {f : ∀ i, κ i → α} (a : α) : (a ⊓ ⨆ (i) (j), f i j) = ⨆ (i) (j), a ⊓ f i j := by simp only [inf_supᵢ_eq] #align inf_bsupr_eq inf_supᵢ₂_eq /- warning: supr_inf_supr -> supᵢ_inf_supᵢ is a dubious translation: lean 3 declaration is forall {α : Type.{u1}} [_inst_1 : Order.Frame.{u1} α] {ι : Type.{u2}} {ι' : Type.{u3}} {f : ι -> α} {g : ι' -> α}, Eq.{succ u1} α (Inf.inf.{u1} α (SemilatticeInf.toHasInf.{u1} α (Lattice.toSemilatticeInf.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)))) (supᵢ.{u1, succ u2} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) ι (fun (i : ι) => f i)) (supᵢ.{u1, succ u3} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) ι' (fun (j : ι') => g j))) (supᵢ.{u1, max (succ u2) (succ u3)} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (Prod.{u2, u3} ι ι') (fun (i : Prod.{u2, u3} ι ι') => Inf.inf.{u1} α (SemilatticeInf.toHasInf.{u1} α (Lattice.toSemilatticeInf.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)))) (f (Prod.fst.{u2, u3} ι ι' i)) (g (Prod.snd.{u2, u3} ι ι' i)))) but is expected to have type forall {α : Type.{u3}} [_inst_1 : Order.Frame.{u3} α] {ι : Type.{u2}} {ι' : Type.{u1}} {f : ι -> α} {g : ι' -> α}, Eq.{succ u3} α (Inf.inf.{u3} α (Lattice.toInf.{u3} α (CompleteLattice.toLattice.{u3} α (Order.Frame.toCompleteLattice.{u3} α _inst_1))) (supᵢ.{u3, succ u2} α (CompleteLattice.toSupSet.{u3} α (Order.Frame.toCompleteLattice.{u3} α _inst_1)) ι (fun (i : ι) => f i)) (supᵢ.{u3, succ u1} α (CompleteLattice.toSupSet.{u3} α (Order.Frame.toCompleteLattice.{u3} α _inst_1)) ι' (fun (j : ι') => g j))) (supᵢ.{u3, max (succ u2) (succ u1)} α (CompleteLattice.toSupSet.{u3} α (Order.Frame.toCompleteLattice.{u3} α _inst_1)) (Prod.{u2, u1} ι ι') (fun (i : Prod.{u2, u1} ι ι') => Inf.inf.{u3} α (Lattice.toInf.{u3} α (CompleteLattice.toLattice.{u3} α (Order.Frame.toCompleteLattice.{u3} α _inst_1))) (f (Prod.fst.{u2, u1} ι ι' i)) (g (Prod.snd.{u2, u1} ι ι' i)))) Case conversion may be inaccurate. Consider using '#align supr_inf_supr supᵢ_inf_supᵢₓ'. -/ theorem supᵢ_inf_supᵢ {ι ι' : Type _} {f : ι → α} {g : ι' → α} : ((⨆ i, f i) ⊓ ⨆ j, g j) = ⨆ i : ι × ι', f i.1 ⊓ g i.2 := by simp only [inf_supᵢ_eq, supᵢ_inf_eq, supᵢ_prod] #align supr_inf_supr supᵢ_inf_supᵢ /- warning: bsupr_inf_bsupr -> bsupᵢ_inf_bsupᵢ is a dubious translation: lean 3 declaration is forall {α : Type.{u1}} [_inst_1 : Order.Frame.{u1} α] {ι : Type.{u2}} {ι' : Type.{u3}} {f : ι -> α} {g : ι' -> α} {s : Set.{u2} ι} {t : Set.{u3} ι'}, Eq.{succ u1} α (Inf.inf.{u1} α (SemilatticeInf.toHasInf.{u1} α (Lattice.toSemilatticeInf.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)))) (supᵢ.{u1, succ u2} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) ι (fun (i : ι) => supᵢ.{u1, 0} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (Membership.Mem.{u2, u2} ι (Set.{u2} ι) (Set.hasMem.{u2} ι) i s) (fun (H : Membership.Mem.{u2, u2} ι (Set.{u2} ι) (Set.hasMem.{u2} ι) i s) => f i))) (supᵢ.{u1, succ u3} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) ι' (fun (j : ι') => supᵢ.{u1, 0} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (Membership.Mem.{u3, u3} ι' (Set.{u3} ι') (Set.hasMem.{u3} ι') j t) (fun (H : Membership.Mem.{u3, u3} ι' (Set.{u3} ι') (Set.hasMem.{u3} ι') j t) => g j)))) (supᵢ.{u1, succ (max u2 u3)} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (Prod.{u2, u3} ι ι') (fun (p : Prod.{u2, u3} ι ι') => supᵢ.{u1, 0} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (Membership.Mem.{max u2 u3, max u2 u3} (Prod.{u2, u3} ι ι') (Set.{max u2 u3} (Prod.{u2, u3} ι ι')) (Set.hasMem.{max u2 u3} (Prod.{u2, u3} ι ι')) p (Set.prod.{u2, u3} ι ι' s t)) (fun (H : Membership.Mem.{max u2 u3, max u2 u3} (Prod.{u2, u3} ι ι') (Set.{max u2 u3} (Prod.{u2, u3} ι ι')) (Set.hasMem.{max u2 u3} (Prod.{u2, u3} ι ι')) p (Set.prod.{u2, u3} ι ι' s t)) => Inf.inf.{u1} α (SemilatticeInf.toHasInf.{u1} α (Lattice.toSemilatticeInf.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)))) (f (Prod.fst.{u2, u3} ι ι' p)) (g (Prod.snd.{u2, u3} ι ι' p))))) but is expected to have type forall {α : Type.{u3}} [_inst_1 : Order.Frame.{u3} α] {ι : Type.{u2}} {ι' : Type.{u1}} {f : ι -> α} {g : ι' -> α} {s : Set.{u2} ι} {t : Set.{u1} ι'}, Eq.{succ u3} α (Inf.inf.{u3} α (Lattice.toInf.{u3} α (CompleteLattice.toLattice.{u3} α (Order.Frame.toCompleteLattice.{u3} α _inst_1))) (supᵢ.{u3, succ u2} α (CompleteLattice.toSupSet.{u3} α (Order.Frame.toCompleteLattice.{u3} α _inst_1)) ι (fun (i : ι) => supᵢ.{u3, 0} α (CompleteLattice.toSupSet.{u3} α (Order.Frame.toCompleteLattice.{u3} α _inst_1)) (Membership.mem.{u2, u2} ι (Set.{u2} ι) (Set.instMembershipSet.{u2} ι) i s) (fun (H : Membership.mem.{u2, u2} ι (Set.{u2} ι) (Set.instMembershipSet.{u2} ι) i s) => f i))) (supᵢ.{u3, succ u1} α (CompleteLattice.toSupSet.{u3} α (Order.Frame.toCompleteLattice.{u3} α _inst_1)) ι' (fun (j : ι') => supᵢ.{u3, 0} α (CompleteLattice.toSupSet.{u3} α (Order.Frame.toCompleteLattice.{u3} α _inst_1)) (Membership.mem.{u1, u1} ι' (Set.{u1} ι') (Set.instMembershipSet.{u1} ι') j t) (fun (H : Membership.mem.{u1, u1} ι' (Set.{u1} ι') (Set.instMembershipSet.{u1} ι') j t) => g j)))) (supᵢ.{u3, succ (max u2 u1)} α (CompleteLattice.toSupSet.{u3} α (Order.Frame.toCompleteLattice.{u3} α _inst_1)) (Prod.{u2, u1} ι ι') (fun (p : Prod.{u2, u1} ι ι') => supᵢ.{u3, 0} α (CompleteLattice.toSupSet.{u3} α (Order.Frame.toCompleteLattice.{u3} α _inst_1)) (Membership.mem.{max u2 u1, max u1 u2} (Prod.{u2, u1} ι ι') (Set.{max u1 u2} (Prod.{u2, u1} ι ι')) (Set.instMembershipSet.{max u2 u1} (Prod.{u2, u1} ι ι')) p (Set.prod.{u2, u1} ι ι' s t)) (fun (H : Membership.mem.{max u2 u1, max u1 u2} (Prod.{u2, u1} ι ι') (Set.{max u1 u2} (Prod.{u2, u1} ι ι')) (Set.instMembershipSet.{max u2 u1} (Prod.{u2, u1} ι ι')) p (Set.prod.{u2, u1} ι ι' s t)) => Inf.inf.{u3} α (Lattice.toInf.{u3} α (CompleteLattice.toLattice.{u3} α (Order.Frame.toCompleteLattice.{u3} α _inst_1))) (f (Prod.fst.{u2, u1} ι ι' p)) (g (Prod.snd.{u2, u1} ι ι' p))))) Case conversion may be inaccurate. Consider using '#align bsupr_inf_bsupr bsupᵢ_inf_bsupᵢₓ'. -/ /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/ theorem bsupᵢ_inf_bsupᵢ {ι ι' : Type _} {f : ι → α} {g : ι' → α} {s : Set ι} {t : Set ι'} : ((⨆ i ∈ s, f i) ⊓ ⨆ j ∈ t, g j) = ⨆ p ∈ s ×ˢ t, f (p : ι × ι').1 ⊓ g p.2 := by simp only [supᵢ_subtype', supᵢ_inf_supᵢ] exact (Equiv.surjective _).supᵢ_congr (Equiv.Set.prod s t).symm fun x => rfl #align bsupr_inf_bsupr bsupᵢ_inf_bsupᵢ /- warning: Sup_inf_Sup -> supₛ_inf_supₛ is a dubious translation: lean 3 declaration is forall {α : Type.{u1}} [_inst_1 : Order.Frame.{u1} α] {s : Set.{u1} α} {t : Set.{u1} α}, Eq.{succ u1} α (Inf.inf.{u1} α (SemilatticeInf.toHasInf.{u1} α (Lattice.toSemilatticeInf.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)))) (SupSet.supₛ.{u1} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) s) (SupSet.supₛ.{u1} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) t)) (supᵢ.{u1, succ u1} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (Prod.{u1, u1} α α) (fun (p : Prod.{u1, u1} α α) => supᵢ.{u1, 0} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (Membership.Mem.{u1, u1} (Prod.{u1, u1} α α) (Set.{u1} (Prod.{u1, u1} α α)) (Set.hasMem.{u1} (Prod.{u1, u1} α α)) p (Set.prod.{u1, u1} α α s t)) (fun (H : Membership.Mem.{u1, u1} (Prod.{u1, u1} α α) (Set.{u1} (Prod.{u1, u1} α α)) (Set.hasMem.{u1} (Prod.{u1, u1} α α)) p (Set.prod.{u1, u1} α α s t)) => Inf.inf.{u1} α (SemilatticeInf.toHasInf.{u1} α (Lattice.toSemilatticeInf.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)))) (Prod.fst.{u1, u1} α α p) (Prod.snd.{u1, u1} α α p)))) but is expected to have type forall {α : Type.{u1}} [_inst_1 : Order.Frame.{u1} α] {s : Set.{u1} α} {t : Set.{u1} α}, Eq.{succ u1} α (Inf.inf.{u1} α (Lattice.toInf.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (SupSet.supₛ.{u1} α (CompleteLattice.toSupSet.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)) s) (SupSet.supₛ.{u1} α (CompleteLattice.toSupSet.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)) t)) (supᵢ.{u1, succ u1} α (CompleteLattice.toSupSet.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)) (Prod.{u1, u1} α α) (fun (p : Prod.{u1, u1} α α) => supᵢ.{u1, 0} α (CompleteLattice.toSupSet.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)) (Membership.mem.{u1, u1} (Prod.{u1, u1} α α) (Set.{u1} (Prod.{u1, u1} α α)) (Set.instMembershipSet.{u1} (Prod.{u1, u1} α α)) p (Set.prod.{u1, u1} α α s t)) (fun (H : Membership.mem.{u1, u1} (Prod.{u1, u1} α α) (Set.{u1} (Prod.{u1, u1} α α)) (Set.instMembershipSet.{u1} (Prod.{u1, u1} α α)) p (Set.prod.{u1, u1} α α s t)) => Inf.inf.{u1} α (Lattice.toInf.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (Prod.fst.{u1, u1} α α p) (Prod.snd.{u1, u1} α α p)))) Case conversion may be inaccurate. Consider using '#align Sup_inf_Sup supₛ_inf_supₛₓ'. -/ /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/ theorem supₛ_inf_supₛ : supₛ s ⊓ supₛ t = ⨆ p ∈ s ×ˢ t, (p : α × α).1 ⊓ p.2 := by simp only [supₛ_eq_supᵢ, bsupᵢ_inf_bsupᵢ] #align Sup_inf_Sup supₛ_inf_supₛ /- warning: supr_disjoint_iff -> supᵢ_disjoint_iff is a dubious translation: lean 3 declaration is forall {α : Type.{u1}} {ι : Sort.{u2}} [_inst_1 : Order.Frame.{u1} α] {a : α} {f : ι -> α}, Iff (Disjoint.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (BoundedOrder.toOrderBot.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))))) (CompleteLattice.toBoundedOrder.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (supᵢ.{u1, u2} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) ι (fun (i : ι) => f i)) a) (forall (i : ι), Disjoint.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (BoundedOrder.toOrderBot.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))))) (CompleteLattice.toBoundedOrder.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (f i) a) but is expected to have type forall {α : Type.{u1}} {ι : Sort.{u2}} [_inst_1 : Order.Frame.{u1} α] {a : α} {f : ι -> α}, Iff (Disjoint.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (BoundedOrder.toOrderBot.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))))) (CompleteLattice.toBoundedOrder.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (supᵢ.{u1, u2} α (CompleteLattice.toSupSet.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)) ι (fun (i : ι) => f i)) a) (forall (i : ι), Disjoint.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (BoundedOrder.toOrderBot.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))))) (CompleteLattice.toBoundedOrder.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (f i) a) Case conversion may be inaccurate. Consider using '#align supr_disjoint_iff supᵢ_disjoint_iffₓ'. -/ theorem supᵢ_disjoint_iff {f : ι → α} : Disjoint (⨆ i, f i) a ↔ ∀ i, Disjoint (f i) a := by simp only [disjoint_iff, supᵢ_inf_eq, supᵢ_eq_bot] #align supr_disjoint_iff supᵢ_disjoint_iff /- warning: disjoint_supr_iff -> disjoint_supᵢ_iff is a dubious translation: lean 3 declaration is forall {α : Type.{u1}} {ι : Sort.{u2}} [_inst_1 : Order.Frame.{u1} α] {a : α} {f : ι -> α}, Iff (Disjoint.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (BoundedOrder.toOrderBot.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))))) (CompleteLattice.toBoundedOrder.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) a (supᵢ.{u1, u2} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) ι (fun (i : ι) => f i))) (forall (i : ι), Disjoint.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (BoundedOrder.toOrderBot.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))))) (CompleteLattice.toBoundedOrder.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) a (f i)) but is expected to have type forall {α : Type.{u1}} {ι : Sort.{u2}} [_inst_1 : Order.Frame.{u1} α] {a : α} {f : ι -> α}, Iff (Disjoint.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (BoundedOrder.toOrderBot.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))))) (CompleteLattice.toBoundedOrder.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) a (supᵢ.{u1, u2} α (CompleteLattice.toSupSet.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)) ι (fun (i : ι) => f i))) (forall (i : ι), Disjoint.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (BoundedOrder.toOrderBot.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))))) (CompleteLattice.toBoundedOrder.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) a (f i)) Case conversion may be inaccurate. Consider using '#align disjoint_supr_iff disjoint_supᵢ_iffₓ'. -/ theorem disjoint_supᵢ_iff {f : ι → α} : Disjoint a (⨆ i, f i) ↔ ∀ i, Disjoint a (f i) := by simpa only [disjoint_comm] using supᵢ_disjoint_iff #align disjoint_supr_iff disjoint_supᵢ_iff /- warning: supr₂_disjoint_iff -> supᵢ₂_disjoint_iff is a dubious translation: lean 3 declaration is forall {α : Type.{u1}} {ι : Sort.{u2}} {κ : ι -> Sort.{u3}} [_inst_1 : Order.Frame.{u1} α] {a : α} {f : forall (i : ι), (κ i) -> α}, Iff (Disjoint.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (BoundedOrder.toOrderBot.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))))) (CompleteLattice.toBoundedOrder.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (supᵢ.{u1, u2} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) ι (fun (i : ι) => supᵢ.{u1, u3} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (κ i) (fun (j : κ i) => f i j))) a) (forall (i : ι) (j : κ i), Disjoint.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (BoundedOrder.toOrderBot.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))))) (CompleteLattice.toBoundedOrder.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (f i j) a) but is expected to have type forall {α : Type.{u2}} {ι : Sort.{u3}} {κ : ι -> Sort.{u1}} [_inst_1 : Order.Frame.{u2} α] {a : α} {f : forall (i : ι), (κ i) -> α}, Iff (Disjoint.{u2} α (CompleteSemilatticeInf.toPartialOrder.{u2} α (CompleteLattice.toCompleteSemilatticeInf.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1))) (BoundedOrder.toOrderBot.{u2} α (Preorder.toLE.{u2} α (PartialOrder.toPreorder.{u2} α (CompleteSemilatticeInf.toPartialOrder.{u2} α (CompleteLattice.toCompleteSemilatticeInf.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1))))) (CompleteLattice.toBoundedOrder.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1))) (supᵢ.{u2, u3} α (CompleteLattice.toSupSet.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1)) ι (fun (i : ι) => supᵢ.{u2, u1} α (CompleteLattice.toSupSet.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1)) (κ i) (fun (j : κ i) => f i j))) a) (forall (i : ι) (j : κ i), Disjoint.{u2} α (CompleteSemilatticeInf.toPartialOrder.{u2} α (CompleteLattice.toCompleteSemilatticeInf.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1))) (BoundedOrder.toOrderBot.{u2} α (Preorder.toLE.{u2} α (PartialOrder.toPreorder.{u2} α (CompleteSemilatticeInf.toPartialOrder.{u2} α (CompleteLattice.toCompleteSemilatticeInf.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1))))) (CompleteLattice.toBoundedOrder.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1))) (f i j) a) Case conversion may be inaccurate. Consider using '#align supr₂_disjoint_iff supᵢ₂_disjoint_iffₓ'. -/ /- ./././Mathport/Syntax/Translate/Expr.lean:107:6: warning: expanding binder group (i j) -/ theorem supᵢ₂_disjoint_iff {f : ∀ i, κ i → α} : Disjoint (⨆ (i) (j), f i j) a ↔ ∀ i j, Disjoint (f i j) a := by simp_rw [supᵢ_disjoint_iff] #align supr₂_disjoint_iff supᵢ₂_disjoint_iff /- warning: disjoint_supr₂_iff -> disjoint_supᵢ₂_iff is a dubious translation: lean 3 declaration is forall {α : Type.{u1}} {ι : Sort.{u2}} {κ : ι -> Sort.{u3}} [_inst_1 : Order.Frame.{u1} α] {a : α} {f : forall (i : ι), (κ i) -> α}, Iff (Disjoint.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (BoundedOrder.toOrderBot.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))))) (CompleteLattice.toBoundedOrder.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) a (supᵢ.{u1, u2} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) ι (fun (i : ι) => supᵢ.{u1, u3} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (κ i) (fun (j : κ i) => f i j)))) (forall (i : ι) (j : κ i), Disjoint.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (BoundedOrder.toOrderBot.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))))) (CompleteLattice.toBoundedOrder.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) a (f i j)) but is expected to have type forall {α : Type.{u2}} {ι : Sort.{u3}} {κ : ι -> Sort.{u1}} [_inst_1 : Order.Frame.{u2} α] {a : α} {f : forall (i : ι), (κ i) -> α}, Iff (Disjoint.{u2} α (CompleteSemilatticeInf.toPartialOrder.{u2} α (CompleteLattice.toCompleteSemilatticeInf.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1))) (BoundedOrder.toOrderBot.{u2} α (Preorder.toLE.{u2} α (PartialOrder.toPreorder.{u2} α (CompleteSemilatticeInf.toPartialOrder.{u2} α (CompleteLattice.toCompleteSemilatticeInf.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1))))) (CompleteLattice.toBoundedOrder.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1))) a (supᵢ.{u2, u3} α (CompleteLattice.toSupSet.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1)) ι (fun (i : ι) => supᵢ.{u2, u1} α (CompleteLattice.toSupSet.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1)) (κ i) (fun (j : κ i) => f i j)))) (forall (i : ι) (j : κ i), Disjoint.{u2} α (CompleteSemilatticeInf.toPartialOrder.{u2} α (CompleteLattice.toCompleteSemilatticeInf.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1))) (BoundedOrder.toOrderBot.{u2} α (Preorder.toLE.{u2} α (PartialOrder.toPreorder.{u2} α (CompleteSemilatticeInf.toPartialOrder.{u2} α (CompleteLattice.toCompleteSemilatticeInf.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1))))) (CompleteLattice.toBoundedOrder.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1))) a (f i j)) Case conversion may be inaccurate. Consider using '#align disjoint_supr₂_iff disjoint_supᵢ₂_iffₓ'. -/ /- ./././Mathport/Syntax/Translate/Expr.lean:107:6: warning: expanding binder group (i j) -/ theorem disjoint_supᵢ₂_iff {f : ∀ i, κ i → α} : Disjoint a (⨆ (i) (j), f i j) ↔ ∀ i j, Disjoint a (f i j) := by simp_rw [disjoint_supᵢ_iff] #align disjoint_supr₂_iff disjoint_supᵢ₂_iff /- warning: Sup_disjoint_iff -> supₛ_disjoint_iff is a dubious translation: lean 3 declaration is forall {α : Type.{u1}} [_inst_1 : Order.Frame.{u1} α] {a : α} {s : Set.{u1} α}, Iff (Disjoint.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (BoundedOrder.toOrderBot.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))))) (CompleteLattice.toBoundedOrder.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (SupSet.supₛ.{u1} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) s) a) (forall (b : α), (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) b s) -> (Disjoint.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (BoundedOrder.toOrderBot.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))))) (CompleteLattice.toBoundedOrder.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) b a)) but is expected to have type forall {α : Type.{u1}} [_inst_1 : Order.Frame.{u1} α] {a : α} {s : Set.{u1} α}, Iff (Disjoint.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (BoundedOrder.toOrderBot.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))))) (CompleteLattice.toBoundedOrder.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (SupSet.supₛ.{u1} α (CompleteLattice.toSupSet.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)) s) a) (forall (b : α), (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) b s) -> (Disjoint.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (BoundedOrder.toOrderBot.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))))) (CompleteLattice.toBoundedOrder.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) b a)) Case conversion may be inaccurate. Consider using '#align Sup_disjoint_iff supₛ_disjoint_iffₓ'. -/ theorem supₛ_disjoint_iff {s : Set α} : Disjoint (supₛ s) a ↔ ∀ b ∈ s, Disjoint b a := by simp only [disjoint_iff, supₛ_inf_eq, supᵢ_eq_bot] #align Sup_disjoint_iff supₛ_disjoint_iff /- warning: disjoint_Sup_iff -> disjoint_supₛ_iff is a dubious translation: lean 3 declaration is forall {α : Type.{u1}} [_inst_1 : Order.Frame.{u1} α] {a : α} {s : Set.{u1} α}, Iff (Disjoint.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (BoundedOrder.toOrderBot.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))))) (CompleteLattice.toBoundedOrder.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) a (SupSet.supₛ.{u1} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) s)) (forall (b : α), (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) b s) -> (Disjoint.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (BoundedOrder.toOrderBot.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))))) (CompleteLattice.toBoundedOrder.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) a b)) but is expected to have type forall {α : Type.{u1}} [_inst_1 : Order.Frame.{u1} α] {a : α} {s : Set.{u1} α}, Iff (Disjoint.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (BoundedOrder.toOrderBot.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))))) (CompleteLattice.toBoundedOrder.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) a (SupSet.supₛ.{u1} α (CompleteLattice.toSupSet.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)) s)) (forall (b : α), (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) b s) -> (Disjoint.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) (BoundedOrder.toOrderBot.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))))) (CompleteLattice.toBoundedOrder.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) a b)) Case conversion may be inaccurate. Consider using '#align disjoint_Sup_iff disjoint_supₛ_iffₓ'. -/ theorem disjoint_supₛ_iff {s : Set α} : Disjoint a (supₛ s) ↔ ∀ b ∈ s, Disjoint a b := by simpa only [disjoint_comm] using supₛ_disjoint_iff #align disjoint_Sup_iff disjoint_supₛ_iff /- warning: supr_inf_of_monotone -> supᵢ_inf_of_monotone is a dubious translation: lean 3 declaration is forall {α : Type.{u1}} [_inst_1 : Order.Frame.{u1} α] {ι : Type.{u2}} [_inst_2 : Preorder.{u2} ι] [_inst_3 : IsDirected.{u2} ι (LE.le.{u2} ι (Preorder.toLE.{u2} ι _inst_2))] {f : ι -> α} {g : ι -> α}, (Monotone.{u2, u1} ι α _inst_2 (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)))) f) -> (Monotone.{u2, u1} ι α _inst_2 (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)))) g) -> (Eq.{succ u1} α (supᵢ.{u1, succ u2} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) ι (fun (i : ι) => Inf.inf.{u1} α (SemilatticeInf.toHasInf.{u1} α (Lattice.toSemilatticeInf.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)))) (f i) (g i))) (Inf.inf.{u1} α (SemilatticeInf.toHasInf.{u1} α (Lattice.toSemilatticeInf.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)))) (supᵢ.{u1, succ u2} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) ι (fun (i : ι) => f i)) (supᵢ.{u1, succ u2} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) ι (fun (i : ι) => g i)))) but is expected to have type forall {α : Type.{u2}} [_inst_1 : Order.Frame.{u2} α] {ι : Type.{u1}} [_inst_2 : Preorder.{u1} ι] [_inst_3 : IsDirected.{u1} ι (fun ([email protected]._hyg.1522 : ι) ([email protected]._hyg.1524 : ι) => LE.le.{u1} ι (Preorder.toLE.{u1} ι _inst_2) [email protected]._hyg.1522 [email protected]._hyg.1524)] {f : ι -> α} {g : ι -> α}, (Monotone.{u1, u2} ι α _inst_2 (PartialOrder.toPreorder.{u2} α (CompleteSemilatticeInf.toPartialOrder.{u2} α (CompleteLattice.toCompleteSemilatticeInf.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1)))) f) -> (Monotone.{u1, u2} ι α _inst_2 (PartialOrder.toPreorder.{u2} α (CompleteSemilatticeInf.toPartialOrder.{u2} α (CompleteLattice.toCompleteSemilatticeInf.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1)))) g) -> (Eq.{succ u2} α (supᵢ.{u2, succ u1} α (CompleteLattice.toSupSet.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1)) ι (fun (i : ι) => Inf.inf.{u2} α (Lattice.toInf.{u2} α (CompleteLattice.toLattice.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1))) (f i) (g i))) (Inf.inf.{u2} α (Lattice.toInf.{u2} α (CompleteLattice.toLattice.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1))) (supᵢ.{u2, succ u1} α (CompleteLattice.toSupSet.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1)) ι (fun (i : ι) => f i)) (supᵢ.{u2, succ u1} α (CompleteLattice.toSupSet.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1)) ι (fun (i : ι) => g i)))) Case conversion may be inaccurate. Consider using '#align supr_inf_of_monotone supᵢ_inf_of_monotoneₓ'. -/ theorem supᵢ_inf_of_monotone {ι : Type _} [Preorder ι] [IsDirected ι (· ≤ ·)] {f g : ι → α} (hf : Monotone f) (hg : Monotone g) : (⨆ i, f i ⊓ g i) = (⨆ i, f i) ⊓ ⨆ i, g i := by refine' (le_supᵢ_inf_supᵢ f g).antisymm _ rw [supᵢ_inf_supᵢ] refine' supᵢ_mono' fun i => _ rcases directed_of (· ≤ ·) i.1 i.2 with ⟨j, h₁, h₂⟩ exact ⟨j, inf_le_inf (hf h₁) (hg h₂)⟩ #align supr_inf_of_monotone supᵢ_inf_of_monotone /- warning: supr_inf_of_antitone -> supᵢ_inf_of_antitone is a dubious translation: lean 3 declaration is forall {α : Type.{u1}} [_inst_1 : Order.Frame.{u1} α] {ι : Type.{u2}} [_inst_2 : Preorder.{u2} ι] [_inst_3 : IsDirected.{u2} ι (Function.swap.{succ u2, succ u2, 1} ι ι (fun (ᾰ : ι) (ᾰ : ι) => Prop) (LE.le.{u2} ι (Preorder.toLE.{u2} ι _inst_2)))] {f : ι -> α} {g : ι -> α}, (Antitone.{u2, u1} ι α _inst_2 (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)))) f) -> (Antitone.{u2, u1} ι α _inst_2 (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)))) g) -> (Eq.{succ u1} α (supᵢ.{u1, succ u2} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) ι (fun (i : ι) => Inf.inf.{u1} α (SemilatticeInf.toHasInf.{u1} α (Lattice.toSemilatticeInf.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)))) (f i) (g i))) (Inf.inf.{u1} α (SemilatticeInf.toHasInf.{u1} α (Lattice.toSemilatticeInf.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1)))) (supᵢ.{u1, succ u2} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) ι (fun (i : ι) => f i)) (supᵢ.{u1, succ u2} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Frame.toCompleteLattice.{u1} α _inst_1))) ι (fun (i : ι) => g i)))) but is expected to have type forall {α : Type.{u2}} [_inst_1 : Order.Frame.{u2} α] {ι : Type.{u1}} [_inst_2 : Preorder.{u1} ι] [_inst_3 : IsDirected.{u1} ι (Function.swap.{succ u1, succ u1, 1} ι ι (fun (ᾰ : ι) (ᾰ : ι) => Prop) (fun ([email protected]._hyg.1717 : ι) ([email protected]._hyg.1719 : ι) => LE.le.{u1} ι (Preorder.toLE.{u1} ι _inst_2) [email protected]._hyg.1717 [email protected]._hyg.1719))] {f : ι -> α} {g : ι -> α}, (Antitone.{u1, u2} ι α _inst_2 (PartialOrder.toPreorder.{u2} α (CompleteSemilatticeInf.toPartialOrder.{u2} α (CompleteLattice.toCompleteSemilatticeInf.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1)))) f) -> (Antitone.{u1, u2} ι α _inst_2 (PartialOrder.toPreorder.{u2} α (CompleteSemilatticeInf.toPartialOrder.{u2} α (CompleteLattice.toCompleteSemilatticeInf.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1)))) g) -> (Eq.{succ u2} α (supᵢ.{u2, succ u1} α (CompleteLattice.toSupSet.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1)) ι (fun (i : ι) => Inf.inf.{u2} α (Lattice.toInf.{u2} α (CompleteLattice.toLattice.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1))) (f i) (g i))) (Inf.inf.{u2} α (Lattice.toInf.{u2} α (CompleteLattice.toLattice.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1))) (supᵢ.{u2, succ u1} α (CompleteLattice.toSupSet.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1)) ι (fun (i : ι) => f i)) (supᵢ.{u2, succ u1} α (CompleteLattice.toSupSet.{u2} α (Order.Frame.toCompleteLattice.{u2} α _inst_1)) ι (fun (i : ι) => g i)))) Case conversion may be inaccurate. Consider using '#align supr_inf_of_antitone supᵢ_inf_of_antitoneₓ'. -/ theorem supᵢ_inf_of_antitone {ι : Type _} [Preorder ι] [IsDirected ι (swap (· ≤ ·))] {f g : ι → α} (hf : Antitone f) (hg : Antitone g) : (⨆ i, f i ⊓ g i) = (⨆ i, f i) ⊓ ⨆ i, g i := @supᵢ_inf_of_monotone α _ ιᵒᵈ _ _ f g hf.dual_left hg.dual_left #align supr_inf_of_antitone supᵢ_inf_of_antitone #print Pi.frame /- instance Pi.frame {ι : Type _} {π : ι → Type _} [∀ i, Frame (π i)] : Frame (∀ i, π i) := { Pi.completeLattice with inf_sup_le_supᵢ_inf := fun a s i => by simp only [CompleteLattice.sup, supₛ_apply, supᵢ_apply, Pi.inf_apply, inf_supᵢ_eq, ← supᵢ_subtype''] } #align pi.frame Pi.frame -/ #print Frame.toDistribLattice /- -- see Note [lower instance priority] instance (priority := 100) Frame.toDistribLattice : DistribLattice α := DistribLattice.ofInfSupLe fun a b c => by rw [← supₛ_pair, ← supₛ_pair, inf_supₛ_eq, ← supₛ_image, image_pair] #align frame.to_distrib_lattice Frame.toDistribLattice -/ end Frame section Coframe variable [Coframe α] {s t : Set α} {a b : α} #print OrderDual.frame /- instance OrderDual.frame : Frame αᵒᵈ := { OrderDual.completeLattice α with inf_sup_le_supᵢ_inf := Coframe.infᵢ_sup_le_sup_inf } #align order_dual.frame OrderDual.frame -/ /- warning: sup_Inf_eq -> sup_infₛ_eq is a dubious translation: lean 3 declaration is forall {α : Type.{u1}} [_inst_1 : Order.Coframe.{u1} α] {s : Set.{u1} α} {a : α}, Eq.{succ u1} α (Sup.sup.{u1} α (SemilatticeSup.toHasSup.{u1} α (Lattice.toSemilatticeSup.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)))) a (InfSet.infₛ.{u1} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1))) s)) (infᵢ.{u1, succ u1} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1))) α (fun (b : α) => infᵢ.{u1, 0} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1))) (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) b s) (fun (H : Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) b s) => Sup.sup.{u1} α (SemilatticeSup.toHasSup.{u1} α (Lattice.toSemilatticeSup.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)))) a b))) but is expected to have type forall {α : Type.{u1}} [_inst_1 : Order.Coframe.{u1} α] {s : Set.{u1} α} {a : α}, Eq.{succ u1} α (Sup.sup.{u1} α (SemilatticeSup.toSup.{u1} α (Lattice.toSemilatticeSup.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)))) a (InfSet.infₛ.{u1} α (CompleteLattice.toInfSet.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)) s)) (infᵢ.{u1, succ u1} α (CompleteLattice.toInfSet.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)) α (fun (b : α) => infᵢ.{u1, 0} α (CompleteLattice.toInfSet.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)) (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) b s) (fun (H : Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) b s) => Sup.sup.{u1} α (SemilatticeSup.toSup.{u1} α (Lattice.toSemilatticeSup.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)))) a b))) Case conversion may be inaccurate. Consider using '#align sup_Inf_eq sup_infₛ_eqₓ'. -/ theorem sup_infₛ_eq : a ⊔ infₛ s = ⨅ b ∈ s, a ⊔ b := @inf_supₛ_eq αᵒᵈ _ _ _ #align sup_Inf_eq sup_infₛ_eq /- warning: Inf_sup_eq -> infₛ_sup_eq is a dubious translation: lean 3 declaration is forall {α : Type.{u1}} [_inst_1 : Order.Coframe.{u1} α] {s : Set.{u1} α} {b : α}, Eq.{succ u1} α (Sup.sup.{u1} α (SemilatticeSup.toHasSup.{u1} α (Lattice.toSemilatticeSup.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)))) (InfSet.infₛ.{u1} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1))) s) b) (infᵢ.{u1, succ u1} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1))) α (fun (a : α) => infᵢ.{u1, 0} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1))) (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) (fun (H : Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) => Sup.sup.{u1} α (SemilatticeSup.toHasSup.{u1} α (Lattice.toSemilatticeSup.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)))) a b))) but is expected to have type forall {α : Type.{u1}} [_inst_1 : Order.Coframe.{u1} α] {s : Set.{u1} α} {b : α}, Eq.{succ u1} α (Sup.sup.{u1} α (SemilatticeSup.toSup.{u1} α (Lattice.toSemilatticeSup.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)))) (InfSet.infₛ.{u1} α (CompleteLattice.toInfSet.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)) s) b) (infᵢ.{u1, succ u1} α (CompleteLattice.toInfSet.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)) α (fun (a : α) => infᵢ.{u1, 0} α (CompleteLattice.toInfSet.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)) (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) a s) (fun (H : Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) a s) => Sup.sup.{u1} α (SemilatticeSup.toSup.{u1} α (Lattice.toSemilatticeSup.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)))) a b))) Case conversion may be inaccurate. Consider using '#align Inf_sup_eq infₛ_sup_eqₓ'. -/ theorem infₛ_sup_eq : infₛ s ⊔ b = ⨅ a ∈ s, a ⊔ b := @supₛ_inf_eq αᵒᵈ _ _ _ #align Inf_sup_eq infₛ_sup_eq /- warning: infi_sup_eq -> infᵢ_sup_eq is a dubious translation: lean 3 declaration is forall {α : Type.{u1}} {ι : Sort.{u2}} [_inst_1 : Order.Coframe.{u1} α] (f : ι -> α) (a : α), Eq.{succ u1} α (Sup.sup.{u1} α (SemilatticeSup.toHasSup.{u1} α (Lattice.toSemilatticeSup.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)))) (infᵢ.{u1, u2} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1))) ι (fun (i : ι) => f i)) a) (infᵢ.{u1, u2} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1))) ι (fun (i : ι) => Sup.sup.{u1} α (SemilatticeSup.toHasSup.{u1} α (Lattice.toSemilatticeSup.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)))) (f i) a)) but is expected to have type forall {α : Type.{u1}} {ι : Sort.{u2}} [_inst_1 : Order.Coframe.{u1} α] (f : ι -> α) (a : α), Eq.{succ u1} α (Sup.sup.{u1} α (SemilatticeSup.toSup.{u1} α (Lattice.toSemilatticeSup.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)))) (infᵢ.{u1, u2} α (CompleteLattice.toInfSet.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)) ι (fun (i : ι) => f i)) a) (infᵢ.{u1, u2} α (CompleteLattice.toInfSet.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)) ι (fun (i : ι) => Sup.sup.{u1} α (SemilatticeSup.toSup.{u1} α (Lattice.toSemilatticeSup.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)))) (f i) a)) Case conversion may be inaccurate. Consider using '#align infi_sup_eq infᵢ_sup_eqₓ'. -/ theorem infᵢ_sup_eq (f : ι → α) (a : α) : (⨅ i, f i) ⊔ a = ⨅ i, f i ⊔ a := @supᵢ_inf_eq αᵒᵈ _ _ _ _ #align infi_sup_eq infᵢ_sup_eq /- warning: sup_infi_eq -> sup_infᵢ_eq is a dubious translation: lean 3 declaration is forall {α : Type.{u1}} {ι : Sort.{u2}} [_inst_1 : Order.Coframe.{u1} α] (a : α) (f : ι -> α), Eq.{succ u1} α (Sup.sup.{u1} α (SemilatticeSup.toHasSup.{u1} α (Lattice.toSemilatticeSup.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)))) a (infᵢ.{u1, u2} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1))) ι (fun (i : ι) => f i))) (infᵢ.{u1, u2} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1))) ι (fun (i : ι) => Sup.sup.{u1} α (SemilatticeSup.toHasSup.{u1} α (Lattice.toSemilatticeSup.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)))) a (f i))) but is expected to have type forall {α : Type.{u1}} {ι : Sort.{u2}} [_inst_1 : Order.Coframe.{u1} α] (a : α) (f : ι -> α), Eq.{succ u1} α (Sup.sup.{u1} α (SemilatticeSup.toSup.{u1} α (Lattice.toSemilatticeSup.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)))) a (infᵢ.{u1, u2} α (CompleteLattice.toInfSet.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)) ι (fun (i : ι) => f i))) (infᵢ.{u1, u2} α (CompleteLattice.toInfSet.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)) ι (fun (i : ι) => Sup.sup.{u1} α (SemilatticeSup.toSup.{u1} α (Lattice.toSemilatticeSup.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)))) a (f i))) Case conversion may be inaccurate. Consider using '#align sup_infi_eq sup_infᵢ_eqₓ'. -/ theorem sup_infᵢ_eq (a : α) (f : ι → α) : (a ⊔ ⨅ i, f i) = ⨅ i, a ⊔ f i := @inf_supᵢ_eq αᵒᵈ _ _ _ _ #align sup_infi_eq sup_infᵢ_eq /- warning: binfi_sup_eq -> infᵢ₂_sup_eq is a dubious translation: lean 3 declaration is forall {α : Type.{u1}} {ι : Sort.{u2}} {κ : ι -> Sort.{u3}} [_inst_1 : Order.Coframe.{u1} α] {f : forall (i : ι), (κ i) -> α} (a : α), Eq.{succ u1} α (Sup.sup.{u1} α (SemilatticeSup.toHasSup.{u1} α (Lattice.toSemilatticeSup.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)))) (infᵢ.{u1, u2} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1))) ι (fun (i : ι) => infᵢ.{u1, u3} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1))) (κ i) (fun (j : κ i) => f i j))) a) (infᵢ.{u1, u2} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1))) ι (fun (i : ι) => infᵢ.{u1, u3} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1))) (κ i) (fun (j : κ i) => Sup.sup.{u1} α (SemilatticeSup.toHasSup.{u1} α (Lattice.toSemilatticeSup.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)))) (f i j) a))) but is expected to have type forall {α : Type.{u2}} {ι : Sort.{u3}} {κ : ι -> Sort.{u1}} [_inst_1 : Order.Coframe.{u2} α] {f : forall (i : ι), (κ i) -> α} (a : α), Eq.{succ u2} α (Sup.sup.{u2} α (SemilatticeSup.toSup.{u2} α (Lattice.toSemilatticeSup.{u2} α (CompleteLattice.toLattice.{u2} α (Order.Coframe.toCompleteLattice.{u2} α _inst_1)))) (infᵢ.{u2, u3} α (CompleteLattice.toInfSet.{u2} α (Order.Coframe.toCompleteLattice.{u2} α _inst_1)) ι (fun (i : ι) => infᵢ.{u2, u1} α (CompleteLattice.toInfSet.{u2} α (Order.Coframe.toCompleteLattice.{u2} α _inst_1)) (κ i) (fun (j : κ i) => f i j))) a) (infᵢ.{u2, u3} α (CompleteLattice.toInfSet.{u2} α (Order.Coframe.toCompleteLattice.{u2} α _inst_1)) ι (fun (i : ι) => infᵢ.{u2, u1} α (CompleteLattice.toInfSet.{u2} α (Order.Coframe.toCompleteLattice.{u2} α _inst_1)) (κ i) (fun (j : κ i) => Sup.sup.{u2} α (SemilatticeSup.toSup.{u2} α (Lattice.toSemilatticeSup.{u2} α (CompleteLattice.toLattice.{u2} α (Order.Coframe.toCompleteLattice.{u2} α _inst_1)))) (f i j) a))) Case conversion may be inaccurate. Consider using '#align binfi_sup_eq infᵢ₂_sup_eqₓ'. -/ /- ./././Mathport/Syntax/Translate/Expr.lean:107:6: warning: expanding binder group (i j) -/ /- ./././Mathport/Syntax/Translate/Expr.lean:107:6: warning: expanding binder group (i j) -/ theorem infᵢ₂_sup_eq {f : ∀ i, κ i → α} (a : α) : (⨅ (i) (j), f i j) ⊔ a = ⨅ (i) (j), f i j ⊔ a := @supᵢ₂_inf_eq αᵒᵈ _ _ _ _ _ #align binfi_sup_eq infᵢ₂_sup_eq /- warning: sup_binfi_eq -> sup_infᵢ₂_eq is a dubious translation: lean 3 declaration is forall {α : Type.{u1}} {ι : Sort.{u2}} {κ : ι -> Sort.{u3}} [_inst_1 : Order.Coframe.{u1} α] {f : forall (i : ι), (κ i) -> α} (a : α), Eq.{succ u1} α (Sup.sup.{u1} α (SemilatticeSup.toHasSup.{u1} α (Lattice.toSemilatticeSup.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)))) a (infᵢ.{u1, u2} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1))) ι (fun (i : ι) => infᵢ.{u1, u3} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1))) (κ i) (fun (j : κ i) => f i j)))) (infᵢ.{u1, u2} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1))) ι (fun (i : ι) => infᵢ.{u1, u3} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1))) (κ i) (fun (j : κ i) => Sup.sup.{u1} α (SemilatticeSup.toHasSup.{u1} α (Lattice.toSemilatticeSup.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)))) a (f i j)))) but is expected to have type forall {α : Type.{u2}} {ι : Sort.{u3}} {κ : ι -> Sort.{u1}} [_inst_1 : Order.Coframe.{u2} α] {f : forall (i : ι), (κ i) -> α} (a : α), Eq.{succ u2} α (Sup.sup.{u2} α (SemilatticeSup.toSup.{u2} α (Lattice.toSemilatticeSup.{u2} α (CompleteLattice.toLattice.{u2} α (Order.Coframe.toCompleteLattice.{u2} α _inst_1)))) a (infᵢ.{u2, u3} α (CompleteLattice.toInfSet.{u2} α (Order.Coframe.toCompleteLattice.{u2} α _inst_1)) ι (fun (i : ι) => infᵢ.{u2, u1} α (CompleteLattice.toInfSet.{u2} α (Order.Coframe.toCompleteLattice.{u2} α _inst_1)) (κ i) (fun (j : κ i) => f i j)))) (infᵢ.{u2, u3} α (CompleteLattice.toInfSet.{u2} α (Order.Coframe.toCompleteLattice.{u2} α _inst_1)) ι (fun (i : ι) => infᵢ.{u2, u1} α (CompleteLattice.toInfSet.{u2} α (Order.Coframe.toCompleteLattice.{u2} α _inst_1)) (κ i) (fun (j : κ i) => Sup.sup.{u2} α (SemilatticeSup.toSup.{u2} α (Lattice.toSemilatticeSup.{u2} α (CompleteLattice.toLattice.{u2} α (Order.Coframe.toCompleteLattice.{u2} α _inst_1)))) a (f i j)))) Case conversion may be inaccurate. Consider using '#align sup_binfi_eq sup_infᵢ₂_eqₓ'. -/ /- ./././Mathport/Syntax/Translate/Expr.lean:107:6: warning: expanding binder group (i j) -/ /- ./././Mathport/Syntax/Translate/Expr.lean:107:6: warning: expanding binder group (i j) -/ theorem sup_infᵢ₂_eq {f : ∀ i, κ i → α} (a : α) : (a ⊔ ⨅ (i) (j), f i j) = ⨅ (i) (j), a ⊔ f i j := @inf_supᵢ₂_eq αᵒᵈ _ _ _ _ _ #align sup_binfi_eq sup_infᵢ₂_eq /- warning: infi_sup_infi -> infᵢ_sup_infᵢ is a dubious translation: lean 3 declaration is forall {α : Type.{u1}} [_inst_1 : Order.Coframe.{u1} α] {ι : Type.{u2}} {ι' : Type.{u3}} {f : ι -> α} {g : ι' -> α}, Eq.{succ u1} α (Sup.sup.{u1} α (SemilatticeSup.toHasSup.{u1} α (Lattice.toSemilatticeSup.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)))) (infᵢ.{u1, succ u2} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1))) ι (fun (i : ι) => f i)) (infᵢ.{u1, succ u3} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1))) ι' (fun (i : ι') => g i))) (infᵢ.{u1, max (succ u2) (succ u3)} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1))) (Prod.{u2, u3} ι ι') (fun (i : Prod.{u2, u3} ι ι') => Sup.sup.{u1} α (SemilatticeSup.toHasSup.{u1} α (Lattice.toSemilatticeSup.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)))) (f (Prod.fst.{u2, u3} ι ι' i)) (g (Prod.snd.{u2, u3} ι ι' i)))) but is expected to have type forall {α : Type.{u3}} [_inst_1 : Order.Coframe.{u3} α] {ι : Type.{u2}} {ι' : Type.{u1}} {f : ι -> α} {g : ι' -> α}, Eq.{succ u3} α (Sup.sup.{u3} α (SemilatticeSup.toSup.{u3} α (Lattice.toSemilatticeSup.{u3} α (CompleteLattice.toLattice.{u3} α (Order.Coframe.toCompleteLattice.{u3} α _inst_1)))) (infᵢ.{u3, succ u2} α (CompleteLattice.toInfSet.{u3} α (Order.Coframe.toCompleteLattice.{u3} α _inst_1)) ι (fun (i : ι) => f i)) (infᵢ.{u3, succ u1} α (CompleteLattice.toInfSet.{u3} α (Order.Coframe.toCompleteLattice.{u3} α _inst_1)) ι' (fun (i : ι') => g i))) (infᵢ.{u3, max (succ u2) (succ u1)} α (CompleteLattice.toInfSet.{u3} α (Order.Coframe.toCompleteLattice.{u3} α _inst_1)) (Prod.{u2, u1} ι ι') (fun (i : Prod.{u2, u1} ι ι') => Sup.sup.{u3} α (SemilatticeSup.toSup.{u3} α (Lattice.toSemilatticeSup.{u3} α (CompleteLattice.toLattice.{u3} α (Order.Coframe.toCompleteLattice.{u3} α _inst_1)))) (f (Prod.fst.{u2, u1} ι ι' i)) (g (Prod.snd.{u2, u1} ι ι' i)))) Case conversion may be inaccurate. Consider using '#align infi_sup_infi infᵢ_sup_infᵢₓ'. -/ theorem infᵢ_sup_infᵢ {ι ι' : Type _} {f : ι → α} {g : ι' → α} : ((⨅ i, f i) ⊔ ⨅ i, g i) = ⨅ i : ι × ι', f i.1 ⊔ g i.2 := @supᵢ_inf_supᵢ αᵒᵈ _ _ _ _ _ #align infi_sup_infi infᵢ_sup_infᵢ /- warning: binfi_sup_binfi -> binfᵢ_sup_binfᵢ is a dubious translation: lean 3 declaration is forall {α : Type.{u1}} [_inst_1 : Order.Coframe.{u1} α] {ι : Type.{u2}} {ι' : Type.{u3}} {f : ι -> α} {g : ι' -> α} {s : Set.{u2} ι} {t : Set.{u3} ι'}, Eq.{succ u1} α (Sup.sup.{u1} α (SemilatticeSup.toHasSup.{u1} α (Lattice.toSemilatticeSup.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)))) (infᵢ.{u1, succ u2} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1))) ι (fun (i : ι) => infᵢ.{u1, 0} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1))) (Membership.Mem.{u2, u2} ι (Set.{u2} ι) (Set.hasMem.{u2} ι) i s) (fun (H : Membership.Mem.{u2, u2} ι (Set.{u2} ι) (Set.hasMem.{u2} ι) i s) => f i))) (infᵢ.{u1, succ u3} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1))) ι' (fun (j : ι') => infᵢ.{u1, 0} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1))) (Membership.Mem.{u3, u3} ι' (Set.{u3} ι') (Set.hasMem.{u3} ι') j t) (fun (H : Membership.Mem.{u3, u3} ι' (Set.{u3} ι') (Set.hasMem.{u3} ι') j t) => g j)))) (infᵢ.{u1, succ (max u2 u3)} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1))) (Prod.{u2, u3} ι ι') (fun (p : Prod.{u2, u3} ι ι') => infᵢ.{u1, 0} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1))) (Membership.Mem.{max u2 u3, max u2 u3} (Prod.{u2, u3} ι ι') (Set.{max u2 u3} (Prod.{u2, u3} ι ι')) (Set.hasMem.{max u2 u3} (Prod.{u2, u3} ι ι')) p (Set.prod.{u2, u3} ι ι' s t)) (fun (H : Membership.Mem.{max u2 u3, max u2 u3} (Prod.{u2, u3} ι ι') (Set.{max u2 u3} (Prod.{u2, u3} ι ι')) (Set.hasMem.{max u2 u3} (Prod.{u2, u3} ι ι')) p (Set.prod.{u2, u3} ι ι' s t)) => Sup.sup.{u1} α (SemilatticeSup.toHasSup.{u1} α (Lattice.toSemilatticeSup.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)))) (f (Prod.fst.{u2, u3} ι ι' p)) (g (Prod.snd.{u2, u3} ι ι' p))))) but is expected to have type forall {α : Type.{u3}} [_inst_1 : Order.Coframe.{u3} α] {ι : Type.{u2}} {ι' : Type.{u1}} {f : ι -> α} {g : ι' -> α} {s : Set.{u2} ι} {t : Set.{u1} ι'}, Eq.{succ u3} α (Sup.sup.{u3} α (SemilatticeSup.toSup.{u3} α (Lattice.toSemilatticeSup.{u3} α (CompleteLattice.toLattice.{u3} α (Order.Coframe.toCompleteLattice.{u3} α _inst_1)))) (infᵢ.{u3, succ u2} α (CompleteLattice.toInfSet.{u3} α (Order.Coframe.toCompleteLattice.{u3} α _inst_1)) ι (fun (i : ι) => infᵢ.{u3, 0} α (CompleteLattice.toInfSet.{u3} α (Order.Coframe.toCompleteLattice.{u3} α _inst_1)) (Membership.mem.{u2, u2} ι (Set.{u2} ι) (Set.instMembershipSet.{u2} ι) i s) (fun (H : Membership.mem.{u2, u2} ι (Set.{u2} ι) (Set.instMembershipSet.{u2} ι) i s) => f i))) (infᵢ.{u3, succ u1} α (CompleteLattice.toInfSet.{u3} α (Order.Coframe.toCompleteLattice.{u3} α _inst_1)) ι' (fun (j : ι') => infᵢ.{u3, 0} α (CompleteLattice.toInfSet.{u3} α (Order.Coframe.toCompleteLattice.{u3} α _inst_1)) (Membership.mem.{u1, u1} ι' (Set.{u1} ι') (Set.instMembershipSet.{u1} ι') j t) (fun (H : Membership.mem.{u1, u1} ι' (Set.{u1} ι') (Set.instMembershipSet.{u1} ι') j t) => g j)))) (infᵢ.{u3, succ (max u2 u1)} α (CompleteLattice.toInfSet.{u3} α (Order.Coframe.toCompleteLattice.{u3} α _inst_1)) (Prod.{u2, u1} ι ι') (fun (p : Prod.{u2, u1} ι ι') => infᵢ.{u3, 0} α (CompleteLattice.toInfSet.{u3} α (Order.Coframe.toCompleteLattice.{u3} α _inst_1)) (Membership.mem.{max u2 u1, max u1 u2} (Prod.{u2, u1} ι ι') (Set.{max u1 u2} (Prod.{u2, u1} ι ι')) (Set.instMembershipSet.{max u2 u1} (Prod.{u2, u1} ι ι')) p (Set.prod.{u2, u1} ι ι' s t)) (fun (H : Membership.mem.{max u2 u1, max u1 u2} (Prod.{u2, u1} ι ι') (Set.{max u1 u2} (Prod.{u2, u1} ι ι')) (Set.instMembershipSet.{max u2 u1} (Prod.{u2, u1} ι ι')) p (Set.prod.{u2, u1} ι ι' s t)) => Sup.sup.{u3} α (SemilatticeSup.toSup.{u3} α (Lattice.toSemilatticeSup.{u3} α (CompleteLattice.toLattice.{u3} α (Order.Coframe.toCompleteLattice.{u3} α _inst_1)))) (f (Prod.fst.{u2, u1} ι ι' p)) (g (Prod.snd.{u2, u1} ι ι' p))))) Case conversion may be inaccurate. Consider using '#align binfi_sup_binfi binfᵢ_sup_binfᵢₓ'. -/ /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/ theorem binfᵢ_sup_binfᵢ {ι ι' : Type _} {f : ι → α} {g : ι' → α} {s : Set ι} {t : Set ι'} : ((⨅ i ∈ s, f i) ⊔ ⨅ j ∈ t, g j) = ⨅ p ∈ s ×ˢ t, f (p : ι × ι').1 ⊔ g p.2 := @bsupᵢ_inf_bsupᵢ αᵒᵈ _ _ _ _ _ _ _ #align binfi_sup_binfi binfᵢ_sup_binfᵢ /- warning: Inf_sup_Inf -> infₛ_sup_infₛ is a dubious translation: lean 3 declaration is forall {α : Type.{u1}} [_inst_1 : Order.Coframe.{u1} α] {s : Set.{u1} α} {t : Set.{u1} α}, Eq.{succ u1} α (Sup.sup.{u1} α (SemilatticeSup.toHasSup.{u1} α (Lattice.toSemilatticeSup.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)))) (InfSet.infₛ.{u1} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1))) s) (InfSet.infₛ.{u1} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1))) t)) (infᵢ.{u1, succ u1} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1))) (Prod.{u1, u1} α α) (fun (p : Prod.{u1, u1} α α) => infᵢ.{u1, 0} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1))) (Membership.Mem.{u1, u1} (Prod.{u1, u1} α α) (Set.{u1} (Prod.{u1, u1} α α)) (Set.hasMem.{u1} (Prod.{u1, u1} α α)) p (Set.prod.{u1, u1} α α s t)) (fun (H : Membership.Mem.{u1, u1} (Prod.{u1, u1} α α) (Set.{u1} (Prod.{u1, u1} α α)) (Set.hasMem.{u1} (Prod.{u1, u1} α α)) p (Set.prod.{u1, u1} α α s t)) => Sup.sup.{u1} α (SemilatticeSup.toHasSup.{u1} α (Lattice.toSemilatticeSup.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)))) (Prod.fst.{u1, u1} α α p) (Prod.snd.{u1, u1} α α p)))) but is expected to have type forall {α : Type.{u1}} [_inst_1 : Order.Coframe.{u1} α] {s : Set.{u1} α} {t : Set.{u1} α}, Eq.{succ u1} α (Sup.sup.{u1} α (SemilatticeSup.toSup.{u1} α (Lattice.toSemilatticeSup.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)))) (InfSet.infₛ.{u1} α (CompleteLattice.toInfSet.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)) s) (InfSet.infₛ.{u1} α (CompleteLattice.toInfSet.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)) t)) (infᵢ.{u1, succ u1} α (CompleteLattice.toInfSet.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)) (Prod.{u1, u1} α α) (fun (p : Prod.{u1, u1} α α) => infᵢ.{u1, 0} α (CompleteLattice.toInfSet.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)) (Membership.mem.{u1, u1} (Prod.{u1, u1} α α) (Set.{u1} (Prod.{u1, u1} α α)) (Set.instMembershipSet.{u1} (Prod.{u1, u1} α α)) p (Set.prod.{u1, u1} α α s t)) (fun (H : Membership.mem.{u1, u1} (Prod.{u1, u1} α α) (Set.{u1} (Prod.{u1, u1} α α)) (Set.instMembershipSet.{u1} (Prod.{u1, u1} α α)) p (Set.prod.{u1, u1} α α s t)) => Sup.sup.{u1} α (SemilatticeSup.toSup.{u1} α (Lattice.toSemilatticeSup.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)))) (Prod.fst.{u1, u1} α α p) (Prod.snd.{u1, u1} α α p)))) Case conversion may be inaccurate. Consider using '#align Inf_sup_Inf infₛ_sup_infₛₓ'. -/ /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/ theorem infₛ_sup_infₛ : infₛ s ⊔ infₛ t = ⨅ p ∈ s ×ˢ t, (p : α × α).1 ⊔ p.2 := @supₛ_inf_supₛ αᵒᵈ _ _ _ #align Inf_sup_Inf infₛ_sup_infₛ /- warning: infi_sup_of_monotone -> infᵢ_sup_of_monotone is a dubious translation: lean 3 declaration is forall {α : Type.{u1}} [_inst_1 : Order.Coframe.{u1} α] {ι : Type.{u2}} [_inst_2 : Preorder.{u2} ι] [_inst_3 : IsDirected.{u2} ι (Function.swap.{succ u2, succ u2, 1} ι ι (fun (ᾰ : ι) (ᾰ : ι) => Prop) (LE.le.{u2} ι (Preorder.toLE.{u2} ι _inst_2)))] {f : ι -> α} {g : ι -> α}, (Monotone.{u2, u1} ι α _inst_2 (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)))) f) -> (Monotone.{u2, u1} ι α _inst_2 (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)))) g) -> (Eq.{succ u1} α (infᵢ.{u1, succ u2} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1))) ι (fun (i : ι) => Sup.sup.{u1} α (SemilatticeSup.toHasSup.{u1} α (Lattice.toSemilatticeSup.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)))) (f i) (g i))) (Sup.sup.{u1} α (SemilatticeSup.toHasSup.{u1} α (Lattice.toSemilatticeSup.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)))) (infᵢ.{u1, succ u2} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1))) ι (fun (i : ι) => f i)) (infᵢ.{u1, succ u2} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1))) ι (fun (i : ι) => g i)))) but is expected to have type forall {α : Type.{u2}} [_inst_1 : Order.Coframe.{u2} α] {ι : Type.{u1}} [_inst_2 : Preorder.{u1} ι] [_inst_3 : IsDirected.{u1} ι (Function.swap.{succ u1, succ u1, 1} ι ι (fun (ᾰ : ι) (ᾰ : ι) => Prop) (fun ([email protected]._hyg.2838 : ι) ([email protected]._hyg.2840 : ι) => LE.le.{u1} ι (Preorder.toLE.{u1} ι _inst_2) [email protected]._hyg.2838 [email protected]._hyg.2840))] {f : ι -> α} {g : ι -> α}, (Monotone.{u1, u2} ι α _inst_2 (PartialOrder.toPreorder.{u2} α (CompleteSemilatticeInf.toPartialOrder.{u2} α (CompleteLattice.toCompleteSemilatticeInf.{u2} α (Order.Coframe.toCompleteLattice.{u2} α _inst_1)))) f) -> (Monotone.{u1, u2} ι α _inst_2 (PartialOrder.toPreorder.{u2} α (CompleteSemilatticeInf.toPartialOrder.{u2} α (CompleteLattice.toCompleteSemilatticeInf.{u2} α (Order.Coframe.toCompleteLattice.{u2} α _inst_1)))) g) -> (Eq.{succ u2} α (infᵢ.{u2, succ u1} α (CompleteLattice.toInfSet.{u2} α (Order.Coframe.toCompleteLattice.{u2} α _inst_1)) ι (fun (i : ι) => Sup.sup.{u2} α (SemilatticeSup.toSup.{u2} α (Lattice.toSemilatticeSup.{u2} α (CompleteLattice.toLattice.{u2} α (Order.Coframe.toCompleteLattice.{u2} α _inst_1)))) (f i) (g i))) (Sup.sup.{u2} α (SemilatticeSup.toSup.{u2} α (Lattice.toSemilatticeSup.{u2} α (CompleteLattice.toLattice.{u2} α (Order.Coframe.toCompleteLattice.{u2} α _inst_1)))) (infᵢ.{u2, succ u1} α (CompleteLattice.toInfSet.{u2} α (Order.Coframe.toCompleteLattice.{u2} α _inst_1)) ι (fun (i : ι) => f i)) (infᵢ.{u2, succ u1} α (CompleteLattice.toInfSet.{u2} α (Order.Coframe.toCompleteLattice.{u2} α _inst_1)) ι (fun (i : ι) => g i)))) Case conversion may be inaccurate. Consider using '#align infi_sup_of_monotone infᵢ_sup_of_monotoneₓ'. -/ theorem infᵢ_sup_of_monotone {ι : Type _} [Preorder ι] [IsDirected ι (swap (· ≤ ·))] {f g : ι → α} (hf : Monotone f) (hg : Monotone g) : (⨅ i, f i ⊔ g i) = (⨅ i, f i) ⊔ ⨅ i, g i := supᵢ_inf_of_antitone hf.dual_right hg.dual_right #align infi_sup_of_monotone infᵢ_sup_of_monotone /- warning: infi_sup_of_antitone -> infᵢ_sup_of_antitone is a dubious translation: lean 3 declaration is forall {α : Type.{u1}} [_inst_1 : Order.Coframe.{u1} α] {ι : Type.{u2}} [_inst_2 : Preorder.{u2} ι] [_inst_3 : IsDirected.{u2} ι (LE.le.{u2} ι (Preorder.toLE.{u2} ι _inst_2))] {f : ι -> α} {g : ι -> α}, (Antitone.{u2, u1} ι α _inst_2 (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)))) f) -> (Antitone.{u2, u1} ι α _inst_2 (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)))) g) -> (Eq.{succ u1} α (infᵢ.{u1, succ u2} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1))) ι (fun (i : ι) => Sup.sup.{u1} α (SemilatticeSup.toHasSup.{u1} α (Lattice.toSemilatticeSup.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)))) (f i) (g i))) (Sup.sup.{u1} α (SemilatticeSup.toHasSup.{u1} α (Lattice.toSemilatticeSup.{u1} α (CompleteLattice.toLattice.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1)))) (infᵢ.{u1, succ u2} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1))) ι (fun (i : ι) => f i)) (infᵢ.{u1, succ u2} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α _inst_1))) ι (fun (i : ι) => g i)))) but is expected to have type forall {α : Type.{u2}} [_inst_1 : Order.Coframe.{u2} α] {ι : Type.{u1}} [_inst_2 : Preorder.{u1} ι] [_inst_3 : IsDirected.{u1} ι (fun ([email protected]._hyg.2960 : ι) ([email protected]._hyg.2962 : ι) => LE.le.{u1} ι (Preorder.toLE.{u1} ι _inst_2) [email protected]._hyg.2960 [email protected]._hyg.2962)] {f : ι -> α} {g : ι -> α}, (Antitone.{u1, u2} ι α _inst_2 (PartialOrder.toPreorder.{u2} α (CompleteSemilatticeInf.toPartialOrder.{u2} α (CompleteLattice.toCompleteSemilatticeInf.{u2} α (Order.Coframe.toCompleteLattice.{u2} α _inst_1)))) f) -> (Antitone.{u1, u2} ι α _inst_2 (PartialOrder.toPreorder.{u2} α (CompleteSemilatticeInf.toPartialOrder.{u2} α (CompleteLattice.toCompleteSemilatticeInf.{u2} α (Order.Coframe.toCompleteLattice.{u2} α _inst_1)))) g) -> (Eq.{succ u2} α (infᵢ.{u2, succ u1} α (CompleteLattice.toInfSet.{u2} α (Order.Coframe.toCompleteLattice.{u2} α _inst_1)) ι (fun (i : ι) => Sup.sup.{u2} α (SemilatticeSup.toSup.{u2} α (Lattice.toSemilatticeSup.{u2} α (CompleteLattice.toLattice.{u2} α (Order.Coframe.toCompleteLattice.{u2} α _inst_1)))) (f i) (g i))) (Sup.sup.{u2} α (SemilatticeSup.toSup.{u2} α (Lattice.toSemilatticeSup.{u2} α (CompleteLattice.toLattice.{u2} α (Order.Coframe.toCompleteLattice.{u2} α _inst_1)))) (infᵢ.{u2, succ u1} α (CompleteLattice.toInfSet.{u2} α (Order.Coframe.toCompleteLattice.{u2} α _inst_1)) ι (fun (i : ι) => f i)) (infᵢ.{u2, succ u1} α (CompleteLattice.toInfSet.{u2} α (Order.Coframe.toCompleteLattice.{u2} α _inst_1)) ι (fun (i : ι) => g i)))) Case conversion may be inaccurate. Consider using '#align infi_sup_of_antitone infᵢ_sup_of_antitoneₓ'. -/ theorem infᵢ_sup_of_antitone {ι : Type _} [Preorder ι] [IsDirected ι (· ≤ ·)] {f g : ι → α} (hf : Antitone f) (hg : Antitone g) : (⨅ i, f i ⊔ g i) = (⨅ i, f i) ⊔ ⨅ i, g i := supᵢ_inf_of_monotone hf.dual_right hg.dual_right #align infi_sup_of_antitone infᵢ_sup_of_antitone #print Pi.coframe /- instance Pi.coframe {ι : Type _} {π : ι → Type _} [∀ i, Coframe (π i)] : Coframe (∀ i, π i) := { Pi.completeLattice with infₛ := infₛ infᵢ_sup_le_sup_inf := fun a s i => by simp only [← sup_infᵢ_eq, infₛ_apply, ← infᵢ_subtype'', infᵢ_apply, Pi.sup_apply] } #align pi.coframe Pi.coframe -/ #print Coframe.toDistribLattice /- -- see Note [lower instance priority] instance (priority := 100) Coframe.toDistribLattice : DistribLattice α := { ‹Coframe α› with le_sup_inf := fun a b c => by rw [← infₛ_pair, ← infₛ_pair, sup_infₛ_eq, ← infₛ_image, image_pair] } #align coframe.to_distrib_lattice Coframe.toDistribLattice -/ end Coframe section CompleteDistribLattice variable [CompleteDistribLattice α] {a b : α} {s t : Set α} instance : CompleteDistribLattice αᵒᵈ := { OrderDual.frame, OrderDual.coframe with } #print Pi.completeDistribLattice /- instance Pi.completeDistribLattice {ι : Type _} {π : ι → Type _} [∀ i, CompleteDistribLattice (π i)] : CompleteDistribLattice (∀ i, π i) := { Pi.frame, Pi.coframe with } #align pi.complete_distrib_lattice Pi.completeDistribLattice -/ end CompleteDistribLattice #print CompleteBooleanAlgebra /- /-- A complete Boolean algebra is a completely distributive Boolean algebra. -/ class CompleteBooleanAlgebra (α) extends BooleanAlgebra α, CompleteDistribLattice α #align complete_boolean_algebra CompleteBooleanAlgebra -/ #print Pi.completeBooleanAlgebra /- instance Pi.completeBooleanAlgebra {ι : Type _} {π : ι → Type _} [∀ i, CompleteBooleanAlgebra (π i)] : CompleteBooleanAlgebra (∀ i, π i) := { Pi.booleanAlgebra, Pi.completeDistribLattice with } #align pi.complete_boolean_algebra Pi.completeBooleanAlgebra -/ #print Prop.completeBooleanAlgebra /- instance Prop.completeBooleanAlgebra : CompleteBooleanAlgebra Prop := { Prop.booleanAlgebra, Prop.completeLattice with infᵢ_sup_le_sup_inf := fun p s => Iff.mp <| by simp only [forall_or_left, CompleteLattice.inf, infᵢ_Prop_eq, sup_Prop_eq] inf_sup_le_supᵢ_inf := fun p s => Iff.mp <| by simp only [CompleteLattice.sup, exists_and_left, inf_Prop_eq, supᵢ_Prop_eq] } #align Prop.complete_boolean_algebra Prop.completeBooleanAlgebra -/ section CompleteBooleanAlgebra variable [CompleteBooleanAlgebra α] {a b : α} {s : Set α} {f : ι → α} /- warning: compl_infi -> compl_infᵢ is a dubious translation: lean 3 declaration is forall {α : Type.{u1}} {ι : Sort.{u2}} [_inst_1 : CompleteBooleanAlgebra.{u1} α] {f : ι -> α}, Eq.{succ u1} α (HasCompl.compl.{u1} α (BooleanAlgebra.toHasCompl.{u1} α (CompleteBooleanAlgebra.toBooleanAlgebra.{u1} α _inst_1)) (infᵢ.{u1, u2} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α (CompleteDistribLattice.toCoframe.{u1} α (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} α _inst_1))))) ι f)) (supᵢ.{u1, u2} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Coframe.toCompleteLattice.{u1} α (CompleteDistribLattice.toCoframe.{u1} α (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} α _inst_1))))) ι (fun (i : ι) => HasCompl.compl.{u1} α (BooleanAlgebra.toHasCompl.{u1} α (CompleteBooleanAlgebra.toBooleanAlgebra.{u1} α _inst_1)) (f i))) but is expected to have type forall {α : Type.{u1}} {ι : Sort.{u2}} [_inst_1 : CompleteBooleanAlgebra.{u1} α] {f : ι -> α}, Eq.{succ u1} α (HasCompl.compl.{u1} α (BooleanAlgebra.toHasCompl.{u1} α (CompleteBooleanAlgebra.toBooleanAlgebra.{u1} α _inst_1)) (infᵢ.{u1, u2} α (CompleteBooleanAlgebra.toInfSet.{u1} α _inst_1) ι f)) (supᵢ.{u1, u2} α (CompleteBooleanAlgebra.toSupSet.{u1} α _inst_1) ι (fun (i : ι) => HasCompl.compl.{u1} α (BooleanAlgebra.toHasCompl.{u1} α (CompleteBooleanAlgebra.toBooleanAlgebra.{u1} α _inst_1)) (f i))) Case conversion may be inaccurate. Consider using '#align compl_infi compl_infᵢₓ'. -/ theorem compl_infᵢ : infᵢ fᶜ = ⨆ i, f iᶜ := le_antisymm (compl_le_of_compl_le <| le_infᵢ fun i => compl_le_of_compl_le <| le_supᵢ (compl ∘ f) i) (supᵢ_le fun i => compl_le_compl <| infᵢ_le _ _) #align compl_infi compl_infᵢ /- warning: compl_supr -> compl_supᵢ is a dubious translation: lean 3 declaration is forall {α : Type.{u1}} {ι : Sort.{u2}} [_inst_1 : CompleteBooleanAlgebra.{u1} α] {f : ι -> α}, Eq.{succ u1} α (HasCompl.compl.{u1} α (BooleanAlgebra.toHasCompl.{u1} α (CompleteBooleanAlgebra.toBooleanAlgebra.{u1} α _inst_1)) (supᵢ.{u1, u2} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Coframe.toCompleteLattice.{u1} α (CompleteDistribLattice.toCoframe.{u1} α (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} α _inst_1))))) ι f)) (infᵢ.{u1, u2} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α (CompleteDistribLattice.toCoframe.{u1} α (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} α _inst_1))))) ι (fun (i : ι) => HasCompl.compl.{u1} α (BooleanAlgebra.toHasCompl.{u1} α (CompleteBooleanAlgebra.toBooleanAlgebra.{u1} α _inst_1)) (f i))) but is expected to have type forall {α : Type.{u1}} {ι : Sort.{u2}} [_inst_1 : CompleteBooleanAlgebra.{u1} α] {f : ι -> α}, Eq.{succ u1} α (HasCompl.compl.{u1} α (BooleanAlgebra.toHasCompl.{u1} α (CompleteBooleanAlgebra.toBooleanAlgebra.{u1} α _inst_1)) (supᵢ.{u1, u2} α (CompleteBooleanAlgebra.toSupSet.{u1} α _inst_1) ι f)) (infᵢ.{u1, u2} α (CompleteBooleanAlgebra.toInfSet.{u1} α _inst_1) ι (fun (i : ι) => HasCompl.compl.{u1} α (BooleanAlgebra.toHasCompl.{u1} α (CompleteBooleanAlgebra.toBooleanAlgebra.{u1} α _inst_1)) (f i))) Case conversion may be inaccurate. Consider using '#align compl_supr compl_supᵢₓ'. -/ theorem compl_supᵢ : supᵢ fᶜ = ⨅ i, f iᶜ := compl_injective (by simp [compl_infᵢ]) #align compl_supr compl_supᵢ /- warning: compl_Inf -> compl_infₛ is a dubious translation: lean 3 declaration is forall {α : Type.{u1}} [_inst_1 : CompleteBooleanAlgebra.{u1} α] {s : Set.{u1} α}, Eq.{succ u1} α (HasCompl.compl.{u1} α (BooleanAlgebra.toHasCompl.{u1} α (CompleteBooleanAlgebra.toBooleanAlgebra.{u1} α _inst_1)) (InfSet.infₛ.{u1} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α (CompleteDistribLattice.toCoframe.{u1} α (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} α _inst_1))))) s)) (supᵢ.{u1, succ u1} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Coframe.toCompleteLattice.{u1} α (CompleteDistribLattice.toCoframe.{u1} α (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} α _inst_1))))) α (fun (i : α) => supᵢ.{u1, 0} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Coframe.toCompleteLattice.{u1} α (CompleteDistribLattice.toCoframe.{u1} α (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} α _inst_1))))) (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) i s) (fun (H : Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) i s) => HasCompl.compl.{u1} α (BooleanAlgebra.toHasCompl.{u1} α (CompleteBooleanAlgebra.toBooleanAlgebra.{u1} α _inst_1)) i))) but is expected to have type forall {α : Type.{u1}} [_inst_1 : CompleteBooleanAlgebra.{u1} α] {s : Set.{u1} α}, Eq.{succ u1} α (HasCompl.compl.{u1} α (BooleanAlgebra.toHasCompl.{u1} α (CompleteBooleanAlgebra.toBooleanAlgebra.{u1} α _inst_1)) (InfSet.infₛ.{u1} α (CompleteBooleanAlgebra.toInfSet.{u1} α _inst_1) s)) (supᵢ.{u1, succ u1} α (CompleteBooleanAlgebra.toSupSet.{u1} α _inst_1) α (fun (i : α) => supᵢ.{u1, 0} α (CompleteBooleanAlgebra.toSupSet.{u1} α _inst_1) (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) i s) (fun (H : Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) i s) => HasCompl.compl.{u1} α (BooleanAlgebra.toHasCompl.{u1} α (CompleteBooleanAlgebra.toBooleanAlgebra.{u1} α _inst_1)) i))) Case conversion may be inaccurate. Consider using '#align compl_Inf compl_infₛₓ'. -/ theorem compl_infₛ : infₛ sᶜ = ⨆ i ∈ s, iᶜ := by simp only [infₛ_eq_infᵢ, compl_infᵢ] #align compl_Inf compl_infₛ /- warning: compl_Sup -> compl_supₛ is a dubious translation: lean 3 declaration is forall {α : Type.{u1}} [_inst_1 : CompleteBooleanAlgebra.{u1} α] {s : Set.{u1} α}, Eq.{succ u1} α (HasCompl.compl.{u1} α (BooleanAlgebra.toHasCompl.{u1} α (CompleteBooleanAlgebra.toBooleanAlgebra.{u1} α _inst_1)) (SupSet.supₛ.{u1} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Coframe.toCompleteLattice.{u1} α (CompleteDistribLattice.toCoframe.{u1} α (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} α _inst_1))))) s)) (infᵢ.{u1, succ u1} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α (CompleteDistribLattice.toCoframe.{u1} α (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} α _inst_1))))) α (fun (i : α) => infᵢ.{u1, 0} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α (CompleteDistribLattice.toCoframe.{u1} α (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} α _inst_1))))) (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) i s) (fun (H : Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) i s) => HasCompl.compl.{u1} α (BooleanAlgebra.toHasCompl.{u1} α (CompleteBooleanAlgebra.toBooleanAlgebra.{u1} α _inst_1)) i))) but is expected to have type forall {α : Type.{u1}} [_inst_1 : CompleteBooleanAlgebra.{u1} α] {s : Set.{u1} α}, Eq.{succ u1} α (HasCompl.compl.{u1} α (BooleanAlgebra.toHasCompl.{u1} α (CompleteBooleanAlgebra.toBooleanAlgebra.{u1} α _inst_1)) (SupSet.supₛ.{u1} α (CompleteBooleanAlgebra.toSupSet.{u1} α _inst_1) s)) (infᵢ.{u1, succ u1} α (CompleteBooleanAlgebra.toInfSet.{u1} α _inst_1) α (fun (i : α) => infᵢ.{u1, 0} α (CompleteBooleanAlgebra.toInfSet.{u1} α _inst_1) (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) i s) (fun (H : Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) i s) => HasCompl.compl.{u1} α (BooleanAlgebra.toHasCompl.{u1} α (CompleteBooleanAlgebra.toBooleanAlgebra.{u1} α _inst_1)) i))) Case conversion may be inaccurate. Consider using '#align compl_Sup compl_supₛₓ'. -/ theorem compl_supₛ : supₛ sᶜ = ⨅ i ∈ s, iᶜ := by simp only [supₛ_eq_supᵢ, compl_supᵢ] #align compl_Sup compl_supₛ /- warning: compl_Inf' -> compl_infₛ' is a dubious translation: lean 3 declaration is forall {α : Type.{u1}} [_inst_1 : CompleteBooleanAlgebra.{u1} α] {s : Set.{u1} α}, Eq.{succ u1} α (HasCompl.compl.{u1} α (BooleanAlgebra.toHasCompl.{u1} α (CompleteBooleanAlgebra.toBooleanAlgebra.{u1} α _inst_1)) (InfSet.infₛ.{u1} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α (CompleteDistribLattice.toCoframe.{u1} α (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} α _inst_1))))) s)) (SupSet.supₛ.{u1} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Coframe.toCompleteLattice.{u1} α (CompleteDistribLattice.toCoframe.{u1} α (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} α _inst_1))))) (Set.image.{u1, u1} α α (HasCompl.compl.{u1} α (BooleanAlgebra.toHasCompl.{u1} α (CompleteBooleanAlgebra.toBooleanAlgebra.{u1} α _inst_1))) s)) but is expected to have type forall {α : Type.{u1}} [_inst_1 : CompleteBooleanAlgebra.{u1} α] {s : Set.{u1} α}, Eq.{succ u1} α (HasCompl.compl.{u1} α (BooleanAlgebra.toHasCompl.{u1} α (CompleteBooleanAlgebra.toBooleanAlgebra.{u1} α _inst_1)) (InfSet.infₛ.{u1} α (CompleteBooleanAlgebra.toInfSet.{u1} α _inst_1) s)) (SupSet.supₛ.{u1} α (CompleteBooleanAlgebra.toSupSet.{u1} α _inst_1) (Set.image.{u1, u1} α α (HasCompl.compl.{u1} α (BooleanAlgebra.toHasCompl.{u1} α (CompleteBooleanAlgebra.toBooleanAlgebra.{u1} α _inst_1))) s)) Case conversion may be inaccurate. Consider using '#align compl_Inf' compl_infₛ'ₓ'. -/ theorem compl_infₛ' : infₛ sᶜ = supₛ (compl '' s) := compl_infₛ.trans supₛ_image.symm #align compl_Inf' compl_infₛ' /- warning: compl_Sup' -> compl_supₛ' is a dubious translation: lean 3 declaration is forall {α : Type.{u1}} [_inst_1 : CompleteBooleanAlgebra.{u1} α] {s : Set.{u1} α}, Eq.{succ u1} α (HasCompl.compl.{u1} α (BooleanAlgebra.toHasCompl.{u1} α (CompleteBooleanAlgebra.toBooleanAlgebra.{u1} α _inst_1)) (SupSet.supₛ.{u1} α (CompleteSemilatticeSup.toHasSup.{u1} α (CompleteLattice.toCompleteSemilatticeSup.{u1} α (Order.Coframe.toCompleteLattice.{u1} α (CompleteDistribLattice.toCoframe.{u1} α (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} α _inst_1))))) s)) (InfSet.infₛ.{u1} α (CompleteSemilatticeInf.toHasInf.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α (Order.Coframe.toCompleteLattice.{u1} α (CompleteDistribLattice.toCoframe.{u1} α (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} α _inst_1))))) (Set.image.{u1, u1} α α (HasCompl.compl.{u1} α (BooleanAlgebra.toHasCompl.{u1} α (CompleteBooleanAlgebra.toBooleanAlgebra.{u1} α _inst_1))) s)) but is expected to have type forall {α : Type.{u1}} [_inst_1 : CompleteBooleanAlgebra.{u1} α] {s : Set.{u1} α}, Eq.{succ u1} α (HasCompl.compl.{u1} α (BooleanAlgebra.toHasCompl.{u1} α (CompleteBooleanAlgebra.toBooleanAlgebra.{u1} α _inst_1)) (SupSet.supₛ.{u1} α (CompleteBooleanAlgebra.toSupSet.{u1} α _inst_1) s)) (InfSet.infₛ.{u1} α (CompleteBooleanAlgebra.toInfSet.{u1} α _inst_1) (Set.image.{u1, u1} α α (HasCompl.compl.{u1} α (BooleanAlgebra.toHasCompl.{u1} α (CompleteBooleanAlgebra.toBooleanAlgebra.{u1} α _inst_1))) s)) Case conversion may be inaccurate. Consider using '#align compl_Sup' compl_supₛ'ₓ'. -/ theorem compl_supₛ' : supₛ sᶜ = infₛ (compl '' s) := compl_supₛ.trans infₛ_image.symm #align compl_Sup' compl_supₛ' end CompleteBooleanAlgebra section lift /- warning: function.injective.frame -> Function.Injective.frame is a dubious translation: lean 3 declaration is forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : Sup.{u1} α] [_inst_2 : Inf.{u1} α] [_inst_3 : SupSet.{u1} α] [_inst_4 : InfSet.{u1} α] [_inst_5 : Top.{u1} α] [_inst_6 : Bot.{u1} α] [_inst_7 : Order.Frame.{u2} β] (f : α -> β), (Function.Injective.{succ u1, succ u2} α β f) -> (forall (a : α) (b : α), Eq.{succ u2} β (f (Sup.sup.{u1} α _inst_1 a b)) (Sup.sup.{u2} β (SemilatticeSup.toHasSup.{u2} β (Lattice.toSemilatticeSup.{u2} β (CompleteLattice.toLattice.{u2} β (Order.Frame.toCompleteLattice.{u2} β _inst_7)))) (f a) (f b))) -> (forall (a : α) (b : α), Eq.{succ u2} β (f (Inf.inf.{u1} α _inst_2 a b)) (Inf.inf.{u2} β (SemilatticeInf.toHasInf.{u2} β (Lattice.toSemilatticeInf.{u2} β (CompleteLattice.toLattice.{u2} β (Order.Frame.toCompleteLattice.{u2} β _inst_7)))) (f a) (f b))) -> (forall (s : Set.{u1} α), Eq.{succ u2} β (f (SupSet.supₛ.{u1} α _inst_3 s)) (supᵢ.{u2, succ u1} β (CompleteSemilatticeSup.toHasSup.{u2} β (CompleteLattice.toCompleteSemilatticeSup.{u2} β (Order.Frame.toCompleteLattice.{u2} β _inst_7))) α (fun (a : α) => supᵢ.{u2, 0} β (CompleteSemilatticeSup.toHasSup.{u2} β (CompleteLattice.toCompleteSemilatticeSup.{u2} β (Order.Frame.toCompleteLattice.{u2} β _inst_7))) (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) (fun (H : Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) => f a)))) -> (forall (s : Set.{u1} α), Eq.{succ u2} β (f (InfSet.infₛ.{u1} α _inst_4 s)) (infᵢ.{u2, succ u1} β (CompleteSemilatticeInf.toHasInf.{u2} β (CompleteLattice.toCompleteSemilatticeInf.{u2} β (Order.Frame.toCompleteLattice.{u2} β _inst_7))) α (fun (a : α) => infᵢ.{u2, 0} β (CompleteSemilatticeInf.toHasInf.{u2} β (CompleteLattice.toCompleteSemilatticeInf.{u2} β (Order.Frame.toCompleteLattice.{u2} β _inst_7))) (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) (fun (H : Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) => f a)))) -> (Eq.{succ u2} β (f (Top.top.{u1} α _inst_5)) (Top.top.{u2} β (CompleteLattice.toHasTop.{u2} β (Order.Frame.toCompleteLattice.{u2} β _inst_7)))) -> (Eq.{succ u2} β (f (Bot.bot.{u1} α _inst_6)) (Bot.bot.{u2} β (CompleteLattice.toHasBot.{u2} β (Order.Frame.toCompleteLattice.{u2} β _inst_7)))) -> (Order.Frame.{u1} α) but is expected to have type forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : Sup.{u1} α] [_inst_2 : Inf.{u1} α] [_inst_3 : SupSet.{u1} α] [_inst_4 : InfSet.{u1} α] [_inst_5 : Top.{u1} α] [_inst_6 : Bot.{u1} α] [_inst_7 : Order.Frame.{u2} β] (f : α -> β), (Function.Injective.{succ u1, succ u2} α β f) -> (forall (a : α) (b : α), Eq.{succ u2} β (f (Sup.sup.{u1} α _inst_1 a b)) (Sup.sup.{u2} β (SemilatticeSup.toSup.{u2} β (Lattice.toSemilatticeSup.{u2} β (CompleteLattice.toLattice.{u2} β (Order.Frame.toCompleteLattice.{u2} β _inst_7)))) (f a) (f b))) -> (forall (a : α) (b : α), Eq.{succ u2} β (f (Inf.inf.{u1} α _inst_2 a b)) (Inf.inf.{u2} β (Lattice.toInf.{u2} β (CompleteLattice.toLattice.{u2} β (Order.Frame.toCompleteLattice.{u2} β _inst_7))) (f a) (f b))) -> (forall (s : Set.{u1} α), Eq.{succ u2} β (f (SupSet.supₛ.{u1} α _inst_3 s)) (supᵢ.{u2, succ u1} β (CompleteLattice.toSupSet.{u2} β (Order.Frame.toCompleteLattice.{u2} β _inst_7)) α (fun (a : α) => supᵢ.{u2, 0} β (CompleteLattice.toSupSet.{u2} β (Order.Frame.toCompleteLattice.{u2} β _inst_7)) (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) a s) (fun (H : Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) a s) => f a)))) -> (forall (s : Set.{u1} α), Eq.{succ u2} β (f (InfSet.infₛ.{u1} α _inst_4 s)) (infᵢ.{u2, succ u1} β (CompleteLattice.toInfSet.{u2} β (Order.Frame.toCompleteLattice.{u2} β _inst_7)) α (fun (a : α) => infᵢ.{u2, 0} β (CompleteLattice.toInfSet.{u2} β (Order.Frame.toCompleteLattice.{u2} β _inst_7)) (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) a s) (fun (H : Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) a s) => f a)))) -> (Eq.{succ u2} β (f (Top.top.{u1} α _inst_5)) (Top.top.{u2} β (CompleteLattice.toTop.{u2} β (Order.Frame.toCompleteLattice.{u2} β _inst_7)))) -> (Eq.{succ u2} β (f (Bot.bot.{u1} α _inst_6)) (Bot.bot.{u2} β (CompleteLattice.toBot.{u2} β (Order.Frame.toCompleteLattice.{u2} β _inst_7)))) -> (Order.Frame.{u1} α) Case conversion may be inaccurate. Consider using '#align function.injective.frame Function.Injective.frameₓ'. -/ -- See note [reducible non-instances] /-- Pullback an `order.frame` along an injection. -/ @[reducible] protected def Function.Injective.frame [Sup α] [Inf α] [SupSet α] [InfSet α] [Top α] [Bot α] [Frame β] (f : α → β) (hf : Injective f) (map_sup : ∀ a b, f (a ⊔ b) = f a ⊔ f b) (map_inf : ∀ a b, f (a ⊓ b) = f a ⊓ f b) (map_Sup : ∀ s, f (supₛ s) = ⨆ a ∈ s, f a) (map_Inf : ∀ s, f (infₛ s) = ⨅ a ∈ s, f a) (map_top : f ⊤ = ⊤) (map_bot : f ⊥ = ⊥) : Frame α := { hf.CompleteLattice f map_sup map_inf map_Sup map_Inf map_top map_bot with inf_sup_le_supᵢ_inf := fun a s => by change f (a ⊓ Sup s) ≤ f _ rw [← supₛ_image, map_inf, map_Sup s, inf_supᵢ₂_eq] simp_rw [← map_inf] exact ((map_Sup _).trans supᵢ_image).ge } #align function.injective.frame Function.Injective.frame /- warning: function.injective.coframe -> Function.Injective.coframe is a dubious translation: lean 3 declaration is forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : Sup.{u1} α] [_inst_2 : Inf.{u1} α] [_inst_3 : SupSet.{u1} α] [_inst_4 : InfSet.{u1} α] [_inst_5 : Top.{u1} α] [_inst_6 : Bot.{u1} α] [_inst_7 : Order.Coframe.{u2} β] (f : α -> β), (Function.Injective.{succ u1, succ u2} α β f) -> (forall (a : α) (b : α), Eq.{succ u2} β (f (Sup.sup.{u1} α _inst_1 a b)) (Sup.sup.{u2} β (SemilatticeSup.toHasSup.{u2} β (Lattice.toSemilatticeSup.{u2} β (CompleteLattice.toLattice.{u2} β (Order.Coframe.toCompleteLattice.{u2} β _inst_7)))) (f a) (f b))) -> (forall (a : α) (b : α), Eq.{succ u2} β (f (Inf.inf.{u1} α _inst_2 a b)) (Inf.inf.{u2} β (SemilatticeInf.toHasInf.{u2} β (Lattice.toSemilatticeInf.{u2} β (CompleteLattice.toLattice.{u2} β (Order.Coframe.toCompleteLattice.{u2} β _inst_7)))) (f a) (f b))) -> (forall (s : Set.{u1} α), Eq.{succ u2} β (f (SupSet.supₛ.{u1} α _inst_3 s)) (supᵢ.{u2, succ u1} β (CompleteSemilatticeSup.toHasSup.{u2} β (CompleteLattice.toCompleteSemilatticeSup.{u2} β (Order.Coframe.toCompleteLattice.{u2} β _inst_7))) α (fun (a : α) => supᵢ.{u2, 0} β (CompleteSemilatticeSup.toHasSup.{u2} β (CompleteLattice.toCompleteSemilatticeSup.{u2} β (Order.Coframe.toCompleteLattice.{u2} β _inst_7))) (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) (fun (H : Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) => f a)))) -> (forall (s : Set.{u1} α), Eq.{succ u2} β (f (InfSet.infₛ.{u1} α _inst_4 s)) (infᵢ.{u2, succ u1} β (CompleteSemilatticeInf.toHasInf.{u2} β (CompleteLattice.toCompleteSemilatticeInf.{u2} β (Order.Coframe.toCompleteLattice.{u2} β _inst_7))) α (fun (a : α) => infᵢ.{u2, 0} β (CompleteSemilatticeInf.toHasInf.{u2} β (CompleteLattice.toCompleteSemilatticeInf.{u2} β (Order.Coframe.toCompleteLattice.{u2} β _inst_7))) (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) (fun (H : Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) => f a)))) -> (Eq.{succ u2} β (f (Top.top.{u1} α _inst_5)) (Top.top.{u2} β (CompleteLattice.toHasTop.{u2} β (Order.Coframe.toCompleteLattice.{u2} β _inst_7)))) -> (Eq.{succ u2} β (f (Bot.bot.{u1} α _inst_6)) (Bot.bot.{u2} β (CompleteLattice.toHasBot.{u2} β (Order.Coframe.toCompleteLattice.{u2} β _inst_7)))) -> (Order.Coframe.{u1} α) but is expected to have type forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : Sup.{u1} α] [_inst_2 : Inf.{u1} α] [_inst_3 : SupSet.{u1} α] [_inst_4 : InfSet.{u1} α] [_inst_5 : Top.{u1} α] [_inst_6 : Bot.{u1} α] [_inst_7 : Order.Coframe.{u2} β] (f : α -> β), (Function.Injective.{succ u1, succ u2} α β f) -> (forall (a : α) (b : α), Eq.{succ u2} β (f (Sup.sup.{u1} α _inst_1 a b)) (Sup.sup.{u2} β (SemilatticeSup.toSup.{u2} β (Lattice.toSemilatticeSup.{u2} β (CompleteLattice.toLattice.{u2} β (Order.Coframe.toCompleteLattice.{u2} β _inst_7)))) (f a) (f b))) -> (forall (a : α) (b : α), Eq.{succ u2} β (f (Inf.inf.{u1} α _inst_2 a b)) (Inf.inf.{u2} β (Lattice.toInf.{u2} β (CompleteLattice.toLattice.{u2} β (Order.Coframe.toCompleteLattice.{u2} β _inst_7))) (f a) (f b))) -> (forall (s : Set.{u1} α), Eq.{succ u2} β (f (SupSet.supₛ.{u1} α _inst_3 s)) (supᵢ.{u2, succ u1} β (CompleteLattice.toSupSet.{u2} β (Order.Coframe.toCompleteLattice.{u2} β _inst_7)) α (fun (a : α) => supᵢ.{u2, 0} β (CompleteLattice.toSupSet.{u2} β (Order.Coframe.toCompleteLattice.{u2} β _inst_7)) (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) a s) (fun (H : Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) a s) => f a)))) -> (forall (s : Set.{u1} α), Eq.{succ u2} β (f (InfSet.infₛ.{u1} α _inst_4 s)) (infᵢ.{u2, succ u1} β (CompleteLattice.toInfSet.{u2} β (Order.Coframe.toCompleteLattice.{u2} β _inst_7)) α (fun (a : α) => infᵢ.{u2, 0} β (CompleteLattice.toInfSet.{u2} β (Order.Coframe.toCompleteLattice.{u2} β _inst_7)) (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) a s) (fun (H : Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) a s) => f a)))) -> (Eq.{succ u2} β (f (Top.top.{u1} α _inst_5)) (Top.top.{u2} β (CompleteLattice.toTop.{u2} β (Order.Coframe.toCompleteLattice.{u2} β _inst_7)))) -> (Eq.{succ u2} β (f (Bot.bot.{u1} α _inst_6)) (Bot.bot.{u2} β (CompleteLattice.toBot.{u2} β (Order.Coframe.toCompleteLattice.{u2} β _inst_7)))) -> (Order.Coframe.{u1} α) Case conversion may be inaccurate. Consider using '#align function.injective.coframe Function.Injective.coframeₓ'. -/ -- See note [reducible non-instances] /-- Pullback an `order.coframe` along an injection. -/ @[reducible] protected def Function.Injective.coframe [Sup α] [Inf α] [SupSet α] [InfSet α] [Top α] [Bot α] [Coframe β] (f : α → β) (hf : Injective f) (map_sup : ∀ a b, f (a ⊔ b) = f a ⊔ f b) (map_inf : ∀ a b, f (a ⊓ b) = f a ⊓ f b) (map_Sup : ∀ s, f (supₛ s) = ⨆ a ∈ s, f a) (map_Inf : ∀ s, f (infₛ s) = ⨅ a ∈ s, f a) (map_top : f ⊤ = ⊤) (map_bot : f ⊥ = ⊥) : Coframe α := { hf.CompleteLattice f map_sup map_inf map_Sup map_Inf map_top map_bot with infᵢ_sup_le_sup_inf := fun a s => by change f _ ≤ f (a ⊔ Inf s) rw [← infₛ_image, map_sup, map_Inf s, sup_infᵢ₂_eq] simp_rw [← map_sup] exact ((map_Inf _).trans infᵢ_image).le } #align function.injective.coframe Function.Injective.coframe /- warning: function.injective.complete_distrib_lattice -> Function.Injective.completeDistribLattice is a dubious translation: lean 3 declaration is forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : Sup.{u1} α] [_inst_2 : Inf.{u1} α] [_inst_3 : SupSet.{u1} α] [_inst_4 : InfSet.{u1} α] [_inst_5 : Top.{u1} α] [_inst_6 : Bot.{u1} α] [_inst_7 : CompleteDistribLattice.{u2} β] (f : α -> β), (Function.Injective.{succ u1, succ u2} α β f) -> (forall (a : α) (b : α), Eq.{succ u2} β (f (Sup.sup.{u1} α _inst_1 a b)) (Sup.sup.{u2} β (SemilatticeSup.toHasSup.{u2} β (Lattice.toSemilatticeSup.{u2} β (CompleteLattice.toLattice.{u2} β (Order.Coframe.toCompleteLattice.{u2} β (CompleteDistribLattice.toCoframe.{u2} β _inst_7))))) (f a) (f b))) -> (forall (a : α) (b : α), Eq.{succ u2} β (f (Inf.inf.{u1} α _inst_2 a b)) (Inf.inf.{u2} β (SemilatticeInf.toHasInf.{u2} β (Lattice.toSemilatticeInf.{u2} β (CompleteLattice.toLattice.{u2} β (Order.Coframe.toCompleteLattice.{u2} β (CompleteDistribLattice.toCoframe.{u2} β _inst_7))))) (f a) (f b))) -> (forall (s : Set.{u1} α), Eq.{succ u2} β (f (SupSet.supₛ.{u1} α _inst_3 s)) (supᵢ.{u2, succ u1} β (CompleteSemilatticeSup.toHasSup.{u2} β (CompleteLattice.toCompleteSemilatticeSup.{u2} β (Order.Coframe.toCompleteLattice.{u2} β (CompleteDistribLattice.toCoframe.{u2} β _inst_7)))) α (fun (a : α) => supᵢ.{u2, 0} β (CompleteSemilatticeSup.toHasSup.{u2} β (CompleteLattice.toCompleteSemilatticeSup.{u2} β (Order.Coframe.toCompleteLattice.{u2} β (CompleteDistribLattice.toCoframe.{u2} β _inst_7)))) (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) (fun (H : Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) => f a)))) -> (forall (s : Set.{u1} α), Eq.{succ u2} β (f (InfSet.infₛ.{u1} α _inst_4 s)) (infᵢ.{u2, succ u1} β (CompleteSemilatticeInf.toHasInf.{u2} β (CompleteLattice.toCompleteSemilatticeInf.{u2} β (Order.Coframe.toCompleteLattice.{u2} β (CompleteDistribLattice.toCoframe.{u2} β _inst_7)))) α (fun (a : α) => infᵢ.{u2, 0} β (CompleteSemilatticeInf.toHasInf.{u2} β (CompleteLattice.toCompleteSemilatticeInf.{u2} β (Order.Coframe.toCompleteLattice.{u2} β (CompleteDistribLattice.toCoframe.{u2} β _inst_7)))) (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) (fun (H : Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) => f a)))) -> (Eq.{succ u2} β (f (Top.top.{u1} α _inst_5)) (Top.top.{u2} β (CompleteLattice.toHasTop.{u2} β (Order.Coframe.toCompleteLattice.{u2} β (CompleteDistribLattice.toCoframe.{u2} β _inst_7))))) -> (Eq.{succ u2} β (f (Bot.bot.{u1} α _inst_6)) (Bot.bot.{u2} β (CompleteLattice.toHasBot.{u2} β (Order.Coframe.toCompleteLattice.{u2} β (CompleteDistribLattice.toCoframe.{u2} β _inst_7))))) -> (CompleteDistribLattice.{u1} α) but is expected to have type forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : Sup.{u1} α] [_inst_2 : Inf.{u1} α] [_inst_3 : SupSet.{u1} α] [_inst_4 : InfSet.{u1} α] [_inst_5 : Top.{u1} α] [_inst_6 : Bot.{u1} α] [_inst_7 : CompleteDistribLattice.{u2} β] (f : α -> β), (Function.Injective.{succ u1, succ u2} α β f) -> (forall (a : α) (b : α), Eq.{succ u2} β (f (Sup.sup.{u1} α _inst_1 a b)) (Sup.sup.{u2} β (SemilatticeSup.toSup.{u2} β (Lattice.toSemilatticeSup.{u2} β (CompleteLattice.toLattice.{u2} β (Order.Coframe.toCompleteLattice.{u2} β (CompleteDistribLattice.toCoframe.{u2} β _inst_7))))) (f a) (f b))) -> (forall (a : α) (b : α), Eq.{succ u2} β (f (Inf.inf.{u1} α _inst_2 a b)) (Inf.inf.{u2} β (Lattice.toInf.{u2} β (CompleteLattice.toLattice.{u2} β (Order.Coframe.toCompleteLattice.{u2} β (CompleteDistribLattice.toCoframe.{u2} β _inst_7)))) (f a) (f b))) -> (forall (s : Set.{u1} α), Eq.{succ u2} β (f (SupSet.supₛ.{u1} α _inst_3 s)) (supᵢ.{u2, succ u1} β (CompleteLattice.toSupSet.{u2} β (Order.Coframe.toCompleteLattice.{u2} β (CompleteDistribLattice.toCoframe.{u2} β _inst_7))) α (fun (a : α) => supᵢ.{u2, 0} β (CompleteLattice.toSupSet.{u2} β (Order.Coframe.toCompleteLattice.{u2} β (CompleteDistribLattice.toCoframe.{u2} β _inst_7))) (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) a s) (fun (H : Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) a s) => f a)))) -> (forall (s : Set.{u1} α), Eq.{succ u2} β (f (InfSet.infₛ.{u1} α _inst_4 s)) (infᵢ.{u2, succ u1} β (CompleteLattice.toInfSet.{u2} β (Order.Coframe.toCompleteLattice.{u2} β (CompleteDistribLattice.toCoframe.{u2} β _inst_7))) α (fun (a : α) => infᵢ.{u2, 0} β (CompleteLattice.toInfSet.{u2} β (Order.Coframe.toCompleteLattice.{u2} β (CompleteDistribLattice.toCoframe.{u2} β _inst_7))) (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) a s) (fun (H : Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) a s) => f a)))) -> (Eq.{succ u2} β (f (Top.top.{u1} α _inst_5)) (Top.top.{u2} β (CompleteLattice.toTop.{u2} β (Order.Coframe.toCompleteLattice.{u2} β (CompleteDistribLattice.toCoframe.{u2} β _inst_7))))) -> (Eq.{succ u2} β (f (Bot.bot.{u1} α _inst_6)) (Bot.bot.{u2} β (CompleteLattice.toBot.{u2} β (Order.Coframe.toCompleteLattice.{u2} β (CompleteDistribLattice.toCoframe.{u2} β _inst_7))))) -> (CompleteDistribLattice.{u1} α) Case conversion may be inaccurate. Consider using '#align function.injective.complete_distrib_lattice Function.Injective.completeDistribLatticeₓ'. -/ -- See note [reducible non-instances] /-- Pullback a `complete_distrib_lattice` along an injection. -/ @[reducible] protected def Function.Injective.completeDistribLattice [Sup α] [Inf α] [SupSet α] [InfSet α] [Top α] [Bot α] [CompleteDistribLattice β] (f : α → β) (hf : Function.Injective f) (map_sup : ∀ a b, f (a ⊔ b) = f a ⊔ f b) (map_inf : ∀ a b, f (a ⊓ b) = f a ⊓ f b) (map_Sup : ∀ s, f (supₛ s) = ⨆ a ∈ s, f a) (map_Inf : ∀ s, f (infₛ s) = ⨅ a ∈ s, f a) (map_top : f ⊤ = ⊤) (map_bot : f ⊥ = ⊥) : CompleteDistribLattice α := { hf.Frame f map_sup map_inf map_Sup map_Inf map_top map_bot, hf.Coframe f map_sup map_inf map_Sup map_Inf map_top map_bot with } #align function.injective.complete_distrib_lattice Function.Injective.completeDistribLattice /- warning: function.injective.complete_boolean_algebra -> Function.Injective.completeBooleanAlgebra is a dubious translation: lean 3 declaration is forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : Sup.{u1} α] [_inst_2 : Inf.{u1} α] [_inst_3 : SupSet.{u1} α] [_inst_4 : InfSet.{u1} α] [_inst_5 : Top.{u1} α] [_inst_6 : Bot.{u1} α] [_inst_7 : HasCompl.{u1} α] [_inst_8 : SDiff.{u1} α] [_inst_9 : CompleteBooleanAlgebra.{u2} β] (f : α -> β), (Function.Injective.{succ u1, succ u2} α β f) -> (forall (a : α) (b : α), Eq.{succ u2} β (f (Sup.sup.{u1} α _inst_1 a b)) (Sup.sup.{u2} β (SemilatticeSup.toHasSup.{u2} β (Lattice.toSemilatticeSup.{u2} β (CompleteLattice.toLattice.{u2} β (Order.Coframe.toCompleteLattice.{u2} β (CompleteDistribLattice.toCoframe.{u2} β (CompleteBooleanAlgebra.toCompleteDistribLattice.{u2} β _inst_9)))))) (f a) (f b))) -> (forall (a : α) (b : α), Eq.{succ u2} β (f (Inf.inf.{u1} α _inst_2 a b)) (Inf.inf.{u2} β (SemilatticeInf.toHasInf.{u2} β (Lattice.toSemilatticeInf.{u2} β (CompleteLattice.toLattice.{u2} β (Order.Coframe.toCompleteLattice.{u2} β (CompleteDistribLattice.toCoframe.{u2} β (CompleteBooleanAlgebra.toCompleteDistribLattice.{u2} β _inst_9)))))) (f a) (f b))) -> (forall (s : Set.{u1} α), Eq.{succ u2} β (f (SupSet.supₛ.{u1} α _inst_3 s)) (supᵢ.{u2, succ u1} β (CompleteSemilatticeSup.toHasSup.{u2} β (CompleteLattice.toCompleteSemilatticeSup.{u2} β (Order.Coframe.toCompleteLattice.{u2} β (CompleteDistribLattice.toCoframe.{u2} β (CompleteBooleanAlgebra.toCompleteDistribLattice.{u2} β _inst_9))))) α (fun (a : α) => supᵢ.{u2, 0} β (CompleteSemilatticeSup.toHasSup.{u2} β (CompleteLattice.toCompleteSemilatticeSup.{u2} β (Order.Coframe.toCompleteLattice.{u2} β (CompleteDistribLattice.toCoframe.{u2} β (CompleteBooleanAlgebra.toCompleteDistribLattice.{u2} β _inst_9))))) (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) (fun (H : Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) => f a)))) -> (forall (s : Set.{u1} α), Eq.{succ u2} β (f (InfSet.infₛ.{u1} α _inst_4 s)) (infᵢ.{u2, succ u1} β (CompleteSemilatticeInf.toHasInf.{u2} β (CompleteLattice.toCompleteSemilatticeInf.{u2} β (Order.Coframe.toCompleteLattice.{u2} β (CompleteDistribLattice.toCoframe.{u2} β (CompleteBooleanAlgebra.toCompleteDistribLattice.{u2} β _inst_9))))) α (fun (a : α) => infᵢ.{u2, 0} β (CompleteSemilatticeInf.toHasInf.{u2} β (CompleteLattice.toCompleteSemilatticeInf.{u2} β (Order.Coframe.toCompleteLattice.{u2} β (CompleteDistribLattice.toCoframe.{u2} β (CompleteBooleanAlgebra.toCompleteDistribLattice.{u2} β _inst_9))))) (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) (fun (H : Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) => f a)))) -> (Eq.{succ u2} β (f (Top.top.{u1} α _inst_5)) (Top.top.{u2} β (CompleteLattice.toHasTop.{u2} β (Order.Coframe.toCompleteLattice.{u2} β (CompleteDistribLattice.toCoframe.{u2} β (CompleteBooleanAlgebra.toCompleteDistribLattice.{u2} β _inst_9)))))) -> (Eq.{succ u2} β (f (Bot.bot.{u1} α _inst_6)) (Bot.bot.{u2} β (CompleteLattice.toHasBot.{u2} β (Order.Coframe.toCompleteLattice.{u2} β (CompleteDistribLattice.toCoframe.{u2} β (CompleteBooleanAlgebra.toCompleteDistribLattice.{u2} β _inst_9)))))) -> (forall (a : α), Eq.{succ u2} β (f (HasCompl.compl.{u1} α _inst_7 a)) (HasCompl.compl.{u2} β (BooleanAlgebra.toHasCompl.{u2} β (CompleteBooleanAlgebra.toBooleanAlgebra.{u2} β _inst_9)) (f a))) -> (forall (a : α) (b : α), Eq.{succ u2} β (f (SDiff.sdiff.{u1} α _inst_8 a b)) (SDiff.sdiff.{u2} β (BooleanAlgebra.toHasSdiff.{u2} β (CompleteBooleanAlgebra.toBooleanAlgebra.{u2} β _inst_9)) (f a) (f b))) -> (CompleteBooleanAlgebra.{u1} α) but is expected to have type forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : Sup.{u1} α] [_inst_2 : Inf.{u1} α] [_inst_3 : SupSet.{u1} α] [_inst_4 : InfSet.{u1} α] [_inst_5 : Top.{u1} α] [_inst_6 : Bot.{u1} α] [_inst_7 : HasCompl.{u1} α] [_inst_8 : SDiff.{u1} α] [_inst_9 : CompleteBooleanAlgebra.{u2} β] (f : α -> β), (Function.Injective.{succ u1, succ u2} α β f) -> (forall (a : α) (b : α), Eq.{succ u2} β (f (Sup.sup.{u1} α _inst_1 a b)) (Sup.sup.{u2} β (SemilatticeSup.toSup.{u2} β (Lattice.toSemilatticeSup.{u2} β (CompleteLattice.toLattice.{u2} β (Order.Coframe.toCompleteLattice.{u2} β (CompleteDistribLattice.toCoframe.{u2} β (CompleteBooleanAlgebra.toCompleteDistribLattice.{u2} β _inst_9)))))) (f a) (f b))) -> (forall (a : α) (b : α), Eq.{succ u2} β (f (Inf.inf.{u1} α _inst_2 a b)) (Inf.inf.{u2} β (Lattice.toInf.{u2} β (CompleteLattice.toLattice.{u2} β (Order.Coframe.toCompleteLattice.{u2} β (CompleteDistribLattice.toCoframe.{u2} β (CompleteBooleanAlgebra.toCompleteDistribLattice.{u2} β _inst_9))))) (f a) (f b))) -> (forall (s : Set.{u1} α), Eq.{succ u2} β (f (SupSet.supₛ.{u1} α _inst_3 s)) (supᵢ.{u2, succ u1} β (CompleteBooleanAlgebra.toSupSet.{u2} β _inst_9) α (fun (a : α) => supᵢ.{u2, 0} β (CompleteBooleanAlgebra.toSupSet.{u2} β _inst_9) (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) a s) (fun (H : Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) a s) => f a)))) -> (forall (s : Set.{u1} α), Eq.{succ u2} β (f (InfSet.infₛ.{u1} α _inst_4 s)) (infᵢ.{u2, succ u1} β (CompleteBooleanAlgebra.toInfSet.{u2} β _inst_9) α (fun (a : α) => infᵢ.{u2, 0} β (CompleteBooleanAlgebra.toInfSet.{u2} β _inst_9) (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) a s) (fun (H : Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) a s) => f a)))) -> (Eq.{succ u2} β (f (Top.top.{u1} α _inst_5)) (Top.top.{u2} β (CompleteLattice.toTop.{u2} β (Order.Coframe.toCompleteLattice.{u2} β (CompleteDistribLattice.toCoframe.{u2} β (CompleteBooleanAlgebra.toCompleteDistribLattice.{u2} β _inst_9)))))) -> (Eq.{succ u2} β (f (Bot.bot.{u1} α _inst_6)) (Bot.bot.{u2} β (CompleteLattice.toBot.{u2} β (Order.Coframe.toCompleteLattice.{u2} β (CompleteDistribLattice.toCoframe.{u2} β (CompleteBooleanAlgebra.toCompleteDistribLattice.{u2} β _inst_9)))))) -> (forall (a : α), Eq.{succ u2} β (f (HasCompl.compl.{u1} α _inst_7 a)) (HasCompl.compl.{u2} β (BooleanAlgebra.toHasCompl.{u2} β (CompleteBooleanAlgebra.toBooleanAlgebra.{u2} β _inst_9)) (f a))) -> (forall (a : α) (b : α), Eq.{succ u2} β (f (SDiff.sdiff.{u1} α _inst_8 a b)) (SDiff.sdiff.{u2} β (BooleanAlgebra.toSDiff.{u2} β (CompleteBooleanAlgebra.toBooleanAlgebra.{u2} β _inst_9)) (f a) (f b))) -> (CompleteBooleanAlgebra.{u1} α) Case conversion may be inaccurate. Consider using '#align function.injective.complete_boolean_algebra Function.Injective.completeBooleanAlgebraₓ'. -/ -- See note [reducible non-instances] /-- Pullback a `complete_boolean_algebra` along an injection. -/ @[reducible] protected def Function.Injective.completeBooleanAlgebra [Sup α] [Inf α] [SupSet α] [InfSet α] [Top α] [Bot α] [HasCompl α] [SDiff α] [CompleteBooleanAlgebra β] (f : α → β) (hf : Function.Injective f) (map_sup : ∀ a b, f (a ⊔ b) = f a ⊔ f b) (map_inf : ∀ a b, f (a ⊓ b) = f a ⊓ f b) (map_Sup : ∀ s, f (supₛ s) = ⨆ a ∈ s, f a) (map_Inf : ∀ s, f (infₛ s) = ⨅ a ∈ s, f a) (map_top : f ⊤ = ⊤) (map_bot : f ⊥ = ⊥) (map_compl : ∀ a, f (aᶜ) = f aᶜ) (map_sdiff : ∀ a b, f (a \ b) = f a \ f b) : CompleteBooleanAlgebra α := { hf.CompleteDistribLattice f map_sup map_inf map_Sup map_Inf map_top map_bot, hf.BooleanAlgebra f map_sup map_inf map_top map_bot map_compl map_sdiff with } #align function.injective.complete_boolean_algebra Function.Injective.completeBooleanAlgebra end lift namespace PUnit variable (s : Set PUnit.{u + 1}) (x y : PUnit.{u + 1}) instance : CompleteBooleanAlgebra PUnit := by refine_struct { PUnit.booleanAlgebra with supₛ := fun _ => star infₛ := fun _ => star } <;> intros <;> first |trivial|simp only [eq_iff_true_of_subsingleton, not_true, and_false_iff] #print PUnit.supₛ_eq /- @[simp] theorem supₛ_eq : supₛ s = unit := rfl #align punit.Sup_eq PUnit.supₛ_eq -/ #print PUnit.infₛ_eq /- @[simp] theorem infₛ_eq : infₛ s = unit := rfl #align punit.Inf_eq PUnit.infₛ_eq -/ end PUnit
import tactic /- If x is a positive integer, then x^2 - x is even. -/ variables x y : ℤ -- First need to define what it means to be even or odd def is_even : Prop := ∃ k, x = 2*k def is_odd : Prop := ¬ (is_even x) lemma if_even_then_not_odd : (is_even x → ¬ is_odd x) := begin rintro ⟨k, h⟩, refine not_not.mpr _, use k, exact h end lemma if_odd_then_not_even : (is_odd x → ¬ is_even x) := begin intro h, exact h, end -- First prove a lemma lemma even_sub_even_is_even : is_even x → is_even y → is_even (x - y) := begin rintro ⟨k1, h1⟩ ⟨k2, h2⟩, use (k1 - k2), rw h1, rw h2, rw ← mul_sub_left_distrib, end lemma even_prod_is_even : is_even x → is_even(x * y) := begin rintro ⟨c, h⟩, use c*y, rw h, rw mul_assoc, end lemma prod_even_is_even : is_even y → is_even (x * y) := begin rintro ⟨c, h⟩, use c*x, rw h, ring, end -- from mc2020 solutions we also have. lemma even_or_odd (n : ℕ) : (∃ k, n = 2 * k) ∨ ∃ k, n = 2 * k + 1 := begin induction n with d hd, { use 0, simp }, -- you should ~always do this rw after opening the successor case of induction on the naturals rw nat.succ_eq_add_one, cases hd with h_even h_odd, { cases h_even with k hk, right, use k, rw hk }, cases h_odd with k hk, left, use k+1, rw hk, ring, end lemma one_of_consecutive_is_even : is_even x ∨ is_even (x + 1) := begin refine or_of_or_of_imp_of_imp _ _ _, end example : is_even (x^2 - x) := begin rw pow_two, --rw ← mul_one x, -- this does all instances of x but I only want the right hand one -- conv_rhs {rw ← mul_one x}, ring_nf, split, {sorry,}, assumption, end
(* Title: HOL/Auth/n_german_lemma_inv__37_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__37_on_rules imports n_german_lemma_on_inv__37 begin section{*All lemmas on causal relation between inv__37*} lemma lemma_inv__37_on_rules: assumes b1: "r \<in> rules N" and b2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__37 p__Inv4)" shows "invHoldForRule s f r (invariants N)" proof - have c1: "(\<exists> j. j\<le>N\<and>r=n_SendReqS j)\<or> (\<exists> i. i\<le>N\<and>r=n_SendReqEI i)\<or> (\<exists> i. i\<le>N\<and>r=n_SendReqES i)\<or> (\<exists> i. i\<le>N\<and>r=n_RecvReq N i)\<or> (\<exists> i. i\<le>N\<and>r=n_SendInvE i)\<or> (\<exists> i. i\<le>N\<and>r=n_SendInvS 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)\<or> (\<exists> i d. i\<le>N\<and>d\<le>N\<and>r=n_Store i d)" apply (cut_tac b1, auto) done moreover { assume d1: "(\<exists> j. j\<le>N\<and>r=n_SendReqS j)" have "invHoldForRule s f r (invariants N)" apply (cut_tac b2 d1, metis n_SendReqSVsinv__37) done } moreover { assume d1: "(\<exists> i. i\<le>N\<and>r=n_SendReqEI i)" have "invHoldForRule s f r (invariants N)" apply (cut_tac b2 d1, metis n_SendReqEIVsinv__37) done } moreover { assume d1: "(\<exists> i. i\<le>N\<and>r=n_SendReqES i)" have "invHoldForRule s f r (invariants N)" apply (cut_tac b2 d1, metis n_SendReqESVsinv__37) done } moreover { assume d1: "(\<exists> i. i\<le>N\<and>r=n_RecvReq N i)" have "invHoldForRule s f r (invariants N)" apply (cut_tac b2 d1, metis n_RecvReqVsinv__37) done } moreover { assume d1: "(\<exists> i. i\<le>N\<and>r=n_SendInvE i)" have "invHoldForRule s f r (invariants N)" apply (cut_tac b2 d1, metis n_SendInvEVsinv__37) done } moreover { assume d1: "(\<exists> i. i\<le>N\<and>r=n_SendInvS i)" have "invHoldForRule s f r (invariants N)" apply (cut_tac b2 d1, metis n_SendInvSVsinv__37) 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__37) 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__37) 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__37) 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__37) 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__37) 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__37) 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__37) done } ultimately show "invHoldForRule s f r (invariants N)" by satx qed end
#include <viaio/Vlib.h> #include <stdio.h> #include <string.h> #include <math.h> #include <stdlib.h> #include <gsl/gsl_matrix.h> #include <gsl/gsl_vector.h> #include <gsl/gsl_rng.h> #include <gsl/gsl_math.h> #include <gsl/gsl_randist.h> #include <gsl/gsl_combination.h> /* binomial coefficient, n choose k */ double binom (int n,int k) { double prod,ix,nx,kx; int i; nx = (double)n; kx = (double)k; prod = ix = 1; for (i=1; i<=k; i++) { prod *= (nx-kx+ix)/ix; ix++; } return prod; } char **randomCombinations(long maxiter,int n,unsigned long int seed) { size_t iter,i,j,k; size_t znum,maxnum=90000; /* ini random */ fprintf(stderr," random shuffle\n"); gsl_rng_env_setup(); const gsl_rng_type *T = gsl_rng_default; gsl_rng *rx = gsl_rng_alloc(T); gsl_rng_set(rx,(unsigned long int)seed); /* ini data structs */ int *src = (int *) calloc(n,sizeof(int)); char *tmp = (char *)calloc(n,sizeof(char)); for (i=0; i<n; i++) src[i] = i; char **table = (char **)calloc(maxiter,sizeof(char *)); for (i=0; i<maxiter; i++) table[i] = (char *)calloc(n,sizeof(char)); /* generate permutation table */ for (iter=0; iter<maxiter; iter++) { znum = 0; skip: if (znum >= maxnum) VError(" znum %d",znum); k = n/2; if (n%2 == 1 && iter%2 == 0) k++; /* for odd number of images */ gsl_ran_shuffle (rx,src,n,sizeof(int)); memset(tmp,'0',n*sizeof(char)); for (j=0; j<k; j++) tmp[src[j]] = '1'; /* check if already there */ for (j=0; j<iter; j++) { if (memcmp(tmp,table[j],(size_t)n) == 0 && znum < maxnum) { znum++; goto skip; } } memcpy(table[iter],tmp,(size_t)n); } return table; } char **XXrandomCombinations(long maxiter,int n,unsigned long int seed) { size_t iter,i,j; double p=0.5; /* ini random */ gsl_rng_env_setup(); const gsl_rng_type *T = gsl_rng_default; gsl_rng *rx = gsl_rng_alloc(T); gsl_rng_set(rx,(unsigned long int)seed); /* ini data structs */ char *tmp = (char *)calloc(n,sizeof(char)); char **table = (char **)calloc(maxiter,sizeof(char *)); for (i=0; i<maxiter; i++) table[i] = (char *)calloc(n,sizeof(char)); /* generate permutation table */ iter = 0; while (iter < maxiter) { memset(tmp,'0',n*sizeof(char)); int ic=0; for (j=0; j<n; j++) { if (gsl_ran_bernoulli(rx,p) > 0) { tmp[j] = '1'; ic++; } } for (j=0; j<iter; j++) { /* check if already there */ if (memcmp(tmp,table[j],n) == 0) goto skip; } memcpy(table[iter],tmp,(size_t)n); iter++; skip: ; } return table; } char **allCombinations(long maxiter,int n,int iskip) { size_t iter,i,j,num,b; /* ini data structs */ char *tmp = (char *)calloc(n,sizeof(char)); char **table = (char **)calloc(maxiter,sizeof(char *)); for (i=0; i<maxiter; i++) table[i] = (char *)calloc(n,sizeof(char)); size_t xmax = (size_t) gsl_pow_int(2.0,(int)n); iter = 0; for (i=0; i<xmax; i+=iskip) { /* decimal to binary */ memset(tmp,'0',n*sizeof(char)); j=0; num = i; while(num > 0) { b=num%2; if (b == 1) tmp[j] = '1'; num=num/2; j++; } /* fprintf(stderr," iter: %5d %s\n",iter,tmp); */ memcpy(table[iter],tmp,(size_t)n); iter++; if (iter >= maxiter) return table; } return table; }
(* Title: CoreC++ Author: David von Oheimb, Tobias Nipkow, Daniel Wasserrab Maintainer: Daniel Wasserrab <wasserra at fmi.uni-passau.de> *) header {* \isaheader{Auxiliary Definitions} *} theory Auxiliary imports Main "~~/src/HOL/Library/While_Combinator" begin declare option.splits[split] Let_def[simp] subset_insertI2 [simp] Cons_eq_map_conv [iff] (* FIXME move and possibly turn into a general simproc *) lemma nat_add_max_le[simp]: "((n::nat) + max i j \<le> m) = (n + i \<le> m \<and> n + j \<le> m)" by arith lemma Suc_add_max_le[simp]: "(Suc(n + max i j) \<le> m) = (Suc(n + i) \<le> m \<and> Suc(n + j) \<le> m)" by arith notation Some ("(\<lfloor>_\<rfloor>)") lemma butlast_tail: "butlast (Xs@[X,Y]) = Xs@[X]" by (induct Xs) auto lemma butlast_noteq:"Cs \<noteq> [] \<Longrightarrow> butlast Cs \<noteq> Cs" by(induct Cs)simp_all lemma app_hd_tl:"\<lbrakk>Cs \<noteq> []; Cs = Cs' @ tl Cs\<rbrakk> \<Longrightarrow> Cs' = [hd Cs]" apply (subgoal_tac "[hd Cs] @ tl Cs = Cs' @ tl Cs") apply fast apply simp done apply - apply (simp add:append_eq_append_conv2) apply (auto simp:in_set_conv_decomp) apply (subgoal_tac "hd (us @ C'#Ds') = C'") apply (case_tac us) apply simp apply fastforce apply simp apply (subgoal_tac "hd (us @ C'#Ds') = C'") apply (case_tac us) apply simp apply fastforce apply simp apply (subgoal_tac "hd (us @ C'#Cs') = C'") apply (case_tac us) apply simp apply fastforce apply (subgoal_tac "hd(C'#Ds') = C'") apply simp apply (simp (no_asm)) apply (subgoal_tac "hd (us @ C'#Cs') = C'") apply (case_tac us) apply simp apply fastforce apply (subgoal_tac "hd(C'#Ds') = C'") apply simp apply (simp (no_asm)) done definition pick :: "'a set \<Rightarrow> 'a" where "pick A \<equiv> SOME x. x \<in> A" lemma pick_is_element:"x \<in> A \<Longrightarrow> pick A \<in> A" by (unfold pick_def,rule_tac x="x" in someI) definition set2list :: "'a set \<Rightarrow> 'a list" where "set2list A \<equiv> fst (while (\<lambda>(Es,S). S \<noteq> {}) (\<lambda>(Es,S). let x = pick S in (x#Es,S-{x})) ([],A) )" lemma card_pick:"\<lbrakk>finite A; A \<noteq> {}\<rbrakk> \<Longrightarrow> Suc(card(A-{pick(A)})) = card A" by (drule card_Suc_Diff1,auto dest!:pick_is_element simp:ex_in_conv) lemma set2list_prop:"\<lbrakk>finite A; A \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>xs. while (\<lambda>(Es,S). S \<noteq> {}) (\<lambda>(Es,S). let x = pick S in (x#Es,S-{x})) ([],A) = (xs,{}) \<and> (set xs \<union> {} = A)" apply(rule_tac P="(\<lambda>xs. (set(fst xs) \<union> snd xs = A))" and r="measure (card o snd)" in while_rule) apply(auto dest:pick_is_element) apply(auto dest:card_pick simp:ex_in_conv measure_def inv_image_def) done lemma set2list_correct:"\<lbrakk>finite A; A \<noteq> {}; set2list A = xs\<rbrakk> \<Longrightarrow> set xs = A" by (auto dest:set2list_prop simp:set2list_def) section {*@{text distinct_fst}*} definition distinct_fst :: "('a \<times> 'b) list \<Rightarrow> bool" where "distinct_fst \<equiv> distinct \<circ> map fst" lemma distinct_fst_Nil [simp]: "distinct_fst []" apply (unfold distinct_fst_def) apply (simp (no_asm)) done lemma distinct_fst_Cons [simp]: "distinct_fst ((k,x)#kxs) = (distinct_fst kxs \<and> (\<forall>y. (k,y) \<notin> set kxs))" apply (unfold distinct_fst_def) apply (auto simp:image_def) done lemma map_of_SomeI: "\<lbrakk> distinct_fst kxs; (k,x) \<in> set kxs \<rbrakk> \<Longrightarrow> map_of kxs k = Some x" by (induct kxs) (auto simp:fun_upd_apply) section {* Using @{term list_all2} for relations *} definition fun_of :: "('a \<times> 'b) set \<Rightarrow> 'a \<Rightarrow> 'b \<Rightarrow> bool" where "fun_of S \<equiv> \<lambda>x y. (x,y) \<in> S" text {* Convenience lemmas *} declare fun_of_def [simp] lemma rel_list_all2_Cons [iff]: "list_all2 (fun_of S) (x#xs) (y#ys) = ((x,y) \<in> S \<and> list_all2 (fun_of S) xs ys)" by simp lemma rel_list_all2_Cons1: "list_all2 (fun_of S) (x#xs) ys = (\<exists>z zs. ys = z#zs \<and> (x,z) \<in> S \<and> list_all2 (fun_of S) xs zs)" by (cases ys) auto lemma rel_list_all2_Cons2: "list_all2 (fun_of S) xs (y#ys) = (\<exists>z zs. xs = z#zs \<and> (z,y) \<in> S \<and> list_all2 (fun_of S) zs ys)" by (cases xs) auto lemma rel_list_all2_refl: "(\<And>x. (x,x) \<in> S) \<Longrightarrow> list_all2 (fun_of S) xs xs" by (simp add: list_all2_refl) lemma rel_list_all2_antisym: "\<lbrakk> (\<And>x y. \<lbrakk>(x,y) \<in> S; (y,x) \<in> T\<rbrakk> \<Longrightarrow> x = y); list_all2 (fun_of S) xs ys; list_all2 (fun_of T) ys xs \<rbrakk> \<Longrightarrow> xs = ys" by (rule list_all2_antisym) auto lemma rel_list_all2_trans: "\<lbrakk> \<And>a b c. \<lbrakk>(a,b) \<in> R; (b,c) \<in> S\<rbrakk> \<Longrightarrow> (a,c) \<in> T; list_all2 (fun_of R) as bs; list_all2 (fun_of S) bs cs\<rbrakk> \<Longrightarrow> list_all2 (fun_of T) as cs" by (rule list_all2_trans) auto lemma rel_list_all2_update_cong: "\<lbrakk> i<size xs; list_all2 (fun_of S) xs ys; (x,y) \<in> S \<rbrakk> \<Longrightarrow> list_all2 (fun_of S) (xs[i:=x]) (ys[i:=y])" by (simp add: list_all2_update_cong) lemma rel_list_all2_nthD: "\<lbrakk> list_all2 (fun_of S) xs ys; p < size xs \<rbrakk> \<Longrightarrow> (xs!p,ys!p) \<in> S" by (drule list_all2_nthD) auto lemma rel_list_all2I: "\<lbrakk> length a = length b; \<And>n. n < length a \<Longrightarrow> (a!n,b!n) \<in> S \<rbrakk> \<Longrightarrow> list_all2 (fun_of S) a b" by (erule list_all2_all_nthI) simp declare fun_of_def [simp del] end
cat("Hello world!\n") # or message("Hello world!") # or print("Hello world!")
import .NN .misc system.io variables {α : Type} [has_mul α] [add_comm_monoid α] [has_le α] variables {k m n : nat} structure LP (α : Type) (m n : nat) := (obf : N α) (lhs : NN α) (rhs : N α) def LP.feasible : LP α m n → N α → Prop | ⟨c, A, b⟩ x := N.le m (mul_vec n A x) b ∧ (N.le n (N.zero α) x) def LP.is_feasible (P : LP α m n) : Prop := ∃ x : N α, P.feasible x instance LP.feasible.decidable [decidable_rel ((≤) : α → α → Prop)] (P : LP α m n) (x : N α) : decidable (P.feasible x) := by {cases P, unfold LP.feasible, apply_instance } open tactic meta def Nx.repr (vx : expr) : nat → tactic string | 0 := return "" | (k + 1) := do vs ← Nx.repr k, a ← to_expr ``(%%vx %%`(k)) >>= eval_expr rat, return $ string.join [vs, " ", a.repr] meta def NNx.repr_aux (Ax : expr) : nat → nat → tactic string | 0 n := return "" | (m + 1) n := do vs ← NNx.repr_aux m n, a ← to_expr ``(%%Ax %%`(m) %%`(n)) >>= eval_expr rat, return $ string.join [vs, " ", a.repr] meta def NNx.repr (Ax : expr) (m : nat) : nat → tactic string | 0 := return "" | 1 := NNx.repr_aux Ax m 0 | (n + 1) := do As ← NNx.repr n, vs ← NNx.repr_aux Ax m n, return $ string.join [As, "\n", vs] meta def put_LP : tactic (string × string × string) := do `(LP.is_feasible %%lp) ← target, `(⟨%%cx, %%Ax, %%bx⟩ : LP _ _ _) ← pure lp, `(LP _ %%mx %%nx) ← infer_type lp, m ← eval_expr nat mx, n ← eval_expr nat nx, cs ← Nx.repr cx n, As ← NNx.repr Ax m n, bs ← Nx.repr bx m, return ⟨cs, As, bs⟩ open tactic -- meta instance int.has_reflect : has_reflect ℤ := by tactic.mk_has_reflect_instance meta def rat.has_reflect' : Π x : ℚ, Σ y : ℚ, Σ' h : x = y, reflected y | ⟨x,y,h,h'⟩ := ⟨rat.mk_nat x y, by { rw [rat.num_denom',rat.mk_nat_eq] } , `(_)⟩ -- meta instance : has_reflect ℚ -- | x := -- match rat.has_reflect' x with -- | ⟨ ._, rfl, h ⟩ := h -- end meta def cvxopt_lp (cs As bs : string) : tactic string := unsafe_run_io $ do cwd ← io.env.get_cwd, io.cmd { cmd := "python3", args := ["src/lp.py", cs, As, bs], cwd := cwd } open parser def digits : list char := [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' ] def parser_digits : parser string := many_char (one_of digits) def parser_sign : parser bool := (ch '+' >> return tt) <|> (ch '-' >> return ff) <|> (return tt) def parser_dnat : parser string := do d ← one_of digits, ch '.', ds ← parser_digits, return ⟨d::ds.data⟩ def drop_zeroes : string → string := string.drop_chars '0' def drop_trailing_nl (s : string) : string := (s.reverse.drop_chars '\n').reverse def parser_mantissa : parser rat := do b ← parser_sign, ds ← parser_dnat, let i := int.of_nat (drop_zeroes ds).to_nat, let numer : int := if b then i else -i, let denom : ℕ := 10 ^ ds.length.pred, return (rat.mk_nat numer denom) def parser_magnitude : parser rat := do b ← parser_sign, ds ← parser_digits, let m : ℕ := 10 ^ (drop_zeroes ds).to_nat, return (if b then (rat.mk_nat m 1) else (rat.mk_nat 1 m)) def parser_scinot : parser rat := do r ← parser_mantissa, ch 'e', s ← parser_magnitude, return (r * s) def ws : parser unit := many' (ch ' ') def parser_entry : parser rat := ch '[' *> ws *> parser_scinot <* ws <* ch ']' def parser_vector : parser (list rat) := sep_by (ch '\n') parser_entry meta def LP.show_is_feasible : tactic unit := do ⟨cs, As, bs⟩ ← put_LP, vs ← cvxopt_lp cs As bs, match run_string parser_vector (drop_trailing_nl vs) with | (sum.inl _) := fail "Cannot parse vector" | (sum.inr rs) := do vx ← to_expr ``(@N.of_list rat _ %%`(rs)), existsi vx, exact_dec_trivial end def ex_c : N rat := N.of_list [2, 1] def ex_A : NN rat := NN.of_lists rat [[-1, 1], [-1, -1], [0, -1], [1, -2]] def ex_b : N rat := N.of_list [1, -2, 0, 4] example : LP.is_feasible (⟨ex_c, ex_A, ex_b⟩ : LP _ 4 2) := by LP.show_is_feasible
= = May 1794 = =
So, without further a do, here are this year’s highlights and some behind the scenes from weddings, fashion shoots and trips! When Kelsey, one of my second shooters, catches me off guard shoving yummy wedding cake in my mouth. LOL. 2019 couple! New York City engagement session! Caught me, again, Kelsey! LOL! Loved meeting and working with Hunter Premo from Nashville during Memphis Fashion Week!! Second home: New York City. Red Rock Canyon was breathtaking. Wish we had spent more time there! Editing & traveling. The hustle is real. The three traveling musketeers! Oh how I love these two! Christmas at Graceland Hallmark movie screening in Memphis with Collins, Megan and Laura!
import .src_04_theorems variables p q r : Prop namespace mth1001 section if_and_only_if /- The symbol `↔`, written `\iff` is read 'if and only if'. From `p ↔ q`, one can deduce `p → q` and `p → q`. Likewise, from `p → q` and `q → p`, one can deduce `p ↔ q`. Given propositions `p` and `q`, if `p ↔ q`, we say that `p` is _equivalent_ to `q`. -/ -- Here is a term-style derivation of `p ↔ q` from `h₁ : p → q` and `h₂ : q → p`. example (h₁ : p → q) (h₂ : q → p) : p ↔ q := iff.intro h₁ h₂ /- Equally, we can use the `split` tactic to decompose the goal `p ↔ q` into two goals: one to prove `p → q` and the other to prove `q → p`. -/ example (h₁ : p → q) (h₂ : q → p) : p ↔ q := begin split, { exact h₁, }, { exact h₂, }, end -- Exercise 033: -- We combine the previous results `and_assoc` and `and_assoc2`. theorem and_assoc : (p ∧ q) ∧ r ↔ p ∧ (q ∧ r) := begin split, { sorry}, { sorry, }, end /- Below is a tactic mode proof of `p → q` from `h : p ↔ q`. Note how `cases` is used to decompose the premise `h` into two new premises, `hpq : p → q` and `hqp : q → p`. -/ example (h : p ↔ q) : p → q := begin cases h with hpq hqp, exact hpq, end -- Exercise 034: example (h : p ↔ q) : q → p := begin sorry end /- Alternatively, we can give a term-style proof. If `h : p ↔ q`, then `h.mp` is a proof of `p → q` and `h.mpr` is a proof of `q → p`. Here `mp` is an abbreviation of 'modus ponens', the Latin name for implication elimination. -/ example (h : p ↔ q) : p → q := h.mp example (h : p ↔ q) : q → p := h.mpr -- Exercise 035: -- We prove `p ∧ q ↔ q ∧ p` using the theorem `and_of_and` from the previous section. theorem and_iff_and : p ∧ q ↔ q ∧ p := begin split, { exact and_of_and p q }, { sorry, }, end end if_and_only_if /- SUMMARY: * Iff introduction. * Term-style introduction using `iff.intro`. * Tactic-style introduction using `split`. * Iff elimination. * Tactic-style elimination using `cases`. * Term-style elimination using `.mp` or `.mpr`. -/ end mth1001
%% retraction of d in T_X(M_r) onto M_r % X=U*diag(S)*V' % d=U*M*V'+U_p*V'+U*V_p' % cf. [Van12] function [S1,U1,V1]=rtr_fr(d,S,U,V) n1=size(U,1); n2=size(V,1); n3=size(S,1); sig=0; if size(S,2)>1, S=diag(S); sig=1; end eps=1e-3; % Pu=U*U'; Pv=V*V'; M=U'*d*V; % U_p=d*V-Pu*d*V; V_p=d'*U-Pv*d'*U; U_p=d*V-U*M; V_p=d'*U-V*M'; [Q_u,R_u]=qr(U_p,0); [Q_v,R_v]=qr(V_p,0); M1=[diag(S)+M, R_v'; R_u, zeros(n3)]; [U1,S1,V1]=svd(M1); S1=diag(S1); S1=S1(1:n3); U1=[U,Q_u]*U1(:,1:n3); V1=[V,Q_v]*V1(:,1:n3); S1=max(S1,eps); if sig==1, S1=diag(S1); end
-- @@stderr -- dtrace: failed to compile script test/unittest/preprocessor/err.D_SYNTAX.withoutpound.d: [D_SYNTAX] line 17: expected predicate and/or actions following probe description
The Catskill Mountains of southeastern New York are several hours northwest of New York City, west of the Hudson River and roughly cover four counties. Considered the frontier in Colonial days, the area was dubbed the "Borscht Belt" or "Jewish Alps" in the mid-20th century for the hotels, resorts, camps and cottage colonies favored by New York City Jews escaping from the city's heat in the summer. With mountains, cool lakes, numerous streams and rivers and small towns scattered among the forests and farmlands, the area is rich in natural beauty, culture and history. The Catskills have lodging options ranging from country inns to chain hotels, cabins and campgrounds. April 1 is the opening of fishing season in many areas of the Catskills, and Roscoe, in Sulllivan County, is billed the "Fly Fishing Capital of the World." The Upper Beaverkill River meets the Willowemoc River in Roscoe, and the stretch of river between Roscoe and nearby Livingston Manor is open to the public. Just off Route 17 between the two towns, visit the Catskill Fly Fishing Center and Museum for exhibits and programs related to the sport. On Memorial Day weekend, head to the Woodstock-New Paltz Arts and Crafts Fair at the Ulster County Fairgrounds for arts, crafts, music, food and wine. Running for more than 30 years, the fair has been voted one of America's best by "Sunshine Artist" magazine. Late May is also the time to head to Tannersville in Greene County for the Rubber Duck and Crazy Boat Races and Festival. Watch as hundreds of rubber ducks are released or build your own boat for the boat race; the festival also has crafts, music and food. Visit Bethel in Sullivan County in the summer to enjoy classical, jazz, rock and country music concerts at Bethel Woods Center for the Arts. Built on the site of the 1969 Woodstock Concert, Bethel Woods offers acres of landscaped grounds, with a monument listing the performers at Woodstock at one corner of the property. The museum focuses not only on the history of the famous concert but also on significant events of the 1960s, including the Civil Rights Movement and the Space Race. Just down the road in Monticello, the Monticello Raceway and Casino, or "racino," offers both thoroughbred harness racing and a casino where you can try your luck at the slot machines or table games. Head to Greene County's Windham Mountain for the Fourth of July celebration, where you'll find a parade, a barbecue, music and a fireworks display. The mountain resort offers hiking, biking and horseback riding. Fall, particularly early to mid-October, is the time for leisurely drives to take in the glory of the autumnal display of color anywhere in the heavily treed Catskills. Book a weekend at a resort such as the Villa Roma Resort and Conference Center in Callicoon, which offers golf, tennis, pools and an arcade room, or explore the Legend of Sleepy Hollow at the Washington Irving Inn in Hunter, a bed and breakfast with themed rooms and cottages. Hunter Mountain hosts an annual Oktoberfest on two weekends in October with music, crafts and food. Hunting is a popular fall activity in the Catskills. Check the Department of Environmental Conservation website (dec.ny.gov) for dates and license requirements for bow and firearm hunting of deer, turkey, bear, bobcat, waterfowl and small game. You'll need permission to hunt on private property, but some public lands are open to hunting as well. Check with the local Department of Environmental Conservation or a New York Forest Ranger for maps and required permissions for public areas. The long, snowy winters in the Catskills make it a destination for winter sports. Top ski resorts in the Catskills include Windham Mountain in Windham, Hunter Mountain in Hunter, Plattekill in Roxbury and Belleayre Mountain in Highmount, although many smaller venues also operate. Delaware County offers two ice festivals, the Winter Festival at the Walton Fairgrounds in Walton, with an ice-carving competition, ice skating, snowmobile races and local food vendors; and the Ice Harvest at Hanford Mills Museum in East Meredith, with demonstrations of ice fishing and the cutting and harvesting of ice, horse-drawn sleigh rides and plenty of warm soups and hot apple cider. For an unusual holiday experience, look for a performance by Bells and Motley, a couple who play medieval and Renaissance instruments, sing, dance and celebrate at libraries and other venues throughout the area. Cap off your winter holiday with a visit to one of the area's many tree farms, where you can pick out your own Christmas tree and have it cut for you on the spot.
module IJuliaCore using JSON using Printf import Base64 include("packagedef.jl") end
[STATEMENT] lemma sparsegrid_subset[intro]: "p \<in> sparsegrid dm lm \<Longrightarrow> p \<in> sparsegrid' dm" [PROOF STATE] proof (prove) goal (1 subgoal): 1. p \<in> sparsegrid dm lm \<Longrightarrow> p \<in> sparsegrid' dm [PROOF STEP] unfolding sparsegrid_def sparsegrid'_def lgrid_def [PROOF STATE] proof (prove) goal (1 subgoal): 1. p \<in> {p \<in> grid (start dm) {0..<dm}. level p < lm} \<Longrightarrow> p \<in> grid (start dm) {0..<dm} [PROOF STEP] by auto
% test for texture synthesis path(path, 'images/'); path(path, '../images/'); name = 'grass'; name = 'turbulence1'; name = 'fingerprint3'; name = 'dunes'; n = 128; M = load_image(name, n); M = crop(M,n); s = size(M,3); n1 = 128; M1 = randn(n1,n1,s); options.niter_synthesis = 5; options.verb = 1; disp('--> Steerable synthesis.'); options.synthesis_method = 'steerable'; Msteer = perform_wavelet_matching(M1,M,options); disp('--> Wavelet orthogonal synthesis.'); options.synthesis_method = 'wavelets-ortho'; Morth = perform_wavelet_matching(M1,M,options); disp('--> Quincunx synthesis.'); options.synthesis_method = 'quincunx-ti'; Mquin = perform_wavelet_matching(M1,M,options); disp('--> Wavelets TI synthesis.'); options.synthesis_method = 'wavelets-ti'; Mwavti = perform_wavelet_matching(M1,M,options); clf; imageplot({M Msteer Morth Mquin Mwavti},{'Original', 'Synth. steerable', 'Synth. wav. ortho', 'Synth. quincunx', 'Synth. wav. ti'});
DOUBLE PRECISION FUNCTION slDSEPV (V1, V2) *+ * - - - - - - * D S E P V * - - - - - - * * Angle between two vectors. * * (double precision) * * Given: * V1 d(3) first vector * V2 d(3) second vector * * The result is the angle, in radians, between the two vectors. It * is always positive. * * Notes: * * 1 There is no requirement for the vectors to be unit length. * * 2 If either vector is null, zero is returned. * * 3 The simplest formulation would use dot product alone. However, * this would reduce the accuracy for angles near zero and pi. The * algorithm uses both cross product and dot product, which maintains * accuracy for all sizes of angle. * * Called: slDVXV, slDVN, slDVDV * * Last revision: 14 June 2005 * * Copyright P.T.Wallace. All rights reserved. * * License: * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program (see SLA_CONDITIONS); if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA * * Copyright (C) 1995 Association of Universities for Research in Astronomy Inc. *- IMPLICIT NONE DOUBLE PRECISION V1(3),V2(3) DOUBLE PRECISION V1XV2(3),WV(3),S,C DOUBLE PRECISION slDVDV * Modulus of cross product = sine multiplied by the two moduli. CALL slDVXV(V1,V2,V1XV2) CALL slDVN(V1XV2,WV,S) * Dot product = cosine multiplied by the two moduli. C = slDVDV(V1,V2) * Angle between the vectors. IF ( S.NE.0D0 .OR. C.NE.0D0 ) THEN slDSEPV = ATAN2(S,C) ELSE slDSEPV = 0D0 END IF END
Formal statement is: lemma closed_Collect_le: fixes f g :: "'a :: topological_space \<Rightarrow> 'b::linorder_topology" assumes f: "continuous_on UNIV f" and g: "continuous_on UNIV g" shows "closed {x. f x \<le> g x}" Informal statement is: The set of points $x$ such that $f(x) \leq g(x)$ is closed.
/- Copyright (c) 2022 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ import category_theory.limits.shapes.regular_mono import category_theory.limits.shapes.zero_morphisms /-! # Categories where inclusions into coproducts are monomorphisms > THIS FILE IS SYNCHRONIZED WITH MATHLIB4. > Any changes to this file require a corresponding PR to mathlib4. If `C` is a category, the class `mono_coprod C` expresses that left inclusions `A ⟶ A ⨿ B` are monomorphisms when `has_coproduct A B` is satisfied. If it is so, it is shown that right inclusions are also monomorphisms. TODO @joelriou: show that if `X : I → C` and `ι : J → I` is an injective map, then the canonical morphism `∐ (X ∘ ι) ⟶ ∐ X` is a monomorphism. TODO: define distributive categories, and show that they satisfy `mono_coprod`, see <https://ncatlab.org/toddtrimble/published/distributivity+implies+monicity+of+coproduct+inclusions> -/ noncomputable theory open category_theory category_theory.category category_theory.limits universe u namespace category_theory namespace limits variables (C : Type*) [category C] /-- This condition expresses that inclusion morphisms into coproducts are monomorphisms. -/ class mono_coprod : Prop := (binary_cofan_inl : ∀ ⦃A B : C⦄ (c : binary_cofan A B) (hc : is_colimit c), mono c.inl) variable {C} @[priority 100] instance mono_coprod_of_has_zero_morphisms [has_zero_morphisms C] : mono_coprod C := ⟨λ A B c hc, begin haveI : is_split_mono c.inl := is_split_mono.mk' (split_mono.mk (hc.desc (binary_cofan.mk (𝟙 A) 0)) (is_colimit.fac _ _ _)), apply_instance, end⟩ namespace mono_coprod instance {A B : C} [mono_coprod C] [has_binary_coproduct A B] : mono (coprod.inl : A ⟶ A ⨿ B) := binary_cofan_inl _ (colimit.is_colimit _) instance {A B : C} [mono_coprod C] [has_binary_coproduct A B] : mono (coprod.inr : B ⟶ A ⨿ B) := binary_cofan_inr _ (colimit.is_colimit _) lemma mono_inl_iff {A B : C} {c₁ c₂ : binary_cofan A B} (hc₁ : is_colimit c₁) (hc₂ : is_colimit c₂) : mono c₁.inl ↔ mono c₂.inl := begin suffices : ∀ (c₁ c₂ : binary_cofan A B) (hc₁ : is_colimit c₁) (hc₂ : is_colimit c₂) (h : mono c₁.inl), mono c₂.inl, { exact ⟨λ h₁, this _ _ hc₁ hc₂ h₁, λ h₂, this _ _ hc₂ hc₁ h₂⟩, }, intros c₁ c₂ hc₁ hc₂, introI, simpa only [is_colimit.comp_cocone_point_unique_up_to_iso_hom] using mono_comp c₁.inl (hc₁.cocone_point_unique_up_to_iso hc₂).hom, end lemma mk' (h : ∀ (A B : C), ∃ (c : binary_cofan A B) (hc : is_colimit c), mono c.inl) : mono_coprod C := ⟨λ A B c' hc', begin obtain ⟨c, hc₁, hc₂⟩ := h A B, simpa only [mono_inl_iff hc' hc₁] using hc₂, end⟩ instance mono_coprod_type : mono_coprod (Type u) := mono_coprod.mk' (λ A B, begin refine ⟨binary_cofan.mk (sum.inl : A ⟶ A ⊕ B) sum.inr, _, _⟩, { refine binary_cofan.is_colimit.mk _ (λ Y f₁ f₂ x, by { cases x, exacts [f₁ x, f₂ x], }) (λ Y f₁ f₂, rfl) (λ Y f₁ f₂, rfl) _, intros Y f₁ f₂ m h₁ h₂, ext x, cases x, { dsimp, exact congr_fun h₁ x, }, { dsimp, exact congr_fun h₂ x, }, }, { rw mono_iff_injective, intros a₁ a₂ h, simp only [binary_cofan.mk_inl] at h, dsimp at h, simpa only using h, }, end) end mono_coprod end limits end category_theory
State Before: α : Type u_1 inst✝ : Preorder α l : Ordnode α x : α r : Ordnode α o₁ : WithBot α o₂ : WithTop α hl : Valid' o₁ l ↑x hr : Valid' (↑x) r o₂ H1 : ¬size l + size r ≤ 1 H2 : delta * size r < size l H3 : 2 * size l ≤ 9 * size r + 5 ∨ size l ≤ 3 ⊢ Valid' o₁ (Ordnode.rotateR l x r) o₂ State After: α : Type u_1 inst✝ : Preorder α l : Ordnode α x : α r : Ordnode α o₁ : WithBot α o₂ : WithTop α hl : Valid' o₁ l ↑x hr : Valid' (↑x) r o₂ H1 : ¬size l + size r ≤ 1 H2 : delta * size r < size l H3 : 2 * size l ≤ 9 * size r + 5 ∨ size l ≤ 3 ⊢ Valid' o₂ (Ordnode.dual (Ordnode.rotateR l x r)) o₁ Tactic: refine' Valid'.dual_iff.2 _ State Before: α : Type u_1 inst✝ : Preorder α l : Ordnode α x : α r : Ordnode α o₁ : WithBot α o₂ : WithTop α hl : Valid' o₁ l ↑x hr : Valid' (↑x) r o₂ H1 : ¬size l + size r ≤ 1 H2 : delta * size r < size l H3 : 2 * size l ≤ 9 * size r + 5 ∨ size l ≤ 3 ⊢ Valid' o₂ (Ordnode.dual (Ordnode.rotateR l x r)) o₁ State After: α : Type u_1 inst✝ : Preorder α l : Ordnode α x : α r : Ordnode α o₁ : WithBot α o₂ : WithTop α hl : Valid' o₁ l ↑x hr : Valid' (↑x) r o₂ H1 : ¬size l + size r ≤ 1 H2 : delta * size r < size l H3 : 2 * size l ≤ 9 * size r + 5 ∨ size l ≤ 3 ⊢ Valid' o₂ (Ordnode.rotateL (Ordnode.dual r) x (Ordnode.dual l)) o₁ Tactic: rw [dual_rotateR] State Before: α : Type u_1 inst✝ : Preorder α l : Ordnode α x : α r : Ordnode α o₁ : WithBot α o₂ : WithTop α hl : Valid' o₁ l ↑x hr : Valid' (↑x) r o₂ H1 : ¬size l + size r ≤ 1 H2 : delta * size r < size l H3 : 2 * size l ≤ 9 * size r + 5 ∨ size l ≤ 3 ⊢ Valid' o₂ (Ordnode.rotateL (Ordnode.dual r) x (Ordnode.dual l)) o₁ State After: case refine'_1 α : Type u_1 inst✝ : Preorder α l : Ordnode α x : α r : Ordnode α o₁ : WithBot α o₂ : WithTop α hl : Valid' o₁ l ↑x hr : Valid' (↑x) r o₂ H1 : ¬size l + size r ≤ 1 H2 : delta * size r < size l H3 : 2 * size l ≤ 9 * size r + 5 ∨ size l ≤ 3 ⊢ ¬size (Ordnode.dual r) + size (Ordnode.dual l) ≤ 1 case refine'_2 α : Type u_1 inst✝ : Preorder α l : Ordnode α x : α r : Ordnode α o₁ : WithBot α o₂ : WithTop α hl : Valid' o₁ l ↑x hr : Valid' (↑x) r o₂ H1 : ¬size l + size r ≤ 1 H2 : delta * size r < size l H3 : 2 * size l ≤ 9 * size r + 5 ∨ size l ≤ 3 ⊢ delta * size (Ordnode.dual r) < size (Ordnode.dual l) case refine'_3 α : Type u_1 inst✝ : Preorder α l : Ordnode α x : α r : Ordnode α o₁ : WithBot α o₂ : WithTop α hl : Valid' o₁ l ↑x hr : Valid' (↑x) r o₂ H1 : ¬size l + size r ≤ 1 H2 : delta * size r < size l H3 : 2 * size l ≤ 9 * size r + 5 ∨ size l ≤ 3 ⊢ 2 * size (Ordnode.dual l) ≤ 9 * size (Ordnode.dual r) + 5 ∨ size (Ordnode.dual l) ≤ 3 Tactic: refine' hr.dual.rotateL hl.dual _ _ _ State Before: case refine'_1 α : Type u_1 inst✝ : Preorder α l : Ordnode α x : α r : Ordnode α o₁ : WithBot α o₂ : WithTop α hl : Valid' o₁ l ↑x hr : Valid' (↑x) r o₂ H1 : ¬size l + size r ≤ 1 H2 : delta * size r < size l H3 : 2 * size l ≤ 9 * size r + 5 ∨ size l ≤ 3 ⊢ ¬size (Ordnode.dual r) + size (Ordnode.dual l) ≤ 1 State After: no goals Tactic: rwa [size_dual, size_dual, add_comm] State Before: case refine'_2 α : Type u_1 inst✝ : Preorder α l : Ordnode α x : α r : Ordnode α o₁ : WithBot α o₂ : WithTop α hl : Valid' o₁ l ↑x hr : Valid' (↑x) r o₂ H1 : ¬size l + size r ≤ 1 H2 : delta * size r < size l H3 : 2 * size l ≤ 9 * size r + 5 ∨ size l ≤ 3 ⊢ delta * size (Ordnode.dual r) < size (Ordnode.dual l) State After: no goals Tactic: rwa [size_dual, size_dual] State Before: case refine'_3 α : Type u_1 inst✝ : Preorder α l : Ordnode α x : α r : Ordnode α o₁ : WithBot α o₂ : WithTop α hl : Valid' o₁ l ↑x hr : Valid' (↑x) r o₂ H1 : ¬size l + size r ≤ 1 H2 : delta * size r < size l H3 : 2 * size l ≤ 9 * size r + 5 ∨ size l ≤ 3 ⊢ 2 * size (Ordnode.dual l) ≤ 9 * size (Ordnode.dual r) + 5 ∨ size (Ordnode.dual l) ≤ 3 State After: no goals Tactic: rwa [size_dual, size_dual]
If $x$ is an algebraic integer, then so is $\lvert x \rvert$.
Tetsurō Tamba as Tiger Tanaka : Head of Japanese secret service .
[STATEMENT] lemma rell_G_mono: "\<lbrakk> L1 \<le> L1'; L2 \<le> L2' \<rbrakk> \<Longrightarrow> rell_G L1 L2 \<le> rell_G L1' L2'" [PROOF STATE] proof (prove) goal (1 subgoal): 1. \<lbrakk>L1 \<le> L1'; L2 \<le> L2'\<rbrakk> \<Longrightarrow> rell_G L1 L2 \<le> rell_G L1' L2' [PROOF STEP] unfolding rell_G_def [PROOF STATE] proof (prove) goal (1 subgoal): 1. \<lbrakk>L1 \<le> L1'; L2 \<le> L2'\<rbrakk> \<Longrightarrow> rel_G L1 L2 (=) (=) (=) (=) \<le> rel_G L1' L2' (=) (=) (=) (=) [PROOF STEP] by (rule rel_G_mono) (auto)
lemma scaleR_left_mono_neg: "b \<le> a \<Longrightarrow> c \<le> 0 \<Longrightarrow> c *\<^sub>R a \<le> c *\<^sub>R b" for a b :: "'a::ordered_real_vector"
lemma residue_holo: assumes "open s" "z \<in> s" and f_holo: "f holomorphic_on s" shows "residue f z = 0"
using MUMPSjInv using Test include("getDivGrad.jl") A = getDivGrad(32, 32, 16) n = size(A, 1) # REAL: test for single rhs println("Test for real SPD matrix: one sparse random rhs") rhs = sprandn(n, 1, 0.05) x = solveMUMPS(A, rhs, 1) err = norm(A * x - rhs) / norm(rhs) @test err < 1e-14 # rhs as sparse vector instead of n X 1 sparse matrix rhs = SparseVector(rhs) x = solveMUMPS(A, rhs, 1) err = norm(A * x - rhs) / norm(rhs) @test err < 1e-14 # REAL: test for multiple rhs println("Test for real SPD matrix: multiple sparse random rhs") nrhs = 10 rhs = sprandn(n, nrhs, 0.03) x = solveMUMPS(A, rhs, 1) err = zeros(nrhs) for i = 1:nrhs err[i] = norm(A * x[:, i] - rhs[:, i]) / norm(rhs[:, i]) end @test eltype(x) == Float64 @test maximum(err) < 1e-14 println("Test for real SPD matrix: multiple sparse delta function rhs") rhs = sparse(1.0I, n, n) rhs = rhs[:, 1:nrhs] x = solveMUMPS(A, rhs, 1) err = zeros(nrhs) for i = 1:nrhs err[i] = norm(A * x[:, i] - rhs[:, i]) / norm(rhs[:, i]) end @test eltype(x) == Float64 @test maximum(err) < 1e-14 # COMPLEX: test for one rhs println("Test for complex SPD matrix: one rhs") r = rand(n) A = A + im*spdiagm(0 => r) rhs = sprandn(n, 1, 0.03) + im*sprandn(n, 1, 0.03) x = solveMUMPS(A, rhs, 2) err = norm(A * x - rhs) / norm(rhs) @test eltype(x) == ComplexF64 @test err < 1e-14 # sparse vector rhs rhs = SparseVector(sprandn(n, 1, 0.03) + im*sprandn(n, 1, 0.03)) x = solveMUMPS(A, rhs, 2) err = norm(A * x - rhs) / norm(rhs) @test eltype(x) == ComplexF64 @test err < 1e-14 # COMPLEX : test for multiple rhs println("Test for complex SPD matrix: multiple sparse random rhs") nrhs = 10 rhs = sprandn(n, nrhs, 0.03) + im * sprandn(n, nrhs, 0.03) x = solveMUMPS(A, rhs, 2) err = zeros(nrhs) for i = 1:nrhs err[i] = norm(A * x[:, i] - rhs[:, i]) / norm(rhs[:, i]) end @test eltype(x) == ComplexF64 @test maximum(err) < 1e-14
Formal statement is: lemma closed_open: "closed S \<longleftrightarrow> open (- S)" Informal statement is: A set $S$ is closed if and only if its complement $-S$ is open.
theory T13 imports Main begin lemma "( (\<forall> x::nat. \<forall> y::nat. meet(x, y) = meet(y, x)) & (\<forall> x::nat. \<forall> y::nat. join(x, y) = join(y, x)) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. meet(x, meet(y, z)) = meet(meet(x, y), z)) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. join(x, join(y, z)) = join(join(x, y), z)) & (\<forall> x::nat. \<forall> y::nat. meet(x, join(x, y)) = x) & (\<forall> x::nat. \<forall> y::nat. join(x, meet(x, y)) = x) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. mult(x, join(y, z)) = join(mult(x, y), mult(x, z))) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. mult(join(x, y), z) = join(mult(x, z), mult(y, z))) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. meet(x, over(join(mult(x, y), z), y)) = x) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. meet(y, undr(x, join(mult(x, y), z))) = y) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. join(mult(over(x, y), y), x) = x) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. join(mult(y, undr(y, x)), x) = x) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. over(join(x, y), z) = join(over(x, z), over(y, z))) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. undr(meet(x, y), z) = join(undr(x, z), undr(y, z))) & (\<forall> x::nat. \<forall> y::nat. invo(join(x, y)) = meet(invo(x), invo(y))) & (\<forall> x::nat. \<forall> y::nat. invo(meet(x, y)) = join(invo(x), invo(y))) & (\<forall> x::nat. invo(invo(x)) = x) ) \<longrightarrow> (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. mult(x, meet(y, z)) = meet(mult(x, y), mult(x, z))) " nitpick[card nat=4,timeout=86400] oops end
M @-@ 122 was a state trunkline highway in the US state of Michigan entirely in the city of St. Ignace . The highway connected US Highway 2 ( US 2 ) to the State Highway Ferry Dock used before the Mackinac Bridge was built . It was retired and the road returned to local control in 1957 .
data_main = readRDS("data/river_queries/clean_senti_polatiry.rds") data_main_1 = data_main[1:488728, ] data_main_2 = data_main[488729:977457, ] data_main_3 = data_main[977458:1466186, ] data_main_4 = data_main[1466187:1954915, ] data_main_5 = data_main[1954916:2443644, ] data_main_6 = data_main[2443645:2932373, ] data_main_7 = data_main[2932374:3421102, ] data_main_8 = data_main[3421103:3909824, ] rm(data_main) # parse text into a single text df parsedtxt_1 = spacy_extract_nounphrases( data_main_1$clean_tweet, output = c("data.frame"), multithread = TRUE ) rm(data_main_1) # parse text into a single text df parsedtxt_2 = spacy_extract_nounphrases( data_main_2$clean_tweet, output = c("data.frame"), multithread = TRUE ) rm(data_main_2) # parse text into a single text df parsedtxt_3 = spacy_extract_nounphrases( data_main_3$clean_tweet, output = c("data.frame"), multithread = TRUE) rm(data_main_3) # parse text into a single text df parsedtxt_4 = spacy_extract_nounphrases( data_main_4$clean_tweet, output = c("data.frame"), multithread = TRUE) rm(data_main_4) # parse text into a single text df parsedtxt_5 = spacy_extract_nounphrases( data_main_5$clean_tweet, output = c("data.frame"), multithread = TRUE ) rm(data_main_5) # parse text into a single text df parsedtxt_6 = spacy_extract_nounphrases( data_main_6$clean_tweet, output = c("data.frame"), multithread = TRUE ) rm(data_main_6) # parse text into a single text df parsedtxt_7 = spacy_extract_nounphrases( data_main_7$clean_tweet, output = c("data.frame"), multithread = TRUE ) rm(data_main_7) # parse text into a single text df parsedtxt_8 = spacy_extract_nounphrases( data_main_8$clean_tweet, output = c("data.frame"), multithread = TRUE ) rm(data_main_8) pp = rbind( parsedtxt_1, parsedtxt_2, parsedtxt_3, parsedtxt_4, parsedtxt_5, parsedtxt_6, parsedtxt_7, parsedtxt_8 ) saveRDS(pp,"data/web/pp.RDS") nounphrase = readRDS("data/web/pp.RDS") nounphrase_sub = nounphrase %>% filter(length > 2) %>% select(text) %>% mutate(text = str_remove_all(text, regex(" ?(f&ht)(tp)(s?)(://)(.*)[.&/](.*)"))) %>% mutate(text = str_remove_all(text, regex("@[[:alnum:]_]{4,}"))) %>% mutate(text = str_remove_all(text, regex("#[[:alnum:]_]+"))) %>% mutate(text = str_remove_all(text, regex("[[:punct:]]"))) %>% mutate(text = str_remove_all(text, regex("^RT:? "))) %>% mutate(text = str_replace(text, "amp", "and")) %>% anti_join(stop_words, by = c("text" = "word")) %>% mutate(text = str_to_lower(text)) %>% # Remove any trailing whitespace around the text mutate(text = str_trim(text, "both")) %>% count(text) %>% arrange(desc(n)) nounphrase_sub = nounphrase_sub[-15,] wordcloud2(nounphrase_sub,shape = "square")
lemma bounded_minus: fixes S ::"'a::real_normed_vector set" assumes "bounded S" "bounded T" shows "bounded ((\<lambda>(x,y). x - y) ` (S \<times> T))"
[STATEMENT] lemma union_mono_aux: "A \<subseteq> B \<Longrightarrow> A \<union> C \<subseteq> B \<union> C" [PROOF STATE] proof (prove) goal (1 subgoal): 1. A \<subseteq> B \<Longrightarrow> A \<union> C \<subseteq> B \<union> C [PROOF STEP] by blast
module JS.Boolean import JS.Marshall import JS.Inheritance import JS.Util export data Boolean : Type where [external] export %foreign "javascript:lambda:()=>true" true : Boolean export %foreign "javascript:lambda:()=>false" false : Boolean export ToFFI Bool Boolean where toFFI True = true toFFI False = false export FromFFI Bool Boolean where fromFFI v = if eqv v true then Just True else if eqv v false then Just False else Nothing export SafeCast Boolean where safeCast = unsafeCastOnTypeof "boolean"
[STATEMENT] lemma list_sel_reasonable: "sel_reasonable f \<Longrightarrow> list_sel f x y \<le> 1 \<and> list_sel f x y > 0" [PROOF STATE] proof (prove) goal (1 subgoal): 1. sel_reasonable f \<Longrightarrow> list_sel f x y \<le> 1 \<and> 0 < list_sel f x y [PROOF STEP] by(induction x) (auto simp: sel_reasonable_def mult_le_one list_sel_aux_reasonable)
-- @@stderr -- dtrace: failed to compile script test/unittest/speculation/err.D_AGG_SPEC.SpeculateWithQuant.d: [D_AGG_SPEC] line 33: aggregating actions may not follow speculate( )
(* Title: HOL/Auth/n_german_lemma_inv__35_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__35_on_rules imports n_german_lemma_on_inv__35 begin section{*All lemmas on causal relation between inv__35*} lemma lemma_inv__35_on_rules: assumes b1: "r \<in> rules N" and b2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__35 p__Inv4)" shows "invHoldForRule s f r (invariants N)" proof - have c1: "(\<exists> j. j\<le>N\<and>r=n_SendReqS j)\<or> (\<exists> i. i\<le>N\<and>r=n_SendReqEI i)\<or> (\<exists> i. i\<le>N\<and>r=n_SendReqES i)\<or> (\<exists> i. i\<le>N\<and>r=n_RecvReq N i)\<or> (\<exists> i. i\<le>N\<and>r=n_SendInvE i)\<or> (\<exists> i. i\<le>N\<and>r=n_SendInvS 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)\<or> (\<exists> i d. i\<le>N\<and>d\<le>N\<and>r=n_Store i d)" apply (cut_tac b1, auto) done moreover { assume d1: "(\<exists> j. j\<le>N\<and>r=n_SendReqS j)" have "invHoldForRule s f r (invariants N)" apply (cut_tac b2 d1, metis n_SendReqSVsinv__35) done } moreover { assume d1: "(\<exists> i. i\<le>N\<and>r=n_SendReqEI i)" have "invHoldForRule s f r (invariants N)" apply (cut_tac b2 d1, metis n_SendReqEIVsinv__35) done } moreover { assume d1: "(\<exists> i. i\<le>N\<and>r=n_SendReqES i)" have "invHoldForRule s f r (invariants N)" apply (cut_tac b2 d1, metis n_SendReqESVsinv__35) done } moreover { assume d1: "(\<exists> i. i\<le>N\<and>r=n_RecvReq N i)" have "invHoldForRule s f r (invariants N)" apply (cut_tac b2 d1, metis n_RecvReqVsinv__35) done } moreover { assume d1: "(\<exists> i. i\<le>N\<and>r=n_SendInvE i)" have "invHoldForRule s f r (invariants N)" apply (cut_tac b2 d1, metis n_SendInvEVsinv__35) done } moreover { assume d1: "(\<exists> i. i\<le>N\<and>r=n_SendInvS i)" have "invHoldForRule s f r (invariants N)" apply (cut_tac b2 d1, metis n_SendInvSVsinv__35) 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__35) 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__35) 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__35) 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__35) 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__35) 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__35) 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__35) done } ultimately show "invHoldForRule s f r (invariants N)" by satx qed end
theory T78 imports Main begin lemma "( (\<forall> x::nat. \<forall> y::nat. meet(x, y) = meet(y, x)) & (\<forall> x::nat. \<forall> y::nat. join(x, y) = join(y, x)) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. meet(x, meet(y, z)) = meet(meet(x, y), z)) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. join(x, join(y, z)) = join(join(x, y), z)) & (\<forall> x::nat. \<forall> y::nat. meet(x, join(x, y)) = x) & (\<forall> x::nat. \<forall> y::nat. join(x, meet(x, y)) = x) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. mult(x, join(y, z)) = join(mult(x, y), mult(x, z))) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. mult(join(x, y), z) = join(mult(x, z), mult(y, z))) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. meet(x, over(join(mult(x, y), z), y)) = x) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. meet(y, undr(x, join(mult(x, y), z))) = y) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. join(mult(over(x, y), y), x) = x) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. join(mult(y, undr(y, x)), x) = x) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. mult(x, meet(y, z)) = meet(mult(x, y), mult(x, z))) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. mult(meet(x, y), z) = meet(mult(x, z), mult(y, z))) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. over(x, meet(y, z)) = join(over(x, y), over(x, z))) & (\<forall> x::nat. \<forall> y::nat. invo(join(x, y)) = meet(invo(x), invo(y))) & (\<forall> x::nat. \<forall> y::nat. invo(meet(x, y)) = join(invo(x), invo(y))) & (\<forall> x::nat. invo(invo(x)) = x) ) \<longrightarrow> (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. undr(x, join(y, z)) = join(undr(x, y), undr(x, z))) " nitpick[card nat=4,timeout=86400] oops end
function [engine, clqtoroot] = push(engine, clq, pushdom) %PUSH_POT push the variables in putshdom which is subset of clq to the clique toword the root and get new engine %pushdom is pushed variables set %clq is the index of the clique that pushdom belongs to clqdom = engine.cliques{clq}; assert( mysubset(pushdom, clqdom)); clqtoroot = parents(engine.jtree, clq); %sepdom = engine.separator{clq, clqtoroot}; sepdom = engine.separator{clqtoroot, clq}; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Calculate the strong marginal of the union of pushdom and and the separatordomain and % % the corresponding complement % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %[margpot, comppot] = complement_pot(engine.clpot{clq}, pushdom); newsepdom = myunion(pushdom,sepdom); [margpot,comppot] = complement_pot(engine.clpot{clq}, newsepdom); engine.clpot{clqtoroot} = direct_combine_pots(engine.clpot{clqtoroot}, margpot); engine.clpot{clq} = comppot; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Calculation of the new separator and separatorpotential of the junction tree % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% engine.seppot{clqtoroot, clq} = direct_combine_pots(engine.seppot{clqtoroot, clq}, margpot); engine.separator{clqtoroot, clq} = myunion(engine.separator{clqtoroot, clq}, pushdom); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Add pushdomain to the clique towards the root % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% engine.cliques{clqtoroot} = myunion(engine.cliques{clqtoroot}, pushdom); num_cliques = length(engine.cliques); B = sparse(num_cliques, 1); for i=1:num_cliques B(i, engine.cliques{i}) = 1; end engine.cliques_bitv = B;