Zulip Chat Archive
Stream: mathlib4
Topic: !4#3274 typeclass instance problem
Jeremy Tan (Apr 05 2023 at 04:19):
!4#3274 there are two remaining instances of the typeclass instance problem being stuck here, can you help?
Moritz Doll (Apr 05 2023 at 04:34):
did you try the usual fixes?
Moritz Doll (Apr 05 2023 at 04:38):
(or as a better question: what is the offending code?)
Jeremy Tan (Apr 05 2023 at 04:43):
One of them is
theorem incMatrix_mul_transpose_apply_of_adj (h : G.Adj a b) :
(G.incMatrix R ⬝ (G.incMatrix R)ᵀ) a b = (1 : R) := by
classical
simp_rw [Matrix.mul_apply, Matrix.transpose_apply, incMatrix_apply_mul_incMatrix_apply,
Set.indicator_apply, Pi.one_apply, sum_boole]
convert Nat.cast_one -- here
convert card_singleton ⟦(a, b)⟧
rw [← coe_eq_singleton, coe_filter_univ]
exact G.incidenceSet_inter_incidenceSet_of_adj h
Jeremy Tan (Apr 05 2023 at 04:43):
The other is
theorem incMatrix_apply_eq_one_iff : G.incMatrix R a e = 1 ↔ e ∈ G.incidenceSet a := by
convert one_ne_zero.ite_eq_left_iff -- here; I've tried @ on this to no avail
infer_instance
Moritz Doll (Apr 05 2023 at 04:47):
ah yeah, that happens sometimes with convert. I usually rewrite the proofs to avoid convert
.
Moritz Doll (Apr 05 2023 at 04:49):
I would not be surprised if the second one is just apply one_ne_zero.ite_eq_left_iff
Jeremy Tan (Apr 05 2023 at 04:52):
Moritz Doll said:
I would not be surprised if the second one is just
apply one_ne_zero.ite_eq_left_iff
There's still an error with the one-line replacement:
failed to synthesize instance
Decidable (e ∈ incidenceSet G a)
Jeremy Tan (Apr 05 2023 at 04:53):
(that error also showed up when I tried to do the @
on that)
Jeremy Tan (Apr 05 2023 at 05:11):
oh, the first problem (Nat.cast_one
) is solved with convert @Nat.cast_one R _
Jeremy Tan (Apr 05 2023 at 05:38):
and now I fixed the other error, so it compiles now
Last updated: Dec 20 2023 at 11:08 UTC