Skip to content

[Merged by Bors] - feat: add polynomial Wronskian#14243

Closed
seewoo5 wants to merge 22 commits intomasterfrom
wronskian
Closed

[Merged by Bors] - feat: add polynomial Wronskian#14243
seewoo5 wants to merge 22 commits intomasterfrom
wronskian

Conversation

@seewoo5
Copy link
Copy Markdown
Collaborator

@seewoo5 seewoo5 commented Jun 28, 2024

Define wronskian for polynomials over commutative rings, and prove some basic properties. This is mainly for the porting of our (me and @jcpaik) formalization of Mason-Stothers theorem. We already discussed about this in Zulip. Especially, it may possible to improve as

  • Replace CommRing with Ring
  • or more generally, Wronskian can be defined over any ring with Derivation, and most of the theorems we proved should also hold in this context

Open in Gitpod

@github-actions github-actions bot added the new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! label Jun 28, 2024
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 28, 2024

PR summary 78720593bd

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.RingTheory.Polynomial.Wronskian 938

Declarations diff

+ degree_ne_bot
+ degree_wronskian_lt_add
+ isAlt_wronskianBilin
+ natDegree_wronskian_lt_add
+ wronskian
+ wronskianBilin
+ wronskianBilin_apply
+ wronskian_add_left
+ wronskian_add_right
+ wronskian_eq_of_sum_zero
+ wronskian_neg_eq
+ wronskian_neg_left
+ wronskian_neg_right
+ wronskian_self_eq_zero
+ wronskian_zero_left
+ wronskian_zero_right

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

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

Copy link
Copy Markdown
Member

@eric-wieser eric-wieser left a comment

Choose a reason for hiding this comment

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

This generally looks good; I've left a first round of mostly stylistic comments.

@eric-wieser eric-wieser added awaiting-review t-algebra Algebra (groups, rings, fields, etc) labels Jun 30, 2024
@ghost ghost added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Jun 30, 2024
mathlib-bors bot pushed a commit that referenced this pull request Jul 1, 2024
For an alternating form $B : M \times M \to R$ and $a, b, c \in M$ with $a + b+ c = 0$, we have $B(a, b) = B(b, c)$.
This can be used to prove the same property of Wronskian: see #14243.



Co-authored-by: Seewoo Lee <49933279+seewoo5@users.noreply.github.com>
mathlib-bors bot pushed a commit that referenced this pull request Jul 1, 2024
For an alternating form $B : M \times M \to R$ and $a, b, c \in M$ with $a + b+ c = 0$, we have $B(a, b) = B(b, c)$.
This can be used to prove the same property of Wronskian: see #14243.



Co-authored-by: Seewoo Lee <49933279+seewoo5@users.noreply.github.com>
@ghost ghost removed the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Jul 1, 2024
@ghost
Copy link
Copy Markdown

ghost commented Jul 1, 2024

This PR/issue depends on:

@seewoo5
Copy link
Copy Markdown
Collaborator Author

seewoo5 commented Jul 2, 2024

@eric-wieser Could you help me for setup? I'm trying to understand how the BilinForm works and how to adapt it to Wronskian. In fact, I cannot figure out how to "state" the theorem wronskianBilin. I found that the core definition of BilinForm is defined as mk₂ in LinearAlgebra/BilinearMap.lean, but not sure where to start. For example, do I need to re-write the definition of current Wronskian? Once I figure out the statements, I think I can prove it myself.

dagurtomas pushed a commit that referenced this pull request Jul 2, 2024
For an alternating form $B : M \times M \to R$ and $a, b, c \in M$ with $a + b+ c = 0$, we have $B(a, b) = B(b, c)$.
This can be used to prove the same property of Wronskian: see #14243.



Co-authored-by: Seewoo Lee <49933279+seewoo5@users.noreply.github.com>
@eric-wieser eric-wieser changed the title add polynomial Wronskian feat: add polynomial Wronskian Jul 2, 2024
@eric-wieser
Copy link
Copy Markdown
Member

eric-wieser commented Jul 2, 2024

With

import Mathlib.Algebra.Polynomial.AlgebraMap
import Mathlib.LinearAlgebra.SesquilinearForm
import Mathlib.Algebra.Algebra.Bilinear

you can write

variable (R) in
/-- `Polynomial.wronskian` as a bilinear map. -/
def wronskianBilin : R[X] →ₗ[R] R[X] →ₗ[R] R[X] :=
  (LinearMap.mul R R[X]).compl₂ derivative - (LinearMap.mul R R[X]).comp derivative

@[simp]
theorem wronskianBilin_apply (a b : R[X]) : wronskianBilin R a b = wronskian a b := rfl

@seewoo5
Copy link
Copy Markdown
Collaborator Author

seewoo5 commented Jul 4, 2024

How can I state IsAltwronskianBilin? I tried the followings, which all didn't work (although I can prove it - whatever it is - with existing wronskian_anticomm that I may rename as wronskian_is_alt)

theorem IsAltwronskianBilin : wronskianBilin.IsAlt := by sorry
theorem IsAltwronskianBilin : LinearMap.IsAlt wronskianBilin := by sorry 

@eric-wieser
Copy link
Copy Markdown
Member

That doesn't work because Lean can't work out which R you are talking about. See my edit above for the fix, then you can write (wronskianBilin R).IsAlt.

@seewoo5
Copy link
Copy Markdown
Collaborator Author

seewoo5 commented Jul 6, 2024

I think I'm almost done assuming IsAltwronskianBilin (I just sorryed it and proved everything else). I have

theorem IsAltwronskianBilin : (wronskianBilin R).IsAlt := by
  intro a
  rw [wronskianBilin]
  -- sorry

and I thought ring or ring_nf would just finish from here, but it seems not.

@seewoo5
Copy link
Copy Markdown
Collaborator Author

seewoo5 commented Jul 9, 2024

@eric-wieser I believe it is now ready to be merged - let me know if it needs further updates.

Copy link
Copy Markdown
Member

@eric-wieser eric-wieser left a comment

Choose a reason for hiding this comment

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

maintainer merge

My one lingering question is "are you sure you don't want the n-ary wronskian instead of the binary one?". That could be written as an AlternatingMap.

If you don't want it, let's add that as a TODO in the module docstring.

I'll let someone else give this the final review, but it looks great to me now.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jul 9, 2024

🚀 Pull request has been placed on the maintainer queue by eric-wieser.

@github-actions github-actions bot added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Jul 9, 2024
@seewoo5
Copy link
Copy Markdown
Collaborator Author

seewoo5 commented Jul 9, 2024

maintainer merge

My one lingering question is "are you sure you don't want the n-ary wronskian instead of the binary one?". That could be written as an AlternatingMap.

If you don't want it, let's add that as a TODO in the module docstring.

I'll let someone else give this the final review, but it looks great to me now.

At least for me, I don't need it right now (for polynomial FLT). But I have an (unordinary) application in my mind that uses n-ary Wronskian. The polynomial FLT can be extended to arbitrary number of polynomials as follows: for any algebraically closed characteristic zero field $k$, the Fermat-Catalan equation

$$ a_{1}^{m_{1}} + a_{2}^{m_{2}} + \cdots + a_{n-1}^{m_{n-1}} = a_{n}^{m_{n}} $$

does not admit a non-constant solution in $k[t]$ whenever $n(n-2) \leq m_{i}$ for all $1\leq i \leq n$ (see this paper). The proof is almost same as the original Mason-Stothers theorem, and it certainly uses n-ary Wronskian. I haven't tried to formalize this proof yet, but if someone wants to formalize this (or possibly more general version that is much close to the Mason-Stothers theorem, not only for the Fermat-Catalan equations), they may need the n-ary version.

But Wronskian itself is more useful for testing linear independence of sufficiently nice functions, not only polynomials. In that direction, ultimately it would be better to define Wronskian for more general class of functions - or even for abstract rings with derivations - not only for polynomials. So I think it is fine to leave it as-is at this point.

@riccardobrasca
Copy link
Copy Markdown
Member

Can you please make the linter happy? Thanks!

@seewoo5
Copy link
Copy Markdown
Collaborator Author

seewoo5 commented Jul 11, 2024

/- The `simpNF` linter reports:
SOME SIMP LEMMAS ARE NOT IN SIMP-NORMAL FORM.
see note [simp-normal form] for tips how to debug this.
https://leanprover-community.github.io/mathlib_docs/notes.html#simp-normal%20form -/
-- Mathlib.Algebra.Polynomial.Degree.Definitions
Error: ././././Mathlib/Algebra/Polynomial/Degree/Definitions.lean:1[23](https://github.com/leanprover-community/mathlib4/actions/runs/9868167114/job/27249725253?pr=14243#step:22:24):1: error: @Polynomial.degree_ne_bot simp can prove this:
  by simp only [@ne_eq, @Polynomial.degree_eq_bot]
One of the lemmas above could be a duplicate.
If that's not the case try reordering lemmas or adding @[priority].

If I understood correctly, this says that the newly added theorem degree_ne_bot is somewhat duplicates with degree_eq_bot. Should I remove this from the Definitions.lean and prove the original statement in Wronskian via Polynomial.degree_eq_bot.ne?

@eric-wieser
Copy link
Copy Markdown
Member

It's just telling you to remove @[simp]

@riccardobrasca
Copy link
Copy Markdown
Member

Thanks!

bors merge

@github-actions github-actions bot added the ready-to-merge This PR has been sent to bors. label Jul 11, 2024
mathlib-bors bot pushed a commit that referenced this pull request Jul 11, 2024
Define wronskian for polynomials over commutative rings, and prove some basic properties. This is mainly for the porting of our (me and @jcpaik) formalization of [Mason-Stothers theorem](https://github.com/seewoo5/lean-poly-abc). We already discussed about this in [Zulip](https://leanprover.zulipchat.com/#narrow/stream/217875-Is-there-code-for-X.3F/topic/Ring.20with.20derivation/near/447378869). Especially, it may possible to improve as
* Replace `CommRing` with `Ring`
* or more generally, Wronskian can be defined over any ring with `Derivation`, and most of the theorems we proved should also hold in this context



Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Co-authored-by: Seewoo Lee <49933279+seewoo5@users.noreply.github.com>
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Jul 11, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat: add polynomial Wronskian [Merged by Bors] - feat: add polynomial Wronskian Jul 11, 2024
@mathlib-bors mathlib-bors bot closed this Jul 11, 2024
@mathlib-bors mathlib-bors bot deleted the wronskian branch July 11, 2024 08:58
@adomani adomani mentioned this pull request Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! 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.

5 participants