@@ -24,9 +24,9 @@ noncomputable section
2424
2525universe u v v' w
2626
27- variable {R : Type u} {M M₁ : Type v} {M' : Type v' } {ι : Type w}
28- variable [Ring R] [AddCommGroup M] [AddCommGroup M'] [AddCommGroup M₁ ]
29- variable [Module R M] [Module R M'] [Module R M₁]
27+ variable {R : Type u} {M : Type v} {ι : Type w}
28+ variable [Semiring R] [AddCommMonoid M ]
29+ variable [Module R M]
3030
3131attribute [local instance ] nontrivial_of_invariantBasisNumber
3232
@@ -56,7 +56,7 @@ theorem rank_le {n : ℕ}
5656section RankZero
5757
5858/-- See `rank_zero_iff` for a stronger version with `NoZeroSMulDivisor R M`. -/
59- lemma rank_eq_zero_iff :
59+ lemma rank_eq_zero_iff {R M} [Ring R] [AddCommGroup M] [Module R M] :
6060 Module.rank R M = 0 ↔ ∀ x : M, ∃ a : R, a ≠ 0 ∧ a • x = 0 := by
6161 nontriviality R
6262 constructor
@@ -77,7 +77,7 @@ lemma rank_eq_zero_iff :
7777 apply ha
7878 simpa using DFunLike.congr_fun (linearIndependent_iff.mp hs (Finsupp.single i a) (by simpa)) i
7979
80- variable [Nontrivial R]
80+ variable {R M : Type *} [Ring R] [AddCommGroup M] [Module R M] [Nontrivial R]
8181
8282section
8383variable [NoZeroSMulDivisors R M]
@@ -101,6 +101,12 @@ theorem rank_pos_iff_nontrivial : 0 < Module.rank R M ↔ Nontrivial M :=
101101theorem rank_pos [Nontrivial M] : 0 < Module.rank R M :=
102102 rank_pos_iff_nontrivial.mpr ‹_›
103103
104+ omit [Nontrivial R] in
105+ theorem Module.finite_of_rank_eq_zero (h : Module.rank R M = 0 ) : Module.Finite R M := by
106+ nontriviality R
107+ rw [rank_zero_iff] at h
108+ infer_instance
109+
104110end
105111
106112theorem exists_mem_ne_zero_of_rank_pos {s : Submodule R M} (h : 0 < Module.rank R s) :
@@ -119,13 +125,6 @@ theorem Module.finite_of_rank_eq_nat [Module.Free R M] {n : ℕ} (h : Module.ran
119125 b.linearIndependent.cardinal_le_rank |>.trans_eq h |>.trans_lt <| nat_lt_aleph0 n
120126 exact Module.Finite.of_basis b
121127
122- theorem Module.finite_of_rank_eq_zero [NoZeroSMulDivisors R M]
123- (h : Module.rank R M = 0 ) :
124- Module.Finite R M := by
125- nontriviality R
126- rw [rank_zero_iff] at h
127- infer_instance
128-
129128theorem Module.finite_of_rank_eq_one [Module.Free R M] (h : Module.rank R M = 1 ) :
130129 Module.Finite R M :=
131130 Module.finite_of_rank_eq_nat <| h.trans Nat.cast_one.symm
@@ -240,7 +239,7 @@ theorem Module.Finite.not_linearIndependent_of_infinite {ι : Type*} [Infinite
240239 (v : ι → M) : ¬LinearIndependent R v := mt LinearIndependent.finite <| @not_finite _ _
241240
242241section
243- variable [NoZeroSMulDivisors R M]
242+ variable {R : Type u} {M : Type v} [Ring R] [AddCommGroup M] [Module R M] [NoZeroSMulDivisors R M]
244243
245244theorem iSupIndep.subtype_ne_bot_le_rank [Nontrivial R]
246245 {V : ι → Submodule R M} (hV : iSupIndep V) :
@@ -289,6 +288,7 @@ theorem iSupIndep.subtype_ne_bot_le_finrank
289288
290289end
291290
291+ variable {R M : Type *} [Ring R] [AddCommGroup M] [Module R M]
292292variable [Module.Finite R M] [StrongRankCondition R]
293293
294294section
@@ -357,21 +357,16 @@ theorem Module.finrank_zero_of_subsingleton [Subsingleton M] :
357357lemma LinearIndependent.finrank_eq_zero_of_infinite {ι} [Infinite ι] {v : ι → M}
358358 (hv : LinearIndependent R v) : finrank R M = 0 := toNat_eq_zero.mpr <| .inr hv.aleph0_le_rank
359359
360- section
361- variable [NoZeroSMulDivisors R M]
362-
363360/-- A finite-dimensional space is nontrivial if it has positive `finrank`. -/
364- theorem Module.nontrivial_of_finrank_pos (h : 0 < finrank R M) : Nontrivial M :=
365- rank_pos_iff_nontrivial.mp (lt_rank_of_lt_finrank h)
361+ theorem Module.nontrivial_of_finrank_pos (h : 0 < finrank R M) : Nontrivial M := by
362+ contrapose! h; exact finrank_zero_of_subsingleton.le
366363
367364/-- A finite-dimensional space is nontrivial if it has `finrank` equal to the successor of a
368365natural number. -/
369366theorem Module.nontrivial_of_finrank_eq_succ {n : ℕ}
370367 (hn : finrank R M = n.succ) : Nontrivial M :=
371368 nontrivial_of_finrank_pos (R := R) (by rw [hn]; exact n.succ_pos)
372369
373- end
374-
375370variable (R M)
376371
377372@[simp]
382377
383378section StrongRankCondition
384379
380+ variable {R M : Type *} [Ring R] [AddCommGroup M] [Module R M]
385381variable [StrongRankCondition R] [Module.Finite R M]
386382
387383/-- A finite rank torsion-free module has positive `finrank` iff it has a nonzero element. -/
@@ -430,6 +426,10 @@ theorem Module.finrank_eq_zero_of_rank_eq_zero (h : Module.rank R M = 0) :
430426 delta finrank
431427 rw [h, zero_toNat]
432428
429+ section
430+
431+ variable {R M : Type *} [Ring R] [AddCommGroup M] [Module R M]
432+
433433theorem Submodule.bot_eq_top_of_rank_eq_zero [NoZeroSMulDivisors R M] (h : Module.rank R M = 0 ) :
434434 (⊥ : Submodule R M) = ⊤ := by
435435 nontriviality R
@@ -459,6 +459,8 @@ lemma Submodule.one_le_finrank_iff [StrongRankCondition R] [NoZeroSMulDivisors R
459459 1 ≤ finrank R S ↔ S ≠ ⊥ := by
460460 contrapose!; rw [Nat.lt_one_iff, finrank_eq_zero]
461461
462+ end
463+
462464@[simp]
463465theorem Set.finrank_empty [Nontrivial R] :
464466 Set.finrank R (∅ : Set M) = 0 := by
@@ -499,6 +501,7 @@ end FinrankZero
499501
500502section RankOne
501503
504+ variable {R : Type u} {M : Type v} [Ring R] [AddCommGroup M] [Module R M]
502505variable [NoZeroSMulDivisors R M] [StrongRankCondition R]
503506
504507/-- If there is a nonzero vector and every other vector is a multiple of it,
@@ -514,20 +517,22 @@ then the module has dimension one. -/
514517theorem finrank_eq_one (v : M) (n : v ≠ 0 ) (h : ∀ w : M, ∃ c : R, c • v = w) : finrank R M = 1 :=
515518 finrank_eq_of_rank_eq (rank_eq_one v n h)
516519
517- /-- If every vector is a multiple of some `v : M`, then `M` has dimension at most one.
518- -/
520+ end RankOne
521+
522+ section
523+
524+ variable [StrongRankCondition R]
525+
526+ theorem rank_le_one (v : M) (h : ∀ w : M, ∃ c : R, c • v = w) : Module.rank R M ≤ 1 := by
527+ simpa using LinearMap.lift_rank_le_of_surjective _
528+ (id h : Surjective (LinearMap.toSpanSingleton R M v))
529+
530+ /-- If every vector is a multiple of some `v : M`, then `M` has dimension at most one. -/
519531theorem finrank_le_one (v : M) (h : ∀ w : M, ∃ c : R, c • v = w) : finrank R M ≤ 1 := by
520- haveI := nontrivial_of_invariantBasisNumber R
521- rcases eq_or_ne v 0 with (rfl | hn)
522- · haveI :=
523- _root_.subsingleton_of_forall_eq (0 : M) fun w => by
524- obtain ⟨c, rfl⟩ := h w
525- simp
526- rw [finrank_zero_of_subsingleton]
527- exact zero_le_one
528- · exact (finrank_eq_one v hn h).le
532+ rw [← map_one toNat, finrank]
533+ exact toNat_le_toNat (rank_le_one v h) one_lt_aleph0
529534
530- end RankOne
535+ end
531536
532537namespace Module
533538variable {ι : Type *}
0 commit comments