feat: add SPred and PostCond entailment lemmas#13582
Merged
Conversation
This PR adds several entailment-related lemmas to `Std.Do.SPred` and `Std.Do.PostCond`, intended for goal-decomposition during program verification proof automation. - `SPred.down_pure_nil` and `SPred.apply_pure_cons` (existing `rfl` lemmas) become `@[simp, grind =]`. Drops the now-redundant `pure_cons` argument from `simp` in `conjunction_apply`. - New `SPred.entails_nil_intro` and `SPred.entails_nil_pure_intro`: introduction forms for `entails` at `SPred []`, mirroring the existing `entails_cons_intro`. - New `SPred.down_pure_intro`: derive `(pure φ).down` from `φ`. - New `SPred.apply_pure_cons_entails_l`/`_r`: peel a state argument from `pure (σ::σs) φ s` on either side of `⊢ₛ`. - New `Std.Do.ExceptConds.entails.pure`: closes any `⊢ₑ` goal at `PostShape.pure`, where `ExceptConds.entails` reduces to `True`.
|
Mathlib CI status (docs):
|
Collaborator
|
Reference manual CI status:
|
sgraf812
added a commit
that referenced
this pull request
Apr 30, 2026
Renames `down_apply_pure_elim` to `down_pure_intro` and relocates it under the `# Pure` section of `DerivedLaws.lean`, matching #13582 as merged. Reverts the six `Invariant.withEarlyReturn`/`withEarlyReturnNewDo` variants to `abbrev` and reverts `Std/Data/String/ToNat.lean` to its pre-PR state, matching the final form of #13583. Updates the local `VCGen.lean` reference to the renamed `SPred.down_pure_intro` lemma and restores `mkFreshPair_triple` to legacy `mvcgen -elimLets +trivial` (it remains blocked under `mvcgen'`).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds several entailment-related lemmas to
Std.Do.SPredandStd.Do.PostCond, intended for goal-decomposition during program verification proof automation.SPred.down_pure_nilandSPred.apply_pure_cons(existingrfllemmas) become@[simp, grind =]. Drops the now-redundantpure_consargument fromsimpinconjunction_apply.SPred.entails_nil_introandSPred.entails_nil_pure_intro: introduction forms forentailsatSPred [], mirroring the existingentails_cons_intro.SPred.down_pure_intro: derive(pure φ).downfromφ.SPred.apply_pure_cons_entails_l/_r: peel a state argument frompure (σ::σs) φ son either side of⊢ₛ.Std.Do.ExceptConds.entails.pure: closes any⊢ₑgoal atPostShape.pure, whereExceptConds.entailsreduces toTrue.