lean4-htt/tests/lean/split_mvars_target.lean
Sebastian Graf 8fc94c5c90
fix: Make split work with metavariables in the target (#8437)
This PR fixes `split` in the presence of metavariables in the target.

The fix consists of replacing an internal use of `apply` for
instantiating match splitters by a new, simpler variant `applyN`. This
new `applyN` is not prone to #8436, which is the ultimate cause for
`split` failing on targets containing metavariables.

---------

Co-authored-by: Sebastian Graf <sg@lean-fro.org>
Co-authored-by: Joachim Breitner <mail@joachim-breitner.de>
2025-05-23 12:46:27 +00:00

15 lines
319 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/-!
Tests that `split` works when there are metavariables in the target.
-/
theorem split_subgoals {x : Option Nat × Nat} :
match x.fst with
| some _ => True
| none => True
:= by
have h {P : Prop} {x'} : (x' = 4 ∧ P) → P := by simp
apply h
split
rotate_right
· exact 4
· trivial
· trivial