Zulip Chat Archive
Stream: general
Topic: Module on hamming
Bolton Bailey (Oct 09 2022 at 18:45):
@Wrenna Robson you asked about this. This is a MWE for hamming
not getting a module typeclass. Why doesn't the instance docs#hamming.module fire here?
import information_theory.hamming
import linear_algebra.finite_dimensional
def linear_code (𝓓 F : Type) [fintype 𝓓] [field F] := submodule F (hamming ( λ d : 𝓓, F ))
variables {𝓓 F : Type} [fintype 𝓓] [field F]
noncomputable def dimension (C : linear_code 𝓓 F) : ℕ :=
set.finrank F C.carrier
Wrenna Robson (Oct 09 2022 at 18:47):
This is a good question. It does with the type synonym, I assume?
Wrenna Robson (Oct 09 2022 at 18:48):
Does it if you spell that D -> F (with the proper unicode)?
Bolton Bailey (Oct 09 2022 at 18:48):
Yes, that works fine
Eric Wieser (Oct 10 2022 at 01:31):
This looks like the standard dependent typeclass issue that we have all the time with pi types
Eric Wieser (Oct 10 2022 at 01:32):
Lean isn't always able to conclude that @module R M ring.to_semiring _
is the same type as @module R M comm_semiring.to_semiring _
Eric Wieser (Oct 10 2022 at 01:32):
In particular, it frequently fails to do so in the presence of pi types
Last updated: Dec 20 2023 at 11:08 UTC