-
Notifications
You must be signed in to change notification settings - Fork 295
@[mk_iff]
causes a type error
#10696
Comments
I think this error makes sense. It tried to write down something like Aside: This inductive looks better suited as a definition by recursion on n and then l. |
Indeed, I was just trying to compare the inductive type vs recursive def approach. What I actually have is along the lines of: def nary_rel (α : Type u) : ℕ → Type u
| 0 := α → Prop
| (n + 1) := α → nary_rel n
def list.nwise {α : Type u} : Π n, nary_rel α n → list α → Prop
| 0 r l := ∀ x ∈ l, r x
| (n + 1) r [] := true
| (n + 1) r (x :: xs) := xs.nwise _ (r x) ∧ xs.nwise _ r
@[simp] lemma list.nwise_zero (r : nary_rel α 0) (l : list α) :
l.nwise _ r ↔ ∀ x ∈ l, r x :=
by cases l; simp [list.nwise]
lemma nwise_iff_pairwise {α : Type u} (l : list α) (r : α → α → Prop) :
l.pairwise r ↔ l.nwise 1 r :=
begin
induction l,
{ simp [list.nwise], },
{ simp only [list.nwise, list.pairwise_cons, l_ih],
refine and_congr _ iff.rfl,
dsimp [nat.add_zero, list.nwise],
rw list.nwise_zero, },
end but I assumed since |
Honestly I have no idea, I expected |
Is the error message better in Lean 4? Should we open an issue? |
The error message is essentially the same: function expected
a✝¹ x However the message appears on the word |
Okay, let's close this then. I hope we do eventually get better error all around, though. |
The following fails with a weird error when
mk_iff
is uncommented:The error is on the
r x
in the| zero
constructor, and is:The text was updated successfully, but these errors were encountered: