Skip to content

fix: activate CompleteLattice→CCPO under open Std.Internal.Do - #14502

Merged
sgraf812 merged 1 commit into
leanprover:masterfrom
sgraf812:sg/triple-order-ambiguity
Jul 22, 2026
Merged

fix: activate CompleteLattice→CCPO under open Std.Internal.Do#14502
sgraf812 merged 1 commit into
leanprover:masterfrom
sgraf812:sg/triple-order-ambiguity

Conversation

@sgraf812

@sgraf812 sgraf812 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

This PR scopes Lean.Order.instCCPO_std into Std.Internal.Do so Hoare triple notation (which defaults the exception postcondition to ) elaborates after open Std.Internal.Do without also requiring open Lean.Order.

Previously ⦃ P ⦄ x ⦃ Q ⦄ expanded to Triple … Lean.Order.bot, and synthesizing CCPO for the exception postcondition required the scoped CompleteLattice → CCPO instance from Lean.Order. Opening only Std.Internal.Do (as needed for the notation) left that instance inactive and failed with failed to synthesize Lean.Order.CCPO EPost⟨⟩. The fix uses attribute [scoped instance] so the same instance is also activated by open Std.Internal.Do.

This PR scopes `Lean.Order.instCCPO_std` into `Std.Internal.Do` so Hoare triple notation (which defaults the exception postcondition to `⊥`) elaborates after `open Std.Internal.Do` without also requiring `open Lean.Order`.

Co-authored-by: Cursor <cursoragent@cursor.com>
@sgraf812 sgraf812 added the changelog-library Library label Jul 22, 2026
@sgraf812
sgraf812 marked this pull request as ready for review July 22, 2026 14:44
@sgraf812
sgraf812 requested a review from TwoFX as a code owner July 22, 2026 14:44
@sgraf812
sgraf812 enabled auto-merge July 22, 2026 14:44
@sgraf812
sgraf812 added this pull request to the merge queue Jul 22, 2026
@github-actions github-actions Bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Jul 22, 2026
@mathlib-lean-pr-testing

Copy link
Copy Markdown

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 1545cc8d57ef25a450e9baef4d689eb63df1f8e0 --onto 3259610687883ec1ea48c481aba2469f2f83facf. You can force Mathlib CI using the force-mathlib-ci label. (2026-07-22 16:06:06)

@leanprover-bot

Copy link
Copy Markdown
Collaborator

Reference manual CI status:

  • ❗ Reference manual CI will not be attempted unless your PR branches off the nightly-with-manual branch. Try git rebase 1545cc8d57ef25a450e9baef4d689eb63df1f8e0 --onto 49ff95727f98d43984726b26742d17a1ceea9dd5. You can force reference manual CI using the force-manual-ci label. (2026-07-22 16:06:08)

Merged via the queue into leanprover:master with commit f82e306 Jul 22, 2026
28 checks passed
@sgraf812
sgraf812 deleted the sg/triple-order-ambiguity branch July 23, 2026 06:00
robsimmons pushed a commit that referenced this pull request Jul 29, 2026
This PR scopes `Lean.Order.instCCPO_std` into `Std.Internal.Do` so Hoare
triple notation (which defaults the exception postcondition to `⊥`)
elaborates after `open Std.Internal.Do` without also requiring `open
Lean.Order`.

Previously `⦃ P ⦄ x ⦃ Q ⦄` expanded to `Triple … Lean.Order.bot`, and
synthesizing `CCPO` for the exception postcondition required the scoped
`CompleteLattice → CCPO` instance from `Lean.Order`. Opening only
`Std.Internal.Do` (as needed for the notation) left that instance
inactive and failed with `failed to synthesize Lean.Order.CCPO EPost⟨⟩`.
The fix uses `attribute [scoped instance]` so the same instance is also
activated by `open Std.Internal.Do`.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-library Library toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants