AFTD Auto-Formalizing Theoretical Domains

Fin.predPredAbove

defimported Lean

The preimage of m under succSuccAbove i j hij given that m is not equal to i or j.

Statement

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
variable {n : ℕ} {c : Fin (n + 1 + 1) → C} in
def Fin.predPredAbove (i j : Fin (n + 1 + 1)) (hij : i ≠ j) (m : Fin (n + 1 + 1))
    (hm : m ≠ i ∧ m ≠ j) : Fin n
Defined in
Physlib, `Fin.predPredAbove`
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
none listed
Built on 2
  • LinearOrder.toTotalPreorderEvery LinearOrder is a TotalPreorder.
  • TotalPreorderA total preorder: a preorder where ≤ is total (complete). This is weaker than LinearOrder — it does NOT require antisymmetry or…
Used by 11

Lean source view module on GitHub

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
variable {n : ℕ} {c : Fin (n + 1 + 1) → C} in
/-- The preimage of `m` under `succSuccAbove i j hij` given that `m` is not equal to `i` or `j`. -/
def Fin.predPredAbove (i j : Fin (n + 1 + 1)) (hij : i ≠ j) (m : Fin (n + 1 + 1))
    (hm : m ≠ i ∧ m ≠ j) : Fin n :=
  if h1 : m.1 < i.1 ∧ m.1 < j.1 then
      ⟨m, by grind⟩
    else if h2 : m.1 - 1 < i.1 ∧ j.1 ≤ m.1 then
      ⟨m - 1, by grind⟩
    else if h3 : i.1 - 1 ≤ m.1 ∧ m.1 < j.1 then
      ⟨m - 1, by grind⟩
    else
      ⟨m - 2, by grind⟩
See it in the graphDiscuss this resultChallenge it