AFTD Auto-Formalizing Theoretical Domains

TensorSpecies.Tensor.IsReindexing.succAbove_succSuccAbove_comm

theoremverifiedformalizationimported Lean

Removing one entry and then a pair of entries from c in either order gives the same colour list: removing the k-th entry and then the (shifted) i-th and j-th entries matches removing the i-th and j-th entries first and then the (shifted) k-th entry, via the identity permutation. This is used for the commutation of a *contraction* with an *evaluation*.

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
open Fin in
lemma TensorSpecies.Tensor.IsReindexing.succAbove_succSuccAbove_comm {n : ℕ} {c : Fin (n + 1 + 1 + 1) → C}
    (k : Fin (n + 1 + 1 + 1)) (i j : Fin (n + 1 + 1)) (hij : i ≠ j) :
    let i' := k.succAbove i;
    let j' := k.succAbove j;
    have hij' : i' ≠ j' := by simp [i', j', hij];
    let k' := predPredAbove i' j' hij' k (by simp [i', j', Ne.symm]);
    IsReindexing ((c ∘ i'.succSuccAbove j') ∘ k'.succAbove)
      ((c ∘ k.succAbove) ∘ i.succSuccAbove j) id
Formalizes
Physlib, `TensorSpecies.Tensor.IsReindexing.succAbove_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 24

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 inopen Fin in/-- Removing one entry and then a pair of entries from `c` in either order gives the same colour list: removing the `k`-th entry and then the (shifted) `i`-th and `j`-th entries matches removing the `i`-th and `j`-th entries first and then the (shifted) `k`-th entry, via the identity permutation. This is used for the commutation of a *contraction* with an *evaluation*. -/lemma TensorSpecies.Tensor.IsReindexing.succAbove_succSuccAbove_comm {n : ℕ} {c : Fin (n + 1 + 1 + 1) → C}    (k : Fin (n + 1 + 1 + 1)) (i j : Fin (n + 1 + 1)) (hij : i ≠ j) :    let i' := k.succAbove i;    let j' := k.succAbove j;    have hij' : i' ≠ j' := by simp [i', j', hij];    let k' := predPredAbove i' j' hij' k (by simp [i', j', Ne.symm]);    IsReindexing ((c ∘ i'.succSuccAbove j') ∘ k'.succAbove)      ((c ∘ k.succAbove) ∘ i.succSuccAbove j) id := by  intro i' j' hij' k'  refine ⟨Function.bijective_id, fun m => ?_⟩  simp only [id_eq, Function.comp_apply]  congr 1  show i'.succSuccAbove j' (k'.succAbove m) = k.succAbove (i.succSuccAbove j m)  apply Fin.val_injective  simp only [i', j', k', Fin.succSuccAbove, Fin.succAbove, Fin.predPredAbove, lt_def, val_castSucc,    val_succ, apply_ite Fin.val, apply_dite Fin.val]  grind (splits := 60)
See it in the graphDiscuss this resultChallenge it