/- Copyright (c) 2026 the ECCompute authors. All rights reserved. Released under the GNU General Public License version 3.0 as described in the file LICENSE. -/ module public import ECCompute.MainTheorem /-! # `HasRankGE` and `Module.finrank` `HasRankGE W n` says that `W(ℚ)` has a finitely generated `ℤ`-submodule of free rank at least `n`. Other formal statements write "rank at least `n`" as `n ≤ Module.finrank ℤ W.toAffine.Point`. This file proves the two bridges between the two forms, keeping the Mordell–Weil finiteness of `W(ℚ)` as a hypothesis. -/ namespace ECCompute open WeierstrassCurve Module /-- If `W(ℚ)` contains a finitely generated submodule of free rank at least `n`, then the `ℤ`-rank of `W(ℚ)` is at least `n`. The finiteness of `W(ℚ)` is the Mordell–Weil theorem and is kept as a hypothesis. -/ public theorem le_finrank_of_hasRankGE (W : WeierstrassCurve ℚ) {n : ℕ} (h : HasRankGE W n) (hfin : Module.Finite ℤ W.toAffine.Point) : n ≤ Module.finrank ℤ W.toAffine.Point := by obtain ⟨H, _, hn⟩ := h exact hn.trans (@Submodule.finrank_le ℤ W.toAffine.Point _ _ _ _ hfin H) /-- If the `ℤ`-rank of `W(ℚ)` is at least `n`, then `W` has rank at least `n` in the sense of `HasRankGE`. The finiteness of `W(ℚ)` is the Mordell–Weil theorem and is kept as a hypothesis. -/ public theorem hasRankGE_of_le_finrank (W : WeierstrassCurve ℚ) {n : ℕ} (hfin : Module.Finite ℤ W.toAffine.Point) (h : n ≤ Module.finrank ℤ W.toAffine.Point) : HasRankGE W n := by refine ⟨⊤, ?_, ?_⟩ · exact Module.Finite.iff_fg.mpr (Module.finite_def.mp hfin) · simpa using h end ECCompute