Skip to content

feat: Port the list part of bi/big_op.v#168

Merged
markusdemedeiros merged 25 commits intoleanprover-community:masterfrom
lzy0505:zliu/bi-bigop-list
Mar 30, 2026
Merged

feat: Port the list part of bi/big_op.v#168
markusdemedeiros merged 25 commits intoleanprover-community:masterfrom
lzy0505:zliu/bi-bigop-list

Conversation

@lzy0505
Copy link
Copy Markdown
Collaborator

@lzy0505 lzy0505 commented Mar 16, 2026

Description

Part of #113.

Ported big_[and/or/sep]L, and big_sepL2.

Checklist

  • My code follows the mathlib naming and code style conventions
  • I have updated PORTING.md as appropriate
  • I have added my name to the authors section of any appropriate files

Generative AI Guidelines

AI assistance is permitted when making contributions to Iris-Lean, however, generative AI systems tend to produce code which takes a long time to review.
Please carefully review your code to ensure it meets the following standards.

  • Your PR should avoid duplicating constructions found in Iris-Lean or in the Lean standard library.
  • have statements that do not aid readability or code reuse should be inlined.
  • Your proofs should be shortened such that their overall structure is explicable to a human reader. As a goal, aim to express one idea per line.
  • In general, proofs should not perform substantially more case splitting than their Rocq counterparts.

In our experience, a good place to begin refactoring is by re-arranging and combining independent tactic invocations.
We also find that pointing generative AI systems to the Mathlib code style guidelines can help them perform some of this refactoring work.

@lzy0505 lzy0505 force-pushed the zliu/bi-bigop-list branch from 5829495 to f3e2e10 Compare March 16, 2026 22:04
@lzy0505 lzy0505 force-pushed the zliu/bi-bigop-list branch from d83f17a to c0318d3 Compare March 18, 2026 22:14
@lzy0505 lzy0505 marked this pull request as ready for review March 19, 2026 12:37
Copy link
Copy Markdown
Collaborator

@markusdemedeiros markusdemedeiros left a comment

Choose a reason for hiding this comment

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

Nice code, and thanks for the time you put into refactoring! I left comments with improvements, but didn't tag every instance of every improvement.

Some are just suggestions for style improvements, like you asked for. Some are refactoring opportunities I haven't tried, but would try if I were doing the final pass over this PR to try and clean up the bigger proofs--some of the bigger ones in BigSepList should be tried to be improved if at all possible. What you do with these are a judgment call on your end, because I'd say this code is pretty good :)

Φ k y1 y2 ≡{n}≡ Ψ k y1' y2') :
([∗list] k ↦ x1;x2 ∈ l1;l2, Φ k x1 x2) ≡{n}≡
([∗list] k ↦ x1;x2 ∈ l1';l2', Ψ k x1 x2) :=
match l1, l1', l2, l2' with
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

In cases like this, where the matching is overwhelming, doesn't bind anything, and not very informative, I think using a first | · tac1 | · tac2 | ... is a lot cleaner. Here, try

cases l1, l1', l2, l2' <;> first | · exact .rfl | · simp at hl2 | · simp at hl1 | skip

and then put the last branch right below

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I couldn't make it work.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Done!

@lzy0505
Copy link
Copy Markdown
Collaborator Author

lzy0505 commented Mar 25, 2026

@markusdemedeiros Thank you so much for the review! I've passed over your comments. Feel free to make a final pass if you think some proofs should be further improved.

@markusdemedeiros
Copy link
Copy Markdown
Collaborator

Looks pretty good!

@markusdemedeiros markusdemedeiros merged commit 33c74d0 into leanprover-community:master Mar 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants