You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Type incorrect translation of well-founded function with dite in the type #7322
PR #7166 was green, mathlib built, I sent it to the queue, and it came back with a pretty tricky failure in the recursive theorem Std.Tactic.BVDecide.BVExpr.bitblast.blastShiftLeftConst.go_denote_eq.
After some debugging I found out that the issue is in WF/Fix.lean, which I didn’t even change! But it seems by reordering the parameters I have uncovered a pre-existing bug:
/--warning: declaration uses 'sorry'---error: application type mismatch congrArg (fun _a => _a = ⟨idx, h⟩) (x✝ n✝ (id sorry))argument has type a = if hidx : idx < distance then ⟨idx, hidx⟩ else abut function has type (a = if hidx : idx < distance then ⟨idx, hidx⟩ else a) → (fun _a => _a = ⟨idx, h⟩) a = (fun _a => _a = ⟨idx, h⟩) (if hidx : idx < distance then ⟨idx, hidx⟩ else a)-/
#guard_msgs intheoremdemo (distance : Nat) (idx : Nat) (a : Fin distance) (fuel : Nat) :
a = if hidx : idx < distance then Fin.mk idx hidx else a := by
cases fuel
· sorry
next fuel =>
split
· rw [demo distance idx a fuel]
sorry
· rfl
termination_by fuel
decreasing_by sorry
The problem is that refining the induction hypothesis through the matcher introduced by split changes the type from
Activity
nomeata commentedon Mar 4, 2025
Ok, one simple fix for this to only refine match targets that are fvars in the induction hypothesis. Let’s see what breaks…
feat: WF/Fix.lean: only refine fix’s ih for atomic discriminant onlys (…