AFTD Auto-Formalizing Theoretical Domains

Fin.succSuccAbove_castAdd_natAdd_apply_castAdd

theoremverifiedformalizationimported Lean

Reinserting a left-block survivor a after removing the i-th slot of the left block and the j-th slot of the right block of Fin ((nA + 1) + (nB + 1)), the removal read at the contracted length (nA + nB) + 1 + 1. Unlike succSuccAbove_natAdd_apply_castAdd the two holes straddle the two blocks, so the statement carries the reshaping Fin.casts.

Statement

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
open Fin in
variable {n : ℕ} {c : Fin (n + 1 + 1) → C} in
lemma Fin.succSuccAbove_castAdd_natAdd_apply_castAdd {nA nB : ℕ} (i : Fin (nA + 1)) (j : Fin (nB + 1))
    (a : Fin nA) :
    Fin.cast (show (nA + nB) + 1 + 1 = (nA + 1) + (nB + 1) by omega)
        ((Fin.cast (show (nA + 1) + (nB + 1) = (nA + nB) + 1 + 1 by omega)
            (Fin.castAdd (nB + 1) i)).succSuccAbove
          (Fin.cast (show (nA + 1) + (nB + 1) = (nA + nB) + 1 + 1 by omega)
            (Fin.natAdd (nA + 1) j)) (Fin.castAdd nB a))
      = Fin.castAdd (nB + 1) (i.succAbove a)
Formalizes
Physlib, `Fin.succSuccAbove_castAdd_natAdd_apply_castAdd`
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 12
Used by 1

Lean source view module on GitHub

set_option autoImplicit true inset_option relaxedAutoImplicit true inopen Fin invariable {n : ℕ} {c : Fin (n + 1 + 1) → C} in/-- Reinserting a left-block survivor `a` after removing the `i`-th slot of the left block and the `j`-th slot of the right block of `Fin ((nA + 1) + (nB + 1))`, the removal read at the contracted length `(nA + nB) + 1 + 1`. Unlike `succSuccAbove_natAdd_apply_castAdd` the two holes straddle the two blocks, so the statement carries the reshaping `Fin.cast`s. -/lemma Fin.succSuccAbove_castAdd_natAdd_apply_castAdd {nA nB : ℕ} (i : Fin (nA + 1)) (j : Fin (nB + 1))    (a : Fin nA) :    Fin.cast (show (nA + nB) + 1 + 1 = (nA + 1) + (nB + 1) by omega)        ((Fin.cast (show (nA + 1) + (nB + 1) = (nA + nB) + 1 + 1 by omega)            (Fin.castAdd (nB + 1) i)).succSuccAbove          (Fin.cast (show (nA + 1) + (nB + 1) = (nA + nB) + 1 + 1 by omega)            (Fin.natAdd (nA + 1) j)) (Fin.castAdd nB a))      = Fin.castAdd (nB + 1) (i.succAbove a) := by  apply Fin.ext  simp only [Fin.succSuccAbove_val, Fin.val_cast, Fin.val_castAdd, Fin.val_natAdd,    Fin.succAbove, Fin.lt_def, Fin.val_castSucc, Fin.val_succ, apply_ite Fin.val]  split_ifs <;> omega
See it in the graphDiscuss this resultChallenge it