Zulip Chat Archive
Stream: lean4
Topic: simp error: application type mismatch
Vasilii Nesterov (Sep 12 2025 at 12:40):
While working on #28874 I discovored this bug:
import Mathlib.Data.Seq.Defs
import Mathlib.Data.ENat.Basic
def length' (s : Stream'.Seq ℕ) [Decidable s.Terminates] : ENat :=
if h : s.Terminates then s.length h else none
instance : Decidable (Stream'.Seq.nil : Stream'.Seq ℕ).Terminates :=
.isTrue (by simp)
-- (kernel) application type mismatch
theorem length'_nil : length' (Stream'.Seq.nil : Stream'.Seq ℕ) = 0 := by
simp [length']
Is this a known issue? I haven’t investigated it further yet.
Joachim Breitner (Sep 12 2025 at 17:36):
Another instance of the issues with simp and defeq proofs; this works
theorem length'_nil : length' (Stream'.Seq.nil : Stream'.Seq ℕ) = 0 := by
simp -implicitDefEqProofs [length']
Last updated: Dec 20 2025 at 21:32 UTC