Theorem: Fin.succ_predAbove_succ
File: Mathlib/Data/Fin/Basic.lean

tactic: obtain h₁ | h₂ := lt_or_le (castSucc a) b
state_before: n✝ m n : ℕ
a : Fin n
b : Fin (n + 1)
⊢ predAbove (succ a) (succ b) = succ (predAbove a b)

tactic: rw [Fin.predAbove_above _ _ h₁, Fin.succ_pred, Fin.predAbove_above, Fin.pred_succ]
state_before: case inl
n✝ m n : ℕ
a : Fin n
b : Fin (n + 1)
h₁ : ↑castSucc a < b
⊢ predAbove (succ a) (succ b) = succ (predAbove a b)

tactic: simpa only [lt_iff_val_lt_val, coe_castSucc, val_succ, add_lt_add_iff_right] using
  h₁
state_before: case inl.h
n✝ m n : ℕ
a : Fin n
b : Fin (n + 1)
h₁ : ↑castSucc a < b
⊢ ↑castSucc (succ a) < succ b

case inl.h
n✝ m n : ℕ
a : Fin n
b : Fin (n + 1)
h₁ : ↑castSucc a < b
⊢ ↑castSucc (succ a) < succ b

tactic: cases' n with n
state_before: case inr
n✝ m n : ℕ
a : Fin n
b : Fin (n + 1)
h₂ : b ≤ ↑castSucc a
⊢ predAbove (succ a) (succ b) = succ (predAbove a b)

tactic: exfalso
state_before: case inr.zero
n m : ℕ
a : Fin zero
b : Fin (zero + 1)
h₂ : b ≤ ↑castSucc a
⊢ predAbove (succ a) (succ b) = succ (predAbove a b)

tactic: exact not_lt_zero' a.is_lt
state_before: case inr.zero.h
n m : ℕ
a : Fin zero
b : Fin (zero + 1)
h₂ : b ≤ ↑castSucc a
⊢ False

tactic: rw [Fin.predAbove_below a b h₂,
  Fin.predAbove_below a.succ b.succ
    (by
      simpa only [le_iff_val_le_val, val_succ, coe_castSucc, add_le_add_iff_right] using h₂)]
state_before: case inr.succ
n✝ m n : ℕ
a : Fin (Nat.succ n)
b : Fin (Nat.succ n + 1)
h₂ : b ≤ ↑castSucc a
⊢ predAbove (succ a) (succ b) = succ (predAbove a b)

tactic: ext
state_before: case inr.succ
n✝ m n : ℕ
a : Fin (Nat.succ n)
b : Fin (Nat.succ n + 1)
h₂ : b ≤ ↑castSucc a
⊢ castPred (succ b) = succ (castPred b)

tactic: have h₀ : (b : ℕ) < n + 1 := by
  simp only [le_iff_val_le_val, coe_castSucc] at h₂
  simpa only [lt_succ_iff] using h₂.trans a.is_le
state_before: case inr.succ.h
n✝ m n : ℕ
a : Fin (Nat.succ n)
b : Fin (Nat.succ n + 1)
h₂ : b ≤ ↑castSucc a
⊢ ↑(castPred (succ b)) = ↑(succ (castPred b))

tactic: have h₁ : (b.succ : ℕ) < n + 2 := by
  rw [← Nat.succ_lt_succ_iff] at h₀
  simpa only [val_succ] using h₀
state_before: case inr.succ.h
n✝ m n : ℕ
a : Fin (Nat.succ n)
b : Fin (Nat.succ n + 1)
h₂ : b ≤ ↑castSucc a
h₀ : ↑b < n + 1
⊢ ↑(castPred (succ b)) = ↑(succ (castPred b))

tactic: simp only [coe_castPred b h₀, coe_castPred b.succ h₁, val_succ]
state_before: case inr.succ.h
n✝ m n : ℕ
a : Fin (Nat.succ n)
b : Fin (Nat.succ n + 1)
h₂ : b ≤ ↑castSucc a
h₀ : ↑b < n + 1
h₁ : ↑(succ b) < n + 2
⊢ ↑(castPred (succ b)) = ↑(succ (castPred b))

tactic: simpa only [le_iff_val_le_val, val_succ, coe_castSucc, add_le_add_iff_right] using h₂
state_before: n✝ m n : ℕ
a : Fin (Nat.succ n)
b : Fin (Nat.succ n + 1)
h₂ : b ≤ ↑castSucc a
⊢ succ b ≤ ↑castSucc (succ a)

tactic: simp only [le_iff_val_le_val, coe_castSucc] at h₂
state_before: n✝ m n : ℕ
a : Fin (Nat.succ n)
b : Fin (Nat.succ n + 1)
h₂ : b ≤ ↑castSucc a
⊢ ↑b < n + 1

tactic: simpa only [lt_succ_iff] using h₂.trans a.is_le
state_before: n✝ m n : ℕ
a : Fin (Nat.succ n)
b : Fin (Nat.succ n + 1)
h₂ : ↑b ≤ ↑a
⊢ ↑b < n + 1

tactic: rw [← Nat.succ_lt_succ_iff] at h₀
state_before: n✝ m n : ℕ
a : Fin (Nat.succ n)
b : Fin (Nat.succ n + 1)
h₂ : b ≤ ↑castSucc a
h₀ : ↑b < n + 1
⊢ ↑(succ b) < n + 2

tactic: simpa only [val_succ] using h₀
state_before: n✝ m n : ℕ
a : Fin (Nat.succ n)
b : Fin (Nat.succ n + 1)
h₂ : b ≤ ↑castSucc a
h₀ : Nat.succ ↑b < Nat.succ (n + 1)
⊢ ↑(succ b) < n + 2