Zulip Chat Archive

Stream: new members

Topic: Failed to synthesize despite abbrev


Francisco Giordano (Nov 30 2023 at 22:14):

What is the reason the second #synth fails below? I expected abbrev to solve this typeclass issue.

import Mathlib.LinearAlgebra.Basic

variable [Field F] [Fintype F]
variable (n : )

#synth AddCommMonoid (Fin n  F) -- ok

abbrev Vec := Fin n  F

#synth AddCommMonoid (Vec n) -- failed to synthesize

Eric Wieser (Nov 30 2023 at 23:01):

Lean doesn't know what F you want to use

Eric Wieser (Nov 30 2023 at 23:01):

#synth AddCommMonoid (Vec (F := F) n) works


Last updated: Dec 20 2023 at 11:08 UTC