AFTD Auto-Formalizing Theoretical Domains

TensorSpecies.Tensor.IsReindexing.append_swap

theoremverifiedformalizationimported Lean

TensorSpecies.Tensor.IsReindexing.append_swap

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_swap {n n2 : ℕ} {c : Fin n → C} {c2 : Fin n2 → C} :
    IsReindexing (Fin.append c c2) (Fin.append c2 c)
      (Fin.append (Fin.natAdd n) (Fin.castAdd n2))
Formalizes
Physlib, `TensorSpecies.Tensor.IsReindexing.append_swap`
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
Quot.soundpropext
Built on 4

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 inlemma TensorSpecies.Tensor.IsReindexing.append_swap {n n2 : ℕ} {c : Fin n → C} {c2 : Fin n2 → C} :    IsReindexing (Fin.append c c2) (Fin.append c2 c)      (Fin.append (Fin.natAdd n) (Fin.castAdd n2)) := by  refine ⟨?_, fun i => ?_⟩  · have heq : (Fin.append (Fin.natAdd n) (Fin.castAdd n2) : Fin (n2 + n) → Fin (n + n2)) =        ⇑(finSumFinEquiv.symm.trans          ((Equiv.sumComm (Fin n2) (Fin n)).trans finSumFinEquiv)) := by      ext i      refine Fin.addCases (fun a => ?_) (fun a => ?_) i <;>        simp [Fin.append_left, Fin.append_right]    rw [heq]    exact Equiv.bijective _  · refine Fin.addCases (fun a => ?_) (fun a => ?_) i <;>      simp [Fin.append_left, Fin.append_right]
See it in the graphDiscuss this resultChallenge it