fact
stringlengths
6
3.84k
type
stringclasses
11 values
library
stringclasses
32 values
imports
listlengths
1
14
filename
stringlengths
20
95
symbolic_name
stringlengths
1
90
docstring
stringlengths
7
20k
codRestrict_ker {f : M →ₗ[S] M} (h : IsProj m f) : ker h.codRestrict = ker f := f.ker_codRestrict m _
theorem
LinearAlgebra
[ "Mathlib.LinearAlgebra.Quotient.Basic", "Mathlib.LinearAlgebra.Prod", "Mathlib.Algebra.Module.Submodule.Invariant", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.Algebra.Ring.Idempotent" ]
Mathlib/LinearAlgebra/Projection.lean
codRestrict_ker
null
isCompl {f : E →ₗ[R] E} (h : IsProj p f) : IsCompl p (ker f) := by rw [← codRestrict_ker h] exact isCompl_of_proj h.codRestrict_apply_cod
theorem
LinearAlgebra
[ "Mathlib.LinearAlgebra.Quotient.Basic", "Mathlib.LinearAlgebra.Prod", "Mathlib.Algebra.Module.Submodule.Invariant", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.Algebra.Ring.Idempotent" ]
Mathlib/LinearAlgebra/Projection.lean
isCompl
null
eq_conj_prod_map' {f : E →ₗ[R] E} (h : IsProj p f) : f = (p.prodEquivOfIsCompl (ker f) h.isCompl).toLinearMap ∘ₗ prodMap id 0 ∘ₗ (p.prodEquivOfIsCompl (ker f) h.isCompl).symm.toLinearMap := by rw [← LinearMap.comp_assoc, LinearEquiv.eq_comp_toLinearMap_symm] ext x · simp only [coe_prodEquivOfIsCompl, comp_apply, coe_inl, coprod_apply, coe_subtype, map_zero, add_zero, h.map_id x x.2, prodMap_apply, id_apply] · simp only [coe_prodEquivOfIsCompl, comp_apply, coe_inr, coprod_apply, map_zero, coe_subtype, zero_add, map_coe_ker, prodMap_apply, zero_apply, add_zero]
theorem
LinearAlgebra
[ "Mathlib.LinearAlgebra.Quotient.Basic", "Mathlib.LinearAlgebra.Prod", "Mathlib.Algebra.Module.Submodule.Invariant", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.Algebra.Ring.Idempotent" ]
Mathlib/LinearAlgebra/Projection.lean
eq_conj_prod_map'
null
submodule_unique {f : M →ₗ[S] M} {m₁ m₂ : Submodule S M} (hf₁ : IsProj m₁ f) (hf₂ : IsProj m₂ f) : m₁ = m₂ := by ext; simp [hf₁.mem_iff_map_id, hf₂.mem_iff_map_id] open LinearMap in
theorem
LinearAlgebra
[ "Mathlib.LinearAlgebra.Quotient.Basic", "Mathlib.LinearAlgebra.Prod", "Mathlib.Algebra.Module.Submodule.Invariant", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.Algebra.Ring.Idempotent" ]
Mathlib/LinearAlgebra/Projection.lean
submodule_unique
null
protected range {f : M →ₗ[S] M} (h : IsProj m f) : range f = m := h.isIdempotentElem.isProj_range.submodule_unique h variable (S M) in
theorem
LinearAlgebra
[ "Mathlib.LinearAlgebra.Quotient.Basic", "Mathlib.LinearAlgebra.Prod", "Mathlib.Algebra.Module.Submodule.Invariant", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.Algebra.Ring.Idempotent" ]
Mathlib/LinearAlgebra/Projection.lean
range
null
protected bot : IsProj (⊥ : Submodule S M) (0 : M →ₗ[S] M) := ⟨congrFun rfl, by simp only [mem_bot, zero_apply, forall_eq]⟩ variable (S M) in
theorem
LinearAlgebra
[ "Mathlib.LinearAlgebra.Quotient.Basic", "Mathlib.LinearAlgebra.Prod", "Mathlib.Algebra.Module.Submodule.Invariant", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.Algebra.Ring.Idempotent" ]
Mathlib/LinearAlgebra/Projection.lean
bot
null
protected top : IsProj (⊤ : Submodule S M) (id (R := S)) := ⟨fun _ ↦ trivial, fun _ ↦ congrFun rfl⟩
theorem
LinearAlgebra
[ "Mathlib.LinearAlgebra.Quotient.Basic", "Mathlib.LinearAlgebra.Prod", "Mathlib.Algebra.Module.Submodule.Invariant", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.Algebra.Ring.Idempotent" ]
Mathlib/LinearAlgebra/Projection.lean
top
null
subtype_comp_codRestrict {U : Submodule S M} {f : M →ₗ[S] M} (hf : IsProj U f) : U.subtype ∘ₗ hf.codRestrict = f := rfl
theorem
LinearAlgebra
[ "Mathlib.LinearAlgebra.Quotient.Basic", "Mathlib.LinearAlgebra.Prod", "Mathlib.Algebra.Module.Submodule.Invariant", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.Algebra.Ring.Idempotent" ]
Mathlib/LinearAlgebra/Projection.lean
subtype_comp_codRestrict
null
submodule_eq_top_iff {f : M →ₗ[S] M} (hf : IsProj m f) : m = (⊤ : Submodule S M) ↔ f = LinearMap.id := by constructor <;> rintro rfl · ext simp [hf.map_id] · rw [← hf.range, range_id]
theorem
LinearAlgebra
[ "Mathlib.LinearAlgebra.Quotient.Basic", "Mathlib.LinearAlgebra.Prod", "Mathlib.Algebra.Module.Submodule.Invariant", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.Algebra.Ring.Idempotent" ]
Mathlib/LinearAlgebra/Projection.lean
submodule_eq_top_iff
null
submodule_eq_bot_iff {f : M →ₗ[S] M} (hf : IsProj m f) : m = (⊥ : Submodule S M) ↔ f = 0 := by constructor <;> rintro rfl · ext simpa using hf.map_mem _ · rw [← hf.range, range_zero]
theorem
LinearAlgebra
[ "Mathlib.LinearAlgebra.Quotient.Basic", "Mathlib.LinearAlgebra.Prod", "Mathlib.Algebra.Module.Submodule.Invariant", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.Algebra.Ring.Idempotent" ]
Mathlib/LinearAlgebra/Projection.lean
submodule_eq_bot_iff
null
IsIdempotentElem.isCompl {f : E →ₗ[R] E} (hf : IsIdempotentElem f) : IsCompl (range f) (ker f) := hf.isProj_range.isCompl open LinearMap in
lemma
LinearAlgebra
[ "Mathlib.LinearAlgebra.Quotient.Basic", "Mathlib.LinearAlgebra.Prod", "Mathlib.Algebra.Module.Submodule.Invariant", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.Algebra.Ring.Idempotent" ]
Mathlib/LinearAlgebra/Projection.lean
IsIdempotentElem.isCompl
null
IsIdempotentElem.mem_range_iff {p : M →ₗ[S] M} (hp : IsIdempotentElem p) {x : M} : x ∈ range p ↔ p x = x := hp.isProj_range.mem_iff_map_id open LinearMap in
theorem
LinearAlgebra
[ "Mathlib.LinearAlgebra.Quotient.Basic", "Mathlib.LinearAlgebra.Prod", "Mathlib.Algebra.Module.Submodule.Invariant", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.Algebra.Ring.Idempotent" ]
Mathlib/LinearAlgebra/Projection.lean
IsIdempotentElem.mem_range_iff
Given an idempotent linear operator `p`, we have `x ∈ range p` if and only if `p(x) = x` for all `x`.
IsIdempotentElem.eq_isCompl_projection {T : E →ₗ[R] E} (hT : IsIdempotentElem T) : T = hT.isCompl.projection := by convert ofIsCompl_subtype_zero_eq hT.isCompl exact ofIsCompl_eq _ (by simp [hT.isProj_range.map_id]) (by simp) |>.symm open LinearMap in
theorem
LinearAlgebra
[ "Mathlib.LinearAlgebra.Quotient.Basic", "Mathlib.LinearAlgebra.Prod", "Mathlib.Algebra.Module.Submodule.Invariant", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.Algebra.Ring.Idempotent" ]
Mathlib/LinearAlgebra/Projection.lean
IsIdempotentElem.eq_isCompl_projection
An idempotent linear operator is equal to the linear projection onto its range along its kernel.
isIdempotentElem_iff_eq_isCompl_projection_range_ker {T : E →ₗ[R] E} : IsIdempotentElem T ↔ ∃ (h : IsCompl (range T) (ker T)), T = h.projection := ⟨fun hT => ⟨hT.isProj_range.isCompl, hT.eq_isCompl_projection⟩, fun ⟨hT, h⟩ => h.symm ▸ hT.projection_isIdempotentElem⟩ open LinearMap in
theorem
LinearAlgebra
[ "Mathlib.LinearAlgebra.Quotient.Basic", "Mathlib.LinearAlgebra.Prod", "Mathlib.Algebra.Module.Submodule.Invariant", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.Algebra.Ring.Idempotent" ]
Mathlib/LinearAlgebra/Projection.lean
isIdempotentElem_iff_eq_isCompl_projection_range_ker
A linear map is an idempotent if and only if it equals the projection onto its range along its kernel.
IsIdempotentElem.comp_eq_right_iff {q : M →ₗ[S] M} (hq : IsIdempotentElem q) {E : Type*} [AddCommMonoid E] [Module S E] (p : E →ₗ[S] M) : q.comp p = p ↔ range p ≤ range q := by simp_rw [LinearMap.ext_iff, comp_apply, ← hq.mem_range_iff, SetLike.le_def, mem_range, forall_exists_index, forall_apply_eq_imp_iff] open LinearMap in
theorem
LinearAlgebra
[ "Mathlib.LinearAlgebra.Quotient.Basic", "Mathlib.LinearAlgebra.Prod", "Mathlib.Algebra.Module.Submodule.Invariant", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.Algebra.Ring.Idempotent" ]
Mathlib/LinearAlgebra/Projection.lean
IsIdempotentElem.comp_eq_right_iff
Given an idempotent linear operator `q`, we have `q ∘ p = p` iff `range p ⊆ range q` for all `p`.
IsIdempotentElem.ext_iff {p q : E →ₗ[R] E} (hp : IsIdempotentElem p) (hq : IsIdempotentElem q) : p = q ↔ range p = range q ∧ ker p = ker q := by refine ⟨fun h => ⟨congrArg range h, congrArg ker h⟩, fun ⟨hr, hk⟩ => ?_⟩ ext x obtain ⟨⟨v, hv⟩, ⟨w, hw⟩, rfl, _⟩ := (ker p).existsUnique_add_of_isCompl hp.isCompl.symm x simp [mem_ker.mp, hv, (hk ▸ hv), (mem_range_iff hp).mp, hw, (mem_range_iff hq).mp, (hr ▸ hw)] alias ⟨_, IsIdempotentElem.ext⟩ := IsIdempotentElem.ext_iff
lemma
LinearAlgebra
[ "Mathlib.LinearAlgebra.Quotient.Basic", "Mathlib.LinearAlgebra.Prod", "Mathlib.Algebra.Module.Submodule.Invariant", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.Algebra.Ring.Idempotent" ]
Mathlib/LinearAlgebra/Projection.lean
IsIdempotentElem.ext_iff
Idempotent operators are equal iff their range and kernels are.
IsIdempotentElem.range_eq_ker {E : Type*} [AddCommGroup E] [Module S E] {p : E →ₗ[S] E} (hp : IsIdempotentElem p) : LinearMap.range p = LinearMap.ker (1 - p) := le_antisymm (LinearMap.range_le_ker_iff.mpr hp.one_sub_mul_self) fun x hx ↦ ⟨x, by simpa [sub_eq_zero, eq_comm (a := x)] using hx⟩ open LinearMap in
theorem
LinearAlgebra
[ "Mathlib.LinearAlgebra.Quotient.Basic", "Mathlib.LinearAlgebra.Prod", "Mathlib.Algebra.Module.Submodule.Invariant", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.Algebra.Ring.Idempotent" ]
Mathlib/LinearAlgebra/Projection.lean
IsIdempotentElem.range_eq_ker
null
IsIdempotentElem.ker_eq_range {E : Type*} [AddCommGroup E] [Module S E] {p : E →ₗ[S] E} (hp : IsIdempotentElem p) : LinearMap.ker p = LinearMap.range (1 - p) := by simpa using hp.one_sub.range_eq_ker.symm open LinearMap in
theorem
LinearAlgebra
[ "Mathlib.LinearAlgebra.Quotient.Basic", "Mathlib.LinearAlgebra.Prod", "Mathlib.Algebra.Module.Submodule.Invariant", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.Algebra.Ring.Idempotent" ]
Mathlib/LinearAlgebra/Projection.lean
IsIdempotentElem.ker_eq_range
null
IsIdempotentElem.comp_eq_left_iff {M : Type*} [AddCommGroup M] [Module S M] {q : M →ₗ[S] M} (hq : IsIdempotentElem q) {E : Type*} [AddCommGroup E] [Module S E] (p : M →ₗ[S] E) : p ∘ₗ q = p ↔ ker q ≤ ker p := by simp [hq.ker_eq_range, range_le_ker_iff, comp_sub, Module.End.one_eq_id, sub_eq_zero, eq_comm (a := p)]
theorem
LinearAlgebra
[ "Mathlib.LinearAlgebra.Quotient.Basic", "Mathlib.LinearAlgebra.Prod", "Mathlib.Algebra.Module.Submodule.Invariant", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.Algebra.Ring.Idempotent" ]
Mathlib/LinearAlgebra/Projection.lean
IsIdempotentElem.comp_eq_left_iff
null
IsProj.eq_conj_prodMap {f : E →ₗ[R] E} (h : IsProj p f) : f = (p.prodEquivOfIsCompl (ker f) h.isCompl).conj (prodMap id 0) := by rw [LinearEquiv.conj_apply] exact h.eq_conj_prod_map'
theorem
LinearAlgebra
[ "Mathlib.LinearAlgebra.Quotient.Basic", "Mathlib.LinearAlgebra.Prod", "Mathlib.Algebra.Module.Submodule.Invariant", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.Algebra.Ring.Idempotent" ]
Mathlib/LinearAlgebra/Projection.lean
IsProj.eq_conj_prodMap
null
range_mem_invtSubmodule_iff (hf : IsIdempotentElem f) : range f ∈ Module.End.invtSubmodule T ↔ f ∘ₗ T ∘ₗ f = T ∘ₗ f := by rw [hf.comp_eq_right_iff, range_comp, Module.End.mem_invtSubmodule_iff_map_le] alias ⟨conj_eq_of_range_mem_invtSubmodule, range_mem_invtSubmodule⟩ := range_mem_invtSubmodule_iff
lemma
LinearAlgebra
[ "Mathlib.LinearAlgebra.Quotient.Basic", "Mathlib.LinearAlgebra.Prod", "Mathlib.Algebra.Module.Submodule.Invariant", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.Algebra.Ring.Idempotent" ]
Mathlib/LinearAlgebra/Projection.lean
range_mem_invtSubmodule_iff
`range f` is invariant under `T` if and only if `f ∘ₗ T ∘ₗ f = T ∘ₗ f`, for idempotent `f`.
_root_.LinearMap.IsProj.mem_invtSubmodule_iff {U : Submodule R E} (hf : IsProj U f) : U ∈ Module.End.invtSubmodule T ↔ f ∘ₗ T ∘ₗ f = T ∘ₗ f := hf.range ▸ hf.isIdempotentElem.range_mem_invtSubmodule_iff open LinearMap in
lemma
LinearAlgebra
[ "Mathlib.LinearAlgebra.Quotient.Basic", "Mathlib.LinearAlgebra.Prod", "Mathlib.Algebra.Module.Submodule.Invariant", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.Algebra.Ring.Idempotent" ]
Mathlib/LinearAlgebra/Projection.lean
_root_.LinearMap.IsProj.mem_invtSubmodule_iff
null
ker_mem_invtSubmodule_iff (hf : IsIdempotentElem f) : ker f ∈ Module.End.invtSubmodule T ↔ f ∘ₗ T ∘ₗ f = f ∘ₗ T := by rw [← comp_assoc, hf.comp_eq_left_iff, ker_comp, Module.End.mem_invtSubmodule] alias ⟨conj_eq_of_ker_mem_invtSubmodule, ker_mem_invtSubmodule⟩ := ker_mem_invtSubmodule_iff
lemma
LinearAlgebra
[ "Mathlib.LinearAlgebra.Quotient.Basic", "Mathlib.LinearAlgebra.Prod", "Mathlib.Algebra.Module.Submodule.Invariant", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.Algebra.Ring.Idempotent" ]
Mathlib/LinearAlgebra/Projection.lean
ker_mem_invtSubmodule_iff
`ker f` is invariant under `T` if and only if `f ∘ₗ T ∘ₗ f = f ∘ₗ T`, for idempotent `f`.
commute_iff (hf : IsIdempotentElem f) : Commute f T ↔ (range f ∈ Module.End.invtSubmodule T ∧ ker f ∈ Module.End.invtSubmodule T) := by simp_rw [hf.range_mem_invtSubmodule_iff, hf.ker_mem_invtSubmodule_iff, ← Module.End.mul_eq_comp] exact ⟨fun h => (by simp [← h.eq, ← mul_assoc, hf.eq]), fun ⟨h1, h2⟩ => h2.symm.trans h1⟩
lemma
LinearAlgebra
[ "Mathlib.LinearAlgebra.Quotient.Basic", "Mathlib.LinearAlgebra.Prod", "Mathlib.Algebra.Module.Submodule.Invariant", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.Algebra.Ring.Idempotent" ]
Mathlib/LinearAlgebra/Projection.lean
commute_iff
An idempotent operator `f` commutes with a linear operator `T` if and only if both `range f` and `ker f` are invariant under `T`.
commute_iff_of_isUnit (hT : IsUnit T) (hf : IsIdempotentElem f) : Commute f T ↔ (range f).map T = range f ∧ (ker f).map T = ker f := by lift T to GeneralLinearGroup R E using hT have {a : E ≃ₗ[R] E} {b : Submodule R E} : b ≤ b.map a.toLinearMap ↔ b ≤ b.map a := by rfl simp_rw [← GeneralLinearGroup.generalLinearEquiv_to_linearMap, le_antisymm_iff, ← Module.End.mem_invtSubmodule_iff_map_le, this, ← Module.End.mem_invtSubmodule_symm_iff_le_map, and_and_and_comm (c := (ker f ∈ _)), ← hf.commute_iff, GeneralLinearGroup.generalLinearEquiv_to_linearMap, iff_self_and] exact Commute.units_inv_right
theorem
LinearAlgebra
[ "Mathlib.LinearAlgebra.Quotient.Basic", "Mathlib.LinearAlgebra.Prod", "Mathlib.Algebra.Module.Submodule.Invariant", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.Algebra.Ring.Idempotent" ]
Mathlib/LinearAlgebra/Projection.lean
commute_iff_of_isUnit
An idempotent operator `f` commutes with an unit operator `T` if and only if `T (range f) = range f` and `T (ker f) = ker f`.
@[nolint unusedArguments] SameRay (R : Type*) [CommSemiring R] [PartialOrder R] [IsStrictOrderedRing R] {M : Type*} [AddCommMonoid M] [Module R M] (v₁ v₂ : M) : Prop := v₁ = 0 ∨ v₂ = 0 ∨ ∃ r₁ r₂ : R, 0 < r₁ ∧ 0 < r₂ ∧ r₁ • v₁ = r₂ • v₂ variable {R : Type*} [CommSemiring R] [PartialOrder R] [IsStrictOrderedRing R] variable {M : Type*} [AddCommMonoid M] [Module R M] variable {N : Type*} [AddCommMonoid N] [Module R N] variable (ι : Type*) [DecidableEq ι]
def
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
SameRay
Two vectors are in the same ray if either one of them is zero or some positive multiples of them are equal (in the typical case over a field, this means one of them is a nonnegative multiple of the other).
@[simp] zero_left (y : M) : SameRay R 0 y := Or.inl rfl @[simp]
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
zero_left
null
zero_right (x : M) : SameRay R x 0 := Or.inr <| Or.inl rfl @[nontriviality]
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
zero_right
null
of_subsingleton [Subsingleton M] (x y : M) : SameRay R x y := by rw [Subsingleton.elim x 0] exact zero_left _ @[nontriviality]
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
of_subsingleton
null
of_subsingleton' [Subsingleton R] (x y : M) : SameRay R x y := haveI := Module.subsingleton R M of_subsingleton x y
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
of_subsingleton'
null
@[refl] refl (x : M) : SameRay R x x := by nontriviality R exact Or.inr (Or.inr <| ⟨1, 1, zero_lt_one, zero_lt_one, rfl⟩)
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
refl
`SameRay` is reflexive.
protected rfl : SameRay R x x := refl _
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
rfl
null
@[symm] 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⟩
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
symm
`SameRay` is symmetric.
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
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
exists_pos
If `x` and `y` are nonzero vectors on the same ray, then there exist positive numbers `r₁ r₂` such that `r₁ • x = r₂ • y`.
sameRay_comm : SameRay R x y ↔ SameRay R y x := ⟨SameRay.symm, SameRay.symm⟩
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
sameRay_comm
null
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] variable {S : Type*} [CommSemiring S] [PartialOrder S] [Algebra S R] [Module S M] [SMulPosMono S R] [IsScalarTower S R M] {a : S}
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
trans
`SameRay` is transitive unless the vector in the middle is zero and both other vectors are nonzero.
sameRay_nonneg_smul_right (v : M) (h : 0 ≤ a) : SameRay R v (a • v) := by obtain h | h := (algebraMap_nonneg R h).eq_or_lt' · rw [← algebraMap_smul R a v, h, zero_smul] exact zero_right _ · refine Or.inr <| Or.inr ⟨algebraMap S R a, 1, h, by nontriviality R; exact zero_lt_one, ?_⟩ module
lemma
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
sameRay_nonneg_smul_right
A vector is in the same ray as a nonnegative multiple of itself.
sameRay_nonneg_smul_left (v : M) (ha : 0 ≤ a) : SameRay R (a • v) v := (sameRay_nonneg_smul_right v ha).symm
lemma
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
sameRay_nonneg_smul_left
A nonnegative multiple of a vector is in the same ray as that vector.
sameRay_pos_smul_right (v : M) (ha : 0 < a) : SameRay R v (a • v) := sameRay_nonneg_smul_right v ha.le
lemma
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
sameRay_pos_smul_right
A vector is in the same ray as a positive multiple of itself.
sameRay_pos_smul_left (v : M) (ha : 0 < a) : SameRay R (a • v) v := sameRay_nonneg_smul_left v ha.le
lemma
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
sameRay_pos_smul_left
A positive multiple of a vector is in the same ray as that vector.
nonneg_smul_right (h : SameRay R x y) (ha : 0 ≤ a) : SameRay R x (a • y) := h.trans (sameRay_nonneg_smul_right y ha) fun hy => Or.inr <| by rw [hy, smul_zero]
lemma
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
nonneg_smul_right
A vector is in the same ray as a nonnegative multiple of one it is in the same ray as.
nonneg_smul_left (h : SameRay R x y) (ha : 0 ≤ a) : SameRay R (a • x) y := (h.symm.nonneg_smul_right ha).symm
lemma
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
nonneg_smul_left
A nonnegative multiple of a vector is in the same ray as one it is in the same ray as.
pos_smul_right (h : SameRay R x y) (ha : 0 < a) : SameRay R x (a • y) := h.nonneg_smul_right ha.le
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
pos_smul_right
A vector is in the same ray as a positive multiple of one it is in the same ray as.
pos_smul_left (h : SameRay R x y) (hr : 0 < a) : SameRay R (a • x) y := h.nonneg_smul_left hr.le
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
pos_smul_left
A positive multiple of a vector is in the same ray as one it is in the same ray as.
map (f : M →ₗ[R] N) (h : SameRay R x y) : SameRay R (f x) (f y) := (h.imp fun hx => by rw [hx, map_zero]) <| Or.imp (fun hy => by rw [hy, map_zero]) fun ⟨r₁, r₂, hr₁, hr₂, h⟩ => ⟨r₁, r₂, hr₁, hr₂, by rw [← f.map_smul, ← f.map_smul, h]⟩
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
map
If two vectors are on the same ray then they remain so after applying a linear map.
_root_.Function.Injective.sameRay_map_iff {F : Type*} [FunLike F M N] [LinearMapClass F R M N] {f : F} (hf : Function.Injective f) : SameRay R (f x) (f y) ↔ SameRay R x y := by simp only [SameRay, map_zero, ← hf.eq_iff, map_smul]
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
_root_.Function.Injective.sameRay_map_iff
The images of two vectors under an injective linear map are on the same ray if and only if the original vectors are on the same ray.
@[simp] sameRay_map_iff (e : M ≃ₗ[R] N) : SameRay R (e x) (e y) ↔ SameRay R x y := Function.Injective.sameRay_map_iff (EquivLike.injective e)
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
sameRay_map_iff
The images of two vectors under a linear equivalence are on the same ray if and only if the original vectors are on the same ray.
smul {S : Type*} [Monoid S] [DistribMulAction S M] [SMulCommClass R S M] (h : SameRay R x y) (s : S) : SameRay R (s • x) (s • y) := h.map (s • (LinearMap.id : M →ₗ[R] M))
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
smul
If two vectors are on the same ray then both scaled by the same action are also on the same ray.
add_left (hx : SameRay R x z) (hy : SameRay R y z) : SameRay R (x + y) z := by rcases eq_or_ne x 0 with (rfl | hx₀); · rwa [zero_add] rcases eq_or_ne y 0 with (rfl | hy₀); · rwa [add_zero] rcases eq_or_ne z 0 with (rfl | hz₀); · apply zero_right rcases hx.exists_pos hx₀ hz₀ with ⟨rx, rz₁, hrx, hrz₁, Hx⟩ rcases hy.exists_pos hy₀ hz₀ with ⟨ry, rz₂, hry, hrz₂, Hy⟩ refine Or.inr (Or.inr ⟨rx * ry, ry * rz₁ + rx * rz₂, mul_pos hrx hry, ?_, ?_⟩) · positivity · convert congr(ry • $Hx + rx • $Hy) using 1 <;> module
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
add_left
If `x` and `y` are on the same ray as `z`, then so is `x + y`.
add_right (hy : SameRay R x y) (hz : SameRay R x z) : SameRay R x (y + z) := (hy.symm.add_left hz.symm).symm
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
add_right
If `y` and `z` are on the same ray as `x`, then so is `y + z`.
@[nolint unusedArguments] RayVector (R M : Type*) [Zero M] := { v : M // v ≠ 0 }
def
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
RayVector
Nonzero vectors, as used to define rays. This type depends on an unused argument `R` so that `RayVector.Setoid` can be an instance.
RayVector.coe [Zero M] : CoeOut (RayVector R M) M where coe := Subtype.val
instance
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
RayVector.coe
null
RayVector.Setoid : Setoid (RayVector R M) where r x y := SameRay R (x : M) y iseqv := ⟨fun _ => SameRay.refl _, fun h => h.symm, by intro x y z hxy hyz exact hxy.trans hyz fun hy => (y.2 hy).elim⟩
instance
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
RayVector.Setoid
The setoid of the `SameRay` relation for the subtype of nonzero vectors.
Module.Ray := Quotient (RayVector.Setoid R M) variable {R M}
def
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
Module.Ray
A ray (equivalence class of nonzero vectors with common positive multiples) in a module.
equiv_iff_sameRay {v₁ v₂ : RayVector R M} : v₁ ≈ v₂ ↔ SameRay R (v₁ : M) v₂ := Iff.rfl variable (R)
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
equiv_iff_sameRay
Equivalence of nonzero vectors, in terms of `SameRay`.
rayOfNeZero (v : M) (h : v ≠ 0) : Module.Ray R M := ⟦⟨v, h⟩⟧
def
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
rayOfNeZero
The ray given by a nonzero vector.
Module.Ray.ind {C : Module.Ray R M → Prop} (h : ∀ (v) (hv : v ≠ 0), C (rayOfNeZero R v hv)) (x : Module.Ray R M) : C x := Quotient.ind (Subtype.rec <| h) x variable {R}
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
Module.Ray.ind
An induction principle for `Module.Ray`, used as `induction x using Module.Ray.ind`.
ray_eq_iff {v₁ v₂ : M} (hv₁ : v₁ ≠ 0) (hv₂ : v₂ ≠ 0) : rayOfNeZero R _ hv₁ = rayOfNeZero R _ hv₂ ↔ SameRay R v₁ v₂ := Quotient.eq'
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
ray_eq_iff
The rays given by two nonzero vectors are equal if and only if those vectors satisfy `SameRay`.
@[simp] ray_pos_smul {v : M} (h : v ≠ 0) {r : R} (hr : 0 < r) (hrv : r • v ≠ 0) : rayOfNeZero R (r • v) hrv = rayOfNeZero R v h := (ray_eq_iff _ _).2 <| SameRay.sameRay_pos_smul_left v hr
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
ray_pos_smul
The ray given by a positive multiple of a nonzero vector.
RayVector.mapLinearEquiv (e : M ≃ₗ[R] N) : RayVector R M ≃ RayVector R N := Equiv.subtypeEquiv e.toEquiv fun _ => e.map_ne_zero_iff.symm
def
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
RayVector.mapLinearEquiv
An equivalence between modules implies an equivalence between ray vectors.
Module.Ray.map (e : M ≃ₗ[R] N) : Module.Ray R M ≃ Module.Ray R N := Quotient.congr (RayVector.mapLinearEquiv e) fun _ _=> (SameRay.sameRay_map_iff _).symm @[simp]
def
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
Module.Ray.map
An equivalence between modules implies an equivalence between rays.
Module.Ray.map_apply (e : M ≃ₗ[R] N) (v : M) (hv : v ≠ 0) : Module.Ray.map e (rayOfNeZero _ v hv) = rayOfNeZero _ (e v) (e.map_ne_zero_iff.2 hv) := rfl @[simp]
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
Module.Ray.map_apply
null
Module.Ray.map_refl : (Module.Ray.map <| LinearEquiv.refl R M) = Equiv.refl _ := Equiv.ext <| Module.Ray.ind R fun _ _ => rfl @[simp]
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
Module.Ray.map_refl
null
Module.Ray.map_symm (e : M ≃ₗ[R] N) : (Module.Ray.map e).symm = Module.Ray.map e.symm := rfl
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
Module.Ray.map_symm
null
@[simp] Module.Ray.linearEquiv_smul_eq_map (e : M ≃ₗ[R] M) (v : Module.Ray R M) : e • v = Module.Ray.map e v := rfl @[simp]
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
Module.Ray.linearEquiv_smul_eq_map
Any invertible action preserves the non-zeroness of ray vectors. This is primarily of interest when `G = Rˣ` -/ instance {R : Type*} : MulAction G (RayVector R M) where smul r := Subtype.map (r • ·) fun _ => (smul_ne_zero_iff_ne _).2 mul_smul a b _ := Subtype.ext <| mul_smul a b _ one_smul _ := Subtype.ext <| one_smul _ _ variable [SMulCommClass R G M] /-- Any invertible action preserves the non-zeroness of rays. This is primarily of interest when `G = Rˣ` -/ instance : MulAction G (Module.Ray R M) where smul r := Quotient.map (r • ·) fun _ _ h => h.smul _ mul_smul a b := Quotient.ind fun _ => congr_arg Quotient.mk' <| mul_smul a b _ one_smul := Quotient.ind fun _ => congr_arg Quotient.mk' <| one_smul _ _ /-- The action via `LinearEquiv.apply_distribMulAction` corresponds to `Module.Ray.map`.
smul_rayOfNeZero (g : G) (v : M) (hv) : g • rayOfNeZero R v hv = rayOfNeZero R (g • v) ((smul_ne_zero_iff_ne _).2 hv) := rfl
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
smul_rayOfNeZero
null
units_smul_of_pos (u : Rˣ) (hu : 0 < (u : R)) (v : Module.Ray R M) : u • v = v := by induction v using Module.Ray.ind rw [smul_rayOfNeZero, ray_eq_iff] exact SameRay.sameRay_pos_smul_left _ hu
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
units_smul_of_pos
Scaling by a positive unit is a no-op.
someRayVector (x : Module.Ray R M) : RayVector R M := Quotient.out x
def
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
someRayVector
An arbitrary `RayVector` giving a ray.
@[simp] someRayVector_ray (x : Module.Ray R M) : (⟦x.someRayVector⟧ : Module.Ray R M) = x := Quotient.out_eq _
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
someRayVector_ray
The ray of `someRayVector`.
someVector (x : Module.Ray R M) : M := x.someRayVector
def
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
someVector
An arbitrary nonzero vector giving a ray.
@[simp] someVector_ne_zero (x : Module.Ray R M) : x.someVector ≠ 0 := x.someRayVector.property
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
someVector_ne_zero
`someVector` is nonzero.
@[simp] someVector_ray (x : Module.Ray R M) : rayOfNeZero R _ x.someVector_ne_zero = x := (congr_arg _ (Subtype.coe_eta _ _) :).trans x.out_eq
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
someVector_ray
The ray of `someVector`.
@[simp] sameRay_neg_iff : SameRay R (-x) (-y) ↔ SameRay R x y := by simp only [SameRay, neg_eq_zero, smul_neg, neg_inj] alias ⟨SameRay.of_neg, SameRay.neg⟩ := sameRay_neg_iff
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
sameRay_neg_iff
`SameRay.neg` as an `iff`.
sameRay_neg_swap : SameRay R (-x) y ↔ SameRay R x (-y) := by rw [← sameRay_neg_iff, neg_neg]
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
sameRay_neg_swap
null
eq_zero_of_sameRay_neg_smul_right [NoZeroSMulDivisors R M] {r : R} (hr : r < 0) (h : SameRay R x (r • x)) : x = 0 := by rcases h with (rfl | h₀ | ⟨r₁, r₂, hr₁, hr₂, h⟩) · rfl · simpa [hr.ne] using h₀ · rw [← sub_eq_zero, smul_smul, ← sub_smul, smul_eq_zero] at h refine h.resolve_left (ne_of_gt <| sub_pos.2 ?_) exact (mul_neg_of_pos_of_neg hr₂ hr).trans hr₁
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
eq_zero_of_sameRay_neg_smul_right
null
eq_zero_of_sameRay_self_neg [NoZeroSMulDivisors R M] (h : SameRay R x (-x)) : x = 0 := by nontriviality M; haveI : Nontrivial R := Module.nontrivial R M refine eq_zero_of_sameRay_neg_smul_right (neg_lt_zero.2 (zero_lt_one' R)) ?_ rwa [neg_one_smul]
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
eq_zero_of_sameRay_self_neg
If a vector is in the same ray as its negation, that vector is zero.
@[simp, norm_cast] coe_neg {R : Type*} (v : RayVector R M) : ↑(-v) = -(v : M) := rfl
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
coe_neg
Negating a nonzero vector. -/ instance {R : Type*} : Neg (RayVector R M) := ⟨fun v => ⟨-v, neg_ne_zero.2 v.prop⟩⟩ /-- Negating a nonzero vector commutes with coercion to the underlying module.
@[simp] equiv_neg_iff {v₁ v₂ : RayVector R M} : -v₁ ≈ -v₂ ↔ v₁ ≈ v₂ := sameRay_neg_iff
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
equiv_neg_iff
Negating a nonzero vector twice produces the original vector. -/ instance {R : Type*} : InvolutiveNeg (RayVector R M) where neg := Neg.neg neg_neg v := by rw [Subtype.ext_iff, coe_neg, coe_neg, neg_neg] /-- If two nonzero vectors are equivalent, so are their negations.
@[simp] neg_rayOfNeZero (v : M) (h : v ≠ 0) : -rayOfNeZero R _ h = rayOfNeZero R (-v) (neg_ne_zero.2 h) := rfl
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
neg_rayOfNeZero
Negating a ray. -/ instance : Neg (Module.Ray R M) := ⟨Quotient.map (fun v => -v) fun _ _ => RayVector.equiv_neg_iff.2⟩ /-- The ray given by the negation of a nonzero vector.
ne_neg_self [NoZeroSMulDivisors R M] (x : Module.Ray R M) : x ≠ -x := by induction x using Module.Ray.ind with | h x hx => rw [neg_rayOfNeZero, Ne, ray_eq_iff] exact mt eq_zero_of_sameRay_self_neg hx
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
ne_neg_self
Negating a ray twice produces the original ray. -/ instance : InvolutiveNeg (Module.Ray R M) where neg := Neg.neg neg_neg x := by apply ind R (by simp) x -- Quotient.ind (fun a => congr_arg Quotient.mk' <| neg_neg _) x /-- A ray does not equal its own negation.
neg_units_smul (u : Rˣ) (v : Module.Ray R M) : -u • v = -(u • v) := by induction v using Module.Ray.ind simp only [smul_rayOfNeZero, Units.smul_def, Units.val_neg, neg_smul, neg_rayOfNeZero]
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
neg_units_smul
null
units_smul_of_neg (u : Rˣ) (hu : (u : R) < 0) (v : Module.Ray R M) : u • v = -v := by rw [← neg_inj, neg_neg, ← neg_units_smul, units_smul_of_pos] rwa [Units.val_neg, Right.neg_pos_iff] @[simp]
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
units_smul_of_neg
Scaling by a negative unit is negation.
protected map_neg (f : M ≃ₗ[R] N) (v : Module.Ray R M) : map f (-v) = -map f v := by induction v using Module.Ray.ind with | h g hg => simp
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
map_neg
null
sameRay_of_mem_orbit {v₁ v₂ : M} (h : v₁ ∈ MulAction.orbit (Units.posSubgroup R) v₂) : SameRay R v₁ v₂ := by rcases h with ⟨⟨r, hr : 0 < r.1⟩, rfl : r • v₂ = v₁⟩ exact SameRay.sameRay_pos_smul_left _ hr
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
sameRay_of_mem_orbit
`SameRay` follows from membership of `MulAction.orbit` for the `Units.posSubgroup`.
@[simp] units_inv_smul (u : Rˣ) (v : Module.Ray R M) : u⁻¹ • v = u • v := have := mul_self_pos.2 u.ne_zero calc u⁻¹ • v = (u * u) • u⁻¹ • v := Eq.symm <| (u⁻¹ • v).units_smul_of_pos _ (by exact this) _ = u • v := by rw [mul_smul, smul_inv_smul]
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
units_inv_smul
Scaling by an inverse unit is the same as scaling by itself.
@[simp] sameRay_smul_right_iff {v : M} {r : R} : SameRay R v (r • v) ↔ 0 ≤ r ∨ v = 0 := ⟨fun hrv => or_iff_not_imp_left.2 fun hr => eq_zero_of_sameRay_neg_smul_right (not_le.1 hr) hrv, or_imp.2 ⟨SameRay.sameRay_nonneg_smul_right v, fun h => h.symm ▸ SameRay.zero_left _⟩⟩
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
sameRay_smul_right_iff
null
sameRay_smul_right_iff_of_ne {v : M} (hv : v ≠ 0) {r : R} (hr : r ≠ 0) : SameRay R v (r • v) ↔ 0 < r := by simp only [sameRay_smul_right_iff, hv, or_false, hr.symm.le_iff_lt] @[simp]
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
sameRay_smul_right_iff_of_ne
A nonzero vector is in the same ray as a multiple of itself if and only if that multiple is positive.
sameRay_smul_left_iff {v : M} {r : R} : SameRay R (r • v) v ↔ 0 ≤ r ∨ v = 0 := SameRay.sameRay_comm.trans sameRay_smul_right_iff
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
sameRay_smul_left_iff
null
sameRay_smul_left_iff_of_ne {v : M} (hv : v ≠ 0) {r : R} (hr : r ≠ 0) : SameRay R (r • v) v ↔ 0 < r := SameRay.sameRay_comm.trans (sameRay_smul_right_iff_of_ne hv hr) @[simp]
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
sameRay_smul_left_iff_of_ne
A multiple of a nonzero vector is in the same ray as that vector if and only if that multiple is positive.
sameRay_neg_smul_right_iff {v : M} {r : R} : SameRay R (-v) (r • v) ↔ r ≤ 0 ∨ v = 0 := by rw [← sameRay_neg_iff, neg_neg, ← neg_smul, sameRay_smul_right_iff, neg_nonneg]
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
sameRay_neg_smul_right_iff
null
sameRay_neg_smul_right_iff_of_ne {v : M} {r : R} (hv : v ≠ 0) (hr : r ≠ 0) : SameRay R (-v) (r • v) ↔ r < 0 := by simp only [sameRay_neg_smul_right_iff, hv, or_false, hr.le_iff_lt] @[simp]
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
sameRay_neg_smul_right_iff_of_ne
null
sameRay_neg_smul_left_iff {v : M} {r : R} : SameRay R (r • v) (-v) ↔ r ≤ 0 ∨ v = 0 := SameRay.sameRay_comm.trans sameRay_neg_smul_right_iff
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
sameRay_neg_smul_left_iff
null
sameRay_neg_smul_left_iff_of_ne {v : M} {r : R} (hv : v ≠ 0) (hr : r ≠ 0) : SameRay R (r • v) (-v) ↔ r < 0 := SameRay.sameRay_comm.trans <| sameRay_neg_smul_right_iff_of_ne hv hr @[simp]
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
sameRay_neg_smul_left_iff_of_ne
null
units_smul_eq_self_iff {u : Rˣ} {v : Module.Ray R M} : u • v = v ↔ 0 < (u : R) := by induction v using Module.Ray.ind with | h v hv => simp only [smul_rayOfNeZero, ray_eq_iff, Units.smul_def, sameRay_smul_left_iff_of_ne hv u.ne_zero] @[simp]
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
units_smul_eq_self_iff
null
units_smul_eq_neg_iff {u : Rˣ} {v : Module.Ray R M} : u • v = -v ↔ u.1 < 0 := by rw [← neg_inj, neg_neg, ← Module.Ray.neg_units_smul, units_smul_eq_self_iff, Units.val_neg, neg_pos]
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
units_smul_eq_neg_iff
null
sameRay_or_sameRay_neg_iff_not_linearIndependent {x y : M} : SameRay R x y ∨ SameRay R x (-y) ↔ ¬LinearIndependent R ![x, y] := by by_cases hx : x = 0; · simpa [hx] using fun h : LinearIndependent R ![0, y] => h.ne_zero 0 rfl by_cases hy : y = 0; · simpa [hy] using fun h : LinearIndependent R ![x, 0] => h.ne_zero 1 rfl simp_rw [Fintype.not_linearIndependent_iff] refine ⟨fun h => ?_, fun h => ?_⟩ · rcases h with ((hx0 | hy0 | ⟨r₁, r₂, hr₁, _, h⟩) | (hx0 | hy0 | ⟨r₁, r₂, hr₁, _, h⟩)) · exact False.elim (hx hx0) · exact False.elim (hy hy0) · refine ⟨![r₁, -r₂], ?_⟩ rw [Fin.sum_univ_two, Fin.exists_fin_two] simp [h, hr₁.ne.symm] · exact False.elim (hx hx0) · exact False.elim (hy (neg_eq_zero.1 hy0)) · refine ⟨![r₁, r₂], ?_⟩ rw [Fin.sum_univ_two, Fin.exists_fin_two] simp [h, hr₁.ne.symm] · rcases h with ⟨m, hm, hmne⟩ rw [Fin.sum_univ_two, add_eq_zero_iff_eq_neg] at hm dsimp only [Matrix.cons_val] at hm rcases lt_trichotomy (m 0) 0 with (hm0 | hm0 | hm0) <;> rcases lt_trichotomy (m 1) 0 with (hm1 | hm1 | hm1) · refine Or.inr (Or.inr (Or.inr ⟨-m 0, -m 1, Left.neg_pos_iff.2 hm0, Left.neg_pos_iff.2 hm1, ?_⟩)) linear_combination (norm := module) -hm · exfalso simp [hm1, hx, hm0.ne] at hm · refine Or.inl (Or.inr (Or.inr ⟨-m 0, m 1, Left.neg_pos_iff.2 hm0, hm1, ?_⟩)) linear_combination (norm := module) -hm · exfalso simp [hm0, hy, hm1.ne] at hm · rw [Fin.exists_fin_two] at hmne exact False.elim (not_and_or.2 hmne ⟨hm0, hm1⟩) · exfalso simp [hm0, hy, hm1.ne.symm] at hm · refine Or.inl (Or.inr (Or.inr ⟨m 0, -m 1, hm0, Left.neg_pos_iff.2 hm1, ?_⟩)) rwa [neg_smul] · exfalso simp [hm1, hx, hm0.ne.symm] at hm · refine Or.inr (Or.inr (Or.inr ⟨m 0, m 1, hm0, hm1, ?_⟩)) rwa [smul_neg]
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
sameRay_or_sameRay_neg_iff_not_linearIndependent
Two vectors are in the same ray, or the first is in the same ray as the negation of the second, if and only if they are not linearly independent.
sameRay_or_ne_zero_and_sameRay_neg_iff_not_linearIndependent {x y : M} : SameRay R x y ∨ x ≠ 0 ∧ y ≠ 0 ∧ SameRay R x (-y) ↔ ¬LinearIndependent R ![x, y] := by rw [← sameRay_or_sameRay_neg_iff_not_linearIndependent] by_cases hx : x = 0; · simp [hx] by_cases hy : y = 0 <;> simp [hx, hy]
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
sameRay_or_ne_zero_and_sameRay_neg_iff_not_linearIndependent
Two vectors are in the same ray, or they are nonzero and the first is in the same ray as the negation of the second, if and only if they are not linearly independent.
exists_pos_left (h : SameRay R x y) (hx : x ≠ 0) (hy : y ≠ 0) : ∃ r : R, 0 < r ∧ r • x = y := let ⟨r₁, r₂, hr₁, hr₂, h⟩ := h.exists_pos hx hy ⟨r₂⁻¹ * r₁, mul_pos (inv_pos.2 hr₂) hr₁, by rw [mul_smul, h, inv_smul_smul₀ hr₂.ne']⟩
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
exists_pos_left
null
exists_pos_right (h : SameRay R x y) (hx : x ≠ 0) (hy : y ≠ 0) : ∃ r : R, 0 < r ∧ x = r • y := (h.symm.exists_pos_left hy hx).imp fun _ => And.imp_right Eq.symm
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
exists_pos_right
null
exists_nonneg_left (h : SameRay R x y) (hx : x ≠ 0) : ∃ r : R, 0 ≤ r ∧ r • x = y := by obtain rfl | hy := eq_or_ne y 0 · exact ⟨0, le_rfl, zero_smul _ _⟩ · exact (h.exists_pos_left hx hy).imp fun _ => And.imp_left le_of_lt
theorem
LinearAlgebra
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.Algebra.Ring.Subring.Units", "Mathlib.LinearAlgebra.LinearIndependent.Defs", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Module", "Mathlib.Tactic.Positivity.Basic" ]
Mathlib/LinearAlgebra/Ray.lean
exists_nonneg_left
If a vector `v₂` is on the same ray as a nonzero vector `v₁`, then it is equal to `c • v₁` for some nonnegative `c`.