Skip to content

feat: port bi/Algebra - #663

Open
markusdemedeiros wants to merge 6 commits into
masterfrom
bi-algebra
Open

feat: port bi/Algebra#663
markusdemedeiros wants to merge 6 commits into
masterfrom
bi-algebra

Conversation

@markusdemedeiros

@markusdemedeiros markusdemedeiros commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Description

Finishes Algebra.v.

There are some lightweight tactics for dealing with sbi simplifications. sbi_unfold.v does this in Rocq, I'm not sure I understand what they're doing enough to determine if we should replicate them or ignore them. The tactics here seem to work alright. Polling you guys for your thoughts @Kaptch @MackieLoeffel. By your reading, is it doing anything that a simp set could not?

Checklist

  • My code follows the mathlib naming and code style conventions
  • 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.

@markusdemedeiros
markusdemedeiros marked this pull request as ready for review August 18, 2026 21:39
Comment thread Iris/Iris/BI/Algebra.lean Outdated
`(tactic| simp only [Iris.SiProp.pure_holds, Iris.SiProp.and_holds, Iris.SiProp.or_holds,
Iris.SiProp.sep_holds, Iris.SiProp.exists_holds, Iris.SiProp.forall_holds,
Iris.SiProp.later_holds_zero, Iris.SiProp.later_holds_succ,
Iris.SiProp.internalEq_holds, Iris.SiProp.cmraValid_holds, Iris.siPure_holds])

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.

Instead of the hard coded simp only list, I would use a custom simp attribute defined with register_simp_attr. This makes it easier to extend this list.
See wp_expr_simp for an example.
(Not sure if this approach also works for sbi_fold. The p parameter might prevent one from using a custom simp attribute there.)

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.

Yes, I think I might roll sbi_unfold into this PR and just do it properly. Finally an occasion to learn about simpprocs.

Comment thread Iris/Iris/BI/SIProp.lean
theorem biEntails_of_iff {P Q : SiProp} (h : ∀ n, P.holds n ↔ Q.holds n) : P ⊣⊢ Q :=
⟨fun n => (h n).mp, fun n => (h n).mpr⟩

@[simp] theorem pure_holds {φ : Prop} {n} : (iprop(⌜φ⌝) : SiProp).holds n ↔ φ := .rfl

@Kaptch Kaptch Aug 19, 2026

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.

Would it be okay to add those to simpset as well instead of adding a simp attribute?

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.

Probably a good idea. I'm going to redo the automation around sbi this morning and will re-request after.

@markusdemedeiros

Copy link
Copy Markdown
Collaborator Author

OK, I changed this PR to use a simp set for the sbi unfolding. It doesn't fully replicate Rocq's sbi_unfold.v--I think we need a simpproc to handle all the cases in this approach, or we can do something else. I don't quite know if sbi_unfold is meant to be useful in general or a tactic for mostly Iris use only, at the moment it helps us simplify our proofs, but it would have to be made more robust if Iris clients are expected to use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants