AFTD Auto-Formalizing Theoretical Domains

TensorSpecies.Tensor.IsReindexing.succSuccAbove_comm

theoremverifiedformalizationimported Lean

Removing two pairs of entries from c in either order gives the same colour list: removing the i1-th and j1-th entries and then the (shifted) i2-th and j2-th entries matches removing the i2-th and j2-th entries first and then the (shifted) i1-th and j1-th entries, via the identity permutation. This is used for the commutation of two *contractions*.

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.succSuccAbove_comm {n : ℕ} {c : Fin (n + 1 + 1 + 1 + 1) → C}
    (i1 j1 : Fin (n + 1 + 1 + 1 + 1)) (i2 j2 : Fin (n + 1 + 1))
    (hij1 : i1 ≠ j1) (hij2 : i2 ≠ j2) :
    let i2' := (i1.succSuccAbove j1 i2);
    let j2' := (i1.succSuccAbove j1 j2);
    have hi2j2' : i2' ≠ j2' := by simp [i2', j2', hij2];
    let i1' := (predPredAbove i2' j2' hi2j2' i1 (by simp [i2', j2']));
    let j1' := (predPredAbove i2' j2' hi2j2' j1 (by simp [i2', j2']));
    IsReindexing ((c ∘ i2'.succSuccAbove j2') ∘ i1'.succSuccAbove j1')
      ((c ∘ i1.succSuccAbove j1) ∘ i2.succSuccAbove j2) id
Formalizes
Physlib, `TensorSpecies.Tensor.IsReindexing.succSuccAbove_comm`
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
10 Oct 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 21

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 pairs of entries from `c` in either order gives the same colour list: removing the `i1`-th and `j1`-th entries and then the (shifted) `i2`-th and `j2`-th entries matches removing the `i2`-th and `j2`-th entries first and then the (shifted) `i1`-th and `j1`-th entries, via the identity permutation. This is used for the commutation of two *contractions*. -/lemma TensorSpecies.Tensor.IsReindexing.succSuccAbove_comm {n : ℕ} {c : Fin (n + 1 + 1 + 1 + 1) → C}    (i1 j1 : Fin (n + 1 + 1 + 1 + 1)) (i2 j2 : Fin (n + 1 + 1))    (hij1 : i1 ≠ j1) (hij2 : i2 ≠ j2) :    let i2' := (i1.succSuccAbove j1 i2);    let j2' := (i1.succSuccAbove j1 j2);    have hi2j2' : i2' ≠ j2' := by simp [i2', j2', hij2];    let i1' := (predPredAbove i2' j2' hi2j2' i1 (by simp [i2', j2']));    let j1' := (predPredAbove i2' j2' hi2j2' j1 (by simp [i2', j2']));    IsReindexing ((c ∘ i2'.succSuccAbove j2') ∘ i1'.succSuccAbove j1')      ((c ∘ i1.succSuccAbove j1) ∘ i2.succSuccAbove j2) id := by  apply And.intro (Function.bijective_id)  simp only [id_eq, Function.comp_apply]  intro i  rw [succSuccAbove_comm_apply]  · simp [hij1]  · simp [hij2]
See it in the graphDiscuss this resultChallenge it