AFTD Auto-Formalizing Theoretical Domains

Physlib.List.insertIdx_getElem_fin

theoremverifiedformalizationimported Lean

Physlib.List.insertIdx_getElem_fin

Statement

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
open Physlib Physlib.List in
open Physlib in
variable {n : Nat} in
@[simp]
lemma Physlib.List.insertIdx_getElem_fin {I : Type} (i : I) :
    (r : List I) → (k : Fin r.length.succ) → (m : Fin r.length) →
    (List.insertIdx r k i)[(k.succAbove m).val] = r[m.val]
Formalizes
Physlib, `Physlib.List.insertIdx_getElem_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
Classical.choiceQuot.soundpropext
Built on 2
Used by 4

Lean source view module on GitHub

set_option autoImplicit true inset_option relaxedAutoImplicit true inopen Physlib Physlib.List inopen Physlib invariable {n : Nat} in@[simp]lemma Physlib.List.insertIdx_getElem_fin {I : Type} (i : I) :    (r : List I) → (k : Fin r.length.succ) → (m : Fin r.length) →    (List.insertIdx r k i)[(k.succAbove m).val] = r[m.val]  | [], 0, m => by exact Fin.elim0 m  | a :: as, 0, m => by simp  | a :: as, ⟨n + 1, h⟩, ⟨0, h0⟩ => by    simp [Fin.succAbove, Fin.lt_def]  | a :: as, ⟨n + 1, h⟩, ⟨m+1, hm⟩ => by    simp only [List.insertIdx_succ_cons, List.length_cons, Nat.succ_eq_add_one,      List.getElem_cons_succ]    conv_rhs => rw [← insertIdx_getElem_fin i as ⟨n, Nat.succ_lt_succ_iff.mp h⟩      ⟨m, Nat.lt_of_succ_lt_succ hm⟩]    simp only [Fin.succAbove, Fin.castSucc_mk, Fin.lt_def, add_lt_add_iff_right, Fin.succ_mk,      Nat.succ_eq_add_one]    split    · simp_all only [List.getElem_cons_succ]    · simp_all only [List.getElem_cons_succ]
See it in the graphDiscuss this resultChallenge it