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.LinearAlgebra.Dimension.Finite import Mathlib.LinearAlgebra.Dimension.Constructions open Cardinal Submodule Set FiniteDimensional universe u v section Module variable {K : Type u} {V : Type v} [Ring K] [StrongRankCondition K] [AddCommGroup V] [Module K V] noncomputable def Basis.ofRankEqZero [Module.Free K V] {ι : Type*} [IsEmpty ι] (hV : Module.rank K V = 0) : Basis ι K V := haveI : Subsingleton V := by obtain ⟨_, b⟩ := Module.Free.exists_basis (R := K) (M := V) haveI := mk_eq_zero_iff.1 (hV ▸ b.mk_eq_rank'') exact b.repr.toEquiv.subsingleton Basis.empty _ #align basis.of_rank_eq_zero Basis.ofRankEqZero @[simp] theorem Basis.ofRankEqZero_apply [Module.Free K V] {ι : Type*} [IsEmpty ι] (hV : Module.rank K V = 0) (i : ι) : Basis.ofRankEqZero hV i = 0 := rfl #align basis.of_rank_eq_zero_apply Basis.ofRankEqZero_apply theorem le_rank_iff_exists_linearIndependent [Module.Free K V] {c : Cardinal} : c ≤ Module.rank K V ↔ ∃ s : Set V, #s = c ∧ LinearIndependent K ((↑) : s → V) := by haveI := nontrivial_of_invariantBasisNumber K constructor · intro h obtain ⟨κ, t'⟩ := Module.Free.exists_basis (R := K) (M := V) let t := t'.reindexRange have : LinearIndependent K ((↑) : Set.range t' → V) := by convert t.linearIndependent ext; exact (Basis.reindexRange_apply _ _).symm rw [← t.mk_eq_rank'', le_mk_iff_exists_subset] at h rcases h with ⟨s, hst, hsc⟩ exact ⟨s, hsc, this.mono hst⟩ · rintro ⟨s, rfl, si⟩ exact si.cardinal_le_rank #align le_rank_iff_exists_linear_independent le_rank_iff_exists_linearIndependent theorem le_rank_iff_exists_linearIndependent_finset [Module.Free K V] {n : ℕ} : ↑n ≤ Module.rank K V ↔ ∃ s : Finset V, s.card = n ∧ LinearIndependent K ((↑) : ↥(s : Set V) → V) := by simp only [le_rank_iff_exists_linearIndependent, mk_set_eq_nat_iff_finset] constructor · rintro ⟨s, ⟨t, rfl, rfl⟩, si⟩ exact ⟨t, rfl, si⟩ · rintro ⟨s, rfl, si⟩ exact ⟨s, ⟨s, rfl, rfl⟩, si⟩ #align le_rank_iff_exists_linear_independent_finset le_rank_iff_exists_linearIndependent_finset theorem rank_le_one_iff [Module.Free K V] : Module.rank K V ≤ 1 ↔ ∃ v₀ : V, ∀ v, ∃ r : K, r • v₀ = v := by obtain ⟨κ, b⟩ := Module.Free.exists_basis (R := K) (M := V) constructor · intro hd rw [← b.mk_eq_rank'', le_one_iff_subsingleton] at hd rcases isEmpty_or_nonempty κ with hb | ⟨⟨i⟩⟩ · use 0 have h' : ∀ v : V, v = 0 := by simpa [range_eq_empty, Submodule.eq_bot_iff] using b.span_eq.symm intro v simp [h' v] · use b i have h' : (K ∙ b i) = ⊤ := (subsingleton_range b).eq_singleton_of_mem (mem_range_self i) ▸ b.span_eq intro v have hv : v ∈ (⊤ : Submodule K V) := mem_top rwa [← h', mem_span_singleton] at hv · rintro ⟨v₀, hv₀⟩ have h : (K ∙ v₀) = ⊤ := by ext simp [mem_span_singleton, hv₀] rw [← rank_top, ← h] refine (rank_span_le _).trans_eq ?_ simp #align rank_le_one_iff rank_le_one_iff theorem rank_eq_one_iff [Module.Free K V] : Module.rank K V = 1 ↔ ∃ v₀ : V, v₀ ≠ 0 ∧ ∀ v, ∃ r : K, r • v₀ = v := by haveI := nontrivial_of_invariantBasisNumber K refine ⟨fun h ↦ ?_, fun ⟨v₀, h, hv⟩ ↦ (rank_le_one_iff.2 ⟨v₀, hv⟩).antisymm ?_⟩ · obtain ⟨v₀, hv⟩ := rank_le_one_iff.1 h.le refine ⟨v₀, fun hzero ↦ ?_, hv⟩ simp_rw [hzero, smul_zero, exists_const] at hv haveI : Subsingleton V := .intro fun _ _ ↦ by simp_rw [← hv] exact one_ne_zero (h ▸ rank_subsingleton' K V) · by_contra H rw [not_le, lt_one_iff_zero] at H obtain ⟨κ, b⟩ := Module.Free.exists_basis (R := K) (M := V) haveI := mk_eq_zero_iff.1 (H ▸ b.mk_eq_rank'') haveI := b.repr.toEquiv.subsingleton exact h (Subsingleton.elim _ _)
Mathlib/LinearAlgebra/Dimension/FreeAndStrongRankCondition.lean
124
139
theorem rank_submodule_le_one_iff (s : Submodule K V) [Module.Free K s] : Module.rank K s ≤ 1 ↔ ∃ v₀ ∈ s, s ≤ K ∙ v₀ := by
simp_rw [rank_le_one_iff, le_span_singleton_iff] constructor · rintro ⟨⟨v₀, hv₀⟩, h⟩ use v₀, hv₀ intro v hv obtain ⟨r, hr⟩ := h ⟨v, hv⟩ use r rwa [Subtype.ext_iff, coe_smul] at hr · rintro ⟨v₀, hv₀, h⟩ use ⟨v₀, hv₀⟩ rintro ⟨v, hv⟩ obtain ⟨r, hr⟩ := h v hv use r rwa [Subtype.ext_iff, coe_smul]
1,686
import Mathlib.LinearAlgebra.Dimension.Finite import Mathlib.LinearAlgebra.Dimension.Constructions open Cardinal Submodule Set FiniteDimensional universe u v namespace Subalgebra variable {F E : Type*} [CommRing F] [StrongRankCondition F] [Ring E] [Algebra F E] {S : Subalgebra F E}
Mathlib/LinearAlgebra/Dimension/FreeAndStrongRankCondition.lean
262
274
theorem eq_bot_of_rank_le_one (h : Module.rank F S ≤ 1) [Module.Free F S] : S = ⊥ := by
nontriviality E obtain ⟨κ, b⟩ := Module.Free.exists_basis (R := F) (M := S) by_cases h1 : Module.rank F S = 1 · refine bot_unique fun x hx ↦ Algebra.mem_bot.2 ?_ rw [← b.mk_eq_rank'', eq_one_iff_unique, ← unique_iff_subsingleton_and_nonempty] at h1 obtain ⟨h1⟩ := h1 obtain ⟨y, hy⟩ := (bijective_algebraMap_of_linearEquiv (b.repr ≪≫ₗ Finsupp.LinearEquiv.finsuppUnique _ _ _).symm).surjective ⟨x, hx⟩ exact ⟨y, congr(Subtype.val $(hy))⟩ haveI := mk_eq_zero_iff.1 (b.mk_eq_rank''.symm ▸ lt_one_iff_zero.1 (h.lt_of_ne h1)) haveI := b.repr.toEquiv.subsingleton exact False.elim <| one_ne_zero congr(S.val $(Subsingleton.elim 1 0))
1,686
import Mathlib.LinearAlgebra.Dimension.Finite import Mathlib.LinearAlgebra.Dimension.Constructions open Cardinal Submodule Set FiniteDimensional universe u v namespace Subalgebra variable {F E : Type*} [CommRing F] [StrongRankCondition F] [Ring E] [Algebra F E] {S : Subalgebra F E} theorem eq_bot_of_rank_le_one (h : Module.rank F S ≤ 1) [Module.Free F S] : S = ⊥ := by nontriviality E obtain ⟨κ, b⟩ := Module.Free.exists_basis (R := F) (M := S) by_cases h1 : Module.rank F S = 1 · refine bot_unique fun x hx ↦ Algebra.mem_bot.2 ?_ rw [← b.mk_eq_rank'', eq_one_iff_unique, ← unique_iff_subsingleton_and_nonempty] at h1 obtain ⟨h1⟩ := h1 obtain ⟨y, hy⟩ := (bijective_algebraMap_of_linearEquiv (b.repr ≪≫ₗ Finsupp.LinearEquiv.finsuppUnique _ _ _).symm).surjective ⟨x, hx⟩ exact ⟨y, congr(Subtype.val $(hy))⟩ haveI := mk_eq_zero_iff.1 (b.mk_eq_rank''.symm ▸ lt_one_iff_zero.1 (h.lt_of_ne h1)) haveI := b.repr.toEquiv.subsingleton exact False.elim <| one_ne_zero congr(S.val $(Subsingleton.elim 1 0)) #align subalgebra.eq_bot_of_rank_le_one Subalgebra.eq_bot_of_rank_le_one
Mathlib/LinearAlgebra/Dimension/FreeAndStrongRankCondition.lean
277
280
theorem eq_bot_of_finrank_one (h : finrank F S = 1) [Module.Free F S] : S = ⊥ := by
refine Subalgebra.eq_bot_of_rank_le_one ?_ rw [finrank, toNat_eq_one] at h rw [h]
1,686
import Mathlib.LinearAlgebra.Dimension.Finite import Mathlib.LinearAlgebra.Dimension.Constructions open Cardinal Submodule Set FiniteDimensional universe u v namespace Subalgebra variable {F E : Type*} [CommRing F] [StrongRankCondition F] [Ring E] [Algebra F E] {S : Subalgebra F E} theorem eq_bot_of_rank_le_one (h : Module.rank F S ≤ 1) [Module.Free F S] : S = ⊥ := by nontriviality E obtain ⟨κ, b⟩ := Module.Free.exists_basis (R := F) (M := S) by_cases h1 : Module.rank F S = 1 · refine bot_unique fun x hx ↦ Algebra.mem_bot.2 ?_ rw [← b.mk_eq_rank'', eq_one_iff_unique, ← unique_iff_subsingleton_and_nonempty] at h1 obtain ⟨h1⟩ := h1 obtain ⟨y, hy⟩ := (bijective_algebraMap_of_linearEquiv (b.repr ≪≫ₗ Finsupp.LinearEquiv.finsuppUnique _ _ _).symm).surjective ⟨x, hx⟩ exact ⟨y, congr(Subtype.val $(hy))⟩ haveI := mk_eq_zero_iff.1 (b.mk_eq_rank''.symm ▸ lt_one_iff_zero.1 (h.lt_of_ne h1)) haveI := b.repr.toEquiv.subsingleton exact False.elim <| one_ne_zero congr(S.val $(Subsingleton.elim 1 0)) #align subalgebra.eq_bot_of_rank_le_one Subalgebra.eq_bot_of_rank_le_one theorem eq_bot_of_finrank_one (h : finrank F S = 1) [Module.Free F S] : S = ⊥ := by refine Subalgebra.eq_bot_of_rank_le_one ?_ rw [finrank, toNat_eq_one] at h rw [h] #align subalgebra.eq_bot_of_finrank_one Subalgebra.eq_bot_of_finrank_one @[simp]
Mathlib/LinearAlgebra/Dimension/FreeAndStrongRankCondition.lean
284
295
theorem rank_eq_one_iff [Nontrivial E] [Module.Free F S] : Module.rank F S = 1 ↔ S = ⊥ := by
refine ⟨fun h ↦ Subalgebra.eq_bot_of_rank_le_one h.le, ?_⟩ rintro rfl obtain ⟨κ, b⟩ := Module.Free.exists_basis (R := F) (M := (⊥ : Subalgebra F E)) refine le_antisymm ?_ ?_ · have := lift_rank_range_le (Algebra.linearMap F E) rwa [← one_eq_range, rank_self, lift_one, lift_le_one_iff] at this · by_contra H rw [not_le, lt_one_iff_zero] at H haveI := mk_eq_zero_iff.1 (H ▸ b.mk_eq_rank'') haveI := b.repr.toEquiv.subsingleton exact one_ne_zero congr((⊥ : Subalgebra F E).val $(Subsingleton.elim 1 0))
1,686
import Mathlib.LinearAlgebra.Dimension.Finite import Mathlib.LinearAlgebra.Dimension.Constructions open Cardinal Submodule Set FiniteDimensional universe u v namespace Subalgebra variable {F E : Type*} [CommRing F] [StrongRankCondition F] [Ring E] [Algebra F E] {S : Subalgebra F E} theorem eq_bot_of_rank_le_one (h : Module.rank F S ≤ 1) [Module.Free F S] : S = ⊥ := by nontriviality E obtain ⟨κ, b⟩ := Module.Free.exists_basis (R := F) (M := S) by_cases h1 : Module.rank F S = 1 · refine bot_unique fun x hx ↦ Algebra.mem_bot.2 ?_ rw [← b.mk_eq_rank'', eq_one_iff_unique, ← unique_iff_subsingleton_and_nonempty] at h1 obtain ⟨h1⟩ := h1 obtain ⟨y, hy⟩ := (bijective_algebraMap_of_linearEquiv (b.repr ≪≫ₗ Finsupp.LinearEquiv.finsuppUnique _ _ _).symm).surjective ⟨x, hx⟩ exact ⟨y, congr(Subtype.val $(hy))⟩ haveI := mk_eq_zero_iff.1 (b.mk_eq_rank''.symm ▸ lt_one_iff_zero.1 (h.lt_of_ne h1)) haveI := b.repr.toEquiv.subsingleton exact False.elim <| one_ne_zero congr(S.val $(Subsingleton.elim 1 0)) #align subalgebra.eq_bot_of_rank_le_one Subalgebra.eq_bot_of_rank_le_one theorem eq_bot_of_finrank_one (h : finrank F S = 1) [Module.Free F S] : S = ⊥ := by refine Subalgebra.eq_bot_of_rank_le_one ?_ rw [finrank, toNat_eq_one] at h rw [h] #align subalgebra.eq_bot_of_finrank_one Subalgebra.eq_bot_of_finrank_one @[simp] theorem rank_eq_one_iff [Nontrivial E] [Module.Free F S] : Module.rank F S = 1 ↔ S = ⊥ := by refine ⟨fun h ↦ Subalgebra.eq_bot_of_rank_le_one h.le, ?_⟩ rintro rfl obtain ⟨κ, b⟩ := Module.Free.exists_basis (R := F) (M := (⊥ : Subalgebra F E)) refine le_antisymm ?_ ?_ · have := lift_rank_range_le (Algebra.linearMap F E) rwa [← one_eq_range, rank_self, lift_one, lift_le_one_iff] at this · by_contra H rw [not_le, lt_one_iff_zero] at H haveI := mk_eq_zero_iff.1 (H ▸ b.mk_eq_rank'') haveI := b.repr.toEquiv.subsingleton exact one_ne_zero congr((⊥ : Subalgebra F E).val $(Subsingleton.elim 1 0)) #align subalgebra.rank_eq_one_iff Subalgebra.rank_eq_one_iff @[simp]
Mathlib/LinearAlgebra/Dimension/FreeAndStrongRankCondition.lean
299
301
theorem finrank_eq_one_iff [Nontrivial E] [Module.Free F S] : finrank F S = 1 ↔ S = ⊥ := by
rw [← Subalgebra.rank_eq_one_iff] exact toNat_eq_iff one_ne_zero
1,686
import Mathlib.LinearAlgebra.Dimension.Finite import Mathlib.LinearAlgebra.Dimension.Constructions open Cardinal Submodule Set FiniteDimensional universe u v namespace Subalgebra variable {F E : Type*} [CommRing F] [StrongRankCondition F] [Ring E] [Algebra F E] {S : Subalgebra F E} theorem eq_bot_of_rank_le_one (h : Module.rank F S ≤ 1) [Module.Free F S] : S = ⊥ := by nontriviality E obtain ⟨κ, b⟩ := Module.Free.exists_basis (R := F) (M := S) by_cases h1 : Module.rank F S = 1 · refine bot_unique fun x hx ↦ Algebra.mem_bot.2 ?_ rw [← b.mk_eq_rank'', eq_one_iff_unique, ← unique_iff_subsingleton_and_nonempty] at h1 obtain ⟨h1⟩ := h1 obtain ⟨y, hy⟩ := (bijective_algebraMap_of_linearEquiv (b.repr ≪≫ₗ Finsupp.LinearEquiv.finsuppUnique _ _ _).symm).surjective ⟨x, hx⟩ exact ⟨y, congr(Subtype.val $(hy))⟩ haveI := mk_eq_zero_iff.1 (b.mk_eq_rank''.symm ▸ lt_one_iff_zero.1 (h.lt_of_ne h1)) haveI := b.repr.toEquiv.subsingleton exact False.elim <| one_ne_zero congr(S.val $(Subsingleton.elim 1 0)) #align subalgebra.eq_bot_of_rank_le_one Subalgebra.eq_bot_of_rank_le_one theorem eq_bot_of_finrank_one (h : finrank F S = 1) [Module.Free F S] : S = ⊥ := by refine Subalgebra.eq_bot_of_rank_le_one ?_ rw [finrank, toNat_eq_one] at h rw [h] #align subalgebra.eq_bot_of_finrank_one Subalgebra.eq_bot_of_finrank_one @[simp] theorem rank_eq_one_iff [Nontrivial E] [Module.Free F S] : Module.rank F S = 1 ↔ S = ⊥ := by refine ⟨fun h ↦ Subalgebra.eq_bot_of_rank_le_one h.le, ?_⟩ rintro rfl obtain ⟨κ, b⟩ := Module.Free.exists_basis (R := F) (M := (⊥ : Subalgebra F E)) refine le_antisymm ?_ ?_ · have := lift_rank_range_le (Algebra.linearMap F E) rwa [← one_eq_range, rank_self, lift_one, lift_le_one_iff] at this · by_contra H rw [not_le, lt_one_iff_zero] at H haveI := mk_eq_zero_iff.1 (H ▸ b.mk_eq_rank'') haveI := b.repr.toEquiv.subsingleton exact one_ne_zero congr((⊥ : Subalgebra F E).val $(Subsingleton.elim 1 0)) #align subalgebra.rank_eq_one_iff Subalgebra.rank_eq_one_iff @[simp] theorem finrank_eq_one_iff [Nontrivial E] [Module.Free F S] : finrank F S = 1 ↔ S = ⊥ := by rw [← Subalgebra.rank_eq_one_iff] exact toNat_eq_iff one_ne_zero #align subalgebra.finrank_eq_one_iff Subalgebra.finrank_eq_one_iff
Mathlib/LinearAlgebra/Dimension/FreeAndStrongRankCondition.lean
304
308
theorem bot_eq_top_iff_rank_eq_one [Nontrivial E] [Module.Free F E] : (⊥ : Subalgebra F E) = ⊤ ↔ Module.rank F E = 1 := by
haveI := Module.Free.of_equiv (Subalgebra.topEquiv (R := F) (A := E)).toLinearEquiv.symm -- Porting note: removed `subalgebra_top_rank_eq_submodule_top_rank` rw [← rank_top, Subalgebra.rank_eq_one_iff, eq_comm]
1,686
import Mathlib.LinearAlgebra.Dimension.Finite import Mathlib.LinearAlgebra.Dimension.Constructions open Cardinal Submodule Set FiniteDimensional universe u v namespace Subalgebra variable {F E : Type*} [CommRing F] [StrongRankCondition F] [Ring E] [Algebra F E] {S : Subalgebra F E} theorem eq_bot_of_rank_le_one (h : Module.rank F S ≤ 1) [Module.Free F S] : S = ⊥ := by nontriviality E obtain ⟨κ, b⟩ := Module.Free.exists_basis (R := F) (M := S) by_cases h1 : Module.rank F S = 1 · refine bot_unique fun x hx ↦ Algebra.mem_bot.2 ?_ rw [← b.mk_eq_rank'', eq_one_iff_unique, ← unique_iff_subsingleton_and_nonempty] at h1 obtain ⟨h1⟩ := h1 obtain ⟨y, hy⟩ := (bijective_algebraMap_of_linearEquiv (b.repr ≪≫ₗ Finsupp.LinearEquiv.finsuppUnique _ _ _).symm).surjective ⟨x, hx⟩ exact ⟨y, congr(Subtype.val $(hy))⟩ haveI := mk_eq_zero_iff.1 (b.mk_eq_rank''.symm ▸ lt_one_iff_zero.1 (h.lt_of_ne h1)) haveI := b.repr.toEquiv.subsingleton exact False.elim <| one_ne_zero congr(S.val $(Subsingleton.elim 1 0)) #align subalgebra.eq_bot_of_rank_le_one Subalgebra.eq_bot_of_rank_le_one theorem eq_bot_of_finrank_one (h : finrank F S = 1) [Module.Free F S] : S = ⊥ := by refine Subalgebra.eq_bot_of_rank_le_one ?_ rw [finrank, toNat_eq_one] at h rw [h] #align subalgebra.eq_bot_of_finrank_one Subalgebra.eq_bot_of_finrank_one @[simp] theorem rank_eq_one_iff [Nontrivial E] [Module.Free F S] : Module.rank F S = 1 ↔ S = ⊥ := by refine ⟨fun h ↦ Subalgebra.eq_bot_of_rank_le_one h.le, ?_⟩ rintro rfl obtain ⟨κ, b⟩ := Module.Free.exists_basis (R := F) (M := (⊥ : Subalgebra F E)) refine le_antisymm ?_ ?_ · have := lift_rank_range_le (Algebra.linearMap F E) rwa [← one_eq_range, rank_self, lift_one, lift_le_one_iff] at this · by_contra H rw [not_le, lt_one_iff_zero] at H haveI := mk_eq_zero_iff.1 (H ▸ b.mk_eq_rank'') haveI := b.repr.toEquiv.subsingleton exact one_ne_zero congr((⊥ : Subalgebra F E).val $(Subsingleton.elim 1 0)) #align subalgebra.rank_eq_one_iff Subalgebra.rank_eq_one_iff @[simp] theorem finrank_eq_one_iff [Nontrivial E] [Module.Free F S] : finrank F S = 1 ↔ S = ⊥ := by rw [← Subalgebra.rank_eq_one_iff] exact toNat_eq_iff one_ne_zero #align subalgebra.finrank_eq_one_iff Subalgebra.finrank_eq_one_iff theorem bot_eq_top_iff_rank_eq_one [Nontrivial E] [Module.Free F E] : (⊥ : Subalgebra F E) = ⊤ ↔ Module.rank F E = 1 := by haveI := Module.Free.of_equiv (Subalgebra.topEquiv (R := F) (A := E)).toLinearEquiv.symm -- Porting note: removed `subalgebra_top_rank_eq_submodule_top_rank` rw [← rank_top, Subalgebra.rank_eq_one_iff, eq_comm] #align subalgebra.bot_eq_top_iff_rank_eq_one Subalgebra.bot_eq_top_iff_rank_eq_one
Mathlib/LinearAlgebra/Dimension/FreeAndStrongRankCondition.lean
311
315
theorem bot_eq_top_iff_finrank_eq_one [Nontrivial E] [Module.Free F E] : (⊥ : Subalgebra F E) = ⊤ ↔ finrank F E = 1 := by
haveI := Module.Free.of_equiv (Subalgebra.topEquiv (R := F) (A := E)).toLinearEquiv.symm rw [← finrank_top, ← subalgebra_top_finrank_eq_submodule_top_finrank, Subalgebra.finrank_eq_one_iff, eq_comm]
1,686
import Mathlib.LinearAlgebra.Dimension.Constructions import Mathlib.LinearAlgebra.Dimension.Finite universe u v open Function Set Cardinal variable {R} {M M₁ M₂ M₃ : Type u} {M' : Type v} [Ring R] variable [AddCommGroup M] [AddCommGroup M₁] [AddCommGroup M₂] [AddCommGroup M₃] [AddCommGroup M'] variable [Module R M] [Module R M₁] [Module R M₂] [Module R M₃] [Module R M'] @[pp_with_univ] class HasRankNullity (R : Type v) [inst : Ring R] : Prop where exists_set_linearIndependent : ∀ (M : Type u) [AddCommGroup M] [Module R M], ∃ s : Set M, #s = Module.rank R M ∧ LinearIndependent (ι := s) R Subtype.val rank_quotient_add_rank : ∀ {M : Type u} [AddCommGroup M] [Module R M] (N : Submodule R M), Module.rank R (M ⧸ N) + Module.rank R N = Module.rank R M variable [HasRankNullity.{u} R] lemma rank_quotient_add_rank (N : Submodule R M) : Module.rank R (M ⧸ N) + Module.rank R N = Module.rank R M := HasRankNullity.rank_quotient_add_rank N #align rank_quotient_add_rank rank_quotient_add_rank variable (R M) in lemma exists_set_linearIndependent : ∃ s : Set M, #s = Module.rank R M ∧ LinearIndependent (ι := s) R Subtype.val := HasRankNullity.exists_set_linearIndependent M variable (R) in instance (priority := 100) : Nontrivial R := by refine (subsingleton_or_nontrivial R).resolve_left fun H ↦ ?_ have := rank_quotient_add_rank (R := R) (M := PUnit) ⊥ simp [one_add_one_eq_two] at this
Mathlib/LinearAlgebra/Dimension/RankNullity.lean
68
72
theorem lift_rank_range_add_rank_ker (f : M →ₗ[R] M') : lift.{u} (Module.rank R (LinearMap.range f)) + lift.{v} (Module.rank R (LinearMap.ker f)) = lift.{v} (Module.rank R M) := by
haveI := fun p : Submodule R M => Classical.decEq (M ⧸ p) rw [← f.quotKerEquivRange.lift_rank_eq, ← lift_add, rank_quotient_add_rank]
1,687
import Mathlib.LinearAlgebra.Dimension.Constructions import Mathlib.LinearAlgebra.Dimension.Finite universe u v open Function Set Cardinal variable {R} {M M₁ M₂ M₃ : Type u} {M' : Type v} [Ring R] variable [AddCommGroup M] [AddCommGroup M₁] [AddCommGroup M₂] [AddCommGroup M₃] [AddCommGroup M'] variable [Module R M] [Module R M₁] [Module R M₂] [Module R M₃] [Module R M'] @[pp_with_univ] class HasRankNullity (R : Type v) [inst : Ring R] : Prop where exists_set_linearIndependent : ∀ (M : Type u) [AddCommGroup M] [Module R M], ∃ s : Set M, #s = Module.rank R M ∧ LinearIndependent (ι := s) R Subtype.val rank_quotient_add_rank : ∀ {M : Type u} [AddCommGroup M] [Module R M] (N : Submodule R M), Module.rank R (M ⧸ N) + Module.rank R N = Module.rank R M variable [HasRankNullity.{u} R] lemma rank_quotient_add_rank (N : Submodule R M) : Module.rank R (M ⧸ N) + Module.rank R N = Module.rank R M := HasRankNullity.rank_quotient_add_rank N #align rank_quotient_add_rank rank_quotient_add_rank variable (R M) in lemma exists_set_linearIndependent : ∃ s : Set M, #s = Module.rank R M ∧ LinearIndependent (ι := s) R Subtype.val := HasRankNullity.exists_set_linearIndependent M variable (R) in instance (priority := 100) : Nontrivial R := by refine (subsingleton_or_nontrivial R).resolve_left fun H ↦ ?_ have := rank_quotient_add_rank (R := R) (M := PUnit) ⊥ simp [one_add_one_eq_two] at this theorem lift_rank_range_add_rank_ker (f : M →ₗ[R] M') : lift.{u} (Module.rank R (LinearMap.range f)) + lift.{v} (Module.rank R (LinearMap.ker f)) = lift.{v} (Module.rank R M) := by haveI := fun p : Submodule R M => Classical.decEq (M ⧸ p) rw [← f.quotKerEquivRange.lift_rank_eq, ← lift_add, rank_quotient_add_rank]
Mathlib/LinearAlgebra/Dimension/RankNullity.lean
75
78
theorem rank_range_add_rank_ker (f : M →ₗ[R] M₁) : Module.rank R (LinearMap.range f) + Module.rank R (LinearMap.ker f) = Module.rank R M := by
haveI := fun p : Submodule R M => Classical.decEq (M ⧸ p) rw [← f.quotKerEquivRange.rank_eq, rank_quotient_add_rank]
1,687
import Mathlib.LinearAlgebra.Dimension.Constructions import Mathlib.LinearAlgebra.Dimension.Finite universe u v open Function Set Cardinal variable {R} {M M₁ M₂ M₃ : Type u} {M' : Type v} [Ring R] variable [AddCommGroup M] [AddCommGroup M₁] [AddCommGroup M₂] [AddCommGroup M₃] [AddCommGroup M'] variable [Module R M] [Module R M₁] [Module R M₂] [Module R M₃] [Module R M'] @[pp_with_univ] class HasRankNullity (R : Type v) [inst : Ring R] : Prop where exists_set_linearIndependent : ∀ (M : Type u) [AddCommGroup M] [Module R M], ∃ s : Set M, #s = Module.rank R M ∧ LinearIndependent (ι := s) R Subtype.val rank_quotient_add_rank : ∀ {M : Type u} [AddCommGroup M] [Module R M] (N : Submodule R M), Module.rank R (M ⧸ N) + Module.rank R N = Module.rank R M variable [HasRankNullity.{u} R] lemma rank_quotient_add_rank (N : Submodule R M) : Module.rank R (M ⧸ N) + Module.rank R N = Module.rank R M := HasRankNullity.rank_quotient_add_rank N #align rank_quotient_add_rank rank_quotient_add_rank variable (R M) in lemma exists_set_linearIndependent : ∃ s : Set M, #s = Module.rank R M ∧ LinearIndependent (ι := s) R Subtype.val := HasRankNullity.exists_set_linearIndependent M variable (R) in instance (priority := 100) : Nontrivial R := by refine (subsingleton_or_nontrivial R).resolve_left fun H ↦ ?_ have := rank_quotient_add_rank (R := R) (M := PUnit) ⊥ simp [one_add_one_eq_two] at this theorem lift_rank_range_add_rank_ker (f : M →ₗ[R] M') : lift.{u} (Module.rank R (LinearMap.range f)) + lift.{v} (Module.rank R (LinearMap.ker f)) = lift.{v} (Module.rank R M) := by haveI := fun p : Submodule R M => Classical.decEq (M ⧸ p) rw [← f.quotKerEquivRange.lift_rank_eq, ← lift_add, rank_quotient_add_rank] theorem rank_range_add_rank_ker (f : M →ₗ[R] M₁) : Module.rank R (LinearMap.range f) + Module.rank R (LinearMap.ker f) = Module.rank R M := by haveI := fun p : Submodule R M => Classical.decEq (M ⧸ p) rw [← f.quotKerEquivRange.rank_eq, rank_quotient_add_rank] #align rank_range_add_rank_ker rank_range_add_rank_ker
Mathlib/LinearAlgebra/Dimension/RankNullity.lean
81
84
theorem lift_rank_eq_of_surjective {f : M →ₗ[R] M'} (h : Surjective f) : lift.{v} (Module.rank R M) = lift.{u} (Module.rank R M') + lift.{v} (Module.rank R (LinearMap.ker f)) := by
rw [← lift_rank_range_add_rank_ker f, ← rank_range_of_surjective f h]
1,687
import Mathlib.LinearAlgebra.Dimension.Constructions import Mathlib.LinearAlgebra.Dimension.Finite universe u v open Function Set Cardinal variable {R} {M M₁ M₂ M₃ : Type u} {M' : Type v} [Ring R] variable [AddCommGroup M] [AddCommGroup M₁] [AddCommGroup M₂] [AddCommGroup M₃] [AddCommGroup M'] variable [Module R M] [Module R M₁] [Module R M₂] [Module R M₃] [Module R M'] @[pp_with_univ] class HasRankNullity (R : Type v) [inst : Ring R] : Prop where exists_set_linearIndependent : ∀ (M : Type u) [AddCommGroup M] [Module R M], ∃ s : Set M, #s = Module.rank R M ∧ LinearIndependent (ι := s) R Subtype.val rank_quotient_add_rank : ∀ {M : Type u} [AddCommGroup M] [Module R M] (N : Submodule R M), Module.rank R (M ⧸ N) + Module.rank R N = Module.rank R M variable [HasRankNullity.{u} R] lemma rank_quotient_add_rank (N : Submodule R M) : Module.rank R (M ⧸ N) + Module.rank R N = Module.rank R M := HasRankNullity.rank_quotient_add_rank N #align rank_quotient_add_rank rank_quotient_add_rank variable (R M) in lemma exists_set_linearIndependent : ∃ s : Set M, #s = Module.rank R M ∧ LinearIndependent (ι := s) R Subtype.val := HasRankNullity.exists_set_linearIndependent M variable (R) in instance (priority := 100) : Nontrivial R := by refine (subsingleton_or_nontrivial R).resolve_left fun H ↦ ?_ have := rank_quotient_add_rank (R := R) (M := PUnit) ⊥ simp [one_add_one_eq_two] at this theorem lift_rank_range_add_rank_ker (f : M →ₗ[R] M') : lift.{u} (Module.rank R (LinearMap.range f)) + lift.{v} (Module.rank R (LinearMap.ker f)) = lift.{v} (Module.rank R M) := by haveI := fun p : Submodule R M => Classical.decEq (M ⧸ p) rw [← f.quotKerEquivRange.lift_rank_eq, ← lift_add, rank_quotient_add_rank] theorem rank_range_add_rank_ker (f : M →ₗ[R] M₁) : Module.rank R (LinearMap.range f) + Module.rank R (LinearMap.ker f) = Module.rank R M := by haveI := fun p : Submodule R M => Classical.decEq (M ⧸ p) rw [← f.quotKerEquivRange.rank_eq, rank_quotient_add_rank] #align rank_range_add_rank_ker rank_range_add_rank_ker theorem lift_rank_eq_of_surjective {f : M →ₗ[R] M'} (h : Surjective f) : lift.{v} (Module.rank R M) = lift.{u} (Module.rank R M') + lift.{v} (Module.rank R (LinearMap.ker f)) := by rw [← lift_rank_range_add_rank_ker f, ← rank_range_of_surjective f h]
Mathlib/LinearAlgebra/Dimension/RankNullity.lean
86
88
theorem rank_eq_of_surjective {f : M →ₗ[R] M₁} (h : Surjective f) : Module.rank R M = Module.rank R M₁ + Module.rank R (LinearMap.ker f) := by
rw [← rank_range_add_rank_ker f, ← rank_range_of_surjective f h]
1,687
import Mathlib.LinearAlgebra.Dimension.Constructions import Mathlib.LinearAlgebra.Dimension.Finite universe u v open Function Set Cardinal variable {R} {M M₁ M₂ M₃ : Type u} {M' : Type v} [Ring R] variable [AddCommGroup M] [AddCommGroup M₁] [AddCommGroup M₂] [AddCommGroup M₃] [AddCommGroup M'] variable [Module R M] [Module R M₁] [Module R M₂] [Module R M₃] [Module R M'] @[pp_with_univ] class HasRankNullity (R : Type v) [inst : Ring R] : Prop where exists_set_linearIndependent : ∀ (M : Type u) [AddCommGroup M] [Module R M], ∃ s : Set M, #s = Module.rank R M ∧ LinearIndependent (ι := s) R Subtype.val rank_quotient_add_rank : ∀ {M : Type u} [AddCommGroup M] [Module R M] (N : Submodule R M), Module.rank R (M ⧸ N) + Module.rank R N = Module.rank R M variable [HasRankNullity.{u} R] lemma rank_quotient_add_rank (N : Submodule R M) : Module.rank R (M ⧸ N) + Module.rank R N = Module.rank R M := HasRankNullity.rank_quotient_add_rank N #align rank_quotient_add_rank rank_quotient_add_rank variable (R M) in lemma exists_set_linearIndependent : ∃ s : Set M, #s = Module.rank R M ∧ LinearIndependent (ι := s) R Subtype.val := HasRankNullity.exists_set_linearIndependent M variable (R) in instance (priority := 100) : Nontrivial R := by refine (subsingleton_or_nontrivial R).resolve_left fun H ↦ ?_ have := rank_quotient_add_rank (R := R) (M := PUnit) ⊥ simp [one_add_one_eq_two] at this theorem lift_rank_range_add_rank_ker (f : M →ₗ[R] M') : lift.{u} (Module.rank R (LinearMap.range f)) + lift.{v} (Module.rank R (LinearMap.ker f)) = lift.{v} (Module.rank R M) := by haveI := fun p : Submodule R M => Classical.decEq (M ⧸ p) rw [← f.quotKerEquivRange.lift_rank_eq, ← lift_add, rank_quotient_add_rank] theorem rank_range_add_rank_ker (f : M →ₗ[R] M₁) : Module.rank R (LinearMap.range f) + Module.rank R (LinearMap.ker f) = Module.rank R M := by haveI := fun p : Submodule R M => Classical.decEq (M ⧸ p) rw [← f.quotKerEquivRange.rank_eq, rank_quotient_add_rank] #align rank_range_add_rank_ker rank_range_add_rank_ker theorem lift_rank_eq_of_surjective {f : M →ₗ[R] M'} (h : Surjective f) : lift.{v} (Module.rank R M) = lift.{u} (Module.rank R M') + lift.{v} (Module.rank R (LinearMap.ker f)) := by rw [← lift_rank_range_add_rank_ker f, ← rank_range_of_surjective f h] theorem rank_eq_of_surjective {f : M →ₗ[R] M₁} (h : Surjective f) : Module.rank R M = Module.rank R M₁ + Module.rank R (LinearMap.ker f) := by rw [← rank_range_add_rank_ker f, ← rank_range_of_surjective f h] #align rank_eq_of_surjective rank_eq_of_surjective
Mathlib/LinearAlgebra/Dimension/RankNullity.lean
91
109
theorem exists_linearIndependent_of_lt_rank [StrongRankCondition R] {s : Set M} (hs : LinearIndependent (ι := s) R Subtype.val) : ∃ t, s ⊆ t ∧ #t = Module.rank R M ∧ LinearIndependent (ι := t) R Subtype.val := by
obtain ⟨t, ht, ht'⟩ := exists_set_linearIndependent R (M ⧸ Submodule.span R s) choose sec hsec using Submodule.Quotient.mk_surjective (Submodule.span R s) have hsec' : Submodule.Quotient.mk ∘ sec = id := funext hsec have hst : Disjoint s (sec '' t) := by rw [Set.disjoint_iff] rintro _ ⟨hxs, ⟨x, hxt, rfl⟩⟩ apply ht'.ne_zero ⟨x, hxt⟩ rw [Subtype.coe_mk, ← hsec x, Submodule.Quotient.mk_eq_zero] exact Submodule.subset_span hxs refine ⟨s ∪ sec '' t, subset_union_left, ?_, ?_⟩ · rw [Cardinal.mk_union_of_disjoint hst, Cardinal.mk_image_eq, ht, ← rank_quotient_add_rank (Submodule.span R s), add_comm, rank_span_set hs] exact HasLeftInverse.injective ⟨Submodule.Quotient.mk, hsec⟩ · apply LinearIndependent.union_of_quotient Submodule.subset_span hs rwa [Function.comp, linearIndependent_image (hsec'.symm ▸ injective_id).injOn.image_of_comp, ← image_comp, hsec', image_id]
1,687
import Mathlib.LinearAlgebra.Dimension.Constructions import Mathlib.LinearAlgebra.Dimension.Finite universe u v open Function Set Cardinal variable {R} {M M₁ M₂ M₃ : Type u} {M' : Type v} [Ring R] variable [AddCommGroup M] [AddCommGroup M₁] [AddCommGroup M₂] [AddCommGroup M₃] [AddCommGroup M'] variable [Module R M] [Module R M₁] [Module R M₂] [Module R M₃] [Module R M'] @[pp_with_univ] class HasRankNullity (R : Type v) [inst : Ring R] : Prop where exists_set_linearIndependent : ∀ (M : Type u) [AddCommGroup M] [Module R M], ∃ s : Set M, #s = Module.rank R M ∧ LinearIndependent (ι := s) R Subtype.val rank_quotient_add_rank : ∀ {M : Type u} [AddCommGroup M] [Module R M] (N : Submodule R M), Module.rank R (M ⧸ N) + Module.rank R N = Module.rank R M variable [HasRankNullity.{u} R] lemma rank_quotient_add_rank (N : Submodule R M) : Module.rank R (M ⧸ N) + Module.rank R N = Module.rank R M := HasRankNullity.rank_quotient_add_rank N #align rank_quotient_add_rank rank_quotient_add_rank variable (R M) in lemma exists_set_linearIndependent : ∃ s : Set M, #s = Module.rank R M ∧ LinearIndependent (ι := s) R Subtype.val := HasRankNullity.exists_set_linearIndependent M variable (R) in instance (priority := 100) : Nontrivial R := by refine (subsingleton_or_nontrivial R).resolve_left fun H ↦ ?_ have := rank_quotient_add_rank (R := R) (M := PUnit) ⊥ simp [one_add_one_eq_two] at this theorem lift_rank_range_add_rank_ker (f : M →ₗ[R] M') : lift.{u} (Module.rank R (LinearMap.range f)) + lift.{v} (Module.rank R (LinearMap.ker f)) = lift.{v} (Module.rank R M) := by haveI := fun p : Submodule R M => Classical.decEq (M ⧸ p) rw [← f.quotKerEquivRange.lift_rank_eq, ← lift_add, rank_quotient_add_rank] theorem rank_range_add_rank_ker (f : M →ₗ[R] M₁) : Module.rank R (LinearMap.range f) + Module.rank R (LinearMap.ker f) = Module.rank R M := by haveI := fun p : Submodule R M => Classical.decEq (M ⧸ p) rw [← f.quotKerEquivRange.rank_eq, rank_quotient_add_rank] #align rank_range_add_rank_ker rank_range_add_rank_ker theorem lift_rank_eq_of_surjective {f : M →ₗ[R] M'} (h : Surjective f) : lift.{v} (Module.rank R M) = lift.{u} (Module.rank R M') + lift.{v} (Module.rank R (LinearMap.ker f)) := by rw [← lift_rank_range_add_rank_ker f, ← rank_range_of_surjective f h] theorem rank_eq_of_surjective {f : M →ₗ[R] M₁} (h : Surjective f) : Module.rank R M = Module.rank R M₁ + Module.rank R (LinearMap.ker f) := by rw [← rank_range_add_rank_ker f, ← rank_range_of_surjective f h] #align rank_eq_of_surjective rank_eq_of_surjective theorem exists_linearIndependent_of_lt_rank [StrongRankCondition R] {s : Set M} (hs : LinearIndependent (ι := s) R Subtype.val) : ∃ t, s ⊆ t ∧ #t = Module.rank R M ∧ LinearIndependent (ι := t) R Subtype.val := by obtain ⟨t, ht, ht'⟩ := exists_set_linearIndependent R (M ⧸ Submodule.span R s) choose sec hsec using Submodule.Quotient.mk_surjective (Submodule.span R s) have hsec' : Submodule.Quotient.mk ∘ sec = id := funext hsec have hst : Disjoint s (sec '' t) := by rw [Set.disjoint_iff] rintro _ ⟨hxs, ⟨x, hxt, rfl⟩⟩ apply ht'.ne_zero ⟨x, hxt⟩ rw [Subtype.coe_mk, ← hsec x, Submodule.Quotient.mk_eq_zero] exact Submodule.subset_span hxs refine ⟨s ∪ sec '' t, subset_union_left, ?_, ?_⟩ · rw [Cardinal.mk_union_of_disjoint hst, Cardinal.mk_image_eq, ht, ← rank_quotient_add_rank (Submodule.span R s), add_comm, rank_span_set hs] exact HasLeftInverse.injective ⟨Submodule.Quotient.mk, hsec⟩ · apply LinearIndependent.union_of_quotient Submodule.subset_span hs rwa [Function.comp, linearIndependent_image (hsec'.symm ▸ injective_id).injOn.image_of_comp, ← image_comp, hsec', image_id]
Mathlib/LinearAlgebra/Dimension/RankNullity.lean
113
123
theorem exists_linearIndependent_cons_of_lt_rank [StrongRankCondition R] {n : ℕ} {v : Fin n → M} (hv : LinearIndependent R v) (h : n < Module.rank R M) : ∃ (x : M), LinearIndependent R (Fin.cons x v) := by
obtain ⟨t, h₁, h₂, h₃⟩ := exists_linearIndependent_of_lt_rank hv.to_subtype_range have : range v ≠ t := by refine fun e ↦ h.ne ?_ rw [← e, ← lift_injective.eq_iff, mk_range_eq_of_injective hv.injective] at h₂ simpa only [mk_fintype, Fintype.card_fin, lift_natCast, lift_id'] using h₂ obtain ⟨x, hx, hx'⟩ := nonempty_of_ssubset (h₁.ssubset_of_ne this) exact ⟨x, (linearIndependent_subtype_range (Fin.cons_injective_iff.mpr ⟨hx', hv.injective⟩)).mp (h₃.mono (Fin.range_cons x v ▸ insert_subset hx h₁))⟩
1,687
import Mathlib.LinearAlgebra.Dimension.Constructions import Mathlib.LinearAlgebra.Dimension.Finite universe u v open Function Set Cardinal variable {R} {M M₁ M₂ M₃ : Type u} {M' : Type v} [Ring R] variable [AddCommGroup M] [AddCommGroup M₁] [AddCommGroup M₂] [AddCommGroup M₃] [AddCommGroup M'] variable [Module R M] [Module R M₁] [Module R M₂] [Module R M₃] [Module R M'] @[pp_with_univ] class HasRankNullity (R : Type v) [inst : Ring R] : Prop where exists_set_linearIndependent : ∀ (M : Type u) [AddCommGroup M] [Module R M], ∃ s : Set M, #s = Module.rank R M ∧ LinearIndependent (ι := s) R Subtype.val rank_quotient_add_rank : ∀ {M : Type u} [AddCommGroup M] [Module R M] (N : Submodule R M), Module.rank R (M ⧸ N) + Module.rank R N = Module.rank R M variable [HasRankNullity.{u} R] lemma rank_quotient_add_rank (N : Submodule R M) : Module.rank R (M ⧸ N) + Module.rank R N = Module.rank R M := HasRankNullity.rank_quotient_add_rank N #align rank_quotient_add_rank rank_quotient_add_rank variable (R M) in lemma exists_set_linearIndependent : ∃ s : Set M, #s = Module.rank R M ∧ LinearIndependent (ι := s) R Subtype.val := HasRankNullity.exists_set_linearIndependent M variable (R) in instance (priority := 100) : Nontrivial R := by refine (subsingleton_or_nontrivial R).resolve_left fun H ↦ ?_ have := rank_quotient_add_rank (R := R) (M := PUnit) ⊥ simp [one_add_one_eq_two] at this theorem lift_rank_range_add_rank_ker (f : M →ₗ[R] M') : lift.{u} (Module.rank R (LinearMap.range f)) + lift.{v} (Module.rank R (LinearMap.ker f)) = lift.{v} (Module.rank R M) := by haveI := fun p : Submodule R M => Classical.decEq (M ⧸ p) rw [← f.quotKerEquivRange.lift_rank_eq, ← lift_add, rank_quotient_add_rank] theorem rank_range_add_rank_ker (f : M →ₗ[R] M₁) : Module.rank R (LinearMap.range f) + Module.rank R (LinearMap.ker f) = Module.rank R M := by haveI := fun p : Submodule R M => Classical.decEq (M ⧸ p) rw [← f.quotKerEquivRange.rank_eq, rank_quotient_add_rank] #align rank_range_add_rank_ker rank_range_add_rank_ker theorem lift_rank_eq_of_surjective {f : M →ₗ[R] M'} (h : Surjective f) : lift.{v} (Module.rank R M) = lift.{u} (Module.rank R M') + lift.{v} (Module.rank R (LinearMap.ker f)) := by rw [← lift_rank_range_add_rank_ker f, ← rank_range_of_surjective f h] theorem rank_eq_of_surjective {f : M →ₗ[R] M₁} (h : Surjective f) : Module.rank R M = Module.rank R M₁ + Module.rank R (LinearMap.ker f) := by rw [← rank_range_add_rank_ker f, ← rank_range_of_surjective f h] #align rank_eq_of_surjective rank_eq_of_surjective theorem exists_linearIndependent_of_lt_rank [StrongRankCondition R] {s : Set M} (hs : LinearIndependent (ι := s) R Subtype.val) : ∃ t, s ⊆ t ∧ #t = Module.rank R M ∧ LinearIndependent (ι := t) R Subtype.val := by obtain ⟨t, ht, ht'⟩ := exists_set_linearIndependent R (M ⧸ Submodule.span R s) choose sec hsec using Submodule.Quotient.mk_surjective (Submodule.span R s) have hsec' : Submodule.Quotient.mk ∘ sec = id := funext hsec have hst : Disjoint s (sec '' t) := by rw [Set.disjoint_iff] rintro _ ⟨hxs, ⟨x, hxt, rfl⟩⟩ apply ht'.ne_zero ⟨x, hxt⟩ rw [Subtype.coe_mk, ← hsec x, Submodule.Quotient.mk_eq_zero] exact Submodule.subset_span hxs refine ⟨s ∪ sec '' t, subset_union_left, ?_, ?_⟩ · rw [Cardinal.mk_union_of_disjoint hst, Cardinal.mk_image_eq, ht, ← rank_quotient_add_rank (Submodule.span R s), add_comm, rank_span_set hs] exact HasLeftInverse.injective ⟨Submodule.Quotient.mk, hsec⟩ · apply LinearIndependent.union_of_quotient Submodule.subset_span hs rwa [Function.comp, linearIndependent_image (hsec'.symm ▸ injective_id).injOn.image_of_comp, ← image_comp, hsec', image_id] theorem exists_linearIndependent_cons_of_lt_rank [StrongRankCondition R] {n : ℕ} {v : Fin n → M} (hv : LinearIndependent R v) (h : n < Module.rank R M) : ∃ (x : M), LinearIndependent R (Fin.cons x v) := by obtain ⟨t, h₁, h₂, h₃⟩ := exists_linearIndependent_of_lt_rank hv.to_subtype_range have : range v ≠ t := by refine fun e ↦ h.ne ?_ rw [← e, ← lift_injective.eq_iff, mk_range_eq_of_injective hv.injective] at h₂ simpa only [mk_fintype, Fintype.card_fin, lift_natCast, lift_id'] using h₂ obtain ⟨x, hx, hx'⟩ := nonempty_of_ssubset (h₁.ssubset_of_ne this) exact ⟨x, (linearIndependent_subtype_range (Fin.cons_injective_iff.mpr ⟨hx', hv.injective⟩)).mp (h₃.mono (Fin.range_cons x v ▸ insert_subset hx h₁))⟩
Mathlib/LinearAlgebra/Dimension/RankNullity.lean
127
132
theorem exists_linearIndependent_snoc_of_lt_rank [StrongRankCondition R] {n : ℕ} {v : Fin n → M} (hv : LinearIndependent R v) (h : n < Module.rank R M) : ∃ (x : M), LinearIndependent R (Fin.snoc v x) := by
simp only [Fin.snoc_eq_cons_rotate] have ⟨x, hx⟩ := exists_linearIndependent_cons_of_lt_rank hv h exact ⟨x, hx.comp _ (finRotate _).injective⟩
1,687
import Mathlib.Algebra.Module.LinearMap.Basic import Mathlib.LinearAlgebra.Basic import Mathlib.LinearAlgebra.Basis import Mathlib.LinearAlgebra.BilinearMap #align_import linear_algebra.sesquilinear_form from "leanprover-community/mathlib"@"87c54600fe3cdc7d32ff5b50873ac724d86aef8d" variable {R R₁ R₂ R₃ M M₁ M₂ M₃ Mₗ₁ Mₗ₁' Mₗ₂ Mₗ₂' K K₁ K₂ V V₁ V₂ n : Type*} namespace LinearMap section CommRing -- the `ₗ` subscript variables are for special cases about linear (as opposed to semilinear) maps variable [CommSemiring R] [CommSemiring R₁] [AddCommMonoid M₁] [Module R₁ M₁] [CommSemiring R₂] [AddCommMonoid M₂] [Module R₂ M₂] [AddCommMonoid M] [Module R M] {I₁ : R₁ →+* R} {I₂ : R₂ →+* R} {I₁' : R₁ →+* R} def IsOrtho (B : M₁ →ₛₗ[I₁] M₂ →ₛₗ[I₂] M) (x : M₁) (y : M₂) : Prop := B x y = 0 #align linear_map.is_ortho LinearMap.IsOrtho theorem isOrtho_def {B : M₁ →ₛₗ[I₁] M₂ →ₛₗ[I₂] M} {x y} : B.IsOrtho x y ↔ B x y = 0 := Iff.rfl #align linear_map.is_ortho_def LinearMap.isOrtho_def
Mathlib/LinearAlgebra/SesquilinearForm.lean
64
66
theorem isOrtho_zero_left (B : M₁ →ₛₗ[I₁] M₂ →ₛₗ[I₂] M) (x) : IsOrtho B (0 : M₁) x := by
dsimp only [IsOrtho] rw [map_zero B, zero_apply]
1,688
import Mathlib.Algebra.Module.LinearMap.Basic import Mathlib.LinearAlgebra.Basic import Mathlib.LinearAlgebra.Basis import Mathlib.LinearAlgebra.BilinearMap #align_import linear_algebra.sesquilinear_form from "leanprover-community/mathlib"@"87c54600fe3cdc7d32ff5b50873ac724d86aef8d" variable {R R₁ R₂ R₃ M M₁ M₂ M₃ Mₗ₁ Mₗ₁' Mₗ₂ Mₗ₂' K K₁ K₂ V V₁ V₂ n : Type*} namespace LinearMap section CommRing -- the `ₗ` subscript variables are for special cases about linear (as opposed to semilinear) maps variable [CommSemiring R] [CommSemiring R₁] [AddCommMonoid M₁] [Module R₁ M₁] [CommSemiring R₂] [AddCommMonoid M₂] [Module R₂ M₂] [AddCommMonoid M] [Module R M] {I₁ : R₁ →+* R} {I₂ : R₂ →+* R} {I₁' : R₁ →+* R} def IsOrtho (B : M₁ →ₛₗ[I₁] M₂ →ₛₗ[I₂] M) (x : M₁) (y : M₂) : Prop := B x y = 0 #align linear_map.is_ortho LinearMap.IsOrtho theorem isOrtho_def {B : M₁ →ₛₗ[I₁] M₂ →ₛₗ[I₂] M} {x y} : B.IsOrtho x y ↔ B x y = 0 := Iff.rfl #align linear_map.is_ortho_def LinearMap.isOrtho_def theorem isOrtho_zero_left (B : M₁ →ₛₗ[I₁] M₂ →ₛₗ[I₂] M) (x) : IsOrtho B (0 : M₁) x := by dsimp only [IsOrtho] rw [map_zero B, zero_apply] #align linear_map.is_ortho_zero_left LinearMap.isOrtho_zero_left theorem isOrtho_zero_right (B : M₁ →ₛₗ[I₁] M₂ →ₛₗ[I₂] M) (x) : IsOrtho B x (0 : M₂) := map_zero (B x) #align linear_map.is_ortho_zero_right LinearMap.isOrtho_zero_right
Mathlib/LinearAlgebra/SesquilinearForm.lean
73
74
theorem isOrtho_flip {B : M₁ →ₛₗ[I₁] M₁ →ₛₗ[I₁'] M} {x y} : B.IsOrtho x y ↔ B.flip.IsOrtho y x := by
simp_rw [isOrtho_def, flip_apply]
1,688
import Mathlib.Algebra.Module.LinearMap.Basic import Mathlib.LinearAlgebra.Basic import Mathlib.LinearAlgebra.Basis import Mathlib.LinearAlgebra.BilinearMap #align_import linear_algebra.sesquilinear_form from "leanprover-community/mathlib"@"87c54600fe3cdc7d32ff5b50873ac724d86aef8d" variable {R R₁ R₂ R₃ M M₁ M₂ M₃ Mₗ₁ Mₗ₁' Mₗ₂ Mₗ₂' K K₁ K₂ V V₁ V₂ n : Type*} namespace LinearMap section CommRing -- the `ₗ` subscript variables are for special cases about linear (as opposed to semilinear) maps variable [CommSemiring R] [CommSemiring R₁] [AddCommMonoid M₁] [Module R₁ M₁] [CommSemiring R₂] [AddCommMonoid M₂] [Module R₂ M₂] [AddCommMonoid M] [Module R M] {I₁ : R₁ →+* R} {I₂ : R₂ →+* R} {I₁' : R₁ →+* R} def IsOrtho (B : M₁ →ₛₗ[I₁] M₂ →ₛₗ[I₂] M) (x : M₁) (y : M₂) : Prop := B x y = 0 #align linear_map.is_ortho LinearMap.IsOrtho theorem isOrtho_def {B : M₁ →ₛₗ[I₁] M₂ →ₛₗ[I₂] M} {x y} : B.IsOrtho x y ↔ B x y = 0 := Iff.rfl #align linear_map.is_ortho_def LinearMap.isOrtho_def theorem isOrtho_zero_left (B : M₁ →ₛₗ[I₁] M₂ →ₛₗ[I₂] M) (x) : IsOrtho B (0 : M₁) x := by dsimp only [IsOrtho] rw [map_zero B, zero_apply] #align linear_map.is_ortho_zero_left LinearMap.isOrtho_zero_left theorem isOrtho_zero_right (B : M₁ →ₛₗ[I₁] M₂ →ₛₗ[I₂] M) (x) : IsOrtho B x (0 : M₂) := map_zero (B x) #align linear_map.is_ortho_zero_right LinearMap.isOrtho_zero_right theorem isOrtho_flip {B : M₁ →ₛₗ[I₁] M₁ →ₛₗ[I₁'] M} {x y} : B.IsOrtho x y ↔ B.flip.IsOrtho y x := by simp_rw [isOrtho_def, flip_apply] #align linear_map.is_ortho_flip LinearMap.isOrtho_flip def IsOrthoᵢ (B : M₁ →ₛₗ[I₁] M₁ →ₛₗ[I₁'] M) (v : n → M₁) : Prop := Pairwise (B.IsOrtho on v) set_option linter.uppercaseLean3 false in #align linear_map.is_Ortho LinearMap.IsOrthoᵢ theorem isOrthoᵢ_def {B : M₁ →ₛₗ[I₁] M₁ →ₛₗ[I₁'] M} {v : n → M₁} : B.IsOrthoᵢ v ↔ ∀ i j : n, i ≠ j → B (v i) (v j) = 0 := Iff.rfl set_option linter.uppercaseLean3 false in #align linear_map.is_Ortho_def LinearMap.isOrthoᵢ_def
Mathlib/LinearAlgebra/SesquilinearForm.lean
91
98
theorem isOrthoᵢ_flip (B : M₁ →ₛₗ[I₁] M₁ →ₛₗ[I₁'] M) {v : n → M₁} : B.IsOrthoᵢ v ↔ B.flip.IsOrthoᵢ v := by
simp_rw [isOrthoᵢ_def] constructor <;> intro h i j hij · rw [flip_apply] exact h j i (Ne.symm hij) simp_rw [flip_apply] at h exact h j i (Ne.symm hij)
1,688
import Mathlib.Algebra.Module.LinearMap.Basic import Mathlib.LinearAlgebra.Basic import Mathlib.LinearAlgebra.Basis import Mathlib.LinearAlgebra.BilinearMap #align_import linear_algebra.sesquilinear_form from "leanprover-community/mathlib"@"87c54600fe3cdc7d32ff5b50873ac724d86aef8d" variable {R R₁ R₂ R₃ M M₁ M₂ M₃ Mₗ₁ Mₗ₁' Mₗ₂ Mₗ₂' K K₁ K₂ V V₁ V₂ n : Type*} namespace LinearMap section Reflexive variable [CommSemiring R] [AddCommMonoid M] [Module R M] [CommSemiring R₁] [AddCommMonoid M₁] [Module R₁ M₁] {I₁ : R₁ →+* R} {I₂ : R₁ →+* R} {B : M₁ →ₛₗ[I₁] M₁ →ₛₗ[I₂] M} def IsRefl (B : M₁ →ₛₗ[I₁] M₁ →ₛₗ[I₂] M) : Prop := ∀ x y, B x y = 0 → B y x = 0 #align linear_map.is_refl LinearMap.IsRefl section Symmetric variable [CommSemiring R] [AddCommMonoid M] [Module R M] {I : R →+* R} {B : M →ₛₗ[I] M →ₗ[R] R} def IsSymm (B : M →ₛₗ[I] M →ₗ[R] R) : Prop := ∀ x y, I (B x y) = B y x #align linear_map.is_symm LinearMap.IsSymm @[simp] theorem isSymm_zero : (0 : M →ₛₗ[I] M →ₗ[R] R).IsSymm := fun _ _ => map_zero _
Mathlib/LinearAlgebra/SesquilinearForm.lean
246
252
theorem isSymm_iff_eq_flip {B : LinearMap.BilinForm R M} : B.IsSymm ↔ B = B.flip := by
constructor <;> intro h · ext rw [← h, flip_apply, RingHom.id_apply] intro x y conv_lhs => rw [h] rfl
1,688
import Mathlib.Analysis.Normed.Field.Basic import Mathlib.LinearAlgebra.SesquilinearForm import Mathlib.Topology.Algebra.Module.WeakDual #align_import analysis.locally_convex.polar from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4" variable {𝕜 E F : Type*} open Topology namespace LinearMap section NormedRing variable [NormedCommRing 𝕜] [AddCommMonoid E] [AddCommMonoid F] variable [Module 𝕜 E] [Module 𝕜 F] variable (B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜) def polar (s : Set E) : Set F := { y : F | ∀ x ∈ s, ‖B x y‖ ≤ 1 } #align linear_map.polar LinearMap.polar theorem polar_mem_iff (s : Set E) (y : F) : y ∈ B.polar s ↔ ∀ x ∈ s, ‖B x y‖ ≤ 1 := Iff.rfl #align linear_map.polar_mem_iff LinearMap.polar_mem_iff theorem polar_mem (s : Set E) (y : F) (hy : y ∈ B.polar s) : ∀ x ∈ s, ‖B x y‖ ≤ 1 := hy #align linear_map.polar_mem LinearMap.polar_mem @[simp] theorem zero_mem_polar (s : Set E) : (0 : F) ∈ B.polar s := fun _ _ => by simp only [map_zero, norm_zero, zero_le_one] #align linear_map.zero_mem_polar LinearMap.zero_mem_polar
Mathlib/Analysis/LocallyConvex/Polar.lean
73
75
theorem polar_eq_iInter {s : Set E} : B.polar s = ⋂ x ∈ s, { y : F | ‖B x y‖ ≤ 1 } := by
ext simp only [polar_mem_iff, Set.mem_iInter, Set.mem_setOf_eq]
1,689
import Mathlib.Analysis.Normed.Field.Basic import Mathlib.LinearAlgebra.SesquilinearForm import Mathlib.Topology.Algebra.Module.WeakDual #align_import analysis.locally_convex.polar from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4" variable {𝕜 E F : Type*} open Topology namespace LinearMap section NormedRing variable [NormedCommRing 𝕜] [AddCommMonoid E] [AddCommMonoid F] variable [Module 𝕜 E] [Module 𝕜 F] variable (B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜) def polar (s : Set E) : Set F := { y : F | ∀ x ∈ s, ‖B x y‖ ≤ 1 } #align linear_map.polar LinearMap.polar theorem polar_mem_iff (s : Set E) (y : F) : y ∈ B.polar s ↔ ∀ x ∈ s, ‖B x y‖ ≤ 1 := Iff.rfl #align linear_map.polar_mem_iff LinearMap.polar_mem_iff theorem polar_mem (s : Set E) (y : F) (hy : y ∈ B.polar s) : ∀ x ∈ s, ‖B x y‖ ≤ 1 := hy #align linear_map.polar_mem LinearMap.polar_mem @[simp] theorem zero_mem_polar (s : Set E) : (0 : F) ∈ B.polar s := fun _ _ => by simp only [map_zero, norm_zero, zero_le_one] #align linear_map.zero_mem_polar LinearMap.zero_mem_polar theorem polar_eq_iInter {s : Set E} : B.polar s = ⋂ x ∈ s, { y : F | ‖B x y‖ ≤ 1 } := by ext simp only [polar_mem_iff, Set.mem_iInter, Set.mem_setOf_eq] #align linear_map.polar_eq_Inter LinearMap.polar_eq_iInter theorem polar_gc : GaloisConnection (OrderDual.toDual ∘ B.polar) (B.flip.polar ∘ OrderDual.ofDual) := fun _ _ => ⟨fun h _ hx _ hy => h hy _ hx, fun h _ hx _ hy => h hy _ hx⟩ #align linear_map.polar_gc LinearMap.polar_gc @[simp] theorem polar_iUnion {ι} {s : ι → Set E} : B.polar (⋃ i, s i) = ⋂ i, B.polar (s i) := B.polar_gc.l_iSup #align linear_map.polar_Union LinearMap.polar_iUnion @[simp] theorem polar_union {s t : Set E} : B.polar (s ∪ t) = B.polar s ∩ B.polar t := B.polar_gc.l_sup #align linear_map.polar_union LinearMap.polar_union theorem polar_antitone : Antitone (B.polar : Set E → Set F) := B.polar_gc.monotone_l #align linear_map.polar_antitone LinearMap.polar_antitone @[simp] theorem polar_empty : B.polar ∅ = Set.univ := B.polar_gc.l_bot #align linear_map.polar_empty LinearMap.polar_empty @[simp]
Mathlib/Analysis/LocallyConvex/Polar.lean
106
109
theorem polar_zero : B.polar ({0} : Set E) = Set.univ := by
refine Set.eq_univ_iff_forall.mpr fun y x hx => ?_ rw [Set.mem_singleton_iff.mp hx, map_zero, LinearMap.zero_apply, norm_zero] exact zero_le_one
1,689
import Mathlib.Analysis.Normed.Field.Basic import Mathlib.LinearAlgebra.SesquilinearForm import Mathlib.Topology.Algebra.Module.WeakDual #align_import analysis.locally_convex.polar from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4" variable {𝕜 E F : Type*} open Topology namespace LinearMap section NormedRing variable [NormedCommRing 𝕜] [AddCommMonoid E] [AddCommMonoid F] variable [Module 𝕜 E] [Module 𝕜 F] variable (B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜) def polar (s : Set E) : Set F := { y : F | ∀ x ∈ s, ‖B x y‖ ≤ 1 } #align linear_map.polar LinearMap.polar theorem polar_mem_iff (s : Set E) (y : F) : y ∈ B.polar s ↔ ∀ x ∈ s, ‖B x y‖ ≤ 1 := Iff.rfl #align linear_map.polar_mem_iff LinearMap.polar_mem_iff theorem polar_mem (s : Set E) (y : F) (hy : y ∈ B.polar s) : ∀ x ∈ s, ‖B x y‖ ≤ 1 := hy #align linear_map.polar_mem LinearMap.polar_mem @[simp] theorem zero_mem_polar (s : Set E) : (0 : F) ∈ B.polar s := fun _ _ => by simp only [map_zero, norm_zero, zero_le_one] #align linear_map.zero_mem_polar LinearMap.zero_mem_polar theorem polar_eq_iInter {s : Set E} : B.polar s = ⋂ x ∈ s, { y : F | ‖B x y‖ ≤ 1 } := by ext simp only [polar_mem_iff, Set.mem_iInter, Set.mem_setOf_eq] #align linear_map.polar_eq_Inter LinearMap.polar_eq_iInter theorem polar_gc : GaloisConnection (OrderDual.toDual ∘ B.polar) (B.flip.polar ∘ OrderDual.ofDual) := fun _ _ => ⟨fun h _ hx _ hy => h hy _ hx, fun h _ hx _ hy => h hy _ hx⟩ #align linear_map.polar_gc LinearMap.polar_gc @[simp] theorem polar_iUnion {ι} {s : ι → Set E} : B.polar (⋃ i, s i) = ⋂ i, B.polar (s i) := B.polar_gc.l_iSup #align linear_map.polar_Union LinearMap.polar_iUnion @[simp] theorem polar_union {s t : Set E} : B.polar (s ∪ t) = B.polar s ∩ B.polar t := B.polar_gc.l_sup #align linear_map.polar_union LinearMap.polar_union theorem polar_antitone : Antitone (B.polar : Set E → Set F) := B.polar_gc.monotone_l #align linear_map.polar_antitone LinearMap.polar_antitone @[simp] theorem polar_empty : B.polar ∅ = Set.univ := B.polar_gc.l_bot #align linear_map.polar_empty LinearMap.polar_empty @[simp] theorem polar_zero : B.polar ({0} : Set E) = Set.univ := by refine Set.eq_univ_iff_forall.mpr fun y x hx => ?_ rw [Set.mem_singleton_iff.mp hx, map_zero, LinearMap.zero_apply, norm_zero] exact zero_le_one #align linear_map.polar_zero LinearMap.polar_zero theorem subset_bipolar (s : Set E) : s ⊆ B.flip.polar (B.polar s) := fun x hx y hy => by rw [B.flip_apply] exact hy x hx #align linear_map.subset_bipolar LinearMap.subset_bipolar @[simp] theorem tripolar_eq_polar (s : Set E) : B.polar (B.flip.polar (B.polar s)) = B.polar s := (B.polar_antitone (B.subset_bipolar s)).antisymm (subset_bipolar B.flip (B.polar s)) #align linear_map.tripolar_eq_polar LinearMap.tripolar_eq_polar
Mathlib/Analysis/LocallyConvex/Polar.lean
123
127
theorem polar_weak_closed (s : Set E) : IsClosed[WeakBilin.instTopologicalSpace B.flip] (B.polar s) := by
rw [polar_eq_iInter] refine isClosed_iInter fun x => isClosed_iInter fun _ => ?_ exact isClosed_le (WeakBilin.eval_continuous B.flip x).norm continuous_const
1,689
import Mathlib.LinearAlgebra.Basis import Mathlib.LinearAlgebra.FreeModule.Basic import Mathlib.LinearAlgebra.LinearPMap import Mathlib.LinearAlgebra.Projection #align_import linear_algebra.basis from "leanprover-community/mathlib"@"13bce9a6b6c44f6b4c91ac1c1d2a816e2533d395" open Function Set Submodule set_option autoImplicit false variable {ι : Type*} {ι' : Type*} {K : Type*} {V : Type*} {V' : Type*} section DivisionRing variable [DivisionRing K] [AddCommGroup V] [AddCommGroup V'] [Module K V] [Module K V'] variable {v : ι → V} {s t : Set V} {x y z : V} open Submodule namespace Basis section ExistsBasis noncomputable def extend (hs : LinearIndependent K ((↑) : s → V)) : Basis (hs.extend (subset_univ s)) K V := Basis.mk (@LinearIndependent.restrict_of_comp_subtype _ _ _ id _ _ _ _ (hs.linearIndependent_extend _)) (SetLike.coe_subset_coe.mp <| by simpa using hs.subset_span_extend (subset_univ s)) #align basis.extend Basis.extend theorem extend_apply_self (hs : LinearIndependent K ((↑) : s → V)) (x : hs.extend _) : Basis.extend hs x = x := Basis.mk_apply _ _ _ #align basis.extend_apply_self Basis.extend_apply_self @[simp] theorem coe_extend (hs : LinearIndependent K ((↑) : s → V)) : ⇑(Basis.extend hs) = ((↑) : _ → _) := funext (extend_apply_self hs) #align basis.coe_extend Basis.coe_extend
Mathlib/LinearAlgebra/Basis/VectorSpace.lean
67
69
theorem range_extend (hs : LinearIndependent K ((↑) : s → V)) : range (Basis.extend hs) = hs.extend (subset_univ _) := by
rw [coe_extend, Subtype.range_coe_subtype, setOf_mem_eq]
1,690
import Mathlib.LinearAlgebra.Basis import Mathlib.LinearAlgebra.FreeModule.Basic import Mathlib.LinearAlgebra.LinearPMap import Mathlib.LinearAlgebra.Projection #align_import linear_algebra.basis from "leanprover-community/mathlib"@"13bce9a6b6c44f6b4c91ac1c1d2a816e2533d395" open Function Set Submodule set_option autoImplicit false variable {ι : Type*} {ι' : Type*} {K : Type*} {V : Type*} {V' : Type*} section DivisionRing variable [DivisionRing K] [AddCommGroup V] [AddCommGroup V'] [Module K V] [Module K V'] variable {v : ι → V} {s t : Set V} {x y z : V} open Submodule namespace Basis section ExistsBasis noncomputable def extend (hs : LinearIndependent K ((↑) : s → V)) : Basis (hs.extend (subset_univ s)) K V := Basis.mk (@LinearIndependent.restrict_of_comp_subtype _ _ _ id _ _ _ _ (hs.linearIndependent_extend _)) (SetLike.coe_subset_coe.mp <| by simpa using hs.subset_span_extend (subset_univ s)) #align basis.extend Basis.extend theorem extend_apply_self (hs : LinearIndependent K ((↑) : s → V)) (x : hs.extend _) : Basis.extend hs x = x := Basis.mk_apply _ _ _ #align basis.extend_apply_self Basis.extend_apply_self @[simp] theorem coe_extend (hs : LinearIndependent K ((↑) : s → V)) : ⇑(Basis.extend hs) = ((↑) : _ → _) := funext (extend_apply_self hs) #align basis.coe_extend Basis.coe_extend theorem range_extend (hs : LinearIndependent K ((↑) : s → V)) : range (Basis.extend hs) = hs.extend (subset_univ _) := by rw [coe_extend, Subtype.range_coe_subtype, setOf_mem_eq] #align basis.range_extend Basis.range_extend -- Porting note: adding this to make the statement of `subExtend` more readable def sumExtendIndex (hs : LinearIndependent K v) : Set V := LinearIndependent.extend hs.to_subtype_range (subset_univ _) \ range v noncomputable def sumExtend (hs : LinearIndependent K v) : Basis (ι ⊕ sumExtendIndex hs) K V := let s := Set.range v let e : ι ≃ s := Equiv.ofInjective v hs.injective let b := hs.to_subtype_range.extend (subset_univ (Set.range v)) (Basis.extend hs.to_subtype_range).reindex <| Equiv.symm <| calc Sum ι (b \ s : Set V) ≃ Sum s (b \ s : Set V) := Equiv.sumCongr e (Equiv.refl _) _ ≃ b := haveI := Classical.decPred (· ∈ s) Equiv.Set.sumDiffSubset (hs.to_subtype_range.subset_extend _) #align basis.sum_extend Basis.sumExtend theorem subset_extend {s : Set V} (hs : LinearIndependent K ((↑) : s → V)) : s ⊆ hs.extend (Set.subset_univ _) := hs.subset_extend _ #align basis.subset_extend Basis.subset_extend section variable (K V) noncomputable def ofVectorSpaceIndex : Set V := (linearIndependent_empty K V).extend (subset_univ _) #align basis.of_vector_space_index Basis.ofVectorSpaceIndex noncomputable def ofVectorSpace : Basis (ofVectorSpaceIndex K V) K V := Basis.extend (linearIndependent_empty K V) #align basis.of_vector_space Basis.ofVectorSpace instance (priority := 100) _root_.Module.Free.of_divisionRing : Module.Free K V := Module.Free.of_basis (ofVectorSpace K V) #align module.free.of_division_ring Module.Free.of_divisionRing
Mathlib/LinearAlgebra/Basis/VectorSpace.lean
117
119
theorem ofVectorSpace_apply_self (x : ofVectorSpaceIndex K V) : ofVectorSpace K V x = x := by
unfold ofVectorSpace exact Basis.mk_apply _ _ _
1,690
import Mathlib.LinearAlgebra.Basis import Mathlib.LinearAlgebra.FreeModule.Basic import Mathlib.LinearAlgebra.LinearPMap import Mathlib.LinearAlgebra.Projection #align_import linear_algebra.basis from "leanprover-community/mathlib"@"13bce9a6b6c44f6b4c91ac1c1d2a816e2533d395" open Function Set Submodule set_option autoImplicit false variable {ι : Type*} {ι' : Type*} {K : Type*} {V : Type*} {V' : Type*} section DivisionRing variable [DivisionRing K] [AddCommGroup V] [AddCommGroup V'] [Module K V] [Module K V'] variable {v : ι → V} {s t : Set V} {x y z : V} open Submodule namespace Basis section ExistsBasis noncomputable def extend (hs : LinearIndependent K ((↑) : s → V)) : Basis (hs.extend (subset_univ s)) K V := Basis.mk (@LinearIndependent.restrict_of_comp_subtype _ _ _ id _ _ _ _ (hs.linearIndependent_extend _)) (SetLike.coe_subset_coe.mp <| by simpa using hs.subset_span_extend (subset_univ s)) #align basis.extend Basis.extend theorem extend_apply_self (hs : LinearIndependent K ((↑) : s → V)) (x : hs.extend _) : Basis.extend hs x = x := Basis.mk_apply _ _ _ #align basis.extend_apply_self Basis.extend_apply_self @[simp] theorem coe_extend (hs : LinearIndependent K ((↑) : s → V)) : ⇑(Basis.extend hs) = ((↑) : _ → _) := funext (extend_apply_self hs) #align basis.coe_extend Basis.coe_extend theorem range_extend (hs : LinearIndependent K ((↑) : s → V)) : range (Basis.extend hs) = hs.extend (subset_univ _) := by rw [coe_extend, Subtype.range_coe_subtype, setOf_mem_eq] #align basis.range_extend Basis.range_extend -- Porting note: adding this to make the statement of `subExtend` more readable def sumExtendIndex (hs : LinearIndependent K v) : Set V := LinearIndependent.extend hs.to_subtype_range (subset_univ _) \ range v noncomputable def sumExtend (hs : LinearIndependent K v) : Basis (ι ⊕ sumExtendIndex hs) K V := let s := Set.range v let e : ι ≃ s := Equiv.ofInjective v hs.injective let b := hs.to_subtype_range.extend (subset_univ (Set.range v)) (Basis.extend hs.to_subtype_range).reindex <| Equiv.symm <| calc Sum ι (b \ s : Set V) ≃ Sum s (b \ s : Set V) := Equiv.sumCongr e (Equiv.refl _) _ ≃ b := haveI := Classical.decPred (· ∈ s) Equiv.Set.sumDiffSubset (hs.to_subtype_range.subset_extend _) #align basis.sum_extend Basis.sumExtend theorem subset_extend {s : Set V} (hs : LinearIndependent K ((↑) : s → V)) : s ⊆ hs.extend (Set.subset_univ _) := hs.subset_extend _ #align basis.subset_extend Basis.subset_extend section variable (K V) noncomputable def ofVectorSpaceIndex : Set V := (linearIndependent_empty K V).extend (subset_univ _) #align basis.of_vector_space_index Basis.ofVectorSpaceIndex noncomputable def ofVectorSpace : Basis (ofVectorSpaceIndex K V) K V := Basis.extend (linearIndependent_empty K V) #align basis.of_vector_space Basis.ofVectorSpace instance (priority := 100) _root_.Module.Free.of_divisionRing : Module.Free K V := Module.Free.of_basis (ofVectorSpace K V) #align module.free.of_division_ring Module.Free.of_divisionRing theorem ofVectorSpace_apply_self (x : ofVectorSpaceIndex K V) : ofVectorSpace K V x = x := by unfold ofVectorSpace exact Basis.mk_apply _ _ _ #align basis.of_vector_space_apply_self Basis.ofVectorSpace_apply_self @[simp] theorem coe_ofVectorSpace : ⇑(ofVectorSpace K V) = ((↑) : _ → _ ) := funext fun x => ofVectorSpace_apply_self K V x #align basis.coe_of_vector_space Basis.coe_ofVectorSpace
Mathlib/LinearAlgebra/Basis/VectorSpace.lean
127
131
theorem ofVectorSpaceIndex.linearIndependent : LinearIndependent K ((↑) : ofVectorSpaceIndex K V → V) := by
convert (ofVectorSpace K V).linearIndependent ext x rw [ofVectorSpace_apply_self]
1,690
import Mathlib.Data.DFinsupp.Basic import Mathlib.Data.Finset.Pointwise import Mathlib.LinearAlgebra.Basis.VectorSpace #align_import algebra.group.unique_prods from "leanprover-community/mathlib"@"d6fad0e5bf2d6f48da9175d25c3dc5706b3834ce" @[to_additive "Let `G` be a Type with addition, let `A B : Finset G` be finite subsets and let `a0 b0 : G` be two elements. `UniqueAdd A B a0 b0` asserts `a0 + b0` can be written in at most one way as a sum of an element from `A` and an element from `B`."] def UniqueMul {G} [Mul G] (A B : Finset G) (a0 b0 : G) : Prop := ∀ ⦃a b⦄, a ∈ A → b ∈ B → a * b = a0 * b0 → a = a0 ∧ b = b0 #align unique_mul UniqueMul #align unique_add UniqueAdd namespace UniqueMul variable {G H : Type*} [Mul G] [Mul H] {A B : Finset G} {a0 b0 : G} @[to_additive (attr := nontriviality, simp)]
Mathlib/Algebra/Group/UniqueProds.lean
67
68
theorem of_subsingleton [Subsingleton G] : UniqueMul A B a0 b0 := by
simp [UniqueMul, eq_iff_true_of_subsingleton]
1,691
import Mathlib.Data.DFinsupp.Basic import Mathlib.Data.Finset.Pointwise import Mathlib.LinearAlgebra.Basis.VectorSpace #align_import algebra.group.unique_prods from "leanprover-community/mathlib"@"d6fad0e5bf2d6f48da9175d25c3dc5706b3834ce" @[to_additive "Let `G` be a Type with addition, let `A B : Finset G` be finite subsets and let `a0 b0 : G` be two elements. `UniqueAdd A B a0 b0` asserts `a0 + b0` can be written in at most one way as a sum of an element from `A` and an element from `B`."] def UniqueMul {G} [Mul G] (A B : Finset G) (a0 b0 : G) : Prop := ∀ ⦃a b⦄, a ∈ A → b ∈ B → a * b = a0 * b0 → a = a0 ∧ b = b0 #align unique_mul UniqueMul #align unique_add UniqueAdd namespace UniqueMul variable {G H : Type*} [Mul G] [Mul H] {A B : Finset G} {a0 b0 : G} @[to_additive (attr := nontriviality, simp)] theorem of_subsingleton [Subsingleton G] : UniqueMul A B a0 b0 := by simp [UniqueMul, eq_iff_true_of_subsingleton] @[to_additive]
Mathlib/Algebra/Group/UniqueProds.lean
71
75
theorem of_card_le_one (hA : A.Nonempty) (hB : B.Nonempty) (hA1 : A.card ≤ 1) (hB1 : B.card ≤ 1) : ∃ a ∈ A, ∃ b ∈ B, UniqueMul A B a b := by
rw [Finset.card_le_one_iff] at hA1 hB1 obtain ⟨a, ha⟩ := hA; obtain ⟨b, hb⟩ := hB exact ⟨a, ha, b, hb, fun _ _ ha' hb' _ ↦ ⟨hA1 ha' ha, hB1 hb' hb⟩⟩
1,691
import Mathlib.Data.DFinsupp.Basic import Mathlib.Data.Finset.Pointwise import Mathlib.LinearAlgebra.Basis.VectorSpace #align_import algebra.group.unique_prods from "leanprover-community/mathlib"@"d6fad0e5bf2d6f48da9175d25c3dc5706b3834ce" @[to_additive "Let `G` be a Type with addition, let `A B : Finset G` be finite subsets and let `a0 b0 : G` be two elements. `UniqueAdd A B a0 b0` asserts `a0 + b0` can be written in at most one way as a sum of an element from `A` and an element from `B`."] def UniqueMul {G} [Mul G] (A B : Finset G) (a0 b0 : G) : Prop := ∀ ⦃a b⦄, a ∈ A → b ∈ B → a * b = a0 * b0 → a = a0 ∧ b = b0 #align unique_mul UniqueMul #align unique_add UniqueAdd namespace UniqueMul variable {G H : Type*} [Mul G] [Mul H] {A B : Finset G} {a0 b0 : G} @[to_additive (attr := nontriviality, simp)] theorem of_subsingleton [Subsingleton G] : UniqueMul A B a0 b0 := by simp [UniqueMul, eq_iff_true_of_subsingleton] @[to_additive] theorem of_card_le_one (hA : A.Nonempty) (hB : B.Nonempty) (hA1 : A.card ≤ 1) (hB1 : B.card ≤ 1) : ∃ a ∈ A, ∃ b ∈ B, UniqueMul A B a b := by rw [Finset.card_le_one_iff] at hA1 hB1 obtain ⟨a, ha⟩ := hA; obtain ⟨b, hb⟩ := hB exact ⟨a, ha, b, hb, fun _ _ ha' hb' _ ↦ ⟨hA1 ha' ha, hB1 hb' hb⟩⟩ @[to_additive] theorem mt (h : UniqueMul A B a0 b0) : ∀ ⦃a b⦄, a ∈ A → b ∈ B → a ≠ a0 ∨ b ≠ b0 → a * b ≠ a0 * b0 := fun _ _ ha hb k ↦ by contrapose! k exact h ha hb k #align unique_mul.mt UniqueMul.mt @[to_additive] theorem subsingleton (h : UniqueMul A B a0 b0) : Subsingleton { ab : G × G // ab.1 ∈ A ∧ ab.2 ∈ B ∧ ab.1 * ab.2 = a0 * b0 } := ⟨fun ⟨⟨_a, _b⟩, ha, hb, ab⟩ ⟨⟨_a', _b'⟩, ha', hb', ab'⟩ ↦ Subtype.ext <| Prod.ext ((h ha hb ab).1.trans (h ha' hb' ab').1.symm) <| (h ha hb ab).2.trans (h ha' hb' ab').2.symm⟩ #align unique_mul.subsingleton UniqueMul.subsingleton #align unique_add.subsingleton UniqueAdd.subsingleton @[to_additive]
Mathlib/Algebra/Group/UniqueProds.lean
95
101
theorem set_subsingleton (h : UniqueMul A B a0 b0) : Set.Subsingleton { ab : G × G | ab.1 ∈ A ∧ ab.2 ∈ B ∧ ab.1 * ab.2 = a0 * b0 } := by
rintro ⟨x1, y1⟩ (hx : x1 ∈ A ∧ y1 ∈ B ∧ x1 * y1 = a0 * b0) ⟨x2, y2⟩ (hy : x2 ∈ A ∧ y2 ∈ B ∧ x2 * y2 = a0 * b0) rcases h hx.1 hx.2.1 hx.2.2 with ⟨rfl, rfl⟩ rcases h hy.1 hy.2.1 hy.2.2 with ⟨rfl, rfl⟩ rfl
1,691
import Mathlib.Data.DFinsupp.Basic import Mathlib.Data.Finset.Pointwise import Mathlib.LinearAlgebra.Basis.VectorSpace #align_import algebra.group.unique_prods from "leanprover-community/mathlib"@"d6fad0e5bf2d6f48da9175d25c3dc5706b3834ce" @[to_additive "Let `G` be a Type with addition, let `A B : Finset G` be finite subsets and let `a0 b0 : G` be two elements. `UniqueAdd A B a0 b0` asserts `a0 + b0` can be written in at most one way as a sum of an element from `A` and an element from `B`."] def UniqueMul {G} [Mul G] (A B : Finset G) (a0 b0 : G) : Prop := ∀ ⦃a b⦄, a ∈ A → b ∈ B → a * b = a0 * b0 → a = a0 ∧ b = b0 #align unique_mul UniqueMul #align unique_add UniqueAdd namespace UniqueMul variable {G H : Type*} [Mul G] [Mul H] {A B : Finset G} {a0 b0 : G} @[to_additive (attr := nontriviality, simp)] theorem of_subsingleton [Subsingleton G] : UniqueMul A B a0 b0 := by simp [UniqueMul, eq_iff_true_of_subsingleton] @[to_additive] theorem of_card_le_one (hA : A.Nonempty) (hB : B.Nonempty) (hA1 : A.card ≤ 1) (hB1 : B.card ≤ 1) : ∃ a ∈ A, ∃ b ∈ B, UniqueMul A B a b := by rw [Finset.card_le_one_iff] at hA1 hB1 obtain ⟨a, ha⟩ := hA; obtain ⟨b, hb⟩ := hB exact ⟨a, ha, b, hb, fun _ _ ha' hb' _ ↦ ⟨hA1 ha' ha, hB1 hb' hb⟩⟩ @[to_additive] theorem mt (h : UniqueMul A B a0 b0) : ∀ ⦃a b⦄, a ∈ A → b ∈ B → a ≠ a0 ∨ b ≠ b0 → a * b ≠ a0 * b0 := fun _ _ ha hb k ↦ by contrapose! k exact h ha hb k #align unique_mul.mt UniqueMul.mt @[to_additive] theorem subsingleton (h : UniqueMul A B a0 b0) : Subsingleton { ab : G × G // ab.1 ∈ A ∧ ab.2 ∈ B ∧ ab.1 * ab.2 = a0 * b0 } := ⟨fun ⟨⟨_a, _b⟩, ha, hb, ab⟩ ⟨⟨_a', _b'⟩, ha', hb', ab'⟩ ↦ Subtype.ext <| Prod.ext ((h ha hb ab).1.trans (h ha' hb' ab').1.symm) <| (h ha hb ab).2.trans (h ha' hb' ab').2.symm⟩ #align unique_mul.subsingleton UniqueMul.subsingleton #align unique_add.subsingleton UniqueAdd.subsingleton @[to_additive] theorem set_subsingleton (h : UniqueMul A B a0 b0) : Set.Subsingleton { ab : G × G | ab.1 ∈ A ∧ ab.2 ∈ B ∧ ab.1 * ab.2 = a0 * b0 } := by rintro ⟨x1, y1⟩ (hx : x1 ∈ A ∧ y1 ∈ B ∧ x1 * y1 = a0 * b0) ⟨x2, y2⟩ (hy : x2 ∈ A ∧ y2 ∈ B ∧ x2 * y2 = a0 * b0) rcases h hx.1 hx.2.1 hx.2.2 with ⟨rfl, rfl⟩ rcases h hy.1 hy.2.1 hy.2.2 with ⟨rfl, rfl⟩ rfl #align unique_mul.set_subsingleton UniqueMul.set_subsingleton #align unique_add.set_subsingleton UniqueAdd.set_subsingleton -- Porting note: mathport warning: expanding binder collection -- (ab «expr ∈ » [finset.product/multiset.product/set.prod/list.product](A, B)) -/ @[to_additive] theorem iff_existsUnique (aA : a0 ∈ A) (bB : b0 ∈ B) : UniqueMul A B a0 b0 ↔ ∃! ab, ab ∈ A ×ˢ B ∧ ab.1 * ab.2 = a0 * b0 := ⟨fun _ ↦ ⟨(a0, b0), ⟨Finset.mk_mem_product aA bB, rfl⟩, by simpa⟩, fun h ↦ h.elim (by rintro ⟨x1, x2⟩ _ J x y hx hy l rcases Prod.mk.inj_iff.mp (J (a0, b0) ⟨Finset.mk_mem_product aA bB, rfl⟩) with ⟨rfl, rfl⟩ exact Prod.mk.inj_iff.mp (J (x, y) ⟨Finset.mk_mem_product hx hy, l⟩))⟩ #align unique_mul.iff_exists_unique UniqueMul.iff_existsUniqueₓ #align unique_add.iff_exists_unique UniqueAdd.iff_existsUniqueₓ open Finset in @[to_additive]
Mathlib/Algebra/Group/UniqueProds.lean
121
129
theorem iff_card_le_one [DecidableEq G] (ha0 : a0 ∈ A) (hb0 : b0 ∈ B) : UniqueMul A B a0 b0 ↔ ((A ×ˢ B).filter (fun p ↦ p.1 * p.2 = a0 * b0)).card ≤ 1 := by
simp_rw [card_le_one_iff, mem_filter, mem_product] refine ⟨fun h p1 p2 ⟨⟨ha1, hb1⟩, he1⟩ ⟨⟨ha2, hb2⟩, he2⟩ ↦ ?_, fun h a b ha hb he ↦ ?_⟩ · have h1 := h ha1 hb1 he1; have h2 := h ha2 hb2 he2 ext · rw [h1.1, h2.1] · rw [h1.2, h2.2] · exact Prod.ext_iff.1 (@h (a, b) (a0, b0) ⟨⟨ha, hb⟩, he⟩ ⟨⟨ha0, hb0⟩, rfl⟩)
1,691
import Mathlib.Algebra.MonoidAlgebra.Basic import Mathlib.Algebra.Group.UniqueProds #align_import algebra.monoid_algebra.no_zero_divisors from "leanprover-community/mathlib"@"3e067975886cf5801e597925328c335609511b1a" open Finsupp variable {R A : Type*} [Semiring R] namespace MonoidAlgebra
Mathlib/Algebra/MonoidAlgebra/NoZeroDivisors.lean
68
79
theorem mul_apply_mul_eq_mul_of_uniqueMul [Mul A] {f g : MonoidAlgebra R A} {a0 b0 : A} (h : UniqueMul f.support g.support a0 b0) : (f * g) (a0 * b0) = f a0 * g b0 := by
classical simp_rw [mul_apply, sum, ← Finset.sum_product'] refine (Finset.sum_eq_single (a0, b0) ?_ ?_).trans (if_pos rfl) <;> simp_rw [Finset.mem_product] · refine fun ab hab hne => if_neg (fun he => hne <| Prod.ext ?_ ?_) exacts [(h hab.1 hab.2 he).1, (h hab.1 hab.2 he).2] · refine fun hnmem => ite_eq_right_iff.mpr (fun _ => ?_) rcases not_and_or.mp hnmem with af | bg · rw [not_mem_support_iff.mp af, zero_mul] · rw [not_mem_support_iff.mp bg, mul_zero]
1,692
import Mathlib.LinearAlgebra.Basis.VectorSpace import Mathlib.LinearAlgebra.Dimension.Constructions import Mathlib.LinearAlgebra.Dimension.Finite #align_import field_theory.finiteness from "leanprover-community/mathlib"@"039a089d2a4b93c761b234f3e5f5aeb752bac60f" universe u v open scoped Classical open Cardinal open Cardinal Submodule Module Function namespace IsNoetherian variable {K : Type u} {V : Type v} [DivisionRing K] [AddCommGroup V] [Module K V]
Mathlib/FieldTheory/Finiteness.lean
32
43
theorem iff_rank_lt_aleph0 : IsNoetherian K V ↔ Module.rank K V < ℵ₀ := by
let b := Basis.ofVectorSpace K V rw [← b.mk_eq_rank'', lt_aleph0_iff_set_finite] constructor · intro exact (Basis.ofVectorSpaceIndex.linearIndependent K V).set_finite_of_isNoetherian · intro hbfinite refine @isNoetherian_of_linearEquiv K (⊤ : Submodule K V) V _ _ _ _ _ (LinearEquiv.ofTop _ rfl) (id ?_) refine isNoetherian_of_fg_of_noetherian _ ⟨Set.Finite.toFinset hbfinite, ?_⟩ rw [Set.Finite.coe_toFinset, ← b.span_eq, Basis.coe_ofVectorSpace, Subtype.range_coe]
1,693
import Mathlib.LinearAlgebra.Basis.VectorSpace import Mathlib.LinearAlgebra.Dimension.Constructions import Mathlib.LinearAlgebra.Dimension.Finite #align_import field_theory.finiteness from "leanprover-community/mathlib"@"039a089d2a4b93c761b234f3e5f5aeb752bac60f" universe u v open scoped Classical open Cardinal open Cardinal Submodule Module Function namespace IsNoetherian variable {K : Type u} {V : Type v} [DivisionRing K] [AddCommGroup V] [Module K V] theorem iff_rank_lt_aleph0 : IsNoetherian K V ↔ Module.rank K V < ℵ₀ := by let b := Basis.ofVectorSpace K V rw [← b.mk_eq_rank'', lt_aleph0_iff_set_finite] constructor · intro exact (Basis.ofVectorSpaceIndex.linearIndependent K V).set_finite_of_isNoetherian · intro hbfinite refine @isNoetherian_of_linearEquiv K (⊤ : Submodule K V) V _ _ _ _ _ (LinearEquiv.ofTop _ rfl) (id ?_) refine isNoetherian_of_fg_of_noetherian _ ⟨Set.Finite.toFinset hbfinite, ?_⟩ rw [Set.Finite.coe_toFinset, ← b.span_eq, Basis.coe_ofVectorSpace, Subtype.range_coe] #align is_noetherian.iff_rank_lt_aleph_0 IsNoetherian.iff_rank_lt_aleph0 #align is_noetherian.rank_lt_aleph_0 rank_lt_aleph0 noncomputable def fintypeBasisIndex {ι : Type*} [IsNoetherian K V] (b : Basis ι K V) : Fintype ι := b.fintypeIndexOfRankLtAleph0 (rank_lt_aleph0 K V) #align is_noetherian.fintype_basis_index IsNoetherian.fintypeBasisIndex noncomputable instance [IsNoetherian K V] : Fintype (Basis.ofVectorSpaceIndex K V) := fintypeBasisIndex (Basis.ofVectorSpace K V) theorem finite_basis_index {ι : Type*} {s : Set ι} [IsNoetherian K V] (b : Basis s K V) : s.Finite := b.finite_index_of_rank_lt_aleph0 (rank_lt_aleph0 K V) #align is_noetherian.finite_basis_index IsNoetherian.finite_basis_index variable (K V) noncomputable def finsetBasisIndex [IsNoetherian K V] : Finset V := (finite_basis_index (Basis.ofVectorSpace K V)).toFinset #align is_noetherian.finset_basis_index IsNoetherian.finsetBasisIndex @[simp] theorem coe_finsetBasisIndex [IsNoetherian K V] : (↑(finsetBasisIndex K V) : Set V) = Basis.ofVectorSpaceIndex K V := Set.Finite.coe_toFinset _ #align is_noetherian.coe_finset_basis_index IsNoetherian.coe_finsetBasisIndex @[simp] theorem coeSort_finsetBasisIndex [IsNoetherian K V] : (finsetBasisIndex K V : Type _) = Basis.ofVectorSpaceIndex K V := Set.Finite.coeSort_toFinset _ #align is_noetherian.coe_sort_finset_basis_index IsNoetherian.coeSort_finsetBasisIndex noncomputable def finsetBasis [IsNoetherian K V] : Basis (finsetBasisIndex K V) K V := (Basis.ofVectorSpace K V).reindex (by rw [coeSort_finsetBasisIndex]) #align is_noetherian.finset_basis IsNoetherian.finsetBasis @[simp]
Mathlib/FieldTheory/Finiteness.lean
95
97
theorem range_finsetBasis [IsNoetherian K V] : Set.range (finsetBasis K V) = Basis.ofVectorSpaceIndex K V := by
rw [finsetBasis, Basis.range_reindex, Basis.range_ofVectorSpace]
1,693
import Mathlib.LinearAlgebra.Basis.VectorSpace import Mathlib.LinearAlgebra.Dimension.Constructions import Mathlib.LinearAlgebra.Dimension.Finite #align_import field_theory.finiteness from "leanprover-community/mathlib"@"039a089d2a4b93c761b234f3e5f5aeb752bac60f" universe u v open scoped Classical open Cardinal open Cardinal Submodule Module Function namespace IsNoetherian variable {K : Type u} {V : Type v} [DivisionRing K] [AddCommGroup V] [Module K V] theorem iff_rank_lt_aleph0 : IsNoetherian K V ↔ Module.rank K V < ℵ₀ := by let b := Basis.ofVectorSpace K V rw [← b.mk_eq_rank'', lt_aleph0_iff_set_finite] constructor · intro exact (Basis.ofVectorSpaceIndex.linearIndependent K V).set_finite_of_isNoetherian · intro hbfinite refine @isNoetherian_of_linearEquiv K (⊤ : Submodule K V) V _ _ _ _ _ (LinearEquiv.ofTop _ rfl) (id ?_) refine isNoetherian_of_fg_of_noetherian _ ⟨Set.Finite.toFinset hbfinite, ?_⟩ rw [Set.Finite.coe_toFinset, ← b.span_eq, Basis.coe_ofVectorSpace, Subtype.range_coe] #align is_noetherian.iff_rank_lt_aleph_0 IsNoetherian.iff_rank_lt_aleph0 #align is_noetherian.rank_lt_aleph_0 rank_lt_aleph0 noncomputable def fintypeBasisIndex {ι : Type*} [IsNoetherian K V] (b : Basis ι K V) : Fintype ι := b.fintypeIndexOfRankLtAleph0 (rank_lt_aleph0 K V) #align is_noetherian.fintype_basis_index IsNoetherian.fintypeBasisIndex noncomputable instance [IsNoetherian K V] : Fintype (Basis.ofVectorSpaceIndex K V) := fintypeBasisIndex (Basis.ofVectorSpace K V) theorem finite_basis_index {ι : Type*} {s : Set ι} [IsNoetherian K V] (b : Basis s K V) : s.Finite := b.finite_index_of_rank_lt_aleph0 (rank_lt_aleph0 K V) #align is_noetherian.finite_basis_index IsNoetherian.finite_basis_index variable (K V) noncomputable def finsetBasisIndex [IsNoetherian K V] : Finset V := (finite_basis_index (Basis.ofVectorSpace K V)).toFinset #align is_noetherian.finset_basis_index IsNoetherian.finsetBasisIndex @[simp] theorem coe_finsetBasisIndex [IsNoetherian K V] : (↑(finsetBasisIndex K V) : Set V) = Basis.ofVectorSpaceIndex K V := Set.Finite.coe_toFinset _ #align is_noetherian.coe_finset_basis_index IsNoetherian.coe_finsetBasisIndex @[simp] theorem coeSort_finsetBasisIndex [IsNoetherian K V] : (finsetBasisIndex K V : Type _) = Basis.ofVectorSpaceIndex K V := Set.Finite.coeSort_toFinset _ #align is_noetherian.coe_sort_finset_basis_index IsNoetherian.coeSort_finsetBasisIndex noncomputable def finsetBasis [IsNoetherian K V] : Basis (finsetBasisIndex K V) K V := (Basis.ofVectorSpace K V).reindex (by rw [coeSort_finsetBasisIndex]) #align is_noetherian.finset_basis IsNoetherian.finsetBasis @[simp] theorem range_finsetBasis [IsNoetherian K V] : Set.range (finsetBasis K V) = Basis.ofVectorSpaceIndex K V := by rw [finsetBasis, Basis.range_reindex, Basis.range_ofVectorSpace] #align is_noetherian.range_finset_basis IsNoetherian.range_finsetBasis variable {K V}
Mathlib/FieldTheory/Finiteness.lean
103
112
theorem iff_fg : IsNoetherian K V ↔ Module.Finite K V := by
constructor · intro h exact ⟨⟨finsetBasisIndex K V, by convert (finsetBasis K V).span_eq simp⟩⟩ · rintro ⟨s, hs⟩ rw [IsNoetherian.iff_rank_lt_aleph0, ← rank_top, ← hs] exact lt_of_le_of_lt (rank_span_le _) s.finite_toSet.lt_aleph0
1,693
import Mathlib.LinearAlgebra.Basis.VectorSpace import Mathlib.LinearAlgebra.Dimension.Finite import Mathlib.SetTheory.Cardinal.Subfield import Mathlib.LinearAlgebra.Dimension.RankNullity #align_import linear_algebra.dimension from "leanprover-community/mathlib"@"47a5f8186becdbc826190ced4312f8199f9db6a5" noncomputable section universe u₀ u v v' v'' u₁' w w' variable {K R : Type u} {V V₁ V₂ V₃ : Type v} {V' V'₁ : Type v'} {V'' : Type v''} variable {ι : Type w} {ι' : Type w'} {η : Type u₁'} {φ : η → Type*} open Cardinal Basis Submodule Function Set section Module section DivisionRing variable [DivisionRing K] variable [AddCommGroup V] [Module K V] variable [AddCommGroup V'] [Module K V'] variable [AddCommGroup V₁] [Module K V₁] theorem Basis.finite_ofVectorSpaceIndex_of_rank_lt_aleph0 (h : Module.rank K V < ℵ₀) : (Basis.ofVectorSpaceIndex K V).Finite := finite_def.2 <| (Basis.ofVectorSpace K V).nonempty_fintype_index_of_rank_lt_aleph0 h #align basis.finite_of_vector_space_index_of_rank_lt_aleph_0 Basis.finite_ofVectorSpaceIndex_of_rank_lt_aleph0
Mathlib/LinearAlgebra/Dimension/DivisionRing.lean
59
63
theorem rank_quotient_add_rank_of_divisionRing (p : Submodule K V) : Module.rank K (V ⧸ p) + Module.rank K p = Module.rank K V := by
classical let ⟨f⟩ := quotient_prod_linearEquiv p exact rank_prod'.symm.trans f.rank_eq
1,694
import Mathlib.LinearAlgebra.Basis.VectorSpace import Mathlib.LinearAlgebra.Dimension.Finite import Mathlib.SetTheory.Cardinal.Subfield import Mathlib.LinearAlgebra.Dimension.RankNullity #align_import linear_algebra.dimension from "leanprover-community/mathlib"@"47a5f8186becdbc826190ced4312f8199f9db6a5" noncomputable section universe u₀ u v v' v'' u₁' w w' variable {K R : Type u} {V V₁ V₂ V₃ : Type v} {V' V'₁ : Type v'} {V'' : Type v''} variable {ι : Type w} {ι' : Type w'} {η : Type u₁'} {φ : η → Type*} open Cardinal Basis Submodule Function Set section Module section DivisionRing variable [DivisionRing K] variable [AddCommGroup V] [Module K V] variable [AddCommGroup V'] [Module K V'] variable [AddCommGroup V₁] [Module K V₁] theorem Basis.finite_ofVectorSpaceIndex_of_rank_lt_aleph0 (h : Module.rank K V < ℵ₀) : (Basis.ofVectorSpaceIndex K V).Finite := finite_def.2 <| (Basis.ofVectorSpace K V).nonempty_fintype_index_of_rank_lt_aleph0 h #align basis.finite_of_vector_space_index_of_rank_lt_aleph_0 Basis.finite_ofVectorSpaceIndex_of_rank_lt_aleph0 theorem rank_quotient_add_rank_of_divisionRing (p : Submodule K V) : Module.rank K (V ⧸ p) + Module.rank K p = Module.rank K V := by classical let ⟨f⟩ := quotient_prod_linearEquiv p exact rank_prod'.symm.trans f.rank_eq instance DivisionRing.hasRankNullity : HasRankNullity.{u₀} K where rank_quotient_add_rank := rank_quotient_add_rank_of_divisionRing exists_set_linearIndependent V _ _ := by let b := Module.Free.chooseBasis K V refine ⟨range b, ?_, b.linearIndependent.to_subtype_range⟩ rw [← lift_injective.eq_iff, mk_range_eq_of_injective b.injective, Module.Free.rank_eq_card_chooseBasisIndex] section variable [AddCommGroup V₂] [Module K V₂] variable [AddCommGroup V₃] [Module K V₃] open LinearMap
Mathlib/LinearAlgebra/Dimension/DivisionRing.lean
81
108
theorem rank_add_rank_split (db : V₂ →ₗ[K] V) (eb : V₃ →ₗ[K] V) (cd : V₁ →ₗ[K] V₂) (ce : V₁ →ₗ[K] V₃) (hde : ⊤ ≤ LinearMap.range db ⊔ LinearMap.range eb) (hgd : ker cd = ⊥) (eq : db.comp cd = eb.comp ce) (eq₂ : ∀ d e, db d = eb e → ∃ c, cd c = d ∧ ce c = e) : Module.rank K V + Module.rank K V₁ = Module.rank K V₂ + Module.rank K V₃ := by
have hf : Surjective (coprod db eb) := by rwa [← range_eq_top, range_coprod, eq_top_iff] conv => rhs rw [← rank_prod', rank_eq_of_surjective hf] congr 1 apply LinearEquiv.rank_eq let L : V₁ →ₗ[K] ker (coprod db eb) := by -- Porting note: this is needed to avoid a timeout refine LinearMap.codRestrict _ (prod cd (-ce)) ?_ · intro c simp only [add_eq_zero_iff_eq_neg, LinearMap.prod_apply, mem_ker, Pi.prod, coprod_apply, neg_neg, map_neg, neg_apply] exact LinearMap.ext_iff.1 eq c refine LinearEquiv.ofBijective L ⟨?_, ?_⟩ · rw [← ker_eq_bot, ker_codRestrict, ker_prod, hgd, bot_inf_eq] · rw [← range_eq_top, eq_top_iff, range_codRestrict, ← map_le_iff_le_comap, Submodule.map_top, range_subtype] rintro ⟨d, e⟩ have h := eq₂ d (-e) simp only [add_eq_zero_iff_eq_neg, LinearMap.prod_apply, mem_ker, SetLike.mem_coe, Prod.mk.inj_iff, coprod_apply, map_neg, neg_apply, LinearMap.mem_range, Pi.prod] at h ⊢ intro hde rcases h hde with ⟨c, h₁, h₂⟩ refine ⟨c, h₁, ?_⟩ rw [h₂, _root_.neg_neg]
1,694
import Mathlib.LinearAlgebra.Basis.VectorSpace import Mathlib.LinearAlgebra.Dimension.Finite import Mathlib.SetTheory.Cardinal.Subfield import Mathlib.LinearAlgebra.Dimension.RankNullity #align_import linear_algebra.dimension from "leanprover-community/mathlib"@"47a5f8186becdbc826190ced4312f8199f9db6a5" noncomputable section universe u₀ u v v' v'' u₁' w w' variable {K R : Type u} {V V₁ V₂ V₃ : Type v} {V' V'₁ : Type v'} {V'' : Type v''} variable {ι : Type w} {ι' : Type w'} {η : Type u₁'} {φ : η → Type*} open Cardinal Basis Submodule Function Set section Module section Basis open FiniteDimensional variable [DivisionRing K] [AddCommGroup V] [Module K V]
Mathlib/LinearAlgebra/Dimension/DivisionRing.lean
123
166
theorem linearIndependent_of_top_le_span_of_card_eq_finrank {ι : Type*} [Fintype ι] {b : ι → V} (spans : ⊤ ≤ span K (Set.range b)) (card_eq : Fintype.card ι = finrank K V) : LinearIndependent K b := linearIndependent_iff'.mpr fun s g dependent i i_mem_s => by classical by_contra gx_ne_zero -- We'll derive a contradiction by showing `b '' (univ \ {i})` of cardinality `n - 1` -- spans a vector space of dimension `n`. refine not_le_of_gt (span_lt_top_of_card_lt_finrank (show (b '' (Set.univ \ {i})).toFinset.card < finrank K V from ?_)) ?_ · calc (b '' (Set.univ \ {i})).toFinset.card = ((Set.univ \ {i}).toFinset.image b).card := by
rw [Set.toFinset_card, Fintype.card_ofFinset] _ ≤ (Set.univ \ {i}).toFinset.card := Finset.card_image_le _ = (Finset.univ.erase i).card := (congr_arg Finset.card (Finset.ext (by simp [and_comm]))) _ < Finset.univ.card := Finset.card_erase_lt_of_mem (Finset.mem_univ i) _ = finrank K V := card_eq -- We already have that `b '' univ` spans the whole space, -- so we only need to show that the span of `b '' (univ \ {i})` contains each `b j`. refine spans.trans (span_le.mpr ?_) rintro _ ⟨j, rfl, rfl⟩ -- The case that `j ≠ i` is easy because `b j ∈ b '' (univ \ {i})`. by_cases j_eq : j = i swap · refine subset_span ⟨j, (Set.mem_diff _).mpr ⟨Set.mem_univ _, ?_⟩, rfl⟩ exact mt Set.mem_singleton_iff.mp j_eq -- To show `b i ∈ span (b '' (univ \ {i}))`, we use that it's a weighted sum -- of the other `b j`s. rw [j_eq, SetLike.mem_coe, show b i = -((g i)⁻¹ • (s.erase i).sum fun j => g j • b j) from _] · refine neg_mem (smul_mem _ _ (sum_mem fun k hk => ?_)) obtain ⟨k_ne_i, _⟩ := Finset.mem_erase.mp hk refine smul_mem _ _ (subset_span ⟨k, ?_, rfl⟩) simp_all only [Set.mem_univ, Set.mem_diff, Set.mem_singleton_iff, and_self, not_false_eq_true] -- To show `b i` is a weighted sum of the other `b j`s, we'll rewrite this sum -- to have the form of the assumption `dependent`. apply eq_neg_of_add_eq_zero_left calc (b i + (g i)⁻¹ • (s.erase i).sum fun j => g j • b j) = (g i)⁻¹ • (g i • b i + (s.erase i).sum fun j => g j • b j) := by rw [smul_add, ← mul_smul, inv_mul_cancel gx_ne_zero, one_smul] _ = (g i)⁻¹ • (0 : V) := congr_arg _ ?_ _ = 0 := smul_zero _ -- And then it's just a bit of manipulation with finite sums. rwa [← Finset.insert_erase i_mem_s, Finset.sum_insert (Finset.not_mem_erase _ _)] at dependent
1,694
import Mathlib.LinearAlgebra.Basis.VectorSpace import Mathlib.LinearAlgebra.Dimension.Finite import Mathlib.SetTheory.Cardinal.Subfield import Mathlib.LinearAlgebra.Dimension.RankNullity #align_import linear_algebra.dimension from "leanprover-community/mathlib"@"47a5f8186becdbc826190ced4312f8199f9db6a5" noncomputable section universe u₀ u v v' v'' u₁' w w' variable {K R : Type u} {V V₁ V₂ V₃ : Type v} {V' V'₁ : Type v'} {V'' : Type v''} variable {ι : Type w} {ι' : Type w'} {η : Type u₁'} {φ : η → Type*} open Cardinal Basis Submodule Function Set section Module section Basis open FiniteDimensional variable [DivisionRing K] [AddCommGroup V] [Module K V] theorem linearIndependent_of_top_le_span_of_card_eq_finrank {ι : Type*} [Fintype ι] {b : ι → V} (spans : ⊤ ≤ span K (Set.range b)) (card_eq : Fintype.card ι = finrank K V) : LinearIndependent K b := linearIndependent_iff'.mpr fun s g dependent i i_mem_s => by classical by_contra gx_ne_zero -- We'll derive a contradiction by showing `b '' (univ \ {i})` of cardinality `n - 1` -- spans a vector space of dimension `n`. refine not_le_of_gt (span_lt_top_of_card_lt_finrank (show (b '' (Set.univ \ {i})).toFinset.card < finrank K V from ?_)) ?_ · calc (b '' (Set.univ \ {i})).toFinset.card = ((Set.univ \ {i}).toFinset.image b).card := by rw [Set.toFinset_card, Fintype.card_ofFinset] _ ≤ (Set.univ \ {i}).toFinset.card := Finset.card_image_le _ = (Finset.univ.erase i).card := (congr_arg Finset.card (Finset.ext (by simp [and_comm]))) _ < Finset.univ.card := Finset.card_erase_lt_of_mem (Finset.mem_univ i) _ = finrank K V := card_eq -- We already have that `b '' univ` spans the whole space, -- so we only need to show that the span of `b '' (univ \ {i})` contains each `b j`. refine spans.trans (span_le.mpr ?_) rintro _ ⟨j, rfl, rfl⟩ -- The case that `j ≠ i` is easy because `b j ∈ b '' (univ \ {i})`. by_cases j_eq : j = i swap · refine subset_span ⟨j, (Set.mem_diff _).mpr ⟨Set.mem_univ _, ?_⟩, rfl⟩ exact mt Set.mem_singleton_iff.mp j_eq -- To show `b i ∈ span (b '' (univ \ {i}))`, we use that it's a weighted sum -- of the other `b j`s. rw [j_eq, SetLike.mem_coe, show b i = -((g i)⁻¹ • (s.erase i).sum fun j => g j • b j) from _] · refine neg_mem (smul_mem _ _ (sum_mem fun k hk => ?_)) obtain ⟨k_ne_i, _⟩ := Finset.mem_erase.mp hk refine smul_mem _ _ (subset_span ⟨k, ?_, rfl⟩) simp_all only [Set.mem_univ, Set.mem_diff, Set.mem_singleton_iff, and_self, not_false_eq_true] -- To show `b i` is a weighted sum of the other `b j`s, we'll rewrite this sum -- to have the form of the assumption `dependent`. apply eq_neg_of_add_eq_zero_left calc (b i + (g i)⁻¹ • (s.erase i).sum fun j => g j • b j) = (g i)⁻¹ • (g i • b i + (s.erase i).sum fun j => g j • b j) := by rw [smul_add, ← mul_smul, inv_mul_cancel gx_ne_zero, one_smul] _ = (g i)⁻¹ • (0 : V) := congr_arg _ ?_ _ = 0 := smul_zero _ -- And then it's just a bit of manipulation with finite sums. rwa [← Finset.insert_erase i_mem_s, Finset.sum_insert (Finset.not_mem_erase _ _)] at dependent #align linear_independent_of_top_le_span_of_card_eq_finrank linearIndependent_of_top_le_span_of_card_eq_finrank
Mathlib/LinearAlgebra/Dimension/DivisionRing.lean
171
193
theorem linearIndependent_iff_card_eq_finrank_span {ι : Type*} [Fintype ι] {b : ι → V} : LinearIndependent K b ↔ Fintype.card ι = (Set.range b).finrank K := by
constructor · intro h exact (finrank_span_eq_card h).symm · intro hc let f := Submodule.subtype (span K (Set.range b)) let b' : ι → span K (Set.range b) := fun i => ⟨b i, mem_span.2 fun p hp => hp (Set.mem_range_self _)⟩ have hs : ⊤ ≤ span K (Set.range b') := by intro x have h : span K (f '' Set.range b') = map f (span K (Set.range b')) := span_image f have hf : f '' Set.range b' = Set.range b := by ext x simp [f, Set.mem_image, Set.mem_range] rw [hf] at h have hx : (x : V) ∈ span K (Set.range b) := x.property conv at hx => arg 2 rw [h] simpa [f, mem_map] using hx have hi : LinearMap.ker f = ⊥ := ker_subtype _ convert (linearIndependent_of_top_le_span_of_card_eq_finrank hs hc).map' _ hi
1,694
import Mathlib.LinearAlgebra.Basis.VectorSpace import Mathlib.LinearAlgebra.Dimension.Finite import Mathlib.SetTheory.Cardinal.Subfield import Mathlib.LinearAlgebra.Dimension.RankNullity #align_import linear_algebra.dimension from "leanprover-community/mathlib"@"47a5f8186becdbc826190ced4312f8199f9db6a5" noncomputable section universe u₀ u v v' v'' u₁' w w' variable {K R : Type u} {V V₁ V₂ V₃ : Type v} {V' V'₁ : Type v'} {V'' : Type v''} variable {ι : Type w} {ι' : Type w'} {η : Type u₁'} {φ : η → Type*} open Cardinal Basis Submodule Function Set section Module section Basis open FiniteDimensional variable [DivisionRing K] [AddCommGroup V] [Module K V] theorem linearIndependent_of_top_le_span_of_card_eq_finrank {ι : Type*} [Fintype ι] {b : ι → V} (spans : ⊤ ≤ span K (Set.range b)) (card_eq : Fintype.card ι = finrank K V) : LinearIndependent K b := linearIndependent_iff'.mpr fun s g dependent i i_mem_s => by classical by_contra gx_ne_zero -- We'll derive a contradiction by showing `b '' (univ \ {i})` of cardinality `n - 1` -- spans a vector space of dimension `n`. refine not_le_of_gt (span_lt_top_of_card_lt_finrank (show (b '' (Set.univ \ {i})).toFinset.card < finrank K V from ?_)) ?_ · calc (b '' (Set.univ \ {i})).toFinset.card = ((Set.univ \ {i}).toFinset.image b).card := by rw [Set.toFinset_card, Fintype.card_ofFinset] _ ≤ (Set.univ \ {i}).toFinset.card := Finset.card_image_le _ = (Finset.univ.erase i).card := (congr_arg Finset.card (Finset.ext (by simp [and_comm]))) _ < Finset.univ.card := Finset.card_erase_lt_of_mem (Finset.mem_univ i) _ = finrank K V := card_eq -- We already have that `b '' univ` spans the whole space, -- so we only need to show that the span of `b '' (univ \ {i})` contains each `b j`. refine spans.trans (span_le.mpr ?_) rintro _ ⟨j, rfl, rfl⟩ -- The case that `j ≠ i` is easy because `b j ∈ b '' (univ \ {i})`. by_cases j_eq : j = i swap · refine subset_span ⟨j, (Set.mem_diff _).mpr ⟨Set.mem_univ _, ?_⟩, rfl⟩ exact mt Set.mem_singleton_iff.mp j_eq -- To show `b i ∈ span (b '' (univ \ {i}))`, we use that it's a weighted sum -- of the other `b j`s. rw [j_eq, SetLike.mem_coe, show b i = -((g i)⁻¹ • (s.erase i).sum fun j => g j • b j) from _] · refine neg_mem (smul_mem _ _ (sum_mem fun k hk => ?_)) obtain ⟨k_ne_i, _⟩ := Finset.mem_erase.mp hk refine smul_mem _ _ (subset_span ⟨k, ?_, rfl⟩) simp_all only [Set.mem_univ, Set.mem_diff, Set.mem_singleton_iff, and_self, not_false_eq_true] -- To show `b i` is a weighted sum of the other `b j`s, we'll rewrite this sum -- to have the form of the assumption `dependent`. apply eq_neg_of_add_eq_zero_left calc (b i + (g i)⁻¹ • (s.erase i).sum fun j => g j • b j) = (g i)⁻¹ • (g i • b i + (s.erase i).sum fun j => g j • b j) := by rw [smul_add, ← mul_smul, inv_mul_cancel gx_ne_zero, one_smul] _ = (g i)⁻¹ • (0 : V) := congr_arg _ ?_ _ = 0 := smul_zero _ -- And then it's just a bit of manipulation with finite sums. rwa [← Finset.insert_erase i_mem_s, Finset.sum_insert (Finset.not_mem_erase _ _)] at dependent #align linear_independent_of_top_le_span_of_card_eq_finrank linearIndependent_of_top_le_span_of_card_eq_finrank theorem linearIndependent_iff_card_eq_finrank_span {ι : Type*} [Fintype ι] {b : ι → V} : LinearIndependent K b ↔ Fintype.card ι = (Set.range b).finrank K := by constructor · intro h exact (finrank_span_eq_card h).symm · intro hc let f := Submodule.subtype (span K (Set.range b)) let b' : ι → span K (Set.range b) := fun i => ⟨b i, mem_span.2 fun p hp => hp (Set.mem_range_self _)⟩ have hs : ⊤ ≤ span K (Set.range b') := by intro x have h : span K (f '' Set.range b') = map f (span K (Set.range b')) := span_image f have hf : f '' Set.range b' = Set.range b := by ext x simp [f, Set.mem_image, Set.mem_range] rw [hf] at h have hx : (x : V) ∈ span K (Set.range b) := x.property conv at hx => arg 2 rw [h] simpa [f, mem_map] using hx have hi : LinearMap.ker f = ⊥ := ker_subtype _ convert (linearIndependent_of_top_le_span_of_card_eq_finrank hs hc).map' _ hi #align linear_independent_iff_card_eq_finrank_span linearIndependent_iff_card_eq_finrank_span
Mathlib/LinearAlgebra/Dimension/DivisionRing.lean
196
198
theorem linearIndependent_iff_card_le_finrank_span {ι : Type*} [Fintype ι] {b : ι → V} : LinearIndependent K b ↔ Fintype.card ι ≤ (Set.range b).finrank K := by
rw [linearIndependent_iff_card_eq_finrank_span, (finrank_range_le_card _).le_iff_eq]
1,694
import Mathlib.LinearAlgebra.Basis.VectorSpace import Mathlib.LinearAlgebra.Dimension.Finite import Mathlib.SetTheory.Cardinal.Subfield import Mathlib.LinearAlgebra.Dimension.RankNullity #align_import linear_algebra.dimension from "leanprover-community/mathlib"@"47a5f8186becdbc826190ced4312f8199f9db6a5" noncomputable section universe u₀ u v v' v'' u₁' w w' variable {K R : Type u} {V V₁ V₂ V₃ : Type v} {V' V'₁ : Type v'} {V'' : Type v''} variable {ι : Type w} {ι' : Type w'} {η : Type u₁'} {φ : η → Type*} open Cardinal Basis Submodule Function Set section Module section Cardinal variable (K) variable [DivisionRing K]
Mathlib/LinearAlgebra/Dimension/DivisionRing.lean
239
283
theorem max_aleph0_card_le_rank_fun_nat : max ℵ₀ #K ≤ Module.rank K (ℕ → K) := by
have aleph0_le : ℵ₀ ≤ Module.rank K (ℕ → K) := (rank_finsupp_self K ℕ).symm.trans_le (Finsupp.lcoeFun.rank_le_of_injective <| by exact DFunLike.coe_injective) refine max_le aleph0_le ?_ obtain card_K | card_K := le_or_lt #K ℵ₀ · exact card_K.trans aleph0_le by_contra! obtain ⟨⟨ιK, bK⟩⟩ := Module.Free.exists_basis (R := K) (M := ℕ → K) let L := Subfield.closure (Set.range (fun i : ιK × ℕ ↦ bK i.1 i.2)) have hLK : #L < #K := by refine (Subfield.cardinal_mk_closure_le_max _).trans_lt (max_lt_iff.mpr ⟨mk_range_le.trans_lt ?_, card_K⟩) rwa [mk_prod, ← aleph0, lift_uzero, bK.mk_eq_rank'', mul_aleph0_eq aleph0_le] letI := Module.compHom K (RingHom.op L.subtype) obtain ⟨⟨ιL, bL⟩⟩ := Module.Free.exists_basis (R := Lᵐᵒᵖ) (M := K) have card_ιL : ℵ₀ ≤ #ιL := by contrapose! hLK haveI := @Fintype.ofFinite _ (lt_aleph0_iff_finite.mp hLK) rw [bL.repr.toEquiv.cardinal_eq, mk_finsupp_of_fintype, ← MulOpposite.opEquiv.cardinal_eq] at card_K ⊢ apply power_nat_le contrapose! card_K exact (power_lt_aleph0 card_K <| nat_lt_aleph0 _).le obtain ⟨e⟩ := lift_mk_le'.mp (card_ιL.trans_eq (lift_uzero #ιL).symm) have rep_e := bK.total_repr (bL ∘ e) rw [Finsupp.total_apply, Finsupp.sum] at rep_e set c := bK.repr (bL ∘ e) set s := c.support let f i (j : s) : L := ⟨bK j i, Subfield.subset_closure ⟨(j, i), rfl⟩⟩ have : ¬LinearIndependent Lᵐᵒᵖ f := fun h ↦ by have := h.cardinal_lift_le_rank rw [lift_uzero, (LinearEquiv.piCongrRight fun _ ↦ MulOpposite.opLinearEquiv Lᵐᵒᵖ).rank_eq, rank_fun'] at this exact (nat_lt_aleph0 _).not_le this obtain ⟨t, g, eq0, i, hi, hgi⟩ := not_linearIndependent_iff.mp this refine hgi (linearIndependent_iff'.mp (bL.linearIndependent.comp e e.injective) t g ?_ i hi) clear_value c s simp_rw [← rep_e, Finset.sum_apply, Pi.smul_apply, Finset.smul_sum] rw [Finset.sum_comm] refine Finset.sum_eq_zero fun i hi ↦ ?_ replace eq0 := congr_arg L.subtype (congr_fun eq0 ⟨i, hi⟩) rw [Finset.sum_apply, map_sum] at eq0 have : SMulCommClass Lᵐᵒᵖ K K := ⟨fun _ _ _ ↦ mul_assoc _ _ _⟩ simp_rw [smul_comm _ (c i), ← Finset.smul_sum] erw [eq0, smul_zero]
1,694
import Mathlib.LinearAlgebra.Basis.VectorSpace import Mathlib.LinearAlgebra.Dimension.Finite import Mathlib.SetTheory.Cardinal.Subfield import Mathlib.LinearAlgebra.Dimension.RankNullity #align_import linear_algebra.dimension from "leanprover-community/mathlib"@"47a5f8186becdbc826190ced4312f8199f9db6a5" noncomputable section universe u₀ u v v' v'' u₁' w w' variable {K R : Type u} {V V₁ V₂ V₃ : Type v} {V' V'₁ : Type v'} {V'' : Type v''} variable {ι : Type w} {ι' : Type w'} {η : Type u₁'} {φ : η → Type*} open Cardinal Basis Submodule Function Set section Module section Cardinal variable (K) variable [DivisionRing K] theorem max_aleph0_card_le_rank_fun_nat : max ℵ₀ #K ≤ Module.rank K (ℕ → K) := by have aleph0_le : ℵ₀ ≤ Module.rank K (ℕ → K) := (rank_finsupp_self K ℕ).symm.trans_le (Finsupp.lcoeFun.rank_le_of_injective <| by exact DFunLike.coe_injective) refine max_le aleph0_le ?_ obtain card_K | card_K := le_or_lt #K ℵ₀ · exact card_K.trans aleph0_le by_contra! obtain ⟨⟨ιK, bK⟩⟩ := Module.Free.exists_basis (R := K) (M := ℕ → K) let L := Subfield.closure (Set.range (fun i : ιK × ℕ ↦ bK i.1 i.2)) have hLK : #L < #K := by refine (Subfield.cardinal_mk_closure_le_max _).trans_lt (max_lt_iff.mpr ⟨mk_range_le.trans_lt ?_, card_K⟩) rwa [mk_prod, ← aleph0, lift_uzero, bK.mk_eq_rank'', mul_aleph0_eq aleph0_le] letI := Module.compHom K (RingHom.op L.subtype) obtain ⟨⟨ιL, bL⟩⟩ := Module.Free.exists_basis (R := Lᵐᵒᵖ) (M := K) have card_ιL : ℵ₀ ≤ #ιL := by contrapose! hLK haveI := @Fintype.ofFinite _ (lt_aleph0_iff_finite.mp hLK) rw [bL.repr.toEquiv.cardinal_eq, mk_finsupp_of_fintype, ← MulOpposite.opEquiv.cardinal_eq] at card_K ⊢ apply power_nat_le contrapose! card_K exact (power_lt_aleph0 card_K <| nat_lt_aleph0 _).le obtain ⟨e⟩ := lift_mk_le'.mp (card_ιL.trans_eq (lift_uzero #ιL).symm) have rep_e := bK.total_repr (bL ∘ e) rw [Finsupp.total_apply, Finsupp.sum] at rep_e set c := bK.repr (bL ∘ e) set s := c.support let f i (j : s) : L := ⟨bK j i, Subfield.subset_closure ⟨(j, i), rfl⟩⟩ have : ¬LinearIndependent Lᵐᵒᵖ f := fun h ↦ by have := h.cardinal_lift_le_rank rw [lift_uzero, (LinearEquiv.piCongrRight fun _ ↦ MulOpposite.opLinearEquiv Lᵐᵒᵖ).rank_eq, rank_fun'] at this exact (nat_lt_aleph0 _).not_le this obtain ⟨t, g, eq0, i, hi, hgi⟩ := not_linearIndependent_iff.mp this refine hgi (linearIndependent_iff'.mp (bL.linearIndependent.comp e e.injective) t g ?_ i hi) clear_value c s simp_rw [← rep_e, Finset.sum_apply, Pi.smul_apply, Finset.smul_sum] rw [Finset.sum_comm] refine Finset.sum_eq_zero fun i hi ↦ ?_ replace eq0 := congr_arg L.subtype (congr_fun eq0 ⟨i, hi⟩) rw [Finset.sum_apply, map_sum] at eq0 have : SMulCommClass Lᵐᵒᵖ K K := ⟨fun _ _ _ ↦ mul_assoc _ _ _⟩ simp_rw [smul_comm _ (c i), ← Finset.smul_sum] erw [eq0, smul_zero] variable {K} open Function in
Mathlib/LinearAlgebra/Dimension/DivisionRing.lean
288
300
theorem rank_fun_infinite {ι : Type v} [hι : Infinite ι] : Module.rank K (ι → K) = #(ι → K) := by
obtain ⟨⟨ιK, bK⟩⟩ := Module.Free.exists_basis (R := K) (M := ι → K) obtain ⟨e⟩ := lift_mk_le'.mp ((aleph0_le_mk_iff.mpr hι).trans_eq (lift_uzero #ι).symm) have := LinearMap.lift_rank_le_of_injective _ <| LinearMap.funLeft_injective_of_surjective K K _ (invFun_surjective e.injective) rw [lift_umax.{u,v}, lift_id'.{u,v}] at this have key := (lift_le.{v}.mpr <| max_aleph0_card_le_rank_fun_nat K).trans this rw [lift_max, lift_aleph0, max_le_iff] at key haveI : Infinite ιK := by rw [← aleph0_le_mk_iff, bK.mk_eq_rank'']; exact key.1 rw [bK.repr.toEquiv.cardinal_eq, mk_finsupp_lift_of_infinite, lift_umax.{u,v}, lift_id'.{u,v}, bK.mk_eq_rank'', eq_comm, max_eq_left] exact key.2
1,694
import Mathlib.LinearAlgebra.Basis.VectorSpace import Mathlib.LinearAlgebra.Dimension.Finite import Mathlib.SetTheory.Cardinal.Subfield import Mathlib.LinearAlgebra.Dimension.RankNullity #align_import linear_algebra.dimension from "leanprover-community/mathlib"@"47a5f8186becdbc826190ced4312f8199f9db6a5" noncomputable section universe u₀ u v v' v'' u₁' w w' variable {K R : Type u} {V V₁ V₂ V₃ : Type v} {V' V'₁ : Type v'} {V'' : Type v''} variable {ι : Type w} {ι' : Type w'} {η : Type u₁'} {φ : η → Type*} open Cardinal Basis Submodule Function Set section Module section Cardinal variable (K) variable [DivisionRing K] theorem max_aleph0_card_le_rank_fun_nat : max ℵ₀ #K ≤ Module.rank K (ℕ → K) := by have aleph0_le : ℵ₀ ≤ Module.rank K (ℕ → K) := (rank_finsupp_self K ℕ).symm.trans_le (Finsupp.lcoeFun.rank_le_of_injective <| by exact DFunLike.coe_injective) refine max_le aleph0_le ?_ obtain card_K | card_K := le_or_lt #K ℵ₀ · exact card_K.trans aleph0_le by_contra! obtain ⟨⟨ιK, bK⟩⟩ := Module.Free.exists_basis (R := K) (M := ℕ → K) let L := Subfield.closure (Set.range (fun i : ιK × ℕ ↦ bK i.1 i.2)) have hLK : #L < #K := by refine (Subfield.cardinal_mk_closure_le_max _).trans_lt (max_lt_iff.mpr ⟨mk_range_le.trans_lt ?_, card_K⟩) rwa [mk_prod, ← aleph0, lift_uzero, bK.mk_eq_rank'', mul_aleph0_eq aleph0_le] letI := Module.compHom K (RingHom.op L.subtype) obtain ⟨⟨ιL, bL⟩⟩ := Module.Free.exists_basis (R := Lᵐᵒᵖ) (M := K) have card_ιL : ℵ₀ ≤ #ιL := by contrapose! hLK haveI := @Fintype.ofFinite _ (lt_aleph0_iff_finite.mp hLK) rw [bL.repr.toEquiv.cardinal_eq, mk_finsupp_of_fintype, ← MulOpposite.opEquiv.cardinal_eq] at card_K ⊢ apply power_nat_le contrapose! card_K exact (power_lt_aleph0 card_K <| nat_lt_aleph0 _).le obtain ⟨e⟩ := lift_mk_le'.mp (card_ιL.trans_eq (lift_uzero #ιL).symm) have rep_e := bK.total_repr (bL ∘ e) rw [Finsupp.total_apply, Finsupp.sum] at rep_e set c := bK.repr (bL ∘ e) set s := c.support let f i (j : s) : L := ⟨bK j i, Subfield.subset_closure ⟨(j, i), rfl⟩⟩ have : ¬LinearIndependent Lᵐᵒᵖ f := fun h ↦ by have := h.cardinal_lift_le_rank rw [lift_uzero, (LinearEquiv.piCongrRight fun _ ↦ MulOpposite.opLinearEquiv Lᵐᵒᵖ).rank_eq, rank_fun'] at this exact (nat_lt_aleph0 _).not_le this obtain ⟨t, g, eq0, i, hi, hgi⟩ := not_linearIndependent_iff.mp this refine hgi (linearIndependent_iff'.mp (bL.linearIndependent.comp e e.injective) t g ?_ i hi) clear_value c s simp_rw [← rep_e, Finset.sum_apply, Pi.smul_apply, Finset.smul_sum] rw [Finset.sum_comm] refine Finset.sum_eq_zero fun i hi ↦ ?_ replace eq0 := congr_arg L.subtype (congr_fun eq0 ⟨i, hi⟩) rw [Finset.sum_apply, map_sum] at eq0 have : SMulCommClass Lᵐᵒᵖ K K := ⟨fun _ _ _ ↦ mul_assoc _ _ _⟩ simp_rw [smul_comm _ (c i), ← Finset.smul_sum] erw [eq0, smul_zero] variable {K} open Function in theorem rank_fun_infinite {ι : Type v} [hι : Infinite ι] : Module.rank K (ι → K) = #(ι → K) := by obtain ⟨⟨ιK, bK⟩⟩ := Module.Free.exists_basis (R := K) (M := ι → K) obtain ⟨e⟩ := lift_mk_le'.mp ((aleph0_le_mk_iff.mpr hι).trans_eq (lift_uzero #ι).symm) have := LinearMap.lift_rank_le_of_injective _ <| LinearMap.funLeft_injective_of_surjective K K _ (invFun_surjective e.injective) rw [lift_umax.{u,v}, lift_id'.{u,v}] at this have key := (lift_le.{v}.mpr <| max_aleph0_card_le_rank_fun_nat K).trans this rw [lift_max, lift_aleph0, max_le_iff] at key haveI : Infinite ιK := by rw [← aleph0_le_mk_iff, bK.mk_eq_rank'']; exact key.1 rw [bK.repr.toEquiv.cardinal_eq, mk_finsupp_lift_of_infinite, lift_umax.{u,v}, lift_id'.{u,v}, bK.mk_eq_rank'', eq_comm, max_eq_left] exact key.2
Mathlib/LinearAlgebra/Dimension/DivisionRing.lean
304
311
theorem rank_dual_eq_card_dual_of_aleph0_le_rank' {V : Type*} [AddCommGroup V] [Module K V] (h : ℵ₀ ≤ Module.rank K V) : Module.rank Kᵐᵒᵖ (V →ₗ[K] K) = #(V →ₗ[K] K) := by
obtain ⟨⟨ι, b⟩⟩ := Module.Free.exists_basis (R := K) (M := V) rw [← b.mk_eq_rank'', aleph0_le_mk_iff] at h have e := (b.constr Kᵐᵒᵖ (M' := K)).symm.trans (LinearEquiv.piCongrRight fun _ ↦ MulOpposite.opLinearEquiv Kᵐᵒᵖ) rw [e.rank_eq, e.toEquiv.cardinal_eq] apply rank_fun_infinite
1,694
import Mathlib.FieldTheory.Finiteness import Mathlib.LinearAlgebra.Dimension.FreeAndStrongRankCondition import Mathlib.LinearAlgebra.Dimension.DivisionRing #align_import linear_algebra.finite_dimensional from "leanprover-community/mathlib"@"e95e4f92c8f8da3c7f693c3ec948bcf9b6683f51" universe u v v' w open Cardinal Submodule Module Function abbrev FiniteDimensional (K V : Type*) [DivisionRing K] [AddCommGroup V] [Module K V] := Module.Finite K V #align finite_dimensional FiniteDimensional variable {K : Type u} {V : Type v} namespace FiniteDimensional open IsNoetherian section DivisionRing variable [DivisionRing K] [AddCommGroup V] [Module K V] {V₂ : Type v'} [AddCommGroup V₂] [Module K V₂] theorem of_injective (f : V →ₗ[K] V₂) (w : Function.Injective f) [FiniteDimensional K V₂] : FiniteDimensional K V := have : IsNoetherian K V₂ := IsNoetherian.iff_fg.mpr ‹_› Module.Finite.of_injective f w #align finite_dimensional.of_injective FiniteDimensional.of_injective theorem of_surjective (f : V →ₗ[K] V₂) (w : Function.Surjective f) [FiniteDimensional K V] : FiniteDimensional K V₂ := Module.Finite.of_surjective f w #align finite_dimensional.of_surjective FiniteDimensional.of_surjective variable (K V) instance finiteDimensional_pi {ι : Type*} [Finite ι] : FiniteDimensional K (ι → K) := Finite.pi #align finite_dimensional.finite_dimensional_pi FiniteDimensional.finiteDimensional_pi instance finiteDimensional_pi' {ι : Type*} [Finite ι] (M : ι → Type*) [∀ i, AddCommGroup (M i)] [∀ i, Module K (M i)] [∀ i, FiniteDimensional K (M i)] : FiniteDimensional K (∀ i, M i) := Finite.pi #align finite_dimensional.finite_dimensional_pi' FiniteDimensional.finiteDimensional_pi' noncomputable def fintypeOfFintype [Fintype K] [FiniteDimensional K V] : Fintype V := Module.fintypeOfFintype (@finsetBasis K V _ _ _ (iff_fg.2 inferInstance)) #align finite_dimensional.fintype_of_fintype FiniteDimensional.fintypeOfFintype
Mathlib/LinearAlgebra/FiniteDimensional.lean
123
126
theorem finite_of_finite [Finite K] [FiniteDimensional K V] : Finite V := by
cases nonempty_fintype K haveI := fintypeOfFintype K V infer_instance
1,695
import Mathlib.LinearAlgebra.FiniteDimensional #align_import linear_algebra.projective_space.basic from "leanprover-community/mathlib"@"c4658a649d216f57e99621708b09dcb3dcccbd23" variable (K V : Type*) [DivisionRing K] [AddCommGroup V] [Module K V] def projectivizationSetoid : Setoid { v : V // v ≠ 0 } := (MulAction.orbitRel Kˣ V).comap (↑) #align projectivization_setoid projectivizationSetoid def Projectivization := Quotient (projectivizationSetoid K V) #align projectivization Projectivization scoped[LinearAlgebra.Projectivization] notation "ℙ" => Projectivization namespace Projectivization open scoped LinearAlgebra.Projectivization variable {V} def mk (v : V) (hv : v ≠ 0) : ℙ K V := Quotient.mk'' ⟨v, hv⟩ #align projectivization.mk Projectivization.mk def mk' (v : { v : V // v ≠ 0 }) : ℙ K V := Quotient.mk'' v #align projectivization.mk' Projectivization.mk' @[simp] theorem mk'_eq_mk (v : { v : V // v ≠ 0 }) : mk' K v = mk K ↑v v.2 := rfl #align projectivization.mk'_eq_mk Projectivization.mk'_eq_mk instance [Nontrivial V] : Nonempty (ℙ K V) := let ⟨v, hv⟩ := exists_ne (0 : V) ⟨mk K v hv⟩ variable {K} protected noncomputable def rep (v : ℙ K V) : V := v.out' #align projectivization.rep Projectivization.rep theorem rep_nonzero (v : ℙ K V) : v.rep ≠ 0 := v.out'.2 #align projectivization.rep_nonzero Projectivization.rep_nonzero @[simp] theorem mk_rep (v : ℙ K V) : mk K v.rep v.rep_nonzero = v := Quotient.out_eq' _ #align projectivization.mk_rep Projectivization.mk_rep open FiniteDimensional protected def submodule (v : ℙ K V) : Submodule K V := (Quotient.liftOn' v fun v => K ∙ (v : V)) <| by rintro ⟨a, ha⟩ ⟨b, hb⟩ ⟨x, rfl : x • b = a⟩ exact Submodule.span_singleton_group_smul_eq _ x _ #align projectivization.submodule Projectivization.submodule variable (K) theorem mk_eq_mk_iff (v w : V) (hv : v ≠ 0) (hw : w ≠ 0) : mk K v hv = mk K w hw ↔ ∃ a : Kˣ, a • w = v := Quotient.eq'' #align projectivization.mk_eq_mk_iff Projectivization.mk_eq_mk_iff
Mathlib/LinearAlgebra/Projectivization/Basic.lean
108
116
theorem mk_eq_mk_iff' (v w : V) (hv : v ≠ 0) (hw : w ≠ 0) : mk K v hv = mk K w hw ↔ ∃ a : K, a • w = v := by
rw [mk_eq_mk_iff K v w hv hw] constructor · rintro ⟨a, ha⟩ exact ⟨a, ha⟩ · rintro ⟨a, ha⟩ refine ⟨Units.mk0 a fun c => hv.symm ?_, ha⟩ rwa [c, zero_smul] at ha
1,696
import Mathlib.LinearAlgebra.FiniteDimensional #align_import linear_algebra.projective_space.basic from "leanprover-community/mathlib"@"c4658a649d216f57e99621708b09dcb3dcccbd23" variable (K V : Type*) [DivisionRing K] [AddCommGroup V] [Module K V] def projectivizationSetoid : Setoid { v : V // v ≠ 0 } := (MulAction.orbitRel Kˣ V).comap (↑) #align projectivization_setoid projectivizationSetoid def Projectivization := Quotient (projectivizationSetoid K V) #align projectivization Projectivization scoped[LinearAlgebra.Projectivization] notation "ℙ" => Projectivization namespace Projectivization open scoped LinearAlgebra.Projectivization variable {V} def mk (v : V) (hv : v ≠ 0) : ℙ K V := Quotient.mk'' ⟨v, hv⟩ #align projectivization.mk Projectivization.mk def mk' (v : { v : V // v ≠ 0 }) : ℙ K V := Quotient.mk'' v #align projectivization.mk' Projectivization.mk' @[simp] theorem mk'_eq_mk (v : { v : V // v ≠ 0 }) : mk' K v = mk K ↑v v.2 := rfl #align projectivization.mk'_eq_mk Projectivization.mk'_eq_mk instance [Nontrivial V] : Nonempty (ℙ K V) := let ⟨v, hv⟩ := exists_ne (0 : V) ⟨mk K v hv⟩ variable {K} protected noncomputable def rep (v : ℙ K V) : V := v.out' #align projectivization.rep Projectivization.rep theorem rep_nonzero (v : ℙ K V) : v.rep ≠ 0 := v.out'.2 #align projectivization.rep_nonzero Projectivization.rep_nonzero @[simp] theorem mk_rep (v : ℙ K V) : mk K v.rep v.rep_nonzero = v := Quotient.out_eq' _ #align projectivization.mk_rep Projectivization.mk_rep open FiniteDimensional protected def submodule (v : ℙ K V) : Submodule K V := (Quotient.liftOn' v fun v => K ∙ (v : V)) <| by rintro ⟨a, ha⟩ ⟨b, hb⟩ ⟨x, rfl : x • b = a⟩ exact Submodule.span_singleton_group_smul_eq _ x _ #align projectivization.submodule Projectivization.submodule variable (K) theorem mk_eq_mk_iff (v w : V) (hv : v ≠ 0) (hw : w ≠ 0) : mk K v hv = mk K w hw ↔ ∃ a : Kˣ, a • w = v := Quotient.eq'' #align projectivization.mk_eq_mk_iff Projectivization.mk_eq_mk_iff theorem mk_eq_mk_iff' (v w : V) (hv : v ≠ 0) (hw : w ≠ 0) : mk K v hv = mk K w hw ↔ ∃ a : K, a • w = v := by rw [mk_eq_mk_iff K v w hv hw] constructor · rintro ⟨a, ha⟩ exact ⟨a, ha⟩ · rintro ⟨a, ha⟩ refine ⟨Units.mk0 a fun c => hv.symm ?_, ha⟩ rwa [c, zero_smul] at ha #align projectivization.mk_eq_mk_iff' Projectivization.mk_eq_mk_iff' theorem exists_smul_eq_mk_rep (v : V) (hv : v ≠ 0) : ∃ a : Kˣ, a • v = (mk K v hv).rep := (mk_eq_mk_iff K _ _ (rep_nonzero _) hv).1 (mk_rep _) #align projectivization.exists_smul_eq_mk_rep Projectivization.exists_smul_eq_mk_rep variable {K} @[elab_as_elim] theorem ind {P : ℙ K V → Prop} (h : ∀ (v : V) (h : v ≠ 0), P (mk K v h)) : ∀ p, P p := Quotient.ind' <| Subtype.rec <| h #align projectivization.ind Projectivization.ind @[simp] theorem submodule_mk (v : V) (hv : v ≠ 0) : (mk K v hv).submodule = K ∙ v := rfl #align projectivization.submodule_mk Projectivization.submodule_mk
Mathlib/LinearAlgebra/Projectivization/Basic.lean
137
139
theorem submodule_eq (v : ℙ K V) : v.submodule = K ∙ v.rep := by
conv_lhs => rw [← v.mk_rep] rfl
1,696
import Mathlib.LinearAlgebra.FiniteDimensional #align_import linear_algebra.projective_space.basic from "leanprover-community/mathlib"@"c4658a649d216f57e99621708b09dcb3dcccbd23" variable (K V : Type*) [DivisionRing K] [AddCommGroup V] [Module K V] def projectivizationSetoid : Setoid { v : V // v ≠ 0 } := (MulAction.orbitRel Kˣ V).comap (↑) #align projectivization_setoid projectivizationSetoid def Projectivization := Quotient (projectivizationSetoid K V) #align projectivization Projectivization scoped[LinearAlgebra.Projectivization] notation "ℙ" => Projectivization namespace Projectivization open scoped LinearAlgebra.Projectivization variable {V} def mk (v : V) (hv : v ≠ 0) : ℙ K V := Quotient.mk'' ⟨v, hv⟩ #align projectivization.mk Projectivization.mk def mk' (v : { v : V // v ≠ 0 }) : ℙ K V := Quotient.mk'' v #align projectivization.mk' Projectivization.mk' @[simp] theorem mk'_eq_mk (v : { v : V // v ≠ 0 }) : mk' K v = mk K ↑v v.2 := rfl #align projectivization.mk'_eq_mk Projectivization.mk'_eq_mk instance [Nontrivial V] : Nonempty (ℙ K V) := let ⟨v, hv⟩ := exists_ne (0 : V) ⟨mk K v hv⟩ variable {K} protected noncomputable def rep (v : ℙ K V) : V := v.out' #align projectivization.rep Projectivization.rep theorem rep_nonzero (v : ℙ K V) : v.rep ≠ 0 := v.out'.2 #align projectivization.rep_nonzero Projectivization.rep_nonzero @[simp] theorem mk_rep (v : ℙ K V) : mk K v.rep v.rep_nonzero = v := Quotient.out_eq' _ #align projectivization.mk_rep Projectivization.mk_rep open FiniteDimensional protected def submodule (v : ℙ K V) : Submodule K V := (Quotient.liftOn' v fun v => K ∙ (v : V)) <| by rintro ⟨a, ha⟩ ⟨b, hb⟩ ⟨x, rfl : x • b = a⟩ exact Submodule.span_singleton_group_smul_eq _ x _ #align projectivization.submodule Projectivization.submodule variable (K) theorem mk_eq_mk_iff (v w : V) (hv : v ≠ 0) (hw : w ≠ 0) : mk K v hv = mk K w hw ↔ ∃ a : Kˣ, a • w = v := Quotient.eq'' #align projectivization.mk_eq_mk_iff Projectivization.mk_eq_mk_iff theorem mk_eq_mk_iff' (v w : V) (hv : v ≠ 0) (hw : w ≠ 0) : mk K v hv = mk K w hw ↔ ∃ a : K, a • w = v := by rw [mk_eq_mk_iff K v w hv hw] constructor · rintro ⟨a, ha⟩ exact ⟨a, ha⟩ · rintro ⟨a, ha⟩ refine ⟨Units.mk0 a fun c => hv.symm ?_, ha⟩ rwa [c, zero_smul] at ha #align projectivization.mk_eq_mk_iff' Projectivization.mk_eq_mk_iff' theorem exists_smul_eq_mk_rep (v : V) (hv : v ≠ 0) : ∃ a : Kˣ, a • v = (mk K v hv).rep := (mk_eq_mk_iff K _ _ (rep_nonzero _) hv).1 (mk_rep _) #align projectivization.exists_smul_eq_mk_rep Projectivization.exists_smul_eq_mk_rep variable {K} @[elab_as_elim] theorem ind {P : ℙ K V → Prop} (h : ∀ (v : V) (h : v ≠ 0), P (mk K v h)) : ∀ p, P p := Quotient.ind' <| Subtype.rec <| h #align projectivization.ind Projectivization.ind @[simp] theorem submodule_mk (v : V) (hv : v ≠ 0) : (mk K v hv).submodule = K ∙ v := rfl #align projectivization.submodule_mk Projectivization.submodule_mk theorem submodule_eq (v : ℙ K V) : v.submodule = K ∙ v.rep := by conv_lhs => rw [← v.mk_rep] rfl #align projectivization.submodule_eq Projectivization.submodule_eq
Mathlib/LinearAlgebra/Projectivization/Basic.lean
142
144
theorem finrank_submodule (v : ℙ K V) : finrank K v.submodule = 1 := by
rw [submodule_eq] exact finrank_span_singleton v.rep_nonzero
1,696
import Mathlib.LinearAlgebra.Projectivization.Basic #align_import linear_algebra.projective_space.subspace from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" variable (K V : Type*) [Field K] [AddCommGroup V] [Module K V] namespace Projectivization open scoped LinearAlgebra.Projectivization @[ext] structure Subspace where carrier : Set (ℙ K V) mem_add' (v w : V) (hv : v ≠ 0) (hw : w ≠ 0) (hvw : v + w ≠ 0) : mk K v hv ∈ carrier → mk K w hw ∈ carrier → mk K (v + w) hvw ∈ carrier #align projectivization.subspace Projectivization.Subspace namespace Subspace variable {K V} instance : SetLike (Subspace K V) (ℙ K V) where coe := carrier coe_injective' A B := by cases A cases B simp @[simp] theorem mem_carrier_iff (A : Subspace K V) (x : ℙ K V) : x ∈ A.carrier ↔ x ∈ A := Iff.refl _ #align projectivization.subspace.mem_carrier_iff Projectivization.Subspace.mem_carrier_iff theorem mem_add (T : Subspace K V) (v w : V) (hv : v ≠ 0) (hw : w ≠ 0) (hvw : v + w ≠ 0) : Projectivization.mk K v hv ∈ T → Projectivization.mk K w hw ∈ T → Projectivization.mk K (v + w) hvw ∈ T := T.mem_add' v w hv hw hvw #align projectivization.subspace.mem_add Projectivization.Subspace.mem_add inductive spanCarrier (S : Set (ℙ K V)) : Set (ℙ K V) | of (x : ℙ K V) (hx : x ∈ S) : spanCarrier S x | mem_add (v w : V) (hv : v ≠ 0) (hw : w ≠ 0) (hvw : v + w ≠ 0) : spanCarrier S (Projectivization.mk K v hv) → spanCarrier S (Projectivization.mk K w hw) → spanCarrier S (Projectivization.mk K (v + w) hvw) #align projectivization.subspace.span_carrier Projectivization.Subspace.spanCarrier def span (S : Set (ℙ K V)) : Subspace K V where carrier := spanCarrier S mem_add' v w hv hw hvw := spanCarrier.mem_add v w hv hw hvw #align projectivization.subspace.span Projectivization.Subspace.span theorem subset_span (S : Set (ℙ K V)) : S ⊆ span S := fun _x hx => spanCarrier.of _ hx #align projectivization.subspace.subset_span Projectivization.Subspace.subset_span def gi : GaloisInsertion (span : Set (ℙ K V) → Subspace K V) SetLike.coe where choice S _hS := span S gc A B := ⟨fun h => le_trans (subset_span _) h, by intro h x hx induction' hx with y hy · apply h assumption · apply B.mem_add assumption'⟩ le_l_u S := subset_span _ choice_eq _ _ := rfl #align projectivization.subspace.gi Projectivization.Subspace.gi @[simp] theorem span_coe (W : Subspace K V) : span ↑W = W := GaloisInsertion.l_u_eq gi W #align projectivization.subspace.span_coe Projectivization.Subspace.span_coe instance instInf : Inf (Subspace K V) := ⟨fun A B => ⟨A ⊓ B, fun _v _w hv hw _hvw h1 h2 => ⟨A.mem_add _ _ hv hw _ h1.1 h2.1, B.mem_add _ _ hv hw _ h1.2 h2.2⟩⟩⟩ #align projectivization.subspace.has_inf Projectivization.Subspace.instInf -- Porting note: delete the name of this instance since it causes problem since hasInf is already -- defined above instance instInfSet : InfSet (Subspace K V) := ⟨fun A => ⟨sInf (SetLike.coe '' A), fun v w hv hw hvw h1 h2 t => by rintro ⟨s, hs, rfl⟩ exact s.mem_add v w hv hw _ (h1 s ⟨s, hs, rfl⟩) (h2 s ⟨s, hs, rfl⟩)⟩⟩ #align projectivization.subspace.has_Inf Projectivization.Subspace.instInfSet instance : CompleteLattice (Subspace K V) := { __ := completeLatticeOfInf (Subspace K V) (by refine fun s => ⟨fun a ha x hx => hx _ ⟨a, ha, rfl⟩, fun a ha x hx E => ?_⟩ rintro ⟨E, hE, rfl⟩ exact ha hE hx) inf_le_left := fun A B _ hx => (@inf_le_left _ _ A B) hx inf_le_right := fun A B _ hx => (@inf_le_right _ _ A B) hx le_inf := fun A B _ h1 h2 _ hx => (le_inf h1 h2) hx } instance subspaceInhabited : Inhabited (Subspace K V) where default := ⊤ #align projectivization.subspace.subspace_inhabited Projectivization.Subspace.subspaceInhabited @[simp] theorem span_empty : span (∅ : Set (ℙ K V)) = ⊥ := gi.gc.l_bot #align projectivization.subspace.span_empty Projectivization.Subspace.span_empty @[simp]
Mathlib/LinearAlgebra/Projectivization/Subspace.lean
155
158
theorem span_univ : span (Set.univ : Set (ℙ K V)) = ⊤ := by
rw [eq_top_iff, SetLike.le_def] intro x _hx exact subset_span _ (Set.mem_univ x)
1,697
import Mathlib.LinearAlgebra.Projectivization.Basic #align_import linear_algebra.projective_space.independence from "leanprover-community/mathlib"@"1e82f5ec4645f6a92bb9e02fce51e44e3bc3e1fe" open scoped LinearAlgebra.Projectivization variable {ι K V : Type*} [DivisionRing K] [AddCommGroup V] [Module K V] {f : ι → ℙ K V} namespace Projectivization inductive Independent : (ι → ℙ K V) → Prop | mk (f : ι → V) (hf : ∀ i : ι, f i ≠ 0) (hl : LinearIndependent K f) : Independent fun i => mk K (f i) (hf i) #align projectivization.independent Projectivization.Independent
Mathlib/LinearAlgebra/Projectivization/Independence.lean
48
58
theorem independent_iff : Independent f ↔ LinearIndependent K (Projectivization.rep ∘ f) := by
refine ⟨?_, fun h => ?_⟩ · rintro ⟨ff, hff, hh⟩ choose a ha using fun i : ι => exists_smul_eq_mk_rep K (ff i) (hff i) convert hh.units_smul a ext i exact (ha i).symm · convert Independent.mk _ _ h · simp only [mk_rep, Function.comp_apply] · intro i apply rep_nonzero
1,698
import Mathlib.LinearAlgebra.Projectivization.Basic #align_import linear_algebra.projective_space.independence from "leanprover-community/mathlib"@"1e82f5ec4645f6a92bb9e02fce51e44e3bc3e1fe" open scoped LinearAlgebra.Projectivization variable {ι K V : Type*} [DivisionRing K] [AddCommGroup V] [Module K V] {f : ι → ℙ K V} namespace Projectivization inductive Independent : (ι → ℙ K V) → Prop | mk (f : ι → V) (hf : ∀ i : ι, f i ≠ 0) (hl : LinearIndependent K f) : Independent fun i => mk K (f i) (hf i) #align projectivization.independent Projectivization.Independent theorem independent_iff : Independent f ↔ LinearIndependent K (Projectivization.rep ∘ f) := by refine ⟨?_, fun h => ?_⟩ · rintro ⟨ff, hff, hh⟩ choose a ha using fun i : ι => exists_smul_eq_mk_rep K (ff i) (hff i) convert hh.units_smul a ext i exact (ha i).symm · convert Independent.mk _ _ h · simp only [mk_rep, Function.comp_apply] · intro i apply rep_nonzero #align projectivization.independent_iff Projectivization.independent_iff
Mathlib/LinearAlgebra/Projectivization/Independence.lean
63
72
theorem independent_iff_completeLattice_independent : Independent f ↔ CompleteLattice.Independent fun i => (f i).submodule := by
refine ⟨?_, fun h => ?_⟩ · rintro ⟨f, hf, hi⟩ simp only [submodule_mk] exact (CompleteLattice.independent_iff_linearIndependent_of_ne_zero (R := K) hf).mpr hi · rw [independent_iff] refine h.linearIndependent (Projectivization.submodule ∘ f) (fun i => ?_) fun i => ?_ · simpa only [Function.comp_apply, submodule_eq] using Submodule.mem_span_singleton_self _ · exact rep_nonzero (f i)
1,698
import Mathlib.LinearAlgebra.Projectivization.Basic #align_import linear_algebra.projective_space.independence from "leanprover-community/mathlib"@"1e82f5ec4645f6a92bb9e02fce51e44e3bc3e1fe" open scoped LinearAlgebra.Projectivization variable {ι K V : Type*} [DivisionRing K] [AddCommGroup V] [Module K V] {f : ι → ℙ K V} namespace Projectivization inductive Independent : (ι → ℙ K V) → Prop | mk (f : ι → V) (hf : ∀ i : ι, f i ≠ 0) (hl : LinearIndependent K f) : Independent fun i => mk K (f i) (hf i) #align projectivization.independent Projectivization.Independent theorem independent_iff : Independent f ↔ LinearIndependent K (Projectivization.rep ∘ f) := by refine ⟨?_, fun h => ?_⟩ · rintro ⟨ff, hff, hh⟩ choose a ha using fun i : ι => exists_smul_eq_mk_rep K (ff i) (hff i) convert hh.units_smul a ext i exact (ha i).symm · convert Independent.mk _ _ h · simp only [mk_rep, Function.comp_apply] · intro i apply rep_nonzero #align projectivization.independent_iff Projectivization.independent_iff theorem independent_iff_completeLattice_independent : Independent f ↔ CompleteLattice.Independent fun i => (f i).submodule := by refine ⟨?_, fun h => ?_⟩ · rintro ⟨f, hf, hi⟩ simp only [submodule_mk] exact (CompleteLattice.independent_iff_linearIndependent_of_ne_zero (R := K) hf).mpr hi · rw [independent_iff] refine h.linearIndependent (Projectivization.submodule ∘ f) (fun i => ?_) fun i => ?_ · simpa only [Function.comp_apply, submodule_eq] using Submodule.mem_span_singleton_self _ · exact rep_nonzero (f i) #align projectivization.independent_iff_complete_lattice_independent Projectivization.independent_iff_completeLattice_independent inductive Dependent : (ι → ℙ K V) → Prop | mk (f : ι → V) (hf : ∀ i : ι, f i ≠ 0) (h : ¬LinearIndependent K f) : Dependent fun i => mk K (f i) (hf i) #align projectivization.dependent Projectivization.Dependent
Mathlib/LinearAlgebra/Projectivization/Independence.lean
84
94
theorem dependent_iff : Dependent f ↔ ¬LinearIndependent K (Projectivization.rep ∘ f) := by
refine ⟨?_, fun h => ?_⟩ · rintro ⟨ff, hff, hh1⟩ contrapose! hh1 choose a ha using fun i : ι => exists_smul_eq_mk_rep K (ff i) (hff i) convert hh1.units_smul a⁻¹ ext i simp only [← ha, inv_smul_smul, Pi.smul_apply', Pi.inv_apply, Function.comp_apply] · convert Dependent.mk _ _ h · simp only [mk_rep, Function.comp_apply] · exact fun i => rep_nonzero (f i)
1,698
import Mathlib.LinearAlgebra.Projectivization.Basic #align_import linear_algebra.projective_space.independence from "leanprover-community/mathlib"@"1e82f5ec4645f6a92bb9e02fce51e44e3bc3e1fe" open scoped LinearAlgebra.Projectivization variable {ι K V : Type*} [DivisionRing K] [AddCommGroup V] [Module K V] {f : ι → ℙ K V} namespace Projectivization inductive Independent : (ι → ℙ K V) → Prop | mk (f : ι → V) (hf : ∀ i : ι, f i ≠ 0) (hl : LinearIndependent K f) : Independent fun i => mk K (f i) (hf i) #align projectivization.independent Projectivization.Independent theorem independent_iff : Independent f ↔ LinearIndependent K (Projectivization.rep ∘ f) := by refine ⟨?_, fun h => ?_⟩ · rintro ⟨ff, hff, hh⟩ choose a ha using fun i : ι => exists_smul_eq_mk_rep K (ff i) (hff i) convert hh.units_smul a ext i exact (ha i).symm · convert Independent.mk _ _ h · simp only [mk_rep, Function.comp_apply] · intro i apply rep_nonzero #align projectivization.independent_iff Projectivization.independent_iff theorem independent_iff_completeLattice_independent : Independent f ↔ CompleteLattice.Independent fun i => (f i).submodule := by refine ⟨?_, fun h => ?_⟩ · rintro ⟨f, hf, hi⟩ simp only [submodule_mk] exact (CompleteLattice.independent_iff_linearIndependent_of_ne_zero (R := K) hf).mpr hi · rw [independent_iff] refine h.linearIndependent (Projectivization.submodule ∘ f) (fun i => ?_) fun i => ?_ · simpa only [Function.comp_apply, submodule_eq] using Submodule.mem_span_singleton_self _ · exact rep_nonzero (f i) #align projectivization.independent_iff_complete_lattice_independent Projectivization.independent_iff_completeLattice_independent inductive Dependent : (ι → ℙ K V) → Prop | mk (f : ι → V) (hf : ∀ i : ι, f i ≠ 0) (h : ¬LinearIndependent K f) : Dependent fun i => mk K (f i) (hf i) #align projectivization.dependent Projectivization.Dependent theorem dependent_iff : Dependent f ↔ ¬LinearIndependent K (Projectivization.rep ∘ f) := by refine ⟨?_, fun h => ?_⟩ · rintro ⟨ff, hff, hh1⟩ contrapose! hh1 choose a ha using fun i : ι => exists_smul_eq_mk_rep K (ff i) (hff i) convert hh1.units_smul a⁻¹ ext i simp only [← ha, inv_smul_smul, Pi.smul_apply', Pi.inv_apply, Function.comp_apply] · convert Dependent.mk _ _ h · simp only [mk_rep, Function.comp_apply] · exact fun i => rep_nonzero (f i) #align projectivization.dependent_iff Projectivization.dependent_iff
Mathlib/LinearAlgebra/Projectivization/Independence.lean
98
99
theorem dependent_iff_not_independent : Dependent f ↔ ¬Independent f := by
rw [dependent_iff, independent_iff]
1,698
import Mathlib.LinearAlgebra.Projectivization.Basic #align_import linear_algebra.projective_space.independence from "leanprover-community/mathlib"@"1e82f5ec4645f6a92bb9e02fce51e44e3bc3e1fe" open scoped LinearAlgebra.Projectivization variable {ι K V : Type*} [DivisionRing K] [AddCommGroup V] [Module K V] {f : ι → ℙ K V} namespace Projectivization inductive Independent : (ι → ℙ K V) → Prop | mk (f : ι → V) (hf : ∀ i : ι, f i ≠ 0) (hl : LinearIndependent K f) : Independent fun i => mk K (f i) (hf i) #align projectivization.independent Projectivization.Independent theorem independent_iff : Independent f ↔ LinearIndependent K (Projectivization.rep ∘ f) := by refine ⟨?_, fun h => ?_⟩ · rintro ⟨ff, hff, hh⟩ choose a ha using fun i : ι => exists_smul_eq_mk_rep K (ff i) (hff i) convert hh.units_smul a ext i exact (ha i).symm · convert Independent.mk _ _ h · simp only [mk_rep, Function.comp_apply] · intro i apply rep_nonzero #align projectivization.independent_iff Projectivization.independent_iff theorem independent_iff_completeLattice_independent : Independent f ↔ CompleteLattice.Independent fun i => (f i).submodule := by refine ⟨?_, fun h => ?_⟩ · rintro ⟨f, hf, hi⟩ simp only [submodule_mk] exact (CompleteLattice.independent_iff_linearIndependent_of_ne_zero (R := K) hf).mpr hi · rw [independent_iff] refine h.linearIndependent (Projectivization.submodule ∘ f) (fun i => ?_) fun i => ?_ · simpa only [Function.comp_apply, submodule_eq] using Submodule.mem_span_singleton_self _ · exact rep_nonzero (f i) #align projectivization.independent_iff_complete_lattice_independent Projectivization.independent_iff_completeLattice_independent inductive Dependent : (ι → ℙ K V) → Prop | mk (f : ι → V) (hf : ∀ i : ι, f i ≠ 0) (h : ¬LinearIndependent K f) : Dependent fun i => mk K (f i) (hf i) #align projectivization.dependent Projectivization.Dependent theorem dependent_iff : Dependent f ↔ ¬LinearIndependent K (Projectivization.rep ∘ f) := by refine ⟨?_, fun h => ?_⟩ · rintro ⟨ff, hff, hh1⟩ contrapose! hh1 choose a ha using fun i : ι => exists_smul_eq_mk_rep K (ff i) (hff i) convert hh1.units_smul a⁻¹ ext i simp only [← ha, inv_smul_smul, Pi.smul_apply', Pi.inv_apply, Function.comp_apply] · convert Dependent.mk _ _ h · simp only [mk_rep, Function.comp_apply] · exact fun i => rep_nonzero (f i) #align projectivization.dependent_iff Projectivization.dependent_iff theorem dependent_iff_not_independent : Dependent f ↔ ¬Independent f := by rw [dependent_iff, independent_iff] #align projectivization.dependent_iff_not_independent Projectivization.dependent_iff_not_independent
Mathlib/LinearAlgebra/Projectivization/Independence.lean
103
104
theorem independent_iff_not_dependent : Independent f ↔ ¬Dependent f := by
rw [dependent_iff_not_independent, Classical.not_not]
1,698
import Mathlib.LinearAlgebra.Projectivization.Basic #align_import linear_algebra.projective_space.independence from "leanprover-community/mathlib"@"1e82f5ec4645f6a92bb9e02fce51e44e3bc3e1fe" open scoped LinearAlgebra.Projectivization variable {ι K V : Type*} [DivisionRing K] [AddCommGroup V] [Module K V] {f : ι → ℙ K V} namespace Projectivization inductive Independent : (ι → ℙ K V) → Prop | mk (f : ι → V) (hf : ∀ i : ι, f i ≠ 0) (hl : LinearIndependent K f) : Independent fun i => mk K (f i) (hf i) #align projectivization.independent Projectivization.Independent theorem independent_iff : Independent f ↔ LinearIndependent K (Projectivization.rep ∘ f) := by refine ⟨?_, fun h => ?_⟩ · rintro ⟨ff, hff, hh⟩ choose a ha using fun i : ι => exists_smul_eq_mk_rep K (ff i) (hff i) convert hh.units_smul a ext i exact (ha i).symm · convert Independent.mk _ _ h · simp only [mk_rep, Function.comp_apply] · intro i apply rep_nonzero #align projectivization.independent_iff Projectivization.independent_iff theorem independent_iff_completeLattice_independent : Independent f ↔ CompleteLattice.Independent fun i => (f i).submodule := by refine ⟨?_, fun h => ?_⟩ · rintro ⟨f, hf, hi⟩ simp only [submodule_mk] exact (CompleteLattice.independent_iff_linearIndependent_of_ne_zero (R := K) hf).mpr hi · rw [independent_iff] refine h.linearIndependent (Projectivization.submodule ∘ f) (fun i => ?_) fun i => ?_ · simpa only [Function.comp_apply, submodule_eq] using Submodule.mem_span_singleton_self _ · exact rep_nonzero (f i) #align projectivization.independent_iff_complete_lattice_independent Projectivization.independent_iff_completeLattice_independent inductive Dependent : (ι → ℙ K V) → Prop | mk (f : ι → V) (hf : ∀ i : ι, f i ≠ 0) (h : ¬LinearIndependent K f) : Dependent fun i => mk K (f i) (hf i) #align projectivization.dependent Projectivization.Dependent theorem dependent_iff : Dependent f ↔ ¬LinearIndependent K (Projectivization.rep ∘ f) := by refine ⟨?_, fun h => ?_⟩ · rintro ⟨ff, hff, hh1⟩ contrapose! hh1 choose a ha using fun i : ι => exists_smul_eq_mk_rep K (ff i) (hff i) convert hh1.units_smul a⁻¹ ext i simp only [← ha, inv_smul_smul, Pi.smul_apply', Pi.inv_apply, Function.comp_apply] · convert Dependent.mk _ _ h · simp only [mk_rep, Function.comp_apply] · exact fun i => rep_nonzero (f i) #align projectivization.dependent_iff Projectivization.dependent_iff theorem dependent_iff_not_independent : Dependent f ↔ ¬Independent f := by rw [dependent_iff, independent_iff] #align projectivization.dependent_iff_not_independent Projectivization.dependent_iff_not_independent theorem independent_iff_not_dependent : Independent f ↔ ¬Dependent f := by rw [dependent_iff_not_independent, Classical.not_not] #align projectivization.independent_iff_not_dependent Projectivization.independent_iff_not_dependent @[simp]
Mathlib/LinearAlgebra/Projectivization/Independence.lean
109
114
theorem dependent_pair_iff_eq (u v : ℙ K V) : Dependent ![u, v] ↔ u = v := by
rw [dependent_iff_not_independent, independent_iff, linearIndependent_fin2, Function.comp_apply, Matrix.cons_val_one, Matrix.head_cons, Ne] simp only [Matrix.cons_val_zero, not_and, not_forall, Classical.not_not, Function.comp_apply, ← mk_eq_mk_iff' K _ _ (rep_nonzero u) (rep_nonzero v), mk_rep, Classical.imp_iff_right_iff] exact Or.inl (rep_nonzero v)
1,698
import Mathlib.LinearAlgebra.Projectivization.Basic #align_import linear_algebra.projective_space.independence from "leanprover-community/mathlib"@"1e82f5ec4645f6a92bb9e02fce51e44e3bc3e1fe" open scoped LinearAlgebra.Projectivization variable {ι K V : Type*} [DivisionRing K] [AddCommGroup V] [Module K V] {f : ι → ℙ K V} namespace Projectivization inductive Independent : (ι → ℙ K V) → Prop | mk (f : ι → V) (hf : ∀ i : ι, f i ≠ 0) (hl : LinearIndependent K f) : Independent fun i => mk K (f i) (hf i) #align projectivization.independent Projectivization.Independent theorem independent_iff : Independent f ↔ LinearIndependent K (Projectivization.rep ∘ f) := by refine ⟨?_, fun h => ?_⟩ · rintro ⟨ff, hff, hh⟩ choose a ha using fun i : ι => exists_smul_eq_mk_rep K (ff i) (hff i) convert hh.units_smul a ext i exact (ha i).symm · convert Independent.mk _ _ h · simp only [mk_rep, Function.comp_apply] · intro i apply rep_nonzero #align projectivization.independent_iff Projectivization.independent_iff theorem independent_iff_completeLattice_independent : Independent f ↔ CompleteLattice.Independent fun i => (f i).submodule := by refine ⟨?_, fun h => ?_⟩ · rintro ⟨f, hf, hi⟩ simp only [submodule_mk] exact (CompleteLattice.independent_iff_linearIndependent_of_ne_zero (R := K) hf).mpr hi · rw [independent_iff] refine h.linearIndependent (Projectivization.submodule ∘ f) (fun i => ?_) fun i => ?_ · simpa only [Function.comp_apply, submodule_eq] using Submodule.mem_span_singleton_self _ · exact rep_nonzero (f i) #align projectivization.independent_iff_complete_lattice_independent Projectivization.independent_iff_completeLattice_independent inductive Dependent : (ι → ℙ K V) → Prop | mk (f : ι → V) (hf : ∀ i : ι, f i ≠ 0) (h : ¬LinearIndependent K f) : Dependent fun i => mk K (f i) (hf i) #align projectivization.dependent Projectivization.Dependent theorem dependent_iff : Dependent f ↔ ¬LinearIndependent K (Projectivization.rep ∘ f) := by refine ⟨?_, fun h => ?_⟩ · rintro ⟨ff, hff, hh1⟩ contrapose! hh1 choose a ha using fun i : ι => exists_smul_eq_mk_rep K (ff i) (hff i) convert hh1.units_smul a⁻¹ ext i simp only [← ha, inv_smul_smul, Pi.smul_apply', Pi.inv_apply, Function.comp_apply] · convert Dependent.mk _ _ h · simp only [mk_rep, Function.comp_apply] · exact fun i => rep_nonzero (f i) #align projectivization.dependent_iff Projectivization.dependent_iff theorem dependent_iff_not_independent : Dependent f ↔ ¬Independent f := by rw [dependent_iff, independent_iff] #align projectivization.dependent_iff_not_independent Projectivization.dependent_iff_not_independent theorem independent_iff_not_dependent : Independent f ↔ ¬Dependent f := by rw [dependent_iff_not_independent, Classical.not_not] #align projectivization.independent_iff_not_dependent Projectivization.independent_iff_not_dependent @[simp] theorem dependent_pair_iff_eq (u v : ℙ K V) : Dependent ![u, v] ↔ u = v := by rw [dependent_iff_not_independent, independent_iff, linearIndependent_fin2, Function.comp_apply, Matrix.cons_val_one, Matrix.head_cons, Ne] simp only [Matrix.cons_val_zero, not_and, not_forall, Classical.not_not, Function.comp_apply, ← mk_eq_mk_iff' K _ _ (rep_nonzero u) (rep_nonzero v), mk_rep, Classical.imp_iff_right_iff] exact Or.inl (rep_nonzero v) #align projectivization.dependent_pair_iff_eq Projectivization.dependent_pair_iff_eq @[simp]
Mathlib/LinearAlgebra/Projectivization/Independence.lean
119
120
theorem independent_pair_iff_neq (u v : ℙ K V) : Independent ![u, v] ↔ u ≠ v := by
rw [independent_iff_not_dependent, dependent_pair_iff_eq u v]
1,698
import Mathlib.Algebra.Algebra.Spectrum import Mathlib.LinearAlgebra.GeneralLinearGroup import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.RingTheory.Nilpotent.Basic #align_import linear_algebra.eigenspace.basic from "leanprover-community/mathlib"@"6b0169218d01f2837d79ea2784882009a0da1aa1" universe u v w namespace Module namespace End open FiniteDimensional Set variable {K R : Type v} {V M : Type w} [CommRing R] [AddCommGroup M] [Module R M] [Field K] [AddCommGroup V] [Module K V] def eigenspace (f : End R M) (μ : R) : Submodule R M := LinearMap.ker (f - algebraMap R (End R M) μ) #align module.End.eigenspace Module.End.eigenspace @[simp]
Mathlib/LinearAlgebra/Eigenspace/Basic.lean
69
69
theorem eigenspace_zero (f : End R M) : f.eigenspace 0 = LinearMap.ker f := by
simp [eigenspace]
1,699
import Mathlib.Algebra.Algebra.Spectrum import Mathlib.LinearAlgebra.GeneralLinearGroup import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.RingTheory.Nilpotent.Basic #align_import linear_algebra.eigenspace.basic from "leanprover-community/mathlib"@"6b0169218d01f2837d79ea2784882009a0da1aa1" universe u v w namespace Module namespace End open FiniteDimensional Set variable {K R : Type v} {V M : Type w} [CommRing R] [AddCommGroup M] [Module R M] [Field K] [AddCommGroup V] [Module K V] def eigenspace (f : End R M) (μ : R) : Submodule R M := LinearMap.ker (f - algebraMap R (End R M) μ) #align module.End.eigenspace Module.End.eigenspace @[simp] theorem eigenspace_zero (f : End R M) : f.eigenspace 0 = LinearMap.ker f := by simp [eigenspace] #align module.End.eigenspace_zero Module.End.eigenspace_zero def HasEigenvector (f : End R M) (μ : R) (x : M) : Prop := x ∈ eigenspace f μ ∧ x ≠ 0 #align module.End.has_eigenvector Module.End.HasEigenvector def HasEigenvalue (f : End R M) (a : R) : Prop := eigenspace f a ≠ ⊥ #align module.End.has_eigenvalue Module.End.HasEigenvalue def Eigenvalues (f : End R M) : Type _ := { μ : R // f.HasEigenvalue μ } #align module.End.eigenvalues Module.End.Eigenvalues @[coe] def Eigenvalues.val (f : Module.End R M) : Eigenvalues f → R := Subtype.val instance Eigenvalues.instCoeOut {f : Module.End R M} : CoeOut (Eigenvalues f) R where coe := Eigenvalues.val f instance Eigenvalues.instDecidableEq [DecidableEq R] (f : Module.End R M) : DecidableEq (Eigenvalues f) := inferInstanceAs (DecidableEq (Subtype (fun x : R => HasEigenvalue f x)))
Mathlib/LinearAlgebra/Eigenspace/Basic.lean
98
101
theorem hasEigenvalue_of_hasEigenvector {f : End R M} {μ : R} {x : M} (h : HasEigenvector f μ x) : HasEigenvalue f μ := by
rw [HasEigenvalue, Submodule.ne_bot_iff] use x; exact h
1,699
import Mathlib.Algebra.Algebra.Spectrum import Mathlib.LinearAlgebra.GeneralLinearGroup import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.RingTheory.Nilpotent.Basic #align_import linear_algebra.eigenspace.basic from "leanprover-community/mathlib"@"6b0169218d01f2837d79ea2784882009a0da1aa1" universe u v w namespace Module namespace End open FiniteDimensional Set variable {K R : Type v} {V M : Type w} [CommRing R] [AddCommGroup M] [Module R M] [Field K] [AddCommGroup V] [Module K V] def eigenspace (f : End R M) (μ : R) : Submodule R M := LinearMap.ker (f - algebraMap R (End R M) μ) #align module.End.eigenspace Module.End.eigenspace @[simp] theorem eigenspace_zero (f : End R M) : f.eigenspace 0 = LinearMap.ker f := by simp [eigenspace] #align module.End.eigenspace_zero Module.End.eigenspace_zero def HasEigenvector (f : End R M) (μ : R) (x : M) : Prop := x ∈ eigenspace f μ ∧ x ≠ 0 #align module.End.has_eigenvector Module.End.HasEigenvector def HasEigenvalue (f : End R M) (a : R) : Prop := eigenspace f a ≠ ⊥ #align module.End.has_eigenvalue Module.End.HasEigenvalue def Eigenvalues (f : End R M) : Type _ := { μ : R // f.HasEigenvalue μ } #align module.End.eigenvalues Module.End.Eigenvalues @[coe] def Eigenvalues.val (f : Module.End R M) : Eigenvalues f → R := Subtype.val instance Eigenvalues.instCoeOut {f : Module.End R M} : CoeOut (Eigenvalues f) R where coe := Eigenvalues.val f instance Eigenvalues.instDecidableEq [DecidableEq R] (f : Module.End R M) : DecidableEq (Eigenvalues f) := inferInstanceAs (DecidableEq (Subtype (fun x : R => HasEigenvalue f x))) theorem hasEigenvalue_of_hasEigenvector {f : End R M} {μ : R} {x : M} (h : HasEigenvector f μ x) : HasEigenvalue f μ := by rw [HasEigenvalue, Submodule.ne_bot_iff] use x; exact h #align module.End.has_eigenvalue_of_has_eigenvector Module.End.hasEigenvalue_of_hasEigenvector
Mathlib/LinearAlgebra/Eigenspace/Basic.lean
104
105
theorem mem_eigenspace_iff {f : End R M} {μ : R} {x : M} : x ∈ eigenspace f μ ↔ f x = μ • x := by
rw [eigenspace, LinearMap.mem_ker, LinearMap.sub_apply, algebraMap_end_apply, sub_eq_zero]
1,699
import Mathlib.Algebra.Algebra.Spectrum import Mathlib.LinearAlgebra.GeneralLinearGroup import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.RingTheory.Nilpotent.Basic #align_import linear_algebra.eigenspace.basic from "leanprover-community/mathlib"@"6b0169218d01f2837d79ea2784882009a0da1aa1" universe u v w namespace Module namespace End open FiniteDimensional Set variable {K R : Type v} {V M : Type w} [CommRing R] [AddCommGroup M] [Module R M] [Field K] [AddCommGroup V] [Module K V] def eigenspace (f : End R M) (μ : R) : Submodule R M := LinearMap.ker (f - algebraMap R (End R M) μ) #align module.End.eigenspace Module.End.eigenspace @[simp] theorem eigenspace_zero (f : End R M) : f.eigenspace 0 = LinearMap.ker f := by simp [eigenspace] #align module.End.eigenspace_zero Module.End.eigenspace_zero def HasEigenvector (f : End R M) (μ : R) (x : M) : Prop := x ∈ eigenspace f μ ∧ x ≠ 0 #align module.End.has_eigenvector Module.End.HasEigenvector def HasEigenvalue (f : End R M) (a : R) : Prop := eigenspace f a ≠ ⊥ #align module.End.has_eigenvalue Module.End.HasEigenvalue def Eigenvalues (f : End R M) : Type _ := { μ : R // f.HasEigenvalue μ } #align module.End.eigenvalues Module.End.Eigenvalues @[coe] def Eigenvalues.val (f : Module.End R M) : Eigenvalues f → R := Subtype.val instance Eigenvalues.instCoeOut {f : Module.End R M} : CoeOut (Eigenvalues f) R where coe := Eigenvalues.val f instance Eigenvalues.instDecidableEq [DecidableEq R] (f : Module.End R M) : DecidableEq (Eigenvalues f) := inferInstanceAs (DecidableEq (Subtype (fun x : R => HasEigenvalue f x))) theorem hasEigenvalue_of_hasEigenvector {f : End R M} {μ : R} {x : M} (h : HasEigenvector f μ x) : HasEigenvalue f μ := by rw [HasEigenvalue, Submodule.ne_bot_iff] use x; exact h #align module.End.has_eigenvalue_of_has_eigenvector Module.End.hasEigenvalue_of_hasEigenvector theorem mem_eigenspace_iff {f : End R M} {μ : R} {x : M} : x ∈ eigenspace f μ ↔ f x = μ • x := by rw [eigenspace, LinearMap.mem_ker, LinearMap.sub_apply, algebraMap_end_apply, sub_eq_zero] #align module.End.mem_eigenspace_iff Module.End.mem_eigenspace_iff theorem HasEigenvector.apply_eq_smul {f : End R M} {μ : R} {x : M} (hx : f.HasEigenvector μ x) : f x = μ • x := mem_eigenspace_iff.mp hx.1 #align module.End.has_eigenvector.apply_eq_smul Module.End.HasEigenvector.apply_eq_smul
Mathlib/LinearAlgebra/Eigenspace/Basic.lean
113
115
theorem HasEigenvector.pow_apply {f : End R M} {μ : R} {v : M} (hv : f.HasEigenvector μ v) (n : ℕ) : (f ^ n) v = μ ^ n • v := by
induction n <;> simp [*, pow_succ f, hv.apply_eq_smul, smul_smul, pow_succ' μ]
1,699
import Mathlib.Algebra.Algebra.Spectrum import Mathlib.LinearAlgebra.GeneralLinearGroup import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.RingTheory.Nilpotent.Basic #align_import linear_algebra.eigenspace.basic from "leanprover-community/mathlib"@"6b0169218d01f2837d79ea2784882009a0da1aa1" universe u v w namespace Module namespace End open FiniteDimensional Set variable {K R : Type v} {V M : Type w} [CommRing R] [AddCommGroup M] [Module R M] [Field K] [AddCommGroup V] [Module K V] def eigenspace (f : End R M) (μ : R) : Submodule R M := LinearMap.ker (f - algebraMap R (End R M) μ) #align module.End.eigenspace Module.End.eigenspace @[simp] theorem eigenspace_zero (f : End R M) : f.eigenspace 0 = LinearMap.ker f := by simp [eigenspace] #align module.End.eigenspace_zero Module.End.eigenspace_zero def HasEigenvector (f : End R M) (μ : R) (x : M) : Prop := x ∈ eigenspace f μ ∧ x ≠ 0 #align module.End.has_eigenvector Module.End.HasEigenvector def HasEigenvalue (f : End R M) (a : R) : Prop := eigenspace f a ≠ ⊥ #align module.End.has_eigenvalue Module.End.HasEigenvalue def Eigenvalues (f : End R M) : Type _ := { μ : R // f.HasEigenvalue μ } #align module.End.eigenvalues Module.End.Eigenvalues @[coe] def Eigenvalues.val (f : Module.End R M) : Eigenvalues f → R := Subtype.val instance Eigenvalues.instCoeOut {f : Module.End R M} : CoeOut (Eigenvalues f) R where coe := Eigenvalues.val f instance Eigenvalues.instDecidableEq [DecidableEq R] (f : Module.End R M) : DecidableEq (Eigenvalues f) := inferInstanceAs (DecidableEq (Subtype (fun x : R => HasEigenvalue f x))) theorem hasEigenvalue_of_hasEigenvector {f : End R M} {μ : R} {x : M} (h : HasEigenvector f μ x) : HasEigenvalue f μ := by rw [HasEigenvalue, Submodule.ne_bot_iff] use x; exact h #align module.End.has_eigenvalue_of_has_eigenvector Module.End.hasEigenvalue_of_hasEigenvector theorem mem_eigenspace_iff {f : End R M} {μ : R} {x : M} : x ∈ eigenspace f μ ↔ f x = μ • x := by rw [eigenspace, LinearMap.mem_ker, LinearMap.sub_apply, algebraMap_end_apply, sub_eq_zero] #align module.End.mem_eigenspace_iff Module.End.mem_eigenspace_iff theorem HasEigenvector.apply_eq_smul {f : End R M} {μ : R} {x : M} (hx : f.HasEigenvector μ x) : f x = μ • x := mem_eigenspace_iff.mp hx.1 #align module.End.has_eigenvector.apply_eq_smul Module.End.HasEigenvector.apply_eq_smul theorem HasEigenvector.pow_apply {f : End R M} {μ : R} {v : M} (hv : f.HasEigenvector μ v) (n : ℕ) : (f ^ n) v = μ ^ n • v := by induction n <;> simp [*, pow_succ f, hv.apply_eq_smul, smul_smul, pow_succ' μ] theorem HasEigenvalue.exists_hasEigenvector {f : End R M} {μ : R} (hμ : f.HasEigenvalue μ) : ∃ v, f.HasEigenvector μ v := Submodule.exists_mem_ne_zero_of_ne_bot hμ #align module.End.has_eigenvalue.exists_has_eigenvector Module.End.HasEigenvalue.exists_hasEigenvector lemma HasEigenvalue.pow {f : End R M} {μ : R} (h : f.HasEigenvalue μ) (n : ℕ) : (f ^ n).HasEigenvalue (μ ^ n) := by rw [HasEigenvalue, Submodule.ne_bot_iff] obtain ⟨m : M, hm⟩ := h.exists_hasEigenvector exact ⟨m, by simpa [mem_eigenspace_iff] using hm.pow_apply n, hm.2⟩ lemma HasEigenvalue.isNilpotent_of_isNilpotent [NoZeroSMulDivisors R M] {f : End R M} (hfn : IsNilpotent f) {μ : R} (hf : f.HasEigenvalue μ) : IsNilpotent μ := by obtain ⟨m : M, hm⟩ := hf.exists_hasEigenvector obtain ⟨n : ℕ, hn : f ^ n = 0⟩ := hfn exact ⟨n, by simpa [hn, hm.2, eq_comm (a := (0 : M))] using hm.pow_apply n⟩
Mathlib/LinearAlgebra/Eigenspace/Basic.lean
138
144
theorem HasEigenvalue.mem_spectrum {f : End R M} {μ : R} (hμ : HasEigenvalue f μ) : μ ∈ spectrum R f := by
refine spectrum.mem_iff.mpr fun h_unit => ?_ set f' := LinearMap.GeneralLinearGroup.toLinearEquiv h_unit.unit rcases hμ.exists_hasEigenvector with ⟨v, hv⟩ refine hv.2 ((LinearMap.ker_eq_bot'.mp f'.ker) v (?_ : μ • v - f v = 0)) rw [hv.apply_eq_smul, sub_self]
1,699
import Mathlib.Algebra.Algebra.Spectrum import Mathlib.LinearAlgebra.GeneralLinearGroup import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.RingTheory.Nilpotent.Basic #align_import linear_algebra.eigenspace.basic from "leanprover-community/mathlib"@"6b0169218d01f2837d79ea2784882009a0da1aa1" universe u v w namespace Module namespace End open FiniteDimensional Set variable {K R : Type v} {V M : Type w} [CommRing R] [AddCommGroup M] [Module R M] [Field K] [AddCommGroup V] [Module K V] def eigenspace (f : End R M) (μ : R) : Submodule R M := LinearMap.ker (f - algebraMap R (End R M) μ) #align module.End.eigenspace Module.End.eigenspace @[simp] theorem eigenspace_zero (f : End R M) : f.eigenspace 0 = LinearMap.ker f := by simp [eigenspace] #align module.End.eigenspace_zero Module.End.eigenspace_zero def HasEigenvector (f : End R M) (μ : R) (x : M) : Prop := x ∈ eigenspace f μ ∧ x ≠ 0 #align module.End.has_eigenvector Module.End.HasEigenvector def HasEigenvalue (f : End R M) (a : R) : Prop := eigenspace f a ≠ ⊥ #align module.End.has_eigenvalue Module.End.HasEigenvalue def Eigenvalues (f : End R M) : Type _ := { μ : R // f.HasEigenvalue μ } #align module.End.eigenvalues Module.End.Eigenvalues @[coe] def Eigenvalues.val (f : Module.End R M) : Eigenvalues f → R := Subtype.val instance Eigenvalues.instCoeOut {f : Module.End R M} : CoeOut (Eigenvalues f) R where coe := Eigenvalues.val f instance Eigenvalues.instDecidableEq [DecidableEq R] (f : Module.End R M) : DecidableEq (Eigenvalues f) := inferInstanceAs (DecidableEq (Subtype (fun x : R => HasEigenvalue f x))) theorem hasEigenvalue_of_hasEigenvector {f : End R M} {μ : R} {x : M} (h : HasEigenvector f μ x) : HasEigenvalue f μ := by rw [HasEigenvalue, Submodule.ne_bot_iff] use x; exact h #align module.End.has_eigenvalue_of_has_eigenvector Module.End.hasEigenvalue_of_hasEigenvector theorem mem_eigenspace_iff {f : End R M} {μ : R} {x : M} : x ∈ eigenspace f μ ↔ f x = μ • x := by rw [eigenspace, LinearMap.mem_ker, LinearMap.sub_apply, algebraMap_end_apply, sub_eq_zero] #align module.End.mem_eigenspace_iff Module.End.mem_eigenspace_iff theorem HasEigenvector.apply_eq_smul {f : End R M} {μ : R} {x : M} (hx : f.HasEigenvector μ x) : f x = μ • x := mem_eigenspace_iff.mp hx.1 #align module.End.has_eigenvector.apply_eq_smul Module.End.HasEigenvector.apply_eq_smul theorem HasEigenvector.pow_apply {f : End R M} {μ : R} {v : M} (hv : f.HasEigenvector μ v) (n : ℕ) : (f ^ n) v = μ ^ n • v := by induction n <;> simp [*, pow_succ f, hv.apply_eq_smul, smul_smul, pow_succ' μ] theorem HasEigenvalue.exists_hasEigenvector {f : End R M} {μ : R} (hμ : f.HasEigenvalue μ) : ∃ v, f.HasEigenvector μ v := Submodule.exists_mem_ne_zero_of_ne_bot hμ #align module.End.has_eigenvalue.exists_has_eigenvector Module.End.HasEigenvalue.exists_hasEigenvector lemma HasEigenvalue.pow {f : End R M} {μ : R} (h : f.HasEigenvalue μ) (n : ℕ) : (f ^ n).HasEigenvalue (μ ^ n) := by rw [HasEigenvalue, Submodule.ne_bot_iff] obtain ⟨m : M, hm⟩ := h.exists_hasEigenvector exact ⟨m, by simpa [mem_eigenspace_iff] using hm.pow_apply n, hm.2⟩ lemma HasEigenvalue.isNilpotent_of_isNilpotent [NoZeroSMulDivisors R M] {f : End R M} (hfn : IsNilpotent f) {μ : R} (hf : f.HasEigenvalue μ) : IsNilpotent μ := by obtain ⟨m : M, hm⟩ := hf.exists_hasEigenvector obtain ⟨n : ℕ, hn : f ^ n = 0⟩ := hfn exact ⟨n, by simpa [hn, hm.2, eq_comm (a := (0 : M))] using hm.pow_apply n⟩ theorem HasEigenvalue.mem_spectrum {f : End R M} {μ : R} (hμ : HasEigenvalue f μ) : μ ∈ spectrum R f := by refine spectrum.mem_iff.mpr fun h_unit => ?_ set f' := LinearMap.GeneralLinearGroup.toLinearEquiv h_unit.unit rcases hμ.exists_hasEigenvector with ⟨v, hv⟩ refine hv.2 ((LinearMap.ker_eq_bot'.mp f'.ker) v (?_ : μ • v - f v = 0)) rw [hv.apply_eq_smul, sub_self] #align module.End.mem_spectrum_of_has_eigenvalue Module.End.HasEigenvalue.mem_spectrum
Mathlib/LinearAlgebra/Eigenspace/Basic.lean
147
149
theorem hasEigenvalue_iff_mem_spectrum [FiniteDimensional K V] {f : End K V} {μ : K} : f.HasEigenvalue μ ↔ μ ∈ spectrum K f := by
rw [spectrum.mem_iff, IsUnit.sub_iff, LinearMap.isUnit_iff_ker_eq_bot, HasEigenvalue, eigenspace]
1,699
import Mathlib.Algebra.Algebra.Spectrum import Mathlib.LinearAlgebra.GeneralLinearGroup import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.RingTheory.Nilpotent.Basic #align_import linear_algebra.eigenspace.basic from "leanprover-community/mathlib"@"6b0169218d01f2837d79ea2784882009a0da1aa1" universe u v w namespace Module namespace End open FiniteDimensional Set variable {K R : Type v} {V M : Type w} [CommRing R] [AddCommGroup M] [Module R M] [Field K] [AddCommGroup V] [Module K V] def eigenspace (f : End R M) (μ : R) : Submodule R M := LinearMap.ker (f - algebraMap R (End R M) μ) #align module.End.eigenspace Module.End.eigenspace @[simp] theorem eigenspace_zero (f : End R M) : f.eigenspace 0 = LinearMap.ker f := by simp [eigenspace] #align module.End.eigenspace_zero Module.End.eigenspace_zero def HasEigenvector (f : End R M) (μ : R) (x : M) : Prop := x ∈ eigenspace f μ ∧ x ≠ 0 #align module.End.has_eigenvector Module.End.HasEigenvector def HasEigenvalue (f : End R M) (a : R) : Prop := eigenspace f a ≠ ⊥ #align module.End.has_eigenvalue Module.End.HasEigenvalue def Eigenvalues (f : End R M) : Type _ := { μ : R // f.HasEigenvalue μ } #align module.End.eigenvalues Module.End.Eigenvalues @[coe] def Eigenvalues.val (f : Module.End R M) : Eigenvalues f → R := Subtype.val instance Eigenvalues.instCoeOut {f : Module.End R M} : CoeOut (Eigenvalues f) R where coe := Eigenvalues.val f instance Eigenvalues.instDecidableEq [DecidableEq R] (f : Module.End R M) : DecidableEq (Eigenvalues f) := inferInstanceAs (DecidableEq (Subtype (fun x : R => HasEigenvalue f x))) theorem hasEigenvalue_of_hasEigenvector {f : End R M} {μ : R} {x : M} (h : HasEigenvector f μ x) : HasEigenvalue f μ := by rw [HasEigenvalue, Submodule.ne_bot_iff] use x; exact h #align module.End.has_eigenvalue_of_has_eigenvector Module.End.hasEigenvalue_of_hasEigenvector theorem mem_eigenspace_iff {f : End R M} {μ : R} {x : M} : x ∈ eigenspace f μ ↔ f x = μ • x := by rw [eigenspace, LinearMap.mem_ker, LinearMap.sub_apply, algebraMap_end_apply, sub_eq_zero] #align module.End.mem_eigenspace_iff Module.End.mem_eigenspace_iff theorem HasEigenvector.apply_eq_smul {f : End R M} {μ : R} {x : M} (hx : f.HasEigenvector μ x) : f x = μ • x := mem_eigenspace_iff.mp hx.1 #align module.End.has_eigenvector.apply_eq_smul Module.End.HasEigenvector.apply_eq_smul theorem HasEigenvector.pow_apply {f : End R M} {μ : R} {v : M} (hv : f.HasEigenvector μ v) (n : ℕ) : (f ^ n) v = μ ^ n • v := by induction n <;> simp [*, pow_succ f, hv.apply_eq_smul, smul_smul, pow_succ' μ] theorem HasEigenvalue.exists_hasEigenvector {f : End R M} {μ : R} (hμ : f.HasEigenvalue μ) : ∃ v, f.HasEigenvector μ v := Submodule.exists_mem_ne_zero_of_ne_bot hμ #align module.End.has_eigenvalue.exists_has_eigenvector Module.End.HasEigenvalue.exists_hasEigenvector lemma HasEigenvalue.pow {f : End R M} {μ : R} (h : f.HasEigenvalue μ) (n : ℕ) : (f ^ n).HasEigenvalue (μ ^ n) := by rw [HasEigenvalue, Submodule.ne_bot_iff] obtain ⟨m : M, hm⟩ := h.exists_hasEigenvector exact ⟨m, by simpa [mem_eigenspace_iff] using hm.pow_apply n, hm.2⟩ lemma HasEigenvalue.isNilpotent_of_isNilpotent [NoZeroSMulDivisors R M] {f : End R M} (hfn : IsNilpotent f) {μ : R} (hf : f.HasEigenvalue μ) : IsNilpotent μ := by obtain ⟨m : M, hm⟩ := hf.exists_hasEigenvector obtain ⟨n : ℕ, hn : f ^ n = 0⟩ := hfn exact ⟨n, by simpa [hn, hm.2, eq_comm (a := (0 : M))] using hm.pow_apply n⟩ theorem HasEigenvalue.mem_spectrum {f : End R M} {μ : R} (hμ : HasEigenvalue f μ) : μ ∈ spectrum R f := by refine spectrum.mem_iff.mpr fun h_unit => ?_ set f' := LinearMap.GeneralLinearGroup.toLinearEquiv h_unit.unit rcases hμ.exists_hasEigenvector with ⟨v, hv⟩ refine hv.2 ((LinearMap.ker_eq_bot'.mp f'.ker) v (?_ : μ • v - f v = 0)) rw [hv.apply_eq_smul, sub_self] #align module.End.mem_spectrum_of_has_eigenvalue Module.End.HasEigenvalue.mem_spectrum theorem hasEigenvalue_iff_mem_spectrum [FiniteDimensional K V] {f : End K V} {μ : K} : f.HasEigenvalue μ ↔ μ ∈ spectrum K f := by rw [spectrum.mem_iff, IsUnit.sub_iff, LinearMap.isUnit_iff_ker_eq_bot, HasEigenvalue, eigenspace] #align module.End.has_eigenvalue_iff_mem_spectrum Module.End.hasEigenvalue_iff_mem_spectrum alias ⟨_, HasEigenvalue.of_mem_spectrum⟩ := hasEigenvalue_iff_mem_spectrum
Mathlib/LinearAlgebra/Eigenspace/Basic.lean
154
163
theorem eigenspace_div (f : End K V) (a b : K) (hb : b ≠ 0) : eigenspace f (a / b) = LinearMap.ker (b • f - algebraMap K (End K V) a) := calc eigenspace f (a / b) = eigenspace f (b⁻¹ * a) := by
rw [div_eq_mul_inv, mul_comm] _ = LinearMap.ker (f - (b⁻¹ * a) • LinearMap.id) := by rw [eigenspace]; rfl _ = LinearMap.ker (f - b⁻¹ • a • LinearMap.id) := by rw [smul_smul] _ = LinearMap.ker (f - b⁻¹ • algebraMap K (End K V) a) := rfl _ = LinearMap.ker (b • (f - b⁻¹ • algebraMap K (End K V) a)) := by rw [LinearMap.ker_smul _ b hb] _ = LinearMap.ker (b • f - algebraMap K (End K V) a) := by rw [smul_sub, smul_inv_smul₀ hb]
1,699
import Mathlib.LinearAlgebra.Isomorphisms import Mathlib.LinearAlgebra.Projection import Mathlib.Order.JordanHolder import Mathlib.Order.CompactlyGenerated.Intervals import Mathlib.LinearAlgebra.FiniteDimensional #align_import ring_theory.simple_module from "leanprover-community/mathlib"@"cce7f68a7eaadadf74c82bbac20721cdc03a1cc1" variable {ι : Type*} (R S : Type*) [Ring R] [Ring S] (M : Type*) [AddCommGroup M] [Module R M] abbrev IsSimpleModule := IsSimpleOrder (Submodule R M) #align is_simple_module IsSimpleModule abbrev IsSemisimpleModule := ComplementedLattice (Submodule R M) #align is_semisimple_module IsSemisimpleModule abbrev IsSemisimpleRing := IsSemisimpleModule R R theorem RingEquiv.isSemisimpleRing (e : R ≃+* S) [IsSemisimpleRing R] : IsSemisimpleRing S := (Submodule.orderIsoMapComap e.toSemilinearEquiv).complementedLattice -- Making this an instance causes the linter to complain of "dangerous instances" theorem IsSimpleModule.nontrivial [IsSimpleModule R M] : Nontrivial M := ⟨⟨0, by have h : (⊥ : Submodule R M) ≠ ⊤ := bot_ne_top contrapose! h ext x simp [Submodule.mem_bot, Submodule.mem_top, h x]⟩⟩ #align is_simple_module.nontrivial IsSimpleModule.nontrivial variable {m : Submodule R M} {N : Type*} [AddCommGroup N] [Module R N] {R S M} theorem LinearMap.isSimpleModule_iff_of_bijective [Module S N] {σ : R →+* S} [RingHomSurjective σ] (l : M →ₛₗ[σ] N) (hl : Function.Bijective l) : IsSimpleModule R M ↔ IsSimpleModule S N := (Submodule.orderIsoMapComapOfBijective l hl).isSimpleOrder_iff theorem IsSimpleModule.congr (l : M ≃ₗ[R] N) [IsSimpleModule R N] : IsSimpleModule R M := (Submodule.orderIsoMapComap l).isSimpleOrder #align is_simple_module.congr IsSimpleModule.congr
Mathlib/RingTheory/SimpleModule.lean
86
88
theorem isSimpleModule_iff_isAtom : IsSimpleModule R m ↔ IsAtom m := by
rw [← Set.isSimpleOrder_Iic_iff_isAtom] exact m.mapIic.isSimpleOrder_iff
1,700
import Mathlib.LinearAlgebra.Isomorphisms import Mathlib.LinearAlgebra.Projection import Mathlib.Order.JordanHolder import Mathlib.Order.CompactlyGenerated.Intervals import Mathlib.LinearAlgebra.FiniteDimensional #align_import ring_theory.simple_module from "leanprover-community/mathlib"@"cce7f68a7eaadadf74c82bbac20721cdc03a1cc1" variable {ι : Type*} (R S : Type*) [Ring R] [Ring S] (M : Type*) [AddCommGroup M] [Module R M] abbrev IsSimpleModule := IsSimpleOrder (Submodule R M) #align is_simple_module IsSimpleModule abbrev IsSemisimpleModule := ComplementedLattice (Submodule R M) #align is_semisimple_module IsSemisimpleModule abbrev IsSemisimpleRing := IsSemisimpleModule R R theorem RingEquiv.isSemisimpleRing (e : R ≃+* S) [IsSemisimpleRing R] : IsSemisimpleRing S := (Submodule.orderIsoMapComap e.toSemilinearEquiv).complementedLattice -- Making this an instance causes the linter to complain of "dangerous instances" theorem IsSimpleModule.nontrivial [IsSimpleModule R M] : Nontrivial M := ⟨⟨0, by have h : (⊥ : Submodule R M) ≠ ⊤ := bot_ne_top contrapose! h ext x simp [Submodule.mem_bot, Submodule.mem_top, h x]⟩⟩ #align is_simple_module.nontrivial IsSimpleModule.nontrivial variable {m : Submodule R M} {N : Type*} [AddCommGroup N] [Module R N] {R S M} theorem LinearMap.isSimpleModule_iff_of_bijective [Module S N] {σ : R →+* S} [RingHomSurjective σ] (l : M →ₛₗ[σ] N) (hl : Function.Bijective l) : IsSimpleModule R M ↔ IsSimpleModule S N := (Submodule.orderIsoMapComapOfBijective l hl).isSimpleOrder_iff theorem IsSimpleModule.congr (l : M ≃ₗ[R] N) [IsSimpleModule R N] : IsSimpleModule R M := (Submodule.orderIsoMapComap l).isSimpleOrder #align is_simple_module.congr IsSimpleModule.congr theorem isSimpleModule_iff_isAtom : IsSimpleModule R m ↔ IsAtom m := by rw [← Set.isSimpleOrder_Iic_iff_isAtom] exact m.mapIic.isSimpleOrder_iff #align is_simple_module_iff_is_atom isSimpleModule_iff_isAtom
Mathlib/RingTheory/SimpleModule.lean
91
94
theorem isSimpleModule_iff_isCoatom : IsSimpleModule R (M ⧸ m) ↔ IsCoatom m := by
rw [← Set.isSimpleOrder_Ici_iff_isCoatom] apply OrderIso.isSimpleOrder_iff exact Submodule.comapMkQRelIso m
1,700
import Mathlib.LinearAlgebra.Isomorphisms import Mathlib.LinearAlgebra.Projection import Mathlib.Order.JordanHolder import Mathlib.Order.CompactlyGenerated.Intervals import Mathlib.LinearAlgebra.FiniteDimensional #align_import ring_theory.simple_module from "leanprover-community/mathlib"@"cce7f68a7eaadadf74c82bbac20721cdc03a1cc1" variable {ι : Type*} (R S : Type*) [Ring R] [Ring S] (M : Type*) [AddCommGroup M] [Module R M] abbrev IsSimpleModule := IsSimpleOrder (Submodule R M) #align is_simple_module IsSimpleModule abbrev IsSemisimpleModule := ComplementedLattice (Submodule R M) #align is_semisimple_module IsSemisimpleModule abbrev IsSemisimpleRing := IsSemisimpleModule R R theorem RingEquiv.isSemisimpleRing (e : R ≃+* S) [IsSemisimpleRing R] : IsSemisimpleRing S := (Submodule.orderIsoMapComap e.toSemilinearEquiv).complementedLattice -- Making this an instance causes the linter to complain of "dangerous instances" theorem IsSimpleModule.nontrivial [IsSimpleModule R M] : Nontrivial M := ⟨⟨0, by have h : (⊥ : Submodule R M) ≠ ⊤ := bot_ne_top contrapose! h ext x simp [Submodule.mem_bot, Submodule.mem_top, h x]⟩⟩ #align is_simple_module.nontrivial IsSimpleModule.nontrivial variable {m : Submodule R M} {N : Type*} [AddCommGroup N] [Module R N] {R S M} theorem LinearMap.isSimpleModule_iff_of_bijective [Module S N] {σ : R →+* S} [RingHomSurjective σ] (l : M →ₛₗ[σ] N) (hl : Function.Bijective l) : IsSimpleModule R M ↔ IsSimpleModule S N := (Submodule.orderIsoMapComapOfBijective l hl).isSimpleOrder_iff theorem IsSimpleModule.congr (l : M ≃ₗ[R] N) [IsSimpleModule R N] : IsSimpleModule R M := (Submodule.orderIsoMapComap l).isSimpleOrder #align is_simple_module.congr IsSimpleModule.congr theorem isSimpleModule_iff_isAtom : IsSimpleModule R m ↔ IsAtom m := by rw [← Set.isSimpleOrder_Iic_iff_isAtom] exact m.mapIic.isSimpleOrder_iff #align is_simple_module_iff_is_atom isSimpleModule_iff_isAtom theorem isSimpleModule_iff_isCoatom : IsSimpleModule R (M ⧸ m) ↔ IsCoatom m := by rw [← Set.isSimpleOrder_Ici_iff_isCoatom] apply OrderIso.isSimpleOrder_iff exact Submodule.comapMkQRelIso m #align is_simple_module_iff_is_coatom isSimpleModule_iff_isCoatom
Mathlib/RingTheory/SimpleModule.lean
97
101
theorem covBy_iff_quot_is_simple {A B : Submodule R M} (hAB : A ≤ B) : A ⋖ B ↔ IsSimpleModule R (B ⧸ Submodule.comap B.subtype A) := by
set f : Submodule R B ≃o Set.Iic B := B.mapIic with hf rw [covBy_iff_coatom_Iic hAB, isSimpleModule_iff_isCoatom, ← OrderIso.isCoatom_iff f, hf] simp [-OrderIso.isCoatom_iff, Submodule.map_comap_subtype, inf_eq_right.2 hAB]
1,700
import Mathlib.LinearAlgebra.Isomorphisms import Mathlib.LinearAlgebra.Projection import Mathlib.Order.JordanHolder import Mathlib.Order.CompactlyGenerated.Intervals import Mathlib.LinearAlgebra.FiniteDimensional #align_import ring_theory.simple_module from "leanprover-community/mathlib"@"cce7f68a7eaadadf74c82bbac20721cdc03a1cc1" variable {ι : Type*} (R S : Type*) [Ring R] [Ring S] (M : Type*) [AddCommGroup M] [Module R M] abbrev IsSimpleModule := IsSimpleOrder (Submodule R M) #align is_simple_module IsSimpleModule abbrev IsSemisimpleModule := ComplementedLattice (Submodule R M) #align is_semisimple_module IsSemisimpleModule abbrev IsSemisimpleRing := IsSemisimpleModule R R theorem RingEquiv.isSemisimpleRing (e : R ≃+* S) [IsSemisimpleRing R] : IsSemisimpleRing S := (Submodule.orderIsoMapComap e.toSemilinearEquiv).complementedLattice -- Making this an instance causes the linter to complain of "dangerous instances" theorem IsSimpleModule.nontrivial [IsSimpleModule R M] : Nontrivial M := ⟨⟨0, by have h : (⊥ : Submodule R M) ≠ ⊤ := bot_ne_top contrapose! h ext x simp [Submodule.mem_bot, Submodule.mem_top, h x]⟩⟩ #align is_simple_module.nontrivial IsSimpleModule.nontrivial variable {m : Submodule R M} {N : Type*} [AddCommGroup N] [Module R N] {R S M} theorem LinearMap.isSimpleModule_iff_of_bijective [Module S N] {σ : R →+* S} [RingHomSurjective σ] (l : M →ₛₗ[σ] N) (hl : Function.Bijective l) : IsSimpleModule R M ↔ IsSimpleModule S N := (Submodule.orderIsoMapComapOfBijective l hl).isSimpleOrder_iff theorem IsSimpleModule.congr (l : M ≃ₗ[R] N) [IsSimpleModule R N] : IsSimpleModule R M := (Submodule.orderIsoMapComap l).isSimpleOrder #align is_simple_module.congr IsSimpleModule.congr theorem isSimpleModule_iff_isAtom : IsSimpleModule R m ↔ IsAtom m := by rw [← Set.isSimpleOrder_Iic_iff_isAtom] exact m.mapIic.isSimpleOrder_iff #align is_simple_module_iff_is_atom isSimpleModule_iff_isAtom theorem isSimpleModule_iff_isCoatom : IsSimpleModule R (M ⧸ m) ↔ IsCoatom m := by rw [← Set.isSimpleOrder_Ici_iff_isCoatom] apply OrderIso.isSimpleOrder_iff exact Submodule.comapMkQRelIso m #align is_simple_module_iff_is_coatom isSimpleModule_iff_isCoatom theorem covBy_iff_quot_is_simple {A B : Submodule R M} (hAB : A ≤ B) : A ⋖ B ↔ IsSimpleModule R (B ⧸ Submodule.comap B.subtype A) := by set f : Submodule R B ≃o Set.Iic B := B.mapIic with hf rw [covBy_iff_coatom_Iic hAB, isSimpleModule_iff_isCoatom, ← OrderIso.isCoatom_iff f, hf] simp [-OrderIso.isCoatom_iff, Submodule.map_comap_subtype, inf_eq_right.2 hAB] #align covby_iff_quot_is_simple covBy_iff_quot_is_simple namespace IsSimpleModule @[simp] theorem isAtom [IsSimpleModule R m] : IsAtom m := isSimpleModule_iff_isAtom.1 ‹_› #align is_simple_module.is_atom IsSimpleModule.isAtom variable [IsSimpleModule R M] (R) open LinearMap theorem span_singleton_eq_top {m : M} (hm : m ≠ 0) : Submodule.span R {m} = ⊤ := (eq_bot_or_eq_top _).resolve_left fun h ↦ hm (h.le <| Submodule.mem_span_singleton_self m) instance (S : Submodule R M) : S.IsPrincipal where principal' := by obtain rfl | rfl := eq_bot_or_eq_top S · exact ⟨0, Submodule.span_zero.symm⟩ have := IsSimpleModule.nontrivial R M have ⟨m, hm⟩ := exists_ne (0 : M) exact ⟨m, (span_singleton_eq_top R hm).symm⟩
Mathlib/RingTheory/SimpleModule.lean
125
127
theorem toSpanSingleton_surjective {m : M} (hm : m ≠ 0) : Function.Surjective (toSpanSingleton R M m) := by
rw [← range_eq_top, ← span_singleton_eq_range, span_singleton_eq_top R hm]
1,700
import Mathlib.LinearAlgebra.Isomorphisms import Mathlib.LinearAlgebra.Projection import Mathlib.Order.JordanHolder import Mathlib.Order.CompactlyGenerated.Intervals import Mathlib.LinearAlgebra.FiniteDimensional #align_import ring_theory.simple_module from "leanprover-community/mathlib"@"cce7f68a7eaadadf74c82bbac20721cdc03a1cc1" variable {ι : Type*} (R S : Type*) [Ring R] [Ring S] (M : Type*) [AddCommGroup M] [Module R M] abbrev IsSimpleModule := IsSimpleOrder (Submodule R M) #align is_simple_module IsSimpleModule abbrev IsSemisimpleModule := ComplementedLattice (Submodule R M) #align is_semisimple_module IsSemisimpleModule abbrev IsSemisimpleRing := IsSemisimpleModule R R theorem RingEquiv.isSemisimpleRing (e : R ≃+* S) [IsSemisimpleRing R] : IsSemisimpleRing S := (Submodule.orderIsoMapComap e.toSemilinearEquiv).complementedLattice -- Making this an instance causes the linter to complain of "dangerous instances" theorem IsSimpleModule.nontrivial [IsSimpleModule R M] : Nontrivial M := ⟨⟨0, by have h : (⊥ : Submodule R M) ≠ ⊤ := bot_ne_top contrapose! h ext x simp [Submodule.mem_bot, Submodule.mem_top, h x]⟩⟩ #align is_simple_module.nontrivial IsSimpleModule.nontrivial variable {m : Submodule R M} {N : Type*} [AddCommGroup N] [Module R N] {R S M} theorem LinearMap.isSimpleModule_iff_of_bijective [Module S N] {σ : R →+* S} [RingHomSurjective σ] (l : M →ₛₗ[σ] N) (hl : Function.Bijective l) : IsSimpleModule R M ↔ IsSimpleModule S N := (Submodule.orderIsoMapComapOfBijective l hl).isSimpleOrder_iff theorem IsSimpleModule.congr (l : M ≃ₗ[R] N) [IsSimpleModule R N] : IsSimpleModule R M := (Submodule.orderIsoMapComap l).isSimpleOrder #align is_simple_module.congr IsSimpleModule.congr theorem isSimpleModule_iff_isAtom : IsSimpleModule R m ↔ IsAtom m := by rw [← Set.isSimpleOrder_Iic_iff_isAtom] exact m.mapIic.isSimpleOrder_iff #align is_simple_module_iff_is_atom isSimpleModule_iff_isAtom theorem isSimpleModule_iff_isCoatom : IsSimpleModule R (M ⧸ m) ↔ IsCoatom m := by rw [← Set.isSimpleOrder_Ici_iff_isCoatom] apply OrderIso.isSimpleOrder_iff exact Submodule.comapMkQRelIso m #align is_simple_module_iff_is_coatom isSimpleModule_iff_isCoatom theorem covBy_iff_quot_is_simple {A B : Submodule R M} (hAB : A ≤ B) : A ⋖ B ↔ IsSimpleModule R (B ⧸ Submodule.comap B.subtype A) := by set f : Submodule R B ≃o Set.Iic B := B.mapIic with hf rw [covBy_iff_coatom_Iic hAB, isSimpleModule_iff_isCoatom, ← OrderIso.isCoatom_iff f, hf] simp [-OrderIso.isCoatom_iff, Submodule.map_comap_subtype, inf_eq_right.2 hAB] #align covby_iff_quot_is_simple covBy_iff_quot_is_simple namespace IsSimpleModule @[simp] theorem isAtom [IsSimpleModule R m] : IsAtom m := isSimpleModule_iff_isAtom.1 ‹_› #align is_simple_module.is_atom IsSimpleModule.isAtom variable [IsSimpleModule R M] (R) open LinearMap theorem span_singleton_eq_top {m : M} (hm : m ≠ 0) : Submodule.span R {m} = ⊤ := (eq_bot_or_eq_top _).resolve_left fun h ↦ hm (h.le <| Submodule.mem_span_singleton_self m) instance (S : Submodule R M) : S.IsPrincipal where principal' := by obtain rfl | rfl := eq_bot_or_eq_top S · exact ⟨0, Submodule.span_zero.symm⟩ have := IsSimpleModule.nontrivial R M have ⟨m, hm⟩ := exists_ne (0 : M) exact ⟨m, (span_singleton_eq_top R hm).symm⟩ theorem toSpanSingleton_surjective {m : M} (hm : m ≠ 0) : Function.Surjective (toSpanSingleton R M m) := by rw [← range_eq_top, ← span_singleton_eq_range, span_singleton_eq_top R hm]
Mathlib/RingTheory/SimpleModule.lean
129
132
theorem ker_toSpanSingleton_isMaximal {m : M} (hm : m ≠ 0) : Ideal.IsMaximal (ker (toSpanSingleton R M m)) := by
rw [Ideal.isMaximal_def, ← isSimpleModule_iff_isCoatom] exact congr (quotKerEquivOfSurjective _ <| toSpanSingleton_surjective R hm)
1,700
import Mathlib.Algebra.MonoidAlgebra.Basic import Mathlib.LinearAlgebra.Basis.VectorSpace import Mathlib.RingTheory.SimpleModule #align_import representation_theory.maschke from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" universe u v w noncomputable section open Module MonoidAlgebra namespace LinearMap -- At first we work with any `[CommRing k]`, and add the assumption that -- `[Invertible (Fintype.card G : k)]` when it is required. variable {k : Type u} [CommRing k] {G : Type u} [Group G] variable {V : Type v} [AddCommGroup V] [Module k V] [Module (MonoidAlgebra k G) V] variable [IsScalarTower k (MonoidAlgebra k G) V] variable {W : Type w} [AddCommGroup W] [Module k W] [Module (MonoidAlgebra k G) W] variable [IsScalarTower k (MonoidAlgebra k G) W] variable (π : W →ₗ[k] V) def conjugate (g : G) : W →ₗ[k] V := .comp (.comp (GroupSMul.linearMap k V g⁻¹) π) (GroupSMul.linearMap k W g) #align linear_map.conjugate LinearMap.conjugate theorem conjugate_apply (g : G) (v : W) : π.conjugate g v = MonoidAlgebra.single g⁻¹ (1 : k) • π (MonoidAlgebra.single g (1 : k) • v) := rfl variable (i : V →ₗ[MonoidAlgebra k G] W) (h : ∀ v : V, (π : W → V) (i v) = v) section
Mathlib/RepresentationTheory/Maschke.lean
81
83
theorem conjugate_i (g : G) (v : V) : (conjugate π g : W → V) (i v) = v := by
rw [conjugate_apply, ← i.map_smul, h, ← mul_smul, single_mul_single, mul_one, mul_left_inv, ← one_def, one_smul]
1,701
import Mathlib.Algebra.MonoidAlgebra.Basic import Mathlib.LinearAlgebra.Basis.VectorSpace import Mathlib.RingTheory.SimpleModule #align_import representation_theory.maschke from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" universe u v w noncomputable section open Module MonoidAlgebra namespace LinearMap -- At first we work with any `[CommRing k]`, and add the assumption that -- `[Invertible (Fintype.card G : k)]` when it is required. variable {k : Type u} [CommRing k] {G : Type u} [Group G] variable {V : Type v} [AddCommGroup V] [Module k V] [Module (MonoidAlgebra k G) V] variable [IsScalarTower k (MonoidAlgebra k G) V] variable {W : Type w} [AddCommGroup W] [Module k W] [Module (MonoidAlgebra k G) W] variable [IsScalarTower k (MonoidAlgebra k G) W] variable (π : W →ₗ[k] V) def conjugate (g : G) : W →ₗ[k] V := .comp (.comp (GroupSMul.linearMap k V g⁻¹) π) (GroupSMul.linearMap k W g) #align linear_map.conjugate LinearMap.conjugate theorem conjugate_apply (g : G) (v : W) : π.conjugate g v = MonoidAlgebra.single g⁻¹ (1 : k) • π (MonoidAlgebra.single g (1 : k) • v) := rfl variable (i : V →ₗ[MonoidAlgebra k G] W) (h : ∀ v : V, (π : W → V) (i v) = v) section theorem conjugate_i (g : G) (v : V) : (conjugate π g : W → V) (i v) = v := by rw [conjugate_apply, ← i.map_smul, h, ← mul_smul, single_mul_single, mul_one, mul_left_inv, ← one_def, one_smul] #align linear_map.conjugate_i LinearMap.conjugate_i end variable (G) [Fintype G] def sumOfConjugates : W →ₗ[k] V := ∑ g : G, π.conjugate g #align linear_map.sum_of_conjugates LinearMap.sumOfConjugates lemma sumOfConjugates_apply (v : W) : π.sumOfConjugates G v = ∑ g : G, π.conjugate g v := LinearMap.sum_apply _ _ _ def sumOfConjugatesEquivariant : W →ₗ[MonoidAlgebra k G] V := MonoidAlgebra.equivariantOfLinearOfComm (π.sumOfConjugates G) fun g v => by simp only [sumOfConjugates_apply, Finset.smul_sum, conjugate_apply] refine Fintype.sum_bijective (· * g) (Group.mulRight_bijective g) _ _ fun i ↦ ?_ simp only [smul_smul, single_mul_single, mul_inv_rev, mul_inv_cancel_left, one_mul] #align linear_map.sum_of_conjugates_equivariant LinearMap.sumOfConjugatesEquivariant theorem sumOfConjugatesEquivariant_apply (v : W) : π.sumOfConjugatesEquivariant G v = ∑ g : G, π.conjugate g v := π.sumOfConjugates_apply G v section variable [Invertible (Fintype.card G : k)] def equivariantProjection : W →ₗ[MonoidAlgebra k G] V := ⅟(Fintype.card G : k) • π.sumOfConjugatesEquivariant G #align linear_map.equivariant_projection LinearMap.equivariantProjection
Mathlib/RepresentationTheory/Maschke.lean
125
127
theorem equivariantProjection_apply (v : W) : π.equivariantProjection G v = ⅟(Fintype.card G : k) • ∑ g : G, π.conjugate g v := by
simp only [equivariantProjection, smul_apply, sumOfConjugatesEquivariant_apply]
1,701
import Mathlib.Algebra.MonoidAlgebra.Basic import Mathlib.LinearAlgebra.Basis.VectorSpace import Mathlib.RingTheory.SimpleModule #align_import representation_theory.maschke from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" universe u v w noncomputable section open Module MonoidAlgebra namespace LinearMap -- At first we work with any `[CommRing k]`, and add the assumption that -- `[Invertible (Fintype.card G : k)]` when it is required. variable {k : Type u} [CommRing k] {G : Type u} [Group G] variable {V : Type v} [AddCommGroup V] [Module k V] [Module (MonoidAlgebra k G) V] variable [IsScalarTower k (MonoidAlgebra k G) V] variable {W : Type w} [AddCommGroup W] [Module k W] [Module (MonoidAlgebra k G) W] variable [IsScalarTower k (MonoidAlgebra k G) W] variable (π : W →ₗ[k] V) def conjugate (g : G) : W →ₗ[k] V := .comp (.comp (GroupSMul.linearMap k V g⁻¹) π) (GroupSMul.linearMap k W g) #align linear_map.conjugate LinearMap.conjugate theorem conjugate_apply (g : G) (v : W) : π.conjugate g v = MonoidAlgebra.single g⁻¹ (1 : k) • π (MonoidAlgebra.single g (1 : k) • v) := rfl variable (i : V →ₗ[MonoidAlgebra k G] W) (h : ∀ v : V, (π : W → V) (i v) = v) section theorem conjugate_i (g : G) (v : V) : (conjugate π g : W → V) (i v) = v := by rw [conjugate_apply, ← i.map_smul, h, ← mul_smul, single_mul_single, mul_one, mul_left_inv, ← one_def, one_smul] #align linear_map.conjugate_i LinearMap.conjugate_i end variable (G) [Fintype G] def sumOfConjugates : W →ₗ[k] V := ∑ g : G, π.conjugate g #align linear_map.sum_of_conjugates LinearMap.sumOfConjugates lemma sumOfConjugates_apply (v : W) : π.sumOfConjugates G v = ∑ g : G, π.conjugate g v := LinearMap.sum_apply _ _ _ def sumOfConjugatesEquivariant : W →ₗ[MonoidAlgebra k G] V := MonoidAlgebra.equivariantOfLinearOfComm (π.sumOfConjugates G) fun g v => by simp only [sumOfConjugates_apply, Finset.smul_sum, conjugate_apply] refine Fintype.sum_bijective (· * g) (Group.mulRight_bijective g) _ _ fun i ↦ ?_ simp only [smul_smul, single_mul_single, mul_inv_rev, mul_inv_cancel_left, one_mul] #align linear_map.sum_of_conjugates_equivariant LinearMap.sumOfConjugatesEquivariant theorem sumOfConjugatesEquivariant_apply (v : W) : π.sumOfConjugatesEquivariant G v = ∑ g : G, π.conjugate g v := π.sumOfConjugates_apply G v section variable [Invertible (Fintype.card G : k)] def equivariantProjection : W →ₗ[MonoidAlgebra k G] V := ⅟(Fintype.card G : k) • π.sumOfConjugatesEquivariant G #align linear_map.equivariant_projection LinearMap.equivariantProjection theorem equivariantProjection_apply (v : W) : π.equivariantProjection G v = ⅟(Fintype.card G : k) • ∑ g : G, π.conjugate g v := by simp only [equivariantProjection, smul_apply, sumOfConjugatesEquivariant_apply]
Mathlib/RepresentationTheory/Maschke.lean
129
133
theorem equivariantProjection_condition (v : V) : (π.equivariantProjection G) (i v) = v := by
rw [equivariantProjection_apply] simp only [conjugate_i π i h] rw [Finset.sum_const, Finset.card_univ, nsmul_eq_smul_cast k, smul_smul, Invertible.invOf_mul_self, one_smul]
1,701
import Mathlib.RingTheory.SimpleModule import Mathlib.Topology.Algebra.Module.Basic #align_import topology.algebra.module.simple from "leanprover-community/mathlib"@"f430769b562e0cedef59ee1ed968d67e0e0c86ba" universe u v w variable {R : Type u} {M : Type v} {N : Type w} [Ring R] [TopologicalSpace R] [TopologicalSpace M] [AddCommGroup M] [AddCommGroup N] [Module R M] [ContinuousSMul R M] [Module R N] [ContinuousAdd M] [IsSimpleModule R N]
Mathlib/Topology/Algebra/Module/Simple.lean
28
34
theorem LinearMap.isClosed_or_dense_ker (l : M →ₗ[R] N) : IsClosed (LinearMap.ker l : Set M) ∨ Dense (LinearMap.ker l : Set M) := by
rcases l.surjective_or_eq_zero with (hl | rfl) · exact l.ker.isClosed_or_dense_of_isCoatom (LinearMap.isCoatom_ker_of_surjective hl) · rw [LinearMap.ker_zero] left exact isClosed_univ
1,702
import Mathlib.LinearAlgebra.Dimension.DivisionRing import Mathlib.LinearAlgebra.Dimension.FreeAndStrongRankCondition noncomputable section universe u v v' v'' variable {K : Type u} {V V₁ : Type v} {V' V'₁ : Type v'} {V'' : Type v''} open Cardinal Basis Submodule Function Set namespace LinearMap section Ring variable [Ring K] [AddCommGroup V] [Module K V] [AddCommGroup V₁] [Module K V₁] variable [AddCommGroup V'] [Module K V'] abbrev rank (f : V →ₗ[K] V') : Cardinal := Module.rank K (LinearMap.range f) #align linear_map.rank LinearMap.rank theorem rank_le_range (f : V →ₗ[K] V') : rank f ≤ Module.rank K V' := rank_submodule_le _ #align linear_map.rank_le_range LinearMap.rank_le_range theorem rank_le_domain (f : V →ₗ[K] V₁) : rank f ≤ Module.rank K V := rank_range_le _ #align linear_map.rank_le_domain LinearMap.rank_le_domain @[simp]
Mathlib/LinearAlgebra/Dimension/LinearMap.lean
46
47
theorem rank_zero [Nontrivial K] : rank (0 : V →ₗ[K] V') = 0 := by
rw [rank, LinearMap.range_zero, rank_bot]
1,703
import Mathlib.LinearAlgebra.Dimension.DivisionRing import Mathlib.LinearAlgebra.Dimension.FreeAndStrongRankCondition noncomputable section universe u v v' v'' variable {K : Type u} {V V₁ : Type v} {V' V'₁ : Type v'} {V'' : Type v''} open Cardinal Basis Submodule Function Set namespace LinearMap section Ring variable [Ring K] [AddCommGroup V] [Module K V] [AddCommGroup V₁] [Module K V₁] variable [AddCommGroup V'] [Module K V'] abbrev rank (f : V →ₗ[K] V') : Cardinal := Module.rank K (LinearMap.range f) #align linear_map.rank LinearMap.rank theorem rank_le_range (f : V →ₗ[K] V') : rank f ≤ Module.rank K V' := rank_submodule_le _ #align linear_map.rank_le_range LinearMap.rank_le_range theorem rank_le_domain (f : V →ₗ[K] V₁) : rank f ≤ Module.rank K V := rank_range_le _ #align linear_map.rank_le_domain LinearMap.rank_le_domain @[simp] theorem rank_zero [Nontrivial K] : rank (0 : V →ₗ[K] V') = 0 := by rw [rank, LinearMap.range_zero, rank_bot] #align linear_map.rank_zero LinearMap.rank_zero variable [AddCommGroup V''] [Module K V'']
Mathlib/LinearAlgebra/Dimension/LinearMap.lean
52
55
theorem rank_comp_le_left (g : V →ₗ[K] V') (f : V' →ₗ[K] V'') : rank (f.comp g) ≤ rank f := by
refine rank_le_of_submodule _ _ ?_ rw [LinearMap.range_comp] exact LinearMap.map_le_range
1,703
import Mathlib.LinearAlgebra.Dimension.DivisionRing import Mathlib.LinearAlgebra.Dimension.FreeAndStrongRankCondition noncomputable section universe u v v' v'' variable {K : Type u} {V V₁ : Type v} {V' V'₁ : Type v'} {V'' : Type v''} open Cardinal Basis Submodule Function Set namespace LinearMap section Ring variable [Ring K] [AddCommGroup V] [Module K V] [AddCommGroup V₁] [Module K V₁] variable [AddCommGroup V'] [Module K V'] abbrev rank (f : V →ₗ[K] V') : Cardinal := Module.rank K (LinearMap.range f) #align linear_map.rank LinearMap.rank theorem rank_le_range (f : V →ₗ[K] V') : rank f ≤ Module.rank K V' := rank_submodule_le _ #align linear_map.rank_le_range LinearMap.rank_le_range theorem rank_le_domain (f : V →ₗ[K] V₁) : rank f ≤ Module.rank K V := rank_range_le _ #align linear_map.rank_le_domain LinearMap.rank_le_domain @[simp] theorem rank_zero [Nontrivial K] : rank (0 : V →ₗ[K] V') = 0 := by rw [rank, LinearMap.range_zero, rank_bot] #align linear_map.rank_zero LinearMap.rank_zero variable [AddCommGroup V''] [Module K V''] theorem rank_comp_le_left (g : V →ₗ[K] V') (f : V' →ₗ[K] V'') : rank (f.comp g) ≤ rank f := by refine rank_le_of_submodule _ _ ?_ rw [LinearMap.range_comp] exact LinearMap.map_le_range #align linear_map.rank_comp_le_left LinearMap.rank_comp_le_left
Mathlib/LinearAlgebra/Dimension/LinearMap.lean
58
60
theorem lift_rank_comp_le_right (g : V →ₗ[K] V') (f : V' →ₗ[K] V'') : Cardinal.lift.{v'} (rank (f.comp g)) ≤ Cardinal.lift.{v''} (rank g) := by
rw [rank, rank, LinearMap.range_comp]; exact lift_rank_map_le _ _
1,703
import Mathlib.LinearAlgebra.Dimension.DivisionRing import Mathlib.LinearAlgebra.Dimension.FreeAndStrongRankCondition noncomputable section universe u v v' v'' variable {K : Type u} {V V₁ : Type v} {V' V'₁ : Type v'} {V'' : Type v''} open Cardinal Basis Submodule Function Set namespace LinearMap section Ring variable [Ring K] [AddCommGroup V] [Module K V] [AddCommGroup V₁] [Module K V₁] variable [AddCommGroup V'] [Module K V'] abbrev rank (f : V →ₗ[K] V') : Cardinal := Module.rank K (LinearMap.range f) #align linear_map.rank LinearMap.rank theorem rank_le_range (f : V →ₗ[K] V') : rank f ≤ Module.rank K V' := rank_submodule_le _ #align linear_map.rank_le_range LinearMap.rank_le_range theorem rank_le_domain (f : V →ₗ[K] V₁) : rank f ≤ Module.rank K V := rank_range_le _ #align linear_map.rank_le_domain LinearMap.rank_le_domain @[simp] theorem rank_zero [Nontrivial K] : rank (0 : V →ₗ[K] V') = 0 := by rw [rank, LinearMap.range_zero, rank_bot] #align linear_map.rank_zero LinearMap.rank_zero variable [AddCommGroup V''] [Module K V''] theorem rank_comp_le_left (g : V →ₗ[K] V') (f : V' →ₗ[K] V'') : rank (f.comp g) ≤ rank f := by refine rank_le_of_submodule _ _ ?_ rw [LinearMap.range_comp] exact LinearMap.map_le_range #align linear_map.rank_comp_le_left LinearMap.rank_comp_le_left theorem lift_rank_comp_le_right (g : V →ₗ[K] V') (f : V' →ₗ[K] V'') : Cardinal.lift.{v'} (rank (f.comp g)) ≤ Cardinal.lift.{v''} (rank g) := by rw [rank, rank, LinearMap.range_comp]; exact lift_rank_map_le _ _ #align linear_map.lift_rank_comp_le_right LinearMap.lift_rank_comp_le_right theorem lift_rank_comp_le (g : V →ₗ[K] V') (f : V' →ₗ[K] V'') : Cardinal.lift.{v'} (rank (f.comp g)) ≤ min (Cardinal.lift.{v'} (rank f)) (Cardinal.lift.{v''} (rank g)) := le_min (Cardinal.lift_le.mpr <| rank_comp_le_left _ _) (lift_rank_comp_le_right _ _) #align linear_map.lift_rank_comp_le LinearMap.lift_rank_comp_le variable [AddCommGroup V'₁] [Module K V'₁]
Mathlib/LinearAlgebra/Dimension/LinearMap.lean
72
73
theorem rank_comp_le_right (g : V →ₗ[K] V') (f : V' →ₗ[K] V'₁) : rank (f.comp g) ≤ rank g := by
simpa only [Cardinal.lift_id] using lift_rank_comp_le_right g f
1,703
import Mathlib.LinearAlgebra.Dimension.DivisionRing import Mathlib.LinearAlgebra.Dimension.FreeAndStrongRankCondition noncomputable section universe u v v' v'' variable {K : Type u} {V V₁ : Type v} {V' V'₁ : Type v'} {V'' : Type v''} open Cardinal Basis Submodule Function Set namespace LinearMap section Ring variable [Ring K] [AddCommGroup V] [Module K V] [AddCommGroup V₁] [Module K V₁] variable [AddCommGroup V'] [Module K V'] abbrev rank (f : V →ₗ[K] V') : Cardinal := Module.rank K (LinearMap.range f) #align linear_map.rank LinearMap.rank theorem rank_le_range (f : V →ₗ[K] V') : rank f ≤ Module.rank K V' := rank_submodule_le _ #align linear_map.rank_le_range LinearMap.rank_le_range theorem rank_le_domain (f : V →ₗ[K] V₁) : rank f ≤ Module.rank K V := rank_range_le _ #align linear_map.rank_le_domain LinearMap.rank_le_domain @[simp] theorem rank_zero [Nontrivial K] : rank (0 : V →ₗ[K] V') = 0 := by rw [rank, LinearMap.range_zero, rank_bot] #align linear_map.rank_zero LinearMap.rank_zero variable [AddCommGroup V''] [Module K V''] theorem rank_comp_le_left (g : V →ₗ[K] V') (f : V' →ₗ[K] V'') : rank (f.comp g) ≤ rank f := by refine rank_le_of_submodule _ _ ?_ rw [LinearMap.range_comp] exact LinearMap.map_le_range #align linear_map.rank_comp_le_left LinearMap.rank_comp_le_left theorem lift_rank_comp_le_right (g : V →ₗ[K] V') (f : V' →ₗ[K] V'') : Cardinal.lift.{v'} (rank (f.comp g)) ≤ Cardinal.lift.{v''} (rank g) := by rw [rank, rank, LinearMap.range_comp]; exact lift_rank_map_le _ _ #align linear_map.lift_rank_comp_le_right LinearMap.lift_rank_comp_le_right theorem lift_rank_comp_le (g : V →ₗ[K] V') (f : V' →ₗ[K] V'') : Cardinal.lift.{v'} (rank (f.comp g)) ≤ min (Cardinal.lift.{v'} (rank f)) (Cardinal.lift.{v''} (rank g)) := le_min (Cardinal.lift_le.mpr <| rank_comp_le_left _ _) (lift_rank_comp_le_right _ _) #align linear_map.lift_rank_comp_le LinearMap.lift_rank_comp_le variable [AddCommGroup V'₁] [Module K V'₁] theorem rank_comp_le_right (g : V →ₗ[K] V') (f : V' →ₗ[K] V'₁) : rank (f.comp g) ≤ rank g := by simpa only [Cardinal.lift_id] using lift_rank_comp_le_right g f #align linear_map.rank_comp_le_right LinearMap.rank_comp_le_right
Mathlib/LinearAlgebra/Dimension/LinearMap.lean
79
81
theorem rank_comp_le (g : V →ₗ[K] V') (f : V' →ₗ[K] V'₁) : rank (f.comp g) ≤ min (rank f) (rank g) := by
simpa only [Cardinal.lift_id] using lift_rank_comp_le g f
1,703
import Mathlib.LinearAlgebra.Dimension.LinearMap import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition #align_import linear_algebra.free_module.finite.matrix from "leanprover-community/mathlib"@"b1c23399f01266afe392a0d8f71f599a0dad4f7b" universe u u' v w variable (R : Type u) (S : Type u') (M : Type v) (N : Type w) open Module.Free (chooseBasis ChooseBasisIndex) open FiniteDimensional (finrank) section Ring variable [Ring R] [Ring S] [AddCommGroup M] [Module R M] [Module.Free R M] [Module.Finite R M] variable [AddCommGroup N] [Module R N] [Module S N] [SMulCommClass R S N] private noncomputable def linearMapEquivFun : (M →ₗ[R] N) ≃ₗ[S] ChooseBasisIndex R M → N := (chooseBasis R M).repr.congrLeft N S ≪≫ₗ (Finsupp.lsum S).symm ≪≫ₗ LinearEquiv.piCongrRight fun _ ↦ LinearMap.ringLmapEquivSelf R S N instance Module.Free.linearMap [Module.Free S N] : Module.Free S (M →ₗ[R] N) := Module.Free.of_equiv (linearMapEquivFun R S M N).symm #align module.free.linear_map Module.Free.linearMap instance Module.Finite.linearMap [Module.Finite S N] : Module.Finite S (M →ₗ[R] N) := Module.Finite.equiv (linearMapEquivFun R S M N).symm #align module.finite.linear_map Module.Finite.linearMap variable [StrongRankCondition R] [StrongRankCondition S] [Module.Free S N] open Cardinal
Mathlib/LinearAlgebra/FreeModule/Finite/Matrix.lean
53
56
theorem FiniteDimensional.rank_linearMap : Module.rank S (M →ₗ[R] N) = lift.{w} (Module.rank R M) * lift.{v} (Module.rank S N) := by
rw [(linearMapEquivFun R S M N).rank_eq, rank_fun_eq_lift_mul, ← finrank_eq_card_chooseBasisIndex, ← finrank_eq_rank R, lift_natCast]
1,704
import Mathlib.LinearAlgebra.Dimension.LinearMap import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition #align_import linear_algebra.free_module.finite.matrix from "leanprover-community/mathlib"@"b1c23399f01266afe392a0d8f71f599a0dad4f7b" universe u u' v w variable (R : Type u) (S : Type u') (M : Type v) (N : Type w) open Module.Free (chooseBasis ChooseBasisIndex) open FiniteDimensional (finrank) section Ring variable [Ring R] [Ring S] [AddCommGroup M] [Module R M] [Module.Free R M] [Module.Finite R M] variable [AddCommGroup N] [Module R N] [Module S N] [SMulCommClass R S N] private noncomputable def linearMapEquivFun : (M →ₗ[R] N) ≃ₗ[S] ChooseBasisIndex R M → N := (chooseBasis R M).repr.congrLeft N S ≪≫ₗ (Finsupp.lsum S).symm ≪≫ₗ LinearEquiv.piCongrRight fun _ ↦ LinearMap.ringLmapEquivSelf R S N instance Module.Free.linearMap [Module.Free S N] : Module.Free S (M →ₗ[R] N) := Module.Free.of_equiv (linearMapEquivFun R S M N).symm #align module.free.linear_map Module.Free.linearMap instance Module.Finite.linearMap [Module.Finite S N] : Module.Finite S (M →ₗ[R] N) := Module.Finite.equiv (linearMapEquivFun R S M N).symm #align module.finite.linear_map Module.Finite.linearMap variable [StrongRankCondition R] [StrongRankCondition S] [Module.Free S N] open Cardinal theorem FiniteDimensional.rank_linearMap : Module.rank S (M →ₗ[R] N) = lift.{w} (Module.rank R M) * lift.{v} (Module.rank S N) := by rw [(linearMapEquivFun R S M N).rank_eq, rank_fun_eq_lift_mul, ← finrank_eq_card_chooseBasisIndex, ← finrank_eq_rank R, lift_natCast]
Mathlib/LinearAlgebra/FreeModule/Finite/Matrix.lean
59
61
theorem FiniteDimensional.finrank_linearMap : finrank S (M →ₗ[R] N) = finrank R M * finrank S N := by
simp_rw [finrank, rank_linearMap, toNat_mul, toNat_lift]
1,704
import Mathlib.LinearAlgebra.Dimension.LinearMap import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition #align_import linear_algebra.free_module.finite.matrix from "leanprover-community/mathlib"@"b1c23399f01266afe392a0d8f71f599a0dad4f7b" universe u u' v w variable (R : Type u) (S : Type u') (M : Type v) (N : Type w) open Module.Free (chooseBasis ChooseBasisIndex) open FiniteDimensional (finrank) section Ring variable [Ring R] [Ring S] [AddCommGroup M] [Module R M] [Module.Free R M] [Module.Finite R M] variable [AddCommGroup N] [Module R N] [Module S N] [SMulCommClass R S N] private noncomputable def linearMapEquivFun : (M →ₗ[R] N) ≃ₗ[S] ChooseBasisIndex R M → N := (chooseBasis R M).repr.congrLeft N S ≪≫ₗ (Finsupp.lsum S).symm ≪≫ₗ LinearEquiv.piCongrRight fun _ ↦ LinearMap.ringLmapEquivSelf R S N instance Module.Free.linearMap [Module.Free S N] : Module.Free S (M →ₗ[R] N) := Module.Free.of_equiv (linearMapEquivFun R S M N).symm #align module.free.linear_map Module.Free.linearMap instance Module.Finite.linearMap [Module.Finite S N] : Module.Finite S (M →ₗ[R] N) := Module.Finite.equiv (linearMapEquivFun R S M N).symm #align module.finite.linear_map Module.Finite.linearMap variable [StrongRankCondition R] [StrongRankCondition S] [Module.Free S N] open Cardinal theorem FiniteDimensional.rank_linearMap : Module.rank S (M →ₗ[R] N) = lift.{w} (Module.rank R M) * lift.{v} (Module.rank S N) := by rw [(linearMapEquivFun R S M N).rank_eq, rank_fun_eq_lift_mul, ← finrank_eq_card_chooseBasisIndex, ← finrank_eq_rank R, lift_natCast] theorem FiniteDimensional.finrank_linearMap : finrank S (M →ₗ[R] N) = finrank R M * finrank S N := by simp_rw [finrank, rank_linearMap, toNat_mul, toNat_lift] #align finite_dimensional.finrank_linear_map FiniteDimensional.finrank_linearMap variable [Module R S] [SMulCommClass R S S]
Mathlib/LinearAlgebra/FreeModule/Finite/Matrix.lean
66
68
theorem FiniteDimensional.rank_linearMap_self : Module.rank S (M →ₗ[R] S) = lift.{u'} (Module.rank R M) := by
rw [rank_linearMap, rank_self, lift_one, mul_one]
1,704
import Mathlib.LinearAlgebra.Dimension.LinearMap import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition #align_import linear_algebra.free_module.finite.matrix from "leanprover-community/mathlib"@"b1c23399f01266afe392a0d8f71f599a0dad4f7b" universe u u' v w variable (R : Type u) (S : Type u') (M : Type v) (N : Type w) open Module.Free (chooseBasis ChooseBasisIndex) open FiniteDimensional (finrank) section Ring variable [Ring R] [Ring S] [AddCommGroup M] [Module R M] [Module.Free R M] [Module.Finite R M] variable [AddCommGroup N] [Module R N] [Module S N] [SMulCommClass R S N] private noncomputable def linearMapEquivFun : (M →ₗ[R] N) ≃ₗ[S] ChooseBasisIndex R M → N := (chooseBasis R M).repr.congrLeft N S ≪≫ₗ (Finsupp.lsum S).symm ≪≫ₗ LinearEquiv.piCongrRight fun _ ↦ LinearMap.ringLmapEquivSelf R S N instance Module.Free.linearMap [Module.Free S N] : Module.Free S (M →ₗ[R] N) := Module.Free.of_equiv (linearMapEquivFun R S M N).symm #align module.free.linear_map Module.Free.linearMap instance Module.Finite.linearMap [Module.Finite S N] : Module.Finite S (M →ₗ[R] N) := Module.Finite.equiv (linearMapEquivFun R S M N).symm #align module.finite.linear_map Module.Finite.linearMap variable [StrongRankCondition R] [StrongRankCondition S] [Module.Free S N] open Cardinal theorem FiniteDimensional.rank_linearMap : Module.rank S (M →ₗ[R] N) = lift.{w} (Module.rank R M) * lift.{v} (Module.rank S N) := by rw [(linearMapEquivFun R S M N).rank_eq, rank_fun_eq_lift_mul, ← finrank_eq_card_chooseBasisIndex, ← finrank_eq_rank R, lift_natCast] theorem FiniteDimensional.finrank_linearMap : finrank S (M →ₗ[R] N) = finrank R M * finrank S N := by simp_rw [finrank, rank_linearMap, toNat_mul, toNat_lift] #align finite_dimensional.finrank_linear_map FiniteDimensional.finrank_linearMap variable [Module R S] [SMulCommClass R S S] theorem FiniteDimensional.rank_linearMap_self : Module.rank S (M →ₗ[R] S) = lift.{u'} (Module.rank R M) := by rw [rank_linearMap, rank_self, lift_one, mul_one]
Mathlib/LinearAlgebra/FreeModule/Finite/Matrix.lean
70
71
theorem FiniteDimensional.finrank_linearMap_self : finrank S (M →ₗ[R] S) = finrank R M := by
rw [finrank_linearMap, finrank_self, mul_one]
1,704
import Mathlib.LinearAlgebra.Dimension.LinearMap import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition #align_import linear_algebra.free_module.finite.matrix from "leanprover-community/mathlib"@"b1c23399f01266afe392a0d8f71f599a0dad4f7b" universe u u' v w variable (R : Type u) (S : Type u') (M : Type v) (N : Type w) open Module.Free (chooseBasis ChooseBasisIndex) open FiniteDimensional (finrank)
Mathlib/LinearAlgebra/FreeModule/Finite/Matrix.lean
113
119
theorem Matrix.rank_vecMulVec {K m n : Type u} [CommRing K] [Fintype n] [DecidableEq n] (w : m → K) (v : n → K) : (Matrix.vecMulVec w v).toLin'.rank ≤ 1 := by
nontriviality K rw [Matrix.vecMulVec_eq, Matrix.toLin'_mul] refine le_trans (LinearMap.rank_comp_le_left _ _) ?_ refine (LinearMap.rank_le_domain _).trans_eq ?_ rw [rank_fun', Fintype.card_unit, Nat.cast_one]
1,704
import Mathlib.Algebra.Module.Submodule.Localization import Mathlib.LinearAlgebra.Dimension.DivisionRing import Mathlib.RingTheory.Localization.FractionRing import Mathlib.RingTheory.OreLocalization.OreSet open Cardinal nonZeroDivisors section CommRing universe u u' v v' variable {R : Type u} (S : Type u') {M : Type v} {N : Type v'} variable [CommRing R] [CommRing S] [AddCommGroup M] [AddCommGroup N] variable [Module R M] [Module R N] [Algebra R S] [Module S N] [IsScalarTower R S N] variable (p : Submonoid R) [IsLocalization p S] (f : M →ₗ[R] N) [IsLocalizedModule p f] variable (hp : p ≤ R⁰) variable {S} in lemma IsLocalizedModule.linearIndependent_lift {ι} {v : ι → N} (hf : LinearIndependent S v) : ∃ w : ι → M, LinearIndependent R w := by choose sec hsec using IsLocalizedModule.surj p f use fun i ↦ (sec (v i)).1 rw [linearIndependent_iff'] at hf ⊢ intro t g hg i hit apply hp (sec (v i)).2.prop apply IsLocalization.injective S hp rw [map_zero] refine hf t (fun i ↦ algebraMap R S (g i * (sec (v i)).2)) ?_ _ hit simp only [map_mul, mul_smul, algebraMap_smul, ← Submonoid.smul_def, hsec, ← map_smul, ← map_sum, hg, map_zero] lemma IsLocalizedModule.lift_rank_eq : Cardinal.lift.{v} (Module.rank S N) = Cardinal.lift.{v'} (Module.rank R M) := by cases' subsingleton_or_nontrivial R · have := (algebraMap R S).codomain_trivial; simp only [rank_subsingleton, lift_one] have := (IsLocalization.injective S hp).nontrivial apply le_antisymm · rw [Module.rank_def, lift_iSup (bddAbove_range.{v', v'} _)] apply ciSup_le' intro ⟨s, hs⟩ exact (IsLocalizedModule.linearIndependent_lift p f hp hs).choose_spec.cardinal_lift_le_rank · rw [Module.rank_def, lift_iSup (bddAbove_range.{v, v} _)] apply ciSup_le' intro ⟨s, hs⟩ choose sec hsec using IsLocalization.surj p (S := S) refine LinearIndependent.cardinal_lift_le_rank (ι := s) (v := fun i ↦ f i) ?_ rw [linearIndependent_iff'] at hs ⊢ intro t g hg i hit apply (IsLocalization.map_units S (sec (g i)).2).mul_left_injective classical let u := fun (i : s) ↦ (t.erase i).prod (fun j ↦ (sec (g j)).2) have : f (t.sum fun i ↦ u i • (sec (g i)).1 • i) = f 0 := by convert congr_arg (t.prod (fun j ↦ (sec (g j)).2) • ·) hg · simp only [map_sum, map_smul, Submonoid.smul_def, Finset.smul_sum] apply Finset.sum_congr rfl intro j hj simp only [u, ← @IsScalarTower.algebraMap_smul R S N, Submonoid.coe_finset_prod, map_prod] rw [← hsec, mul_comm (g j), mul_smul, ← mul_smul, Finset.prod_erase_mul (h := hj)] rw [map_zero, smul_zero] obtain ⟨c, hc⟩ := IsLocalizedModule.exists_of_eq (S := p) this simp_rw [smul_zero, Finset.smul_sum, ← mul_smul, Submonoid.smul_def, ← mul_smul, mul_comm] at hc simp only [hsec, zero_mul, map_eq_zero_iff (algebraMap R S) (IsLocalization.injective S hp)] apply hp (c * u i).prop exact hs t _ hc _ hit lemma IsLocalizedModule.rank_eq {N : Type v} [AddCommGroup N] [Module R N] [Module S N] [IsScalarTower R S N] (f : M →ₗ[R] N) [IsLocalizedModule p f] : Module.rank S N = Module.rank R M := by simpa using IsLocalizedModule.lift_rank_eq S p f hp variable (R M) in
Mathlib/LinearAlgebra/Dimension/Localization.lean
85
93
theorem exists_set_linearIndependent_of_isDomain [IsDomain R] : ∃ s : Set M, #s = Module.rank R M ∧ LinearIndependent (ι := s) R Subtype.val := by
obtain ⟨w, hw⟩ := IsLocalizedModule.linearIndependent_lift R⁰ (LocalizedModule.mkLinearMap R⁰ M) le_rfl (Module.Free.chooseBasis (FractionRing R) (LocalizedModule R⁰ M)).linearIndependent refine ⟨Set.range w, ?_, (linearIndependent_subtype_range hw.injective).mpr hw⟩ apply Cardinal.lift_injective.{max u v} rw [Cardinal.mk_range_eq_of_injective hw.injective, ← Module.Free.rank_eq_card_chooseBasisIndex, IsLocalizedModule.lift_rank_eq (FractionRing R) R⁰ (LocalizedModule.mkLinearMap R⁰ M) le_rfl]
1,705
import Mathlib.Algebra.Module.Submodule.Localization import Mathlib.LinearAlgebra.Dimension.DivisionRing import Mathlib.RingTheory.Localization.FractionRing import Mathlib.RingTheory.OreLocalization.OreSet open Cardinal nonZeroDivisors section CommRing universe u u' v v' variable {R : Type u} (S : Type u') {M : Type v} {N : Type v'} variable [CommRing R] [CommRing S] [AddCommGroup M] [AddCommGroup N] variable [Module R M] [Module R N] [Algebra R S] [Module S N] [IsScalarTower R S N] variable (p : Submonoid R) [IsLocalization p S] (f : M →ₗ[R] N) [IsLocalizedModule p f] variable (hp : p ≤ R⁰) variable {S} in lemma IsLocalizedModule.linearIndependent_lift {ι} {v : ι → N} (hf : LinearIndependent S v) : ∃ w : ι → M, LinearIndependent R w := by choose sec hsec using IsLocalizedModule.surj p f use fun i ↦ (sec (v i)).1 rw [linearIndependent_iff'] at hf ⊢ intro t g hg i hit apply hp (sec (v i)).2.prop apply IsLocalization.injective S hp rw [map_zero] refine hf t (fun i ↦ algebraMap R S (g i * (sec (v i)).2)) ?_ _ hit simp only [map_mul, mul_smul, algebraMap_smul, ← Submonoid.smul_def, hsec, ← map_smul, ← map_sum, hg, map_zero] lemma IsLocalizedModule.lift_rank_eq : Cardinal.lift.{v} (Module.rank S N) = Cardinal.lift.{v'} (Module.rank R M) := by cases' subsingleton_or_nontrivial R · have := (algebraMap R S).codomain_trivial; simp only [rank_subsingleton, lift_one] have := (IsLocalization.injective S hp).nontrivial apply le_antisymm · rw [Module.rank_def, lift_iSup (bddAbove_range.{v', v'} _)] apply ciSup_le' intro ⟨s, hs⟩ exact (IsLocalizedModule.linearIndependent_lift p f hp hs).choose_spec.cardinal_lift_le_rank · rw [Module.rank_def, lift_iSup (bddAbove_range.{v, v} _)] apply ciSup_le' intro ⟨s, hs⟩ choose sec hsec using IsLocalization.surj p (S := S) refine LinearIndependent.cardinal_lift_le_rank (ι := s) (v := fun i ↦ f i) ?_ rw [linearIndependent_iff'] at hs ⊢ intro t g hg i hit apply (IsLocalization.map_units S (sec (g i)).2).mul_left_injective classical let u := fun (i : s) ↦ (t.erase i).prod (fun j ↦ (sec (g j)).2) have : f (t.sum fun i ↦ u i • (sec (g i)).1 • i) = f 0 := by convert congr_arg (t.prod (fun j ↦ (sec (g j)).2) • ·) hg · simp only [map_sum, map_smul, Submonoid.smul_def, Finset.smul_sum] apply Finset.sum_congr rfl intro j hj simp only [u, ← @IsScalarTower.algebraMap_smul R S N, Submonoid.coe_finset_prod, map_prod] rw [← hsec, mul_comm (g j), mul_smul, ← mul_smul, Finset.prod_erase_mul (h := hj)] rw [map_zero, smul_zero] obtain ⟨c, hc⟩ := IsLocalizedModule.exists_of_eq (S := p) this simp_rw [smul_zero, Finset.smul_sum, ← mul_smul, Submonoid.smul_def, ← mul_smul, mul_comm] at hc simp only [hsec, zero_mul, map_eq_zero_iff (algebraMap R S) (IsLocalization.injective S hp)] apply hp (c * u i).prop exact hs t _ hc _ hit lemma IsLocalizedModule.rank_eq {N : Type v} [AddCommGroup N] [Module R N] [Module S N] [IsScalarTower R S N] (f : M →ₗ[R] N) [IsLocalizedModule p f] : Module.rank S N = Module.rank R M := by simpa using IsLocalizedModule.lift_rank_eq S p f hp variable (R M) in theorem exists_set_linearIndependent_of_isDomain [IsDomain R] : ∃ s : Set M, #s = Module.rank R M ∧ LinearIndependent (ι := s) R Subtype.val := by obtain ⟨w, hw⟩ := IsLocalizedModule.linearIndependent_lift R⁰ (LocalizedModule.mkLinearMap R⁰ M) le_rfl (Module.Free.chooseBasis (FractionRing R) (LocalizedModule R⁰ M)).linearIndependent refine ⟨Set.range w, ?_, (linearIndependent_subtype_range hw.injective).mpr hw⟩ apply Cardinal.lift_injective.{max u v} rw [Cardinal.mk_range_eq_of_injective hw.injective, ← Module.Free.rank_eq_card_chooseBasisIndex, IsLocalizedModule.lift_rank_eq (FractionRing R) R⁰ (LocalizedModule.mkLinearMap R⁰ M) le_rfl]
Mathlib/LinearAlgebra/Dimension/Localization.lean
96
102
theorem rank_quotient_add_rank_of_isDomain [IsDomain R] (M' : Submodule R M) : Module.rank R (M ⧸ M') + Module.rank R M' = Module.rank R M := by
apply lift_injective.{max u v} rw [lift_add, ← IsLocalizedModule.lift_rank_eq (FractionRing R) R⁰ (M'.toLocalized R⁰) le_rfl, ← IsLocalizedModule.lift_rank_eq (FractionRing R) R⁰ (LocalizedModule.mkLinearMap R⁰ M) le_rfl, ← IsLocalizedModule.lift_rank_eq (FractionRing R) R⁰ (M'.toLocalizedQuotient R⁰) le_rfl, ← lift_add, rank_quotient_add_rank_of_divisionRing]
1,705
import Mathlib.Data.Finset.Sort import Mathlib.Data.Fin.VecNotation import Mathlib.Data.Sign import Mathlib.LinearAlgebra.AffineSpace.Combination import Mathlib.LinearAlgebra.AffineSpace.AffineEquiv import Mathlib.LinearAlgebra.Basis.VectorSpace #align_import linear_algebra.affine_space.independent from "leanprover-community/mathlib"@"2de9c37fa71dde2f1c6feff19876dd6a7b1519f0" noncomputable section open Finset Function open scoped Affine section AffineIndependent variable (k : Type*) {V : Type*} {P : Type*} [Ring k] [AddCommGroup V] [Module k V] variable [AffineSpace V P] {ι : Type*} def AffineIndependent (p : ι → P) : Prop := ∀ (s : Finset ι) (w : ι → k), ∑ i ∈ s, w i = 0 → s.weightedVSub p w = (0 : V) → ∀ i ∈ s, w i = 0 #align affine_independent AffineIndependent theorem affineIndependent_def (p : ι → P) : AffineIndependent k p ↔ ∀ (s : Finset ι) (w : ι → k), ∑ i ∈ s, w i = 0 → s.weightedVSub p w = (0 : V) → ∀ i ∈ s, w i = 0 := Iff.rfl #align affine_independent_def affineIndependent_def theorem affineIndependent_of_subsingleton [Subsingleton ι] (p : ι → P) : AffineIndependent k p := fun _ _ h _ i hi => Fintype.eq_of_subsingleton_of_sum_eq h i hi #align affine_independent_of_subsingleton affineIndependent_of_subsingleton
Mathlib/LinearAlgebra/AffineSpace/Independent.lean
72
81
theorem affineIndependent_iff_of_fintype [Fintype ι] (p : ι → P) : AffineIndependent k p ↔ ∀ w : ι → k, ∑ i, w i = 0 → Finset.univ.weightedVSub p w = (0 : V) → ∀ i, w i = 0 := by
constructor · exact fun h w hw hs i => h Finset.univ w hw hs i (Finset.mem_univ _) · intro h s w hw hs i hi rw [Finset.weightedVSub_indicator_subset _ _ (Finset.subset_univ s)] at hs rw [← Finset.sum_indicator_subset _ (Finset.subset_univ s)] at hw replace h := h ((↑s : Set ι).indicator w) hw hs i simpa [hi] using h
1,706
import Mathlib.Data.Finset.Sort import Mathlib.Data.Fin.VecNotation import Mathlib.Data.Sign import Mathlib.LinearAlgebra.AffineSpace.Combination import Mathlib.LinearAlgebra.AffineSpace.AffineEquiv import Mathlib.LinearAlgebra.Basis.VectorSpace #align_import linear_algebra.affine_space.independent from "leanprover-community/mathlib"@"2de9c37fa71dde2f1c6feff19876dd6a7b1519f0" noncomputable section open Finset Function open scoped Affine section AffineIndependent variable (k : Type*) {V : Type*} {P : Type*} [Ring k] [AddCommGroup V] [Module k V] variable [AffineSpace V P] {ι : Type*} def AffineIndependent (p : ι → P) : Prop := ∀ (s : Finset ι) (w : ι → k), ∑ i ∈ s, w i = 0 → s.weightedVSub p w = (0 : V) → ∀ i ∈ s, w i = 0 #align affine_independent AffineIndependent theorem affineIndependent_def (p : ι → P) : AffineIndependent k p ↔ ∀ (s : Finset ι) (w : ι → k), ∑ i ∈ s, w i = 0 → s.weightedVSub p w = (0 : V) → ∀ i ∈ s, w i = 0 := Iff.rfl #align affine_independent_def affineIndependent_def theorem affineIndependent_of_subsingleton [Subsingleton ι] (p : ι → P) : AffineIndependent k p := fun _ _ h _ i hi => Fintype.eq_of_subsingleton_of_sum_eq h i hi #align affine_independent_of_subsingleton affineIndependent_of_subsingleton theorem affineIndependent_iff_of_fintype [Fintype ι] (p : ι → P) : AffineIndependent k p ↔ ∀ w : ι → k, ∑ i, w i = 0 → Finset.univ.weightedVSub p w = (0 : V) → ∀ i, w i = 0 := by constructor · exact fun h w hw hs i => h Finset.univ w hw hs i (Finset.mem_univ _) · intro h s w hw hs i hi rw [Finset.weightedVSub_indicator_subset _ _ (Finset.subset_univ s)] at hs rw [← Finset.sum_indicator_subset _ (Finset.subset_univ s)] at hw replace h := h ((↑s : Set ι).indicator w) hw hs i simpa [hi] using h #align affine_independent_iff_of_fintype affineIndependent_iff_of_fintype
Mathlib/LinearAlgebra/AffineSpace/Independent.lean
86
134
theorem affineIndependent_iff_linearIndependent_vsub (p : ι → P) (i1 : ι) : AffineIndependent k p ↔ LinearIndependent k fun i : { x // x ≠ i1 } => (p i -ᵥ p i1 : V) := by
classical constructor · intro h rw [linearIndependent_iff'] intro s g hg i hi set f : ι → k := fun x => if hx : x = i1 then -∑ y ∈ s, g y else g ⟨x, hx⟩ with hfdef let s2 : Finset ι := insert i1 (s.map (Embedding.subtype _)) have hfg : ∀ x : { x // x ≠ i1 }, g x = f x := by intro x rw [hfdef] dsimp only erw [dif_neg x.property, Subtype.coe_eta] rw [hfg] have hf : ∑ ι ∈ s2, f ι = 0 := by rw [Finset.sum_insert (Finset.not_mem_map_subtype_of_not_property s (Classical.not_not.2 rfl)), Finset.sum_subtype_map_embedding fun x _ => (hfg x).symm] rw [hfdef] dsimp only rw [dif_pos rfl] exact neg_add_self _ have hs2 : s2.weightedVSub p f = (0 : V) := by set f2 : ι → V := fun x => f x • (p x -ᵥ p i1) with hf2def set g2 : { x // x ≠ i1 } → V := fun x => g x • (p x -ᵥ p i1) have hf2g2 : ∀ x : { x // x ≠ i1 }, f2 x = g2 x := by simp only [g2, hf2def] refine fun x => ?_ rw [hfg] rw [Finset.weightedVSub_eq_weightedVSubOfPoint_of_sum_eq_zero s2 f p hf (p i1), Finset.weightedVSubOfPoint_insert, Finset.weightedVSubOfPoint_apply, Finset.sum_subtype_map_embedding fun x _ => hf2g2 x] exact hg exact h s2 f hf hs2 i (Finset.mem_insert_of_mem (Finset.mem_map.2 ⟨i, hi, rfl⟩)) · intro h rw [linearIndependent_iff'] at h intro s w hw hs i hi rw [Finset.weightedVSub_eq_weightedVSubOfPoint_of_sum_eq_zero s w p hw (p i1), ← s.weightedVSubOfPoint_erase w p i1, Finset.weightedVSubOfPoint_apply] at hs let f : ι → V := fun i => w i • (p i -ᵥ p i1) have hs2 : (∑ i ∈ (s.erase i1).subtype fun i => i ≠ i1, f i) = 0 := by rw [← hs] convert Finset.sum_subtype_of_mem f fun x => Finset.ne_of_mem_erase have h2 := h ((s.erase i1).subtype fun i => i ≠ i1) (fun x => w x) hs2 simp_rw [Finset.mem_subtype] at h2 have h2b : ∀ i ∈ s, i ≠ i1 → w i = 0 := fun i his hi => h2 ⟨i, hi⟩ (Finset.mem_erase_of_ne_of_mem hi his) exact Finset.eq_zero_of_sum_eq_zero hw h2b i hi
1,706
import Mathlib.Data.Finset.Sort import Mathlib.Data.Fin.VecNotation import Mathlib.Data.Sign import Mathlib.LinearAlgebra.AffineSpace.Combination import Mathlib.LinearAlgebra.AffineSpace.AffineEquiv import Mathlib.LinearAlgebra.Basis.VectorSpace #align_import linear_algebra.affine_space.independent from "leanprover-community/mathlib"@"2de9c37fa71dde2f1c6feff19876dd6a7b1519f0" noncomputable section open Finset Function open scoped Affine section AffineIndependent variable (k : Type*) {V : Type*} {P : Type*} [Ring k] [AddCommGroup V] [Module k V] variable [AffineSpace V P] {ι : Type*} def AffineIndependent (p : ι → P) : Prop := ∀ (s : Finset ι) (w : ι → k), ∑ i ∈ s, w i = 0 → s.weightedVSub p w = (0 : V) → ∀ i ∈ s, w i = 0 #align affine_independent AffineIndependent theorem affineIndependent_def (p : ι → P) : AffineIndependent k p ↔ ∀ (s : Finset ι) (w : ι → k), ∑ i ∈ s, w i = 0 → s.weightedVSub p w = (0 : V) → ∀ i ∈ s, w i = 0 := Iff.rfl #align affine_independent_def affineIndependent_def theorem affineIndependent_of_subsingleton [Subsingleton ι] (p : ι → P) : AffineIndependent k p := fun _ _ h _ i hi => Fintype.eq_of_subsingleton_of_sum_eq h i hi #align affine_independent_of_subsingleton affineIndependent_of_subsingleton theorem affineIndependent_iff_of_fintype [Fintype ι] (p : ι → P) : AffineIndependent k p ↔ ∀ w : ι → k, ∑ i, w i = 0 → Finset.univ.weightedVSub p w = (0 : V) → ∀ i, w i = 0 := by constructor · exact fun h w hw hs i => h Finset.univ w hw hs i (Finset.mem_univ _) · intro h s w hw hs i hi rw [Finset.weightedVSub_indicator_subset _ _ (Finset.subset_univ s)] at hs rw [← Finset.sum_indicator_subset _ (Finset.subset_univ s)] at hw replace h := h ((↑s : Set ι).indicator w) hw hs i simpa [hi] using h #align affine_independent_iff_of_fintype affineIndependent_iff_of_fintype theorem affineIndependent_iff_linearIndependent_vsub (p : ι → P) (i1 : ι) : AffineIndependent k p ↔ LinearIndependent k fun i : { x // x ≠ i1 } => (p i -ᵥ p i1 : V) := by classical constructor · intro h rw [linearIndependent_iff'] intro s g hg i hi set f : ι → k := fun x => if hx : x = i1 then -∑ y ∈ s, g y else g ⟨x, hx⟩ with hfdef let s2 : Finset ι := insert i1 (s.map (Embedding.subtype _)) have hfg : ∀ x : { x // x ≠ i1 }, g x = f x := by intro x rw [hfdef] dsimp only erw [dif_neg x.property, Subtype.coe_eta] rw [hfg] have hf : ∑ ι ∈ s2, f ι = 0 := by rw [Finset.sum_insert (Finset.not_mem_map_subtype_of_not_property s (Classical.not_not.2 rfl)), Finset.sum_subtype_map_embedding fun x _ => (hfg x).symm] rw [hfdef] dsimp only rw [dif_pos rfl] exact neg_add_self _ have hs2 : s2.weightedVSub p f = (0 : V) := by set f2 : ι → V := fun x => f x • (p x -ᵥ p i1) with hf2def set g2 : { x // x ≠ i1 } → V := fun x => g x • (p x -ᵥ p i1) have hf2g2 : ∀ x : { x // x ≠ i1 }, f2 x = g2 x := by simp only [g2, hf2def] refine fun x => ?_ rw [hfg] rw [Finset.weightedVSub_eq_weightedVSubOfPoint_of_sum_eq_zero s2 f p hf (p i1), Finset.weightedVSubOfPoint_insert, Finset.weightedVSubOfPoint_apply, Finset.sum_subtype_map_embedding fun x _ => hf2g2 x] exact hg exact h s2 f hf hs2 i (Finset.mem_insert_of_mem (Finset.mem_map.2 ⟨i, hi, rfl⟩)) · intro h rw [linearIndependent_iff'] at h intro s w hw hs i hi rw [Finset.weightedVSub_eq_weightedVSubOfPoint_of_sum_eq_zero s w p hw (p i1), ← s.weightedVSubOfPoint_erase w p i1, Finset.weightedVSubOfPoint_apply] at hs let f : ι → V := fun i => w i • (p i -ᵥ p i1) have hs2 : (∑ i ∈ (s.erase i1).subtype fun i => i ≠ i1, f i) = 0 := by rw [← hs] convert Finset.sum_subtype_of_mem f fun x => Finset.ne_of_mem_erase have h2 := h ((s.erase i1).subtype fun i => i ≠ i1) (fun x => w x) hs2 simp_rw [Finset.mem_subtype] at h2 have h2b : ∀ i ∈ s, i ≠ i1 → w i = 0 := fun i his hi => h2 ⟨i, hi⟩ (Finset.mem_erase_of_ne_of_mem hi his) exact Finset.eq_zero_of_sum_eq_zero hw h2b i hi #align affine_independent_iff_linear_independent_vsub affineIndependent_iff_linearIndependent_vsub
Mathlib/LinearAlgebra/AffineSpace/Independent.lean
139
158
theorem affineIndependent_set_iff_linearIndependent_vsub {s : Set P} {p₁ : P} (hp₁ : p₁ ∈ s) : AffineIndependent k (fun p => p : s → P) ↔ LinearIndependent k (fun v => v : (fun p => (p -ᵥ p₁ : V)) '' (s \ {p₁}) → V) := by
rw [affineIndependent_iff_linearIndependent_vsub k (fun p => p : s → P) ⟨p₁, hp₁⟩] constructor · intro h have hv : ∀ v : (fun p => (p -ᵥ p₁ : V)) '' (s \ {p₁}), (v : V) +ᵥ p₁ ∈ s \ {p₁} := fun v => (vsub_left_injective p₁).mem_set_image.1 ((vadd_vsub (v : V) p₁).symm ▸ v.property) let f : (fun p : P => (p -ᵥ p₁ : V)) '' (s \ {p₁}) → { x : s // x ≠ ⟨p₁, hp₁⟩ } := fun x => ⟨⟨(x : V) +ᵥ p₁, Set.mem_of_mem_diff (hv x)⟩, fun hx => Set.not_mem_of_mem_diff (hv x) (Subtype.ext_iff.1 hx)⟩ convert h.comp f fun x1 x2 hx => Subtype.ext (vadd_right_cancel p₁ (Subtype.ext_iff.1 (Subtype.ext_iff.1 hx))) ext v exact (vadd_vsub (v : V) p₁).symm · intro h let f : { x : s // x ≠ ⟨p₁, hp₁⟩ } → (fun p : P => (p -ᵥ p₁ : V)) '' (s \ {p₁}) := fun x => ⟨((x : s) : P) -ᵥ p₁, ⟨x, ⟨⟨(x : s).property, fun hx => x.property (Subtype.ext hx)⟩, rfl⟩⟩⟩ convert h.comp f fun x1 x2 hx => Subtype.ext (Subtype.ext (vsub_left_cancel (Subtype.ext_iff.1 hx)))
1,706
import Mathlib.Analysis.Convex.Hull import Mathlib.LinearAlgebra.AffineSpace.Independent #align_import analysis.convex.simplicial_complex.basic from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" open Finset Set variable (𝕜 E : Type*) {ι : Type*} [OrderedRing 𝕜] [AddCommGroup E] [Module 𝕜 E] namespace Geometry -- TODO: update to new binder order? not sure what binder order is correct for `down_closed`. @[ext] structure SimplicialComplex where faces : Set (Finset E) not_empty_mem : ∅ ∉ faces indep : ∀ {s}, s ∈ faces → AffineIndependent 𝕜 ((↑) : s → E) down_closed : ∀ {s t}, s ∈ faces → t ⊆ s → t ≠ ∅ → t ∈ faces inter_subset_convexHull : ∀ {s t}, s ∈ faces → t ∈ faces → convexHull 𝕜 ↑s ∩ convexHull 𝕜 ↑t ⊆ convexHull 𝕜 (s ∩ t : Set E) #align geometry.simplicial_complex Geometry.SimplicialComplex namespace SimplicialComplex variable {𝕜 E} variable {K : SimplicialComplex 𝕜 E} {s t : Finset E} {x : E} instance : Membership (Finset E) (SimplicialComplex 𝕜 E) := ⟨fun s K => s ∈ K.faces⟩ def space (K : SimplicialComplex 𝕜 E) : Set E := ⋃ s ∈ K.faces, convexHull 𝕜 (s : Set E) #align geometry.simplicial_complex.space Geometry.SimplicialComplex.space -- Porting note: Expanded `∃ s ∈ K.faces` to get the type to match more closely with Lean 3
Mathlib/Analysis/Convex/SimplicialComplex/Basic.lean
86
87
theorem mem_space_iff : x ∈ K.space ↔ ∃ s ∈ K.faces, x ∈ convexHull 𝕜 (s : Set E) := by
simp [space]
1,707
import Mathlib.Analysis.Convex.Hull import Mathlib.LinearAlgebra.AffineSpace.Independent #align_import analysis.convex.simplicial_complex.basic from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" open Finset Set variable (𝕜 E : Type*) {ι : Type*} [OrderedRing 𝕜] [AddCommGroup E] [Module 𝕜 E] namespace Geometry -- TODO: update to new binder order? not sure what binder order is correct for `down_closed`. @[ext] structure SimplicialComplex where faces : Set (Finset E) not_empty_mem : ∅ ∉ faces indep : ∀ {s}, s ∈ faces → AffineIndependent 𝕜 ((↑) : s → E) down_closed : ∀ {s t}, s ∈ faces → t ⊆ s → t ≠ ∅ → t ∈ faces inter_subset_convexHull : ∀ {s t}, s ∈ faces → t ∈ faces → convexHull 𝕜 ↑s ∩ convexHull 𝕜 ↑t ⊆ convexHull 𝕜 (s ∩ t : Set E) #align geometry.simplicial_complex Geometry.SimplicialComplex namespace SimplicialComplex variable {𝕜 E} variable {K : SimplicialComplex 𝕜 E} {s t : Finset E} {x : E} instance : Membership (Finset E) (SimplicialComplex 𝕜 E) := ⟨fun s K => s ∈ K.faces⟩ def space (K : SimplicialComplex 𝕜 E) : Set E := ⋃ s ∈ K.faces, convexHull 𝕜 (s : Set E) #align geometry.simplicial_complex.space Geometry.SimplicialComplex.space -- Porting note: Expanded `∃ s ∈ K.faces` to get the type to match more closely with Lean 3 theorem mem_space_iff : x ∈ K.space ↔ ∃ s ∈ K.faces, x ∈ convexHull 𝕜 (s : Set E) := by simp [space] #align geometry.simplicial_complex.mem_space_iff Geometry.SimplicialComplex.mem_space_iff -- Porting note: Original proof was `:= subset_biUnion_of_mem hs`
Mathlib/Analysis/Convex/SimplicialComplex/Basic.lean
91
93
theorem convexHull_subset_space (hs : s ∈ K.faces) : convexHull 𝕜 ↑s ⊆ K.space := by
convert subset_biUnion_of_mem hs rfl
1,707
import Mathlib.Analysis.Convex.Hull import Mathlib.LinearAlgebra.AffineSpace.Independent #align_import analysis.convex.simplicial_complex.basic from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" open Finset Set variable (𝕜 E : Type*) {ι : Type*} [OrderedRing 𝕜] [AddCommGroup E] [Module 𝕜 E] namespace Geometry -- TODO: update to new binder order? not sure what binder order is correct for `down_closed`. @[ext] structure SimplicialComplex where faces : Set (Finset E) not_empty_mem : ∅ ∉ faces indep : ∀ {s}, s ∈ faces → AffineIndependent 𝕜 ((↑) : s → E) down_closed : ∀ {s t}, s ∈ faces → t ⊆ s → t ≠ ∅ → t ∈ faces inter_subset_convexHull : ∀ {s t}, s ∈ faces → t ∈ faces → convexHull 𝕜 ↑s ∩ convexHull 𝕜 ↑t ⊆ convexHull 𝕜 (s ∩ t : Set E) #align geometry.simplicial_complex Geometry.SimplicialComplex namespace SimplicialComplex variable {𝕜 E} variable {K : SimplicialComplex 𝕜 E} {s t : Finset E} {x : E} instance : Membership (Finset E) (SimplicialComplex 𝕜 E) := ⟨fun s K => s ∈ K.faces⟩ def space (K : SimplicialComplex 𝕜 E) : Set E := ⋃ s ∈ K.faces, convexHull 𝕜 (s : Set E) #align geometry.simplicial_complex.space Geometry.SimplicialComplex.space -- Porting note: Expanded `∃ s ∈ K.faces` to get the type to match more closely with Lean 3 theorem mem_space_iff : x ∈ K.space ↔ ∃ s ∈ K.faces, x ∈ convexHull 𝕜 (s : Set E) := by simp [space] #align geometry.simplicial_complex.mem_space_iff Geometry.SimplicialComplex.mem_space_iff -- Porting note: Original proof was `:= subset_biUnion_of_mem hs` theorem convexHull_subset_space (hs : s ∈ K.faces) : convexHull 𝕜 ↑s ⊆ K.space := by convert subset_biUnion_of_mem hs rfl #align geometry.simplicial_complex.convex_hull_subset_space Geometry.SimplicialComplex.convexHull_subset_space protected theorem subset_space (hs : s ∈ K.faces) : (s : Set E) ⊆ K.space := (subset_convexHull 𝕜 _).trans <| convexHull_subset_space hs #align geometry.simplicial_complex.subset_space Geometry.SimplicialComplex.subset_space theorem convexHull_inter_convexHull (hs : s ∈ K.faces) (ht : t ∈ K.faces) : convexHull 𝕜 ↑s ∩ convexHull 𝕜 ↑t = convexHull 𝕜 (s ∩ t : Set E) := (K.inter_subset_convexHull hs ht).antisymm <| subset_inter (convexHull_mono Set.inter_subset_left) <| convexHull_mono Set.inter_subset_right #align geometry.simplicial_complex.convex_hull_inter_convex_hull Geometry.SimplicialComplex.convexHull_inter_convexHull
Mathlib/Analysis/Convex/SimplicialComplex/Basic.lean
110
119
theorem disjoint_or_exists_inter_eq_convexHull (hs : s ∈ K.faces) (ht : t ∈ K.faces) : Disjoint (convexHull 𝕜 (s : Set E)) (convexHull 𝕜 ↑t) ∨ ∃ u ∈ K.faces, convexHull 𝕜 (s : Set E) ∩ convexHull 𝕜 ↑t = convexHull 𝕜 ↑u := by
classical by_contra! h refine h.2 (s ∩ t) (K.down_closed hs inter_subset_left fun hst => h.1 <| disjoint_iff_inf_le.mpr <| (K.inter_subset_convexHull hs ht).trans ?_) ?_ · rw [← coe_inter, hst, coe_empty, convexHull_empty] rfl · rw [coe_inter, convexHull_inter_convexHull hs ht]
1,707
import Mathlib.Analysis.Convex.Hull import Mathlib.LinearAlgebra.AffineSpace.Independent #align_import analysis.convex.simplicial_complex.basic from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" open Finset Set variable (𝕜 E : Type*) {ι : Type*} [OrderedRing 𝕜] [AddCommGroup E] [Module 𝕜 E] namespace Geometry -- TODO: update to new binder order? not sure what binder order is correct for `down_closed`. @[ext] structure SimplicialComplex where faces : Set (Finset E) not_empty_mem : ∅ ∉ faces indep : ∀ {s}, s ∈ faces → AffineIndependent 𝕜 ((↑) : s → E) down_closed : ∀ {s t}, s ∈ faces → t ⊆ s → t ≠ ∅ → t ∈ faces inter_subset_convexHull : ∀ {s t}, s ∈ faces → t ∈ faces → convexHull 𝕜 ↑s ∩ convexHull 𝕜 ↑t ⊆ convexHull 𝕜 (s ∩ t : Set E) #align geometry.simplicial_complex Geometry.SimplicialComplex namespace SimplicialComplex variable {𝕜 E} variable {K : SimplicialComplex 𝕜 E} {s t : Finset E} {x : E} instance : Membership (Finset E) (SimplicialComplex 𝕜 E) := ⟨fun s K => s ∈ K.faces⟩ def space (K : SimplicialComplex 𝕜 E) : Set E := ⋃ s ∈ K.faces, convexHull 𝕜 (s : Set E) #align geometry.simplicial_complex.space Geometry.SimplicialComplex.space -- Porting note: Expanded `∃ s ∈ K.faces` to get the type to match more closely with Lean 3 theorem mem_space_iff : x ∈ K.space ↔ ∃ s ∈ K.faces, x ∈ convexHull 𝕜 (s : Set E) := by simp [space] #align geometry.simplicial_complex.mem_space_iff Geometry.SimplicialComplex.mem_space_iff -- Porting note: Original proof was `:= subset_biUnion_of_mem hs` theorem convexHull_subset_space (hs : s ∈ K.faces) : convexHull 𝕜 ↑s ⊆ K.space := by convert subset_biUnion_of_mem hs rfl #align geometry.simplicial_complex.convex_hull_subset_space Geometry.SimplicialComplex.convexHull_subset_space protected theorem subset_space (hs : s ∈ K.faces) : (s : Set E) ⊆ K.space := (subset_convexHull 𝕜 _).trans <| convexHull_subset_space hs #align geometry.simplicial_complex.subset_space Geometry.SimplicialComplex.subset_space theorem convexHull_inter_convexHull (hs : s ∈ K.faces) (ht : t ∈ K.faces) : convexHull 𝕜 ↑s ∩ convexHull 𝕜 ↑t = convexHull 𝕜 (s ∩ t : Set E) := (K.inter_subset_convexHull hs ht).antisymm <| subset_inter (convexHull_mono Set.inter_subset_left) <| convexHull_mono Set.inter_subset_right #align geometry.simplicial_complex.convex_hull_inter_convex_hull Geometry.SimplicialComplex.convexHull_inter_convexHull theorem disjoint_or_exists_inter_eq_convexHull (hs : s ∈ K.faces) (ht : t ∈ K.faces) : Disjoint (convexHull 𝕜 (s : Set E)) (convexHull 𝕜 ↑t) ∨ ∃ u ∈ K.faces, convexHull 𝕜 (s : Set E) ∩ convexHull 𝕜 ↑t = convexHull 𝕜 ↑u := by classical by_contra! h refine h.2 (s ∩ t) (K.down_closed hs inter_subset_left fun hst => h.1 <| disjoint_iff_inf_le.mpr <| (K.inter_subset_convexHull hs ht).trans ?_) ?_ · rw [← coe_inter, hst, coe_empty, convexHull_empty] rfl · rw [coe_inter, convexHull_inter_convexHull hs ht] #align geometry.simplicial_complex.disjoint_or_exists_inter_eq_convex_hull Geometry.SimplicialComplex.disjoint_or_exists_inter_eq_convexHull @[simps] def ofErase (faces : Set (Finset E)) (indep : ∀ s ∈ faces, AffineIndependent 𝕜 ((↑) : s → E)) (down_closed : ∀ s ∈ faces, ∀ t ⊆ s, t ∈ faces) (inter_subset_convexHull : ∀ᵉ (s ∈ faces) (t ∈ faces), convexHull 𝕜 ↑s ∩ convexHull 𝕜 ↑t ⊆ convexHull 𝕜 (s ∩ t : Set E)) : SimplicialComplex 𝕜 E where faces := faces \ {∅} not_empty_mem h := h.2 (mem_singleton _) indep hs := indep _ hs.1 down_closed hs hts ht := ⟨down_closed _ hs.1 _ hts, ht⟩ inter_subset_convexHull hs ht := inter_subset_convexHull _ hs.1 _ ht.1 #align geometry.simplicial_complex.of_erase Geometry.SimplicialComplex.ofErase @[simps] def ofSubcomplex (K : SimplicialComplex 𝕜 E) (faces : Set (Finset E)) (subset : faces ⊆ K.faces) (down_closed : ∀ {s t}, s ∈ faces → t ⊆ s → t ∈ faces) : SimplicialComplex 𝕜 E := { faces not_empty_mem := fun h => K.not_empty_mem (subset h) indep := fun hs => K.indep (subset hs) down_closed := fun hs hts _ => down_closed hs hts inter_subset_convexHull := fun hs ht => K.inter_subset_convexHull (subset hs) (subset ht) } #align geometry.simplicial_complex.of_subcomplex Geometry.SimplicialComplex.ofSubcomplex def vertices (K : SimplicialComplex 𝕜 E) : Set E := { x | {x} ∈ K.faces } #align geometry.simplicial_complex.vertices Geometry.SimplicialComplex.vertices theorem mem_vertices : x ∈ K.vertices ↔ {x} ∈ K.faces := Iff.rfl #align geometry.simplicial_complex.mem_vertices Geometry.SimplicialComplex.mem_vertices
Mathlib/Analysis/Convex/SimplicialComplex/Basic.lean
158
162
theorem vertices_eq : K.vertices = ⋃ k ∈ K.faces, (k : Set E) := by
ext x refine ⟨fun h => mem_biUnion h <| mem_coe.2 <| mem_singleton_self x, fun h => ?_⟩ obtain ⟨s, hs, hx⟩ := mem_iUnion₂.1 h exact K.down_closed hs (Finset.singleton_subset_iff.2 <| mem_coe.1 hx) (singleton_ne_empty _)
1,707
import Mathlib.Algebra.Algebra.Bilinear import Mathlib.LinearAlgebra.Basis import Mathlib.RingTheory.Ideal.Basic #align_import ring_theory.ideal.operations from "leanprover-community/mathlib"@"e7f0ddbf65bd7181a85edb74b64bdc35ba4bdc74" namespace Ideal variable {ι R S : Type*} [CommSemiring R] [CommRing S] [IsDomain S] [Algebra R S] noncomputable def basisSpanSingleton (b : Basis ι R S) {x : S} (hx : x ≠ 0) : Basis ι R (span ({x} : Set S)) := b.map <| LinearEquiv.ofInjective (Algebra.lmul R S x) (LinearMap.mul_injective hx) ≪≫ₗ LinearEquiv.ofEq _ _ (by ext simp [mem_span_singleton', mul_comm]) ≪≫ₗ (Submodule.restrictScalarsEquiv R S S (Ideal.span ({x} : Set S))).restrictScalars R #align ideal.basis_span_singleton Ideal.basisSpanSingleton @[simp]
Mathlib/RingTheory/Ideal/Basis.lean
35
39
theorem basisSpanSingleton_apply (b : Basis ι R S) {x : S} (hx : x ≠ 0) (i : ι) : (basisSpanSingleton b hx i : S) = x * b i := by
simp only [basisSpanSingleton, Basis.map_apply, LinearEquiv.trans_apply, Submodule.restrictScalarsEquiv_apply, LinearEquiv.ofInjective_apply, LinearEquiv.coe_ofEq_apply, LinearEquiv.restrictScalars_apply, Algebra.coe_lmul_eq_mul, LinearMap.mul_apply']
1,708
import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Module.BigOperators import Mathlib.LinearAlgebra.Basis #align_import ring_theory.algebra_tower from "leanprover-community/mathlib"@"94825b2b0b982306be14d891c4f063a1eca4f370" open Pointwise universe u v w u₁ variable (R : Type u) (S : Type v) (A : Type w) (B : Type u₁) namespace IsScalarTower section Semiring open Finsupp open scoped Classical universe v₁ w₁ variable {R S A} variable [Semiring R] [Semiring S] [AddCommMonoid A] variable [Module R S] [Module S A] [Module R A] [IsScalarTower R S A]
Mathlib/RingTheory/AlgebraTower.lean
108
121
theorem linearIndependent_smul {ι : Type v₁} {b : ι → S} {ι' : Type w₁} {c : ι' → A} (hb : LinearIndependent R b) (hc : LinearIndependent S c) : LinearIndependent R fun p : ι × ι' => b p.1 • c p.2 := by
rw [linearIndependent_iff'] at hb hc; rw [linearIndependent_iff'']; rintro s g hg hsg ⟨i, k⟩ by_cases hik : (i, k) ∈ s · have h1 : ∑ i ∈ s.image Prod.fst ×ˢ s.image Prod.snd, g i • b i.1 • c i.2 = 0 := by rw [← hsg] exact (Finset.sum_subset Finset.subset_product fun p _ hp => show g p • b p.1 • c p.2 = 0 by rw [hg p hp, zero_smul]).symm rw [Finset.sum_product_right] at h1 simp_rw [← smul_assoc, ← Finset.sum_smul] at h1 exact hb _ _ (hc _ _ h1 k (Finset.mem_image_of_mem _ hik)) i (Finset.mem_image_of_mem _ hik) exact hg _ hik
1,709
import Mathlib.Data.Matrix.Block import Mathlib.Data.Matrix.Notation import Mathlib.LinearAlgebra.StdBasis import Mathlib.RingTheory.AlgebraTower import Mathlib.Algebra.Algebra.Subalgebra.Tower #align_import linear_algebra.matrix.to_lin from "leanprover-community/mathlib"@"0e2aab2b0d521f060f62a14d2cf2e2c54e8491d6" noncomputable section open LinearMap Matrix Set Submodule section ToMatrixRight variable {R : Type*} [Semiring R] variable {l m n : Type*} def Matrix.vecMulLinear [Fintype m] (M : Matrix m n R) : (m → R) →ₗ[R] n → R where toFun x := x ᵥ* M map_add' _ _ := funext fun _ ↦ add_dotProduct _ _ _ map_smul' _ _ := funext fun _ ↦ smul_dotProduct _ _ _ #align matrix.vec_mul_linear Matrix.vecMulLinear @[simp] theorem Matrix.vecMulLinear_apply [Fintype m] (M : Matrix m n R) (x : m → R) : M.vecMulLinear x = x ᵥ* M := rfl theorem Matrix.coe_vecMulLinear [Fintype m] (M : Matrix m n R) : (M.vecMulLinear : _ → _) = M.vecMul := rfl variable [Fintype m] [DecidableEq m] @[simp]
Mathlib/LinearAlgebra/Matrix/ToLin.lean
91
99
theorem Matrix.vecMul_stdBasis (M : Matrix m n R) (i j) : (LinearMap.stdBasis R (fun _ ↦ R) i 1 ᵥ* M) j = M i j := by
have : (∑ i', (if i = i' then 1 else 0) * M i' j) = M i j := by simp_rw [boole_mul, Finset.sum_ite_eq, Finset.mem_univ, if_true] simp only [vecMul, dotProduct] convert this split_ifs with h <;> simp only [stdBasis_apply] · rw [h, Function.update_same] · rw [Function.update_noteq (Ne.symm h), Pi.zero_apply]
1,710
import Mathlib.Data.Matrix.Block import Mathlib.Data.Matrix.Notation import Mathlib.LinearAlgebra.StdBasis import Mathlib.RingTheory.AlgebraTower import Mathlib.Algebra.Algebra.Subalgebra.Tower #align_import linear_algebra.matrix.to_lin from "leanprover-community/mathlib"@"0e2aab2b0d521f060f62a14d2cf2e2c54e8491d6" noncomputable section open LinearMap Matrix Set Submodule section ToMatrixRight variable {R : Type*} [Semiring R] variable {l m n : Type*} def Matrix.vecMulLinear [Fintype m] (M : Matrix m n R) : (m → R) →ₗ[R] n → R where toFun x := x ᵥ* M map_add' _ _ := funext fun _ ↦ add_dotProduct _ _ _ map_smul' _ _ := funext fun _ ↦ smul_dotProduct _ _ _ #align matrix.vec_mul_linear Matrix.vecMulLinear @[simp] theorem Matrix.vecMulLinear_apply [Fintype m] (M : Matrix m n R) (x : m → R) : M.vecMulLinear x = x ᵥ* M := rfl theorem Matrix.coe_vecMulLinear [Fintype m] (M : Matrix m n R) : (M.vecMulLinear : _ → _) = M.vecMul := rfl variable [Fintype m] [DecidableEq m] @[simp] theorem Matrix.vecMul_stdBasis (M : Matrix m n R) (i j) : (LinearMap.stdBasis R (fun _ ↦ R) i 1 ᵥ* M) j = M i j := by have : (∑ i', (if i = i' then 1 else 0) * M i' j) = M i j := by simp_rw [boole_mul, Finset.sum_ite_eq, Finset.mem_univ, if_true] simp only [vecMul, dotProduct] convert this split_ifs with h <;> simp only [stdBasis_apply] · rw [h, Function.update_same] · rw [Function.update_noteq (Ne.symm h), Pi.zero_apply] #align matrix.vec_mul_std_basis Matrix.vecMul_stdBasis
Mathlib/LinearAlgebra/Matrix/ToLin.lean
102
110
theorem range_vecMulLinear (M : Matrix m n R) : LinearMap.range M.vecMulLinear = span R (range M) := by
letI := Classical.decEq m simp_rw [range_eq_map, ← iSup_range_stdBasis, Submodule.map_iSup, range_eq_map, ← Ideal.span_singleton_one, Ideal.span, Submodule.map_span, image_image, image_singleton, Matrix.vecMulLinear_apply, iSup_span, range_eq_iUnion, iUnion_singleton_eq_range, LinearMap.stdBasis, coe_single] unfold vecMul simp_rw [single_dotProduct, one_mul]
1,710
import Mathlib.Data.Matrix.Block import Mathlib.Data.Matrix.Notation import Mathlib.LinearAlgebra.StdBasis import Mathlib.RingTheory.AlgebraTower import Mathlib.Algebra.Algebra.Subalgebra.Tower #align_import linear_algebra.matrix.to_lin from "leanprover-community/mathlib"@"0e2aab2b0d521f060f62a14d2cf2e2c54e8491d6" noncomputable section open LinearMap Matrix Set Submodule section ToMatrixRight variable {R : Type*} [Semiring R] variable {l m n : Type*} def Matrix.vecMulLinear [Fintype m] (M : Matrix m n R) : (m → R) →ₗ[R] n → R where toFun x := x ᵥ* M map_add' _ _ := funext fun _ ↦ add_dotProduct _ _ _ map_smul' _ _ := funext fun _ ↦ smul_dotProduct _ _ _ #align matrix.vec_mul_linear Matrix.vecMulLinear @[simp] theorem Matrix.vecMulLinear_apply [Fintype m] (M : Matrix m n R) (x : m → R) : M.vecMulLinear x = x ᵥ* M := rfl theorem Matrix.coe_vecMulLinear [Fintype m] (M : Matrix m n R) : (M.vecMulLinear : _ → _) = M.vecMul := rfl variable [Fintype m] [DecidableEq m] @[simp] theorem Matrix.vecMul_stdBasis (M : Matrix m n R) (i j) : (LinearMap.stdBasis R (fun _ ↦ R) i 1 ᵥ* M) j = M i j := by have : (∑ i', (if i = i' then 1 else 0) * M i' j) = M i j := by simp_rw [boole_mul, Finset.sum_ite_eq, Finset.mem_univ, if_true] simp only [vecMul, dotProduct] convert this split_ifs with h <;> simp only [stdBasis_apply] · rw [h, Function.update_same] · rw [Function.update_noteq (Ne.symm h), Pi.zero_apply] #align matrix.vec_mul_std_basis Matrix.vecMul_stdBasis theorem range_vecMulLinear (M : Matrix m n R) : LinearMap.range M.vecMulLinear = span R (range M) := by letI := Classical.decEq m simp_rw [range_eq_map, ← iSup_range_stdBasis, Submodule.map_iSup, range_eq_map, ← Ideal.span_singleton_one, Ideal.span, Submodule.map_span, image_image, image_singleton, Matrix.vecMulLinear_apply, iSup_span, range_eq_iUnion, iUnion_singleton_eq_range, LinearMap.stdBasis, coe_single] unfold vecMul simp_rw [single_dotProduct, one_mul]
Mathlib/LinearAlgebra/Matrix/ToLin.lean
112
123
theorem Matrix.vecMul_injective_iff {R : Type*} [CommRing R] {M : Matrix m n R} : Function.Injective M.vecMul ↔ LinearIndependent R (fun i ↦ M i) := by
rw [← coe_vecMulLinear] simp only [← LinearMap.ker_eq_bot, Fintype.linearIndependent_iff, Submodule.eq_bot_iff, LinearMap.mem_ker, vecMulLinear_apply] refine ⟨fun h c h0 ↦ congr_fun <| h c ?_, fun h c h0 ↦ funext <| h c ?_⟩ · rw [← h0] ext i simp [vecMul, dotProduct] · rw [← h0] ext j simp [vecMul, dotProduct]
1,710
import Mathlib.Data.Matrix.Block import Mathlib.Data.Matrix.Notation import Mathlib.LinearAlgebra.StdBasis import Mathlib.RingTheory.AlgebraTower import Mathlib.Algebra.Algebra.Subalgebra.Tower #align_import linear_algebra.matrix.to_lin from "leanprover-community/mathlib"@"0e2aab2b0d521f060f62a14d2cf2e2c54e8491d6" noncomputable section open LinearMap Matrix Set Submodule section ToMatrixRight variable {R : Type*} [Semiring R] variable {l m n : Type*} def Matrix.vecMulLinear [Fintype m] (M : Matrix m n R) : (m → R) →ₗ[R] n → R where toFun x := x ᵥ* M map_add' _ _ := funext fun _ ↦ add_dotProduct _ _ _ map_smul' _ _ := funext fun _ ↦ smul_dotProduct _ _ _ #align matrix.vec_mul_linear Matrix.vecMulLinear @[simp] theorem Matrix.vecMulLinear_apply [Fintype m] (M : Matrix m n R) (x : m → R) : M.vecMulLinear x = x ᵥ* M := rfl theorem Matrix.coe_vecMulLinear [Fintype m] (M : Matrix m n R) : (M.vecMulLinear : _ → _) = M.vecMul := rfl variable [Fintype m] [DecidableEq m] @[simp] theorem Matrix.vecMul_stdBasis (M : Matrix m n R) (i j) : (LinearMap.stdBasis R (fun _ ↦ R) i 1 ᵥ* M) j = M i j := by have : (∑ i', (if i = i' then 1 else 0) * M i' j) = M i j := by simp_rw [boole_mul, Finset.sum_ite_eq, Finset.mem_univ, if_true] simp only [vecMul, dotProduct] convert this split_ifs with h <;> simp only [stdBasis_apply] · rw [h, Function.update_same] · rw [Function.update_noteq (Ne.symm h), Pi.zero_apply] #align matrix.vec_mul_std_basis Matrix.vecMul_stdBasis theorem range_vecMulLinear (M : Matrix m n R) : LinearMap.range M.vecMulLinear = span R (range M) := by letI := Classical.decEq m simp_rw [range_eq_map, ← iSup_range_stdBasis, Submodule.map_iSup, range_eq_map, ← Ideal.span_singleton_one, Ideal.span, Submodule.map_span, image_image, image_singleton, Matrix.vecMulLinear_apply, iSup_span, range_eq_iUnion, iUnion_singleton_eq_range, LinearMap.stdBasis, coe_single] unfold vecMul simp_rw [single_dotProduct, one_mul] theorem Matrix.vecMul_injective_iff {R : Type*} [CommRing R] {M : Matrix m n R} : Function.Injective M.vecMul ↔ LinearIndependent R (fun i ↦ M i) := by rw [← coe_vecMulLinear] simp only [← LinearMap.ker_eq_bot, Fintype.linearIndependent_iff, Submodule.eq_bot_iff, LinearMap.mem_ker, vecMulLinear_apply] refine ⟨fun h c h0 ↦ congr_fun <| h c ?_, fun h c h0 ↦ funext <| h c ?_⟩ · rw [← h0] ext i simp [vecMul, dotProduct] · rw [← h0] ext j simp [vecMul, dotProduct] def LinearMap.toMatrixRight' : ((m → R) →ₗ[R] n → R) ≃ₗ[Rᵐᵒᵖ] Matrix m n R where toFun f i j := f (stdBasis R (fun _ ↦ R) i 1) j invFun := Matrix.vecMulLinear right_inv M := by ext i j simp only [Matrix.vecMul_stdBasis, Matrix.vecMulLinear_apply] left_inv f := by apply (Pi.basisFun R m).ext intro j; ext i simp only [Pi.basisFun_apply, Matrix.vecMul_stdBasis, Matrix.vecMulLinear_apply] map_add' f g := by ext i j simp only [Pi.add_apply, LinearMap.add_apply, Matrix.add_apply] map_smul' c f := by ext i j simp only [Pi.smul_apply, LinearMap.smul_apply, RingHom.id_apply, Matrix.smul_apply] #align linear_map.to_matrix_right' LinearMap.toMatrixRight' abbrev Matrix.toLinearMapRight' : Matrix m n R ≃ₗ[Rᵐᵒᵖ] (m → R) →ₗ[R] n → R := LinearEquiv.symm LinearMap.toMatrixRight' #align matrix.to_linear_map_right' Matrix.toLinearMapRight' @[simp] theorem Matrix.toLinearMapRight'_apply (M : Matrix m n R) (v : m → R) : (Matrix.toLinearMapRight') M v = v ᵥ* M := rfl #align matrix.to_linear_map_right'_apply Matrix.toLinearMapRight'_apply @[simp] theorem Matrix.toLinearMapRight'_mul [Fintype l] [DecidableEq l] (M : Matrix l m R) (N : Matrix m n R) : Matrix.toLinearMapRight' (M * N) = (Matrix.toLinearMapRight' N).comp (Matrix.toLinearMapRight' M) := LinearMap.ext fun _x ↦ (vecMul_vecMul _ M N).symm #align matrix.to_linear_map_right'_mul Matrix.toLinearMapRight'_mul theorem Matrix.toLinearMapRight'_mul_apply [Fintype l] [DecidableEq l] (M : Matrix l m R) (N : Matrix m n R) (x) : Matrix.toLinearMapRight' (M * N) x = Matrix.toLinearMapRight' N (Matrix.toLinearMapRight' M x) := (vecMul_vecMul _ M N).symm #align matrix.to_linear_map_right'_mul_apply Matrix.toLinearMapRight'_mul_apply @[simp]
Mathlib/LinearAlgebra/Matrix/ToLin.lean
173
176
theorem Matrix.toLinearMapRight'_one : Matrix.toLinearMapRight' (1 : Matrix m m R) = LinearMap.id := by
ext simp [LinearMap.one_apply, stdBasis_apply]
1,710
import Mathlib.LinearAlgebra.Matrix.ToLin import Mathlib.LinearAlgebra.Quotient import Mathlib.RingTheory.Ideal.Maps import Mathlib.RingTheory.Nilpotent.Defs #align_import ring_theory.nilpotent from "leanprover-community/mathlib"@"da420a8c6dd5bdfb85c4ced85c34388f633bc6ff" universe u v open Function Set variable {R S : Type*} {x y : R}
Mathlib/RingTheory/Nilpotent/Lemmas.lean
25
29
theorem RingHom.ker_isRadical_iff_reduced_of_surjective {S F} [CommSemiring R] [CommRing S] [FunLike F R S] [RingHomClass F R S] {f : F} (hf : Function.Surjective f) : (RingHom.ker f).IsRadical ↔ IsReduced S := by
simp_rw [isReduced_iff, hf.forall, IsNilpotent, ← map_pow, ← RingHom.mem_ker] rfl
1,711
import Mathlib.LinearAlgebra.Matrix.ToLin import Mathlib.LinearAlgebra.Quotient import Mathlib.RingTheory.Ideal.Maps import Mathlib.RingTheory.Nilpotent.Defs #align_import ring_theory.nilpotent from "leanprover-community/mathlib"@"da420a8c6dd5bdfb85c4ced85c34388f633bc6ff" universe u v open Function Set variable {R S : Type*} {x y : R} theorem RingHom.ker_isRadical_iff_reduced_of_surjective {S F} [CommSemiring R] [CommRing S] [FunLike F R S] [RingHomClass F R S] {f : F} (hf : Function.Surjective f) : (RingHom.ker f).IsRadical ↔ IsReduced S := by simp_rw [isReduced_iff, hf.forall, IsNilpotent, ← map_pow, ← RingHom.mem_ker] rfl #align ring_hom.ker_is_radical_iff_reduced_of_surjective RingHom.ker_isRadical_iff_reduced_of_surjective
Mathlib/RingTheory/Nilpotent/Lemmas.lean
32
35
theorem isRadical_iff_span_singleton [CommSemiring R] : IsRadical y ↔ (Ideal.span ({y} : Set R)).IsRadical := by
simp_rw [IsRadical, ← Ideal.mem_span_singleton] exact forall_swap.trans (forall_congr' fun r => exists_imp.symm)
1,711
import Mathlib.LinearAlgebra.Matrix.ToLin import Mathlib.LinearAlgebra.Quotient import Mathlib.RingTheory.Ideal.Maps import Mathlib.RingTheory.Nilpotent.Defs #align_import ring_theory.nilpotent from "leanprover-community/mathlib"@"da420a8c6dd5bdfb85c4ced85c34388f633bc6ff" universe u v open Function Set variable {R S : Type*} {x y : R} theorem RingHom.ker_isRadical_iff_reduced_of_surjective {S F} [CommSemiring R] [CommRing S] [FunLike F R S] [RingHomClass F R S] {f : F} (hf : Function.Surjective f) : (RingHom.ker f).IsRadical ↔ IsReduced S := by simp_rw [isReduced_iff, hf.forall, IsNilpotent, ← map_pow, ← RingHom.mem_ker] rfl #align ring_hom.ker_is_radical_iff_reduced_of_surjective RingHom.ker_isRadical_iff_reduced_of_surjective theorem isRadical_iff_span_singleton [CommSemiring R] : IsRadical y ↔ (Ideal.span ({y} : Set R)).IsRadical := by simp_rw [IsRadical, ← Ideal.mem_span_singleton] exact forall_swap.trans (forall_congr' fun r => exists_imp.symm) #align is_radical_iff_span_singleton isRadical_iff_span_singleton namespace Commute namespace Module.End lemma isNilpotent.restrict {R M : Type*} [Semiring R] [AddCommMonoid M] [Module R M] {f : M →ₗ[R] M} {p : Submodule R M} (hf : MapsTo f p p) (hnil : IsNilpotent f) : IsNilpotent (f.restrict hf) := by obtain ⟨n, hn⟩ := hnil exact ⟨n, LinearMap.ext fun m ↦ by simp [LinearMap.pow_restrict n, LinearMap.restrict_apply, hn]⟩ variable {M : Type v} [Ring R] [AddCommGroup M] [Module R M] variable {f : Module.End R M} {p : Submodule R M} (hp : p ≤ p.comap f)
Mathlib/RingTheory/Nilpotent/Lemmas.lean
123
126
theorem IsNilpotent.mapQ (hnp : IsNilpotent f) : IsNilpotent (p.mapQ p f hp) := by
obtain ⟨k, hk⟩ := hnp use k simp [← p.mapQ_pow, hk]
1,711
import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.PartialSups import Mathlib.Algebra.Module.Submodule.IterateMapComap import Mathlib.RingTheory.OrzechProperty import Mathlib.RingTheory.Nilpotent.Lemmas #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" open Set Filter Pointwise -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def
Mathlib/RingTheory/Noetherian.lean
81
91
theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by
refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃)
1,712
import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.PartialSups import Mathlib.Algebra.Module.Submodule.IterateMapComap import Mathlib.RingTheory.OrzechProperty import Mathlib.RingTheory.Nilpotent.Lemmas #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" open Set Filter Pointwise -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} instance isNoetherian_quotient {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [IsNoetherian R M] : IsNoetherian R (M ⧸ N) := isNoetherian_of_surjective _ _ (LinearMap.range_eq_top.mpr N.mkQ_surjective) #align submodule.quotient.is_noetherian isNoetherian_quotient @[deprecated (since := "2024-04-27"), nolint defLemma] alias Submodule.Quotient.isNoetherian := isNoetherian_quotient theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv
Mathlib/RingTheory/Noetherian.lean
136
139
theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by
constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm
1,712
import Mathlib.LinearAlgebra.Span import Mathlib.RingTheory.Ideal.IsPrimary import Mathlib.RingTheory.Ideal.QuotientOperations import Mathlib.RingTheory.Noetherian #align_import ring_theory.ideal.associated_prime from "leanprover-community/mathlib"@"f0c8bf9245297a541f468be517f1bde6195105e9" variable {R : Type*} [CommRing R] (I J : Ideal R) (M : Type*) [AddCommGroup M] [Module R M] def IsAssociatedPrime : Prop := I.IsPrime ∧ ∃ x : M, I = (R ∙ x).annihilator #align is_associated_prime IsAssociatedPrime variable (R) def associatedPrimes : Set (Ideal R) := { I | IsAssociatedPrime I M } #align associated_primes associatedPrimes variable {I J M R} variable {M' : Type*} [AddCommGroup M'] [Module R M'] (f : M →ₗ[R] M') theorem AssociatePrimes.mem_iff : I ∈ associatedPrimes R M ↔ IsAssociatedPrime I M := Iff.rfl #align associate_primes.mem_iff AssociatePrimes.mem_iff theorem IsAssociatedPrime.isPrime (h : IsAssociatedPrime I M) : I.IsPrime := h.1 #align is_associated_prime.is_prime IsAssociatedPrime.isPrime
Mathlib/RingTheory/Ideal/AssociatedPrime.lean
59
65
theorem IsAssociatedPrime.map_of_injective (h : IsAssociatedPrime I M) (hf : Function.Injective f) : IsAssociatedPrime I M' := by
obtain ⟨x, rfl⟩ := h.2 refine ⟨h.1, ⟨f x, ?_⟩⟩ ext r rw [Submodule.mem_annihilator_span_singleton, Submodule.mem_annihilator_span_singleton, ← map_smul, ← f.map_zero, hf.eq_iff]
1,713
import Mathlib.LinearAlgebra.Span import Mathlib.RingTheory.Ideal.IsPrimary import Mathlib.RingTheory.Ideal.QuotientOperations import Mathlib.RingTheory.Noetherian #align_import ring_theory.ideal.associated_prime from "leanprover-community/mathlib"@"f0c8bf9245297a541f468be517f1bde6195105e9" variable {R : Type*} [CommRing R] (I J : Ideal R) (M : Type*) [AddCommGroup M] [Module R M] def IsAssociatedPrime : Prop := I.IsPrime ∧ ∃ x : M, I = (R ∙ x).annihilator #align is_associated_prime IsAssociatedPrime variable (R) def associatedPrimes : Set (Ideal R) := { I | IsAssociatedPrime I M } #align associated_primes associatedPrimes variable {I J M R} variable {M' : Type*} [AddCommGroup M'] [Module R M'] (f : M →ₗ[R] M') theorem AssociatePrimes.mem_iff : I ∈ associatedPrimes R M ↔ IsAssociatedPrime I M := Iff.rfl #align associate_primes.mem_iff AssociatePrimes.mem_iff theorem IsAssociatedPrime.isPrime (h : IsAssociatedPrime I M) : I.IsPrime := h.1 #align is_associated_prime.is_prime IsAssociatedPrime.isPrime theorem IsAssociatedPrime.map_of_injective (h : IsAssociatedPrime I M) (hf : Function.Injective f) : IsAssociatedPrime I M' := by obtain ⟨x, rfl⟩ := h.2 refine ⟨h.1, ⟨f x, ?_⟩⟩ ext r rw [Submodule.mem_annihilator_span_singleton, Submodule.mem_annihilator_span_singleton, ← map_smul, ← f.map_zero, hf.eq_iff] #align is_associated_prime.map_of_injective IsAssociatedPrime.map_of_injective theorem LinearEquiv.isAssociatedPrime_iff (l : M ≃ₗ[R] M') : IsAssociatedPrime I M ↔ IsAssociatedPrime I M' := ⟨fun h => h.map_of_injective l l.injective, fun h => h.map_of_injective l.symm l.symm.injective⟩ #align linear_equiv.is_associated_prime_iff LinearEquiv.isAssociatedPrime_iff
Mathlib/RingTheory/Ideal/AssociatedPrime.lean
74
78
theorem not_isAssociatedPrime_of_subsingleton [Subsingleton M] : ¬IsAssociatedPrime I M := by
rintro ⟨hI, x, hx⟩ apply hI.ne_top rwa [Subsingleton.elim x 0, Submodule.span_singleton_eq_bot.mpr rfl, Submodule.annihilator_bot] at hx
1,713