Skip to content

feat: port bi/lib/counterexamples.v (+ fix IntoWand instances) - #540

Open
alvinylt wants to merge 24 commits into
leanprover-community:masterfrom
ISTA-PLV:Counterexamples
Open

feat: port bi/lib/counterexamples.v (+ fix IntoWand instances)#540
alvinylt wants to merge 24 commits into
leanprover-community:masterfrom
ISTA-PLV:Counterexamples

Conversation

@alvinylt

@alvinylt alvinylt commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Description

Ports bi/lib/counterexamples.v.

Addresses #206.

Each Module in the Rocq version corresponds to a namespace in BI/Lib/Counterexamples.lean.

  • affine_em: AffineEM
  • löb_em: LoebEM
  • savedprop
  • inv
    • inv1
    • inv2
  • linear
  • later_credits_plain

Fixing IntoWand Instances

There is a comment above the existing type class instances intoWand_imp_false and intoWand_imp_true:

TODO: compare this with into_wand_impl_false_false, into_wand_impl_false_true, ... in Rocq

At one point within the proof of later_anything, we come across the following proof state:

□HnotP : ¬▷ False
□IH : ▷ False
⊢ False

With the existing two instances, we are unable to use ispecialize HnotP $$ IH to solve the goal.

The instance intoWand_imp_true stipulates Affine (▷ False), which does not hold. The type class instance into_wand_impl_true_true, on the other hand, has no such requirement. The instances intoWand_impl_false_true and intoWand_impl_false_false also come with different assumptions.

The two instances are therefore replaced by those directly corresponding to the formulation in Rocq.

Checklist

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

Comment on lines +257 to +259
/- Necessary to unfold `▷^[n + 1]` as `▷ ▷^[n]`, or else we get
`∗Hfalse : ▷^[n + 1] False` after `imod`. -/
icases (later_laterN n).mp $$ Hfalse with Hfalse

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We have to unfold laterN manually in order for imod to produce the correct hypothesis.
Might be interesting to investigate the cause.

@alvinylt
alvinylt marked this pull request as ready for review July 27, 2026 17:00
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.

1 participant