English
IsSymmetric(psum σ R n) holds for all σ, R, n.
Русский
IsSymmetric(psum σ R n) выполняется для всех σ, R, n.
LaTeX
$$IsSymmetric(psum_{\\sigma,R}(n))$$
Lean4
theorem accumulate_injective {n m} (hnm : n ≤ m) : Function.Injective (accumulate n m) :=
by
refine fun t s he ↦ funext fun i ↦ ?_
obtain h | h := lt_or_ge (i.1 + 1) m
· have := accumulate_rec i.2 h s
rwa [← he, accumulate_rec i.2 h t, add_right_cancel_iff] at this
· have := h.antisymm (i.2.nat_succ_le.trans hnm)
rw [← accumulate_last i.2 this t, ← accumulate_last i.2 this s, he]
iterate 2 { intro j hj; exact ((j.2.trans_le hnm).not_ge hj).elim
}