Lean4
/-- Decreasing induction: if `P (k+1)` implies `P k` for all `m ≤ k < n`, then `P n` implies `P m`.
Also works for functions to `Sort*`.
Weakens the assumptions of `Nat.decreasingInduction`. -/
@[elab_as_elim]
def decreasingInduction' {P : ℕ → Sort*} (h : ∀ k < n, m ≤ k → P (k + 1) → P k) (mn : m ≤ n) (hP : P n) : P m := by
induction mn using decreasingInduction with
| self => exact hP
| of_succ k hk ih => exact h _ (lt_of_succ_le hk) (Nat.le_refl _) (ih fun k' hk' h'' => h k' hk' <| le_of_succ_le h'')