feat: assert the property of a `Subtype.mk` term in `grind` (#15802)
This PR makes `grind` learn `p v` from a term `⟨v, h⟩ : {x // p x}`, so
facts about subtypes are usable even when the type of the stored proof
`h` is only definitionally equal to `p v`. For example, after
`Subtype.forall` normalizes `∀ x : {b // R a b}, q x` to `∀ b (h : R a
b), q ⟨b, h⟩`, the instance for `⟨b, hab⟩` with `hab : diag R a b` is
now discharged.
The proposition `grind` learns from a nested proof is its inferred type,
which may differ syntactically from the subtype predicate applied to the
value. `grind` now asserts `p v` once when it internalizes a
`Subtype.mk` application, with the stored proof as evidence. The new
test file `grind_subtype_forall_defeq.lean` covers the side conditions
introduced by `Subtype.forall` and the other `Subtype` facts `grind`
handles.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
This is the repository for Lean 4.
See Install Lean.
Please read our Contribution Guidelines first.
See Building Lean.