Skip to content

[Merged by Bors] - feat(SetTheory/Surreal/Basic): surreal number multiplication#14044

Closed
hwatheod wants to merge 26 commits intomasterfrom
hwatheod/surreal_multiplication
Closed

[Merged by Bors] - feat(SetTheory/Surreal/Basic): surreal number multiplication#14044
hwatheod wants to merge 26 commits intomasterfrom
hwatheod/surreal_multiplication

Conversation

@hwatheod
Copy link
Copy Markdown
Contributor

@hwatheod hwatheod commented Jun 23, 2024

prove multiplication of surreal numbers is well-defined, thus they form an ordered commutative ring

This is a port of a Lean 3 proof from this mathlib branch. It shows that multiplication of surreal numbers is well-defined, and therefore the surreal numbers form an ordered commutative ring.

Because Surreal is now a ring, the simp normal-form for scalar multiplication (by integers) is now *. This required changes throughout SetTheory/Surreal/Dyadic.

For the most part, I translated the Lean 3 code directly to Lean 4, although in a few cases, I couldn't get that to work and wrote a new proof instead.

There were some lemmas used that were in the mathlib branch that were not ported to mathlib4. I have ported those lemmas and put them in an appropriate place in mathlib4.

I copied over the author names from the Lean 3 code and added myself.


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 23, 2024
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 23, 2024

PR summary 877c8d3e90

Import changes

Dependency changes

File Base Count Head Count Change
Mathlib.SetTheory.Surreal.Dyadic 849 864 +15 (+1.77%)

Declarations diff

+ Args
+ Args.Numeric
+ Args.numeric_P1
+ Args.numeric_P24
+ Args.toMultiset
+ ArgsRel
+ ArgsRel.numeric_closed
+ Equiv.mul_congr
+ Equiv.mul_congr_left
+ Equiv.mul_congr_right
+ IH1
+ IH24
+ IH3
+ IH4
+ MulOptionsLTMul
+ Numeric.mul
+ Numeric.mul_pos
+ P1
+ P124
+ P1_of_eq
+ P1_of_ih
+ P1_of_lt
+ P2
+ P24_neg_left
+ P24_neg_right
+ P24_of_ih
+ P2_neg_left
+ P2_neg_right
+ P3
+ P3.trans
+ P3_comm
+ P3_neg
+ P3_of_ih
+ P3_of_le_left
+ P3_of_lt
+ P3_of_lt_of_lt
+ P4
+ P4_neg_left
+ P4_neg_right
+ TransGen.closed'
+ argsRel_wf
+ cutExpand_add_right
+ cutExpand_closed
+ cutExpand_double
+ cutExpand_double_left
+ cutExpand_pair_left
+ cutExpand_pair_right
+ cutExpand_zero
+ ih1
+ ih1_neg_left
+ ih1_neg_right
+ ih1_swap
+ ih24_neg
+ ih3_of_ih
+ ih4
+ ih4_neg
+ ih₁₂
+ ih₂₁
+ instance : LinearOrderedCommRing Surreal
+ isOption
+ leftMoves_mul_iff
+ main
+ mulOption
+ mulOption_lt
+ mulOption_lt_iff_P1
+ mulOption_lt_mul_iff_P3
+ mulOption_lt_mul_of_equiv
+ mulOption_lt_of_lt
+ mulOption_neg_neg
+ mulOption_symm
+ mulOptionsLTMul_of_numeric
+ mul_right_le_of_equiv
+ numeric_mul_option
+ numeric_of_ih
+ numeric_option_mul
+ numeric_option_mul_option
+ quot_neg_mul_neg
+ rightMoves_mul_iff
++ P24

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>

@hwatheod hwatheod force-pushed the hwatheod/surreal_multiplication branch from 766cd86 to 36c6cd7 Compare June 23, 2024 04:14
@kim-em kim-em added awaiting-author A reviewer has asked the author a question or requested changes. and removed awaiting-review labels Jun 24, 2024
@hwatheod hwatheod added awaiting-review and removed awaiting-author A reviewer has asked the author a question or requested changes. labels Jun 24, 2024
Copy link
Copy Markdown
Contributor

@alreadydone alreadydone left a comment

Choose a reason for hiding this comment

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

Thanks for porting and opening the PR! Here are some initial comments, and I'll probably do some cleanups myself later. (There's a algebraic geometry formalization workshop this week, so my time will be limited ...)

Copy link
Copy Markdown
Contributor

@alreadydone alreadydone left a comment

Choose a reason for hiding this comment

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

Thanks for your work! I've pushed some more cleanups. I think the only thing remaining is to clean up the draft docs, which I should be able to do by the end of tomorrow.

Copy link
Copy Markdown
Contributor

@alreadydone alreadydone left a comment

Choose a reason for hiding this comment

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

Okay I think I've done cleaning up the PR. Maybe @MichaelStollBayreuth (coauthor of the original proof) would be interested in taking a look, and then I think we can merge this!

@alreadydone
Copy link
Copy Markdown
Contributor

Also, I haven't seen @vihdzp around for a while but I think this is worth a notification. also cc @apurvanakade

@MichaelStollBayreuth
Copy link
Copy Markdown
Contributor

I'll try to have a look soon-ish, but won't have a lot of time this week because of the AIM workshop (plus teaching etc. as usual).

@kim-em
Copy link
Copy Markdown
Contributor

kim-em commented Jun 27, 2024

Two minor comments, but otherwise I'm happy.

bors d+

@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Jun 27, 2024

✌️ hwatheod can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@github-actions github-actions bot added delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). and removed awaiting-review labels Jun 27, 2024
@hwatheod
Copy link
Copy Markdown
Contributor Author

bors r+

mathlib-bors bot pushed a commit that referenced this pull request Jun 27, 2024
prove multiplication of surreal numbers is well-defined, thus they form an ordered commutative ring


This is a port of a Lean 3 proof from [this mathlib branch](https://github.com/leanprover-community/mathlib/blob/surreal_mul_symm'/src/set_theory/surreal/basic.lean). It shows that multiplication of surreal numbers is well-defined, and therefore the surreal numbers form an ordered commutative ring.

Because `Surreal` is now a ring, the simp normal-form for scalar multiplication (by integers) is now `*`. This required changes throughout `SetTheory/Surreal/Dyadic`.

For the most part, I translated the Lean 3 code directly to Lean 4, although in a few cases, I couldn't get that to work and wrote a new proof instead.

There were some lemmas used that were in the mathlib branch that were not ported to mathlib4. I have ported those lemmas and put them in an appropriate place in mathlib4.

I copied over the author names from the Lean 3 code and added myself.



Co-authored-by: Junyan Xu <junyanxumath@gmail.com>
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Jun 27, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat(SetTheory/Surreal/Basic): surreal number multiplication [Merged by Bors] - feat(SetTheory/Surreal/Basic): surreal number multiplication Jun 27, 2024
@mathlib-bors mathlib-bors bot closed this Jun 27, 2024
@mathlib-bors mathlib-bors bot deleted the hwatheod/surreal_multiplication branch June 27, 2024 06:36
dagurtomas pushed a commit that referenced this pull request Jul 2, 2024
prove multiplication of surreal numbers is well-defined, thus they form an ordered commutative ring


This is a port of a Lean 3 proof from [this mathlib branch](https://github.com/leanprover-community/mathlib/blob/surreal_mul_symm'/src/set_theory/surreal/basic.lean). It shows that multiplication of surreal numbers is well-defined, and therefore the surreal numbers form an ordered commutative ring.

Because `Surreal` is now a ring, the simp normal-form for scalar multiplication (by integers) is now `*`. This required changes throughout `SetTheory/Surreal/Dyadic`.

For the most part, I translated the Lean 3 code directly to Lean 4, although in a few cases, I couldn't get that to work and wrote a new proof instead.

There were some lemmas used that were in the mathlib branch that were not ported to mathlib4. I have ported those lemmas and put them in an appropriate place in mathlib4.

I copied over the author names from the Lean 3 code and added myself.



Co-authored-by: Junyan Xu <junyanxumath@gmail.com>
mathlib-bors bot pushed a commit that referenced this pull request Apr 13, 2025
Deduplicates the instance `LinearOrder Surreal`, which was defined in both `Surreal/Basic` and `Surreal/Multiplication`.
The duplicate originated in #14044.

The surviving instance is at

https://github.com/leanprover-community/mathlib4/blob/461b2e79dd4c923f26e435f770faeaf87208d0d9/Mathlib/SetTheory/Surreal/Basic.lean#L368-L373
tannerduve pushed a commit that referenced this pull request May 13, 2025
Deduplicates the instance `LinearOrder Surreal`, which was defined in both `Surreal/Basic` and `Surreal/Multiplication`.
The duplicate originated in #14044.

The surviving instance is at

https://github.com/leanprover-community/mathlib4/blob/461b2e79dd4c923f26e435f770faeaf87208d0d9/Mathlib/SetTheory/Surreal/Basic.lean#L368-L373
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants