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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.