AFTD Auto-Formalizing Theoretical Domains

Physlib.List.insertIdx_eraseIdx_fin

theoremverifiedformalizationimported Lean

Physlib.List.insertIdx_eraseIdx_fin

Statement

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
open Physlib Physlib.List in
open Physlib in
variable {n : Nat} in
lemma Physlib.List.insertIdx_eraseIdx_fin {I : Type} :
    (r : List I) → (k : Fin r.length) →
    (List.eraseIdx r k).insertIdx k r[k] = r
Formalizes
Physlib, `Physlib.List.insertIdx_eraseIdx_fin`
Lean proof
By Joseph Tooby-Smith, from github.com/leanprover-community/physlib at e411c6e89692 (Copyright (c) 2024 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 1

Lean source view module on GitHub

set_option autoImplicit true inset_option relaxedAutoImplicit true inopen Physlib Physlib.List inopen Physlib invariable {n : Nat} inlemma Physlib.List.insertIdx_eraseIdx_fin {I : Type} :    (r : List I) → (k : Fin r.length) →    (List.eraseIdx r k).insertIdx k r[k] = r  | [], k => by exact Fin.elim0 k  | a :: as, ⟨0, h⟩ => by simp  | a :: as, ⟨n + 1, h⟩ => by    simp only [List.length_cons, Fin.getElem_fin, List.getElem_cons_succ, List.eraseIdx_cons_succ,      List.insertIdx_succ_cons, List.cons.injEq, true_and]    exact insertIdx_eraseIdx_fin as ⟨n, Nat.lt_of_succ_lt_succ h⟩
See it in the graphDiscuss this resultChallenge it