Zulip Chat Archive

Stream: Is there code for X?

Topic: sum over single element


Jenkin (Oct 19 2025 at 18:50):

I am trying to prove the following but I am not sure how

import Mathlib

variable {m : Type} [Fintype m] [Nonempty m] [DecidableEq m] (N : Matrix m m )

example {i : m × m} :
 x  { x : m × m | x.1 = x.2 } with i.2 = x.2, N i.1 x.1 = N i.1 i.2 := by
  sorry

any pointers welcome!

Kenny Lau (Oct 19 2025 at 18:52):

import Mathlib

variable {m : Type} [Fintype m] [Nonempty m] [DecidableEq m] (N : Matrix m m )

example {i : m × m} :
     x  { x : m × m | x.1 = x.2 } with i.2 = x.2, N i.1 x.1 = N i.1 i.2 := by
  convert Finset.sum_singleton _ _ using 2

Jenkin (Oct 19 2025 at 19:00):

I tried viewing this in the LEAN4 playground but there were unsolved goals

 {x  {x | x.1 = x.2} | i.2 = x.2} = {?convert_5}

Aaron Liu (Oct 19 2025 at 19:10):

import Mathlib

variable {m : Type} [Fintype m] [Nonempty m] [DecidableEq m] (N : Matrix m m )

example {i : m × m} :
     x  { x : m × m | x.1 = x.2 } with i.2 = x.2, N i.1 x.1 = N i.1 i.2 := by
  rw [Finset.sum_filter, Finset.sum_filter]
  conv =>
    enter [1, 2, a]
    equals if (i.2, i.2) = a then N i.1 i.2 else 0 =>
      grind
  simp

Kenny Lau (Oct 19 2025 at 19:56):

Jenkin said:

there were unsolved goals

you said pointers


Last updated: Dec 20 2025 at 21:32 UTC