AFTD Auto-Formalizing Theoretical Domains

TensorSpecies.Tensor.IsReindexing.append_succSuccAbove_natAdd

theoremverifiedformalizationimported Lean

Removing two entries from the right component of Fin.append c1 c commutes with the append: removing the i-th and j-th entries of c and then appending c1 matches removing the corresponding entries of Fin.append c1 c, via the identity permutation. This is used for the commutation of taking a *product* of tensors with *contraction* of indices.

Statement

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
open TensorSpecies TensorSpecies.Tensor in
open Module in
variable {C : Type} in
open Fin in
lemma TensorSpecies.Tensor.IsReindexing.append_succSuccAbove_natAdd {n n1 : ℕ} {c : Fin (n + 1 + 1) → C}
    {c1 : Fin n1 → C} (i j : Fin (n + 1 + 1)) :
    IsReindexing (Fin.append c1 c ∘ (Fin.natAdd n1 i).succSuccAbove (Fin.natAdd n1 j))
      (Fin.append c1 (c ∘ i.succSuccAbove j)) id
Formalizes
Physlib, `TensorSpecies.Tensor.IsReindexing.append_succSuccAbove_natAdd`
Lean proof
By Joseph Tooby-Smith, from github.com/leanprover-community/physlib at e411c6e89692 (Copyright (c) 2025 Joseph Tooby-Smith. 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
Built on 19

Lean source view module on GitHub

set_option autoImplicit true inset_option relaxedAutoImplicit true inopen TensorSpecies TensorSpecies.Tensor inopen Module invariable {C : Type} inopen Fin in/-- Removing two entries from the right component of `Fin.append c1 c` commutes with the append: removing the `i`-th and `j`-th entries of `c` and then appending `c1` matches removing the corresponding entries of `Fin.append c1 c`, via the identity permutation. This is used for the commutation of taking a *product* of tensors with *contraction* of indices. -/lemma TensorSpecies.Tensor.IsReindexing.append_succSuccAbove_natAdd {n n1 : ℕ} {c : Fin (n + 1 + 1) → C}    {c1 : Fin n1 → C} (i j : Fin (n + 1 + 1)) :    IsReindexing (Fin.append c1 c ∘ (Fin.natAdd n1 i).succSuccAbove (Fin.natAdd n1 j))      (Fin.append c1 (c ∘ i.succSuccAbove j)) id := by  apply And.intro (Function.bijective_id)  simp [forall_fin_add, succSuccAbove_comm_natAdd i j, succSuccAbove_natAdd_apply_castAdd i j]
See it in the graphDiscuss this resultChallenge it