Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Mathlib/Algebra/Module/SpanRank.lean
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,20 @@ lemma spanFinrank_singleton {m : M} (hm : m ≠ 0) : (span R {m}).spanFinrank =
· by_contra!
simp [Submodule.spanFinrank_eq_zero_iff_eq_bot (fg_span_singleton m), hm] at this

lemma spanFinrank_eq_one_iff (p : Submodule R M) : p.spanFinrank = 1 ↔ p.IsPrincipal ∧ p ≠ ⊥ := by
refine ⟨fun h ↦ ⟨?_, ?_⟩, fun ⟨prin, ne⟩ ↦ ?_⟩
· have fg : p.FG := by
contrapose h
simp [Submodule.spanFinrank_of_not_fg h]
obtain ⟨a, ha⟩ : ∃ a, p.generators = {a} := by simpa [← fg.generators_ncard] using h
exact ⟨a, ha ▸ (p.span_generators).symm⟩
· contrapose h
simp [h]
· rcases prin with ⟨a, rfl⟩
apply Submodule.spanFinrank_singleton
contrapose ne
simp [ne]

end Defs

end Submodule
Expand Down
Loading