Skip to content

feat: require the explicit motive in a match to be a type family#13076

Draft
goretkin wants to merge 3 commits intoleanprover:masterfrom
goretkin:gng/explicit-motive-match-remove-old
Draft

feat: require the explicit motive in a match to be a type family#13076
goretkin wants to merge 3 commits intoleanprover:masterfrom
goretkin:gng/explicit-motive-match-remove-old

Conversation

@goretkin
Copy link

@goretkin goretkin commented Mar 24, 2026

This PR requires all explicit motives to be a lambda.

Closes: #13081

This PR belongs to a stack:

feat: deprecate Pi type motives in match expressions, support type families

This PR adds deprecation warnings for Pi type motives in match expressions
and supports the new preferred style of using type families (lambdas) directly.

Deprecated:  match (motive := (x : T) → P x) ...
Preferred:   match (motive := fun (x : T) => P x) ...
BREAKING CHANGE: Pi type syntax for match motives is no longer accepted.
Use type family (lambda) syntax instead:
  Removed:    match (motive := (_ : Bool) → Nat) b with ...
  Use this:   match (motive := fun (_ : Bool) => Nat) b with ...
@goretkin goretkin force-pushed the gng/explicit-motive-match-remove-old branch from 2d4c1be to 150d4e3 Compare March 24, 2026 03:30
@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 Mar 24, 2026
@mathlib-lean-pr-testing
Copy link

mathlib-lean-pr-testing bot commented Mar 24, 2026

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 2e06fb50088a80ac174a608d51a9a9a069acad1a --onto 4bf7fa7447eea00cecba8327bb9c9e5f4485f0a7. You can force Mathlib CI using the force-mathlib-ci label. (2026-03-24 03:34:49)
  • ❗ Mathlib CI can not be attempted yet, as the nightly-testing-2026-03-10 tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto nightly-with-mathlib, Mathlib CI should run now. You can force Mathlib CI using the force-mathlib-ci label. (2026-03-24 04:16:56)

@leanprover-bot
Copy link
Collaborator

leanprover-bot commented Mar 24, 2026

Reference manual CI status:

  • ❗ Reference manual CI will not be attempted unless your PR branches off the nightly-with-manual branch. Try git rebase 2e06fb50088a80ac174a608d51a9a9a069acad1a --onto cfa8c5a036d6990635c6ec50b02d0e806995cec3. You can force reference manual CI using the force-manual-ci label. (2026-03-24 03:34:50)
  • ❗ Reference manual CI can not be attempted yet, as the nightly-testing-2026-03-10 tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto nightly-with-manual, reference manual CI should run now. You can force reference manual CI using the force-manual-ci label. (2026-03-24 04:16:58)

@goretkin goretkin changed the title feat!: require the explicit motive in a match to be a type family feat: require the explicit motive in a match to be a type family Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

match (explicit) motives are Pi types, but motives should be type families

2 participants