lean4-htt/tests/lean/run/9365.lean
Sebastian Graf 61ea403bfa
fix: Make mvcgen mintro let/have bindings (#9474) (#9507)
This PR makes `mvcgen` `mintro` let/have bindings.

Closes #9474.
2025-08-06 07:30:09 +00:00

23 lines
599 B
Text

import Std.Tactic.Do
open Std.Do
set_option mvcgen.warning false
abbrev SM := StateM (Array Nat)
abbrev gns : SVal ((Array Nat)::[]) (Array Nat) := fun s => SVal.pure s
noncomputable def setZeroHead : StateM (Array Nat) Unit := do
modify fun _ => #[0, 1, 2, 3, 4, 5]
theorem setZeroHead_spec :
⦃⌜True⌝⦄
setZeroHead
⦃⇓ _ => ⌜∃ ns', (#gns).toList = 0 :: ns'⌝⦄ := by
mvcgen [setZeroHead]
-- We want to see and name the tuple `t` here in order for us not having to repeat its
-- definition in t.2.toList.tail below
rename_i t
simp
exists t.2.toList.tail