Skip to content

[Merged by Bors] - chore: generalize MvPolynomial.rank_mvPolynomial#18741

Closed
alreadydone wants to merge 4 commits intomasterfrom
rank_mvPolynomial
Closed

[Merged by Bors] - chore: generalize MvPolynomial.rank_mvPolynomial#18741
alreadydone wants to merge 4 commits intomasterfrom
rank_mvPolynomial

Conversation

@alreadydone
Copy link
Copy Markdown
Contributor

@alreadydone alreadydone commented Nov 7, 2024

Generalize from Field to Nontrivial Ring and rename to MvPolynomial.rank_eq. Also provide universe polymorphic version rank_eq_lift. Also add finrank_eq_zero/one by request.


Open in Gitpod

@alreadydone alreadydone added easy < 20s of review time. See the lifecycle page for guidelines. awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. t-algebra Algebra (groups, rings, fields, etc) labels Nov 7, 2024
@github-actions github-actions Bot added the large-import Automatically added label for PRs with a significant increase in transitive imports label Nov 7, 2024
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Nov 7, 2024

PR summary a1d700e2b7

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.FieldTheory.MvPolynomial -1139
Mathlib.RingTheory.MvPolynomial 1268

Declarations diff

+ finrank_eq_one
+ finrank_eq_zero
+ rank_eq
+ rank_eq_lift

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

The doc-module for script/declarations_diff.sh contains some details about this script.

@github-actions github-actions Bot removed the awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. label Nov 7, 2024
@alreadydone alreadydone added easy < 20s of review time. See the lifecycle page for guidelines. and removed easy < 20s of review time. See the lifecycle page for guidelines. labels Nov 7, 2024
@alreadydone
Copy link
Copy Markdown
Contributor Author

alreadydone commented Nov 7, 2024

Since this file contains only three lemmas, I think a 4.48% increase in imports is reasonable. Also, no downstream file has imports increased.

@erdOne
Copy link
Copy Markdown
Member

erdOne commented Nov 7, 2024

Do we have the finrank version?

@alreadydone
Copy link
Copy Markdown
Contributor Author

Do we have the finrank version?

Is it useful? The finrank is 0 (infinite) if σ is nonempty and 1 if it's empty.

@acmepjz
Copy link
Copy Markdown
Collaborator

acmepjz commented Nov 8, 2024

Generalize from Field to Nontrivial Ring

So maybe it should not in FieldTheory folder anymore...

@acmepjz
Copy link
Copy Markdown
Collaborator

acmepjz commented Nov 8, 2024

By the way, I have something WIP similar to these results, this is the starting of that file:

import Mathlib.FieldTheory.Adjoin
import Mathlib.LinearAlgebra.TensorProduct.Subalgebra
import Mathlib.Algebra.MvPolynomial.Cardinal
import Mathlib.RingTheory.Localization.Cardinality
import Mathlib.RingTheory.AlgebraicIndependent
import Mathlib.Data.Fin.Tuple.Reflection

open scoped Classical TensorProduct

open FiniteDimensional IntermediateField

noncomputable section

universe u v w

variable {F : Type u} {E : Type v} [Field F] [Field E] [Algebra F E]

variable {A B : IntermediateField F E}

variable (L : Type w) [Field L] [Algebra F L] [Algebra L E] [IsScalarTower F L E]

-- already in mathlib
variable (A B) in
private lemma _root_.IntermediateField.rank_sup_le_of_isAlgebraic
    (halg : Algebra.IsAlgebraic F A ∨ Algebra.IsAlgebraic F B) :
    Module.rank F ↥(A ⊔ B) ≤ Module.rank F A * Module.rank F B := by
  have := A.toSubalgebra.rank_sup_le_of_free B.toSubalgebra
  rwa [← sup_toSubalgebra_of_isAlgebraic A B halg] at this

-- already in mathlib with different name
theorem _root_.FractionRing.card (R : Type u) [CommRing R] :
    Cardinal.mk (FractionRing R) = Cardinal.mk R :=
  (IsLocalization.card (FractionRing R) (nonZeroDivisors R) (le_refl _)).symm

-- TODO: move to suitable place
theorem _root_.rank_fractionRing_mvPolynomial_eq {σ : Type u} {F : Type v} [Field F] [Nonempty σ] :
    Module.rank F (FractionRing (MvPolynomial σ F)) =
      max (max (Cardinal.lift.{u} (Cardinal.mk F)) (Cardinal.lift.{v} (Cardinal.mk σ)))
        Cardinal.aleph0 := by
  refine le_antisymm ?_ ?_
  · refine (rank_le_card _ _).trans ?_
    rw [FractionRing.card, MvPolynomial.cardinal_mk_eq_max_lift]
  · have hinj := NoZeroSMulDivisors.algebraMap_injective (MvPolynomial σ F)
      (FractionRing (MvPolynomial σ F))
    have h1 := IsScalarTower.toAlgHom F (MvPolynomial σ F) (FractionRing (MvPolynomial σ F))
      |>.toLinearMap.rank_le_of_injective hinj
    simp_rw [Cardinal.lift_id'.{u, v} _ ▸ (MvPolynomial.basisMonomials σ F).mk_eq_rank.symm] at h1
    rw [Cardinal.lift_umax.{u, v}, Cardinal.mk_finsupp_nat, Cardinal.lift_max,
      Cardinal.lift_aleph0, max_le_iff] at h1
    obtain ⟨i⟩ := ‹Nonempty σ›
    let x := algebraMap (MvPolynomial σ F) (FractionRing (MvPolynomial σ F)) (MvPolynomial.X i)
    have hx : Transcendental F x := (transcendental_algebraMap_iff hinj).2
      (MvPolynomial.transcendental_X F i)
    have h2 := hx.linearIndependent_sub_inv.cardinal_lift_le_rank
    rw [Cardinal.lift_id'.{v, u} _, Cardinal.lift_umax.{v, u}] at h2
    exact max_le_iff.2 ⟨max_le_iff.2 ⟨h2, h1.1⟩, h1.2

@github-actions github-actions Bot removed the large-import Automatically added label for PRs with a significant increase in transitive imports label Nov 8, 2024
Copy link
Copy Markdown
Member

@jcommelin jcommelin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 🎉

bors merge

@ghost ghost added the ready-to-merge This PR has been sent to bors. label Nov 13, 2024
mathlib-bors Bot pushed a commit that referenced this pull request Nov 13, 2024
Generalize from Field to Nontrivial Ring and rename to `MvPolynomial.rank_eq`. Also provide universe polymorphic version `rank_eq_lift`. Also add `finrank_eq_zero/one` by request.
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors Bot commented Nov 13, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors Bot changed the title chore: generalize MvPolynomial.rank_mvPolynomial [Merged by Bors] - chore: generalize MvPolynomial.rank_mvPolynomial Nov 13, 2024
@mathlib-bors mathlib-bors Bot closed this Nov 13, 2024
@mathlib-bors mathlib-bors Bot deleted the rank_mvPolynomial branch November 13, 2024 10:39
TobiasLeichtfried pushed a commit that referenced this pull request Nov 21, 2024
Generalize from Field to Nontrivial Ring and rename to `MvPolynomial.rank_eq`. Also provide universe polymorphic version `rank_eq_lift`. Also add `finrank_eq_zero/one` by request.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

easy < 20s of review time. See the lifecycle page for guidelines. ready-to-merge This PR has been sent to bors. t-algebra Algebra (groups, rings, fields, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants