Zulip Chat Archive

Stream: new members

Topic: use "2" to denote 2 times the unit matrix


Z. X. Wang (Aug 05 2025 at 16:10):

i want to prove that

2 i j = 2 * 1 i j

where the previous "2" denote two times the unit matrix, and the later "2" is just a Nat, and "1" is the unit matrix. But now i feel confused about the way that lean define the previous "2", so there is some trouble for me to prove the simple proposition.

Z. X. Wang (Aug 05 2025 at 16:19):

Here is the code

import Mathlib

open Matrix

example : 2 = 2  (1 : Matrix (Fin n) (Fin n) ) := by
  refine ext ?_
  intro i j
  simp only [smul_apply, nsmul_eq_mul, Nat.cast_ofNat]
  sorry

Yuyang Zhao (Aug 05 2025 at 16:21):

import Mathlib

open Matrix

example : 2 = 2  (1 : Matrix (Fin n) (Fin n) ) := by
  simp [nsmul_eq_mul]

edit: actually there is no need to write any lemma in simp...


Last updated: Dec 20 2025 at 21:32 UTC