Theorem: Int.inductionOn'_sub_one
File: Mathlib/Data/Int/Defs.lean

Proof steps:
state_before: a b✝ c d m n : ℤ
C : ℤ → Sort u_1
z b : ℤ
H0 : C b
Hs : (k : ℤ) → b ≤ k → C k → C (k + 1)
Hp : (k : ℤ) → k ≤ b → C k → C (k - 1)
hz : z ≤ b
⊢ (z - 1).inductionOn' b H0 Hs Hp = Hp z hz (z.inductionOn' b H0 Hs Hp)
state_after: a b✝ c d m n : ℤ
C : ℤ → Sort u_1
z b : ℤ
H0 : C b
Hs : (k : ℤ) → b ≤ k → C k → C (k + 1)
Hp : (k : ℤ) → k ≤ b → C k → C (k - 1)
hz : z ≤ b
⊢ HEq
    (match z - 1 - b with
    | ofNat n => inductionOn'.pos b H0 Hs n
    | -[n+1] => inductionOn'.neg b H0 Hp n)
    (Hp z hz (z.inductionOn' b H0 Hs Hp))
tactic: apply cast_eq_iff_heq.mpr
state_before: a b✝ c d m n : ℤ
C : ℤ → Sort u_1
z b : ℤ
H0 : C b
Hs : (k : ℤ) → b ≤ k → C k → C (k + 1)
Hp : (k : ℤ) → k ≤ b → C k → C (k - 1)
hz : z ≤ b
⊢ HEq
    (match z - 1 - b with
    | ofNat n => inductionOn'.pos b H0 Hs n
    | -[n+1] => inductionOn'.neg b H0 Hp n)
    (Hp z hz (z.inductionOn' b H0 Hs Hp))
state_after: case intro
a b✝ c d m n✝ : ℤ
C : ℤ → Sort u_1
z b : ℤ
H0 : C b
Hs : (k : ℤ) → b ≤ k → C k → C (k + 1)
Hp : (k : ℤ) → k ≤ b → C k → C (k - 1)
hz : z ≤ b
n : ℕ
hn : z - 1 - b = -[n+1]
⊢ HEq
    (match z - 1 - b with
    | ofNat n => inductionOn'.pos b H0 Hs n
    | -[n+1] => inductionOn'.neg b H0 Hp n)
    (Hp z hz (z.inductionOn' b H0 Hs Hp))
tactic: obtain ⟨n, hn⟩ := Int.eq_negSucc_of_lt_zero (show z - 1 - b < 0 by omega)
state_before: case intro
a b✝ c d m n✝ : ℤ
C : ℤ → Sort u_1
z b : ℤ
H0 : C b
Hs : (k : ℤ) → b ≤ k → C k → C (k + 1)
Hp : (k : ℤ) → k ≤ b → C k → C (k - 1)
hz : z ≤ b
n : ℕ
hn : z - 1 - b = -[n+1]
⊢ HEq
    (match z - 1 - b with
    | ofNat n => inductionOn'.pos b H0 Hs n
    | -[n+1] => inductionOn'.neg b H0 Hp n)
    (Hp z hz (z.inductionOn' b H0 Hs Hp))
state_after: case intro
a b✝ c d m n✝ : ℤ
C : ℤ → Sort u_1
z b : ℤ
H0 : C b
Hs : (k : ℤ) → b ≤ k → C k → C (k + 1)
Hp : (k : ℤ) → k ≤ b → C k → C (k - 1)
hz : z ≤ b
n : ℕ
hn : z - 1 - b = -[n+1]
⊢ HEq
    (match -[n+1] with
    | ofNat n => inductionOn'.pos b H0 Hs n
    | -[n+1] => inductionOn'.neg b H0 Hp n)
    (Hp z hz (z.inductionOn' b H0 Hs Hp))
tactic: rw [hn]
state_before: case intro
a b✝ c d m n✝ : ℤ
C : ℤ → Sort u_1
z b : ℤ
H0 : C b
Hs : (k : ℤ) → b ≤ k → C k → C (k + 1)
Hp : (k : ℤ) → k ≤ b → C k → C (k - 1)
hz : z ≤ b
n : ℕ
hn : z - 1 - b = -[n+1]
⊢ HEq
    (match -[n+1] with
    | ofNat n => inductionOn'.pos b H0 Hs n
    | -[n+1] => inductionOn'.neg b H0 Hp n)
    (Hp z hz (z.inductionOn' b H0 Hs Hp))
state_after: case intro.zero
a b✝ c d m n : ℤ
C : ℤ → Sort u_1
z b : ℤ
H0 : C b
Hs : (k : ℤ) → b ≤ k → C k → C (k + 1)
Hp : (k : ℤ) → k ≤ b → C k → C (k - 1)
hz : z ≤ b
hn : z - 1 - b = -[0+1]
⊢ HEq
    (match -[0+1] with
    | ofNat n => inductionOn'.pos b H0 Hs n
    | -[n+1] => inductionOn'.neg b H0 Hp n)
    (Hp z hz (z.inductionOn' b H0 Hs Hp))

case intro.succ
a b✝ c d m n✝ : ℤ
C : ℤ → Sort u_1
z b : ℤ
H0 : C b
Hs : (k : ℤ) → b ≤ k → C k → C (k + 1)
Hp : (k : ℤ) → k ≤ b → C k → C (k - 1)
hz : z ≤ b
n : ℕ
hn : z - 1 - b = -[n + 1+1]
⊢ HEq
    (match -[n + 1+1] with
    | ofNat n => inductionOn'.pos b H0 Hs n
    | -[n+1] => inductionOn'.neg b H0 Hp n)
    (Hp z hz (z.inductionOn' b H0 Hs Hp))
tactic: obtain _|n := n