Context
stringlengths
57
6.04k
file_name
stringlengths
21
79
start
int64
14
1.49k
end
int64
18
1.5k
theorem
stringlengths
25
1.55k
proof
stringlengths
5
7.36k
rank
int64
0
2.4k
import Mathlib.Data.Finsupp.Encodable import Mathlib.LinearAlgebra.Pi import Mathlib.LinearAlgebra.Span import Mathlib.Data.Set.Countable #align_import linear_algebra.finsupp from "leanprover-community/mathlib"@"9d684a893c52e1d6692a504a118bfccbae04feeb" noncomputable section open Set LinearMap Submodule namespace Finsupp variable {Ξ± : Type*} {M : Type*} {N : Type*} {P : Type*} {R : Type*} {S : Type*} variable [Semiring R] [Semiring S] [AddCommMonoid M] [Module R M] variable [AddCommMonoid N] [Module R N] variable [AddCommMonoid P] [Module R P] def lsingle (a : Ξ±) : M β†’β‚—[R] Ξ± β†’β‚€ M := { Finsupp.singleAddHom a with map_smul' := fun _ _ => (smul_single _ _ _).symm } #align finsupp.lsingle Finsupp.lsingle theorem lhom_ext ⦃φ ψ : (Ξ± β†’β‚€ M) β†’β‚—[R] N⦄ (h : βˆ€ a b, Ο† (single a b) = ψ (single a b)) : Ο† = ψ := LinearMap.toAddMonoidHom_injective <| addHom_ext h #align finsupp.lhom_ext Finsupp.lhom_ext -- Porting note: The priority should be higher than `LinearMap.ext`. @[ext high] theorem lhom_ext' ⦃φ ψ : (Ξ± β†’β‚€ M) β†’β‚—[R] N⦄ (h : βˆ€ a, Ο†.comp (lsingle a) = ψ.comp (lsingle a)) : Ο† = ψ := lhom_ext fun a => LinearMap.congr_fun (h a) #align finsupp.lhom_ext' Finsupp.lhom_ext' def lapply (a : Ξ±) : (Ξ± β†’β‚€ M) β†’β‚—[R] M := { Finsupp.applyAddHom a with map_smul' := fun _ _ => rfl } #align finsupp.lapply Finsupp.lapply @[simps] def lcoeFun : (Ξ± β†’β‚€ M) β†’β‚—[R] Ξ± β†’ M where toFun := (⇑) map_add' x y := by ext simp map_smul' x y := by ext simp #align finsupp.lcoe_fun Finsupp.lcoeFun @[simp] theorem lsingle_apply (a : Ξ±) (b : M) : (lsingle a : M β†’β‚—[R] Ξ± β†’β‚€ M) b = single a b := rfl #align finsupp.lsingle_apply Finsupp.lsingle_apply @[simp] theorem lapply_apply (a : Ξ±) (f : Ξ± β†’β‚€ M) : (lapply a : (Ξ± β†’β‚€ M) β†’β‚—[R] M) f = f a := rfl #align finsupp.lapply_apply Finsupp.lapply_apply @[simp] theorem lapply_comp_lsingle_same (a : Ξ±) : lapply a βˆ˜β‚— lsingle a = (.id : M β†’β‚—[R] M) := by ext; simp @[simp] theorem lapply_comp_lsingle_of_ne (a a' : Ξ±) (h : a β‰  a') : lapply a βˆ˜β‚— lsingle a' = (0 : M β†’β‚—[R] M) := by ext; simp [h.symm] @[simp] theorem ker_lsingle (a : Ξ±) : ker (lsingle a : M β†’β‚—[R] Ξ± β†’β‚€ M) = βŠ₯ := ker_eq_bot_of_injective (single_injective a) #align finsupp.ker_lsingle Finsupp.ker_lsingle theorem lsingle_range_le_ker_lapply (s t : Set Ξ±) (h : Disjoint s t) : ⨆ a ∈ s, LinearMap.range (lsingle a : M β†’β‚—[R] Ξ± β†’β‚€ M) ≀ β¨… a ∈ t, ker (lapply a : (Ξ± β†’β‚€ M) β†’β‚—[R] M) := by refine iSup_le fun a₁ => iSup_le fun h₁ => range_le_iff_comap.2 ?_ simp only [(ker_comp _ _).symm, eq_top_iff, SetLike.le_def, mem_ker, comap_iInf, mem_iInf] intro b _ aβ‚‚ hβ‚‚ have : a₁ β‰  aβ‚‚ := fun eq => h.le_bot ⟨h₁, eq.symm β–Έ hβ‚‚βŸ© exact single_eq_of_ne this #align finsupp.lsingle_range_le_ker_lapply Finsupp.lsingle_range_le_ker_lapply theorem iInf_ker_lapply_le_bot : β¨… a, ker (lapply a : (Ξ± β†’β‚€ M) β†’β‚—[R] M) ≀ βŠ₯ := by simp only [SetLike.le_def, mem_iInf, mem_ker, mem_bot, lapply_apply] exact fun a h => Finsupp.ext h #align finsupp.infi_ker_lapply_le_bot Finsupp.iInf_ker_lapply_le_bot theorem iSup_lsingle_range : ⨆ a, LinearMap.range (lsingle a : M β†’β‚—[R] Ξ± β†’β‚€ M) = ⊀ := by refine eq_top_iff.2 <| SetLike.le_def.2 fun f _ => ?_ rw [← sum_single f] exact sum_mem fun a _ => Submodule.mem_iSup_of_mem a ⟨_, rfl⟩ #align finsupp.supr_lsingle_range Finsupp.iSup_lsingle_range
Mathlib/LinearAlgebra/Finsupp.lean
266
284
theorem disjoint_lsingle_lsingle (s t : Set Ξ±) (hs : Disjoint s t) : Disjoint (⨆ a ∈ s, LinearMap.range (lsingle a : M β†’β‚—[R] Ξ± β†’β‚€ M)) (⨆ a ∈ t, LinearMap.range (lsingle a : M β†’β‚—[R] Ξ± β†’β‚€ M)) := by
-- Porting note: 2 placeholders are added to prevent timeout. refine (Disjoint.mono (lsingle_range_le_ker_lapply s sᢜ ?_) (lsingle_range_le_ker_lapply t tᢜ ?_)) ?_ · apply disjoint_compl_right · apply disjoint_compl_right rw [disjoint_iff_inf_le] refine le_trans (le_iInf fun i => ?_) iInf_ker_lapply_le_bot classical by_cases his : i ∈ s · by_cases hit : i ∈ t · exact (hs.le_bot ⟨his, hit⟩).elim exact inf_le_of_right_le (iInf_le_of_le i <| iInf_le _ hit) exact inf_le_of_left_le (iInf_le_of_le i <| iInf_le _ his)
1,319
import Mathlib.Data.Finsupp.Encodable import Mathlib.LinearAlgebra.Pi import Mathlib.LinearAlgebra.Span import Mathlib.Data.Set.Countable #align_import linear_algebra.finsupp from "leanprover-community/mathlib"@"9d684a893c52e1d6692a504a118bfccbae04feeb" noncomputable section open Set LinearMap Submodule namespace Finsupp variable {Ξ± : Type*} {M : Type*} {N : Type*} {P : Type*} {R : Type*} {S : Type*} variable [Semiring R] [Semiring S] [AddCommMonoid M] [Module R M] variable [AddCommMonoid N] [Module R N] variable [AddCommMonoid P] [Module R P] def lsingle (a : Ξ±) : M β†’β‚—[R] Ξ± β†’β‚€ M := { Finsupp.singleAddHom a with map_smul' := fun _ _ => (smul_single _ _ _).symm } #align finsupp.lsingle Finsupp.lsingle theorem lhom_ext ⦃φ ψ : (Ξ± β†’β‚€ M) β†’β‚—[R] N⦄ (h : βˆ€ a b, Ο† (single a b) = ψ (single a b)) : Ο† = ψ := LinearMap.toAddMonoidHom_injective <| addHom_ext h #align finsupp.lhom_ext Finsupp.lhom_ext -- Porting note: The priority should be higher than `LinearMap.ext`. @[ext high] theorem lhom_ext' ⦃φ ψ : (Ξ± β†’β‚€ M) β†’β‚—[R] N⦄ (h : βˆ€ a, Ο†.comp (lsingle a) = ψ.comp (lsingle a)) : Ο† = ψ := lhom_ext fun a => LinearMap.congr_fun (h a) #align finsupp.lhom_ext' Finsupp.lhom_ext' def lapply (a : Ξ±) : (Ξ± β†’β‚€ M) β†’β‚—[R] M := { Finsupp.applyAddHom a with map_smul' := fun _ _ => rfl } #align finsupp.lapply Finsupp.lapply @[simps] def lcoeFun : (Ξ± β†’β‚€ M) β†’β‚—[R] Ξ± β†’ M where toFun := (⇑) map_add' x y := by ext simp map_smul' x y := by ext simp #align finsupp.lcoe_fun Finsupp.lcoeFun @[simp] theorem lsingle_apply (a : Ξ±) (b : M) : (lsingle a : M β†’β‚—[R] Ξ± β†’β‚€ M) b = single a b := rfl #align finsupp.lsingle_apply Finsupp.lsingle_apply @[simp] theorem lapply_apply (a : Ξ±) (f : Ξ± β†’β‚€ M) : (lapply a : (Ξ± β†’β‚€ M) β†’β‚—[R] M) f = f a := rfl #align finsupp.lapply_apply Finsupp.lapply_apply @[simp] theorem lapply_comp_lsingle_same (a : Ξ±) : lapply a βˆ˜β‚— lsingle a = (.id : M β†’β‚—[R] M) := by ext; simp @[simp] theorem lapply_comp_lsingle_of_ne (a a' : Ξ±) (h : a β‰  a') : lapply a βˆ˜β‚— lsingle a' = (0 : M β†’β‚—[R] M) := by ext; simp [h.symm] @[simp] theorem ker_lsingle (a : Ξ±) : ker (lsingle a : M β†’β‚—[R] Ξ± β†’β‚€ M) = βŠ₯ := ker_eq_bot_of_injective (single_injective a) #align finsupp.ker_lsingle Finsupp.ker_lsingle theorem lsingle_range_le_ker_lapply (s t : Set Ξ±) (h : Disjoint s t) : ⨆ a ∈ s, LinearMap.range (lsingle a : M β†’β‚—[R] Ξ± β†’β‚€ M) ≀ β¨… a ∈ t, ker (lapply a : (Ξ± β†’β‚€ M) β†’β‚—[R] M) := by refine iSup_le fun a₁ => iSup_le fun h₁ => range_le_iff_comap.2 ?_ simp only [(ker_comp _ _).symm, eq_top_iff, SetLike.le_def, mem_ker, comap_iInf, mem_iInf] intro b _ aβ‚‚ hβ‚‚ have : a₁ β‰  aβ‚‚ := fun eq => h.le_bot ⟨h₁, eq.symm β–Έ hβ‚‚βŸ© exact single_eq_of_ne this #align finsupp.lsingle_range_le_ker_lapply Finsupp.lsingle_range_le_ker_lapply theorem iInf_ker_lapply_le_bot : β¨… a, ker (lapply a : (Ξ± β†’β‚€ M) β†’β‚—[R] M) ≀ βŠ₯ := by simp only [SetLike.le_def, mem_iInf, mem_ker, mem_bot, lapply_apply] exact fun a h => Finsupp.ext h #align finsupp.infi_ker_lapply_le_bot Finsupp.iInf_ker_lapply_le_bot theorem iSup_lsingle_range : ⨆ a, LinearMap.range (lsingle a : M β†’β‚—[R] Ξ± β†’β‚€ M) = ⊀ := by refine eq_top_iff.2 <| SetLike.le_def.2 fun f _ => ?_ rw [← sum_single f] exact sum_mem fun a _ => Submodule.mem_iSup_of_mem a ⟨_, rfl⟩ #align finsupp.supr_lsingle_range Finsupp.iSup_lsingle_range theorem disjoint_lsingle_lsingle (s t : Set Ξ±) (hs : Disjoint s t) : Disjoint (⨆ a ∈ s, LinearMap.range (lsingle a : M β†’β‚—[R] Ξ± β†’β‚€ M)) (⨆ a ∈ t, LinearMap.range (lsingle a : M β†’β‚—[R] Ξ± β†’β‚€ M)) := by -- Porting note: 2 placeholders are added to prevent timeout. refine (Disjoint.mono (lsingle_range_le_ker_lapply s sᢜ ?_) (lsingle_range_le_ker_lapply t tᢜ ?_)) ?_ Β· apply disjoint_compl_right Β· apply disjoint_compl_right rw [disjoint_iff_inf_le] refine le_trans (le_iInf fun i => ?_) iInf_ker_lapply_le_bot classical by_cases his : i ∈ s Β· by_cases hit : i ∈ t Β· exact (hs.le_bot ⟨his, hit⟩).elim exact inf_le_of_right_le (iInf_le_of_le i <| iInf_le _ hit) exact inf_le_of_left_le (iInf_le_of_le i <| iInf_le _ his) #align finsupp.disjoint_lsingle_lsingle Finsupp.disjoint_lsingle_lsingle
Mathlib/LinearAlgebra/Finsupp.lean
287
289
theorem span_single_image (s : Set M) (a : Ξ±) : Submodule.span R (single a '' s) = (Submodule.span R s).map (lsingle a : M β†’β‚—[R] Ξ± β†’β‚€ M) := by
rw [← span_image]; rfl
1,319
import Mathlib.Tactic.FinCases import Mathlib.Data.Nat.Choose.Sum import Mathlib.LinearAlgebra.Finsupp import Mathlib.Algebra.Field.IsField #align_import ring_theory.ideal.basic from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988" universe u v w variable {Ξ± : Type u} {Ξ² : Type v} open Set Function open Pointwise abbrev Ideal (R : Type u) [Semiring R] := Submodule R R #align ideal Ideal @[mk_iff] class IsPrincipalIdealRing (R : Type u) [Semiring R] : Prop where principal : βˆ€ S : Ideal R, S.IsPrincipal #align is_principal_ideal_ring IsPrincipalIdealRing attribute [instance] IsPrincipalIdealRing.principal section Semiring namespace Ideal variable [Semiring Ξ±] (I : Ideal Ξ±) {a b : Ξ±} protected theorem zero_mem : (0 : Ξ±) ∈ I := Submodule.zero_mem I #align ideal.zero_mem Ideal.zero_mem protected theorem add_mem : a ∈ I β†’ b ∈ I β†’ a + b ∈ I := Submodule.add_mem I #align ideal.add_mem Ideal.add_mem variable (a) theorem mul_mem_left : b ∈ I β†’ a * b ∈ I := Submodule.smul_mem I a #align ideal.mul_mem_left Ideal.mul_mem_left variable {a} @[ext] theorem ext {I J : Ideal Ξ±} (h : βˆ€ x, x ∈ I ↔ x ∈ J) : I = J := Submodule.ext h #align ideal.ext Ideal.ext theorem sum_mem (I : Ideal Ξ±) {ΞΉ : Type*} {t : Finset ΞΉ} {f : ΞΉ β†’ Ξ±} : (βˆ€ c ∈ t, f c ∈ I) β†’ (βˆ‘ i ∈ t, f i) ∈ I := Submodule.sum_mem I #align ideal.sum_mem Ideal.sum_mem
Mathlib/RingTheory/Ideal/Basic.lean
84
89
theorem eq_top_of_unit_mem (x y : α) (hx : x ∈ I) (h : y * x = 1) : I = ⊀ := eq_top_iff.2 fun z _ => calc z = z * (y * x) := by
simp [h] _ = z * y * x := Eq.symm <| mul_assoc z y x _ ∈ I := I.mul_mem_left _ hx
1,320
import Mathlib.Tactic.FinCases import Mathlib.Data.Nat.Choose.Sum import Mathlib.LinearAlgebra.Finsupp import Mathlib.Algebra.Field.IsField #align_import ring_theory.ideal.basic from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988" universe u v w variable {Ξ± : Type u} {Ξ² : Type v} open Set Function open Pointwise abbrev Ideal (R : Type u) [Semiring R] := Submodule R R #align ideal Ideal @[mk_iff] class IsPrincipalIdealRing (R : Type u) [Semiring R] : Prop where principal : βˆ€ S : Ideal R, S.IsPrincipal #align is_principal_ideal_ring IsPrincipalIdealRing attribute [instance] IsPrincipalIdealRing.principal section Semiring namespace Ideal variable [Semiring Ξ±] (I : Ideal Ξ±) {a b : Ξ±} protected theorem zero_mem : (0 : Ξ±) ∈ I := Submodule.zero_mem I #align ideal.zero_mem Ideal.zero_mem protected theorem add_mem : a ∈ I β†’ b ∈ I β†’ a + b ∈ I := Submodule.add_mem I #align ideal.add_mem Ideal.add_mem variable (a) theorem mul_mem_left : b ∈ I β†’ a * b ∈ I := Submodule.smul_mem I a #align ideal.mul_mem_left Ideal.mul_mem_left variable {a} @[ext] theorem ext {I J : Ideal Ξ±} (h : βˆ€ x, x ∈ I ↔ x ∈ J) : I = J := Submodule.ext h #align ideal.ext Ideal.ext theorem sum_mem (I : Ideal Ξ±) {ΞΉ : Type*} {t : Finset ΞΉ} {f : ΞΉ β†’ Ξ±} : (βˆ€ c ∈ t, f c ∈ I) β†’ (βˆ‘ i ∈ t, f i) ∈ I := Submodule.sum_mem I #align ideal.sum_mem Ideal.sum_mem theorem eq_top_of_unit_mem (x y : Ξ±) (hx : x ∈ I) (h : y * x = 1) : I = ⊀ := eq_top_iff.2 fun z _ => calc z = z * (y * x) := by simp [h] _ = z * y * x := Eq.symm <| mul_assoc z y x _ ∈ I := I.mul_mem_left _ hx #align ideal.eq_top_of_unit_mem Ideal.eq_top_of_unit_mem theorem eq_top_of_isUnit_mem {x} (hx : x ∈ I) (h : IsUnit x) : I = ⊀ := let ⟨y, hy⟩ := h.exists_left_inv eq_top_of_unit_mem I x y hx hy #align ideal.eq_top_of_is_unit_mem Ideal.eq_top_of_isUnit_mem theorem eq_top_iff_one : I = ⊀ ↔ (1 : Ξ±) ∈ I := ⟨by rintro rfl; trivial, fun h => eq_top_of_unit_mem _ _ 1 h (by simp)⟩ #align ideal.eq_top_iff_one Ideal.eq_top_iff_one theorem ne_top_iff_one : I β‰  ⊀ ↔ (1 : Ξ±) βˆ‰ I := not_congr I.eq_top_iff_one #align ideal.ne_top_iff_one Ideal.ne_top_iff_one @[simp]
Mathlib/RingTheory/Ideal/Basic.lean
106
110
theorem unit_mul_mem_iff_mem {x y : Ξ±} (hy : IsUnit y) : y * x ∈ I ↔ x ∈ I := by
refine ⟨fun h => ?_, fun h => I.mul_mem_left y h⟩ obtain ⟨y', hy'⟩ := hy.exists_left_inv have := I.mul_mem_left y' h rwa [← mul_assoc, hy', one_mul] at this
1,320
import Mathlib.Tactic.FinCases import Mathlib.Data.Nat.Choose.Sum import Mathlib.LinearAlgebra.Finsupp import Mathlib.Algebra.Field.IsField #align_import ring_theory.ideal.basic from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988" universe u v w variable {Ξ± : Type u} {Ξ² : Type v} open Set Function open Pointwise abbrev Ideal (R : Type u) [Semiring R] := Submodule R R #align ideal Ideal @[mk_iff] class IsPrincipalIdealRing (R : Type u) [Semiring R] : Prop where principal : βˆ€ S : Ideal R, S.IsPrincipal #align is_principal_ideal_ring IsPrincipalIdealRing attribute [instance] IsPrincipalIdealRing.principal section Semiring namespace Ideal variable [Semiring Ξ±] (I : Ideal Ξ±) {a b : Ξ±} protected theorem zero_mem : (0 : Ξ±) ∈ I := Submodule.zero_mem I #align ideal.zero_mem Ideal.zero_mem protected theorem add_mem : a ∈ I β†’ b ∈ I β†’ a + b ∈ I := Submodule.add_mem I #align ideal.add_mem Ideal.add_mem variable (a) theorem mul_mem_left : b ∈ I β†’ a * b ∈ I := Submodule.smul_mem I a #align ideal.mul_mem_left Ideal.mul_mem_left variable {a} @[ext] theorem ext {I J : Ideal Ξ±} (h : βˆ€ x, x ∈ I ↔ x ∈ J) : I = J := Submodule.ext h #align ideal.ext Ideal.ext theorem sum_mem (I : Ideal Ξ±) {ΞΉ : Type*} {t : Finset ΞΉ} {f : ΞΉ β†’ Ξ±} : (βˆ€ c ∈ t, f c ∈ I) β†’ (βˆ‘ i ∈ t, f i) ∈ I := Submodule.sum_mem I #align ideal.sum_mem Ideal.sum_mem theorem eq_top_of_unit_mem (x y : Ξ±) (hx : x ∈ I) (h : y * x = 1) : I = ⊀ := eq_top_iff.2 fun z _ => calc z = z * (y * x) := by simp [h] _ = z * y * x := Eq.symm <| mul_assoc z y x _ ∈ I := I.mul_mem_left _ hx #align ideal.eq_top_of_unit_mem Ideal.eq_top_of_unit_mem theorem eq_top_of_isUnit_mem {x} (hx : x ∈ I) (h : IsUnit x) : I = ⊀ := let ⟨y, hy⟩ := h.exists_left_inv eq_top_of_unit_mem I x y hx hy #align ideal.eq_top_of_is_unit_mem Ideal.eq_top_of_isUnit_mem theorem eq_top_iff_one : I = ⊀ ↔ (1 : Ξ±) ∈ I := ⟨by rintro rfl; trivial, fun h => eq_top_of_unit_mem _ _ 1 h (by simp)⟩ #align ideal.eq_top_iff_one Ideal.eq_top_iff_one theorem ne_top_iff_one : I β‰  ⊀ ↔ (1 : Ξ±) βˆ‰ I := not_congr I.eq_top_iff_one #align ideal.ne_top_iff_one Ideal.ne_top_iff_one @[simp] theorem unit_mul_mem_iff_mem {x y : Ξ±} (hy : IsUnit y) : y * x ∈ I ↔ x ∈ I := by refine ⟨fun h => ?_, fun h => I.mul_mem_left y h⟩ obtain ⟨y', hy'⟩ := hy.exists_left_inv have := I.mul_mem_left y' h rwa [← mul_assoc, hy', one_mul] at this #align ideal.unit_mul_mem_iff_mem Ideal.unit_mul_mem_iff_mem def span (s : Set Ξ±) : Ideal Ξ± := Submodule.span Ξ± s #align ideal.span Ideal.span @[simp] theorem submodule_span_eq {s : Set Ξ±} : Submodule.span Ξ± s = Ideal.span s := rfl #align ideal.submodule_span_eq Ideal.submodule_span_eq @[simp] theorem span_empty : span (βˆ… : Set Ξ±) = βŠ₯ := Submodule.span_empty #align ideal.span_empty Ideal.span_empty @[simp] theorem span_univ : span (Set.univ : Set Ξ±) = ⊀ := Submodule.span_univ #align ideal.span_univ Ideal.span_univ theorem span_union (s t : Set Ξ±) : span (s βˆͺ t) = span s βŠ” span t := Submodule.span_union _ _ #align ideal.span_union Ideal.span_union theorem span_iUnion {ΞΉ} (s : ΞΉ β†’ Set Ξ±) : span (⋃ i, s i) = ⨆ i, span (s i) := Submodule.span_iUnion _ #align ideal.span_Union Ideal.span_iUnion theorem mem_span {s : Set Ξ±} (x) : x ∈ span s ↔ βˆ€ p : Ideal Ξ±, s βŠ† p β†’ x ∈ p := mem_iInterβ‚‚ #align ideal.mem_span Ideal.mem_span theorem subset_span {s : Set Ξ±} : s βŠ† span s := Submodule.subset_span #align ideal.subset_span Ideal.subset_span theorem span_le {s : Set Ξ±} {I} : span s ≀ I ↔ s βŠ† I := Submodule.span_le #align ideal.span_le Ideal.span_le theorem span_mono {s t : Set Ξ±} : s βŠ† t β†’ span s ≀ span t := Submodule.span_mono #align ideal.span_mono Ideal.span_mono @[simp] theorem span_eq : span (I : Set Ξ±) = I := Submodule.span_eq _ #align ideal.span_eq Ideal.span_eq @[simp] theorem span_singleton_one : span ({1} : Set Ξ±) = ⊀ := (eq_top_iff_one _).2 <| subset_span <| mem_singleton _ #align ideal.span_singleton_one Ideal.span_singleton_one
Mathlib/RingTheory/Ideal/Basic.lean
167
168
theorem isCompactElement_top : CompleteLattice.IsCompactElement (⊀ : Ideal α) := by
simpa only [← span_singleton_one] using Submodule.singleton_span_isCompactElement 1
1,320
import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.GroupWithZero.NonZeroDivisors import Mathlib.GroupTheory.MonoidLocalization import Mathlib.RingTheory.Ideal.Basic import Mathlib.GroupTheory.GroupAction.Ring #align_import ring_theory.localization.basic from "leanprover-community/mathlib"@"b69c9a770ecf37eb21f7b8cf4fa00de3b62694ec" open Function section CommSemiring variable {R : Type*} [CommSemiring R] (M : Submonoid R) (S : Type*) [CommSemiring S] variable [Algebra R S] {P : Type*} [CommSemiring P] @[mk_iff] class IsLocalization : Prop where -- Porting note: add ' to fields, and made new versions of these with either `S` or `M` explicit. map_units' : βˆ€ y : M, IsUnit (algebraMap R S y) surj' : βˆ€ z : S, βˆƒ x : R Γ— M, z * algebraMap R S x.2 = algebraMap R S x.1 exists_of_eq : βˆ€ {x y}, algebraMap R S x = algebraMap R S y β†’ βˆƒ c : M, ↑c * x = ↑c * y #align is_localization IsLocalization variable {M} namespace IsLocalization section IsLocalization variable [IsLocalization M S] section @[inherit_doc IsLocalization.map_units'] theorem map_units : βˆ€ y : M, IsUnit (algebraMap R S y) := IsLocalization.map_units' variable (M) {S} @[inherit_doc IsLocalization.surj'] theorem surj : βˆ€ z : S, βˆƒ x : R Γ— M, z * algebraMap R S x.2 = algebraMap R S x.1 := IsLocalization.surj' variable (S) @[inherit_doc IsLocalization.exists_of_eq] theorem eq_iff_exists {x y} : algebraMap R S x = algebraMap R S y ↔ βˆƒ c : M, ↑c * x = ↑c * y := Iff.intro IsLocalization.exists_of_eq fun ⟨c, h⟩ ↦ by apply_fun algebraMap R S at h rw [map_mul, map_mul] at h exact (IsLocalization.map_units S c).mul_right_inj.mp h variable {S}
Mathlib/RingTheory/Localization/Basic.lean
135
144
theorem of_le (N : Submonoid R) (h₁ : M ≀ N) (hβ‚‚ : βˆ€ r ∈ N, IsUnit (algebraMap R S r)) : IsLocalization N S where map_units' r := hβ‚‚ r r.2 surj' s := have ⟨⟨x, y, hy⟩, H⟩ := IsLocalization.surj M s ⟨⟨x, y, h₁ hy⟩, H⟩ exists_of_eq {x y} := by
rw [IsLocalization.eq_iff_exists M] rintro ⟨c, hc⟩ exact ⟨⟨c, h₁ c.2⟩, hc⟩
1,321
import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.GroupWithZero.NonZeroDivisors import Mathlib.GroupTheory.MonoidLocalization import Mathlib.RingTheory.Ideal.Basic import Mathlib.GroupTheory.GroupAction.Ring #align_import ring_theory.localization.basic from "leanprover-community/mathlib"@"b69c9a770ecf37eb21f7b8cf4fa00de3b62694ec" open Function section CommSemiring variable {R : Type*} [CommSemiring R] (M : Submonoid R) (S : Type*) [CommSemiring S] variable [Algebra R S] {P : Type*} [CommSemiring P] @[mk_iff] class IsLocalization : Prop where -- Porting note: add ' to fields, and made new versions of these with either `S` or `M` explicit. map_units' : βˆ€ y : M, IsUnit (algebraMap R S y) surj' : βˆ€ z : S, βˆƒ x : R Γ— M, z * algebraMap R S x.2 = algebraMap R S x.1 exists_of_eq : βˆ€ {x y}, algebraMap R S x = algebraMap R S y β†’ βˆƒ c : M, ↑c * x = ↑c * y #align is_localization IsLocalization variable {M} namespace IsLocalization section IsLocalization variable [IsLocalization M S] section @[inherit_doc IsLocalization.map_units'] theorem map_units : βˆ€ y : M, IsUnit (algebraMap R S y) := IsLocalization.map_units' variable (M) {S} @[inherit_doc IsLocalization.surj'] theorem surj : βˆ€ z : S, βˆƒ x : R Γ— M, z * algebraMap R S x.2 = algebraMap R S x.1 := IsLocalization.surj' variable (S) @[inherit_doc IsLocalization.exists_of_eq] theorem eq_iff_exists {x y} : algebraMap R S x = algebraMap R S y ↔ βˆƒ c : M, ↑c * x = ↑c * y := Iff.intro IsLocalization.exists_of_eq fun ⟨c, h⟩ ↦ by apply_fun algebraMap R S at h rw [map_mul, map_mul] at h exact (IsLocalization.map_units S c).mul_right_inj.mp h variable {S} theorem of_le (N : Submonoid R) (h₁ : M ≀ N) (hβ‚‚ : βˆ€ r ∈ N, IsUnit (algebraMap R S r)) : IsLocalization N S where map_units' r := hβ‚‚ r r.2 surj' s := have ⟨⟨x, y, hy⟩, H⟩ := IsLocalization.surj M s ⟨⟨x, y, h₁ hy⟩, H⟩ exists_of_eq {x y} := by rw [IsLocalization.eq_iff_exists M] rintro ⟨c, hc⟩ exact ⟨⟨c, h₁ c.2⟩, hc⟩ #align is_localization.of_le IsLocalization.of_le variable (S) @[simps] def toLocalizationWithZeroMap : Submonoid.LocalizationWithZeroMap M S where __ := algebraMap R S toFun := algebraMap R S map_units' := IsLocalization.map_units _ surj' := IsLocalization.surj _ exists_of_eq _ _ := IsLocalization.exists_of_eq #align is_localization.to_localization_with_zero_map IsLocalization.toLocalizationWithZeroMap abbrev toLocalizationMap : Submonoid.LocalizationMap M S := (toLocalizationWithZeroMap M S).toLocalizationMap #align is_localization.to_localization_map IsLocalization.toLocalizationMap @[simp] theorem toLocalizationMap_toMap : (toLocalizationMap M S).toMap = (algebraMap R S : R β†’*β‚€ S) := rfl #align is_localization.to_localization_map_to_map IsLocalization.toLocalizationMap_toMap theorem toLocalizationMap_toMap_apply (x) : (toLocalizationMap M S).toMap x = algebraMap R S x := rfl #align is_localization.to_localization_map_to_map_apply IsLocalization.toLocalizationMap_toMap_apply theorem surjβ‚‚ : βˆ€ z w : S, βˆƒ z' w' : R, βˆƒ d : M, (z * algebraMap R S d = algebraMap R S z') ∧ (w * algebraMap R S d = algebraMap R S w') := (toLocalizationMap M S).surjβ‚‚ end variable (M) {S} noncomputable def sec (z : S) : R Γ— M := Classical.choose <| IsLocalization.surj _ z #align is_localization.sec IsLocalization.sec @[simp] theorem toLocalizationMap_sec : (toLocalizationMap M S).sec = sec M := rfl #align is_localization.to_localization_map_sec IsLocalization.toLocalizationMap_sec theorem sec_spec (z : S) : z * algebraMap R S (IsLocalization.sec M z).2 = algebraMap R S (IsLocalization.sec M z).1 := Classical.choose_spec <| IsLocalization.surj _ z #align is_localization.sec_spec IsLocalization.sec_spec
Mathlib/RingTheory/Localization/Basic.lean
202
204
theorem sec_spec' (z : S) : algebraMap R S (IsLocalization.sec M z).1 = algebraMap R S (IsLocalization.sec M z).2 * z := by
rw [mul_comm, sec_spec]
1,321
import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.GroupWithZero.NonZeroDivisors import Mathlib.GroupTheory.MonoidLocalization import Mathlib.RingTheory.Ideal.Basic import Mathlib.GroupTheory.GroupAction.Ring #align_import ring_theory.localization.basic from "leanprover-community/mathlib"@"b69c9a770ecf37eb21f7b8cf4fa00de3b62694ec" open Function section CommSemiring variable {R : Type*} [CommSemiring R] (M : Submonoid R) (S : Type*) [CommSemiring S] variable [Algebra R S] {P : Type*} [CommSemiring P] @[mk_iff] class IsLocalization : Prop where -- Porting note: add ' to fields, and made new versions of these with either `S` or `M` explicit. map_units' : βˆ€ y : M, IsUnit (algebraMap R S y) surj' : βˆ€ z : S, βˆƒ x : R Γ— M, z * algebraMap R S x.2 = algebraMap R S x.1 exists_of_eq : βˆ€ {x y}, algebraMap R S x = algebraMap R S y β†’ βˆƒ c : M, ↑c * x = ↑c * y #align is_localization IsLocalization variable {M} namespace IsLocalization section IsLocalization variable [IsLocalization M S] section @[inherit_doc IsLocalization.map_units'] theorem map_units : βˆ€ y : M, IsUnit (algebraMap R S y) := IsLocalization.map_units' variable (M) {S} @[inherit_doc IsLocalization.surj'] theorem surj : βˆ€ z : S, βˆƒ x : R Γ— M, z * algebraMap R S x.2 = algebraMap R S x.1 := IsLocalization.surj' variable (S) @[inherit_doc IsLocalization.exists_of_eq] theorem eq_iff_exists {x y} : algebraMap R S x = algebraMap R S y ↔ βˆƒ c : M, ↑c * x = ↑c * y := Iff.intro IsLocalization.exists_of_eq fun ⟨c, h⟩ ↦ by apply_fun algebraMap R S at h rw [map_mul, map_mul] at h exact (IsLocalization.map_units S c).mul_right_inj.mp h variable {S} theorem of_le (N : Submonoid R) (h₁ : M ≀ N) (hβ‚‚ : βˆ€ r ∈ N, IsUnit (algebraMap R S r)) : IsLocalization N S where map_units' r := hβ‚‚ r r.2 surj' s := have ⟨⟨x, y, hy⟩, H⟩ := IsLocalization.surj M s ⟨⟨x, y, h₁ hy⟩, H⟩ exists_of_eq {x y} := by rw [IsLocalization.eq_iff_exists M] rintro ⟨c, hc⟩ exact ⟨⟨c, h₁ c.2⟩, hc⟩ #align is_localization.of_le IsLocalization.of_le variable (S) @[simps] def toLocalizationWithZeroMap : Submonoid.LocalizationWithZeroMap M S where __ := algebraMap R S toFun := algebraMap R S map_units' := IsLocalization.map_units _ surj' := IsLocalization.surj _ exists_of_eq _ _ := IsLocalization.exists_of_eq #align is_localization.to_localization_with_zero_map IsLocalization.toLocalizationWithZeroMap abbrev toLocalizationMap : Submonoid.LocalizationMap M S := (toLocalizationWithZeroMap M S).toLocalizationMap #align is_localization.to_localization_map IsLocalization.toLocalizationMap @[simp] theorem toLocalizationMap_toMap : (toLocalizationMap M S).toMap = (algebraMap R S : R β†’*β‚€ S) := rfl #align is_localization.to_localization_map_to_map IsLocalization.toLocalizationMap_toMap theorem toLocalizationMap_toMap_apply (x) : (toLocalizationMap M S).toMap x = algebraMap R S x := rfl #align is_localization.to_localization_map_to_map_apply IsLocalization.toLocalizationMap_toMap_apply theorem surjβ‚‚ : βˆ€ z w : S, βˆƒ z' w' : R, βˆƒ d : M, (z * algebraMap R S d = algebraMap R S z') ∧ (w * algebraMap R S d = algebraMap R S w') := (toLocalizationMap M S).surjβ‚‚ end variable (M) {S} noncomputable def sec (z : S) : R Γ— M := Classical.choose <| IsLocalization.surj _ z #align is_localization.sec IsLocalization.sec @[simp] theorem toLocalizationMap_sec : (toLocalizationMap M S).sec = sec M := rfl #align is_localization.to_localization_map_sec IsLocalization.toLocalizationMap_sec theorem sec_spec (z : S) : z * algebraMap R S (IsLocalization.sec M z).2 = algebraMap R S (IsLocalization.sec M z).1 := Classical.choose_spec <| IsLocalization.surj _ z #align is_localization.sec_spec IsLocalization.sec_spec theorem sec_spec' (z : S) : algebraMap R S (IsLocalization.sec M z).1 = algebraMap R S (IsLocalization.sec M z).2 * z := by rw [mul_comm, sec_spec] #align is_localization.sec_spec' IsLocalization.sec_spec' variable {M} theorem subsingleton (h : 0 ∈ M) : Subsingleton S := (toLocalizationMap M S).subsingleton h theorem map_right_cancel {x y} {c : M} (h : algebraMap R S (c * x) = algebraMap R S (c * y)) : algebraMap R S x = algebraMap R S y := (toLocalizationMap M S).map_right_cancel h #align is_localization.map_right_cancel IsLocalization.map_right_cancel theorem map_left_cancel {x y} {c : M} (h : algebraMap R S (x * c) = algebraMap R S (y * c)) : algebraMap R S x = algebraMap R S y := (toLocalizationMap M S).map_left_cancel h #align is_localization.map_left_cancel IsLocalization.map_left_cancel
Mathlib/RingTheory/Localization/Basic.lean
222
225
theorem eq_zero_of_fst_eq_zero {z x} {y : M} (h : z * algebraMap R S y = algebraMap R S x) (hx : x = 0) : z = 0 := by
rw [hx, (algebraMap R S).map_zero] at h exact (IsUnit.mul_left_eq_zero (IsLocalization.map_units S y)).1 h
1,321
import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.GroupWithZero.NonZeroDivisors import Mathlib.GroupTheory.MonoidLocalization import Mathlib.RingTheory.Ideal.Basic import Mathlib.GroupTheory.GroupAction.Ring #align_import ring_theory.localization.basic from "leanprover-community/mathlib"@"b69c9a770ecf37eb21f7b8cf4fa00de3b62694ec" open Function section CommSemiring variable {R : Type*} [CommSemiring R] (M : Submonoid R) (S : Type*) [CommSemiring S] variable [Algebra R S] {P : Type*} [CommSemiring P] @[mk_iff] class IsLocalization : Prop where -- Porting note: add ' to fields, and made new versions of these with either `S` or `M` explicit. map_units' : βˆ€ y : M, IsUnit (algebraMap R S y) surj' : βˆ€ z : S, βˆƒ x : R Γ— M, z * algebraMap R S x.2 = algebraMap R S x.1 exists_of_eq : βˆ€ {x y}, algebraMap R S x = algebraMap R S y β†’ βˆƒ c : M, ↑c * x = ↑c * y #align is_localization IsLocalization variable {M} namespace IsLocalization section IsLocalization variable [IsLocalization M S] section @[inherit_doc IsLocalization.map_units'] theorem map_units : βˆ€ y : M, IsUnit (algebraMap R S y) := IsLocalization.map_units' variable (M) {S} @[inherit_doc IsLocalization.surj'] theorem surj : βˆ€ z : S, βˆƒ x : R Γ— M, z * algebraMap R S x.2 = algebraMap R S x.1 := IsLocalization.surj' variable (S) @[inherit_doc IsLocalization.exists_of_eq] theorem eq_iff_exists {x y} : algebraMap R S x = algebraMap R S y ↔ βˆƒ c : M, ↑c * x = ↑c * y := Iff.intro IsLocalization.exists_of_eq fun ⟨c, h⟩ ↦ by apply_fun algebraMap R S at h rw [map_mul, map_mul] at h exact (IsLocalization.map_units S c).mul_right_inj.mp h variable {S} theorem of_le (N : Submonoid R) (h₁ : M ≀ N) (hβ‚‚ : βˆ€ r ∈ N, IsUnit (algebraMap R S r)) : IsLocalization N S where map_units' r := hβ‚‚ r r.2 surj' s := have ⟨⟨x, y, hy⟩, H⟩ := IsLocalization.surj M s ⟨⟨x, y, h₁ hy⟩, H⟩ exists_of_eq {x y} := by rw [IsLocalization.eq_iff_exists M] rintro ⟨c, hc⟩ exact ⟨⟨c, h₁ c.2⟩, hc⟩ #align is_localization.of_le IsLocalization.of_le variable (S) @[simps] def toLocalizationWithZeroMap : Submonoid.LocalizationWithZeroMap M S where __ := algebraMap R S toFun := algebraMap R S map_units' := IsLocalization.map_units _ surj' := IsLocalization.surj _ exists_of_eq _ _ := IsLocalization.exists_of_eq #align is_localization.to_localization_with_zero_map IsLocalization.toLocalizationWithZeroMap abbrev toLocalizationMap : Submonoid.LocalizationMap M S := (toLocalizationWithZeroMap M S).toLocalizationMap #align is_localization.to_localization_map IsLocalization.toLocalizationMap @[simp] theorem toLocalizationMap_toMap : (toLocalizationMap M S).toMap = (algebraMap R S : R β†’*β‚€ S) := rfl #align is_localization.to_localization_map_to_map IsLocalization.toLocalizationMap_toMap theorem toLocalizationMap_toMap_apply (x) : (toLocalizationMap M S).toMap x = algebraMap R S x := rfl #align is_localization.to_localization_map_to_map_apply IsLocalization.toLocalizationMap_toMap_apply theorem surjβ‚‚ : βˆ€ z w : S, βˆƒ z' w' : R, βˆƒ d : M, (z * algebraMap R S d = algebraMap R S z') ∧ (w * algebraMap R S d = algebraMap R S w') := (toLocalizationMap M S).surjβ‚‚ end variable (M) {S} noncomputable def sec (z : S) : R Γ— M := Classical.choose <| IsLocalization.surj _ z #align is_localization.sec IsLocalization.sec @[simp] theorem toLocalizationMap_sec : (toLocalizationMap M S).sec = sec M := rfl #align is_localization.to_localization_map_sec IsLocalization.toLocalizationMap_sec theorem sec_spec (z : S) : z * algebraMap R S (IsLocalization.sec M z).2 = algebraMap R S (IsLocalization.sec M z).1 := Classical.choose_spec <| IsLocalization.surj _ z #align is_localization.sec_spec IsLocalization.sec_spec theorem sec_spec' (z : S) : algebraMap R S (IsLocalization.sec M z).1 = algebraMap R S (IsLocalization.sec M z).2 * z := by rw [mul_comm, sec_spec] #align is_localization.sec_spec' IsLocalization.sec_spec' variable {M} theorem subsingleton (h : 0 ∈ M) : Subsingleton S := (toLocalizationMap M S).subsingleton h theorem map_right_cancel {x y} {c : M} (h : algebraMap R S (c * x) = algebraMap R S (c * y)) : algebraMap R S x = algebraMap R S y := (toLocalizationMap M S).map_right_cancel h #align is_localization.map_right_cancel IsLocalization.map_right_cancel theorem map_left_cancel {x y} {c : M} (h : algebraMap R S (x * c) = algebraMap R S (y * c)) : algebraMap R S x = algebraMap R S y := (toLocalizationMap M S).map_left_cancel h #align is_localization.map_left_cancel IsLocalization.map_left_cancel theorem eq_zero_of_fst_eq_zero {z x} {y : M} (h : z * algebraMap R S y = algebraMap R S x) (hx : x = 0) : z = 0 := by rw [hx, (algebraMap R S).map_zero] at h exact (IsUnit.mul_left_eq_zero (IsLocalization.map_units S y)).1 h #align is_localization.eq_zero_of_fst_eq_zero IsLocalization.eq_zero_of_fst_eq_zero variable (M S)
Mathlib/RingTheory/Localization/Basic.lean
230
237
theorem map_eq_zero_iff (r : R) : algebraMap R S r = 0 ↔ βˆƒ m : M, ↑m * r = 0 := by
constructor Β· intro h obtain ⟨m, hm⟩ := (IsLocalization.eq_iff_exists M S).mp ((algebraMap R S).map_zero.trans h.symm) exact ⟨m, by simpa using hm.symm⟩ Β· rintro ⟨m, hm⟩ rw [← (IsLocalization.map_units S m).mul_right_inj, mul_zero, ← RingHom.map_mul, hm, RingHom.map_zero]
1,321
import Mathlib.RingTheory.UniqueFactorizationDomain import Mathlib.RingTheory.Localization.Basic #align_import ring_theory.localization.away.basic from "leanprover-community/mathlib"@"a7c017d750512a352b623b1824d75da5998457d0" section CommSemiring variable {R : Type*} [CommSemiring R] (M : Submonoid R) {S : Type*} [CommSemiring S] variable [Algebra R S] {P : Type*} [CommSemiring P] namespace IsLocalization section Away variable (x : R) abbrev Away (S : Type*) [CommSemiring S] [Algebra R S] := IsLocalization (Submonoid.powers x) S #align is_localization.away IsLocalization.Away namespace Away variable [IsLocalization.Away x S] noncomputable def invSelf : S := mk' S (1 : R) ⟨x, Submonoid.mem_powers _⟩ #align is_localization.away.inv_self IsLocalization.Away.invSelf @[simp]
Mathlib/RingTheory/Localization/Away/Basic.lean
58
61
theorem mul_invSelf : algebraMap R S x * invSelf x = 1 := by
convert IsLocalization.mk'_mul_mk'_eq_one (M := Submonoid.powers x) (S := S) _ 1 symm apply IsLocalization.mk'_one
1,322
import Mathlib.RingTheory.Localization.Basic #align_import ring_theory.localization.integer from "leanprover-community/mathlib"@"9556784a5b84697562e9c6acb40500d4a82e675a" variable {R : Type*} [CommSemiring R] {M : Submonoid R} {S : Type*} [CommSemiring S] variable [Algebra R S] {P : Type*} [CommSemiring P] open Function namespace IsLocalization section variable (R) -- TODO: define a subalgebra of `IsInteger`s def IsInteger (a : S) : Prop := a ∈ (algebraMap R S).rangeS #align is_localization.is_integer IsLocalization.IsInteger end theorem isInteger_zero : IsInteger R (0 : S) := Subsemiring.zero_mem _ #align is_localization.is_integer_zero IsLocalization.isInteger_zero theorem isInteger_one : IsInteger R (1 : S) := Subsemiring.one_mem _ #align is_localization.is_integer_one IsLocalization.isInteger_one theorem isInteger_add {a b : S} (ha : IsInteger R a) (hb : IsInteger R b) : IsInteger R (a + b) := Subsemiring.add_mem _ ha hb #align is_localization.is_integer_add IsLocalization.isInteger_add theorem isInteger_mul {a b : S} (ha : IsInteger R a) (hb : IsInteger R b) : IsInteger R (a * b) := Subsemiring.mul_mem _ ha hb #align is_localization.is_integer_mul IsLocalization.isInteger_mul
Mathlib/RingTheory/Localization/Integer.lean
63
66
theorem isInteger_smul {a : R} {b : S} (hb : IsInteger R b) : IsInteger R (a β€’ b) := by
rcases hb with ⟨b', hb⟩ use a * b' rw [← hb, (algebraMap R S).map_mul, Algebra.smul_def]
1,323
import Mathlib.RingTheory.Localization.Basic #align_import ring_theory.localization.integer from "leanprover-community/mathlib"@"9556784a5b84697562e9c6acb40500d4a82e675a" variable {R : Type*} [CommSemiring R] {M : Submonoid R} {S : Type*} [CommSemiring S] variable [Algebra R S] {P : Type*} [CommSemiring P] open Function namespace IsLocalization section variable (R) -- TODO: define a subalgebra of `IsInteger`s def IsInteger (a : S) : Prop := a ∈ (algebraMap R S).rangeS #align is_localization.is_integer IsLocalization.IsInteger end theorem isInteger_zero : IsInteger R (0 : S) := Subsemiring.zero_mem _ #align is_localization.is_integer_zero IsLocalization.isInteger_zero theorem isInteger_one : IsInteger R (1 : S) := Subsemiring.one_mem _ #align is_localization.is_integer_one IsLocalization.isInteger_one theorem isInteger_add {a b : S} (ha : IsInteger R a) (hb : IsInteger R b) : IsInteger R (a + b) := Subsemiring.add_mem _ ha hb #align is_localization.is_integer_add IsLocalization.isInteger_add theorem isInteger_mul {a b : S} (ha : IsInteger R a) (hb : IsInteger R b) : IsInteger R (a * b) := Subsemiring.mul_mem _ ha hb #align is_localization.is_integer_mul IsLocalization.isInteger_mul theorem isInteger_smul {a : R} {b : S} (hb : IsInteger R b) : IsInteger R (a β€’ b) := by rcases hb with ⟨b', hb⟩ use a * b' rw [← hb, (algebraMap R S).map_mul, Algebra.smul_def] #align is_localization.is_integer_smul IsLocalization.isInteger_smul variable (M) variable [IsLocalization M S] theorem exists_integer_multiple' (a : S) : βˆƒ b : M, IsInteger R (a * algebraMap R S b) := let ⟨⟨Num, denom⟩, h⟩ := IsLocalization.surj _ a ⟨denom, Set.mem_range.mpr ⟨Num, h.symm⟩⟩ #align is_localization.exists_integer_multiple' IsLocalization.exists_integer_multiple'
Mathlib/RingTheory/Localization/Integer.lean
85
87
theorem exists_integer_multiple (a : S) : βˆƒ b : M, IsInteger R ((b : R) β€’ a) := by
simp_rw [Algebra.smul_def, mul_comm _ a] apply exists_integer_multiple'
1,323
import Mathlib.RingTheory.Localization.Basic #align_import ring_theory.localization.integer from "leanprover-community/mathlib"@"9556784a5b84697562e9c6acb40500d4a82e675a" variable {R : Type*} [CommSemiring R] {M : Submonoid R} {S : Type*} [CommSemiring S] variable [Algebra R S] {P : Type*} [CommSemiring P] open Function namespace IsLocalization section variable (R) -- TODO: define a subalgebra of `IsInteger`s def IsInteger (a : S) : Prop := a ∈ (algebraMap R S).rangeS #align is_localization.is_integer IsLocalization.IsInteger end theorem isInteger_zero : IsInteger R (0 : S) := Subsemiring.zero_mem _ #align is_localization.is_integer_zero IsLocalization.isInteger_zero theorem isInteger_one : IsInteger R (1 : S) := Subsemiring.one_mem _ #align is_localization.is_integer_one IsLocalization.isInteger_one theorem isInteger_add {a b : S} (ha : IsInteger R a) (hb : IsInteger R b) : IsInteger R (a + b) := Subsemiring.add_mem _ ha hb #align is_localization.is_integer_add IsLocalization.isInteger_add theorem isInteger_mul {a b : S} (ha : IsInteger R a) (hb : IsInteger R b) : IsInteger R (a * b) := Subsemiring.mul_mem _ ha hb #align is_localization.is_integer_mul IsLocalization.isInteger_mul theorem isInteger_smul {a : R} {b : S} (hb : IsInteger R b) : IsInteger R (a β€’ b) := by rcases hb with ⟨b', hb⟩ use a * b' rw [← hb, (algebraMap R S).map_mul, Algebra.smul_def] #align is_localization.is_integer_smul IsLocalization.isInteger_smul variable (M) variable [IsLocalization M S] theorem exists_integer_multiple' (a : S) : βˆƒ b : M, IsInteger R (a * algebraMap R S b) := let ⟨⟨Num, denom⟩, h⟩ := IsLocalization.surj _ a ⟨denom, Set.mem_range.mpr ⟨Num, h.symm⟩⟩ #align is_localization.exists_integer_multiple' IsLocalization.exists_integer_multiple' theorem exists_integer_multiple (a : S) : βˆƒ b : M, IsInteger R ((b : R) β€’ a) := by simp_rw [Algebra.smul_def, mul_comm _ a] apply exists_integer_multiple' #align is_localization.exists_integer_multiple IsLocalization.exists_integer_multiple
Mathlib/RingTheory/Localization/Integer.lean
91
103
theorem exist_integer_multiples {ΞΉ : Type*} (s : Finset ΞΉ) (f : ΞΉ β†’ S) : βˆƒ b : M, βˆ€ i ∈ s, IsLocalization.IsInteger R ((b : R) β€’ f i) := by
haveI := Classical.propDecidable refine ⟨∏ i ∈ s, (sec M (f i)).2, fun i hi => ⟨?_, ?_⟩⟩ Β· exact (∏ j ∈ s.erase i, (sec M (f j)).2) * (sec M (f i)).1 rw [RingHom.map_mul, sec_spec', ← mul_assoc, ← (algebraMap R S).map_mul, ← Algebra.smul_def] congr 2 refine _root_.trans ?_ (map_prod (Submonoid.subtype M) _ _).symm rw [mul_comm,Submonoid.coe_finset_prod, -- Porting note: explicitly supplied `f` ← Finset.prod_insert (f := fun i => ((sec M (f i)).snd : R)) (s.not_mem_erase i), Finset.insert_erase hi] rfl
1,323
import Mathlib.RingTheory.Localization.Basic #align_import ring_theory.localization.integer from "leanprover-community/mathlib"@"9556784a5b84697562e9c6acb40500d4a82e675a" variable {R : Type*} [CommSemiring R] {M : Submonoid R} {S : Type*} [CommSemiring S] variable [Algebra R S] {P : Type*} [CommSemiring P] open Function namespace IsLocalization section variable (R) -- TODO: define a subalgebra of `IsInteger`s def IsInteger (a : S) : Prop := a ∈ (algebraMap R S).rangeS #align is_localization.is_integer IsLocalization.IsInteger end theorem isInteger_zero : IsInteger R (0 : S) := Subsemiring.zero_mem _ #align is_localization.is_integer_zero IsLocalization.isInteger_zero theorem isInteger_one : IsInteger R (1 : S) := Subsemiring.one_mem _ #align is_localization.is_integer_one IsLocalization.isInteger_one theorem isInteger_add {a b : S} (ha : IsInteger R a) (hb : IsInteger R b) : IsInteger R (a + b) := Subsemiring.add_mem _ ha hb #align is_localization.is_integer_add IsLocalization.isInteger_add theorem isInteger_mul {a b : S} (ha : IsInteger R a) (hb : IsInteger R b) : IsInteger R (a * b) := Subsemiring.mul_mem _ ha hb #align is_localization.is_integer_mul IsLocalization.isInteger_mul theorem isInteger_smul {a : R} {b : S} (hb : IsInteger R b) : IsInteger R (a β€’ b) := by rcases hb with ⟨b', hb⟩ use a * b' rw [← hb, (algebraMap R S).map_mul, Algebra.smul_def] #align is_localization.is_integer_smul IsLocalization.isInteger_smul variable (M) variable [IsLocalization M S] theorem exists_integer_multiple' (a : S) : βˆƒ b : M, IsInteger R (a * algebraMap R S b) := let ⟨⟨Num, denom⟩, h⟩ := IsLocalization.surj _ a ⟨denom, Set.mem_range.mpr ⟨Num, h.symm⟩⟩ #align is_localization.exists_integer_multiple' IsLocalization.exists_integer_multiple' theorem exists_integer_multiple (a : S) : βˆƒ b : M, IsInteger R ((b : R) β€’ a) := by simp_rw [Algebra.smul_def, mul_comm _ a] apply exists_integer_multiple' #align is_localization.exists_integer_multiple IsLocalization.exists_integer_multiple theorem exist_integer_multiples {ΞΉ : Type*} (s : Finset ΞΉ) (f : ΞΉ β†’ S) : βˆƒ b : M, βˆ€ i ∈ s, IsLocalization.IsInteger R ((b : R) β€’ f i) := by haveI := Classical.propDecidable refine ⟨∏ i ∈ s, (sec M (f i)).2, fun i hi => ⟨?_, ?_⟩⟩ Β· exact (∏ j ∈ s.erase i, (sec M (f j)).2) * (sec M (f i)).1 rw [RingHom.map_mul, sec_spec', ← mul_assoc, ← (algebraMap R S).map_mul, ← Algebra.smul_def] congr 2 refine _root_.trans ?_ (map_prod (Submonoid.subtype M) _ _).symm rw [mul_comm,Submonoid.coe_finset_prod, -- Porting note: explicitly supplied `f` ← Finset.prod_insert (f := fun i => ((sec M (f i)).snd : R)) (s.not_mem_erase i), Finset.insert_erase hi] rfl #align is_localization.exist_integer_multiples IsLocalization.exist_integer_multiples
Mathlib/RingTheory/Localization/Integer.lean
107
111
theorem exist_integer_multiples_of_finite {ΞΉ : Type*} [Finite ΞΉ] (f : ΞΉ β†’ S) : βˆƒ b : M, βˆ€ i, IsLocalization.IsInteger R ((b : R) β€’ f i) := by
cases nonempty_fintype ι obtain ⟨b, hb⟩ := exist_integer_multiples M Finset.univ f exact ⟨b, fun i => hb i (Finset.mem_univ _)⟩
1,323
import Mathlib.RingTheory.Localization.Basic #align_import ring_theory.localization.integer from "leanprover-community/mathlib"@"9556784a5b84697562e9c6acb40500d4a82e675a" variable {R : Type*} [CommSemiring R] {M : Submonoid R} {S : Type*} [CommSemiring S] variable [Algebra R S] {P : Type*} [CommSemiring P] open Function namespace IsLocalization section variable (R) -- TODO: define a subalgebra of `IsInteger`s def IsInteger (a : S) : Prop := a ∈ (algebraMap R S).rangeS #align is_localization.is_integer IsLocalization.IsInteger end theorem isInteger_zero : IsInteger R (0 : S) := Subsemiring.zero_mem _ #align is_localization.is_integer_zero IsLocalization.isInteger_zero theorem isInteger_one : IsInteger R (1 : S) := Subsemiring.one_mem _ #align is_localization.is_integer_one IsLocalization.isInteger_one theorem isInteger_add {a b : S} (ha : IsInteger R a) (hb : IsInteger R b) : IsInteger R (a + b) := Subsemiring.add_mem _ ha hb #align is_localization.is_integer_add IsLocalization.isInteger_add theorem isInteger_mul {a b : S} (ha : IsInteger R a) (hb : IsInteger R b) : IsInteger R (a * b) := Subsemiring.mul_mem _ ha hb #align is_localization.is_integer_mul IsLocalization.isInteger_mul theorem isInteger_smul {a : R} {b : S} (hb : IsInteger R b) : IsInteger R (a β€’ b) := by rcases hb with ⟨b', hb⟩ use a * b' rw [← hb, (algebraMap R S).map_mul, Algebra.smul_def] #align is_localization.is_integer_smul IsLocalization.isInteger_smul variable (M) variable [IsLocalization M S] theorem exists_integer_multiple' (a : S) : βˆƒ b : M, IsInteger R (a * algebraMap R S b) := let ⟨⟨Num, denom⟩, h⟩ := IsLocalization.surj _ a ⟨denom, Set.mem_range.mpr ⟨Num, h.symm⟩⟩ #align is_localization.exists_integer_multiple' IsLocalization.exists_integer_multiple' theorem exists_integer_multiple (a : S) : βˆƒ b : M, IsInteger R ((b : R) β€’ a) := by simp_rw [Algebra.smul_def, mul_comm _ a] apply exists_integer_multiple' #align is_localization.exists_integer_multiple IsLocalization.exists_integer_multiple theorem exist_integer_multiples {ΞΉ : Type*} (s : Finset ΞΉ) (f : ΞΉ β†’ S) : βˆƒ b : M, βˆ€ i ∈ s, IsLocalization.IsInteger R ((b : R) β€’ f i) := by haveI := Classical.propDecidable refine ⟨∏ i ∈ s, (sec M (f i)).2, fun i hi => ⟨?_, ?_⟩⟩ Β· exact (∏ j ∈ s.erase i, (sec M (f j)).2) * (sec M (f i)).1 rw [RingHom.map_mul, sec_spec', ← mul_assoc, ← (algebraMap R S).map_mul, ← Algebra.smul_def] congr 2 refine _root_.trans ?_ (map_prod (Submonoid.subtype M) _ _).symm rw [mul_comm,Submonoid.coe_finset_prod, -- Porting note: explicitly supplied `f` ← Finset.prod_insert (f := fun i => ((sec M (f i)).snd : R)) (s.not_mem_erase i), Finset.insert_erase hi] rfl #align is_localization.exist_integer_multiples IsLocalization.exist_integer_multiples theorem exist_integer_multiples_of_finite {ΞΉ : Type*} [Finite ΞΉ] (f : ΞΉ β†’ S) : βˆƒ b : M, βˆ€ i, IsLocalization.IsInteger R ((b : R) β€’ f i) := by cases nonempty_fintype ΞΉ obtain ⟨b, hb⟩ := exist_integer_multiples M Finset.univ f exact ⟨b, fun i => hb i (Finset.mem_univ _)⟩ #align is_localization.exist_integer_multiples_of_finite IsLocalization.exist_integer_multiples_of_finite theorem exist_integer_multiples_of_finset (s : Finset S) : βˆƒ b : M, βˆ€ a ∈ s, IsInteger R ((b : R) β€’ a) := exist_integer_multiples M s id #align is_localization.exist_integer_multiples_of_finset IsLocalization.exist_integer_multiples_of_finset noncomputable def commonDenom {ΞΉ : Type*} (s : Finset ΞΉ) (f : ΞΉ β†’ S) : M := (exist_integer_multiples M s f).choose #align is_localization.common_denom IsLocalization.commonDenom noncomputable def integerMultiple {ΞΉ : Type*} (s : Finset ΞΉ) (f : ΞΉ β†’ S) (i : s) : R := ((exist_integer_multiples M s f).choose_spec i i.prop).choose #align is_localization.integer_multiple IsLocalization.integerMultiple @[simp] theorem map_integerMultiple {ΞΉ : Type*} (s : Finset ΞΉ) (f : ΞΉ β†’ S) (i : s) : algebraMap R S (integerMultiple M s f i) = commonDenom M s f β€’ f i := ((exist_integer_multiples M s f).choose_spec _ i.prop).choose_spec #align is_localization.map_integer_multiple IsLocalization.map_integerMultiple noncomputable def commonDenomOfFinset (s : Finset S) : M := commonDenom M s id #align is_localization.common_denom_of_finset IsLocalization.commonDenomOfFinset noncomputable def finsetIntegerMultiple [DecidableEq R] (s : Finset S) : Finset R := s.attach.image fun t => integerMultiple M s id t #align is_localization.finset_integer_multiple IsLocalization.finsetIntegerMultiple open Pointwise
Mathlib/RingTheory/Localization/Integer.lean
149
159
theorem finsetIntegerMultiple_image [DecidableEq R] (s : Finset S) : algebraMap R S '' finsetIntegerMultiple M s = commonDenomOfFinset M s β€’ (s : Set S) := by
delta finsetIntegerMultiple commonDenom rw [Finset.coe_image] ext constructor · rintro ⟨_, ⟨x, -, rfl⟩, rfl⟩ rw [map_integerMultiple] exact Set.mem_image_of_mem _ x.prop · rintro ⟨x, hx, rfl⟩ exact ⟨_, ⟨⟨x, hx⟩, s.mem_attach _, rfl⟩, map_integerMultiple M s id _⟩
1,323
import Mathlib.RingTheory.Localization.FractionRing import Mathlib.RingTheory.Localization.Integer import Mathlib.RingTheory.UniqueFactorizationDomain #align_import ring_theory.localization.num_denom from "leanprover-community/mathlib"@"831c494092374cfe9f50591ed0ac81a25efc5b86" variable {R : Type*} [CommRing R] (M : Submonoid R) {S : Type*} [CommRing S] variable [Algebra R S] {P : Type*} [CommRing P] namespace IsFractionRing open IsLocalization section NumDen variable (A : Type*) [CommRing A] [IsDomain A] [UniqueFactorizationMonoid A] variable {K : Type*} [Field K] [Algebra A K] [IsFractionRing A K]
Mathlib/RingTheory/Localization/NumDen.lean
37
47
theorem exists_reduced_fraction (x : K) : βˆƒ (a : A) (b : nonZeroDivisors A), IsRelPrime a b ∧ mk' K a b = x := by
obtain ⟨⟨b, b_nonzero⟩, a, hab⟩ := exists_integer_multiple (nonZeroDivisors A) x obtain ⟨a', b', c', no_factor, rfl, rfl⟩ := UniqueFactorizationMonoid.exists_reduced_factors' a b (mem_nonZeroDivisors_iff_ne_zero.mp b_nonzero) obtain ⟨_, b'_nonzero⟩ := mul_mem_nonZeroDivisors.mp b_nonzero refine ⟨a', ⟨b', b'_nonzero⟩, no_factor, ?_⟩ refine mul_left_cancelβ‚€ (IsFractionRing.to_map_ne_zero_of_mem_nonZeroDivisors b_nonzero) ?_ simp only [Subtype.coe_mk, RingHom.map_mul, Algebra.smul_def] at * erw [← hab, mul_assoc, mk'_spec' _ a' ⟨b', b'_nonzero⟩]
1,324
import Mathlib.RingTheory.Localization.FractionRing import Mathlib.RingTheory.Localization.Integer import Mathlib.RingTheory.UniqueFactorizationDomain #align_import ring_theory.localization.num_denom from "leanprover-community/mathlib"@"831c494092374cfe9f50591ed0ac81a25efc5b86" variable {R : Type*} [CommRing R] (M : Submonoid R) {S : Type*} [CommRing S] variable [Algebra R S] {P : Type*} [CommRing P] namespace IsFractionRing open IsLocalization section NumDen variable (A : Type*) [CommRing A] [IsDomain A] [UniqueFactorizationMonoid A] variable {K : Type*} [Field K] [Algebra A K] [IsFractionRing A K] theorem exists_reduced_fraction (x : K) : βˆƒ (a : A) (b : nonZeroDivisors A), IsRelPrime a b ∧ mk' K a b = x := by obtain ⟨⟨b, b_nonzero⟩, a, hab⟩ := exists_integer_multiple (nonZeroDivisors A) x obtain ⟨a', b', c', no_factor, rfl, rfl⟩ := UniqueFactorizationMonoid.exists_reduced_factors' a b (mem_nonZeroDivisors_iff_ne_zero.mp b_nonzero) obtain ⟨_, b'_nonzero⟩ := mul_mem_nonZeroDivisors.mp b_nonzero refine ⟨a', ⟨b', b'_nonzero⟩, no_factor, ?_⟩ refine mul_left_cancelβ‚€ (IsFractionRing.to_map_ne_zero_of_mem_nonZeroDivisors b_nonzero) ?_ simp only [Subtype.coe_mk, RingHom.map_mul, Algebra.smul_def] at * erw [← hab, mul_assoc, mk'_spec' _ a' ⟨b', b'_nonzero⟩] #align is_fraction_ring.exists_reduced_fraction IsFractionRing.exists_reduced_fraction noncomputable def num (x : K) : A := Classical.choose (exists_reduced_fraction A x) #align is_fraction_ring.num IsFractionRing.num noncomputable def den (x : K) : nonZeroDivisors A := Classical.choose (Classical.choose_spec (exists_reduced_fraction A x)) #align is_fraction_ring.denom IsFractionRing.den theorem num_den_reduced (x : K) : IsRelPrime (num A x) (den A x) := (Classical.choose_spec (Classical.choose_spec (exists_reduced_fraction A x))).1 #align is_fraction_ring.num_denom_reduced IsFractionRing.num_den_reduced -- @[simp] -- Porting note: LHS reduces to give the simp lemma below theorem mk'_num_den (x : K) : mk' K (num A x) (den A x) = x := (Classical.choose_spec (Classical.choose_spec (exists_reduced_fraction A x))).2 #align is_fraction_ring.mk'_num_denom IsFractionRing.mk'_num_den @[simp]
Mathlib/RingTheory/Localization/NumDen.lean
70
72
theorem mk'_num_den' (x : K) : algebraMap A K (num A x) / algebraMap A K (den A x) = x := by
rw [← mk'_eq_div] apply mk'_num_den
1,324
import Mathlib.RingTheory.Localization.FractionRing import Mathlib.RingTheory.Localization.Integer import Mathlib.RingTheory.UniqueFactorizationDomain #align_import ring_theory.localization.num_denom from "leanprover-community/mathlib"@"831c494092374cfe9f50591ed0ac81a25efc5b86" variable {R : Type*} [CommRing R] (M : Submonoid R) {S : Type*} [CommRing S] variable [Algebra R S] {P : Type*} [CommRing P] namespace IsFractionRing open IsLocalization section NumDen variable (A : Type*) [CommRing A] [IsDomain A] [UniqueFactorizationMonoid A] variable {K : Type*} [Field K] [Algebra A K] [IsFractionRing A K] theorem exists_reduced_fraction (x : K) : βˆƒ (a : A) (b : nonZeroDivisors A), IsRelPrime a b ∧ mk' K a b = x := by obtain ⟨⟨b, b_nonzero⟩, a, hab⟩ := exists_integer_multiple (nonZeroDivisors A) x obtain ⟨a', b', c', no_factor, rfl, rfl⟩ := UniqueFactorizationMonoid.exists_reduced_factors' a b (mem_nonZeroDivisors_iff_ne_zero.mp b_nonzero) obtain ⟨_, b'_nonzero⟩ := mul_mem_nonZeroDivisors.mp b_nonzero refine ⟨a', ⟨b', b'_nonzero⟩, no_factor, ?_⟩ refine mul_left_cancelβ‚€ (IsFractionRing.to_map_ne_zero_of_mem_nonZeroDivisors b_nonzero) ?_ simp only [Subtype.coe_mk, RingHom.map_mul, Algebra.smul_def] at * erw [← hab, mul_assoc, mk'_spec' _ a' ⟨b', b'_nonzero⟩] #align is_fraction_ring.exists_reduced_fraction IsFractionRing.exists_reduced_fraction noncomputable def num (x : K) : A := Classical.choose (exists_reduced_fraction A x) #align is_fraction_ring.num IsFractionRing.num noncomputable def den (x : K) : nonZeroDivisors A := Classical.choose (Classical.choose_spec (exists_reduced_fraction A x)) #align is_fraction_ring.denom IsFractionRing.den theorem num_den_reduced (x : K) : IsRelPrime (num A x) (den A x) := (Classical.choose_spec (Classical.choose_spec (exists_reduced_fraction A x))).1 #align is_fraction_ring.num_denom_reduced IsFractionRing.num_den_reduced -- @[simp] -- Porting note: LHS reduces to give the simp lemma below theorem mk'_num_den (x : K) : mk' K (num A x) (den A x) = x := (Classical.choose_spec (Classical.choose_spec (exists_reduced_fraction A x))).2 #align is_fraction_ring.mk'_num_denom IsFractionRing.mk'_num_den @[simp] theorem mk'_num_den' (x : K) : algebraMap A K (num A x) / algebraMap A K (den A x) = x := by rw [← mk'_eq_div] apply mk'_num_den variable {A} theorem num_mul_den_eq_num_iff_eq {x y : K} : x * algebraMap A K (den A y) = algebraMap A K (num A y) ↔ x = y := ⟨fun h => by simpa only [mk'_num_den] using eq_mk'_iff_mul_eq.mpr h, fun h ↦ eq_mk'_iff_mul_eq.mp (by rw [h, mk'_num_den])⟩ #align is_fraction_ring.num_mul_denom_eq_num_iff_eq IsFractionRing.num_mul_den_eq_num_iff_eq theorem num_mul_den_eq_num_iff_eq' {x y : K} : y * algebraMap A K (den A x) = algebraMap A K (num A x) ↔ x = y := ⟨fun h ↦ by simpa only [eq_comm, mk'_num_den] using eq_mk'_iff_mul_eq.mpr h, fun h ↦ eq_mk'_iff_mul_eq.mp (by rw [h, mk'_num_den])⟩ #align is_fraction_ring.num_mul_denom_eq_num_iff_eq' IsFractionRing.num_mul_den_eq_num_iff_eq' theorem num_mul_den_eq_num_mul_den_iff_eq {x y : K} : num A y * den A x = num A x * den A y ↔ x = y := ⟨fun h ↦ by simpa only [mk'_num_den] using mk'_eq_of_eq' (S := K) h, fun h ↦ by rw [h]⟩ #align is_fraction_ring.num_mul_denom_eq_num_mul_denom_iff_eq IsFractionRing.num_mul_den_eq_num_mul_den_iff_eq theorem eq_zero_of_num_eq_zero {x : K} (h : num A x = 0) : x = 0 := num_mul_den_eq_num_iff_eq'.mp (by rw [zero_mul, h, RingHom.map_zero]) #align is_fraction_ring.eq_zero_of_num_eq_zero IsFractionRing.eq_zero_of_num_eq_zero
Mathlib/RingTheory/Localization/NumDen.lean
97
105
theorem isInteger_of_isUnit_den {x : K} (h : IsUnit (den A x : A)) : IsInteger A x := by
cases' h with d hd have d_ne_zero : algebraMap A K (den A x) β‰  0 := IsFractionRing.to_map_ne_zero_of_mem_nonZeroDivisors (den A x).2 use ↑d⁻¹ * num A x refine _root_.trans ?_ (mk'_num_den A x) rw [map_mul, map_units_inv, hd] apply mul_left_cancelβ‚€ d_ne_zero rw [← mul_assoc, mul_inv_cancel d_ne_zero, one_mul, mk'_spec']
1,324
import Mathlib.RingTheory.Localization.AtPrime import Mathlib.RingTheory.Localization.Basic import Mathlib.RingTheory.Localization.FractionRing #align_import ring_theory.localization.localization_localization from "leanprover-community/mathlib"@"831c494092374cfe9f50591ed0ac81a25efc5b86" open Function namespace IsLocalization section LocalizationLocalization variable {R : Type*} [CommSemiring R] (M : Submonoid R) {S : Type*} [CommSemiring S] variable [Algebra R S] {P : Type*} [CommSemiring P] variable (N : Submonoid S) (T : Type*) [CommSemiring T] [Algebra R T] section variable [Algebra S T] [IsScalarTower R S T] -- This should only be defined when `S` is the localization `M⁻¹R`, hence the nolint. @[nolint unusedArguments] def localizationLocalizationSubmodule : Submonoid R := (N βŠ” M.map (algebraMap R S)).comap (algebraMap R S) #align is_localization.localization_localization_submodule IsLocalization.localizationLocalizationSubmodule variable {M N} @[simp]
Mathlib/RingTheory/Localization/LocalizationLocalization.lean
53
61
theorem mem_localizationLocalizationSubmodule {x : R} : x ∈ localizationLocalizationSubmodule M N ↔ βˆƒ (y : N) (z : M), algebraMap R S x = y * algebraMap R S z := by
rw [localizationLocalizationSubmodule, Submonoid.mem_comap, Submonoid.mem_sup] constructor · rintro ⟨y, hy, _, ⟨z, hz, rfl⟩, e⟩ exact ⟨⟨y, hy⟩, ⟨z, hz⟩, e.symm⟩ · rintro ⟨y, z, e⟩ exact ⟨y, y.prop, _, ⟨z, z.prop, rfl⟩, e.symm⟩
1,325
import Mathlib.RingTheory.Localization.AtPrime import Mathlib.RingTheory.Localization.Basic import Mathlib.RingTheory.Localization.FractionRing #align_import ring_theory.localization.localization_localization from "leanprover-community/mathlib"@"831c494092374cfe9f50591ed0ac81a25efc5b86" open Function namespace IsLocalization section LocalizationLocalization variable {R : Type*} [CommSemiring R] (M : Submonoid R) {S : Type*} [CommSemiring S] variable [Algebra R S] {P : Type*} [CommSemiring P] variable (N : Submonoid S) (T : Type*) [CommSemiring T] [Algebra R T] section variable [Algebra S T] [IsScalarTower R S T] -- This should only be defined when `S` is the localization `M⁻¹R`, hence the nolint. @[nolint unusedArguments] def localizationLocalizationSubmodule : Submonoid R := (N βŠ” M.map (algebraMap R S)).comap (algebraMap R S) #align is_localization.localization_localization_submodule IsLocalization.localizationLocalizationSubmodule variable {M N} @[simp] theorem mem_localizationLocalizationSubmodule {x : R} : x ∈ localizationLocalizationSubmodule M N ↔ βˆƒ (y : N) (z : M), algebraMap R S x = y * algebraMap R S z := by rw [localizationLocalizationSubmodule, Submonoid.mem_comap, Submonoid.mem_sup] constructor Β· rintro ⟨y, hy, _, ⟨z, hz, rfl⟩, e⟩ exact ⟨⟨y, hy⟩, ⟨z, hz⟩, e.symm⟩ Β· rintro ⟨y, z, e⟩ exact ⟨y, y.prop, _, ⟨z, z.prop, rfl⟩, e.symm⟩ #align is_localization.mem_localization_localization_submodule IsLocalization.mem_localizationLocalizationSubmodule variable (M N) [IsLocalization M S]
Mathlib/RingTheory/Localization/LocalizationLocalization.lean
66
70
theorem localization_localization_map_units [IsLocalization N T] (y : localizationLocalizationSubmodule M N) : IsUnit (algebraMap R T y) := by
obtain ⟨y', z, eq⟩ := mem_localizationLocalizationSubmodule.mp y.prop rw [IsScalarTower.algebraMap_apply R S T, eq, RingHom.map_mul, IsUnit.mul_iff] exact ⟨IsLocalization.map_units T y', (IsLocalization.map_units _ z).map (algebraMap S T)⟩
1,325
import Mathlib.RingTheory.Localization.AtPrime import Mathlib.RingTheory.Localization.Basic import Mathlib.RingTheory.Localization.FractionRing #align_import ring_theory.localization.localization_localization from "leanprover-community/mathlib"@"831c494092374cfe9f50591ed0ac81a25efc5b86" open Function namespace IsLocalization section LocalizationLocalization variable {R : Type*} [CommSemiring R] (M : Submonoid R) {S : Type*} [CommSemiring S] variable [Algebra R S] {P : Type*} [CommSemiring P] variable (N : Submonoid S) (T : Type*) [CommSemiring T] [Algebra R T] section variable [Algebra S T] [IsScalarTower R S T] -- This should only be defined when `S` is the localization `M⁻¹R`, hence the nolint. @[nolint unusedArguments] def localizationLocalizationSubmodule : Submonoid R := (N βŠ” M.map (algebraMap R S)).comap (algebraMap R S) #align is_localization.localization_localization_submodule IsLocalization.localizationLocalizationSubmodule variable {M N} @[simp] theorem mem_localizationLocalizationSubmodule {x : R} : x ∈ localizationLocalizationSubmodule M N ↔ βˆƒ (y : N) (z : M), algebraMap R S x = y * algebraMap R S z := by rw [localizationLocalizationSubmodule, Submonoid.mem_comap, Submonoid.mem_sup] constructor Β· rintro ⟨y, hy, _, ⟨z, hz, rfl⟩, e⟩ exact ⟨⟨y, hy⟩, ⟨z, hz⟩, e.symm⟩ Β· rintro ⟨y, z, e⟩ exact ⟨y, y.prop, _, ⟨z, z.prop, rfl⟩, e.symm⟩ #align is_localization.mem_localization_localization_submodule IsLocalization.mem_localizationLocalizationSubmodule variable (M N) [IsLocalization M S] theorem localization_localization_map_units [IsLocalization N T] (y : localizationLocalizationSubmodule M N) : IsUnit (algebraMap R T y) := by obtain ⟨y', z, eq⟩ := mem_localizationLocalizationSubmodule.mp y.prop rw [IsScalarTower.algebraMap_apply R S T, eq, RingHom.map_mul, IsUnit.mul_iff] exact ⟨IsLocalization.map_units T y', (IsLocalization.map_units _ z).map (algebraMap S T)⟩ #align is_localization.localization_localization_map_units IsLocalization.localization_localization_map_units
Mathlib/RingTheory/Localization/LocalizationLocalization.lean
73
89
theorem localization_localization_surj [IsLocalization N T] (x : T) : βˆƒ y : R Γ— localizationLocalizationSubmodule M N, x * algebraMap R T y.2 = algebraMap R T y.1 := by
rcases IsLocalization.surj N x with ⟨⟨y, s⟩, eqβ‚βŸ© -- x = y / s rcases IsLocalization.surj M y with ⟨⟨z, t⟩, eqβ‚‚βŸ© -- y = z / t rcases IsLocalization.surj M (s : S) with ⟨⟨z', t'⟩, eqβ‚ƒβŸ© -- s = z' / t' dsimp only at eq₁ eqβ‚‚ eq₃ refine ⟨⟨z * t', z' * t, ?_⟩, ?_⟩ -- x = y / s = (z * t') / (z' * t) Β· rw [mem_localizationLocalizationSubmodule] refine ⟨s, t * t', ?_⟩ rw [RingHom.map_mul, ← eq₃, mul_assoc, ← RingHom.map_mul, mul_comm t, Submonoid.coe_mul] Β· simp only [Subtype.coe_mk, RingHom.map_mul, IsScalarTower.algebraMap_apply R S T, ← eq₃, ← eqβ‚‚, ← eq₁] ring
1,325
import Mathlib.RingTheory.Localization.AtPrime import Mathlib.RingTheory.Localization.Basic import Mathlib.RingTheory.Localization.FractionRing #align_import ring_theory.localization.localization_localization from "leanprover-community/mathlib"@"831c494092374cfe9f50591ed0ac81a25efc5b86" open Function namespace IsLocalization section LocalizationLocalization variable {R : Type*} [CommSemiring R] (M : Submonoid R) {S : Type*} [CommSemiring S] variable [Algebra R S] {P : Type*} [CommSemiring P] variable (N : Submonoid S) (T : Type*) [CommSemiring T] [Algebra R T] section variable [Algebra S T] [IsScalarTower R S T] -- This should only be defined when `S` is the localization `M⁻¹R`, hence the nolint. @[nolint unusedArguments] def localizationLocalizationSubmodule : Submonoid R := (N βŠ” M.map (algebraMap R S)).comap (algebraMap R S) #align is_localization.localization_localization_submodule IsLocalization.localizationLocalizationSubmodule variable {M N} @[simp] theorem mem_localizationLocalizationSubmodule {x : R} : x ∈ localizationLocalizationSubmodule M N ↔ βˆƒ (y : N) (z : M), algebraMap R S x = y * algebraMap R S z := by rw [localizationLocalizationSubmodule, Submonoid.mem_comap, Submonoid.mem_sup] constructor Β· rintro ⟨y, hy, _, ⟨z, hz, rfl⟩, e⟩ exact ⟨⟨y, hy⟩, ⟨z, hz⟩, e.symm⟩ Β· rintro ⟨y, z, e⟩ exact ⟨y, y.prop, _, ⟨z, z.prop, rfl⟩, e.symm⟩ #align is_localization.mem_localization_localization_submodule IsLocalization.mem_localizationLocalizationSubmodule variable (M N) [IsLocalization M S] theorem localization_localization_map_units [IsLocalization N T] (y : localizationLocalizationSubmodule M N) : IsUnit (algebraMap R T y) := by obtain ⟨y', z, eq⟩ := mem_localizationLocalizationSubmodule.mp y.prop rw [IsScalarTower.algebraMap_apply R S T, eq, RingHom.map_mul, IsUnit.mul_iff] exact ⟨IsLocalization.map_units T y', (IsLocalization.map_units _ z).map (algebraMap S T)⟩ #align is_localization.localization_localization_map_units IsLocalization.localization_localization_map_units theorem localization_localization_surj [IsLocalization N T] (x : T) : βˆƒ y : R Γ— localizationLocalizationSubmodule M N, x * algebraMap R T y.2 = algebraMap R T y.1 := by rcases IsLocalization.surj N x with ⟨⟨y, s⟩, eqβ‚βŸ© -- x = y / s rcases IsLocalization.surj M y with ⟨⟨z, t⟩, eqβ‚‚βŸ© -- y = z / t rcases IsLocalization.surj M (s : S) with ⟨⟨z', t'⟩, eqβ‚ƒβŸ© -- s = z' / t' dsimp only at eq₁ eqβ‚‚ eq₃ refine ⟨⟨z * t', z' * t, ?_⟩, ?_⟩ -- x = y / s = (z * t') / (z' * t) Β· rw [mem_localizationLocalizationSubmodule] refine ⟨s, t * t', ?_⟩ rw [RingHom.map_mul, ← eq₃, mul_assoc, ← RingHom.map_mul, mul_comm t, Submonoid.coe_mul] Β· simp only [Subtype.coe_mk, RingHom.map_mul, IsScalarTower.algebraMap_apply R S T, ← eq₃, ← eqβ‚‚, ← eq₁] ring #align is_localization.localization_localization_surj IsLocalization.localization_localization_surj
Mathlib/RingTheory/Localization/LocalizationLocalization.lean
92
108
theorem localization_localization_exists_of_eq [IsLocalization N T] (x y : R) : algebraMap R T x = algebraMap R T y β†’ βˆƒ c : localizationLocalizationSubmodule M N, ↑c * x = ↑c * y := by
rw [IsScalarTower.algebraMap_apply R S T, IsScalarTower.algebraMap_apply R S T, IsLocalization.eq_iff_exists N T] rintro ⟨z, eqβ‚βŸ© rcases IsLocalization.surj M (z : S) with ⟨⟨z', s⟩, eqβ‚‚βŸ© dsimp only at eqβ‚‚ suffices (algebraMap R S) (x * z' : R) = (algebraMap R S) (y * z') by obtain ⟨c, eq₃ : ↑c * (x * z') = ↑c * (y * z')⟩ := (IsLocalization.eq_iff_exists M S).mp this refine ⟨⟨c * z', ?_⟩, ?_⟩ Β· rw [mem_localizationLocalizationSubmodule] refine ⟨z, c * s, ?_⟩ rw [map_mul, ← eqβ‚‚, Submonoid.coe_mul, map_mul, mul_left_comm] Β· rwa [mul_comm _ z', mul_comm _ z', ← mul_assoc, ← mul_assoc] at eq₃ rw [map_mul, map_mul, ← eqβ‚‚, ← mul_assoc, ← mul_assoc, mul_comm _ (z : S), eq₁, mul_comm _ (z : S)]
1,325
import Mathlib.RingTheory.Localization.AtPrime import Mathlib.RingTheory.Localization.Basic import Mathlib.RingTheory.Localization.FractionRing #align_import ring_theory.localization.localization_localization from "leanprover-community/mathlib"@"831c494092374cfe9f50591ed0ac81a25efc5b86" open Function namespace IsLocalization section LocalizationLocalization variable {R : Type*} [CommSemiring R] (M : Submonoid R) {S : Type*} [CommSemiring S] variable [Algebra R S] {P : Type*} [CommSemiring P] variable (N : Submonoid S) (T : Type*) [CommSemiring T] [Algebra R T] section variable [Algebra S T] [IsScalarTower R S T] -- This should only be defined when `S` is the localization `M⁻¹R`, hence the nolint. @[nolint unusedArguments] def localizationLocalizationSubmodule : Submonoid R := (N βŠ” M.map (algebraMap R S)).comap (algebraMap R S) #align is_localization.localization_localization_submodule IsLocalization.localizationLocalizationSubmodule variable {M N} @[simp] theorem mem_localizationLocalizationSubmodule {x : R} : x ∈ localizationLocalizationSubmodule M N ↔ βˆƒ (y : N) (z : M), algebraMap R S x = y * algebraMap R S z := by rw [localizationLocalizationSubmodule, Submonoid.mem_comap, Submonoid.mem_sup] constructor Β· rintro ⟨y, hy, _, ⟨z, hz, rfl⟩, e⟩ exact ⟨⟨y, hy⟩, ⟨z, hz⟩, e.symm⟩ Β· rintro ⟨y, z, e⟩ exact ⟨y, y.prop, _, ⟨z, z.prop, rfl⟩, e.symm⟩ #align is_localization.mem_localization_localization_submodule IsLocalization.mem_localizationLocalizationSubmodule variable (M N) [IsLocalization M S] theorem localization_localization_map_units [IsLocalization N T] (y : localizationLocalizationSubmodule M N) : IsUnit (algebraMap R T y) := by obtain ⟨y', z, eq⟩ := mem_localizationLocalizationSubmodule.mp y.prop rw [IsScalarTower.algebraMap_apply R S T, eq, RingHom.map_mul, IsUnit.mul_iff] exact ⟨IsLocalization.map_units T y', (IsLocalization.map_units _ z).map (algebraMap S T)⟩ #align is_localization.localization_localization_map_units IsLocalization.localization_localization_map_units theorem localization_localization_surj [IsLocalization N T] (x : T) : βˆƒ y : R Γ— localizationLocalizationSubmodule M N, x * algebraMap R T y.2 = algebraMap R T y.1 := by rcases IsLocalization.surj N x with ⟨⟨y, s⟩, eqβ‚βŸ© -- x = y / s rcases IsLocalization.surj M y with ⟨⟨z, t⟩, eqβ‚‚βŸ© -- y = z / t rcases IsLocalization.surj M (s : S) with ⟨⟨z', t'⟩, eqβ‚ƒβŸ© -- s = z' / t' dsimp only at eq₁ eqβ‚‚ eq₃ refine ⟨⟨z * t', z' * t, ?_⟩, ?_⟩ -- x = y / s = (z * t') / (z' * t) Β· rw [mem_localizationLocalizationSubmodule] refine ⟨s, t * t', ?_⟩ rw [RingHom.map_mul, ← eq₃, mul_assoc, ← RingHom.map_mul, mul_comm t, Submonoid.coe_mul] Β· simp only [Subtype.coe_mk, RingHom.map_mul, IsScalarTower.algebraMap_apply R S T, ← eq₃, ← eqβ‚‚, ← eq₁] ring #align is_localization.localization_localization_surj IsLocalization.localization_localization_surj theorem localization_localization_exists_of_eq [IsLocalization N T] (x y : R) : algebraMap R T x = algebraMap R T y β†’ βˆƒ c : localizationLocalizationSubmodule M N, ↑c * x = ↑c * y := by rw [IsScalarTower.algebraMap_apply R S T, IsScalarTower.algebraMap_apply R S T, IsLocalization.eq_iff_exists N T] rintro ⟨z, eqβ‚βŸ© rcases IsLocalization.surj M (z : S) with ⟨⟨z', s⟩, eqβ‚‚βŸ© dsimp only at eqβ‚‚ suffices (algebraMap R S) (x * z' : R) = (algebraMap R S) (y * z') by obtain ⟨c, eq₃ : ↑c * (x * z') = ↑c * (y * z')⟩ := (IsLocalization.eq_iff_exists M S).mp this refine ⟨⟨c * z', ?_⟩, ?_⟩ Β· rw [mem_localizationLocalizationSubmodule] refine ⟨z, c * s, ?_⟩ rw [map_mul, ← eqβ‚‚, Submonoid.coe_mul, map_mul, mul_left_comm] Β· rwa [mul_comm _ z', mul_comm _ z', ← mul_assoc, ← mul_assoc] at eq₃ rw [map_mul, map_mul, ← eqβ‚‚, ← mul_assoc, ← mul_assoc, mul_comm _ (z : S), eq₁, mul_comm _ (z : S)] #align is_localization.localization_localization_eq_iff_exists IsLocalization.localization_localization_exists_of_eqβ‚“ theorem localization_localization_isLocalization [IsLocalization N T] : IsLocalization (localizationLocalizationSubmodule M N) T := { map_units' := localization_localization_map_units M N T surj' := localization_localization_surj M N T exists_of_eq := localization_localization_exists_of_eq M N T _ _ } #align is_localization.localization_localization_is_localization IsLocalization.localization_localization_isLocalization
Mathlib/RingTheory/Localization/LocalizationLocalization.lean
125
133
theorem localization_localization_isLocalization_of_has_all_units [IsLocalization N T] (H : βˆ€ x : S, IsUnit x β†’ x ∈ N) : IsLocalization (N.comap (algebraMap R S)) T := by
convert localization_localization_isLocalization M N T using 1 dsimp [localizationLocalizationSubmodule] congr symm rw [sup_eq_left] rintro _ ⟨x, hx, rfl⟩ exact H _ (IsLocalization.map_units _ ⟨x, hx⟩)
1,325
import Mathlib.RingTheory.Localization.LocalizationLocalization #align_import ring_theory.localization.as_subring from "leanprover-community/mathlib"@"649ca66bf4d62796b5eefef966e622d91aa471f3" namespace Localization open nonZeroDivisors variable {A : Type*} (K : Type*) [CommRing A] (S : Submonoid A) (hS : S ≀ A⁰) section CommRing variable [CommRing K] [Algebra A K] [IsFractionRing A K]
Mathlib/RingTheory/Localization/AsSubring.lean
31
32
theorem map_isUnit_of_le (hS : S ≀ A⁰) (s : S) : IsUnit (algebraMap A K s) := by
apply IsLocalization.map_units K (⟨s.1, hS s.2⟩ : A⁰)
1,326
import Mathlib.Algebra.Algebra.Bilinear import Mathlib.RingTheory.Localization.Basic #align_import algebra.module.localized_module from "leanprover-community/mathlib"@"831c494092374cfe9f50591ed0ac81a25efc5b86" namespace LocalizedModule universe u v variable {R : Type u} [CommSemiring R] (S : Submonoid R) variable (M : Type v) [AddCommMonoid M] [Module R M] variable (T : Type*) [CommSemiring T] [Algebra R T] [IsLocalization S T] def r (a b : M Γ— S) : Prop := βˆƒ u : S, u β€’ b.2 β€’ a.1 = u β€’ a.2 β€’ b.1 #align localized_module.r LocalizedModule.r theorem r.isEquiv : IsEquiv _ (r S M) := { refl := fun ⟨m, s⟩ => ⟨1, by rw [one_smul]⟩ trans := fun ⟨m1, s1⟩ ⟨m2, s2⟩ ⟨m3, s3⟩ ⟨u1, hu1⟩ ⟨u2, hu2⟩ => by use u1 * u2 * s2 -- Put everything in the same shape, sorting the terms using `simp` have hu1' := congr_arg ((u2 * s3) β€’ Β·) hu1.symm have hu2' := congr_arg ((u1 * s1) β€’ Β·) hu2.symm simp only [← mul_smul, smul_assoc, mul_assoc, mul_comm, mul_left_comm] at hu1' hu2' ⊒ rw [hu2', hu1'] symm := fun ⟨m1, s1⟩ ⟨m2, s2⟩ ⟨u, hu⟩ => ⟨u, hu.symm⟩ } #align localized_module.r.is_equiv LocalizedModule.r.isEquiv instance r.setoid : Setoid (M Γ— S) where r := r S M iseqv := ⟨(r.isEquiv S M).refl, (r.isEquiv S M).symm _ _, (r.isEquiv S M).trans _ _ _⟩ #align localized_module.r.setoid LocalizedModule.r.setoid -- TODO: change `Localization` to use `r'` instead of `r` so that the two types are also defeq, -- `Localization S = LocalizedModule S R`. example {R} [CommSemiring R] (S : Submonoid R) : ⇑(Localization.r' S) = LocalizedModule.r S R := rfl -- Porting note(#5171): @[nolint has_nonempty_instance] def _root_.LocalizedModule : Type max u v := Quotient (r.setoid S M) #align localized_module LocalizedModule section variable {M S} def mk (m : M) (s : S) : LocalizedModule S M := Quotient.mk' ⟨m, s⟩ #align localized_module.mk LocalizedModule.mk theorem mk_eq {m m' : M} {s s' : S} : mk m s = mk m' s' ↔ βˆƒ u : S, u β€’ s' β€’ m = u β€’ s β€’ m' := Quotient.eq' #align localized_module.mk_eq LocalizedModule.mk_eq @[elab_as_elim]
Mathlib/Algebra/Module/LocalizedModule.lean
99
102
theorem induction_on {Ξ² : LocalizedModule S M β†’ Prop} (h : βˆ€ (m : M) (s : S), Ξ² (mk m s)) : βˆ€ x : LocalizedModule S M, Ξ² x := by
rintro ⟨⟨m, s⟩⟩ exact h m s
1,327
import Mathlib.Algebra.Algebra.Bilinear import Mathlib.RingTheory.Localization.Basic #align_import algebra.module.localized_module from "leanprover-community/mathlib"@"831c494092374cfe9f50591ed0ac81a25efc5b86" namespace LocalizedModule universe u v variable {R : Type u} [CommSemiring R] (S : Submonoid R) variable (M : Type v) [AddCommMonoid M] [Module R M] variable (T : Type*) [CommSemiring T] [Algebra R T] [IsLocalization S T] def r (a b : M Γ— S) : Prop := βˆƒ u : S, u β€’ b.2 β€’ a.1 = u β€’ a.2 β€’ b.1 #align localized_module.r LocalizedModule.r theorem r.isEquiv : IsEquiv _ (r S M) := { refl := fun ⟨m, s⟩ => ⟨1, by rw [one_smul]⟩ trans := fun ⟨m1, s1⟩ ⟨m2, s2⟩ ⟨m3, s3⟩ ⟨u1, hu1⟩ ⟨u2, hu2⟩ => by use u1 * u2 * s2 -- Put everything in the same shape, sorting the terms using `simp` have hu1' := congr_arg ((u2 * s3) β€’ Β·) hu1.symm have hu2' := congr_arg ((u1 * s1) β€’ Β·) hu2.symm simp only [← mul_smul, smul_assoc, mul_assoc, mul_comm, mul_left_comm] at hu1' hu2' ⊒ rw [hu2', hu1'] symm := fun ⟨m1, s1⟩ ⟨m2, s2⟩ ⟨u, hu⟩ => ⟨u, hu.symm⟩ } #align localized_module.r.is_equiv LocalizedModule.r.isEquiv instance r.setoid : Setoid (M Γ— S) where r := r S M iseqv := ⟨(r.isEquiv S M).refl, (r.isEquiv S M).symm _ _, (r.isEquiv S M).trans _ _ _⟩ #align localized_module.r.setoid LocalizedModule.r.setoid -- TODO: change `Localization` to use `r'` instead of `r` so that the two types are also defeq, -- `Localization S = LocalizedModule S R`. example {R} [CommSemiring R] (S : Submonoid R) : ⇑(Localization.r' S) = LocalizedModule.r S R := rfl -- Porting note(#5171): @[nolint has_nonempty_instance] def _root_.LocalizedModule : Type max u v := Quotient (r.setoid S M) #align localized_module LocalizedModule section variable {M S} def mk (m : M) (s : S) : LocalizedModule S M := Quotient.mk' ⟨m, s⟩ #align localized_module.mk LocalizedModule.mk theorem mk_eq {m m' : M} {s s' : S} : mk m s = mk m' s' ↔ βˆƒ u : S, u β€’ s' β€’ m = u β€’ s β€’ m' := Quotient.eq' #align localized_module.mk_eq LocalizedModule.mk_eq @[elab_as_elim] theorem induction_on {Ξ² : LocalizedModule S M β†’ Prop} (h : βˆ€ (m : M) (s : S), Ξ² (mk m s)) : βˆ€ x : LocalizedModule S M, Ξ² x := by rintro ⟨⟨m, s⟩⟩ exact h m s #align localized_module.induction_on LocalizedModule.induction_on @[elab_as_elim]
Mathlib/Algebra/Module/LocalizedModule.lean
106
109
theorem induction_onβ‚‚ {Ξ² : LocalizedModule S M β†’ LocalizedModule S M β†’ Prop} (h : βˆ€ (m m' : M) (s s' : S), Ξ² (mk m s) (mk m' s')) : βˆ€ x y, Ξ² x y := by
rintro ⟨⟨m, s⟩⟩ ⟨⟨m', s'⟩⟩ exact h m m' s s'
1,327
import Mathlib.Algebra.Algebra.Bilinear import Mathlib.RingTheory.Localization.Basic #align_import algebra.module.localized_module from "leanprover-community/mathlib"@"831c494092374cfe9f50591ed0ac81a25efc5b86" namespace LocalizedModule universe u v variable {R : Type u} [CommSemiring R] (S : Submonoid R) variable (M : Type v) [AddCommMonoid M] [Module R M] variable (T : Type*) [CommSemiring T] [Algebra R T] [IsLocalization S T] def r (a b : M Γ— S) : Prop := βˆƒ u : S, u β€’ b.2 β€’ a.1 = u β€’ a.2 β€’ b.1 #align localized_module.r LocalizedModule.r theorem r.isEquiv : IsEquiv _ (r S M) := { refl := fun ⟨m, s⟩ => ⟨1, by rw [one_smul]⟩ trans := fun ⟨m1, s1⟩ ⟨m2, s2⟩ ⟨m3, s3⟩ ⟨u1, hu1⟩ ⟨u2, hu2⟩ => by use u1 * u2 * s2 -- Put everything in the same shape, sorting the terms using `simp` have hu1' := congr_arg ((u2 * s3) β€’ Β·) hu1.symm have hu2' := congr_arg ((u1 * s1) β€’ Β·) hu2.symm simp only [← mul_smul, smul_assoc, mul_assoc, mul_comm, mul_left_comm] at hu1' hu2' ⊒ rw [hu2', hu1'] symm := fun ⟨m1, s1⟩ ⟨m2, s2⟩ ⟨u, hu⟩ => ⟨u, hu.symm⟩ } #align localized_module.r.is_equiv LocalizedModule.r.isEquiv instance r.setoid : Setoid (M Γ— S) where r := r S M iseqv := ⟨(r.isEquiv S M).refl, (r.isEquiv S M).symm _ _, (r.isEquiv S M).trans _ _ _⟩ #align localized_module.r.setoid LocalizedModule.r.setoid -- TODO: change `Localization` to use `r'` instead of `r` so that the two types are also defeq, -- `Localization S = LocalizedModule S R`. example {R} [CommSemiring R] (S : Submonoid R) : ⇑(Localization.r' S) = LocalizedModule.r S R := rfl -- Porting note(#5171): @[nolint has_nonempty_instance] def _root_.LocalizedModule : Type max u v := Quotient (r.setoid S M) #align localized_module LocalizedModule section variable {M S} def mk (m : M) (s : S) : LocalizedModule S M := Quotient.mk' ⟨m, s⟩ #align localized_module.mk LocalizedModule.mk theorem mk_eq {m m' : M} {s s' : S} : mk m s = mk m' s' ↔ βˆƒ u : S, u β€’ s' β€’ m = u β€’ s β€’ m' := Quotient.eq' #align localized_module.mk_eq LocalizedModule.mk_eq @[elab_as_elim] theorem induction_on {Ξ² : LocalizedModule S M β†’ Prop} (h : βˆ€ (m : M) (s : S), Ξ² (mk m s)) : βˆ€ x : LocalizedModule S M, Ξ² x := by rintro ⟨⟨m, s⟩⟩ exact h m s #align localized_module.induction_on LocalizedModule.induction_on @[elab_as_elim] theorem induction_onβ‚‚ {Ξ² : LocalizedModule S M β†’ LocalizedModule S M β†’ Prop} (h : βˆ€ (m m' : M) (s s' : S), Ξ² (mk m s) (mk m' s')) : βˆ€ x y, Ξ² x y := by rintro ⟨⟨m, s⟩⟩ ⟨⟨m', s'⟩⟩ exact h m m' s s' #align localized_module.induction_onβ‚‚ LocalizedModule.induction_onβ‚‚ def liftOn {Ξ± : Type*} (x : LocalizedModule S M) (f : M Γ— S β†’ Ξ±) (wd : βˆ€ (p p' : M Γ— S), p β‰ˆ p' β†’ f p = f p') : Ξ± := Quotient.liftOn x f wd #align localized_module.lift_on LocalizedModule.liftOn
Mathlib/Algebra/Module/LocalizedModule.lean
120
121
theorem liftOn_mk {Ξ± : Type*} {f : M Γ— S β†’ Ξ±} (wd : βˆ€ (p p' : M Γ— S), p β‰ˆ p' β†’ f p = f p') (m : M) (s : S) : liftOn (mk m s) f wd = f ⟨m, s⟩ := by
convert Quotient.liftOn_mk f wd ⟨m, s⟩
1,327
import Mathlib.Algebra.Algebra.Bilinear import Mathlib.RingTheory.Localization.Basic #align_import algebra.module.localized_module from "leanprover-community/mathlib"@"831c494092374cfe9f50591ed0ac81a25efc5b86" namespace LocalizedModule universe u v variable {R : Type u} [CommSemiring R] (S : Submonoid R) variable (M : Type v) [AddCommMonoid M] [Module R M] variable (T : Type*) [CommSemiring T] [Algebra R T] [IsLocalization S T] def r (a b : M Γ— S) : Prop := βˆƒ u : S, u β€’ b.2 β€’ a.1 = u β€’ a.2 β€’ b.1 #align localized_module.r LocalizedModule.r theorem r.isEquiv : IsEquiv _ (r S M) := { refl := fun ⟨m, s⟩ => ⟨1, by rw [one_smul]⟩ trans := fun ⟨m1, s1⟩ ⟨m2, s2⟩ ⟨m3, s3⟩ ⟨u1, hu1⟩ ⟨u2, hu2⟩ => by use u1 * u2 * s2 -- Put everything in the same shape, sorting the terms using `simp` have hu1' := congr_arg ((u2 * s3) β€’ Β·) hu1.symm have hu2' := congr_arg ((u1 * s1) β€’ Β·) hu2.symm simp only [← mul_smul, smul_assoc, mul_assoc, mul_comm, mul_left_comm] at hu1' hu2' ⊒ rw [hu2', hu1'] symm := fun ⟨m1, s1⟩ ⟨m2, s2⟩ ⟨u, hu⟩ => ⟨u, hu.symm⟩ } #align localized_module.r.is_equiv LocalizedModule.r.isEquiv instance r.setoid : Setoid (M Γ— S) where r := r S M iseqv := ⟨(r.isEquiv S M).refl, (r.isEquiv S M).symm _ _, (r.isEquiv S M).trans _ _ _⟩ #align localized_module.r.setoid LocalizedModule.r.setoid -- TODO: change `Localization` to use `r'` instead of `r` so that the two types are also defeq, -- `Localization S = LocalizedModule S R`. example {R} [CommSemiring R] (S : Submonoid R) : ⇑(Localization.r' S) = LocalizedModule.r S R := rfl -- Porting note(#5171): @[nolint has_nonempty_instance] def _root_.LocalizedModule : Type max u v := Quotient (r.setoid S M) #align localized_module LocalizedModule section variable {M S} def mk (m : M) (s : S) : LocalizedModule S M := Quotient.mk' ⟨m, s⟩ #align localized_module.mk LocalizedModule.mk theorem mk_eq {m m' : M} {s s' : S} : mk m s = mk m' s' ↔ βˆƒ u : S, u β€’ s' β€’ m = u β€’ s β€’ m' := Quotient.eq' #align localized_module.mk_eq LocalizedModule.mk_eq @[elab_as_elim] theorem induction_on {Ξ² : LocalizedModule S M β†’ Prop} (h : βˆ€ (m : M) (s : S), Ξ² (mk m s)) : βˆ€ x : LocalizedModule S M, Ξ² x := by rintro ⟨⟨m, s⟩⟩ exact h m s #align localized_module.induction_on LocalizedModule.induction_on @[elab_as_elim] theorem induction_onβ‚‚ {Ξ² : LocalizedModule S M β†’ LocalizedModule S M β†’ Prop} (h : βˆ€ (m m' : M) (s s' : S), Ξ² (mk m s) (mk m' s')) : βˆ€ x y, Ξ² x y := by rintro ⟨⟨m, s⟩⟩ ⟨⟨m', s'⟩⟩ exact h m m' s s' #align localized_module.induction_onβ‚‚ LocalizedModule.induction_onβ‚‚ def liftOn {Ξ± : Type*} (x : LocalizedModule S M) (f : M Γ— S β†’ Ξ±) (wd : βˆ€ (p p' : M Γ— S), p β‰ˆ p' β†’ f p = f p') : Ξ± := Quotient.liftOn x f wd #align localized_module.lift_on LocalizedModule.liftOn theorem liftOn_mk {Ξ± : Type*} {f : M Γ— S β†’ Ξ±} (wd : βˆ€ (p p' : M Γ— S), p β‰ˆ p' β†’ f p = f p') (m : M) (s : S) : liftOn (mk m s) f wd = f ⟨m, s⟩ := by convert Quotient.liftOn_mk f wd ⟨m, s⟩ #align localized_module.lift_on_mk LocalizedModule.liftOn_mk def liftOnβ‚‚ {Ξ± : Type*} (x y : LocalizedModule S M) (f : M Γ— S β†’ M Γ— S β†’ Ξ±) (wd : βˆ€ (p q p' q' : M Γ— S), p β‰ˆ p' β†’ q β‰ˆ q' β†’ f p q = f p' q') : Ξ± := Quotient.liftOnβ‚‚ x y f wd #align localized_module.lift_onβ‚‚ LocalizedModule.liftOnβ‚‚
Mathlib/Algebra/Module/LocalizedModule.lean
132
135
theorem liftOnβ‚‚_mk {Ξ± : Type*} (f : M Γ— S β†’ M Γ— S β†’ Ξ±) (wd : βˆ€ (p q p' q' : M Γ— S), p β‰ˆ p' β†’ q β‰ˆ q' β†’ f p q = f p' q') (m m' : M) (s s' : S) : liftOnβ‚‚ (mk m s) (mk m' s') f wd = f ⟨m, s⟩ ⟨m', s'⟩ := by
convert Quotient.liftOnβ‚‚_mk f wd _ _
1,327
import Mathlib.Algebra.Algebra.Bilinear import Mathlib.RingTheory.Localization.Basic #align_import algebra.module.localized_module from "leanprover-community/mathlib"@"831c494092374cfe9f50591ed0ac81a25efc5b86" namespace LocalizedModule universe u v variable {R : Type u} [CommSemiring R] (S : Submonoid R) variable (M : Type v) [AddCommMonoid M] [Module R M] variable (T : Type*) [CommSemiring T] [Algebra R T] [IsLocalization S T] def r (a b : M Γ— S) : Prop := βˆƒ u : S, u β€’ b.2 β€’ a.1 = u β€’ a.2 β€’ b.1 #align localized_module.r LocalizedModule.r theorem r.isEquiv : IsEquiv _ (r S M) := { refl := fun ⟨m, s⟩ => ⟨1, by rw [one_smul]⟩ trans := fun ⟨m1, s1⟩ ⟨m2, s2⟩ ⟨m3, s3⟩ ⟨u1, hu1⟩ ⟨u2, hu2⟩ => by use u1 * u2 * s2 -- Put everything in the same shape, sorting the terms using `simp` have hu1' := congr_arg ((u2 * s3) β€’ Β·) hu1.symm have hu2' := congr_arg ((u1 * s1) β€’ Β·) hu2.symm simp only [← mul_smul, smul_assoc, mul_assoc, mul_comm, mul_left_comm] at hu1' hu2' ⊒ rw [hu2', hu1'] symm := fun ⟨m1, s1⟩ ⟨m2, s2⟩ ⟨u, hu⟩ => ⟨u, hu.symm⟩ } #align localized_module.r.is_equiv LocalizedModule.r.isEquiv instance r.setoid : Setoid (M Γ— S) where r := r S M iseqv := ⟨(r.isEquiv S M).refl, (r.isEquiv S M).symm _ _, (r.isEquiv S M).trans _ _ _⟩ #align localized_module.r.setoid LocalizedModule.r.setoid -- TODO: change `Localization` to use `r'` instead of `r` so that the two types are also defeq, -- `Localization S = LocalizedModule S R`. example {R} [CommSemiring R] (S : Submonoid R) : ⇑(Localization.r' S) = LocalizedModule.r S R := rfl -- Porting note(#5171): @[nolint has_nonempty_instance] def _root_.LocalizedModule : Type max u v := Quotient (r.setoid S M) #align localized_module LocalizedModule section variable {M S} def mk (m : M) (s : S) : LocalizedModule S M := Quotient.mk' ⟨m, s⟩ #align localized_module.mk LocalizedModule.mk theorem mk_eq {m m' : M} {s s' : S} : mk m s = mk m' s' ↔ βˆƒ u : S, u β€’ s' β€’ m = u β€’ s β€’ m' := Quotient.eq' #align localized_module.mk_eq LocalizedModule.mk_eq @[elab_as_elim] theorem induction_on {Ξ² : LocalizedModule S M β†’ Prop} (h : βˆ€ (m : M) (s : S), Ξ² (mk m s)) : βˆ€ x : LocalizedModule S M, Ξ² x := by rintro ⟨⟨m, s⟩⟩ exact h m s #align localized_module.induction_on LocalizedModule.induction_on @[elab_as_elim] theorem induction_onβ‚‚ {Ξ² : LocalizedModule S M β†’ LocalizedModule S M β†’ Prop} (h : βˆ€ (m m' : M) (s s' : S), Ξ² (mk m s) (mk m' s')) : βˆ€ x y, Ξ² x y := by rintro ⟨⟨m, s⟩⟩ ⟨⟨m', s'⟩⟩ exact h m m' s s' #align localized_module.induction_onβ‚‚ LocalizedModule.induction_onβ‚‚ def liftOn {Ξ± : Type*} (x : LocalizedModule S M) (f : M Γ— S β†’ Ξ±) (wd : βˆ€ (p p' : M Γ— S), p β‰ˆ p' β†’ f p = f p') : Ξ± := Quotient.liftOn x f wd #align localized_module.lift_on LocalizedModule.liftOn theorem liftOn_mk {Ξ± : Type*} {f : M Γ— S β†’ Ξ±} (wd : βˆ€ (p p' : M Γ— S), p β‰ˆ p' β†’ f p = f p') (m : M) (s : S) : liftOn (mk m s) f wd = f ⟨m, s⟩ := by convert Quotient.liftOn_mk f wd ⟨m, s⟩ #align localized_module.lift_on_mk LocalizedModule.liftOn_mk def liftOnβ‚‚ {Ξ± : Type*} (x y : LocalizedModule S M) (f : M Γ— S β†’ M Γ— S β†’ Ξ±) (wd : βˆ€ (p q p' q' : M Γ— S), p β‰ˆ p' β†’ q β‰ˆ q' β†’ f p q = f p' q') : Ξ± := Quotient.liftOnβ‚‚ x y f wd #align localized_module.lift_onβ‚‚ LocalizedModule.liftOnβ‚‚ theorem liftOnβ‚‚_mk {Ξ± : Type*} (f : M Γ— S β†’ M Γ— S β†’ Ξ±) (wd : βˆ€ (p q p' q' : M Γ— S), p β‰ˆ p' β†’ q β‰ˆ q' β†’ f p q = f p' q') (m m' : M) (s s' : S) : liftOnβ‚‚ (mk m s) (mk m' s') f wd = f ⟨m, s⟩ ⟨m', s'⟩ := by convert Quotient.liftOnβ‚‚_mk f wd _ _ #align localized_module.lift_onβ‚‚_mk LocalizedModule.liftOnβ‚‚_mk instance : Zero (LocalizedModule S M) := ⟨mk 0 1⟩
Mathlib/Algebra/Module/LocalizedModule.lean
142
145
theorem subsingleton (h : 0 ∈ S) : Subsingleton (LocalizedModule S M) := by
refine ⟨fun a b ↦ ?_⟩ induction a,b using LocalizedModule.induction_onβ‚‚ exact mk_eq.mpr ⟨⟨0, h⟩, by simp only [Submonoid.mk_smul, zero_smul]⟩
1,327
import Mathlib.Algebra.Algebra.Bilinear import Mathlib.RingTheory.Localization.Basic #align_import algebra.module.localized_module from "leanprover-community/mathlib"@"831c494092374cfe9f50591ed0ac81a25efc5b86" section IsLocalizedModule universe u v variable {R : Type*} [CommSemiring R] (S : Submonoid R) variable {M M' M'' : Type*} [AddCommMonoid M] [AddCommMonoid M'] [AddCommMonoid M''] variable {A : Type*} [CommSemiring A] [Algebra R A] [Module A M'] [IsLocalization S A] variable [Module R M] [Module R M'] [Module R M''] [IsScalarTower R A M'] variable (f : M β†’β‚—[R] M') (g : M β†’β‚—[R] M'') @[mk_iff] class IsLocalizedModule : Prop where map_units : βˆ€ x : S, IsUnit (algebraMap R (Module.End R M') x) surj' : βˆ€ y : M', βˆƒ x : M Γ— S, x.2 β€’ y = f x.1 exists_of_eq : βˆ€ {x₁ xβ‚‚}, f x₁ = f xβ‚‚ β†’ βˆƒ c : S, c β€’ x₁ = c β€’ xβ‚‚ #align is_localized_module IsLocalizedModule attribute [nolint docBlame] IsLocalizedModule.map_units IsLocalizedModule.surj' IsLocalizedModule.exists_of_eq -- Porting note: Manually added to make `S` and `f` explicit. lemma IsLocalizedModule.surj [IsLocalizedModule S f] (y : M') : βˆƒ x : M Γ— S, x.2 β€’ y = f x.1 := surj' y -- Porting note: Manually added to make `S` and `f` explicit. lemma IsLocalizedModule.eq_iff_exists [IsLocalizedModule S f] {x₁ xβ‚‚} : f x₁ = f xβ‚‚ ↔ βˆƒ c : S, c β€’ x₁ = c β€’ xβ‚‚ := Iff.intro exists_of_eq fun ⟨c, h⟩ ↦ by apply_fun f at h simp_rw [f.map_smul_of_tower, Submonoid.smul_def, ← Module.algebraMap_end_apply R R] at h exact ((Module.End_isUnit_iff _).mp <| map_units f c).1 h
Mathlib/Algebra/Module/LocalizedModule.lean
574
588
theorem IsLocalizedModule.of_linearEquiv (e : M' ≃ₗ[R] M'') [hf : IsLocalizedModule S f] : IsLocalizedModule S (e βˆ˜β‚— f : M β†’β‚—[R] M'') where map_units s := by
rw [show algebraMap R (Module.End R M'') s = e βˆ˜β‚— (algebraMap R (Module.End R M') s) βˆ˜β‚— e.symm by ext; simp, Module.End_isUnit_iff, LinearMap.coe_comp, LinearMap.coe_comp, LinearEquiv.coe_coe, LinearEquiv.coe_coe, EquivLike.comp_bijective, EquivLike.bijective_comp] exact (Module.End_isUnit_iff _).mp <| hf.map_units s surj' x := by obtain ⟨p, h⟩ := hf.surj' (e.symm x) exact ⟨p, by rw [LinearMap.coe_comp, LinearEquiv.coe_coe, Function.comp_apply, ← e.congr_arg h, Submonoid.smul_def, Submonoid.smul_def, LinearEquiv.map_smul, LinearEquiv.apply_symm_apply]⟩ exists_of_eq h := by simp_rw [LinearMap.coe_comp, LinearEquiv.coe_coe, Function.comp_apply, EmbeddingLike.apply_eq_iff_eq] at h exact hf.exists_of_eq h
1,327
import Mathlib.Algebra.Algebra.Bilinear import Mathlib.RingTheory.Localization.Basic #align_import algebra.module.localized_module from "leanprover-community/mathlib"@"831c494092374cfe9f50591ed0ac81a25efc5b86" section IsLocalizedModule universe u v variable {R : Type*} [CommSemiring R] (S : Submonoid R) variable {M M' M'' : Type*} [AddCommMonoid M] [AddCommMonoid M'] [AddCommMonoid M''] variable {A : Type*} [CommSemiring A] [Algebra R A] [Module A M'] [IsLocalization S A] variable [Module R M] [Module R M'] [Module R M''] [IsScalarTower R A M'] variable (f : M β†’β‚—[R] M') (g : M β†’β‚—[R] M'') @[mk_iff] class IsLocalizedModule : Prop where map_units : βˆ€ x : S, IsUnit (algebraMap R (Module.End R M') x) surj' : βˆ€ y : M', βˆƒ x : M Γ— S, x.2 β€’ y = f x.1 exists_of_eq : βˆ€ {x₁ xβ‚‚}, f x₁ = f xβ‚‚ β†’ βˆƒ c : S, c β€’ x₁ = c β€’ xβ‚‚ #align is_localized_module IsLocalizedModule attribute [nolint docBlame] IsLocalizedModule.map_units IsLocalizedModule.surj' IsLocalizedModule.exists_of_eq -- Porting note: Manually added to make `S` and `f` explicit. lemma IsLocalizedModule.surj [IsLocalizedModule S f] (y : M') : βˆƒ x : M Γ— S, x.2 β€’ y = f x.1 := surj' y -- Porting note: Manually added to make `S` and `f` explicit. lemma IsLocalizedModule.eq_iff_exists [IsLocalizedModule S f] {x₁ xβ‚‚} : f x₁ = f xβ‚‚ ↔ βˆƒ c : S, c β€’ x₁ = c β€’ xβ‚‚ := Iff.intro exists_of_eq fun ⟨c, h⟩ ↦ by apply_fun f at h simp_rw [f.map_smul_of_tower, Submonoid.smul_def, ← Module.algebraMap_end_apply R R] at h exact ((Module.End_isUnit_iff _).mp <| map_units f c).1 h theorem IsLocalizedModule.of_linearEquiv (e : M' ≃ₗ[R] M'') [hf : IsLocalizedModule S f] : IsLocalizedModule S (e βˆ˜β‚— f : M β†’β‚—[R] M'') where map_units s := by rw [show algebraMap R (Module.End R M'') s = e βˆ˜β‚— (algebraMap R (Module.End R M') s) βˆ˜β‚— e.symm by ext; simp, Module.End_isUnit_iff, LinearMap.coe_comp, LinearMap.coe_comp, LinearEquiv.coe_coe, LinearEquiv.coe_coe, EquivLike.comp_bijective, EquivLike.bijective_comp] exact (Module.End_isUnit_iff _).mp <| hf.map_units s surj' x := by obtain ⟨p, h⟩ := hf.surj' (e.symm x) exact ⟨p, by rw [LinearMap.coe_comp, LinearEquiv.coe_coe, Function.comp_apply, ← e.congr_arg h, Submonoid.smul_def, Submonoid.smul_def, LinearEquiv.map_smul, LinearEquiv.apply_symm_apply]⟩ exists_of_eq h := by simp_rw [LinearMap.coe_comp, LinearEquiv.coe_coe, Function.comp_apply, EmbeddingLike.apply_eq_iff_eq] at h exact hf.exists_of_eq h variable (M) in lemma isLocalizedModule_id (R') [CommSemiring R'] [Algebra R R'] [IsLocalization S R'] [Module R' M] [IsScalarTower R R' M] : IsLocalizedModule S (.id : M β†’β‚—[R] M) where map_units s := by rw [← (Algebra.lsmul R (A := R') R M).commutes]; exact (IsLocalization.map_units R' s).map _ surj' m := ⟨(m, 1), one_smul _ _⟩ exists_of_eq h := ⟨1, congr_arg _ h⟩ variable {S} in
Mathlib/Algebra/Module/LocalizedModule.lean
599
610
theorem isLocalizedModule_iff_isLocalization {A Aβ‚›} [CommSemiring A] [Algebra R A] [CommSemiring Aβ‚›] [Algebra A Aβ‚›] [Algebra R Aβ‚›] [IsScalarTower R A Aβ‚›] : IsLocalizedModule S (IsScalarTower.toAlgHom R A Aβ‚›).toLinearMap ↔ IsLocalization (Algebra.algebraMapSubmonoid A S) Aβ‚› := by
rw [isLocalizedModule_iff, isLocalization_iff] refine and_congr ?_ (and_congr (forall_congr' fun _ ↦ ?_) (forallβ‚‚_congr fun _ _ ↦ ?_)) Β· simp_rw [← (Algebra.lmul R Aβ‚›).commutes, Algebra.lmul_isUnit_iff, Subtype.forall, Algebra.algebraMapSubmonoid, ← SetLike.mem_coe, Submonoid.coe_map, Set.forall_mem_image, ← IsScalarTower.algebraMap_apply] Β· simp_rw [Prod.exists, Subtype.exists, Algebra.algebraMapSubmonoid] simp [← IsScalarTower.algebraMap_apply, Submonoid.mk_smul, Algebra.smul_def, mul_comm] Β· congr!; simp_rw [Subtype.exists, Algebra.algebraMapSubmonoid]; simp [Algebra.smul_def]
1,327
import Mathlib.Algebra.Algebra.Defs import Mathlib.Algebra.Order.Group.Basic import Mathlib.Algebra.Order.Ring.Basic import Mathlib.RingTheory.Localization.Basic import Mathlib.SetTheory.Game.Birthday import Mathlib.SetTheory.Surreal.Basic #align_import set_theory.surreal.dyadic from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7" universe u namespace SetTheory namespace PGame def powHalf : β„• β†’ PGame | 0 => 1 | n + 1 => ⟨PUnit, PUnit, 0, fun _ => powHalf n⟩ #align pgame.pow_half SetTheory.PGame.powHalf @[simp] theorem powHalf_zero : powHalf 0 = 1 := rfl #align pgame.pow_half_zero SetTheory.PGame.powHalf_zero
Mathlib/SetTheory/Surreal/Dyadic.lean
52
52
theorem powHalf_leftMoves (n) : (powHalf n).LeftMoves = PUnit := by
cases n <;> rfl
1,328
import Mathlib.Algebra.Algebra.Defs import Mathlib.Algebra.Order.Group.Basic import Mathlib.Algebra.Order.Ring.Basic import Mathlib.RingTheory.Localization.Basic import Mathlib.SetTheory.Game.Birthday import Mathlib.SetTheory.Surreal.Basic #align_import set_theory.surreal.dyadic from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7" universe u namespace SetTheory namespace PGame def powHalf : β„• β†’ PGame | 0 => 1 | n + 1 => ⟨PUnit, PUnit, 0, fun _ => powHalf n⟩ #align pgame.pow_half SetTheory.PGame.powHalf @[simp] theorem powHalf_zero : powHalf 0 = 1 := rfl #align pgame.pow_half_zero SetTheory.PGame.powHalf_zero theorem powHalf_leftMoves (n) : (powHalf n).LeftMoves = PUnit := by cases n <;> rfl #align pgame.pow_half_left_moves SetTheory.PGame.powHalf_leftMoves theorem powHalf_zero_rightMoves : (powHalf 0).RightMoves = PEmpty := rfl #align pgame.pow_half_zero_right_moves SetTheory.PGame.powHalf_zero_rightMoves theorem powHalf_succ_rightMoves (n) : (powHalf (n + 1)).RightMoves = PUnit := rfl #align pgame.pow_half_succ_right_moves SetTheory.PGame.powHalf_succ_rightMoves @[simp]
Mathlib/SetTheory/Surreal/Dyadic.lean
64
64
theorem powHalf_moveLeft (n i) : (powHalf n).moveLeft i = 0 := by
cases n <;> cases i <;> rfl
1,328
import Mathlib.Algebra.Algebra.Defs import Mathlib.Algebra.Order.Group.Basic import Mathlib.Algebra.Order.Ring.Basic import Mathlib.RingTheory.Localization.Basic import Mathlib.SetTheory.Game.Birthday import Mathlib.SetTheory.Surreal.Basic #align_import set_theory.surreal.dyadic from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7" universe u namespace SetTheory namespace PGame def powHalf : β„• β†’ PGame | 0 => 1 | n + 1 => ⟨PUnit, PUnit, 0, fun _ => powHalf n⟩ #align pgame.pow_half SetTheory.PGame.powHalf @[simp] theorem powHalf_zero : powHalf 0 = 1 := rfl #align pgame.pow_half_zero SetTheory.PGame.powHalf_zero theorem powHalf_leftMoves (n) : (powHalf n).LeftMoves = PUnit := by cases n <;> rfl #align pgame.pow_half_left_moves SetTheory.PGame.powHalf_leftMoves theorem powHalf_zero_rightMoves : (powHalf 0).RightMoves = PEmpty := rfl #align pgame.pow_half_zero_right_moves SetTheory.PGame.powHalf_zero_rightMoves theorem powHalf_succ_rightMoves (n) : (powHalf (n + 1)).RightMoves = PUnit := rfl #align pgame.pow_half_succ_right_moves SetTheory.PGame.powHalf_succ_rightMoves @[simp] theorem powHalf_moveLeft (n i) : (powHalf n).moveLeft i = 0 := by cases n <;> cases i <;> rfl #align pgame.pow_half_move_left SetTheory.PGame.powHalf_moveLeft @[simp] theorem powHalf_succ_moveRight (n i) : (powHalf (n + 1)).moveRight i = powHalf n := rfl #align pgame.pow_half_succ_move_right SetTheory.PGame.powHalf_succ_moveRight instance uniquePowHalfLeftMoves (n) : Unique (powHalf n).LeftMoves := by cases n <;> exact PUnit.unique #align pgame.unique_pow_half_left_moves SetTheory.PGame.uniquePowHalfLeftMoves instance isEmpty_powHalf_zero_rightMoves : IsEmpty (powHalf 0).RightMoves := inferInstanceAs (IsEmpty PEmpty) #align pgame.is_empty_pow_half_zero_right_moves SetTheory.PGame.isEmpty_powHalf_zero_rightMoves instance uniquePowHalfSuccRightMoves (n) : Unique (powHalf (n + 1)).RightMoves := PUnit.unique #align pgame.unique_pow_half_succ_right_moves SetTheory.PGame.uniquePowHalfSuccRightMoves @[simp]
Mathlib/SetTheory/Surreal/Dyadic.lean
85
86
theorem birthday_half : birthday (powHalf 1) = 2 := by
rw [birthday_def]; simp
1,328
import Mathlib.Algebra.Algebra.Defs import Mathlib.Algebra.Order.Group.Basic import Mathlib.Algebra.Order.Ring.Basic import Mathlib.RingTheory.Localization.Basic import Mathlib.SetTheory.Game.Birthday import Mathlib.SetTheory.Surreal.Basic #align_import set_theory.surreal.dyadic from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7" universe u namespace SetTheory namespace PGame def powHalf : β„• β†’ PGame | 0 => 1 | n + 1 => ⟨PUnit, PUnit, 0, fun _ => powHalf n⟩ #align pgame.pow_half SetTheory.PGame.powHalf @[simp] theorem powHalf_zero : powHalf 0 = 1 := rfl #align pgame.pow_half_zero SetTheory.PGame.powHalf_zero theorem powHalf_leftMoves (n) : (powHalf n).LeftMoves = PUnit := by cases n <;> rfl #align pgame.pow_half_left_moves SetTheory.PGame.powHalf_leftMoves theorem powHalf_zero_rightMoves : (powHalf 0).RightMoves = PEmpty := rfl #align pgame.pow_half_zero_right_moves SetTheory.PGame.powHalf_zero_rightMoves theorem powHalf_succ_rightMoves (n) : (powHalf (n + 1)).RightMoves = PUnit := rfl #align pgame.pow_half_succ_right_moves SetTheory.PGame.powHalf_succ_rightMoves @[simp] theorem powHalf_moveLeft (n i) : (powHalf n).moveLeft i = 0 := by cases n <;> cases i <;> rfl #align pgame.pow_half_move_left SetTheory.PGame.powHalf_moveLeft @[simp] theorem powHalf_succ_moveRight (n i) : (powHalf (n + 1)).moveRight i = powHalf n := rfl #align pgame.pow_half_succ_move_right SetTheory.PGame.powHalf_succ_moveRight instance uniquePowHalfLeftMoves (n) : Unique (powHalf n).LeftMoves := by cases n <;> exact PUnit.unique #align pgame.unique_pow_half_left_moves SetTheory.PGame.uniquePowHalfLeftMoves instance isEmpty_powHalf_zero_rightMoves : IsEmpty (powHalf 0).RightMoves := inferInstanceAs (IsEmpty PEmpty) #align pgame.is_empty_pow_half_zero_right_moves SetTheory.PGame.isEmpty_powHalf_zero_rightMoves instance uniquePowHalfSuccRightMoves (n) : Unique (powHalf (n + 1)).RightMoves := PUnit.unique #align pgame.unique_pow_half_succ_right_moves SetTheory.PGame.uniquePowHalfSuccRightMoves @[simp] theorem birthday_half : birthday (powHalf 1) = 2 := by rw [birthday_def]; simp #align pgame.birthday_half SetTheory.PGame.birthday_half
Mathlib/SetTheory/Surreal/Dyadic.lean
90
95
theorem numeric_powHalf (n) : (powHalf n).Numeric := by
induction' n with n hn · exact numeric_one · constructor · simpa using hn.moveLeft_lt default · exact ⟨fun _ => numeric_zero, fun _ => hn⟩
1,328
import Mathlib.Algebra.Algebra.Defs import Mathlib.Algebra.Order.Group.Basic import Mathlib.Algebra.Order.Ring.Basic import Mathlib.RingTheory.Localization.Basic import Mathlib.SetTheory.Game.Birthday import Mathlib.SetTheory.Surreal.Basic #align_import set_theory.surreal.dyadic from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7" universe u namespace SetTheory namespace PGame def powHalf : β„• β†’ PGame | 0 => 1 | n + 1 => ⟨PUnit, PUnit, 0, fun _ => powHalf n⟩ #align pgame.pow_half SetTheory.PGame.powHalf @[simp] theorem powHalf_zero : powHalf 0 = 1 := rfl #align pgame.pow_half_zero SetTheory.PGame.powHalf_zero theorem powHalf_leftMoves (n) : (powHalf n).LeftMoves = PUnit := by cases n <;> rfl #align pgame.pow_half_left_moves SetTheory.PGame.powHalf_leftMoves theorem powHalf_zero_rightMoves : (powHalf 0).RightMoves = PEmpty := rfl #align pgame.pow_half_zero_right_moves SetTheory.PGame.powHalf_zero_rightMoves theorem powHalf_succ_rightMoves (n) : (powHalf (n + 1)).RightMoves = PUnit := rfl #align pgame.pow_half_succ_right_moves SetTheory.PGame.powHalf_succ_rightMoves @[simp] theorem powHalf_moveLeft (n i) : (powHalf n).moveLeft i = 0 := by cases n <;> cases i <;> rfl #align pgame.pow_half_move_left SetTheory.PGame.powHalf_moveLeft @[simp] theorem powHalf_succ_moveRight (n i) : (powHalf (n + 1)).moveRight i = powHalf n := rfl #align pgame.pow_half_succ_move_right SetTheory.PGame.powHalf_succ_moveRight instance uniquePowHalfLeftMoves (n) : Unique (powHalf n).LeftMoves := by cases n <;> exact PUnit.unique #align pgame.unique_pow_half_left_moves SetTheory.PGame.uniquePowHalfLeftMoves instance isEmpty_powHalf_zero_rightMoves : IsEmpty (powHalf 0).RightMoves := inferInstanceAs (IsEmpty PEmpty) #align pgame.is_empty_pow_half_zero_right_moves SetTheory.PGame.isEmpty_powHalf_zero_rightMoves instance uniquePowHalfSuccRightMoves (n) : Unique (powHalf (n + 1)).RightMoves := PUnit.unique #align pgame.unique_pow_half_succ_right_moves SetTheory.PGame.uniquePowHalfSuccRightMoves @[simp] theorem birthday_half : birthday (powHalf 1) = 2 := by rw [birthday_def]; simp #align pgame.birthday_half SetTheory.PGame.birthday_half theorem numeric_powHalf (n) : (powHalf n).Numeric := by induction' n with n hn Β· exact numeric_one Β· constructor Β· simpa using hn.moveLeft_lt default Β· exact ⟨fun _ => numeric_zero, fun _ => hn⟩ #align pgame.numeric_pow_half SetTheory.PGame.numeric_powHalf theorem powHalf_succ_lt_powHalf (n : β„•) : powHalf (n + 1) < powHalf n := (numeric_powHalf (n + 1)).lt_moveRight default #align pgame.pow_half_succ_lt_pow_half SetTheory.PGame.powHalf_succ_lt_powHalf theorem powHalf_succ_le_powHalf (n : β„•) : powHalf (n + 1) ≀ powHalf n := (powHalf_succ_lt_powHalf n).le #align pgame.pow_half_succ_le_pow_half SetTheory.PGame.powHalf_succ_le_powHalf
Mathlib/SetTheory/Surreal/Dyadic.lean
106
109
theorem powHalf_le_one (n : β„•) : powHalf n ≀ 1 := by
induction' n with n hn Β· exact le_rfl Β· exact (powHalf_succ_le_powHalf n).trans hn
1,328
import Mathlib.Algebra.Algebra.Defs import Mathlib.Algebra.Order.Group.Basic import Mathlib.Algebra.Order.Ring.Basic import Mathlib.RingTheory.Localization.Basic import Mathlib.SetTheory.Game.Birthday import Mathlib.SetTheory.Surreal.Basic #align_import set_theory.surreal.dyadic from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7" universe u namespace SetTheory namespace PGame def powHalf : β„• β†’ PGame | 0 => 1 | n + 1 => ⟨PUnit, PUnit, 0, fun _ => powHalf n⟩ #align pgame.pow_half SetTheory.PGame.powHalf @[simp] theorem powHalf_zero : powHalf 0 = 1 := rfl #align pgame.pow_half_zero SetTheory.PGame.powHalf_zero theorem powHalf_leftMoves (n) : (powHalf n).LeftMoves = PUnit := by cases n <;> rfl #align pgame.pow_half_left_moves SetTheory.PGame.powHalf_leftMoves theorem powHalf_zero_rightMoves : (powHalf 0).RightMoves = PEmpty := rfl #align pgame.pow_half_zero_right_moves SetTheory.PGame.powHalf_zero_rightMoves theorem powHalf_succ_rightMoves (n) : (powHalf (n + 1)).RightMoves = PUnit := rfl #align pgame.pow_half_succ_right_moves SetTheory.PGame.powHalf_succ_rightMoves @[simp] theorem powHalf_moveLeft (n i) : (powHalf n).moveLeft i = 0 := by cases n <;> cases i <;> rfl #align pgame.pow_half_move_left SetTheory.PGame.powHalf_moveLeft @[simp] theorem powHalf_succ_moveRight (n i) : (powHalf (n + 1)).moveRight i = powHalf n := rfl #align pgame.pow_half_succ_move_right SetTheory.PGame.powHalf_succ_moveRight instance uniquePowHalfLeftMoves (n) : Unique (powHalf n).LeftMoves := by cases n <;> exact PUnit.unique #align pgame.unique_pow_half_left_moves SetTheory.PGame.uniquePowHalfLeftMoves instance isEmpty_powHalf_zero_rightMoves : IsEmpty (powHalf 0).RightMoves := inferInstanceAs (IsEmpty PEmpty) #align pgame.is_empty_pow_half_zero_right_moves SetTheory.PGame.isEmpty_powHalf_zero_rightMoves instance uniquePowHalfSuccRightMoves (n) : Unique (powHalf (n + 1)).RightMoves := PUnit.unique #align pgame.unique_pow_half_succ_right_moves SetTheory.PGame.uniquePowHalfSuccRightMoves @[simp] theorem birthday_half : birthday (powHalf 1) = 2 := by rw [birthday_def]; simp #align pgame.birthday_half SetTheory.PGame.birthday_half theorem numeric_powHalf (n) : (powHalf n).Numeric := by induction' n with n hn Β· exact numeric_one Β· constructor Β· simpa using hn.moveLeft_lt default Β· exact ⟨fun _ => numeric_zero, fun _ => hn⟩ #align pgame.numeric_pow_half SetTheory.PGame.numeric_powHalf theorem powHalf_succ_lt_powHalf (n : β„•) : powHalf (n + 1) < powHalf n := (numeric_powHalf (n + 1)).lt_moveRight default #align pgame.pow_half_succ_lt_pow_half SetTheory.PGame.powHalf_succ_lt_powHalf theorem powHalf_succ_le_powHalf (n : β„•) : powHalf (n + 1) ≀ powHalf n := (powHalf_succ_lt_powHalf n).le #align pgame.pow_half_succ_le_pow_half SetTheory.PGame.powHalf_succ_le_powHalf theorem powHalf_le_one (n : β„•) : powHalf n ≀ 1 := by induction' n with n hn Β· exact le_rfl Β· exact (powHalf_succ_le_powHalf n).trans hn #align pgame.pow_half_le_one SetTheory.PGame.powHalf_le_one theorem powHalf_succ_lt_one (n : β„•) : powHalf (n + 1) < 1 := (powHalf_succ_lt_powHalf n).trans_le <| powHalf_le_one n #align pgame.pow_half_succ_lt_one SetTheory.PGame.powHalf_succ_lt_one
Mathlib/SetTheory/Surreal/Dyadic.lean
116
117
theorem powHalf_pos (n : β„•) : 0 < powHalf n := by
rw [← lf_iff_lt numeric_zero (numeric_powHalf n), zero_lf_le]; simp
1,328
import Mathlib.Algebra.Algebra.Defs import Mathlib.Algebra.Order.Group.Basic import Mathlib.Algebra.Order.Ring.Basic import Mathlib.RingTheory.Localization.Basic import Mathlib.SetTheory.Game.Birthday import Mathlib.SetTheory.Surreal.Basic #align_import set_theory.surreal.dyadic from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7" universe u namespace SetTheory namespace PGame def powHalf : β„• β†’ PGame | 0 => 1 | n + 1 => ⟨PUnit, PUnit, 0, fun _ => powHalf n⟩ #align pgame.pow_half SetTheory.PGame.powHalf @[simp] theorem powHalf_zero : powHalf 0 = 1 := rfl #align pgame.pow_half_zero SetTheory.PGame.powHalf_zero theorem powHalf_leftMoves (n) : (powHalf n).LeftMoves = PUnit := by cases n <;> rfl #align pgame.pow_half_left_moves SetTheory.PGame.powHalf_leftMoves theorem powHalf_zero_rightMoves : (powHalf 0).RightMoves = PEmpty := rfl #align pgame.pow_half_zero_right_moves SetTheory.PGame.powHalf_zero_rightMoves theorem powHalf_succ_rightMoves (n) : (powHalf (n + 1)).RightMoves = PUnit := rfl #align pgame.pow_half_succ_right_moves SetTheory.PGame.powHalf_succ_rightMoves @[simp] theorem powHalf_moveLeft (n i) : (powHalf n).moveLeft i = 0 := by cases n <;> cases i <;> rfl #align pgame.pow_half_move_left SetTheory.PGame.powHalf_moveLeft @[simp] theorem powHalf_succ_moveRight (n i) : (powHalf (n + 1)).moveRight i = powHalf n := rfl #align pgame.pow_half_succ_move_right SetTheory.PGame.powHalf_succ_moveRight instance uniquePowHalfLeftMoves (n) : Unique (powHalf n).LeftMoves := by cases n <;> exact PUnit.unique #align pgame.unique_pow_half_left_moves SetTheory.PGame.uniquePowHalfLeftMoves instance isEmpty_powHalf_zero_rightMoves : IsEmpty (powHalf 0).RightMoves := inferInstanceAs (IsEmpty PEmpty) #align pgame.is_empty_pow_half_zero_right_moves SetTheory.PGame.isEmpty_powHalf_zero_rightMoves instance uniquePowHalfSuccRightMoves (n) : Unique (powHalf (n + 1)).RightMoves := PUnit.unique #align pgame.unique_pow_half_succ_right_moves SetTheory.PGame.uniquePowHalfSuccRightMoves @[simp] theorem birthday_half : birthday (powHalf 1) = 2 := by rw [birthday_def]; simp #align pgame.birthday_half SetTheory.PGame.birthday_half theorem numeric_powHalf (n) : (powHalf n).Numeric := by induction' n with n hn Β· exact numeric_one Β· constructor Β· simpa using hn.moveLeft_lt default Β· exact ⟨fun _ => numeric_zero, fun _ => hn⟩ #align pgame.numeric_pow_half SetTheory.PGame.numeric_powHalf theorem powHalf_succ_lt_powHalf (n : β„•) : powHalf (n + 1) < powHalf n := (numeric_powHalf (n + 1)).lt_moveRight default #align pgame.pow_half_succ_lt_pow_half SetTheory.PGame.powHalf_succ_lt_powHalf theorem powHalf_succ_le_powHalf (n : β„•) : powHalf (n + 1) ≀ powHalf n := (powHalf_succ_lt_powHalf n).le #align pgame.pow_half_succ_le_pow_half SetTheory.PGame.powHalf_succ_le_powHalf theorem powHalf_le_one (n : β„•) : powHalf n ≀ 1 := by induction' n with n hn Β· exact le_rfl Β· exact (powHalf_succ_le_powHalf n).trans hn #align pgame.pow_half_le_one SetTheory.PGame.powHalf_le_one theorem powHalf_succ_lt_one (n : β„•) : powHalf (n + 1) < 1 := (powHalf_succ_lt_powHalf n).trans_le <| powHalf_le_one n #align pgame.pow_half_succ_lt_one SetTheory.PGame.powHalf_succ_lt_one theorem powHalf_pos (n : β„•) : 0 < powHalf n := by rw [← lf_iff_lt numeric_zero (numeric_powHalf n), zero_lf_le]; simp #align pgame.pow_half_pos SetTheory.PGame.powHalf_pos theorem zero_le_powHalf (n : β„•) : 0 ≀ powHalf n := (powHalf_pos n).le #align pgame.zero_le_pow_half SetTheory.PGame.zero_le_powHalf
Mathlib/SetTheory/Surreal/Dyadic.lean
124
156
theorem add_powHalf_succ_self_eq_powHalf (n) : powHalf (n + 1) + powHalf (n + 1) β‰ˆ powHalf n := by
induction' n using Nat.strong_induction_on with n hn constructor <;> rw [le_iff_forall_lf] <;> constructor Β· rintro (⟨⟨⟩⟩ | ⟨⟨⟩⟩) <;> apply lf_of_lt Β· calc 0 + powHalf n.succ β‰ˆ powHalf n.succ := zero_add_equiv _ _ < powHalf n := powHalf_succ_lt_powHalf n Β· calc powHalf n.succ + 0 β‰ˆ powHalf n.succ := add_zero_equiv _ _ < powHalf n := powHalf_succ_lt_powHalf n Β· cases' n with n Β· rintro ⟨⟩ rintro ⟨⟩ apply lf_of_moveRight_le swap Β· exact Sum.inl default calc powHalf n.succ + powHalf (n.succ + 1) ≀ powHalf n.succ + powHalf n.succ := add_le_add_left (powHalf_succ_le_powHalf _) _ _ β‰ˆ powHalf n := hn _ (Nat.lt_succ_self n) Β· simp only [powHalf_moveLeft, forall_const] apply lf_of_lt calc 0 β‰ˆ 0 + 0 := Equiv.symm (add_zero_equiv 0) _ ≀ powHalf n.succ + 0 := add_le_add_right (zero_le_powHalf _) _ _ < powHalf n.succ + powHalf n.succ := add_lt_add_left (powHalf_pos _) _ Β· rintro (⟨⟨⟩⟩ | ⟨⟨⟩⟩) <;> apply lf_of_lt Β· calc powHalf n β‰ˆ powHalf n + 0 := Equiv.symm (add_zero_equiv _) _ < powHalf n + powHalf n.succ := add_lt_add_left (powHalf_pos _) _ Β· calc powHalf n β‰ˆ 0 + powHalf n := Equiv.symm (zero_add_equiv _) _ < powHalf n.succ + powHalf n := add_lt_add_right (powHalf_pos _) _
1,328
import Mathlib.Algebra.BigOperators.Fin import Mathlib.LinearAlgebra.Finsupp import Mathlib.LinearAlgebra.Prod import Mathlib.SetTheory.Cardinal.Basic import Mathlib.Tactic.FinCases import Mathlib.Tactic.LinearCombination import Mathlib.Lean.Expr.ExtraRecognizers import Mathlib.Data.Set.Subsingleton #align_import linear_algebra.linear_independent from "leanprover-community/mathlib"@"9d684a893c52e1d6692a504a118bfccbae04feeb" noncomputable section open Function Set Submodule open Cardinal universe u' u variable {ΞΉ : Type u'} {ΞΉ' : Type*} {R : Type*} {K : Type*} variable {M : Type*} {M' M'' : Type*} {V : Type u} {V' : Type*} section Module variable {v : ΞΉ β†’ M} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid M'] [AddCommMonoid M''] variable [Module R M] [Module R M'] [Module R M''] variable {a b : R} {x y : M} variable (R) (v) def LinearIndependent : Prop := LinearMap.ker (Finsupp.total ΞΉ M R v) = βŠ₯ #align linear_independent LinearIndependent open Lean PrettyPrinter.Delaborator SubExpr in @[delab app.LinearIndependent] def delabLinearIndependent : Delab := whenPPOption getPPNotation <| whenNotPPOption getPPAnalysisSkip <| withOptionAtCurrPos `pp.analysis.skip true do let e ← getExpr guard <| e.isAppOfArity ``LinearIndependent 7 let some _ := (e.getArg! 0).coeTypeSet? | failure let optionsPerPos ← if (e.getArg! 3).isLambda then withNaryArg 3 do return (← read).optionsPerPos.setBool (← getPos) pp.funBinderTypes.name true else withNaryArg 0 do return (← read).optionsPerPos.setBool (← getPos) `pp.analysis.namedArg true withTheReader Context ({Β· with optionsPerPos}) delab variable {R} {v}
Mathlib/LinearAlgebra/LinearIndependent.lean
126
128
theorem linearIndependent_iff : LinearIndependent R v ↔ βˆ€ l, Finsupp.total ΞΉ M R v l = 0 β†’ l = 0 := by
simp [LinearIndependent, LinearMap.ker_eq_bot']
1,329
import Mathlib.Algebra.BigOperators.Fin import Mathlib.LinearAlgebra.Finsupp import Mathlib.LinearAlgebra.Prod import Mathlib.SetTheory.Cardinal.Basic import Mathlib.Tactic.FinCases import Mathlib.Tactic.LinearCombination import Mathlib.Lean.Expr.ExtraRecognizers import Mathlib.Data.Set.Subsingleton #align_import linear_algebra.linear_independent from "leanprover-community/mathlib"@"9d684a893c52e1d6692a504a118bfccbae04feeb" noncomputable section open Function Set Submodule open Cardinal universe u' u variable {ΞΉ : Type u'} {ΞΉ' : Type*} {R : Type*} {K : Type*} variable {M : Type*} {M' M'' : Type*} {V : Type u} {V' : Type*} section Module variable {v : ΞΉ β†’ M} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid M'] [AddCommMonoid M''] variable [Module R M] [Module R M'] [Module R M''] variable {a b : R} {x y : M} variable (R) (v) def LinearIndependent : Prop := LinearMap.ker (Finsupp.total ΞΉ M R v) = βŠ₯ #align linear_independent LinearIndependent open Lean PrettyPrinter.Delaborator SubExpr in @[delab app.LinearIndependent] def delabLinearIndependent : Delab := whenPPOption getPPNotation <| whenNotPPOption getPPAnalysisSkip <| withOptionAtCurrPos `pp.analysis.skip true do let e ← getExpr guard <| e.isAppOfArity ``LinearIndependent 7 let some _ := (e.getArg! 0).coeTypeSet? | failure let optionsPerPos ← if (e.getArg! 3).isLambda then withNaryArg 3 do return (← read).optionsPerPos.setBool (← getPos) pp.funBinderTypes.name true else withNaryArg 0 do return (← read).optionsPerPos.setBool (← getPos) `pp.analysis.namedArg true withTheReader Context ({Β· with optionsPerPos}) delab variable {R} {v} theorem linearIndependent_iff : LinearIndependent R v ↔ βˆ€ l, Finsupp.total ΞΉ M R v l = 0 β†’ l = 0 := by simp [LinearIndependent, LinearMap.ker_eq_bot'] #align linear_independent_iff linearIndependent_iff
Mathlib/LinearAlgebra/LinearIndependent.lean
131
151
theorem linearIndependent_iff' : LinearIndependent R v ↔ βˆ€ s : Finset ΞΉ, βˆ€ g : ΞΉ β†’ R, βˆ‘ i ∈ s, g i β€’ v i = 0 β†’ βˆ€ i ∈ s, g i = 0 := linearIndependent_iff.trans ⟨fun hf s g hg i his => have h := hf (βˆ‘ i ∈ s, Finsupp.single i (g i)) <| by simpa only [map_sum, Finsupp.total_single] using hg calc g i = (Finsupp.lapply i : (ΞΉ β†’β‚€ R) β†’β‚—[R] R) (Finsupp.single i (g i)) := by
{ rw [Finsupp.lapply_apply, Finsupp.single_eq_same] } _ = βˆ‘ j ∈ s, (Finsupp.lapply i : (ΞΉ β†’β‚€ R) β†’β‚—[R] R) (Finsupp.single j (g j)) := Eq.symm <| Finset.sum_eq_single i (fun j _hjs hji => by rw [Finsupp.lapply_apply, Finsupp.single_eq_of_ne hji]) fun hnis => hnis.elim his _ = (βˆ‘ j ∈ s, Finsupp.single j (g j)) i := (map_sum ..).symm _ = 0 := DFunLike.ext_iff.1 h i, fun hf l hl => Finsupp.ext fun i => _root_.by_contradiction fun hni => hni <| hf _ _ hl _ <| Finsupp.mem_support_iff.2 hni⟩
1,329
import Mathlib.Algebra.BigOperators.Fin import Mathlib.LinearAlgebra.Finsupp import Mathlib.LinearAlgebra.Prod import Mathlib.SetTheory.Cardinal.Basic import Mathlib.Tactic.FinCases import Mathlib.Tactic.LinearCombination import Mathlib.Lean.Expr.ExtraRecognizers import Mathlib.Data.Set.Subsingleton #align_import linear_algebra.linear_independent from "leanprover-community/mathlib"@"9d684a893c52e1d6692a504a118bfccbae04feeb" noncomputable section open Function Set Submodule open Cardinal universe u' u variable {ΞΉ : Type u'} {ΞΉ' : Type*} {R : Type*} {K : Type*} variable {M : Type*} {M' M'' : Type*} {V : Type u} {V' : Type*} section Module variable {v : ΞΉ β†’ M} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid M'] [AddCommMonoid M''] variable [Module R M] [Module R M'] [Module R M''] variable {a b : R} {x y : M} variable (R) (v) def LinearIndependent : Prop := LinearMap.ker (Finsupp.total ΞΉ M R v) = βŠ₯ #align linear_independent LinearIndependent open Lean PrettyPrinter.Delaborator SubExpr in @[delab app.LinearIndependent] def delabLinearIndependent : Delab := whenPPOption getPPNotation <| whenNotPPOption getPPAnalysisSkip <| withOptionAtCurrPos `pp.analysis.skip true do let e ← getExpr guard <| e.isAppOfArity ``LinearIndependent 7 let some _ := (e.getArg! 0).coeTypeSet? | failure let optionsPerPos ← if (e.getArg! 3).isLambda then withNaryArg 3 do return (← read).optionsPerPos.setBool (← getPos) pp.funBinderTypes.name true else withNaryArg 0 do return (← read).optionsPerPos.setBool (← getPos) `pp.analysis.namedArg true withTheReader Context ({Β· with optionsPerPos}) delab variable {R} {v} theorem linearIndependent_iff : LinearIndependent R v ↔ βˆ€ l, Finsupp.total ΞΉ M R v l = 0 β†’ l = 0 := by simp [LinearIndependent, LinearMap.ker_eq_bot'] #align linear_independent_iff linearIndependent_iff theorem linearIndependent_iff' : LinearIndependent R v ↔ βˆ€ s : Finset ΞΉ, βˆ€ g : ΞΉ β†’ R, βˆ‘ i ∈ s, g i β€’ v i = 0 β†’ βˆ€ i ∈ s, g i = 0 := linearIndependent_iff.trans ⟨fun hf s g hg i his => have h := hf (βˆ‘ i ∈ s, Finsupp.single i (g i)) <| by simpa only [map_sum, Finsupp.total_single] using hg calc g i = (Finsupp.lapply i : (ΞΉ β†’β‚€ R) β†’β‚—[R] R) (Finsupp.single i (g i)) := by { rw [Finsupp.lapply_apply, Finsupp.single_eq_same] } _ = βˆ‘ j ∈ s, (Finsupp.lapply i : (ΞΉ β†’β‚€ R) β†’β‚—[R] R) (Finsupp.single j (g j)) := Eq.symm <| Finset.sum_eq_single i (fun j _hjs hji => by rw [Finsupp.lapply_apply, Finsupp.single_eq_of_ne hji]) fun hnis => hnis.elim his _ = (βˆ‘ j ∈ s, Finsupp.single j (g j)) i := (map_sum ..).symm _ = 0 := DFunLike.ext_iff.1 h i, fun hf l hl => Finsupp.ext fun i => _root_.by_contradiction fun hni => hni <| hf _ _ hl _ <| Finsupp.mem_support_iff.2 hni⟩ #align linear_independent_iff' linearIndependent_iff'
Mathlib/LinearAlgebra/LinearIndependent.lean
154
164
theorem linearIndependent_iff'' : LinearIndependent R v ↔ βˆ€ (s : Finset ΞΉ) (g : ΞΉ β†’ R), (βˆ€ i βˆ‰ s, g i = 0) β†’ βˆ‘ i ∈ s, g i β€’ v i = 0 β†’ βˆ€ i, g i = 0 := by
classical exact linearIndependent_iff'.trans ⟨fun H s g hg hv i => if his : i ∈ s then H s g hv i his else hg i his, fun H s g hg i hi => by convert H s (fun j => if j ∈ s then g j else 0) (fun j hj => if_neg hj) (by simp_rw [ite_smul, zero_smul, Finset.sum_extend_by_zero, hg]) i exact (if_pos hi).symm⟩
1,329
import Mathlib.Algebra.BigOperators.Fin import Mathlib.LinearAlgebra.Finsupp import Mathlib.LinearAlgebra.Prod import Mathlib.SetTheory.Cardinal.Basic import Mathlib.Tactic.FinCases import Mathlib.Tactic.LinearCombination import Mathlib.Lean.Expr.ExtraRecognizers import Mathlib.Data.Set.Subsingleton #align_import linear_algebra.linear_independent from "leanprover-community/mathlib"@"9d684a893c52e1d6692a504a118bfccbae04feeb" noncomputable section open Function Set Submodule open Cardinal universe u' u variable {ΞΉ : Type u'} {ΞΉ' : Type*} {R : Type*} {K : Type*} variable {M : Type*} {M' M'' : Type*} {V : Type u} {V' : Type*} section Module variable {v : ΞΉ β†’ M} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid M'] [AddCommMonoid M''] variable [Module R M] [Module R M'] [Module R M''] variable {a b : R} {x y : M} variable (R) (v) def LinearIndependent : Prop := LinearMap.ker (Finsupp.total ΞΉ M R v) = βŠ₯ #align linear_independent LinearIndependent open Lean PrettyPrinter.Delaborator SubExpr in @[delab app.LinearIndependent] def delabLinearIndependent : Delab := whenPPOption getPPNotation <| whenNotPPOption getPPAnalysisSkip <| withOptionAtCurrPos `pp.analysis.skip true do let e ← getExpr guard <| e.isAppOfArity ``LinearIndependent 7 let some _ := (e.getArg! 0).coeTypeSet? | failure let optionsPerPos ← if (e.getArg! 3).isLambda then withNaryArg 3 do return (← read).optionsPerPos.setBool (← getPos) pp.funBinderTypes.name true else withNaryArg 0 do return (← read).optionsPerPos.setBool (← getPos) `pp.analysis.namedArg true withTheReader Context ({Β· with optionsPerPos}) delab variable {R} {v} theorem linearIndependent_iff : LinearIndependent R v ↔ βˆ€ l, Finsupp.total ΞΉ M R v l = 0 β†’ l = 0 := by simp [LinearIndependent, LinearMap.ker_eq_bot'] #align linear_independent_iff linearIndependent_iff theorem linearIndependent_iff' : LinearIndependent R v ↔ βˆ€ s : Finset ΞΉ, βˆ€ g : ΞΉ β†’ R, βˆ‘ i ∈ s, g i β€’ v i = 0 β†’ βˆ€ i ∈ s, g i = 0 := linearIndependent_iff.trans ⟨fun hf s g hg i his => have h := hf (βˆ‘ i ∈ s, Finsupp.single i (g i)) <| by simpa only [map_sum, Finsupp.total_single] using hg calc g i = (Finsupp.lapply i : (ΞΉ β†’β‚€ R) β†’β‚—[R] R) (Finsupp.single i (g i)) := by { rw [Finsupp.lapply_apply, Finsupp.single_eq_same] } _ = βˆ‘ j ∈ s, (Finsupp.lapply i : (ΞΉ β†’β‚€ R) β†’β‚—[R] R) (Finsupp.single j (g j)) := Eq.symm <| Finset.sum_eq_single i (fun j _hjs hji => by rw [Finsupp.lapply_apply, Finsupp.single_eq_of_ne hji]) fun hnis => hnis.elim his _ = (βˆ‘ j ∈ s, Finsupp.single j (g j)) i := (map_sum ..).symm _ = 0 := DFunLike.ext_iff.1 h i, fun hf l hl => Finsupp.ext fun i => _root_.by_contradiction fun hni => hni <| hf _ _ hl _ <| Finsupp.mem_support_iff.2 hni⟩ #align linear_independent_iff' linearIndependent_iff' theorem linearIndependent_iff'' : LinearIndependent R v ↔ βˆ€ (s : Finset ΞΉ) (g : ΞΉ β†’ R), (βˆ€ i βˆ‰ s, g i = 0) β†’ βˆ‘ i ∈ s, g i β€’ v i = 0 β†’ βˆ€ i, g i = 0 := by classical exact linearIndependent_iff'.trans ⟨fun H s g hg hv i => if his : i ∈ s then H s g hv i his else hg i his, fun H s g hg i hi => by convert H s (fun j => if j ∈ s then g j else 0) (fun j hj => if_neg hj) (by simp_rw [ite_smul, zero_smul, Finset.sum_extend_by_zero, hg]) i exact (if_pos hi).symm⟩ #align linear_independent_iff'' linearIndependent_iff''
Mathlib/LinearAlgebra/LinearIndependent.lean
167
171
theorem not_linearIndependent_iff : Β¬LinearIndependent R v ↔ βˆƒ s : Finset ΞΉ, βˆƒ g : ΞΉ β†’ R, βˆ‘ i ∈ s, g i β€’ v i = 0 ∧ βˆƒ i ∈ s, g i β‰  0 := by
rw [linearIndependent_iff'] simp only [exists_prop, not_forall]
1,329
import Mathlib.Algebra.BigOperators.Fin import Mathlib.LinearAlgebra.Finsupp import Mathlib.LinearAlgebra.Prod import Mathlib.SetTheory.Cardinal.Basic import Mathlib.Tactic.FinCases import Mathlib.Tactic.LinearCombination import Mathlib.Lean.Expr.ExtraRecognizers import Mathlib.Data.Set.Subsingleton #align_import linear_algebra.linear_independent from "leanprover-community/mathlib"@"9d684a893c52e1d6692a504a118bfccbae04feeb" noncomputable section open Function Set Submodule open Cardinal universe u' u variable {ΞΉ : Type u'} {ΞΉ' : Type*} {R : Type*} {K : Type*} variable {M : Type*} {M' M'' : Type*} {V : Type u} {V' : Type*} section Module variable {v : ΞΉ β†’ M} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid M'] [AddCommMonoid M''] variable [Module R M] [Module R M'] [Module R M''] variable {a b : R} {x y : M} variable (R) (v) def LinearIndependent : Prop := LinearMap.ker (Finsupp.total ΞΉ M R v) = βŠ₯ #align linear_independent LinearIndependent open Lean PrettyPrinter.Delaborator SubExpr in @[delab app.LinearIndependent] def delabLinearIndependent : Delab := whenPPOption getPPNotation <| whenNotPPOption getPPAnalysisSkip <| withOptionAtCurrPos `pp.analysis.skip true do let e ← getExpr guard <| e.isAppOfArity ``LinearIndependent 7 let some _ := (e.getArg! 0).coeTypeSet? | failure let optionsPerPos ← if (e.getArg! 3).isLambda then withNaryArg 3 do return (← read).optionsPerPos.setBool (← getPos) pp.funBinderTypes.name true else withNaryArg 0 do return (← read).optionsPerPos.setBool (← getPos) `pp.analysis.namedArg true withTheReader Context ({Β· with optionsPerPos}) delab variable {R} {v} theorem linearIndependent_iff : LinearIndependent R v ↔ βˆ€ l, Finsupp.total ΞΉ M R v l = 0 β†’ l = 0 := by simp [LinearIndependent, LinearMap.ker_eq_bot'] #align linear_independent_iff linearIndependent_iff theorem linearIndependent_iff' : LinearIndependent R v ↔ βˆ€ s : Finset ΞΉ, βˆ€ g : ΞΉ β†’ R, βˆ‘ i ∈ s, g i β€’ v i = 0 β†’ βˆ€ i ∈ s, g i = 0 := linearIndependent_iff.trans ⟨fun hf s g hg i his => have h := hf (βˆ‘ i ∈ s, Finsupp.single i (g i)) <| by simpa only [map_sum, Finsupp.total_single] using hg calc g i = (Finsupp.lapply i : (ΞΉ β†’β‚€ R) β†’β‚—[R] R) (Finsupp.single i (g i)) := by { rw [Finsupp.lapply_apply, Finsupp.single_eq_same] } _ = βˆ‘ j ∈ s, (Finsupp.lapply i : (ΞΉ β†’β‚€ R) β†’β‚—[R] R) (Finsupp.single j (g j)) := Eq.symm <| Finset.sum_eq_single i (fun j _hjs hji => by rw [Finsupp.lapply_apply, Finsupp.single_eq_of_ne hji]) fun hnis => hnis.elim his _ = (βˆ‘ j ∈ s, Finsupp.single j (g j)) i := (map_sum ..).symm _ = 0 := DFunLike.ext_iff.1 h i, fun hf l hl => Finsupp.ext fun i => _root_.by_contradiction fun hni => hni <| hf _ _ hl _ <| Finsupp.mem_support_iff.2 hni⟩ #align linear_independent_iff' linearIndependent_iff' theorem linearIndependent_iff'' : LinearIndependent R v ↔ βˆ€ (s : Finset ΞΉ) (g : ΞΉ β†’ R), (βˆ€ i βˆ‰ s, g i = 0) β†’ βˆ‘ i ∈ s, g i β€’ v i = 0 β†’ βˆ€ i, g i = 0 := by classical exact linearIndependent_iff'.trans ⟨fun H s g hg hv i => if his : i ∈ s then H s g hv i his else hg i his, fun H s g hg i hi => by convert H s (fun j => if j ∈ s then g j else 0) (fun j hj => if_neg hj) (by simp_rw [ite_smul, zero_smul, Finset.sum_extend_by_zero, hg]) i exact (if_pos hi).symm⟩ #align linear_independent_iff'' linearIndependent_iff'' theorem not_linearIndependent_iff : Β¬LinearIndependent R v ↔ βˆƒ s : Finset ΞΉ, βˆƒ g : ΞΉ β†’ R, βˆ‘ i ∈ s, g i β€’ v i = 0 ∧ βˆƒ i ∈ s, g i β‰  0 := by rw [linearIndependent_iff'] simp only [exists_prop, not_forall] #align not_linear_independent_iff not_linearIndependent_iff
Mathlib/LinearAlgebra/LinearIndependent.lean
174
181
theorem Fintype.linearIndependent_iff [Fintype ΞΉ] : LinearIndependent R v ↔ βˆ€ g : ΞΉ β†’ R, βˆ‘ i, g i β€’ v i = 0 β†’ βˆ€ i, g i = 0 := by
refine ⟨fun H g => by simpa using linearIndependent_iff'.1 H Finset.univ g, fun H => linearIndependent_iff''.2 fun s g hg hs i => H _ ?_ _⟩ rw [← hs] refine (Finset.sum_subset (Finset.subset_univ _) fun i _ hi => ?_).symm rw [hg i hi, zero_smul]
1,329
import Mathlib.Algebra.BigOperators.Fin import Mathlib.LinearAlgebra.Finsupp import Mathlib.LinearAlgebra.Prod import Mathlib.SetTheory.Cardinal.Basic import Mathlib.Tactic.FinCases import Mathlib.Tactic.LinearCombination import Mathlib.Lean.Expr.ExtraRecognizers import Mathlib.Data.Set.Subsingleton #align_import linear_algebra.linear_independent from "leanprover-community/mathlib"@"9d684a893c52e1d6692a504a118bfccbae04feeb" noncomputable section open Function Set Submodule open Cardinal universe u' u variable {ΞΉ : Type u'} {ΞΉ' : Type*} {R : Type*} {K : Type*} variable {M : Type*} {M' M'' : Type*} {V : Type u} {V' : Type*} section Module variable {v : ΞΉ β†’ M} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid M'] [AddCommMonoid M''] variable [Module R M] [Module R M'] [Module R M''] variable {a b : R} {x y : M} variable (R) (v) def LinearIndependent : Prop := LinearMap.ker (Finsupp.total ΞΉ M R v) = βŠ₯ #align linear_independent LinearIndependent open Lean PrettyPrinter.Delaborator SubExpr in @[delab app.LinearIndependent] def delabLinearIndependent : Delab := whenPPOption getPPNotation <| whenNotPPOption getPPAnalysisSkip <| withOptionAtCurrPos `pp.analysis.skip true do let e ← getExpr guard <| e.isAppOfArity ``LinearIndependent 7 let some _ := (e.getArg! 0).coeTypeSet? | failure let optionsPerPos ← if (e.getArg! 3).isLambda then withNaryArg 3 do return (← read).optionsPerPos.setBool (← getPos) pp.funBinderTypes.name true else withNaryArg 0 do return (← read).optionsPerPos.setBool (← getPos) `pp.analysis.namedArg true withTheReader Context ({Β· with optionsPerPos}) delab variable {R} {v} theorem linearIndependent_iff : LinearIndependent R v ↔ βˆ€ l, Finsupp.total ΞΉ M R v l = 0 β†’ l = 0 := by simp [LinearIndependent, LinearMap.ker_eq_bot'] #align linear_independent_iff linearIndependent_iff theorem linearIndependent_iff' : LinearIndependent R v ↔ βˆ€ s : Finset ΞΉ, βˆ€ g : ΞΉ β†’ R, βˆ‘ i ∈ s, g i β€’ v i = 0 β†’ βˆ€ i ∈ s, g i = 0 := linearIndependent_iff.trans ⟨fun hf s g hg i his => have h := hf (βˆ‘ i ∈ s, Finsupp.single i (g i)) <| by simpa only [map_sum, Finsupp.total_single] using hg calc g i = (Finsupp.lapply i : (ΞΉ β†’β‚€ R) β†’β‚—[R] R) (Finsupp.single i (g i)) := by { rw [Finsupp.lapply_apply, Finsupp.single_eq_same] } _ = βˆ‘ j ∈ s, (Finsupp.lapply i : (ΞΉ β†’β‚€ R) β†’β‚—[R] R) (Finsupp.single j (g j)) := Eq.symm <| Finset.sum_eq_single i (fun j _hjs hji => by rw [Finsupp.lapply_apply, Finsupp.single_eq_of_ne hji]) fun hnis => hnis.elim his _ = (βˆ‘ j ∈ s, Finsupp.single j (g j)) i := (map_sum ..).symm _ = 0 := DFunLike.ext_iff.1 h i, fun hf l hl => Finsupp.ext fun i => _root_.by_contradiction fun hni => hni <| hf _ _ hl _ <| Finsupp.mem_support_iff.2 hni⟩ #align linear_independent_iff' linearIndependent_iff' theorem linearIndependent_iff'' : LinearIndependent R v ↔ βˆ€ (s : Finset ΞΉ) (g : ΞΉ β†’ R), (βˆ€ i βˆ‰ s, g i = 0) β†’ βˆ‘ i ∈ s, g i β€’ v i = 0 β†’ βˆ€ i, g i = 0 := by classical exact linearIndependent_iff'.trans ⟨fun H s g hg hv i => if his : i ∈ s then H s g hv i his else hg i his, fun H s g hg i hi => by convert H s (fun j => if j ∈ s then g j else 0) (fun j hj => if_neg hj) (by simp_rw [ite_smul, zero_smul, Finset.sum_extend_by_zero, hg]) i exact (if_pos hi).symm⟩ #align linear_independent_iff'' linearIndependent_iff'' theorem not_linearIndependent_iff : Β¬LinearIndependent R v ↔ βˆƒ s : Finset ΞΉ, βˆƒ g : ΞΉ β†’ R, βˆ‘ i ∈ s, g i β€’ v i = 0 ∧ βˆƒ i ∈ s, g i β‰  0 := by rw [linearIndependent_iff'] simp only [exists_prop, not_forall] #align not_linear_independent_iff not_linearIndependent_iff theorem Fintype.linearIndependent_iff [Fintype ΞΉ] : LinearIndependent R v ↔ βˆ€ g : ΞΉ β†’ R, βˆ‘ i, g i β€’ v i = 0 β†’ βˆ€ i, g i = 0 := by refine ⟨fun H g => by simpa using linearIndependent_iff'.1 H Finset.univ g, fun H => linearIndependent_iff''.2 fun s g hg hs i => H _ ?_ _⟩ rw [← hs] refine (Finset.sum_subset (Finset.subset_univ _) fun i _ hi => ?_).symm rw [hg i hi, zero_smul] #align fintype.linear_independent_iff Fintype.linearIndependent_iff
Mathlib/LinearAlgebra/LinearIndependent.lean
186
189
theorem Fintype.linearIndependent_iff' [Fintype ΞΉ] [DecidableEq ΞΉ] : LinearIndependent R v ↔ LinearMap.ker (LinearMap.lsum R (fun _ ↦ R) β„• fun i ↦ LinearMap.id.smulRight (v i)) = βŠ₯ := by
simp [Fintype.linearIndependent_iff, LinearMap.ker_eq_bot', funext_iff]
1,329
import Mathlib.Algebra.BigOperators.Fin import Mathlib.LinearAlgebra.Finsupp import Mathlib.LinearAlgebra.Prod import Mathlib.SetTheory.Cardinal.Basic import Mathlib.Tactic.FinCases import Mathlib.Tactic.LinearCombination import Mathlib.Lean.Expr.ExtraRecognizers import Mathlib.Data.Set.Subsingleton #align_import linear_algebra.linear_independent from "leanprover-community/mathlib"@"9d684a893c52e1d6692a504a118bfccbae04feeb" noncomputable section open Function Set Submodule open Cardinal universe u' u variable {ΞΉ : Type u'} {ΞΉ' : Type*} {R : Type*} {K : Type*} variable {M : Type*} {M' M'' : Type*} {V : Type u} {V' : Type*} section Module variable {v : ΞΉ β†’ M} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid M'] [AddCommMonoid M''] variable [Module R M] [Module R M'] [Module R M''] variable {a b : R} {x y : M} variable (R) (v) def LinearIndependent : Prop := LinearMap.ker (Finsupp.total ΞΉ M R v) = βŠ₯ #align linear_independent LinearIndependent open Lean PrettyPrinter.Delaborator SubExpr in @[delab app.LinearIndependent] def delabLinearIndependent : Delab := whenPPOption getPPNotation <| whenNotPPOption getPPAnalysisSkip <| withOptionAtCurrPos `pp.analysis.skip true do let e ← getExpr guard <| e.isAppOfArity ``LinearIndependent 7 let some _ := (e.getArg! 0).coeTypeSet? | failure let optionsPerPos ← if (e.getArg! 3).isLambda then withNaryArg 3 do return (← read).optionsPerPos.setBool (← getPos) pp.funBinderTypes.name true else withNaryArg 0 do return (← read).optionsPerPos.setBool (← getPos) `pp.analysis.namedArg true withTheReader Context ({Β· with optionsPerPos}) delab variable {R} {v} theorem linearIndependent_iff : LinearIndependent R v ↔ βˆ€ l, Finsupp.total ΞΉ M R v l = 0 β†’ l = 0 := by simp [LinearIndependent, LinearMap.ker_eq_bot'] #align linear_independent_iff linearIndependent_iff theorem linearIndependent_iff' : LinearIndependent R v ↔ βˆ€ s : Finset ΞΉ, βˆ€ g : ΞΉ β†’ R, βˆ‘ i ∈ s, g i β€’ v i = 0 β†’ βˆ€ i ∈ s, g i = 0 := linearIndependent_iff.trans ⟨fun hf s g hg i his => have h := hf (βˆ‘ i ∈ s, Finsupp.single i (g i)) <| by simpa only [map_sum, Finsupp.total_single] using hg calc g i = (Finsupp.lapply i : (ΞΉ β†’β‚€ R) β†’β‚—[R] R) (Finsupp.single i (g i)) := by { rw [Finsupp.lapply_apply, Finsupp.single_eq_same] } _ = βˆ‘ j ∈ s, (Finsupp.lapply i : (ΞΉ β†’β‚€ R) β†’β‚—[R] R) (Finsupp.single j (g j)) := Eq.symm <| Finset.sum_eq_single i (fun j _hjs hji => by rw [Finsupp.lapply_apply, Finsupp.single_eq_of_ne hji]) fun hnis => hnis.elim his _ = (βˆ‘ j ∈ s, Finsupp.single j (g j)) i := (map_sum ..).symm _ = 0 := DFunLike.ext_iff.1 h i, fun hf l hl => Finsupp.ext fun i => _root_.by_contradiction fun hni => hni <| hf _ _ hl _ <| Finsupp.mem_support_iff.2 hni⟩ #align linear_independent_iff' linearIndependent_iff' theorem linearIndependent_iff'' : LinearIndependent R v ↔ βˆ€ (s : Finset ΞΉ) (g : ΞΉ β†’ R), (βˆ€ i βˆ‰ s, g i = 0) β†’ βˆ‘ i ∈ s, g i β€’ v i = 0 β†’ βˆ€ i, g i = 0 := by classical exact linearIndependent_iff'.trans ⟨fun H s g hg hv i => if his : i ∈ s then H s g hv i his else hg i his, fun H s g hg i hi => by convert H s (fun j => if j ∈ s then g j else 0) (fun j hj => if_neg hj) (by simp_rw [ite_smul, zero_smul, Finset.sum_extend_by_zero, hg]) i exact (if_pos hi).symm⟩ #align linear_independent_iff'' linearIndependent_iff'' theorem not_linearIndependent_iff : Β¬LinearIndependent R v ↔ βˆƒ s : Finset ΞΉ, βˆƒ g : ΞΉ β†’ R, βˆ‘ i ∈ s, g i β€’ v i = 0 ∧ βˆƒ i ∈ s, g i β‰  0 := by rw [linearIndependent_iff'] simp only [exists_prop, not_forall] #align not_linear_independent_iff not_linearIndependent_iff theorem Fintype.linearIndependent_iff [Fintype ΞΉ] : LinearIndependent R v ↔ βˆ€ g : ΞΉ β†’ R, βˆ‘ i, g i β€’ v i = 0 β†’ βˆ€ i, g i = 0 := by refine ⟨fun H g => by simpa using linearIndependent_iff'.1 H Finset.univ g, fun H => linearIndependent_iff''.2 fun s g hg hs i => H _ ?_ _⟩ rw [← hs] refine (Finset.sum_subset (Finset.subset_univ _) fun i _ hi => ?_).symm rw [hg i hi, zero_smul] #align fintype.linear_independent_iff Fintype.linearIndependent_iff theorem Fintype.linearIndependent_iff' [Fintype ΞΉ] [DecidableEq ΞΉ] : LinearIndependent R v ↔ LinearMap.ker (LinearMap.lsum R (fun _ ↦ R) β„• fun i ↦ LinearMap.id.smulRight (v i)) = βŠ₯ := by simp [Fintype.linearIndependent_iff, LinearMap.ker_eq_bot', funext_iff] #align fintype.linear_independent_iff' Fintype.linearIndependent_iff'
Mathlib/LinearAlgebra/LinearIndependent.lean
192
194
theorem Fintype.not_linearIndependent_iff [Fintype ΞΉ] : Β¬LinearIndependent R v ↔ βˆƒ g : ΞΉ β†’ R, βˆ‘ i, g i β€’ v i = 0 ∧ βˆƒ i, g i β‰  0 := by
simpa using not_iff_not.2 Fintype.linearIndependent_iff
1,329
import Mathlib.LinearAlgebra.LinearIndependent #align_import linear_algebra.dimension from "leanprover-community/mathlib"@"47a5f8186becdbc826190ced4312f8199f9db6a5" noncomputable section universe w w' u u' v v' variable {R : Type u} {R' : Type u'} {M M₁ : Type v} {M' : Type v'} open Cardinal Submodule Function Set section Module section variable [Semiring R] [AddCommMonoid M] [Module R M] variable (R M) protected irreducible_def Module.rank : Cardinal := ⨆ ΞΉ : { s : Set M // LinearIndependent R ((↑) : s β†’ M) }, (#ΞΉ.1) #align module.rank Module.rank theorem rank_le_card : Module.rank R M ≀ #M := (Module.rank_def _ _).trans_le (ciSup_le' fun _ ↦ mk_set_le _) lemma nonempty_linearIndependent_set : Nonempty {s : Set M // LinearIndependent R ((↑) : s β†’ M)} := βŸ¨βŸ¨βˆ…, linearIndependent_empty _ _⟩⟩ end variable [Ring R] [Ring R'] [AddCommGroup M] [AddCommGroup M'] [AddCommGroup M₁] variable [Module R M] [Module R M'] [Module R M₁] [Module R' M'] [Module R' M₁] namespace LinearIndependent variable [Nontrivial R]
Mathlib/LinearAlgebra/Dimension/Basic.lean
79
84
theorem cardinal_lift_le_rank {ΞΉ : Type w} {v : ΞΉ β†’ M} (hv : LinearIndependent R v) : Cardinal.lift.{v} #ΞΉ ≀ Cardinal.lift.{w} (Module.rank R M) := by
rw [Module.rank] refine le_trans ?_ (lift_le.mpr <| le_ciSup (bddAbove_range.{v, v} _) ⟨_, hv.coe_range⟩) exact lift_mk_le'.mpr ⟨(Equiv.ofInjective _ hv.injective).toEmbedding⟩
1,330
import Mathlib.LinearAlgebra.LinearIndependent #align_import linear_algebra.dimension from "leanprover-community/mathlib"@"47a5f8186becdbc826190ced4312f8199f9db6a5" noncomputable section universe w w' u u' v v' variable {R : Type u} {R' : Type u'} {M M₁ : Type v} {M' : Type v'} open Cardinal Submodule Function Set section Module section variable [Semiring R] [AddCommMonoid M] [Module R M] variable (R M) protected irreducible_def Module.rank : Cardinal := ⨆ ΞΉ : { s : Set M // LinearIndependent R ((↑) : s β†’ M) }, (#ΞΉ.1) #align module.rank Module.rank theorem rank_le_card : Module.rank R M ≀ #M := (Module.rank_def _ _).trans_le (ciSup_le' fun _ ↦ mk_set_le _) lemma nonempty_linearIndependent_set : Nonempty {s : Set M // LinearIndependent R ((↑) : s β†’ M)} := βŸ¨βŸ¨βˆ…, linearIndependent_empty _ _⟩⟩ end variable [Ring R] [Ring R'] [AddCommGroup M] [AddCommGroup M'] [AddCommGroup M₁] variable [Module R M] [Module R M'] [Module R M₁] [Module R' M'] [Module R' M₁] namespace LinearIndependent variable [Nontrivial R] theorem cardinal_lift_le_rank {ΞΉ : Type w} {v : ΞΉ β†’ M} (hv : LinearIndependent R v) : Cardinal.lift.{v} #ΞΉ ≀ Cardinal.lift.{w} (Module.rank R M) := by rw [Module.rank] refine le_trans ?_ (lift_le.mpr <| le_ciSup (bddAbove_range.{v, v} _) ⟨_, hv.coe_range⟩) exact lift_mk_le'.mpr ⟨(Equiv.ofInjective _ hv.injective).toEmbedding⟩ #align cardinal_lift_le_rank_of_linear_independent LinearIndependent.cardinal_lift_le_rank #align cardinal_lift_le_rank_of_linear_independent' LinearIndependent.cardinal_lift_le_rank lemma aleph0_le_rank {ΞΉ : Type w} [Infinite ΞΉ] {v : ΞΉ β†’ M} (hv : LinearIndependent R v) : β„΅β‚€ ≀ Module.rank R M := aleph0_le_lift.mp <| (aleph0_le_lift.mpr <| aleph0_le_mk ΞΉ).trans hv.cardinal_lift_le_rank
Mathlib/LinearAlgebra/Dimension/Basic.lean
92
94
theorem cardinal_le_rank {ΞΉ : Type v} {v : ΞΉ β†’ M} (hv : LinearIndependent R v) : #ΞΉ ≀ Module.rank R M := by
simpa using hv.cardinal_lift_le_rank
1,330
import Mathlib.LinearAlgebra.Dimension.Basic import Mathlib.SetTheory.Cardinal.ToNat #align_import linear_algebra.finrank from "leanprover-community/mathlib"@"347636a7a80595d55bedf6e6fbd996a3c39da69a" universe u v w open Cardinal Submodule Module Function variable {R : Type u} {M : Type v} {N : Type w} variable [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] namespace FiniteDimensional section Ring noncomputable def finrank (R M : Type*) [Semiring R] [AddCommGroup M] [Module R M] : β„• := Cardinal.toNat (Module.rank R M) #align finite_dimensional.finrank FiniteDimensional.finrank
Mathlib/LinearAlgebra/Dimension/Finrank.lean
58
61
theorem finrank_eq_of_rank_eq {n : β„•} (h : Module.rank R M = ↑n) : finrank R M = n := by
apply_fun toNat at h rw [toNat_natCast] at h exact mod_cast h
1,331
import Mathlib.LinearAlgebra.Dimension.Basic import Mathlib.SetTheory.Cardinal.ToNat #align_import linear_algebra.finrank from "leanprover-community/mathlib"@"347636a7a80595d55bedf6e6fbd996a3c39da69a" universe u v w open Cardinal Submodule Module Function variable {R : Type u} {M : Type v} {N : Type w} variable [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] namespace FiniteDimensional section Ring noncomputable def finrank (R M : Type*) [Semiring R] [AddCommGroup M] [Module R M] : β„• := Cardinal.toNat (Module.rank R M) #align finite_dimensional.finrank FiniteDimensional.finrank theorem finrank_eq_of_rank_eq {n : β„•} (h : Module.rank R M = ↑n) : finrank R M = n := by apply_fun toNat at h rw [toNat_natCast] at h exact mod_cast h #align finite_dimensional.finrank_eq_of_rank_eq FiniteDimensional.finrank_eq_of_rank_eq lemma rank_eq_one_iff_finrank_eq_one : Module.rank R M = 1 ↔ finrank R M = 1 := Cardinal.toNat_eq_one.symm lemma rank_eq_ofNat_iff_finrank_eq_ofNat (n : β„•) [Nat.AtLeastTwo n] : Module.rank R M = OfNat.ofNat n ↔ finrank R M = OfNat.ofNat n := Cardinal.toNat_eq_ofNat.symm
Mathlib/LinearAlgebra/Dimension/Finrank.lean
72
75
theorem finrank_le_of_rank_le {n : β„•} (h : Module.rank R M ≀ ↑n) : finrank R M ≀ n := by
rwa [← Cardinal.toNat_le_iff_le_of_lt_aleph0, toNat_natCast] at h Β· exact h.trans_lt (nat_lt_aleph0 n) Β· exact nat_lt_aleph0 n
1,331
import Mathlib.LinearAlgebra.Dimension.Basic import Mathlib.SetTheory.Cardinal.ToNat #align_import linear_algebra.finrank from "leanprover-community/mathlib"@"347636a7a80595d55bedf6e6fbd996a3c39da69a" universe u v w open Cardinal Submodule Module Function variable {R : Type u} {M : Type v} {N : Type w} variable [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] namespace FiniteDimensional section Ring noncomputable def finrank (R M : Type*) [Semiring R] [AddCommGroup M] [Module R M] : β„• := Cardinal.toNat (Module.rank R M) #align finite_dimensional.finrank FiniteDimensional.finrank theorem finrank_eq_of_rank_eq {n : β„•} (h : Module.rank R M = ↑n) : finrank R M = n := by apply_fun toNat at h rw [toNat_natCast] at h exact mod_cast h #align finite_dimensional.finrank_eq_of_rank_eq FiniteDimensional.finrank_eq_of_rank_eq lemma rank_eq_one_iff_finrank_eq_one : Module.rank R M = 1 ↔ finrank R M = 1 := Cardinal.toNat_eq_one.symm lemma rank_eq_ofNat_iff_finrank_eq_ofNat (n : β„•) [Nat.AtLeastTwo n] : Module.rank R M = OfNat.ofNat n ↔ finrank R M = OfNat.ofNat n := Cardinal.toNat_eq_ofNat.symm theorem finrank_le_of_rank_le {n : β„•} (h : Module.rank R M ≀ ↑n) : finrank R M ≀ n := by rwa [← Cardinal.toNat_le_iff_le_of_lt_aleph0, toNat_natCast] at h Β· exact h.trans_lt (nat_lt_aleph0 n) Β· exact nat_lt_aleph0 n #align finite_dimensional.finrank_le_of_rank_le FiniteDimensional.finrank_le_of_rank_le
Mathlib/LinearAlgebra/Dimension/Finrank.lean
78
81
theorem finrank_lt_of_rank_lt {n : β„•} (h : Module.rank R M < ↑n) : finrank R M < n := by
rwa [← Cardinal.toNat_lt_iff_lt_of_lt_aleph0, toNat_natCast] at h Β· exact h.trans (nat_lt_aleph0 n) Β· exact nat_lt_aleph0 n
1,331
import Mathlib.LinearAlgebra.Dimension.Basic import Mathlib.SetTheory.Cardinal.ToNat #align_import linear_algebra.finrank from "leanprover-community/mathlib"@"347636a7a80595d55bedf6e6fbd996a3c39da69a" universe u v w open Cardinal Submodule Module Function variable {R : Type u} {M : Type v} {N : Type w} variable [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] namespace FiniteDimensional section Ring noncomputable def finrank (R M : Type*) [Semiring R] [AddCommGroup M] [Module R M] : β„• := Cardinal.toNat (Module.rank R M) #align finite_dimensional.finrank FiniteDimensional.finrank theorem finrank_eq_of_rank_eq {n : β„•} (h : Module.rank R M = ↑n) : finrank R M = n := by apply_fun toNat at h rw [toNat_natCast] at h exact mod_cast h #align finite_dimensional.finrank_eq_of_rank_eq FiniteDimensional.finrank_eq_of_rank_eq lemma rank_eq_one_iff_finrank_eq_one : Module.rank R M = 1 ↔ finrank R M = 1 := Cardinal.toNat_eq_one.symm lemma rank_eq_ofNat_iff_finrank_eq_ofNat (n : β„•) [Nat.AtLeastTwo n] : Module.rank R M = OfNat.ofNat n ↔ finrank R M = OfNat.ofNat n := Cardinal.toNat_eq_ofNat.symm theorem finrank_le_of_rank_le {n : β„•} (h : Module.rank R M ≀ ↑n) : finrank R M ≀ n := by rwa [← Cardinal.toNat_le_iff_le_of_lt_aleph0, toNat_natCast] at h Β· exact h.trans_lt (nat_lt_aleph0 n) Β· exact nat_lt_aleph0 n #align finite_dimensional.finrank_le_of_rank_le FiniteDimensional.finrank_le_of_rank_le theorem finrank_lt_of_rank_lt {n : β„•} (h : Module.rank R M < ↑n) : finrank R M < n := by rwa [← Cardinal.toNat_lt_iff_lt_of_lt_aleph0, toNat_natCast] at h Β· exact h.trans (nat_lt_aleph0 n) Β· exact nat_lt_aleph0 n #align finite_dimensional.finrank_lt_of_rank_lt FiniteDimensional.finrank_lt_of_rank_lt
Mathlib/LinearAlgebra/Dimension/Finrank.lean
84
89
theorem lt_rank_of_lt_finrank {n : β„•} (h : n < finrank R M) : ↑n < Module.rank R M := by
rwa [← Cardinal.toNat_lt_iff_lt_of_lt_aleph0, toNat_natCast] Β· exact nat_lt_aleph0 n Β· contrapose! h rw [finrank, Cardinal.toNat_apply_of_aleph0_le h] exact n.zero_le
1,331
import Mathlib.LinearAlgebra.Dimension.Basic import Mathlib.SetTheory.Cardinal.ToNat #align_import linear_algebra.finrank from "leanprover-community/mathlib"@"347636a7a80595d55bedf6e6fbd996a3c39da69a" universe u v w open Cardinal Submodule Module Function variable {R : Type u} {M : Type v} {N : Type w} variable [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] namespace FiniteDimensional section Ring noncomputable def finrank (R M : Type*) [Semiring R] [AddCommGroup M] [Module R M] : β„• := Cardinal.toNat (Module.rank R M) #align finite_dimensional.finrank FiniteDimensional.finrank theorem finrank_eq_of_rank_eq {n : β„•} (h : Module.rank R M = ↑n) : finrank R M = n := by apply_fun toNat at h rw [toNat_natCast] at h exact mod_cast h #align finite_dimensional.finrank_eq_of_rank_eq FiniteDimensional.finrank_eq_of_rank_eq lemma rank_eq_one_iff_finrank_eq_one : Module.rank R M = 1 ↔ finrank R M = 1 := Cardinal.toNat_eq_one.symm lemma rank_eq_ofNat_iff_finrank_eq_ofNat (n : β„•) [Nat.AtLeastTwo n] : Module.rank R M = OfNat.ofNat n ↔ finrank R M = OfNat.ofNat n := Cardinal.toNat_eq_ofNat.symm theorem finrank_le_of_rank_le {n : β„•} (h : Module.rank R M ≀ ↑n) : finrank R M ≀ n := by rwa [← Cardinal.toNat_le_iff_le_of_lt_aleph0, toNat_natCast] at h Β· exact h.trans_lt (nat_lt_aleph0 n) Β· exact nat_lt_aleph0 n #align finite_dimensional.finrank_le_of_rank_le FiniteDimensional.finrank_le_of_rank_le theorem finrank_lt_of_rank_lt {n : β„•} (h : Module.rank R M < ↑n) : finrank R M < n := by rwa [← Cardinal.toNat_lt_iff_lt_of_lt_aleph0, toNat_natCast] at h Β· exact h.trans (nat_lt_aleph0 n) Β· exact nat_lt_aleph0 n #align finite_dimensional.finrank_lt_of_rank_lt FiniteDimensional.finrank_lt_of_rank_lt theorem lt_rank_of_lt_finrank {n : β„•} (h : n < finrank R M) : ↑n < Module.rank R M := by rwa [← Cardinal.toNat_lt_iff_lt_of_lt_aleph0, toNat_natCast] Β· exact nat_lt_aleph0 n Β· contrapose! h rw [finrank, Cardinal.toNat_apply_of_aleph0_le h] exact n.zero_le #align finite_dimensional.rank_lt_of_finrank_lt FiniteDimensional.lt_rank_of_lt_finrank
Mathlib/LinearAlgebra/Dimension/Finrank.lean
92
93
theorem one_lt_rank_of_one_lt_finrank (h : 1 < finrank R M) : 1 < Module.rank R M := by
simpa using lt_rank_of_lt_finrank h
1,331
import Mathlib.LinearAlgebra.Dimension.Basic import Mathlib.SetTheory.Cardinal.ToNat #align_import linear_algebra.finrank from "leanprover-community/mathlib"@"347636a7a80595d55bedf6e6fbd996a3c39da69a" universe u v w open Cardinal Submodule Module Function variable {R : Type u} {M : Type v} {N : Type w} variable [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] namespace FiniteDimensional section Ring noncomputable def finrank (R M : Type*) [Semiring R] [AddCommGroup M] [Module R M] : β„• := Cardinal.toNat (Module.rank R M) #align finite_dimensional.finrank FiniteDimensional.finrank theorem finrank_eq_of_rank_eq {n : β„•} (h : Module.rank R M = ↑n) : finrank R M = n := by apply_fun toNat at h rw [toNat_natCast] at h exact mod_cast h #align finite_dimensional.finrank_eq_of_rank_eq FiniteDimensional.finrank_eq_of_rank_eq lemma rank_eq_one_iff_finrank_eq_one : Module.rank R M = 1 ↔ finrank R M = 1 := Cardinal.toNat_eq_one.symm lemma rank_eq_ofNat_iff_finrank_eq_ofNat (n : β„•) [Nat.AtLeastTwo n] : Module.rank R M = OfNat.ofNat n ↔ finrank R M = OfNat.ofNat n := Cardinal.toNat_eq_ofNat.symm theorem finrank_le_of_rank_le {n : β„•} (h : Module.rank R M ≀ ↑n) : finrank R M ≀ n := by rwa [← Cardinal.toNat_le_iff_le_of_lt_aleph0, toNat_natCast] at h Β· exact h.trans_lt (nat_lt_aleph0 n) Β· exact nat_lt_aleph0 n #align finite_dimensional.finrank_le_of_rank_le FiniteDimensional.finrank_le_of_rank_le theorem finrank_lt_of_rank_lt {n : β„•} (h : Module.rank R M < ↑n) : finrank R M < n := by rwa [← Cardinal.toNat_lt_iff_lt_of_lt_aleph0, toNat_natCast] at h Β· exact h.trans (nat_lt_aleph0 n) Β· exact nat_lt_aleph0 n #align finite_dimensional.finrank_lt_of_rank_lt FiniteDimensional.finrank_lt_of_rank_lt theorem lt_rank_of_lt_finrank {n : β„•} (h : n < finrank R M) : ↑n < Module.rank R M := by rwa [← Cardinal.toNat_lt_iff_lt_of_lt_aleph0, toNat_natCast] Β· exact nat_lt_aleph0 n Β· contrapose! h rw [finrank, Cardinal.toNat_apply_of_aleph0_le h] exact n.zero_le #align finite_dimensional.rank_lt_of_finrank_lt FiniteDimensional.lt_rank_of_lt_finrank theorem one_lt_rank_of_one_lt_finrank (h : 1 < finrank R M) : 1 < Module.rank R M := by simpa using lt_rank_of_lt_finrank h
Mathlib/LinearAlgebra/Dimension/Finrank.lean
95
98
theorem finrank_le_finrank_of_rank_le_rank (h : lift.{w} (Module.rank R M) ≀ Cardinal.lift.{v} (Module.rank R N)) (h' : Module.rank R N < β„΅β‚€) : finrank R M ≀ finrank R N := by
simpa only [toNat_lift] using toNat_le_toNat h (lift_lt_aleph0.mpr h')
1,331
import Mathlib.Algebra.Group.Subgroup.Actions import Mathlib.Algebra.Order.Module.Algebra import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Algebra.Ring.Subring.Units #align_import linear_algebra.ray from "leanprover-community/mathlib"@"0f6670b8af2dff699de1c0b4b49039b31bc13c46" noncomputable section section StrictOrderedCommSemiring variable (R : Type*) [StrictOrderedCommSemiring R] variable {M : Type*} [AddCommMonoid M] [Module R M] variable {N : Type*} [AddCommMonoid N] [Module R N] variable (ΞΉ : Type*) [DecidableEq ΞΉ] def SameRay (v₁ vβ‚‚ : M) : Prop := v₁ = 0 ∨ vβ‚‚ = 0 ∨ βˆƒ r₁ rβ‚‚ : R, 0 < r₁ ∧ 0 < rβ‚‚ ∧ r₁ β€’ v₁ = rβ‚‚ β€’ vβ‚‚ #align same_ray SameRay variable {R} namespace SameRay variable {x y z : M} @[simp] theorem zero_left (y : M) : SameRay R 0 y := Or.inl rfl #align same_ray.zero_left SameRay.zero_left @[simp] theorem zero_right (x : M) : SameRay R x 0 := Or.inr <| Or.inl rfl #align same_ray.zero_right SameRay.zero_right @[nontriviality]
Mathlib/LinearAlgebra/Ray.lean
61
63
theorem of_subsingleton [Subsingleton M] (x y : M) : SameRay R x y := by
rw [Subsingleton.elim x 0] exact zero_left _
1,332
import Mathlib.Algebra.Group.Subgroup.Actions import Mathlib.Algebra.Order.Module.Algebra import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Algebra.Ring.Subring.Units #align_import linear_algebra.ray from "leanprover-community/mathlib"@"0f6670b8af2dff699de1c0b4b49039b31bc13c46" noncomputable section section StrictOrderedCommSemiring variable (R : Type*) [StrictOrderedCommSemiring R] variable {M : Type*} [AddCommMonoid M] [Module R M] variable {N : Type*} [AddCommMonoid N] [Module R N] variable (ΞΉ : Type*) [DecidableEq ΞΉ] def SameRay (v₁ vβ‚‚ : M) : Prop := v₁ = 0 ∨ vβ‚‚ = 0 ∨ βˆƒ r₁ rβ‚‚ : R, 0 < r₁ ∧ 0 < rβ‚‚ ∧ r₁ β€’ v₁ = rβ‚‚ β€’ vβ‚‚ #align same_ray SameRay variable {R} namespace SameRay variable {x y z : M} @[simp] theorem zero_left (y : M) : SameRay R 0 y := Or.inl rfl #align same_ray.zero_left SameRay.zero_left @[simp] theorem zero_right (x : M) : SameRay R x 0 := Or.inr <| Or.inl rfl #align same_ray.zero_right SameRay.zero_right @[nontriviality] theorem of_subsingleton [Subsingleton M] (x y : M) : SameRay R x y := by rw [Subsingleton.elim x 0] exact zero_left _ #align same_ray.of_subsingleton SameRay.of_subsingleton @[nontriviality] theorem of_subsingleton' [Subsingleton R] (x y : M) : SameRay R x y := haveI := Module.subsingleton R M of_subsingleton x y #align same_ray.of_subsingleton' SameRay.of_subsingleton' @[refl]
Mathlib/LinearAlgebra/Ray.lean
74
76
theorem refl (x : M) : SameRay R x x := by
nontriviality R exact Or.inr (Or.inr <| ⟨1, 1, zero_lt_one, zero_lt_one, rfl⟩)
1,332
import Mathlib.Algebra.Group.Subgroup.Actions import Mathlib.Algebra.Order.Module.Algebra import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Algebra.Ring.Subring.Units #align_import linear_algebra.ray from "leanprover-community/mathlib"@"0f6670b8af2dff699de1c0b4b49039b31bc13c46" noncomputable section section StrictOrderedCommSemiring variable (R : Type*) [StrictOrderedCommSemiring R] variable {M : Type*} [AddCommMonoid M] [Module R M] variable {N : Type*} [AddCommMonoid N] [Module R N] variable (ΞΉ : Type*) [DecidableEq ΞΉ] def SameRay (v₁ vβ‚‚ : M) : Prop := v₁ = 0 ∨ vβ‚‚ = 0 ∨ βˆƒ r₁ rβ‚‚ : R, 0 < r₁ ∧ 0 < rβ‚‚ ∧ r₁ β€’ v₁ = rβ‚‚ β€’ vβ‚‚ #align same_ray SameRay variable {R} namespace SameRay variable {x y z : M} @[simp] theorem zero_left (y : M) : SameRay R 0 y := Or.inl rfl #align same_ray.zero_left SameRay.zero_left @[simp] theorem zero_right (x : M) : SameRay R x 0 := Or.inr <| Or.inl rfl #align same_ray.zero_right SameRay.zero_right @[nontriviality] theorem of_subsingleton [Subsingleton M] (x y : M) : SameRay R x y := by rw [Subsingleton.elim x 0] exact zero_left _ #align same_ray.of_subsingleton SameRay.of_subsingleton @[nontriviality] theorem of_subsingleton' [Subsingleton R] (x y : M) : SameRay R x y := haveI := Module.subsingleton R M of_subsingleton x y #align same_ray.of_subsingleton' SameRay.of_subsingleton' @[refl] theorem refl (x : M) : SameRay R x x := by nontriviality R exact Or.inr (Or.inr <| ⟨1, 1, zero_lt_one, zero_lt_one, rfl⟩) #align same_ray.refl SameRay.refl protected theorem rfl : SameRay R x x := refl _ #align same_ray.rfl SameRay.rfl @[symm] theorem symm (h : SameRay R x y) : SameRay R y x := (or_left_comm.1 h).imp_right <| Or.imp_right fun ⟨r₁, rβ‚‚, h₁, hβ‚‚, h⟩ => ⟨rβ‚‚, r₁, hβ‚‚, h₁, h.symm⟩ #align same_ray.symm SameRay.symm theorem exists_pos (h : SameRay R x y) (hx : x β‰  0) (hy : y β‰  0) : βˆƒ r₁ rβ‚‚ : R, 0 < r₁ ∧ 0 < rβ‚‚ ∧ r₁ β€’ x = rβ‚‚ β€’ y := (h.resolve_left hx).resolve_left hy #align same_ray.exists_pos SameRay.exists_pos theorem sameRay_comm : SameRay R x y ↔ SameRay R y x := ⟨SameRay.symm, SameRay.symm⟩ #align same_ray_comm SameRay.sameRay_comm
Mathlib/LinearAlgebra/Ray.lean
102
111
theorem trans (hxy : SameRay R x y) (hyz : SameRay R y z) (hy : y = 0 β†’ x = 0 ∨ z = 0) : SameRay R x z := by
rcases eq_or_ne x 0 with (rfl | hx); Β· exact zero_left z rcases eq_or_ne z 0 with (rfl | hz); Β· exact zero_right x rcases eq_or_ne y 0 with (rfl | hy); Β· exact (hy rfl).elim (fun h => (hx h).elim) fun h => (hz h).elim rcases hxy.exists_pos hx hy with ⟨r₁, rβ‚‚, hr₁, hrβ‚‚, hβ‚βŸ© rcases hyz.exists_pos hy hz with ⟨r₃, rβ‚„, hr₃, hrβ‚„, hβ‚‚βŸ© refine Or.inr (Or.inr <| ⟨r₃ * r₁, rβ‚‚ * rβ‚„, mul_pos hr₃ hr₁, mul_pos hrβ‚‚ hrβ‚„, ?_⟩) rw [mul_smul, mul_smul, h₁, ← hβ‚‚, smul_comm]
1,332
import Mathlib.Algebra.Order.Invertible import Mathlib.Algebra.Order.Module.OrderedSMul import Mathlib.LinearAlgebra.AffineSpace.Midpoint import Mathlib.LinearAlgebra.Ray import Mathlib.Tactic.GCongr #align_import analysis.convex.segment from "leanprover-community/mathlib"@"c5773405394e073885e2a144c9ca14637e8eb963" variable {π•œ E F G ΞΉ : Type*} {Ο€ : ΞΉ β†’ Type*} open Function Set open Pointwise Convex section OrderedSemiring variable [OrderedSemiring π•œ] [AddCommMonoid E] section SMul variable (π•œ) [SMul π•œ E] {s : Set E} {x y : E} def segment (x y : E) : Set E := { z : E | βˆƒ a b : π•œ, 0 ≀ a ∧ 0 ≀ b ∧ a + b = 1 ∧ a β€’ x + b β€’ y = z } #align segment segment def openSegment (x y : E) : Set E := { z : E | βˆƒ a b : π•œ, 0 < a ∧ 0 < b ∧ a + b = 1 ∧ a β€’ x + b β€’ y = z } #align open_segment openSegment @[inherit_doc] scoped[Convex] notation (priority := high) "[" x "-[" π•œ "]" y "]" => segment π•œ x y
Mathlib/Analysis/Convex/Segment.lean
62
65
theorem segment_eq_imageβ‚‚ (x y : E) : [x -[π•œ] y] = (fun p : π•œ Γ— π•œ => p.1 β€’ x + p.2 β€’ y) '' { p | 0 ≀ p.1 ∧ 0 ≀ p.2 ∧ p.1 + p.2 = 1 } := by
simp only [segment, image, Prod.exists, mem_setOf_eq, exists_prop, and_assoc]
1,333
import Mathlib.Algebra.Order.Invertible import Mathlib.Algebra.Order.Module.OrderedSMul import Mathlib.LinearAlgebra.AffineSpace.Midpoint import Mathlib.LinearAlgebra.Ray import Mathlib.Tactic.GCongr #align_import analysis.convex.segment from "leanprover-community/mathlib"@"c5773405394e073885e2a144c9ca14637e8eb963" variable {π•œ E F G ΞΉ : Type*} {Ο€ : ΞΉ β†’ Type*} open Function Set open Pointwise Convex section OrderedSemiring variable [OrderedSemiring π•œ] [AddCommMonoid E] section SMul variable (π•œ) [SMul π•œ E] {s : Set E} {x y : E} def segment (x y : E) : Set E := { z : E | βˆƒ a b : π•œ, 0 ≀ a ∧ 0 ≀ b ∧ a + b = 1 ∧ a β€’ x + b β€’ y = z } #align segment segment def openSegment (x y : E) : Set E := { z : E | βˆƒ a b : π•œ, 0 < a ∧ 0 < b ∧ a + b = 1 ∧ a β€’ x + b β€’ y = z } #align open_segment openSegment @[inherit_doc] scoped[Convex] notation (priority := high) "[" x "-[" π•œ "]" y "]" => segment π•œ x y theorem segment_eq_imageβ‚‚ (x y : E) : [x -[π•œ] y] = (fun p : π•œ Γ— π•œ => p.1 β€’ x + p.2 β€’ y) '' { p | 0 ≀ p.1 ∧ 0 ≀ p.2 ∧ p.1 + p.2 = 1 } := by simp only [segment, image, Prod.exists, mem_setOf_eq, exists_prop, and_assoc] #align segment_eq_imageβ‚‚ segment_eq_imageβ‚‚
Mathlib/Analysis/Convex/Segment.lean
68
71
theorem openSegment_eq_imageβ‚‚ (x y : E) : openSegment π•œ x y = (fun p : π•œ Γ— π•œ => p.1 β€’ x + p.2 β€’ y) '' { p | 0 < p.1 ∧ 0 < p.2 ∧ p.1 + p.2 = 1 } := by
simp only [openSegment, image, Prod.exists, mem_setOf_eq, exists_prop, and_assoc]
1,333
import Mathlib.Algebra.Order.Group.Instances import Mathlib.Analysis.Convex.Segment import Mathlib.Tactic.GCongr #align_import analysis.convex.star from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853" open Set open Convex Pointwise variable {π•œ E F : Type*} section OrderedSemiring variable [OrderedSemiring π•œ] section AddCommMonoid variable [AddCommMonoid E] [AddCommMonoid F] section SMul variable (π•œ) [SMul π•œ E] [SMul π•œ F] (x : E) (s : Set E) def StarConvex : Prop := βˆ€ ⦃y : E⦄, y ∈ s β†’ βˆ€ ⦃a b : π•œβ¦„, 0 ≀ a β†’ 0 ≀ b β†’ a + b = 1 β†’ a β€’ x + b β€’ y ∈ s #align star_convex StarConvex variable {π•œ x s} {t : Set E}
Mathlib/Analysis/Convex/Star.lean
75
80
theorem starConvex_iff_segment_subset : StarConvex π•œ x s ↔ βˆ€ ⦃y⦄, y ∈ s β†’ [x -[π•œ] y] βŠ† s := by
constructor · rintro h y hy z ⟨a, b, ha, hb, hab, rfl⟩ exact h hy ha hb hab · rintro h y hy a b ha hb hab exact h hy ⟨a, b, ha, hb, hab, rfl⟩
1,334
import Mathlib.Algebra.Order.Group.Instances import Mathlib.Analysis.Convex.Segment import Mathlib.Tactic.GCongr #align_import analysis.convex.star from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853" open Set open Convex Pointwise variable {π•œ E F : Type*} section OrderedSemiring variable [OrderedSemiring π•œ] section AddCommMonoid variable [AddCommMonoid E] [AddCommMonoid F] section SMul variable (π•œ) [SMul π•œ E] [SMul π•œ F] (x : E) (s : Set E) def StarConvex : Prop := βˆ€ ⦃y : E⦄, y ∈ s β†’ βˆ€ ⦃a b : π•œβ¦„, 0 ≀ a β†’ 0 ≀ b β†’ a + b = 1 β†’ a β€’ x + b β€’ y ∈ s #align star_convex StarConvex variable {π•œ x s} {t : Set E} theorem starConvex_iff_segment_subset : StarConvex π•œ x s ↔ βˆ€ ⦃y⦄, y ∈ s β†’ [x -[π•œ] y] βŠ† s := by constructor Β· rintro h y hy z ⟨a, b, ha, hb, hab, rfl⟩ exact h hy ha hb hab Β· rintro h y hy a b ha hb hab exact h hy ⟨a, b, ha, hb, hab, rfl⟩ #align star_convex_iff_segment_subset starConvex_iff_segment_subset theorem StarConvex.segment_subset (h : StarConvex π•œ x s) {y : E} (hy : y ∈ s) : [x -[π•œ] y] βŠ† s := starConvex_iff_segment_subset.1 h hy #align star_convex.segment_subset StarConvex.segment_subset theorem StarConvex.openSegment_subset (h : StarConvex π•œ x s) {y : E} (hy : y ∈ s) : openSegment π•œ x y βŠ† s := (openSegment_subset_segment π•œ x y).trans (h.segment_subset hy) #align star_convex.open_segment_subset StarConvex.openSegment_subset
Mathlib/Analysis/Convex/Star.lean
93
99
theorem starConvex_iff_pointwise_add_subset : StarConvex π•œ x s ↔ βˆ€ ⦃a b : π•œβ¦„, 0 ≀ a β†’ 0 ≀ b β†’ a + b = 1 β†’ a β€’ {x} + b β€’ s βŠ† s := by
refine ⟨?_, fun h y hy a b ha hb hab => h ha hb hab (add_mem_add (smul_mem_smul_set <| mem_singleton _) ⟨_, hy, rfl⟩)⟩ rintro hA a b ha hb hab w ⟨au, ⟨u, rfl : u = x, rfl⟩, bv, ⟨v, hv, rfl⟩, rfl⟩ exact hA hv ha hb hab
1,334
import Mathlib.Algebra.Order.Group.Instances import Mathlib.Analysis.Convex.Segment import Mathlib.Tactic.GCongr #align_import analysis.convex.star from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853" open Set open Convex Pointwise variable {π•œ E F : Type*} section OrderedSemiring variable [OrderedSemiring π•œ] section AddCommMonoid variable [AddCommMonoid E] [AddCommMonoid F] section SMul variable (π•œ) [SMul π•œ E] [SMul π•œ F] (x : E) (s : Set E) def StarConvex : Prop := βˆ€ ⦃y : E⦄, y ∈ s β†’ βˆ€ ⦃a b : π•œβ¦„, 0 ≀ a β†’ 0 ≀ b β†’ a + b = 1 β†’ a β€’ x + b β€’ y ∈ s #align star_convex StarConvex variable {π•œ x s} {t : Set E} theorem starConvex_iff_segment_subset : StarConvex π•œ x s ↔ βˆ€ ⦃y⦄, y ∈ s β†’ [x -[π•œ] y] βŠ† s := by constructor Β· rintro h y hy z ⟨a, b, ha, hb, hab, rfl⟩ exact h hy ha hb hab Β· rintro h y hy a b ha hb hab exact h hy ⟨a, b, ha, hb, hab, rfl⟩ #align star_convex_iff_segment_subset starConvex_iff_segment_subset theorem StarConvex.segment_subset (h : StarConvex π•œ x s) {y : E} (hy : y ∈ s) : [x -[π•œ] y] βŠ† s := starConvex_iff_segment_subset.1 h hy #align star_convex.segment_subset StarConvex.segment_subset theorem StarConvex.openSegment_subset (h : StarConvex π•œ x s) {y : E} (hy : y ∈ s) : openSegment π•œ x y βŠ† s := (openSegment_subset_segment π•œ x y).trans (h.segment_subset hy) #align star_convex.open_segment_subset StarConvex.openSegment_subset theorem starConvex_iff_pointwise_add_subset : StarConvex π•œ x s ↔ βˆ€ ⦃a b : π•œβ¦„, 0 ≀ a β†’ 0 ≀ b β†’ a + b = 1 β†’ a β€’ {x} + b β€’ s βŠ† s := by refine ⟨?_, fun h y hy a b ha hb hab => h ha hb hab (add_mem_add (smul_mem_smul_set <| mem_singleton _) ⟨_, hy, rfl⟩)⟩ rintro hA a b ha hb hab w ⟨au, ⟨u, rfl : u = x, rfl⟩, bv, ⟨v, hv, rfl⟩, rfl⟩ exact hA hv ha hb hab #align star_convex_iff_pointwise_add_subset starConvex_iff_pointwise_add_subset theorem starConvex_empty (x : E) : StarConvex π•œ x βˆ… := fun _ hy => hy.elim #align star_convex_empty starConvex_empty theorem starConvex_univ (x : E) : StarConvex π•œ x univ := fun _ _ _ _ _ _ _ => trivial #align star_convex_univ starConvex_univ theorem StarConvex.inter (hs : StarConvex π•œ x s) (ht : StarConvex π•œ x t) : StarConvex π•œ x (s ∩ t) := fun _ hy _ _ ha hb hab => ⟨hs hy.left ha hb hab, ht hy.right ha hb hab⟩ #align star_convex.inter StarConvex.inter theorem starConvex_sInter {S : Set (Set E)} (h : βˆ€ s ∈ S, StarConvex π•œ x s) : StarConvex π•œ x (β‹‚β‚€ S) := fun _ hy _ _ ha hb hab s hs => h s hs (hy s hs) ha hb hab #align star_convex_sInter starConvex_sInter theorem starConvex_iInter {ΞΉ : Sort*} {s : ΞΉ β†’ Set E} (h : βˆ€ i, StarConvex π•œ x (s i)) : StarConvex π•œ x (β‹‚ i, s i) := sInter_range s β–Έ starConvex_sInter <| forall_mem_range.2 h #align star_convex_Inter starConvex_iInter
Mathlib/Analysis/Convex/Star.lean
121
125
theorem StarConvex.union (hs : StarConvex π•œ x s) (ht : StarConvex π•œ x t) : StarConvex π•œ x (s βˆͺ t) := by
rintro y (hy | hy) a b ha hb hab Β· exact Or.inl (hs hy ha hb hab) Β· exact Or.inr (ht hy ha hb hab)
1,334
import Mathlib.Algebra.Order.Group.Instances import Mathlib.Analysis.Convex.Segment import Mathlib.Tactic.GCongr #align_import analysis.convex.star from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853" open Set open Convex Pointwise variable {π•œ E F : Type*} section OrderedSemiring variable [OrderedSemiring π•œ] section AddCommMonoid variable [AddCommMonoid E] [AddCommMonoid F] section SMul variable (π•œ) [SMul π•œ E] [SMul π•œ F] (x : E) (s : Set E) def StarConvex : Prop := βˆ€ ⦃y : E⦄, y ∈ s β†’ βˆ€ ⦃a b : π•œβ¦„, 0 ≀ a β†’ 0 ≀ b β†’ a + b = 1 β†’ a β€’ x + b β€’ y ∈ s #align star_convex StarConvex variable {π•œ x s} {t : Set E} theorem starConvex_iff_segment_subset : StarConvex π•œ x s ↔ βˆ€ ⦃y⦄, y ∈ s β†’ [x -[π•œ] y] βŠ† s := by constructor Β· rintro h y hy z ⟨a, b, ha, hb, hab, rfl⟩ exact h hy ha hb hab Β· rintro h y hy a b ha hb hab exact h hy ⟨a, b, ha, hb, hab, rfl⟩ #align star_convex_iff_segment_subset starConvex_iff_segment_subset theorem StarConvex.segment_subset (h : StarConvex π•œ x s) {y : E} (hy : y ∈ s) : [x -[π•œ] y] βŠ† s := starConvex_iff_segment_subset.1 h hy #align star_convex.segment_subset StarConvex.segment_subset theorem StarConvex.openSegment_subset (h : StarConvex π•œ x s) {y : E} (hy : y ∈ s) : openSegment π•œ x y βŠ† s := (openSegment_subset_segment π•œ x y).trans (h.segment_subset hy) #align star_convex.open_segment_subset StarConvex.openSegment_subset theorem starConvex_iff_pointwise_add_subset : StarConvex π•œ x s ↔ βˆ€ ⦃a b : π•œβ¦„, 0 ≀ a β†’ 0 ≀ b β†’ a + b = 1 β†’ a β€’ {x} + b β€’ s βŠ† s := by refine ⟨?_, fun h y hy a b ha hb hab => h ha hb hab (add_mem_add (smul_mem_smul_set <| mem_singleton _) ⟨_, hy, rfl⟩)⟩ rintro hA a b ha hb hab w ⟨au, ⟨u, rfl : u = x, rfl⟩, bv, ⟨v, hv, rfl⟩, rfl⟩ exact hA hv ha hb hab #align star_convex_iff_pointwise_add_subset starConvex_iff_pointwise_add_subset theorem starConvex_empty (x : E) : StarConvex π•œ x βˆ… := fun _ hy => hy.elim #align star_convex_empty starConvex_empty theorem starConvex_univ (x : E) : StarConvex π•œ x univ := fun _ _ _ _ _ _ _ => trivial #align star_convex_univ starConvex_univ theorem StarConvex.inter (hs : StarConvex π•œ x s) (ht : StarConvex π•œ x t) : StarConvex π•œ x (s ∩ t) := fun _ hy _ _ ha hb hab => ⟨hs hy.left ha hb hab, ht hy.right ha hb hab⟩ #align star_convex.inter StarConvex.inter theorem starConvex_sInter {S : Set (Set E)} (h : βˆ€ s ∈ S, StarConvex π•œ x s) : StarConvex π•œ x (β‹‚β‚€ S) := fun _ hy _ _ ha hb hab s hs => h s hs (hy s hs) ha hb hab #align star_convex_sInter starConvex_sInter theorem starConvex_iInter {ΞΉ : Sort*} {s : ΞΉ β†’ Set E} (h : βˆ€ i, StarConvex π•œ x (s i)) : StarConvex π•œ x (β‹‚ i, s i) := sInter_range s β–Έ starConvex_sInter <| forall_mem_range.2 h #align star_convex_Inter starConvex_iInter theorem StarConvex.union (hs : StarConvex π•œ x s) (ht : StarConvex π•œ x t) : StarConvex π•œ x (s βˆͺ t) := by rintro y (hy | hy) a b ha hb hab Β· exact Or.inl (hs hy ha hb hab) Β· exact Or.inr (ht hy ha hb hab) #align star_convex.union StarConvex.union
Mathlib/Analysis/Convex/Star.lean
128
133
theorem starConvex_iUnion {ΞΉ : Sort*} {s : ΞΉ β†’ Set E} (hs : βˆ€ i, StarConvex π•œ x (s i)) : StarConvex π•œ x (⋃ i, s i) := by
rintro y hy a b ha hb hab rw [mem_iUnion] at hy ⊒ obtain ⟨i, hy⟩ := hy exact ⟨i, hs i hy ha hb hab⟩
1,334
import Mathlib.Algebra.Order.Group.Instances import Mathlib.Analysis.Convex.Segment import Mathlib.Tactic.GCongr #align_import analysis.convex.star from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853" open Set open Convex Pointwise variable {π•œ E F : Type*} section OrderedSemiring variable [OrderedSemiring π•œ] section AddCommMonoid variable [AddCommMonoid E] [AddCommMonoid F] section SMul variable (π•œ) [SMul π•œ E] [SMul π•œ F] (x : E) (s : Set E) def StarConvex : Prop := βˆ€ ⦃y : E⦄, y ∈ s β†’ βˆ€ ⦃a b : π•œβ¦„, 0 ≀ a β†’ 0 ≀ b β†’ a + b = 1 β†’ a β€’ x + b β€’ y ∈ s #align star_convex StarConvex variable {π•œ x s} {t : Set E} theorem starConvex_iff_segment_subset : StarConvex π•œ x s ↔ βˆ€ ⦃y⦄, y ∈ s β†’ [x -[π•œ] y] βŠ† s := by constructor Β· rintro h y hy z ⟨a, b, ha, hb, hab, rfl⟩ exact h hy ha hb hab Β· rintro h y hy a b ha hb hab exact h hy ⟨a, b, ha, hb, hab, rfl⟩ #align star_convex_iff_segment_subset starConvex_iff_segment_subset theorem StarConvex.segment_subset (h : StarConvex π•œ x s) {y : E} (hy : y ∈ s) : [x -[π•œ] y] βŠ† s := starConvex_iff_segment_subset.1 h hy #align star_convex.segment_subset StarConvex.segment_subset theorem StarConvex.openSegment_subset (h : StarConvex π•œ x s) {y : E} (hy : y ∈ s) : openSegment π•œ x y βŠ† s := (openSegment_subset_segment π•œ x y).trans (h.segment_subset hy) #align star_convex.open_segment_subset StarConvex.openSegment_subset theorem starConvex_iff_pointwise_add_subset : StarConvex π•œ x s ↔ βˆ€ ⦃a b : π•œβ¦„, 0 ≀ a β†’ 0 ≀ b β†’ a + b = 1 β†’ a β€’ {x} + b β€’ s βŠ† s := by refine ⟨?_, fun h y hy a b ha hb hab => h ha hb hab (add_mem_add (smul_mem_smul_set <| mem_singleton _) ⟨_, hy, rfl⟩)⟩ rintro hA a b ha hb hab w ⟨au, ⟨u, rfl : u = x, rfl⟩, bv, ⟨v, hv, rfl⟩, rfl⟩ exact hA hv ha hb hab #align star_convex_iff_pointwise_add_subset starConvex_iff_pointwise_add_subset theorem starConvex_empty (x : E) : StarConvex π•œ x βˆ… := fun _ hy => hy.elim #align star_convex_empty starConvex_empty theorem starConvex_univ (x : E) : StarConvex π•œ x univ := fun _ _ _ _ _ _ _ => trivial #align star_convex_univ starConvex_univ theorem StarConvex.inter (hs : StarConvex π•œ x s) (ht : StarConvex π•œ x t) : StarConvex π•œ x (s ∩ t) := fun _ hy _ _ ha hb hab => ⟨hs hy.left ha hb hab, ht hy.right ha hb hab⟩ #align star_convex.inter StarConvex.inter theorem starConvex_sInter {S : Set (Set E)} (h : βˆ€ s ∈ S, StarConvex π•œ x s) : StarConvex π•œ x (β‹‚β‚€ S) := fun _ hy _ _ ha hb hab s hs => h s hs (hy s hs) ha hb hab #align star_convex_sInter starConvex_sInter theorem starConvex_iInter {ΞΉ : Sort*} {s : ΞΉ β†’ Set E} (h : βˆ€ i, StarConvex π•œ x (s i)) : StarConvex π•œ x (β‹‚ i, s i) := sInter_range s β–Έ starConvex_sInter <| forall_mem_range.2 h #align star_convex_Inter starConvex_iInter theorem StarConvex.union (hs : StarConvex π•œ x s) (ht : StarConvex π•œ x t) : StarConvex π•œ x (s βˆͺ t) := by rintro y (hy | hy) a b ha hb hab Β· exact Or.inl (hs hy ha hb hab) Β· exact Or.inr (ht hy ha hb hab) #align star_convex.union StarConvex.union theorem starConvex_iUnion {ΞΉ : Sort*} {s : ΞΉ β†’ Set E} (hs : βˆ€ i, StarConvex π•œ x (s i)) : StarConvex π•œ x (⋃ i, s i) := by rintro y hy a b ha hb hab rw [mem_iUnion] at hy ⊒ obtain ⟨i, hy⟩ := hy exact ⟨i, hs i hy ha hb hab⟩ #align star_convex_Union starConvex_iUnion
Mathlib/Analysis/Convex/Star.lean
136
139
theorem starConvex_sUnion {S : Set (Set E)} (hS : βˆ€ s ∈ S, StarConvex π•œ x s) : StarConvex π•œ x (⋃₀ S) := by
rw [sUnion_eq_iUnion] exact starConvex_iUnion fun s => hS _ s.2
1,334
import Mathlib.Algebra.Order.Module.OrderedSMul import Mathlib.Analysis.Convex.Star import Mathlib.LinearAlgebra.AffineSpace.AffineSubspace #align_import analysis.convex.basic from "leanprover-community/mathlib"@"92bd7b1ffeb306a89f450bee126ddd8a284c259d" variable {π•œ E F Ξ² : Type*} open LinearMap Set open scoped Convex Pointwise section OrderedSemiring variable [OrderedSemiring π•œ] section AddCommMonoid variable [AddCommMonoid E] [AddCommMonoid F] section SMul variable (π•œ) [SMul π•œ E] [SMul π•œ F] (s : Set E) {x : E} def Convex : Prop := βˆ€ ⦃x : E⦄, x ∈ s β†’ StarConvex π•œ x s #align convex Convex variable {π•œ s} theorem Convex.starConvex (hs : Convex π•œ s) (hx : x ∈ s) : StarConvex π•œ x s := hs hx #align convex.star_convex Convex.starConvex theorem convex_iff_segment_subset : Convex π•œ s ↔ βˆ€ ⦃x⦄, x ∈ s β†’ βˆ€ ⦃y⦄, y ∈ s β†’ [x -[π•œ] y] βŠ† s := forallβ‚‚_congr fun _ _ => starConvex_iff_segment_subset #align convex_iff_segment_subset convex_iff_segment_subset theorem Convex.segment_subset (h : Convex π•œ s) {x y : E} (hx : x ∈ s) (hy : y ∈ s) : [x -[π•œ] y] βŠ† s := convex_iff_segment_subset.1 h hx hy #align convex.segment_subset Convex.segment_subset theorem Convex.openSegment_subset (h : Convex π•œ s) {x y : E} (hx : x ∈ s) (hy : y ∈ s) : openSegment π•œ x y βŠ† s := (openSegment_subset_segment π•œ x y).trans (h.segment_subset hx hy) #align convex.open_segment_subset Convex.openSegment_subset theorem convex_iff_pointwise_add_subset : Convex π•œ s ↔ βˆ€ ⦃a b : π•œβ¦„, 0 ≀ a β†’ 0 ≀ b β†’ a + b = 1 β†’ a β€’ s + b β€’ s βŠ† s := Iff.intro (by rintro hA a b ha hb hab w ⟨au, ⟨u, hu, rfl⟩, bv, ⟨v, hv, rfl⟩, rfl⟩ exact hA hu hv ha hb hab) fun h x hx y hy a b ha hb hab => (h ha hb hab) (Set.add_mem_add ⟨_, hx, rfl⟩ ⟨_, hy, rfl⟩) #align convex_iff_pointwise_add_subset convex_iff_pointwise_add_subset alias ⟨Convex.set_combo_subset, _⟩ := convex_iff_pointwise_add_subset #align convex.set_combo_subset Convex.set_combo_subset theorem convex_empty : Convex π•œ (βˆ… : Set E) := fun _ => False.elim #align convex_empty convex_empty theorem convex_univ : Convex π•œ (Set.univ : Set E) := fun _ _ => starConvex_univ _ #align convex_univ convex_univ theorem Convex.inter {t : Set E} (hs : Convex π•œ s) (ht : Convex π•œ t) : Convex π•œ (s ∩ t) := fun _ hx => (hs hx.1).inter (ht hx.2) #align convex.inter Convex.inter theorem convex_sInter {S : Set (Set E)} (h : βˆ€ s ∈ S, Convex π•œ s) : Convex π•œ (β‹‚β‚€ S) := fun _ hx => starConvex_sInter fun _ hs => h _ hs <| hx _ hs #align convex_sInter convex_sInter theorem convex_iInter {ΞΉ : Sort*} {s : ΞΉ β†’ Set E} (h : βˆ€ i, Convex π•œ (s i)) : Convex π•œ (β‹‚ i, s i) := sInter_range s β–Έ convex_sInter <| forall_mem_range.2 h #align convex_Inter convex_iInter theorem convex_iInterβ‚‚ {ΞΉ : Sort*} {ΞΊ : ΞΉ β†’ Sort*} {s : βˆ€ i, ΞΊ i β†’ Set E} (h : βˆ€ i j, Convex π•œ (s i j)) : Convex π•œ (β‹‚ (i) (j), s i j) := convex_iInter fun i => convex_iInter <| h i #align convex_Interβ‚‚ convex_iInterβ‚‚ theorem Convex.prod {s : Set E} {t : Set F} (hs : Convex π•œ s) (ht : Convex π•œ t) : Convex π•œ (s Γ—Λ’ t) := fun _ hx => (hs hx.1).prod (ht hx.2) #align convex.prod Convex.prod theorem convex_pi {ΞΉ : Type*} {E : ΞΉ β†’ Type*} [βˆ€ i, AddCommMonoid (E i)] [βˆ€ i, SMul π•œ (E i)] {s : Set ΞΉ} {t : βˆ€ i, Set (E i)} (ht : βˆ€ ⦃i⦄, i ∈ s β†’ Convex π•œ (t i)) : Convex π•œ (s.pi t) := fun _ hx => starConvex_pi fun _ hi => ht hi <| hx _ hi #align convex_pi convex_pi
Mathlib/Analysis/Convex/Basic.lean
121
128
theorem Directed.convex_iUnion {ΞΉ : Sort*} {s : ΞΉ β†’ Set E} (hdir : Directed (Β· βŠ† Β·) s) (hc : βˆ€ ⦃i : ι⦄, Convex π•œ (s i)) : Convex π•œ (⋃ i, s i) := by
rintro x hx y hy a b ha hb hab rw [mem_iUnion] at hx hy ⊒ obtain ⟨i, hx⟩ := hx obtain ⟨j, hy⟩ := hy obtain ⟨k, hik, hjk⟩ := hdir i j exact ⟨k, hc (hik hx) (hjk hy) ha hb hab⟩
1,335
import Mathlib.Algebra.Order.Module.OrderedSMul import Mathlib.Analysis.Convex.Star import Mathlib.LinearAlgebra.AffineSpace.AffineSubspace #align_import analysis.convex.basic from "leanprover-community/mathlib"@"92bd7b1ffeb306a89f450bee126ddd8a284c259d" variable {π•œ E F Ξ² : Type*} open LinearMap Set open scoped Convex Pointwise section OrderedSemiring variable [OrderedSemiring π•œ] section AddCommMonoid variable [AddCommMonoid E] [AddCommMonoid F] section SMul variable (π•œ) [SMul π•œ E] [SMul π•œ F] (s : Set E) {x : E} def Convex : Prop := βˆ€ ⦃x : E⦄, x ∈ s β†’ StarConvex π•œ x s #align convex Convex variable {π•œ s} theorem Convex.starConvex (hs : Convex π•œ s) (hx : x ∈ s) : StarConvex π•œ x s := hs hx #align convex.star_convex Convex.starConvex theorem convex_iff_segment_subset : Convex π•œ s ↔ βˆ€ ⦃x⦄, x ∈ s β†’ βˆ€ ⦃y⦄, y ∈ s β†’ [x -[π•œ] y] βŠ† s := forallβ‚‚_congr fun _ _ => starConvex_iff_segment_subset #align convex_iff_segment_subset convex_iff_segment_subset theorem Convex.segment_subset (h : Convex π•œ s) {x y : E} (hx : x ∈ s) (hy : y ∈ s) : [x -[π•œ] y] βŠ† s := convex_iff_segment_subset.1 h hx hy #align convex.segment_subset Convex.segment_subset theorem Convex.openSegment_subset (h : Convex π•œ s) {x y : E} (hx : x ∈ s) (hy : y ∈ s) : openSegment π•œ x y βŠ† s := (openSegment_subset_segment π•œ x y).trans (h.segment_subset hx hy) #align convex.open_segment_subset Convex.openSegment_subset theorem convex_iff_pointwise_add_subset : Convex π•œ s ↔ βˆ€ ⦃a b : π•œβ¦„, 0 ≀ a β†’ 0 ≀ b β†’ a + b = 1 β†’ a β€’ s + b β€’ s βŠ† s := Iff.intro (by rintro hA a b ha hb hab w ⟨au, ⟨u, hu, rfl⟩, bv, ⟨v, hv, rfl⟩, rfl⟩ exact hA hu hv ha hb hab) fun h x hx y hy a b ha hb hab => (h ha hb hab) (Set.add_mem_add ⟨_, hx, rfl⟩ ⟨_, hy, rfl⟩) #align convex_iff_pointwise_add_subset convex_iff_pointwise_add_subset alias ⟨Convex.set_combo_subset, _⟩ := convex_iff_pointwise_add_subset #align convex.set_combo_subset Convex.set_combo_subset theorem convex_empty : Convex π•œ (βˆ… : Set E) := fun _ => False.elim #align convex_empty convex_empty theorem convex_univ : Convex π•œ (Set.univ : Set E) := fun _ _ => starConvex_univ _ #align convex_univ convex_univ theorem Convex.inter {t : Set E} (hs : Convex π•œ s) (ht : Convex π•œ t) : Convex π•œ (s ∩ t) := fun _ hx => (hs hx.1).inter (ht hx.2) #align convex.inter Convex.inter theorem convex_sInter {S : Set (Set E)} (h : βˆ€ s ∈ S, Convex π•œ s) : Convex π•œ (β‹‚β‚€ S) := fun _ hx => starConvex_sInter fun _ hs => h _ hs <| hx _ hs #align convex_sInter convex_sInter theorem convex_iInter {ΞΉ : Sort*} {s : ΞΉ β†’ Set E} (h : βˆ€ i, Convex π•œ (s i)) : Convex π•œ (β‹‚ i, s i) := sInter_range s β–Έ convex_sInter <| forall_mem_range.2 h #align convex_Inter convex_iInter theorem convex_iInterβ‚‚ {ΞΉ : Sort*} {ΞΊ : ΞΉ β†’ Sort*} {s : βˆ€ i, ΞΊ i β†’ Set E} (h : βˆ€ i j, Convex π•œ (s i j)) : Convex π•œ (β‹‚ (i) (j), s i j) := convex_iInter fun i => convex_iInter <| h i #align convex_Interβ‚‚ convex_iInterβ‚‚ theorem Convex.prod {s : Set E} {t : Set F} (hs : Convex π•œ s) (ht : Convex π•œ t) : Convex π•œ (s Γ—Λ’ t) := fun _ hx => (hs hx.1).prod (ht hx.2) #align convex.prod Convex.prod theorem convex_pi {ΞΉ : Type*} {E : ΞΉ β†’ Type*} [βˆ€ i, AddCommMonoid (E i)] [βˆ€ i, SMul π•œ (E i)] {s : Set ΞΉ} {t : βˆ€ i, Set (E i)} (ht : βˆ€ ⦃i⦄, i ∈ s β†’ Convex π•œ (t i)) : Convex π•œ (s.pi t) := fun _ hx => starConvex_pi fun _ hi => ht hi <| hx _ hi #align convex_pi convex_pi theorem Directed.convex_iUnion {ΞΉ : Sort*} {s : ΞΉ β†’ Set E} (hdir : Directed (Β· βŠ† Β·) s) (hc : βˆ€ ⦃i : ι⦄, Convex π•œ (s i)) : Convex π•œ (⋃ i, s i) := by rintro x hx y hy a b ha hb hab rw [mem_iUnion] at hx hy ⊒ obtain ⟨i, hx⟩ := hx obtain ⟨j, hy⟩ := hy obtain ⟨k, hik, hjk⟩ := hdir i j exact ⟨k, hc (hik hx) (hjk hy) ha hb hab⟩ #align directed.convex_Union Directed.convex_iUnion
Mathlib/Analysis/Convex/Basic.lean
131
134
theorem DirectedOn.convex_sUnion {c : Set (Set E)} (hdir : DirectedOn (Β· βŠ† Β·) c) (hc : βˆ€ ⦃A : Set E⦄, A ∈ c β†’ Convex π•œ A) : Convex π•œ (⋃₀ c) := by
rw [sUnion_eq_iUnion] exact (directedOn_iff_directed.1 hdir).convex_iUnion fun A => hc A.2
1,335
import Mathlib.Analysis.Convex.Basic import Mathlib.Analysis.NormedSpace.Basic import Mathlib.Topology.MetricSpace.HausdorffDistance #align_import analysis.convex.body from "leanprover-community/mathlib"@"858a10cf68fd6c06872950fc58c4dcc68d465591" open scoped Pointwise Topology NNReal variable {V : Type*} structure ConvexBody (V : Type*) [TopologicalSpace V] [AddCommMonoid V] [SMul ℝ V] where carrier : Set V convex' : Convex ℝ carrier isCompact' : IsCompact carrier nonempty' : carrier.Nonempty #align convex_body ConvexBody namespace ConvexBody section TVS variable [TopologicalSpace V] [AddCommGroup V] [Module ℝ V] instance : SetLike (ConvexBody V) V where coe := ConvexBody.carrier coe_injective' K L h := by cases K cases L congr protected theorem convex (K : ConvexBody V) : Convex ℝ (K : Set V) := K.convex' #align convex_body.convex ConvexBody.convex protected theorem isCompact (K : ConvexBody V) : IsCompact (K : Set V) := K.isCompact' #align convex_body.is_compact ConvexBody.isCompact -- Porting note (#10756): new theorem protected theorem isClosed [T2Space V] (K : ConvexBody V) : IsClosed (K : Set V) := K.isCompact.isClosed protected theorem nonempty (K : ConvexBody V) : (K : Set V).Nonempty := K.nonempty' #align convex_body.nonempty ConvexBody.nonempty @[ext] protected theorem ext {K L : ConvexBody V} (h : (K : Set V) = L) : K = L := SetLike.ext' h #align convex_body.ext ConvexBody.ext @[simp] theorem coe_mk (s : Set V) (h₁ hβ‚‚ h₃) : (mk s h₁ hβ‚‚ h₃ : Set V) = s := rfl #align convex_body.coe_mk ConvexBody.coe_mk
Mathlib/Analysis/Convex/Body.lean
93
97
theorem zero_mem_of_symmetric (K : ConvexBody V) (h_symm : βˆ€ x ∈ K, - x ∈ K) : 0 ∈ K := by
obtain ⟨x, hx⟩ := K.nonempty rw [show 0 = (1/2 : ℝ) β€’ x + (1/2 : ℝ) β€’ (- x) by field_simp] apply convex_iff_forall_pos.mp K.convex hx (h_symm x hx) all_goals linarith
1,336
import Mathlib.Analysis.Convex.Basic import Mathlib.Order.Closure #align_import analysis.convex.hull from "leanprover-community/mathlib"@"92bd7b1ffeb306a89f450bee126ddd8a284c259d" open Set open Pointwise variable {π•œ E F : Type*} section convexHull section OrderedSemiring variable [OrderedSemiring π•œ] section AddCommMonoid variable (π•œ) variable [AddCommMonoid E] [AddCommMonoid F] [Module π•œ E] [Module π•œ F] @[simps! isClosed] def convexHull : ClosureOperator (Set E) := .ofCompletePred (Convex π•œ) fun _ ↦ convex_sInter #align convex_hull convexHull variable (s : Set E) theorem subset_convexHull : s βŠ† convexHull π•œ s := (convexHull π•œ).le_closure s #align subset_convex_hull subset_convexHull theorem convex_convexHull : Convex π•œ (convexHull π•œ s) := (convexHull π•œ).isClosed_closure s #align convex_convex_hull convex_convexHull
Mathlib/Analysis/Convex/Hull.lean
56
57
theorem convexHull_eq_iInter : convexHull π•œ s = β‹‚ (t : Set E) (_ : s βŠ† t) (_ : Convex π•œ t), t := by
simp [convexHull, iInter_subtype, iInter_and]
1,337
import Mathlib.Analysis.Convex.Basic import Mathlib.Order.Closure #align_import analysis.convex.hull from "leanprover-community/mathlib"@"92bd7b1ffeb306a89f450bee126ddd8a284c259d" open Set open Pointwise variable {π•œ E F : Type*} section convexHull section OrderedSemiring variable [OrderedSemiring π•œ] section AddCommMonoid variable (π•œ) variable [AddCommMonoid E] [AddCommMonoid F] [Module π•œ E] [Module π•œ F] @[simps! isClosed] def convexHull : ClosureOperator (Set E) := .ofCompletePred (Convex π•œ) fun _ ↦ convex_sInter #align convex_hull convexHull variable (s : Set E) theorem subset_convexHull : s βŠ† convexHull π•œ s := (convexHull π•œ).le_closure s #align subset_convex_hull subset_convexHull theorem convex_convexHull : Convex π•œ (convexHull π•œ s) := (convexHull π•œ).isClosed_closure s #align convex_convex_hull convex_convexHull theorem convexHull_eq_iInter : convexHull π•œ s = β‹‚ (t : Set E) (_ : s βŠ† t) (_ : Convex π•œ t), t := by simp [convexHull, iInter_subtype, iInter_and] #align convex_hull_eq_Inter convexHull_eq_iInter variable {π•œ s} {t : Set E} {x y : E}
Mathlib/Analysis/Convex/Hull.lean
62
63
theorem mem_convexHull_iff : x ∈ convexHull π•œ s ↔ βˆ€ t, s βŠ† t β†’ Convex π•œ t β†’ x ∈ t := by
simp_rw [convexHull_eq_iInter, mem_iInter]
1,337
import Mathlib.Analysis.Convex.Basic import Mathlib.Order.Closure #align_import analysis.convex.hull from "leanprover-community/mathlib"@"92bd7b1ffeb306a89f450bee126ddd8a284c259d" open Set open Pointwise variable {π•œ E F : Type*} section convexHull section OrderedSemiring variable [OrderedSemiring π•œ] section AddCommMonoid variable (π•œ) variable [AddCommMonoid E] [AddCommMonoid F] [Module π•œ E] [Module π•œ F] @[simps! isClosed] def convexHull : ClosureOperator (Set E) := .ofCompletePred (Convex π•œ) fun _ ↦ convex_sInter #align convex_hull convexHull variable (s : Set E) theorem subset_convexHull : s βŠ† convexHull π•œ s := (convexHull π•œ).le_closure s #align subset_convex_hull subset_convexHull theorem convex_convexHull : Convex π•œ (convexHull π•œ s) := (convexHull π•œ).isClosed_closure s #align convex_convex_hull convex_convexHull theorem convexHull_eq_iInter : convexHull π•œ s = β‹‚ (t : Set E) (_ : s βŠ† t) (_ : Convex π•œ t), t := by simp [convexHull, iInter_subtype, iInter_and] #align convex_hull_eq_Inter convexHull_eq_iInter variable {π•œ s} {t : Set E} {x y : E} theorem mem_convexHull_iff : x ∈ convexHull π•œ s ↔ βˆ€ t, s βŠ† t β†’ Convex π•œ t β†’ x ∈ t := by simp_rw [convexHull_eq_iInter, mem_iInter] #align mem_convex_hull_iff mem_convexHull_iff theorem convexHull_min : s βŠ† t β†’ Convex π•œ t β†’ convexHull π•œ s βŠ† t := (convexHull π•œ).closure_min #align convex_hull_min convexHull_min theorem Convex.convexHull_subset_iff (ht : Convex π•œ t) : convexHull π•œ s βŠ† t ↔ s βŠ† t := (show (convexHull π•œ).IsClosed t from ht).closure_le_iff #align convex.convex_hull_subset_iff Convex.convexHull_subset_iff @[mono] theorem convexHull_mono (hst : s βŠ† t) : convexHull π•œ s βŠ† convexHull π•œ t := (convexHull π•œ).monotone hst #align convex_hull_mono convexHull_mono lemma convexHull_eq_self : convexHull π•œ s = s ↔ Convex π•œ s := (convexHull π•œ).isClosed_iff.symm alias ⟨_, Convex.convexHull_eq⟩ := convexHull_eq_self #align convex.convex_hull_eq Convex.convexHull_eq @[simp] theorem convexHull_univ : convexHull π•œ (univ : Set E) = univ := ClosureOperator.closure_top (convexHull π•œ) #align convex_hull_univ convexHull_univ @[simp] theorem convexHull_empty : convexHull π•œ (βˆ… : Set E) = βˆ… := convex_empty.convexHull_eq #align convex_hull_empty convexHull_empty @[simp]
Mathlib/Analysis/Convex/Hull.lean
94
100
theorem convexHull_empty_iff : convexHull π•œ s = βˆ… ↔ s = βˆ… := by
constructor Β· intro h rw [← Set.subset_empty_iff, ← h] exact subset_convexHull π•œ _ Β· rintro rfl exact convexHull_empty
1,337
import Mathlib.Analysis.Convex.Basic import Mathlib.Order.Closure #align_import analysis.convex.hull from "leanprover-community/mathlib"@"92bd7b1ffeb306a89f450bee126ddd8a284c259d" open Set open Pointwise variable {π•œ E F : Type*} section convexHull section OrderedSemiring variable [OrderedSemiring π•œ] section AddCommMonoid variable (π•œ) variable [AddCommMonoid E] [AddCommMonoid F] [Module π•œ E] [Module π•œ F] @[simps! isClosed] def convexHull : ClosureOperator (Set E) := .ofCompletePred (Convex π•œ) fun _ ↦ convex_sInter #align convex_hull convexHull variable (s : Set E) theorem subset_convexHull : s βŠ† convexHull π•œ s := (convexHull π•œ).le_closure s #align subset_convex_hull subset_convexHull theorem convex_convexHull : Convex π•œ (convexHull π•œ s) := (convexHull π•œ).isClosed_closure s #align convex_convex_hull convex_convexHull theorem convexHull_eq_iInter : convexHull π•œ s = β‹‚ (t : Set E) (_ : s βŠ† t) (_ : Convex π•œ t), t := by simp [convexHull, iInter_subtype, iInter_and] #align convex_hull_eq_Inter convexHull_eq_iInter variable {π•œ s} {t : Set E} {x y : E} theorem mem_convexHull_iff : x ∈ convexHull π•œ s ↔ βˆ€ t, s βŠ† t β†’ Convex π•œ t β†’ x ∈ t := by simp_rw [convexHull_eq_iInter, mem_iInter] #align mem_convex_hull_iff mem_convexHull_iff theorem convexHull_min : s βŠ† t β†’ Convex π•œ t β†’ convexHull π•œ s βŠ† t := (convexHull π•œ).closure_min #align convex_hull_min convexHull_min theorem Convex.convexHull_subset_iff (ht : Convex π•œ t) : convexHull π•œ s βŠ† t ↔ s βŠ† t := (show (convexHull π•œ).IsClosed t from ht).closure_le_iff #align convex.convex_hull_subset_iff Convex.convexHull_subset_iff @[mono] theorem convexHull_mono (hst : s βŠ† t) : convexHull π•œ s βŠ† convexHull π•œ t := (convexHull π•œ).monotone hst #align convex_hull_mono convexHull_mono lemma convexHull_eq_self : convexHull π•œ s = s ↔ Convex π•œ s := (convexHull π•œ).isClosed_iff.symm alias ⟨_, Convex.convexHull_eq⟩ := convexHull_eq_self #align convex.convex_hull_eq Convex.convexHull_eq @[simp] theorem convexHull_univ : convexHull π•œ (univ : Set E) = univ := ClosureOperator.closure_top (convexHull π•œ) #align convex_hull_univ convexHull_univ @[simp] theorem convexHull_empty : convexHull π•œ (βˆ… : Set E) = βˆ… := convex_empty.convexHull_eq #align convex_hull_empty convexHull_empty @[simp] theorem convexHull_empty_iff : convexHull π•œ s = βˆ… ↔ s = βˆ… := by constructor Β· intro h rw [← Set.subset_empty_iff, ← h] exact subset_convexHull π•œ _ Β· rintro rfl exact convexHull_empty #align convex_hull_empty_iff convexHull_empty_iff @[simp]
Mathlib/Analysis/Convex/Hull.lean
104
106
theorem convexHull_nonempty_iff : (convexHull π•œ s).Nonempty ↔ s.Nonempty := by
rw [nonempty_iff_ne_empty, nonempty_iff_ne_empty, Ne, Ne] exact not_congr convexHull_empty_iff
1,337
import Mathlib.Analysis.Convex.Basic import Mathlib.Order.Closure #align_import analysis.convex.hull from "leanprover-community/mathlib"@"92bd7b1ffeb306a89f450bee126ddd8a284c259d" open Set open Pointwise variable {π•œ E F : Type*} section convexHull section OrderedSemiring variable [OrderedSemiring π•œ] section AddCommMonoid variable (π•œ) variable [AddCommMonoid E] [AddCommMonoid F] [Module π•œ E] [Module π•œ F] @[simps! isClosed] def convexHull : ClosureOperator (Set E) := .ofCompletePred (Convex π•œ) fun _ ↦ convex_sInter #align convex_hull convexHull variable (s : Set E) theorem subset_convexHull : s βŠ† convexHull π•œ s := (convexHull π•œ).le_closure s #align subset_convex_hull subset_convexHull theorem convex_convexHull : Convex π•œ (convexHull π•œ s) := (convexHull π•œ).isClosed_closure s #align convex_convex_hull convex_convexHull theorem convexHull_eq_iInter : convexHull π•œ s = β‹‚ (t : Set E) (_ : s βŠ† t) (_ : Convex π•œ t), t := by simp [convexHull, iInter_subtype, iInter_and] #align convex_hull_eq_Inter convexHull_eq_iInter variable {π•œ s} {t : Set E} {x y : E} theorem mem_convexHull_iff : x ∈ convexHull π•œ s ↔ βˆ€ t, s βŠ† t β†’ Convex π•œ t β†’ x ∈ t := by simp_rw [convexHull_eq_iInter, mem_iInter] #align mem_convex_hull_iff mem_convexHull_iff theorem convexHull_min : s βŠ† t β†’ Convex π•œ t β†’ convexHull π•œ s βŠ† t := (convexHull π•œ).closure_min #align convex_hull_min convexHull_min theorem Convex.convexHull_subset_iff (ht : Convex π•œ t) : convexHull π•œ s βŠ† t ↔ s βŠ† t := (show (convexHull π•œ).IsClosed t from ht).closure_le_iff #align convex.convex_hull_subset_iff Convex.convexHull_subset_iff @[mono] theorem convexHull_mono (hst : s βŠ† t) : convexHull π•œ s βŠ† convexHull π•œ t := (convexHull π•œ).monotone hst #align convex_hull_mono convexHull_mono lemma convexHull_eq_self : convexHull π•œ s = s ↔ Convex π•œ s := (convexHull π•œ).isClosed_iff.symm alias ⟨_, Convex.convexHull_eq⟩ := convexHull_eq_self #align convex.convex_hull_eq Convex.convexHull_eq @[simp] theorem convexHull_univ : convexHull π•œ (univ : Set E) = univ := ClosureOperator.closure_top (convexHull π•œ) #align convex_hull_univ convexHull_univ @[simp] theorem convexHull_empty : convexHull π•œ (βˆ… : Set E) = βˆ… := convex_empty.convexHull_eq #align convex_hull_empty convexHull_empty @[simp] theorem convexHull_empty_iff : convexHull π•œ s = βˆ… ↔ s = βˆ… := by constructor Β· intro h rw [← Set.subset_empty_iff, ← h] exact subset_convexHull π•œ _ Β· rintro rfl exact convexHull_empty #align convex_hull_empty_iff convexHull_empty_iff @[simp] theorem convexHull_nonempty_iff : (convexHull π•œ s).Nonempty ↔ s.Nonempty := by rw [nonempty_iff_ne_empty, nonempty_iff_ne_empty, Ne, Ne] exact not_congr convexHull_empty_iff #align convex_hull_nonempty_iff convexHull_nonempty_iff protected alias ⟨_, Set.Nonempty.convexHull⟩ := convexHull_nonempty_iff #align set.nonempty.convex_hull Set.Nonempty.convexHull theorem segment_subset_convexHull (hx : x ∈ s) (hy : y ∈ s) : segment π•œ x y βŠ† convexHull π•œ s := (convex_convexHull _ _).segment_subset (subset_convexHull _ _ hx) (subset_convexHull _ _ hy) #align segment_subset_convex_hull segment_subset_convexHull @[simp] theorem convexHull_singleton (x : E) : convexHull π•œ ({x} : Set E) = {x} := (convex_singleton x).convexHull_eq #align convex_hull_singleton convexHull_singleton @[simp] theorem convexHull_zero : convexHull π•œ (0 : Set E) = 0 := convexHull_singleton 0 #align convex_hull_zero convexHull_zero @[simp]
Mathlib/Analysis/Convex/Hull.lean
127
131
theorem convexHull_pair (x y : E) : convexHull π•œ {x, y} = segment π•œ x y := by
refine (convexHull_min ?_ <| convex_segment _ _).antisymm (segment_subset_convexHull (mem_insert _ _) <| subset_insert _ _ <| mem_singleton _) rw [insert_subset_iff, singleton_subset_iff] exact ⟨left_mem_segment _ _ _, right_mem_segment _ _ _⟩
1,337
import Mathlib.Analysis.Convex.Basic import Mathlib.Order.Closure #align_import analysis.convex.hull from "leanprover-community/mathlib"@"92bd7b1ffeb306a89f450bee126ddd8a284c259d" open Set open Pointwise variable {π•œ E F : Type*} section convexHull section OrderedSemiring variable [OrderedSemiring π•œ] section AddCommMonoid variable (π•œ) variable [AddCommMonoid E] [AddCommMonoid F] [Module π•œ E] [Module π•œ F] @[simps! isClosed] def convexHull : ClosureOperator (Set E) := .ofCompletePred (Convex π•œ) fun _ ↦ convex_sInter #align convex_hull convexHull variable (s : Set E) theorem subset_convexHull : s βŠ† convexHull π•œ s := (convexHull π•œ).le_closure s #align subset_convex_hull subset_convexHull theorem convex_convexHull : Convex π•œ (convexHull π•œ s) := (convexHull π•œ).isClosed_closure s #align convex_convex_hull convex_convexHull theorem convexHull_eq_iInter : convexHull π•œ s = β‹‚ (t : Set E) (_ : s βŠ† t) (_ : Convex π•œ t), t := by simp [convexHull, iInter_subtype, iInter_and] #align convex_hull_eq_Inter convexHull_eq_iInter variable {π•œ s} {t : Set E} {x y : E} theorem mem_convexHull_iff : x ∈ convexHull π•œ s ↔ βˆ€ t, s βŠ† t β†’ Convex π•œ t β†’ x ∈ t := by simp_rw [convexHull_eq_iInter, mem_iInter] #align mem_convex_hull_iff mem_convexHull_iff theorem convexHull_min : s βŠ† t β†’ Convex π•œ t β†’ convexHull π•œ s βŠ† t := (convexHull π•œ).closure_min #align convex_hull_min convexHull_min theorem Convex.convexHull_subset_iff (ht : Convex π•œ t) : convexHull π•œ s βŠ† t ↔ s βŠ† t := (show (convexHull π•œ).IsClosed t from ht).closure_le_iff #align convex.convex_hull_subset_iff Convex.convexHull_subset_iff @[mono] theorem convexHull_mono (hst : s βŠ† t) : convexHull π•œ s βŠ† convexHull π•œ t := (convexHull π•œ).monotone hst #align convex_hull_mono convexHull_mono lemma convexHull_eq_self : convexHull π•œ s = s ↔ Convex π•œ s := (convexHull π•œ).isClosed_iff.symm alias ⟨_, Convex.convexHull_eq⟩ := convexHull_eq_self #align convex.convex_hull_eq Convex.convexHull_eq @[simp] theorem convexHull_univ : convexHull π•œ (univ : Set E) = univ := ClosureOperator.closure_top (convexHull π•œ) #align convex_hull_univ convexHull_univ @[simp] theorem convexHull_empty : convexHull π•œ (βˆ… : Set E) = βˆ… := convex_empty.convexHull_eq #align convex_hull_empty convexHull_empty @[simp] theorem convexHull_empty_iff : convexHull π•œ s = βˆ… ↔ s = βˆ… := by constructor Β· intro h rw [← Set.subset_empty_iff, ← h] exact subset_convexHull π•œ _ Β· rintro rfl exact convexHull_empty #align convex_hull_empty_iff convexHull_empty_iff @[simp] theorem convexHull_nonempty_iff : (convexHull π•œ s).Nonempty ↔ s.Nonempty := by rw [nonempty_iff_ne_empty, nonempty_iff_ne_empty, Ne, Ne] exact not_congr convexHull_empty_iff #align convex_hull_nonempty_iff convexHull_nonempty_iff protected alias ⟨_, Set.Nonempty.convexHull⟩ := convexHull_nonempty_iff #align set.nonempty.convex_hull Set.Nonempty.convexHull theorem segment_subset_convexHull (hx : x ∈ s) (hy : y ∈ s) : segment π•œ x y βŠ† convexHull π•œ s := (convex_convexHull _ _).segment_subset (subset_convexHull _ _ hx) (subset_convexHull _ _ hy) #align segment_subset_convex_hull segment_subset_convexHull @[simp] theorem convexHull_singleton (x : E) : convexHull π•œ ({x} : Set E) = {x} := (convex_singleton x).convexHull_eq #align convex_hull_singleton convexHull_singleton @[simp] theorem convexHull_zero : convexHull π•œ (0 : Set E) = 0 := convexHull_singleton 0 #align convex_hull_zero convexHull_zero @[simp] theorem convexHull_pair (x y : E) : convexHull π•œ {x, y} = segment π•œ x y := by refine (convexHull_min ?_ <| convex_segment _ _).antisymm (segment_subset_convexHull (mem_insert _ _) <| subset_insert _ _ <| mem_singleton _) rw [insert_subset_iff, singleton_subset_iff] exact ⟨left_mem_segment _ _ _, right_mem_segment _ _ _⟩ #align convex_hull_pair convexHull_pair theorem convexHull_convexHull_union_left (s t : Set E) : convexHull π•œ (convexHull π•œ s βˆͺ t) = convexHull π•œ (s βˆͺ t) := ClosureOperator.closure_sup_closure_left _ _ _ #align convex_hull_convex_hull_union_left convexHull_convexHull_union_left theorem convexHull_convexHull_union_right (s t : Set E) : convexHull π•œ (s βˆͺ convexHull π•œ t) = convexHull π•œ (s βˆͺ t) := ClosureOperator.closure_sup_closure_right _ _ _ #align convex_hull_convex_hull_union_right convexHull_convexHull_union_right
Mathlib/Analysis/Convex/Hull.lean
144
158
theorem Convex.convex_remove_iff_not_mem_convexHull_remove {s : Set E} (hs : Convex π•œ s) (x : E) : Convex π•œ (s \ {x}) ↔ x βˆ‰ convexHull π•œ (s \ {x}) := by
constructor Β· rintro hsx hx rw [hsx.convexHull_eq] at hx exact hx.2 (mem_singleton _) rintro hx suffices h : s \ {x} = convexHull π•œ (s \ {x}) by rw [h] exact convex_convexHull π•œ _ exact Subset.antisymm (subset_convexHull π•œ _) fun y hy => ⟨convexHull_min diff_subset hs hy, by rintro (rfl : y = x) exact hx hy⟩
1,337
import Mathlib.Analysis.Convex.Basic import Mathlib.Analysis.Convex.Hull import Mathlib.Analysis.NormedSpace.Basic import Mathlib.Topology.Bornology.Absorbs #align_import analysis.locally_convex.basic from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open Set open Pointwise Topology variable {π•œ 𝕝 E : Type*} {ΞΉ : Sort*} {ΞΊ : ΞΉ β†’ Sort*} section SeminormedRing variable [SeminormedRing π•œ] section SMul variable [SMul π•œ E] {s t u v A B : Set E} variable (π•œ) def Balanced (A : Set E) := βˆ€ a : π•œ, β€–aβ€– ≀ 1 β†’ a β€’ A βŠ† A #align balanced Balanced variable {π•œ} lemma absorbs_iff_norm : Absorbs π•œ A B ↔ βˆƒ r, βˆ€ c : π•œ, r ≀ β€–cβ€– β†’ B βŠ† c β€’ A := Filter.atTop_basis.cobounded_of_norm.eventually_iff.trans <| by simp only [true_and]; rfl alias ⟨_, Absorbs.of_norm⟩ := absorbs_iff_norm lemma Absorbs.exists_pos (h : Absorbs π•œ A B) : βˆƒ r > 0, βˆ€ c : π•œ, r ≀ β€–cβ€– β†’ B βŠ† c β€’ A := let ⟨r, hr₁, hr⟩ := (Filter.atTop_basis' 1).cobounded_of_norm.eventually_iff.1 h ⟨r, one_pos.trans_le hr₁, hr⟩ theorem balanced_iff_smul_mem : Balanced π•œ s ↔ βˆ€ ⦃a : π•œβ¦„, β€–aβ€– ≀ 1 β†’ βˆ€ ⦃x : E⦄, x ∈ s β†’ a β€’ x ∈ s := forallβ‚‚_congr fun _a _ha => smul_set_subset_iff #align balanced_iff_smul_mem balanced_iff_smul_mem alias ⟨Balanced.smul_mem, _⟩ := balanced_iff_smul_mem #align balanced.smul_mem Balanced.smul_mem
Mathlib/Analysis/LocallyConvex/Basic.lean
81
82
theorem balanced_iff_closedBall_smul : Balanced π•œ s ↔ Metric.closedBall (0 : π•œ) 1 β€’ s βŠ† s := by
simp [balanced_iff_smul_mem, smul_subset_iff]
1,338
import Mathlib.Analysis.LocallyConvex.Basic #align_import analysis.locally_convex.balanced_core_hull from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open Set Pointwise Topology Filter variable {π•œ E ΞΉ : Type*} section balancedHull section SeminormedRing variable [SeminormedRing π•œ] section SMul variable (π•œ) [SMul π•œ E] {s t : Set E} {x : E} def balancedCore (s : Set E) := ⋃₀ { t : Set E | Balanced π•œ t ∧ t βŠ† s } #align balanced_core balancedCore def balancedCoreAux (s : Set E) := β‹‚ (r : π•œ) (_ : 1 ≀ β€–rβ€–), r β€’ s #align balanced_core_aux balancedCoreAux def balancedHull (s : Set E) := ⋃ (r : π•œ) (_ : β€–rβ€– ≀ 1), r β€’ s #align balanced_hull balancedHull variable {π•œ} theorem balancedCore_subset (s : Set E) : balancedCore π•œ s βŠ† s := sUnion_subset fun _ ht => ht.2 #align balanced_core_subset balancedCore_subset theorem balancedCore_empty : balancedCore π•œ (βˆ… : Set E) = βˆ… := eq_empty_of_subset_empty (balancedCore_subset _) #align balanced_core_empty balancedCore_empty
Mathlib/Analysis/LocallyConvex/BalancedCoreHull.lean
81
82
theorem mem_balancedCore_iff : x ∈ balancedCore π•œ s ↔ βˆƒ t, Balanced π•œ t ∧ t βŠ† s ∧ x ∈ t := by
simp_rw [balancedCore, mem_sUnion, mem_setOf_eq, and_assoc]
1,339
import Mathlib.Analysis.LocallyConvex.Basic #align_import analysis.locally_convex.balanced_core_hull from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open Set Pointwise Topology Filter variable {π•œ E ΞΉ : Type*} section balancedHull section SeminormedRing variable [SeminormedRing π•œ] section SMul variable (π•œ) [SMul π•œ E] {s t : Set E} {x : E} def balancedCore (s : Set E) := ⋃₀ { t : Set E | Balanced π•œ t ∧ t βŠ† s } #align balanced_core balancedCore def balancedCoreAux (s : Set E) := β‹‚ (r : π•œ) (_ : 1 ≀ β€–rβ€–), r β€’ s #align balanced_core_aux balancedCoreAux def balancedHull (s : Set E) := ⋃ (r : π•œ) (_ : β€–rβ€– ≀ 1), r β€’ s #align balanced_hull balancedHull variable {π•œ} theorem balancedCore_subset (s : Set E) : balancedCore π•œ s βŠ† s := sUnion_subset fun _ ht => ht.2 #align balanced_core_subset balancedCore_subset theorem balancedCore_empty : balancedCore π•œ (βˆ… : Set E) = βˆ… := eq_empty_of_subset_empty (balancedCore_subset _) #align balanced_core_empty balancedCore_empty theorem mem_balancedCore_iff : x ∈ balancedCore π•œ s ↔ βˆƒ t, Balanced π•œ t ∧ t βŠ† s ∧ x ∈ t := by simp_rw [balancedCore, mem_sUnion, mem_setOf_eq, and_assoc] #align mem_balanced_core_iff mem_balancedCore_iff
Mathlib/Analysis/LocallyConvex/BalancedCoreHull.lean
85
90
theorem smul_balancedCore_subset (s : Set E) {a : π•œ} (ha : β€–aβ€– ≀ 1) : a β€’ balancedCore π•œ s βŠ† balancedCore π•œ s := by
rintro x ⟨y, hy, rfl⟩ rw [mem_balancedCore_iff] at hy rcases hy with ⟨t, ht1, ht2, hy⟩ exact ⟨t, ⟨ht1, ht2⟩, ht1 a ha (smul_mem_smul_set hy)⟩
1,339
import Mathlib.Analysis.LocallyConvex.Basic #align_import analysis.locally_convex.balanced_core_hull from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open Set Pointwise Topology Filter variable {π•œ E ΞΉ : Type*} section balancedHull section SeminormedRing variable [SeminormedRing π•œ] section SMul variable (π•œ) [SMul π•œ E] {s t : Set E} {x : E} def balancedCore (s : Set E) := ⋃₀ { t : Set E | Balanced π•œ t ∧ t βŠ† s } #align balanced_core balancedCore def balancedCoreAux (s : Set E) := β‹‚ (r : π•œ) (_ : 1 ≀ β€–rβ€–), r β€’ s #align balanced_core_aux balancedCoreAux def balancedHull (s : Set E) := ⋃ (r : π•œ) (_ : β€–rβ€– ≀ 1), r β€’ s #align balanced_hull balancedHull variable {π•œ} theorem balancedCore_subset (s : Set E) : balancedCore π•œ s βŠ† s := sUnion_subset fun _ ht => ht.2 #align balanced_core_subset balancedCore_subset theorem balancedCore_empty : balancedCore π•œ (βˆ… : Set E) = βˆ… := eq_empty_of_subset_empty (balancedCore_subset _) #align balanced_core_empty balancedCore_empty theorem mem_balancedCore_iff : x ∈ balancedCore π•œ s ↔ βˆƒ t, Balanced π•œ t ∧ t βŠ† s ∧ x ∈ t := by simp_rw [balancedCore, mem_sUnion, mem_setOf_eq, and_assoc] #align mem_balanced_core_iff mem_balancedCore_iff theorem smul_balancedCore_subset (s : Set E) {a : π•œ} (ha : β€–aβ€– ≀ 1) : a β€’ balancedCore π•œ s βŠ† balancedCore π•œ s := by rintro x ⟨y, hy, rfl⟩ rw [mem_balancedCore_iff] at hy rcases hy with ⟨t, ht1, ht2, hy⟩ exact ⟨t, ⟨ht1, ht2⟩, ht1 a ha (smul_mem_smul_set hy)⟩ #align smul_balanced_core_subset smul_balancedCore_subset theorem balancedCore_balanced (s : Set E) : Balanced π•œ (balancedCore π•œ s) := fun _ => smul_balancedCore_subset s #align balanced_core_balanced balancedCore_balanced theorem Balanced.subset_balancedCore_of_subset (hs : Balanced π•œ s) (h : s βŠ† t) : s βŠ† balancedCore π•œ t := subset_sUnion_of_mem ⟨hs, h⟩ #align balanced.subset_core_of_subset Balanced.subset_balancedCore_of_subset theorem mem_balancedCoreAux_iff : x ∈ balancedCoreAux π•œ s ↔ βˆ€ r : π•œ, 1 ≀ β€–rβ€– β†’ x ∈ r β€’ s := mem_iInterβ‚‚ #align mem_balanced_core_aux_iff mem_balancedCoreAux_iff
Mathlib/Analysis/LocallyConvex/BalancedCoreHull.lean
108
109
theorem mem_balancedHull_iff : x ∈ balancedHull π•œ s ↔ βˆƒ r : π•œ, β€–rβ€– ≀ 1 ∧ x ∈ r β€’ s := by
simp [balancedHull]
1,339
import Mathlib.Analysis.LocallyConvex.Basic #align_import analysis.locally_convex.balanced_core_hull from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open Set Pointwise Topology Filter variable {π•œ E ΞΉ : Type*} section balancedHull section SeminormedRing variable [SeminormedRing π•œ] section SMul variable (π•œ) [SMul π•œ E] {s t : Set E} {x : E} def balancedCore (s : Set E) := ⋃₀ { t : Set E | Balanced π•œ t ∧ t βŠ† s } #align balanced_core balancedCore def balancedCoreAux (s : Set E) := β‹‚ (r : π•œ) (_ : 1 ≀ β€–rβ€–), r β€’ s #align balanced_core_aux balancedCoreAux def balancedHull (s : Set E) := ⋃ (r : π•œ) (_ : β€–rβ€– ≀ 1), r β€’ s #align balanced_hull balancedHull variable {π•œ} theorem balancedCore_subset (s : Set E) : balancedCore π•œ s βŠ† s := sUnion_subset fun _ ht => ht.2 #align balanced_core_subset balancedCore_subset theorem balancedCore_empty : balancedCore π•œ (βˆ… : Set E) = βˆ… := eq_empty_of_subset_empty (balancedCore_subset _) #align balanced_core_empty balancedCore_empty theorem mem_balancedCore_iff : x ∈ balancedCore π•œ s ↔ βˆƒ t, Balanced π•œ t ∧ t βŠ† s ∧ x ∈ t := by simp_rw [balancedCore, mem_sUnion, mem_setOf_eq, and_assoc] #align mem_balanced_core_iff mem_balancedCore_iff theorem smul_balancedCore_subset (s : Set E) {a : π•œ} (ha : β€–aβ€– ≀ 1) : a β€’ balancedCore π•œ s βŠ† balancedCore π•œ s := by rintro x ⟨y, hy, rfl⟩ rw [mem_balancedCore_iff] at hy rcases hy with ⟨t, ht1, ht2, hy⟩ exact ⟨t, ⟨ht1, ht2⟩, ht1 a ha (smul_mem_smul_set hy)⟩ #align smul_balanced_core_subset smul_balancedCore_subset theorem balancedCore_balanced (s : Set E) : Balanced π•œ (balancedCore π•œ s) := fun _ => smul_balancedCore_subset s #align balanced_core_balanced balancedCore_balanced theorem Balanced.subset_balancedCore_of_subset (hs : Balanced π•œ s) (h : s βŠ† t) : s βŠ† balancedCore π•œ t := subset_sUnion_of_mem ⟨hs, h⟩ #align balanced.subset_core_of_subset Balanced.subset_balancedCore_of_subset theorem mem_balancedCoreAux_iff : x ∈ balancedCoreAux π•œ s ↔ βˆ€ r : π•œ, 1 ≀ β€–rβ€– β†’ x ∈ r β€’ s := mem_iInterβ‚‚ #align mem_balanced_core_aux_iff mem_balancedCoreAux_iff theorem mem_balancedHull_iff : x ∈ balancedHull π•œ s ↔ βˆƒ r : π•œ, β€–rβ€– ≀ 1 ∧ x ∈ r β€’ s := by simp [balancedHull] #align mem_balanced_hull_iff mem_balancedHull_iff
Mathlib/Analysis/LocallyConvex/BalancedCoreHull.lean
114
118
theorem Balanced.balancedHull_subset_of_subset (ht : Balanced π•œ t) (h : s βŠ† t) : balancedHull π•œ s βŠ† t := by
intros x hx obtain ⟨r, hr, y, hy, rfl⟩ := mem_balancedHull_iff.1 hx exact ht.smul_mem hr (h hy)
1,339
import Mathlib.Analysis.Convex.Hull #align_import analysis.convex.extreme from "leanprover-community/mathlib"@"c5773405394e073885e2a144c9ca14637e8eb963" open Function Set open scoped Classical open Affine variable {π•œ E F ΞΉ : Type*} {Ο€ : ΞΉ β†’ Type*} section SMul variable (π•œ) [OrderedSemiring π•œ] [AddCommMonoid E] [SMul π•œ E] def IsExtreme (A B : Set E) : Prop := B βŠ† A ∧ βˆ€ ⦃x₁⦄, x₁ ∈ A β†’ βˆ€ ⦃x₂⦄, xβ‚‚ ∈ A β†’ βˆ€ ⦃x⦄, x ∈ B β†’ x ∈ openSegment π•œ x₁ xβ‚‚ β†’ x₁ ∈ B ∧ xβ‚‚ ∈ B #align is_extreme IsExtreme def Set.extremePoints (A : Set E) : Set E := { x ∈ A | βˆ€ ⦃x₁⦄, x₁ ∈ A β†’ βˆ€ ⦃x₂⦄, xβ‚‚ ∈ A β†’ x ∈ openSegment π•œ x₁ xβ‚‚ β†’ x₁ = x ∧ xβ‚‚ = x } #align set.extreme_points Set.extremePoints @[refl] protected theorem IsExtreme.refl (A : Set E) : IsExtreme π•œ A A := ⟨Subset.rfl, fun _ hx₁A _ hxβ‚‚A _ _ _ ↦ ⟨hx₁A, hxβ‚‚A⟩⟩ #align is_extreme.refl IsExtreme.refl variable {π•œ} {A B C : Set E} {x : E} protected theorem IsExtreme.rfl : IsExtreme π•œ A A := IsExtreme.refl π•œ A #align is_extreme.rfl IsExtreme.rfl @[trans] protected theorem IsExtreme.trans (hAB : IsExtreme π•œ A B) (hBC : IsExtreme π•œ B C) : IsExtreme π•œ A C := by refine ⟨Subset.trans hBC.1 hAB.1, fun x₁ hx₁A xβ‚‚ hxβ‚‚A x hxC hx ↦ ?_⟩ obtain ⟨hx₁B, hxβ‚‚B⟩ := hAB.2 hx₁A hxβ‚‚A (hBC.1 hxC) hx exact hBC.2 hx₁B hxβ‚‚B hxC hx #align is_extreme.trans IsExtreme.trans protected theorem IsExtreme.antisymm : AntiSymmetric (IsExtreme π•œ : Set E β†’ Set E β†’ Prop) := fun _ _ hAB hBA ↦ Subset.antisymm hBA.1 hAB.1 #align is_extreme.antisymm IsExtreme.antisymm instance : IsPartialOrder (Set E) (IsExtreme π•œ) where refl := IsExtreme.refl π•œ trans _ _ _ := IsExtreme.trans antisymm := IsExtreme.antisymm
Mathlib/Analysis/Convex/Extreme.lean
97
103
theorem IsExtreme.inter (hAB : IsExtreme π•œ A B) (hAC : IsExtreme π•œ A C) : IsExtreme π•œ A (B ∩ C) := by
use Subset.trans inter_subset_left hAB.1 rintro x₁ hx₁A xβ‚‚ hxβ‚‚A x ⟨hxB, hxC⟩ hx obtain ⟨hx₁B, hxβ‚‚B⟩ := hAB.2 hx₁A hxβ‚‚A hxB hx obtain ⟨hx₁C, hxβ‚‚C⟩ := hAC.2 hx₁A hxβ‚‚A hxC hx exact ⟨⟨hx₁B, hx₁C⟩, hxβ‚‚B, hxβ‚‚C⟩
1,340
import Mathlib.Analysis.Convex.Hull #align_import analysis.convex.extreme from "leanprover-community/mathlib"@"c5773405394e073885e2a144c9ca14637e8eb963" open Function Set open scoped Classical open Affine variable {π•œ E F ΞΉ : Type*} {Ο€ : ΞΉ β†’ Type*} section SMul variable (π•œ) [OrderedSemiring π•œ] [AddCommMonoid E] [SMul π•œ E] def IsExtreme (A B : Set E) : Prop := B βŠ† A ∧ βˆ€ ⦃x₁⦄, x₁ ∈ A β†’ βˆ€ ⦃x₂⦄, xβ‚‚ ∈ A β†’ βˆ€ ⦃x⦄, x ∈ B β†’ x ∈ openSegment π•œ x₁ xβ‚‚ β†’ x₁ ∈ B ∧ xβ‚‚ ∈ B #align is_extreme IsExtreme def Set.extremePoints (A : Set E) : Set E := { x ∈ A | βˆ€ ⦃x₁⦄, x₁ ∈ A β†’ βˆ€ ⦃x₂⦄, xβ‚‚ ∈ A β†’ x ∈ openSegment π•œ x₁ xβ‚‚ β†’ x₁ = x ∧ xβ‚‚ = x } #align set.extreme_points Set.extremePoints @[refl] protected theorem IsExtreme.refl (A : Set E) : IsExtreme π•œ A A := ⟨Subset.rfl, fun _ hx₁A _ hxβ‚‚A _ _ _ ↦ ⟨hx₁A, hxβ‚‚A⟩⟩ #align is_extreme.refl IsExtreme.refl variable {π•œ} {A B C : Set E} {x : E} protected theorem IsExtreme.rfl : IsExtreme π•œ A A := IsExtreme.refl π•œ A #align is_extreme.rfl IsExtreme.rfl @[trans] protected theorem IsExtreme.trans (hAB : IsExtreme π•œ A B) (hBC : IsExtreme π•œ B C) : IsExtreme π•œ A C := by refine ⟨Subset.trans hBC.1 hAB.1, fun x₁ hx₁A xβ‚‚ hxβ‚‚A x hxC hx ↦ ?_⟩ obtain ⟨hx₁B, hxβ‚‚B⟩ := hAB.2 hx₁A hxβ‚‚A (hBC.1 hxC) hx exact hBC.2 hx₁B hxβ‚‚B hxC hx #align is_extreme.trans IsExtreme.trans protected theorem IsExtreme.antisymm : AntiSymmetric (IsExtreme π•œ : Set E β†’ Set E β†’ Prop) := fun _ _ hAB hBA ↦ Subset.antisymm hBA.1 hAB.1 #align is_extreme.antisymm IsExtreme.antisymm instance : IsPartialOrder (Set E) (IsExtreme π•œ) where refl := IsExtreme.refl π•œ trans _ _ _ := IsExtreme.trans antisymm := IsExtreme.antisymm theorem IsExtreme.inter (hAB : IsExtreme π•œ A B) (hAC : IsExtreme π•œ A C) : IsExtreme π•œ A (B ∩ C) := by use Subset.trans inter_subset_left hAB.1 rintro x₁ hx₁A xβ‚‚ hxβ‚‚A x ⟨hxB, hxC⟩ hx obtain ⟨hx₁B, hxβ‚‚B⟩ := hAB.2 hx₁A hxβ‚‚A hxB hx obtain ⟨hx₁C, hxβ‚‚C⟩ := hAC.2 hx₁A hxβ‚‚A hxC hx exact ⟨⟨hx₁B, hx₁C⟩, hxβ‚‚B, hxβ‚‚C⟩ #align is_extreme.inter IsExtreme.inter protected theorem IsExtreme.mono (hAC : IsExtreme π•œ A C) (hBA : B βŠ† A) (hCB : C βŠ† B) : IsExtreme π•œ B C := ⟨hCB, fun _ hx₁B _ hxβ‚‚B _ hxC hx ↦ hAC.2 (hBA hx₁B) (hBA hxβ‚‚B) hxC hx⟩ #align is_extreme.mono IsExtreme.mono
Mathlib/Analysis/Convex/Extreme.lean
111
117
theorem isExtreme_iInter {ΞΉ : Sort*} [Nonempty ΞΉ] {F : ΞΉ β†’ Set E} (hAF : βˆ€ i : ΞΉ, IsExtreme π•œ A (F i)) : IsExtreme π•œ A (β‹‚ i : ΞΉ, F i) := by
obtain i := Classical.arbitrary ΞΉ refine ⟨iInter_subset_of_subset i (hAF i).1, fun x₁ hx₁A xβ‚‚ hxβ‚‚A x hxF hx ↦ ?_⟩ simp_rw [mem_iInter] at hxF ⊒ have h := fun i ↦ (hAF i).2 hx₁A hxβ‚‚A (hxF i) hx exact ⟨fun i ↦ (h i).1, fun i ↦ (h i).2⟩
1,340
import Mathlib.Analysis.Convex.Hull #align_import analysis.convex.extreme from "leanprover-community/mathlib"@"c5773405394e073885e2a144c9ca14637e8eb963" open Function Set open scoped Classical open Affine variable {π•œ E F ΞΉ : Type*} {Ο€ : ΞΉ β†’ Type*} section SMul variable (π•œ) [OrderedSemiring π•œ] [AddCommMonoid E] [SMul π•œ E] def IsExtreme (A B : Set E) : Prop := B βŠ† A ∧ βˆ€ ⦃x₁⦄, x₁ ∈ A β†’ βˆ€ ⦃x₂⦄, xβ‚‚ ∈ A β†’ βˆ€ ⦃x⦄, x ∈ B β†’ x ∈ openSegment π•œ x₁ xβ‚‚ β†’ x₁ ∈ B ∧ xβ‚‚ ∈ B #align is_extreme IsExtreme def Set.extremePoints (A : Set E) : Set E := { x ∈ A | βˆ€ ⦃x₁⦄, x₁ ∈ A β†’ βˆ€ ⦃x₂⦄, xβ‚‚ ∈ A β†’ x ∈ openSegment π•œ x₁ xβ‚‚ β†’ x₁ = x ∧ xβ‚‚ = x } #align set.extreme_points Set.extremePoints @[refl] protected theorem IsExtreme.refl (A : Set E) : IsExtreme π•œ A A := ⟨Subset.rfl, fun _ hx₁A _ hxβ‚‚A _ _ _ ↦ ⟨hx₁A, hxβ‚‚A⟩⟩ #align is_extreme.refl IsExtreme.refl variable {π•œ} {A B C : Set E} {x : E} protected theorem IsExtreme.rfl : IsExtreme π•œ A A := IsExtreme.refl π•œ A #align is_extreme.rfl IsExtreme.rfl @[trans] protected theorem IsExtreme.trans (hAB : IsExtreme π•œ A B) (hBC : IsExtreme π•œ B C) : IsExtreme π•œ A C := by refine ⟨Subset.trans hBC.1 hAB.1, fun x₁ hx₁A xβ‚‚ hxβ‚‚A x hxC hx ↦ ?_⟩ obtain ⟨hx₁B, hxβ‚‚B⟩ := hAB.2 hx₁A hxβ‚‚A (hBC.1 hxC) hx exact hBC.2 hx₁B hxβ‚‚B hxC hx #align is_extreme.trans IsExtreme.trans protected theorem IsExtreme.antisymm : AntiSymmetric (IsExtreme π•œ : Set E β†’ Set E β†’ Prop) := fun _ _ hAB hBA ↦ Subset.antisymm hBA.1 hAB.1 #align is_extreme.antisymm IsExtreme.antisymm instance : IsPartialOrder (Set E) (IsExtreme π•œ) where refl := IsExtreme.refl π•œ trans _ _ _ := IsExtreme.trans antisymm := IsExtreme.antisymm theorem IsExtreme.inter (hAB : IsExtreme π•œ A B) (hAC : IsExtreme π•œ A C) : IsExtreme π•œ A (B ∩ C) := by use Subset.trans inter_subset_left hAB.1 rintro x₁ hx₁A xβ‚‚ hxβ‚‚A x ⟨hxB, hxC⟩ hx obtain ⟨hx₁B, hxβ‚‚B⟩ := hAB.2 hx₁A hxβ‚‚A hxB hx obtain ⟨hx₁C, hxβ‚‚C⟩ := hAC.2 hx₁A hxβ‚‚A hxC hx exact ⟨⟨hx₁B, hx₁C⟩, hxβ‚‚B, hxβ‚‚C⟩ #align is_extreme.inter IsExtreme.inter protected theorem IsExtreme.mono (hAC : IsExtreme π•œ A C) (hBA : B βŠ† A) (hCB : C βŠ† B) : IsExtreme π•œ B C := ⟨hCB, fun _ hx₁B _ hxβ‚‚B _ hxC hx ↦ hAC.2 (hBA hx₁B) (hBA hxβ‚‚B) hxC hx⟩ #align is_extreme.mono IsExtreme.mono theorem isExtreme_iInter {ΞΉ : Sort*} [Nonempty ΞΉ] {F : ΞΉ β†’ Set E} (hAF : βˆ€ i : ΞΉ, IsExtreme π•œ A (F i)) : IsExtreme π•œ A (β‹‚ i : ΞΉ, F i) := by obtain i := Classical.arbitrary ΞΉ refine ⟨iInter_subset_of_subset i (hAF i).1, fun x₁ hx₁A xβ‚‚ hxβ‚‚A x hxF hx ↦ ?_⟩ simp_rw [mem_iInter] at hxF ⊒ have h := fun i ↦ (hAF i).2 hx₁A hxβ‚‚A (hxF i) hx exact ⟨fun i ↦ (h i).1, fun i ↦ (h i).2⟩ #align is_extreme_Inter isExtreme_iInter
Mathlib/Analysis/Convex/Extreme.lean
120
123
theorem isExtreme_biInter {F : Set (Set E)} (hF : F.Nonempty) (hA : βˆ€ B ∈ F, IsExtreme π•œ A B) : IsExtreme π•œ A (β‹‚ B ∈ F, B) := by
haveI := hF.to_subtype simpa only [iInter_subtype] using isExtreme_iInter fun i : F ↦ hA _ i.2
1,340
import Mathlib.Analysis.Convex.Hull #align_import analysis.convex.extreme from "leanprover-community/mathlib"@"c5773405394e073885e2a144c9ca14637e8eb963" open Function Set open scoped Classical open Affine variable {π•œ E F ΞΉ : Type*} {Ο€ : ΞΉ β†’ Type*} section SMul variable (π•œ) [OrderedSemiring π•œ] [AddCommMonoid E] [SMul π•œ E] def IsExtreme (A B : Set E) : Prop := B βŠ† A ∧ βˆ€ ⦃x₁⦄, x₁ ∈ A β†’ βˆ€ ⦃x₂⦄, xβ‚‚ ∈ A β†’ βˆ€ ⦃x⦄, x ∈ B β†’ x ∈ openSegment π•œ x₁ xβ‚‚ β†’ x₁ ∈ B ∧ xβ‚‚ ∈ B #align is_extreme IsExtreme def Set.extremePoints (A : Set E) : Set E := { x ∈ A | βˆ€ ⦃x₁⦄, x₁ ∈ A β†’ βˆ€ ⦃x₂⦄, xβ‚‚ ∈ A β†’ x ∈ openSegment π•œ x₁ xβ‚‚ β†’ x₁ = x ∧ xβ‚‚ = x } #align set.extreme_points Set.extremePoints @[refl] protected theorem IsExtreme.refl (A : Set E) : IsExtreme π•œ A A := ⟨Subset.rfl, fun _ hx₁A _ hxβ‚‚A _ _ _ ↦ ⟨hx₁A, hxβ‚‚A⟩⟩ #align is_extreme.refl IsExtreme.refl variable {π•œ} {A B C : Set E} {x : E} protected theorem IsExtreme.rfl : IsExtreme π•œ A A := IsExtreme.refl π•œ A #align is_extreme.rfl IsExtreme.rfl @[trans] protected theorem IsExtreme.trans (hAB : IsExtreme π•œ A B) (hBC : IsExtreme π•œ B C) : IsExtreme π•œ A C := by refine ⟨Subset.trans hBC.1 hAB.1, fun x₁ hx₁A xβ‚‚ hxβ‚‚A x hxC hx ↦ ?_⟩ obtain ⟨hx₁B, hxβ‚‚B⟩ := hAB.2 hx₁A hxβ‚‚A (hBC.1 hxC) hx exact hBC.2 hx₁B hxβ‚‚B hxC hx #align is_extreme.trans IsExtreme.trans protected theorem IsExtreme.antisymm : AntiSymmetric (IsExtreme π•œ : Set E β†’ Set E β†’ Prop) := fun _ _ hAB hBA ↦ Subset.antisymm hBA.1 hAB.1 #align is_extreme.antisymm IsExtreme.antisymm instance : IsPartialOrder (Set E) (IsExtreme π•œ) where refl := IsExtreme.refl π•œ trans _ _ _ := IsExtreme.trans antisymm := IsExtreme.antisymm theorem IsExtreme.inter (hAB : IsExtreme π•œ A B) (hAC : IsExtreme π•œ A C) : IsExtreme π•œ A (B ∩ C) := by use Subset.trans inter_subset_left hAB.1 rintro x₁ hx₁A xβ‚‚ hxβ‚‚A x ⟨hxB, hxC⟩ hx obtain ⟨hx₁B, hxβ‚‚B⟩ := hAB.2 hx₁A hxβ‚‚A hxB hx obtain ⟨hx₁C, hxβ‚‚C⟩ := hAC.2 hx₁A hxβ‚‚A hxC hx exact ⟨⟨hx₁B, hx₁C⟩, hxβ‚‚B, hxβ‚‚C⟩ #align is_extreme.inter IsExtreme.inter protected theorem IsExtreme.mono (hAC : IsExtreme π•œ A C) (hBA : B βŠ† A) (hCB : C βŠ† B) : IsExtreme π•œ B C := ⟨hCB, fun _ hx₁B _ hxβ‚‚B _ hxC hx ↦ hAC.2 (hBA hx₁B) (hBA hxβ‚‚B) hxC hx⟩ #align is_extreme.mono IsExtreme.mono theorem isExtreme_iInter {ΞΉ : Sort*} [Nonempty ΞΉ] {F : ΞΉ β†’ Set E} (hAF : βˆ€ i : ΞΉ, IsExtreme π•œ A (F i)) : IsExtreme π•œ A (β‹‚ i : ΞΉ, F i) := by obtain i := Classical.arbitrary ΞΉ refine ⟨iInter_subset_of_subset i (hAF i).1, fun x₁ hx₁A xβ‚‚ hxβ‚‚A x hxF hx ↦ ?_⟩ simp_rw [mem_iInter] at hxF ⊒ have h := fun i ↦ (hAF i).2 hx₁A hxβ‚‚A (hxF i) hx exact ⟨fun i ↦ (h i).1, fun i ↦ (h i).2⟩ #align is_extreme_Inter isExtreme_iInter theorem isExtreme_biInter {F : Set (Set E)} (hF : F.Nonempty) (hA : βˆ€ B ∈ F, IsExtreme π•œ A B) : IsExtreme π•œ A (β‹‚ B ∈ F, B) := by haveI := hF.to_subtype simpa only [iInter_subtype] using isExtreme_iInter fun i : F ↦ hA _ i.2 #align is_extreme_bInter isExtreme_biInter
Mathlib/Analysis/Convex/Extreme.lean
126
127
theorem isExtreme_sInter {F : Set (Set E)} (hF : F.Nonempty) (hAF : βˆ€ B ∈ F, IsExtreme π•œ A B) : IsExtreme π•œ A (β‹‚β‚€ F) := by
simpa [sInter_eq_biInter] using isExtreme_biInter hF hAF
1,340
import Mathlib.Analysis.Convex.Hull #align_import analysis.convex.join from "leanprover-community/mathlib"@"951bf1d9e98a2042979ced62c0620bcfb3587cf8" open Set variable {ΞΉ : Sort*} {π•œ E : Type*} section OrderedSemiring variable (π•œ) [OrderedSemiring π•œ] [AddCommMonoid E] [Module π•œ E] {s t s₁ sβ‚‚ t₁ tβ‚‚ u : Set E} {x y : E} def convexJoin (s t : Set E) : Set E := ⋃ (x ∈ s) (y ∈ t), segment π•œ x y #align convex_join convexJoin variable {π•œ}
Mathlib/Analysis/Convex/Join.lean
36
37
theorem mem_convexJoin : x ∈ convexJoin π•œ s t ↔ βˆƒ a ∈ s, βˆƒ b ∈ t, x ∈ segment π•œ a b := by
simp [convexJoin]
1,341
import Mathlib.Analysis.Convex.Hull #align_import analysis.convex.join from "leanprover-community/mathlib"@"951bf1d9e98a2042979ced62c0620bcfb3587cf8" open Set variable {ΞΉ : Sort*} {π•œ E : Type*} section OrderedSemiring variable (π•œ) [OrderedSemiring π•œ] [AddCommMonoid E] [Module π•œ E] {s t s₁ sβ‚‚ t₁ tβ‚‚ u : Set E} {x y : E} def convexJoin (s t : Set E) : Set E := ⋃ (x ∈ s) (y ∈ t), segment π•œ x y #align convex_join convexJoin variable {π•œ} theorem mem_convexJoin : x ∈ convexJoin π•œ s t ↔ βˆƒ a ∈ s, βˆƒ b ∈ t, x ∈ segment π•œ a b := by simp [convexJoin] #align mem_convex_join mem_convexJoin theorem convexJoin_comm (s t : Set E) : convexJoin π•œ s t = convexJoin π•œ t s := (iUnionβ‚‚_comm _).trans <| by simp_rw [convexJoin, segment_symm] #align convex_join_comm convexJoin_comm theorem convexJoin_mono (hs : s₁ βŠ† sβ‚‚) (ht : t₁ βŠ† tβ‚‚) : convexJoin π•œ s₁ t₁ βŠ† convexJoin π•œ sβ‚‚ tβ‚‚ := biUnion_mono hs fun _ _ => biUnion_subset_biUnion_left ht #align convex_join_mono convexJoin_mono theorem convexJoin_mono_left (hs : s₁ βŠ† sβ‚‚) : convexJoin π•œ s₁ t βŠ† convexJoin π•œ sβ‚‚ t := convexJoin_mono hs Subset.rfl #align convex_join_mono_left convexJoin_mono_left theorem convexJoin_mono_right (ht : t₁ βŠ† tβ‚‚) : convexJoin π•œ s t₁ βŠ† convexJoin π•œ s tβ‚‚ := convexJoin_mono Subset.rfl ht #align convex_join_mono_right convexJoin_mono_right @[simp]
Mathlib/Analysis/Convex/Join.lean
57
57
theorem convexJoin_empty_left (t : Set E) : convexJoin π•œ βˆ… t = βˆ… := by
simp [convexJoin]
1,341
import Mathlib.Analysis.Convex.Hull #align_import analysis.convex.join from "leanprover-community/mathlib"@"951bf1d9e98a2042979ced62c0620bcfb3587cf8" open Set variable {ΞΉ : Sort*} {π•œ E : Type*} section OrderedSemiring variable (π•œ) [OrderedSemiring π•œ] [AddCommMonoid E] [Module π•œ E] {s t s₁ sβ‚‚ t₁ tβ‚‚ u : Set E} {x y : E} def convexJoin (s t : Set E) : Set E := ⋃ (x ∈ s) (y ∈ t), segment π•œ x y #align convex_join convexJoin variable {π•œ} theorem mem_convexJoin : x ∈ convexJoin π•œ s t ↔ βˆƒ a ∈ s, βˆƒ b ∈ t, x ∈ segment π•œ a b := by simp [convexJoin] #align mem_convex_join mem_convexJoin theorem convexJoin_comm (s t : Set E) : convexJoin π•œ s t = convexJoin π•œ t s := (iUnionβ‚‚_comm _).trans <| by simp_rw [convexJoin, segment_symm] #align convex_join_comm convexJoin_comm theorem convexJoin_mono (hs : s₁ βŠ† sβ‚‚) (ht : t₁ βŠ† tβ‚‚) : convexJoin π•œ s₁ t₁ βŠ† convexJoin π•œ sβ‚‚ tβ‚‚ := biUnion_mono hs fun _ _ => biUnion_subset_biUnion_left ht #align convex_join_mono convexJoin_mono theorem convexJoin_mono_left (hs : s₁ βŠ† sβ‚‚) : convexJoin π•œ s₁ t βŠ† convexJoin π•œ sβ‚‚ t := convexJoin_mono hs Subset.rfl #align convex_join_mono_left convexJoin_mono_left theorem convexJoin_mono_right (ht : t₁ βŠ† tβ‚‚) : convexJoin π•œ s t₁ βŠ† convexJoin π•œ s tβ‚‚ := convexJoin_mono Subset.rfl ht #align convex_join_mono_right convexJoin_mono_right @[simp] theorem convexJoin_empty_left (t : Set E) : convexJoin π•œ βˆ… t = βˆ… := by simp [convexJoin] #align convex_join_empty_left convexJoin_empty_left @[simp]
Mathlib/Analysis/Convex/Join.lean
61
61
theorem convexJoin_empty_right (s : Set E) : convexJoin π•œ s βˆ… = βˆ… := by
simp [convexJoin]
1,341
import Mathlib.Analysis.Convex.Hull #align_import analysis.convex.join from "leanprover-community/mathlib"@"951bf1d9e98a2042979ced62c0620bcfb3587cf8" open Set variable {ΞΉ : Sort*} {π•œ E : Type*} section OrderedSemiring variable (π•œ) [OrderedSemiring π•œ] [AddCommMonoid E] [Module π•œ E] {s t s₁ sβ‚‚ t₁ tβ‚‚ u : Set E} {x y : E} def convexJoin (s t : Set E) : Set E := ⋃ (x ∈ s) (y ∈ t), segment π•œ x y #align convex_join convexJoin variable {π•œ} theorem mem_convexJoin : x ∈ convexJoin π•œ s t ↔ βˆƒ a ∈ s, βˆƒ b ∈ t, x ∈ segment π•œ a b := by simp [convexJoin] #align mem_convex_join mem_convexJoin theorem convexJoin_comm (s t : Set E) : convexJoin π•œ s t = convexJoin π•œ t s := (iUnionβ‚‚_comm _).trans <| by simp_rw [convexJoin, segment_symm] #align convex_join_comm convexJoin_comm theorem convexJoin_mono (hs : s₁ βŠ† sβ‚‚) (ht : t₁ βŠ† tβ‚‚) : convexJoin π•œ s₁ t₁ βŠ† convexJoin π•œ sβ‚‚ tβ‚‚ := biUnion_mono hs fun _ _ => biUnion_subset_biUnion_left ht #align convex_join_mono convexJoin_mono theorem convexJoin_mono_left (hs : s₁ βŠ† sβ‚‚) : convexJoin π•œ s₁ t βŠ† convexJoin π•œ sβ‚‚ t := convexJoin_mono hs Subset.rfl #align convex_join_mono_left convexJoin_mono_left theorem convexJoin_mono_right (ht : t₁ βŠ† tβ‚‚) : convexJoin π•œ s t₁ βŠ† convexJoin π•œ s tβ‚‚ := convexJoin_mono Subset.rfl ht #align convex_join_mono_right convexJoin_mono_right @[simp] theorem convexJoin_empty_left (t : Set E) : convexJoin π•œ βˆ… t = βˆ… := by simp [convexJoin] #align convex_join_empty_left convexJoin_empty_left @[simp] theorem convexJoin_empty_right (s : Set E) : convexJoin π•œ s βˆ… = βˆ… := by simp [convexJoin] #align convex_join_empty_right convexJoin_empty_right @[simp]
Mathlib/Analysis/Convex/Join.lean
65
66
theorem convexJoin_singleton_left (t : Set E) (x : E) : convexJoin π•œ {x} t = ⋃ y ∈ t, segment π•œ x y := by
simp [convexJoin]
1,341
import Mathlib.Analysis.Convex.Hull #align_import analysis.convex.join from "leanprover-community/mathlib"@"951bf1d9e98a2042979ced62c0620bcfb3587cf8" open Set variable {ΞΉ : Sort*} {π•œ E : Type*} section OrderedSemiring variable (π•œ) [OrderedSemiring π•œ] [AddCommMonoid E] [Module π•œ E] {s t s₁ sβ‚‚ t₁ tβ‚‚ u : Set E} {x y : E} def convexJoin (s t : Set E) : Set E := ⋃ (x ∈ s) (y ∈ t), segment π•œ x y #align convex_join convexJoin variable {π•œ} theorem mem_convexJoin : x ∈ convexJoin π•œ s t ↔ βˆƒ a ∈ s, βˆƒ b ∈ t, x ∈ segment π•œ a b := by simp [convexJoin] #align mem_convex_join mem_convexJoin theorem convexJoin_comm (s t : Set E) : convexJoin π•œ s t = convexJoin π•œ t s := (iUnionβ‚‚_comm _).trans <| by simp_rw [convexJoin, segment_symm] #align convex_join_comm convexJoin_comm theorem convexJoin_mono (hs : s₁ βŠ† sβ‚‚) (ht : t₁ βŠ† tβ‚‚) : convexJoin π•œ s₁ t₁ βŠ† convexJoin π•œ sβ‚‚ tβ‚‚ := biUnion_mono hs fun _ _ => biUnion_subset_biUnion_left ht #align convex_join_mono convexJoin_mono theorem convexJoin_mono_left (hs : s₁ βŠ† sβ‚‚) : convexJoin π•œ s₁ t βŠ† convexJoin π•œ sβ‚‚ t := convexJoin_mono hs Subset.rfl #align convex_join_mono_left convexJoin_mono_left theorem convexJoin_mono_right (ht : t₁ βŠ† tβ‚‚) : convexJoin π•œ s t₁ βŠ† convexJoin π•œ s tβ‚‚ := convexJoin_mono Subset.rfl ht #align convex_join_mono_right convexJoin_mono_right @[simp] theorem convexJoin_empty_left (t : Set E) : convexJoin π•œ βˆ… t = βˆ… := by simp [convexJoin] #align convex_join_empty_left convexJoin_empty_left @[simp] theorem convexJoin_empty_right (s : Set E) : convexJoin π•œ s βˆ… = βˆ… := by simp [convexJoin] #align convex_join_empty_right convexJoin_empty_right @[simp] theorem convexJoin_singleton_left (t : Set E) (x : E) : convexJoin π•œ {x} t = ⋃ y ∈ t, segment π•œ x y := by simp [convexJoin] #align convex_join_singleton_left convexJoin_singleton_left @[simp]
Mathlib/Analysis/Convex/Join.lean
70
71
theorem convexJoin_singleton_right (s : Set E) (y : E) : convexJoin π•œ s {y} = ⋃ x ∈ s, segment π•œ x y := by
simp [convexJoin]
1,341
import Mathlib.Analysis.Convex.Hull #align_import analysis.convex.join from "leanprover-community/mathlib"@"951bf1d9e98a2042979ced62c0620bcfb3587cf8" open Set variable {ΞΉ : Sort*} {π•œ E : Type*} section OrderedSemiring variable (π•œ) [OrderedSemiring π•œ] [AddCommMonoid E] [Module π•œ E] {s t s₁ sβ‚‚ t₁ tβ‚‚ u : Set E} {x y : E} def convexJoin (s t : Set E) : Set E := ⋃ (x ∈ s) (y ∈ t), segment π•œ x y #align convex_join convexJoin variable {π•œ} theorem mem_convexJoin : x ∈ convexJoin π•œ s t ↔ βˆƒ a ∈ s, βˆƒ b ∈ t, x ∈ segment π•œ a b := by simp [convexJoin] #align mem_convex_join mem_convexJoin theorem convexJoin_comm (s t : Set E) : convexJoin π•œ s t = convexJoin π•œ t s := (iUnionβ‚‚_comm _).trans <| by simp_rw [convexJoin, segment_symm] #align convex_join_comm convexJoin_comm theorem convexJoin_mono (hs : s₁ βŠ† sβ‚‚) (ht : t₁ βŠ† tβ‚‚) : convexJoin π•œ s₁ t₁ βŠ† convexJoin π•œ sβ‚‚ tβ‚‚ := biUnion_mono hs fun _ _ => biUnion_subset_biUnion_left ht #align convex_join_mono convexJoin_mono theorem convexJoin_mono_left (hs : s₁ βŠ† sβ‚‚) : convexJoin π•œ s₁ t βŠ† convexJoin π•œ sβ‚‚ t := convexJoin_mono hs Subset.rfl #align convex_join_mono_left convexJoin_mono_left theorem convexJoin_mono_right (ht : t₁ βŠ† tβ‚‚) : convexJoin π•œ s t₁ βŠ† convexJoin π•œ s tβ‚‚ := convexJoin_mono Subset.rfl ht #align convex_join_mono_right convexJoin_mono_right @[simp] theorem convexJoin_empty_left (t : Set E) : convexJoin π•œ βˆ… t = βˆ… := by simp [convexJoin] #align convex_join_empty_left convexJoin_empty_left @[simp] theorem convexJoin_empty_right (s : Set E) : convexJoin π•œ s βˆ… = βˆ… := by simp [convexJoin] #align convex_join_empty_right convexJoin_empty_right @[simp] theorem convexJoin_singleton_left (t : Set E) (x : E) : convexJoin π•œ {x} t = ⋃ y ∈ t, segment π•œ x y := by simp [convexJoin] #align convex_join_singleton_left convexJoin_singleton_left @[simp] theorem convexJoin_singleton_right (s : Set E) (y : E) : convexJoin π•œ s {y} = ⋃ x ∈ s, segment π•œ x y := by simp [convexJoin] #align convex_join_singleton_right convexJoin_singleton_right -- Porting note (#10618): simp can prove it
Mathlib/Analysis/Convex/Join.lean
75
75
theorem convexJoin_singletons (x : E) : convexJoin π•œ {x} {y} = segment π•œ x y := by
simp
1,341
import Mathlib.Analysis.Convex.Hull #align_import analysis.convex.join from "leanprover-community/mathlib"@"951bf1d9e98a2042979ced62c0620bcfb3587cf8" open Set variable {ΞΉ : Sort*} {π•œ E : Type*} section OrderedSemiring variable (π•œ) [OrderedSemiring π•œ] [AddCommMonoid E] [Module π•œ E] {s t s₁ sβ‚‚ t₁ tβ‚‚ u : Set E} {x y : E} def convexJoin (s t : Set E) : Set E := ⋃ (x ∈ s) (y ∈ t), segment π•œ x y #align convex_join convexJoin variable {π•œ} theorem mem_convexJoin : x ∈ convexJoin π•œ s t ↔ βˆƒ a ∈ s, βˆƒ b ∈ t, x ∈ segment π•œ a b := by simp [convexJoin] #align mem_convex_join mem_convexJoin theorem convexJoin_comm (s t : Set E) : convexJoin π•œ s t = convexJoin π•œ t s := (iUnionβ‚‚_comm _).trans <| by simp_rw [convexJoin, segment_symm] #align convex_join_comm convexJoin_comm theorem convexJoin_mono (hs : s₁ βŠ† sβ‚‚) (ht : t₁ βŠ† tβ‚‚) : convexJoin π•œ s₁ t₁ βŠ† convexJoin π•œ sβ‚‚ tβ‚‚ := biUnion_mono hs fun _ _ => biUnion_subset_biUnion_left ht #align convex_join_mono convexJoin_mono theorem convexJoin_mono_left (hs : s₁ βŠ† sβ‚‚) : convexJoin π•œ s₁ t βŠ† convexJoin π•œ sβ‚‚ t := convexJoin_mono hs Subset.rfl #align convex_join_mono_left convexJoin_mono_left theorem convexJoin_mono_right (ht : t₁ βŠ† tβ‚‚) : convexJoin π•œ s t₁ βŠ† convexJoin π•œ s tβ‚‚ := convexJoin_mono Subset.rfl ht #align convex_join_mono_right convexJoin_mono_right @[simp] theorem convexJoin_empty_left (t : Set E) : convexJoin π•œ βˆ… t = βˆ… := by simp [convexJoin] #align convex_join_empty_left convexJoin_empty_left @[simp] theorem convexJoin_empty_right (s : Set E) : convexJoin π•œ s βˆ… = βˆ… := by simp [convexJoin] #align convex_join_empty_right convexJoin_empty_right @[simp] theorem convexJoin_singleton_left (t : Set E) (x : E) : convexJoin π•œ {x} t = ⋃ y ∈ t, segment π•œ x y := by simp [convexJoin] #align convex_join_singleton_left convexJoin_singleton_left @[simp] theorem convexJoin_singleton_right (s : Set E) (y : E) : convexJoin π•œ s {y} = ⋃ x ∈ s, segment π•œ x y := by simp [convexJoin] #align convex_join_singleton_right convexJoin_singleton_right -- Porting note (#10618): simp can prove it theorem convexJoin_singletons (x : E) : convexJoin π•œ {x} {y} = segment π•œ x y := by simp #align convex_join_singletons convexJoin_singletons @[simp]
Mathlib/Analysis/Convex/Join.lean
79
81
theorem convexJoin_union_left (s₁ sβ‚‚ t : Set E) : convexJoin π•œ (s₁ βˆͺ sβ‚‚) t = convexJoin π•œ s₁ t βˆͺ convexJoin π•œ sβ‚‚ t := by
simp_rw [convexJoin, mem_union, iUnion_or, iUnion_union_distrib]
1,341
import Mathlib.Analysis.Convex.Hull #align_import analysis.convex.join from "leanprover-community/mathlib"@"951bf1d9e98a2042979ced62c0620bcfb3587cf8" open Set variable {ΞΉ : Sort*} {π•œ E : Type*} section OrderedSemiring variable (π•œ) [OrderedSemiring π•œ] [AddCommMonoid E] [Module π•œ E] {s t s₁ sβ‚‚ t₁ tβ‚‚ u : Set E} {x y : E} def convexJoin (s t : Set E) : Set E := ⋃ (x ∈ s) (y ∈ t), segment π•œ x y #align convex_join convexJoin variable {π•œ} theorem mem_convexJoin : x ∈ convexJoin π•œ s t ↔ βˆƒ a ∈ s, βˆƒ b ∈ t, x ∈ segment π•œ a b := by simp [convexJoin] #align mem_convex_join mem_convexJoin theorem convexJoin_comm (s t : Set E) : convexJoin π•œ s t = convexJoin π•œ t s := (iUnionβ‚‚_comm _).trans <| by simp_rw [convexJoin, segment_symm] #align convex_join_comm convexJoin_comm theorem convexJoin_mono (hs : s₁ βŠ† sβ‚‚) (ht : t₁ βŠ† tβ‚‚) : convexJoin π•œ s₁ t₁ βŠ† convexJoin π•œ sβ‚‚ tβ‚‚ := biUnion_mono hs fun _ _ => biUnion_subset_biUnion_left ht #align convex_join_mono convexJoin_mono theorem convexJoin_mono_left (hs : s₁ βŠ† sβ‚‚) : convexJoin π•œ s₁ t βŠ† convexJoin π•œ sβ‚‚ t := convexJoin_mono hs Subset.rfl #align convex_join_mono_left convexJoin_mono_left theorem convexJoin_mono_right (ht : t₁ βŠ† tβ‚‚) : convexJoin π•œ s t₁ βŠ† convexJoin π•œ s tβ‚‚ := convexJoin_mono Subset.rfl ht #align convex_join_mono_right convexJoin_mono_right @[simp] theorem convexJoin_empty_left (t : Set E) : convexJoin π•œ βˆ… t = βˆ… := by simp [convexJoin] #align convex_join_empty_left convexJoin_empty_left @[simp] theorem convexJoin_empty_right (s : Set E) : convexJoin π•œ s βˆ… = βˆ… := by simp [convexJoin] #align convex_join_empty_right convexJoin_empty_right @[simp] theorem convexJoin_singleton_left (t : Set E) (x : E) : convexJoin π•œ {x} t = ⋃ y ∈ t, segment π•œ x y := by simp [convexJoin] #align convex_join_singleton_left convexJoin_singleton_left @[simp] theorem convexJoin_singleton_right (s : Set E) (y : E) : convexJoin π•œ s {y} = ⋃ x ∈ s, segment π•œ x y := by simp [convexJoin] #align convex_join_singleton_right convexJoin_singleton_right -- Porting note (#10618): simp can prove it theorem convexJoin_singletons (x : E) : convexJoin π•œ {x} {y} = segment π•œ x y := by simp #align convex_join_singletons convexJoin_singletons @[simp] theorem convexJoin_union_left (s₁ sβ‚‚ t : Set E) : convexJoin π•œ (s₁ βˆͺ sβ‚‚) t = convexJoin π•œ s₁ t βˆͺ convexJoin π•œ sβ‚‚ t := by simp_rw [convexJoin, mem_union, iUnion_or, iUnion_union_distrib] #align convex_join_union_left convexJoin_union_left @[simp]
Mathlib/Analysis/Convex/Join.lean
85
87
theorem convexJoin_union_right (s t₁ tβ‚‚ : Set E) : convexJoin π•œ s (t₁ βˆͺ tβ‚‚) = convexJoin π•œ s t₁ βˆͺ convexJoin π•œ s tβ‚‚ := by
simp_rw [convexJoin_comm s, convexJoin_union_left]
1,341
import Mathlib.Analysis.Convex.Hull #align_import analysis.convex.join from "leanprover-community/mathlib"@"951bf1d9e98a2042979ced62c0620bcfb3587cf8" open Set variable {ΞΉ : Sort*} {π•œ E : Type*} section OrderedSemiring variable (π•œ) [OrderedSemiring π•œ] [AddCommMonoid E] [Module π•œ E] {s t s₁ sβ‚‚ t₁ tβ‚‚ u : Set E} {x y : E} def convexJoin (s t : Set E) : Set E := ⋃ (x ∈ s) (y ∈ t), segment π•œ x y #align convex_join convexJoin variable {π•œ} theorem mem_convexJoin : x ∈ convexJoin π•œ s t ↔ βˆƒ a ∈ s, βˆƒ b ∈ t, x ∈ segment π•œ a b := by simp [convexJoin] #align mem_convex_join mem_convexJoin theorem convexJoin_comm (s t : Set E) : convexJoin π•œ s t = convexJoin π•œ t s := (iUnionβ‚‚_comm _).trans <| by simp_rw [convexJoin, segment_symm] #align convex_join_comm convexJoin_comm theorem convexJoin_mono (hs : s₁ βŠ† sβ‚‚) (ht : t₁ βŠ† tβ‚‚) : convexJoin π•œ s₁ t₁ βŠ† convexJoin π•œ sβ‚‚ tβ‚‚ := biUnion_mono hs fun _ _ => biUnion_subset_biUnion_left ht #align convex_join_mono convexJoin_mono theorem convexJoin_mono_left (hs : s₁ βŠ† sβ‚‚) : convexJoin π•œ s₁ t βŠ† convexJoin π•œ sβ‚‚ t := convexJoin_mono hs Subset.rfl #align convex_join_mono_left convexJoin_mono_left theorem convexJoin_mono_right (ht : t₁ βŠ† tβ‚‚) : convexJoin π•œ s t₁ βŠ† convexJoin π•œ s tβ‚‚ := convexJoin_mono Subset.rfl ht #align convex_join_mono_right convexJoin_mono_right @[simp] theorem convexJoin_empty_left (t : Set E) : convexJoin π•œ βˆ… t = βˆ… := by simp [convexJoin] #align convex_join_empty_left convexJoin_empty_left @[simp] theorem convexJoin_empty_right (s : Set E) : convexJoin π•œ s βˆ… = βˆ… := by simp [convexJoin] #align convex_join_empty_right convexJoin_empty_right @[simp] theorem convexJoin_singleton_left (t : Set E) (x : E) : convexJoin π•œ {x} t = ⋃ y ∈ t, segment π•œ x y := by simp [convexJoin] #align convex_join_singleton_left convexJoin_singleton_left @[simp] theorem convexJoin_singleton_right (s : Set E) (y : E) : convexJoin π•œ s {y} = ⋃ x ∈ s, segment π•œ x y := by simp [convexJoin] #align convex_join_singleton_right convexJoin_singleton_right -- Porting note (#10618): simp can prove it theorem convexJoin_singletons (x : E) : convexJoin π•œ {x} {y} = segment π•œ x y := by simp #align convex_join_singletons convexJoin_singletons @[simp] theorem convexJoin_union_left (s₁ sβ‚‚ t : Set E) : convexJoin π•œ (s₁ βˆͺ sβ‚‚) t = convexJoin π•œ s₁ t βˆͺ convexJoin π•œ sβ‚‚ t := by simp_rw [convexJoin, mem_union, iUnion_or, iUnion_union_distrib] #align convex_join_union_left convexJoin_union_left @[simp] theorem convexJoin_union_right (s t₁ tβ‚‚ : Set E) : convexJoin π•œ s (t₁ βˆͺ tβ‚‚) = convexJoin π•œ s t₁ βˆͺ convexJoin π•œ s tβ‚‚ := by simp_rw [convexJoin_comm s, convexJoin_union_left] #align convex_join_union_right convexJoin_union_right @[simp]
Mathlib/Analysis/Convex/Join.lean
91
94
theorem convexJoin_iUnion_left (s : ΞΉ β†’ Set E) (t : Set E) : convexJoin π•œ (⋃ i, s i) t = ⋃ i, convexJoin π•œ (s i) t := by
simp_rw [convexJoin, mem_iUnion, iUnion_exists] exact iUnion_comm _
1,341
import Mathlib.Analysis.Convex.Hull #align_import analysis.convex.join from "leanprover-community/mathlib"@"951bf1d9e98a2042979ced62c0620bcfb3587cf8" open Set variable {ΞΉ : Sort*} {π•œ E : Type*} section OrderedSemiring variable (π•œ) [OrderedSemiring π•œ] [AddCommMonoid E] [Module π•œ E] {s t s₁ sβ‚‚ t₁ tβ‚‚ u : Set E} {x y : E} def convexJoin (s t : Set E) : Set E := ⋃ (x ∈ s) (y ∈ t), segment π•œ x y #align convex_join convexJoin variable {π•œ} theorem mem_convexJoin : x ∈ convexJoin π•œ s t ↔ βˆƒ a ∈ s, βˆƒ b ∈ t, x ∈ segment π•œ a b := by simp [convexJoin] #align mem_convex_join mem_convexJoin theorem convexJoin_comm (s t : Set E) : convexJoin π•œ s t = convexJoin π•œ t s := (iUnionβ‚‚_comm _).trans <| by simp_rw [convexJoin, segment_symm] #align convex_join_comm convexJoin_comm theorem convexJoin_mono (hs : s₁ βŠ† sβ‚‚) (ht : t₁ βŠ† tβ‚‚) : convexJoin π•œ s₁ t₁ βŠ† convexJoin π•œ sβ‚‚ tβ‚‚ := biUnion_mono hs fun _ _ => biUnion_subset_biUnion_left ht #align convex_join_mono convexJoin_mono theorem convexJoin_mono_left (hs : s₁ βŠ† sβ‚‚) : convexJoin π•œ s₁ t βŠ† convexJoin π•œ sβ‚‚ t := convexJoin_mono hs Subset.rfl #align convex_join_mono_left convexJoin_mono_left theorem convexJoin_mono_right (ht : t₁ βŠ† tβ‚‚) : convexJoin π•œ s t₁ βŠ† convexJoin π•œ s tβ‚‚ := convexJoin_mono Subset.rfl ht #align convex_join_mono_right convexJoin_mono_right @[simp] theorem convexJoin_empty_left (t : Set E) : convexJoin π•œ βˆ… t = βˆ… := by simp [convexJoin] #align convex_join_empty_left convexJoin_empty_left @[simp] theorem convexJoin_empty_right (s : Set E) : convexJoin π•œ s βˆ… = βˆ… := by simp [convexJoin] #align convex_join_empty_right convexJoin_empty_right @[simp] theorem convexJoin_singleton_left (t : Set E) (x : E) : convexJoin π•œ {x} t = ⋃ y ∈ t, segment π•œ x y := by simp [convexJoin] #align convex_join_singleton_left convexJoin_singleton_left @[simp] theorem convexJoin_singleton_right (s : Set E) (y : E) : convexJoin π•œ s {y} = ⋃ x ∈ s, segment π•œ x y := by simp [convexJoin] #align convex_join_singleton_right convexJoin_singleton_right -- Porting note (#10618): simp can prove it theorem convexJoin_singletons (x : E) : convexJoin π•œ {x} {y} = segment π•œ x y := by simp #align convex_join_singletons convexJoin_singletons @[simp] theorem convexJoin_union_left (s₁ sβ‚‚ t : Set E) : convexJoin π•œ (s₁ βˆͺ sβ‚‚) t = convexJoin π•œ s₁ t βˆͺ convexJoin π•œ sβ‚‚ t := by simp_rw [convexJoin, mem_union, iUnion_or, iUnion_union_distrib] #align convex_join_union_left convexJoin_union_left @[simp] theorem convexJoin_union_right (s t₁ tβ‚‚ : Set E) : convexJoin π•œ s (t₁ βˆͺ tβ‚‚) = convexJoin π•œ s t₁ βˆͺ convexJoin π•œ s tβ‚‚ := by simp_rw [convexJoin_comm s, convexJoin_union_left] #align convex_join_union_right convexJoin_union_right @[simp] theorem convexJoin_iUnion_left (s : ΞΉ β†’ Set E) (t : Set E) : convexJoin π•œ (⋃ i, s i) t = ⋃ i, convexJoin π•œ (s i) t := by simp_rw [convexJoin, mem_iUnion, iUnion_exists] exact iUnion_comm _ #align convex_join_Union_left convexJoin_iUnion_left @[simp]
Mathlib/Analysis/Convex/Join.lean
98
100
theorem convexJoin_iUnion_right (s : Set E) (t : ΞΉ β†’ Set E) : convexJoin π•œ s (⋃ i, t i) = ⋃ i, convexJoin π•œ s (t i) := by
simp_rw [convexJoin_comm s, convexJoin_iUnion_left]
1,341
import Mathlib.LinearAlgebra.Ray import Mathlib.Analysis.NormedSpace.Real #align_import analysis.normed_space.ray from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7" open Real variable {E : Type*} [SeminormedAddCommGroup E] [NormedSpace ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] namespace SameRay variable {x y : E}
Mathlib/Analysis/NormedSpace/Ray.lean
32
35
theorem norm_add (h : SameRay ℝ x y) : β€–x + yβ€– = β€–xβ€– + β€–yβ€– := by
rcases h.exists_eq_smul with ⟨u, a, b, ha, hb, -, rfl, rfl⟩ rw [← add_smul, norm_smul_of_nonneg (add_nonneg ha hb), norm_smul_of_nonneg ha, norm_smul_of_nonneg hb, add_mul]
1,342
import Mathlib.LinearAlgebra.Ray import Mathlib.Analysis.NormedSpace.Real #align_import analysis.normed_space.ray from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7" open Real variable {E : Type*} [SeminormedAddCommGroup E] [NormedSpace ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] namespace SameRay variable {x y : E} theorem norm_add (h : SameRay ℝ x y) : β€–x + yβ€– = β€–xβ€– + β€–yβ€– := by rcases h.exists_eq_smul with ⟨u, a, b, ha, hb, -, rfl, rfl⟩ rw [← add_smul, norm_smul_of_nonneg (add_nonneg ha hb), norm_smul_of_nonneg ha, norm_smul_of_nonneg hb, add_mul] #align same_ray.norm_add SameRay.norm_add
Mathlib/Analysis/NormedSpace/Ray.lean
38
46
theorem norm_sub (h : SameRay ℝ x y) : β€–x - yβ€– = |β€–xβ€– - β€–yβ€–| := by
rcases h.exists_eq_smul with ⟨u, a, b, ha, hb, -, rfl, rfl⟩ wlog hab : b ≀ a generalizing a b with H Β· rw [SameRay.sameRay_comm] at h rw [norm_sub_rev, abs_sub_comm] exact H b a hb ha h (le_of_not_le hab) rw [← sub_nonneg] at hab rw [← sub_smul, norm_smul_of_nonneg hab, norm_smul_of_nonneg ha, norm_smul_of_nonneg hb, ← sub_mul, abs_of_nonneg (mul_nonneg hab (norm_nonneg _))]
1,342
import Mathlib.LinearAlgebra.Ray import Mathlib.Analysis.NormedSpace.Real #align_import analysis.normed_space.ray from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7" open Real variable {E : Type*} [SeminormedAddCommGroup E] [NormedSpace ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] namespace SameRay variable {x y : E} theorem norm_add (h : SameRay ℝ x y) : β€–x + yβ€– = β€–xβ€– + β€–yβ€– := by rcases h.exists_eq_smul with ⟨u, a, b, ha, hb, -, rfl, rfl⟩ rw [← add_smul, norm_smul_of_nonneg (add_nonneg ha hb), norm_smul_of_nonneg ha, norm_smul_of_nonneg hb, add_mul] #align same_ray.norm_add SameRay.norm_add theorem norm_sub (h : SameRay ℝ x y) : β€–x - yβ€– = |β€–xβ€– - β€–yβ€–| := by rcases h.exists_eq_smul with ⟨u, a, b, ha, hb, -, rfl, rfl⟩ wlog hab : b ≀ a generalizing a b with H Β· rw [SameRay.sameRay_comm] at h rw [norm_sub_rev, abs_sub_comm] exact H b a hb ha h (le_of_not_le hab) rw [← sub_nonneg] at hab rw [← sub_smul, norm_smul_of_nonneg hab, norm_smul_of_nonneg ha, norm_smul_of_nonneg hb, ← sub_mul, abs_of_nonneg (mul_nonneg hab (norm_nonneg _))] #align same_ray.norm_sub SameRay.norm_sub
Mathlib/Analysis/NormedSpace/Ray.lean
49
52
theorem norm_smul_eq (h : SameRay ℝ x y) : β€–xβ€– β€’ y = β€–yβ€– β€’ x := by
rcases h.exists_eq_smul with ⟨u, a, b, ha, hb, -, rfl, rfl⟩ simp only [norm_smul_of_nonneg, *, mul_smul] rw [smul_comm, smul_comm b, smul_comm a b u]
1,342
import Mathlib.LinearAlgebra.Ray import Mathlib.Analysis.NormedSpace.Real #align_import analysis.normed_space.ray from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7" open Real variable {E : Type*} [SeminormedAddCommGroup E] [NormedSpace ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] variable {x y : F}
Mathlib/Analysis/NormedSpace/Ray.lean
59
65
theorem norm_injOn_ray_left (hx : x β‰  0) : { y | SameRay ℝ x y }.InjOn norm := by
rintro y hy z hz h rcases hy.exists_nonneg_left hx with ⟨r, hr, rfl⟩ rcases hz.exists_nonneg_left hx with ⟨s, hs, rfl⟩ rw [norm_smul, norm_smul, mul_left_inj' (norm_ne_zero_iff.2 hx), norm_of_nonneg hr, norm_of_nonneg hs] at h rw [h]
1,342
import Mathlib.LinearAlgebra.Ray import Mathlib.Analysis.NormedSpace.Real #align_import analysis.normed_space.ray from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7" open Real variable {E : Type*} [SeminormedAddCommGroup E] [NormedSpace ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] variable {x y : F} theorem norm_injOn_ray_left (hx : x β‰  0) : { y | SameRay ℝ x y }.InjOn norm := by rintro y hy z hz h rcases hy.exists_nonneg_left hx with ⟨r, hr, rfl⟩ rcases hz.exists_nonneg_left hx with ⟨s, hs, rfl⟩ rw [norm_smul, norm_smul, mul_left_inj' (norm_ne_zero_iff.2 hx), norm_of_nonneg hr, norm_of_nonneg hs] at h rw [h] #align norm_inj_on_ray_left norm_injOn_ray_left
Mathlib/Analysis/NormedSpace/Ray.lean
68
69
theorem norm_injOn_ray_right (hy : y β‰  0) : { x | SameRay ℝ x y }.InjOn norm := by
simpa only [SameRay.sameRay_comm] using norm_injOn_ray_left hy
1,342
import Mathlib.Algebra.Module.Defs import Mathlib.LinearAlgebra.Finsupp import Mathlib.LinearAlgebra.FreeModule.Basic import Mathlib.LinearAlgebra.TensorProduct.Tower #align_import algebra.module.projective from "leanprover-community/mathlib"@"405ea5cee7a7070ff8fb8dcb4cfb003532e34bce" universe u v open LinearMap hiding id open Finsupp class Module.Projective (R : Type*) [Semiring R] (P : Type*) [AddCommMonoid P] [Module R P] : Prop where out : βˆƒ s : P β†’β‚—[R] P β†’β‚€ R, Function.LeftInverse (Finsupp.total P P R id) s #align module.projective Module.Projective namespace Module section Semiring variable {R : Type*} [Semiring R] {P : Type*} [AddCommMonoid P] [Module R P] {M : Type*} [AddCommMonoid M] [Module R M] {N : Type*} [AddCommMonoid N] [Module R N] theorem projective_def : Projective R P ↔ βˆƒ s : P β†’β‚—[R] P β†’β‚€ R, Function.LeftInverse (Finsupp.total P P R id) s := ⟨fun h => h.1, fun h => ⟨h⟩⟩ #align module.projective_def Module.projective_def
Mathlib/Algebra/Module/Projective.lean
92
94
theorem projective_def' : Projective R P ↔ βˆƒ s : P β†’β‚—[R] P β†’β‚€ R, Finsupp.total P P R id βˆ˜β‚— s = .id := by
simp_rw [projective_def, DFunLike.ext_iff, Function.LeftInverse, comp_apply, id_apply]
1,343
import Mathlib.Algebra.Module.Defs import Mathlib.LinearAlgebra.Finsupp import Mathlib.LinearAlgebra.FreeModule.Basic import Mathlib.LinearAlgebra.TensorProduct.Tower #align_import algebra.module.projective from "leanprover-community/mathlib"@"405ea5cee7a7070ff8fb8dcb4cfb003532e34bce" universe u v open LinearMap hiding id open Finsupp class Module.Projective (R : Type*) [Semiring R] (P : Type*) [AddCommMonoid P] [Module R P] : Prop where out : βˆƒ s : P β†’β‚—[R] P β†’β‚€ R, Function.LeftInverse (Finsupp.total P P R id) s #align module.projective Module.Projective namespace Module section Semiring variable {R : Type*} [Semiring R] {P : Type*} [AddCommMonoid P] [Module R P] {M : Type*} [AddCommMonoid M] [Module R M] {N : Type*} [AddCommMonoid N] [Module R N] theorem projective_def : Projective R P ↔ βˆƒ s : P β†’β‚—[R] P β†’β‚€ R, Function.LeftInverse (Finsupp.total P P R id) s := ⟨fun h => h.1, fun h => ⟨h⟩⟩ #align module.projective_def Module.projective_def theorem projective_def' : Projective R P ↔ βˆƒ s : P β†’β‚—[R] P β†’β‚€ R, Finsupp.total P P R id βˆ˜β‚— s = .id := by simp_rw [projective_def, DFunLike.ext_iff, Function.LeftInverse, comp_apply, id_apply] #align module.projective_def' Module.projective_def'
Mathlib/Algebra/Module/Projective.lean
98
116
theorem projective_lifting_property [h : Projective R P] (f : M β†’β‚—[R] N) (g : P β†’β‚—[R] N) (hf : Function.Surjective f) : βˆƒ h : P β†’β‚—[R] M, f.comp h = g := by
/- Here's the first step of the proof. Recall that `X β†’β‚€ R` is Lean's way of talking about the free `R`-module on a type `X`. The universal property `Finsupp.total` says that to a map `X β†’ N` from a type to an `R`-module, we get an associated R-module map `(X β†’β‚€ R) β†’β‚— N`. Apply this to a (noncomputable) map `P β†’ M` coming from the map `P β†’β‚— N` and a random splitting of the surjection `M β†’β‚— N`, and we get a map `Ο† : (P β†’β‚€ R) β†’β‚— M`. -/ let Ο† : (P β†’β‚€ R) β†’β‚—[R] M := Finsupp.total _ _ _ fun p => Function.surjInv hf (g p) -- By projectivity we have a map `P β†’β‚— (P β†’β‚€ R)`; cases' h.out with s hs -- Compose to get `P β†’β‚— M`. This works. use Ο†.comp s ext p conv_rhs => rw [← hs p] simp [Ο†, Finsupp.total_apply, Function.surjInv_eq hf, map_finsupp_sum]
1,343
import Mathlib.Algebra.Module.Defs import Mathlib.LinearAlgebra.Finsupp import Mathlib.LinearAlgebra.FreeModule.Basic import Mathlib.LinearAlgebra.TensorProduct.Tower #align_import algebra.module.projective from "leanprover-community/mathlib"@"405ea5cee7a7070ff8fb8dcb4cfb003532e34bce" universe u v open LinearMap hiding id open Finsupp class Module.Projective (R : Type*) [Semiring R] (P : Type*) [AddCommMonoid P] [Module R P] : Prop where out : βˆƒ s : P β†’β‚—[R] P β†’β‚€ R, Function.LeftInverse (Finsupp.total P P R id) s #align module.projective Module.Projective namespace Module section Ring variable {R : Type u} [Ring R] {P : Type v} [AddCommGroup P] [Module R P]
Mathlib/Algebra/Module/Projective.lean
156
163
theorem Projective.of_basis {ΞΉ : Type*} (b : Basis ΞΉ R P) : Projective R P := by
-- need P β†’β‚— (P β†’β‚€ R) for definition of projective. -- get it from `ΞΉ β†’ (P β†’β‚€ R)` coming from `b`. use b.constr β„• fun i => Finsupp.single (b i) (1 : R) intro m simp only [b.constr_apply, mul_one, id, Finsupp.smul_single', Finsupp.total_single, map_finsupp_sum] exact b.total_repr m
1,343
import Mathlib.RingTheory.Ideal.Basic import Mathlib.RingTheory.Ideal.Maps import Mathlib.LinearAlgebra.Finsupp import Mathlib.RingTheory.GradedAlgebra.Basic #align_import ring_theory.graded_algebra.homogeneous_ideal from "leanprover-community/mathlib"@"4e861f25ba5ceef42ba0712d8ffeb32f38ad6441" open SetLike DirectSum Set open Pointwise DirectSum variable {ΞΉ Οƒ R A : Type*} section HomogeneousDef variable [Semiring A] variable [SetLike Οƒ A] [AddSubmonoidClass Οƒ A] (π’œ : ΞΉ β†’ Οƒ) variable [DecidableEq ΞΉ] [AddMonoid ΞΉ] [GradedRing π’œ] variable (I : Ideal A) def Ideal.IsHomogeneous : Prop := βˆ€ (i : ΞΉ) ⦃r : A⦄, r ∈ I β†’ (DirectSum.decompose π’œ r i : A) ∈ I #align ideal.is_homogeneous Ideal.IsHomogeneous
Mathlib/RingTheory/GradedAlgebra/HomogeneousIdeal.lean
64
69
theorem Ideal.IsHomogeneous.mem_iff {I} (hI : Ideal.IsHomogeneous π’œ I) {x} : x ∈ I ↔ βˆ€ i, (decompose π’œ x i : A) ∈ I := by
classical refine ⟨fun hx i ↦ hI i hx, fun hx ↦ ?_⟩ rw [← DirectSum.sum_support_decompose π’œ x] exact Ideal.sum_mem _ (fun i _ ↦ hx i)
1,344