AFTD Auto-Formalizing Theoretical Domains

sum_over_snoc

theoremverifiedformalizationimported Lean

Split a sum over (k+1)-tuples into the last entry and the initial k-tuple.

Statement

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
open Matrix in
open Matrix in
variable {α : Type} [DecidableEq α] [Fintype α] in
lemma sum_over_snoc {X : Type*} [Fintype X] {M : Type*} [AddCommMonoid M] {k : ℕ}
    (F : (Fin (k + 1) → X) → M) :
    ∑ h : Fin (k + 1) → X, F h = ∑ h' : Fin k → X, ∑ c : X, F (Fin.snoc h' c)
Formalizes
Physlib, `sum_over_snoc`
Lean proof
By Robert Sneiderman, from github.com/leanprover-community/physlib at e411c6e89692 (Copyright (c) 2026 Robert Sneiderman. All rights reserved, Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.34.1.
Verified
09 Oct 2026
Axioms
Classical.choiceQuot.soundpropext

Lean source view module on GitHub

set_option autoImplicit true inset_option relaxedAutoImplicit true inopen Matrix inopen Matrix invariable {α : Type} [DecidableEq α] [Fintype α] in/-- Split a sum over `(k+1)`-tuples into the last entry and the initial `k`-tuple. -/lemma sum_over_snoc {X : Type*} [Fintype X] {M : Type*} [AddCommMonoid M] {k : ℕ}    (F : (Fin (k + 1) → X) → M) :    ∑ h : Fin (k + 1) → X, F h = ∑ h' : Fin k → X, ∑ c : X, F (Fin.snoc h' c) := by  rw [← Equiv.sum_comp (Fin.snocEquiv (fun _ => X)) F, Fintype.sum_prod_type, Finset.sum_comm]  rfl
See it in the graphDiscuss this resultChallenge it