Skip to content

[Merged by Bors] - feat: add LinearMap.IsAlt.eq_of_add_add_eq_zero#14281

Closed
seewoo5 wants to merge 8 commits intomasterfrom
alt-eq-of-sum-zero
Closed

[Merged by Bors] - feat: add LinearMap.IsAlt.eq_of_add_add_eq_zero#14281
seewoo5 wants to merge 8 commits intomasterfrom
alt-eq-of-sum-zero

Conversation

@seewoo5
Copy link
Copy Markdown
Collaborator

@seewoo5 seewoo5 commented Jun 30, 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.


Open in Gitpod

@seewoo5 seewoo5 requested a review from eric-wieser June 30, 2024 07:46
@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 30, 2024
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 30, 2024

PR summary 7857ad4e6e

Import changes

No significant changes to the import graph


Declarations diff

+ IsAlt.eq_of_add_add_eq_zero
+ eq_of_add_add_eq_zero

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>

@seewoo5 seewoo5 self-assigned this Jun 30, 2024
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.

Could you prove this for LinearMap.IsAlt too?

@eric-wieser
Copy link
Copy Markdown
Member

Here's a proof that works for semirings and not just rings:

theorem isAlt.eq_of_add_add_eq_zero [IsCancelAdd R] {B : LinearMap.BilinForm R M} {a b c : M} (hB : B.IsAlt) (hSum : a + b + c = 0) :
    B a b = B b c := by
  have : B a a + B a b + B a c = B a c + B b c + B c c := by
    simp_rw [← map_add, ← map_add₂, hSum, map_zero, zero_apply]
  rw [hB, hB, zero_add, add_zero, add_comm] at this
  exact add_left_cancel this

I'll leave adapting this to LinearMap.IsAlt to you :)

@eric-wieser eric-wieser added awaiting-author A reviewer has asked the author a question or requested changes. t-algebra Algebra (groups, rings, fields, etc) labels Jun 30, 2024
@seewoo5
Copy link
Copy Markdown
Collaborator Author

seewoo5 commented Jun 30, 2024

Here's a proof that works for semirings and not just rings:

theorem isAlt.eq_of_add_add_eq_zero [IsCancelAdd R] {B : LinearMap.BilinForm R M} {a b c : M} (hB : B.IsAlt) (hSum : a + b + c = 0) :
    B a b = B b c := by
  have : B a a + B a b + B a c = B a c + B b c + B c c := by
    simp_rw [← map_add, ← map_add₂, hSum, map_zero, zero_apply]
  rw [hB, hB, zero_add, add_zero, add_comm] at this
  exact add_left_cancel this

I'll leave adapting this to LinearMap.IsAlt to you :)

I naively put this above end IsAlt as theorem eq_of_add_add_eq_zero ..., and it says that zero_apply in simp_rw made no progress. Do you have any idea?

@eric-wieser
Copy link
Copy Markdown
Member

It might need to be LinearMap.zero_apply. If you push what you tried, I can help more.

Another trick would be to just remove that lemma from the simp_rw, then use simp? to find what the lemma is really called.

@seewoo5
Copy link
Copy Markdown
Collaborator Author

seewoo5 commented Jun 30, 2024

Updated (almost no change from your suggestion, which also worked well for LinearMap.IsAlt. I changed some names of variables and remove unnecessary terms, too.

Actually, I don't quite understand why we don't need IsCancelAdd R₁ hypothesis for the same theorem in SesquilinearForm.lean. I was not able to find the relevant assumption in the file, but it works well without explicitly assuming it in the theorem, so I guess I'm missing the hypothesis which is somewhere in the file.

@seewoo5 seewoo5 changed the title add Alt_eq_of_sum_zero feat: add isAlt.eq_of_add_add_zero Jul 1, 2024
@seewoo5 seewoo5 changed the title feat: add isAlt.eq_of_add_add_zero feat: add isAlt.eq_of_add_add_eq_zero Jul 1, 2024
@eric-wieser eric-wieser changed the title feat: add isAlt.eq_of_add_add_eq_zero feat: add LinearMap.IsAlt.eq_of_add_add_eq_zero Jul 1, 2024
seewoo5 and others added 2 commits July 1, 2024 08:05
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@eric-wieser
Copy link
Copy Markdown
Member

bors merge

Thanks, this now looks great!

@github-actions github-actions bot added the ready-to-merge This PR has been sent to bors. label Jul 1, 2024
@github-actions github-actions bot removed the awaiting-author A reviewer has asked the author a question or requested changes. label Jul 1, 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
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Jul 1, 2024

Build failed (retrying...):

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
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Jul 1, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat: add LinearMap.IsAlt.eq_of_add_add_eq_zero [Merged by Bors] - feat: add LinearMap.IsAlt.eq_of_add_add_eq_zero Jul 1, 2024
@mathlib-bors mathlib-bors bot closed this Jul 1, 2024
@mathlib-bors mathlib-bors bot deleted the alt-eq-of-sum-zero branch July 1, 2024 23:15
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>
@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

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.

2 participants