Theorem: Int.inductionOn'_add_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 : b ≤ z
⊢ (z + 1).inductionOn' b H0 Hs Hp = Hs 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 : b ≤ z
⊢ HEq
    (match z + 1 - b with
    | ofNat n => inductionOn'.pos b H0 Hs n
    | -[n+1] => inductionOn'.neg b H0 Hp n)
    (Hs 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 : b ≤ z
⊢ HEq
    (match z + 1 - b with
    | ofNat n => inductionOn'.pos b H0 Hs n
    | -[n+1] => inductionOn'.neg b H0 Hp n)
    (Hs 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 : b ≤ z
zb : ℕ
hzb : ↑zb = z - b
⊢ HEq
    (match z + 1 - b with
    | ofNat n => inductionOn'.pos b H0 Hs n
    | -[n+1] => inductionOn'.neg b H0 Hp n)
    (Hs z hz (z.inductionOn' b H0 Hs Hp))
tactic: lift z - b to ℕ using Int.sub_nonneg.mpr hz with zb hzb
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 : b ≤ z
zb : ℕ
hzb : ↑zb = z - b
⊢ HEq
    (match z + 1 - b with
    | ofNat n => inductionOn'.pos b H0 Hs n
    | -[n+1] => inductionOn'.neg b H0 Hp n)
    (Hs 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 : b ≤ z
zb : ℕ
hzb : ↑zb = z - b
⊢ HEq
    (match ↑zb + 1 with
    | ofNat n => inductionOn'.pos b H0 Hs n
    | -[n+1] => inductionOn'.neg b H0 Hp n)
    (Hs z hz (z.inductionOn' b H0 Hs Hp))
tactic: rw [show z + 1 - b = zb + 1 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 : b ≤ z
zb : ℕ
hzb : ↑zb = z - b
⊢ HEq
    (match ↑zb + 1 with
    | ofNat n => inductionOn'.pos b H0 Hs n
    | -[n+1] => inductionOn'.neg b H0 Hp n)
    (Hs 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 : b ≤ z
zb : ℕ
hzb : ↑zb = z - b
this : b + ↑zb = z
⊢ HEq
    (match ↑zb + 1 with
    | ofNat n => inductionOn'.pos b H0 Hs n
    | -[n+1] => inductionOn'.neg b H0 Hp n)
    (Hs z hz (z.inductionOn' b H0 Hs Hp))
tactic: have : b + zb = z := 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 : b ≤ z
zb : ℕ
hzb : ↑zb = z - b
this : b + ↑zb = z
⊢ HEq
    (match ↑zb + 1 with
    | ofNat n => inductionOn'.pos b H0 Hs n
    | -[n+1] => inductionOn'.neg b H0 Hp n)
    (Hs z hz (z.inductionOn' b H0 Hs Hp))
state_after: case intro
a b✝ c d m n : ℤ
C : ℤ → Sort u_1
b : ℤ
H0 : C b
Hs : (k : ℤ) → b ≤ k → C k → C (k + 1)
Hp : (k : ℤ) → k ≤ b → C k → C (k - 1)
zb : ℕ
hz : b ≤ b + ↑zb
hzb : ↑zb = b + ↑zb - b
⊢ HEq
    (match ↑zb + 1 with
    | ofNat n => inductionOn'.pos b H0 Hs n
    | -[n+1] => inductionOn'.neg b H0 Hp n)
    (Hs (b + ↑zb) hz ((b + ↑zb).inductionOn' b H0 Hs Hp))
tactic: subst this
state_before: case intro
a b✝ c d m n : ℤ
C : ℤ → Sort u_1
b : ℤ
H0 : C b
Hs : (k : ℤ) → b ≤ k → C k → C (k + 1)
Hp : (k : ℤ) → k ≤ b → C k → C (k - 1)
zb : ℕ
hz : b ≤ b + ↑zb
hzb : ↑zb = b + ↑zb - b
⊢ HEq
    (match ↑zb + 1 with
    | ofNat n => inductionOn'.pos b H0 Hs n
    | -[n+1] => inductionOn'.neg b H0 Hp n)
    (Hs (b + ↑zb) hz ((b + ↑zb).inductionOn' b H0 Hs Hp))
state_after: case h.e'_4.h.e'_3
a b✝ c d m n : ℤ
C : ℤ → Sort u_1
b : ℤ
H0 : C b
Hs : (k : ℤ) → b ≤ k → C k → C (k + 1)
Hp : (k : ℤ) → k ≤ b → C k → C (k - 1)
zb : ℕ
hz : b ≤ b + ↑zb
hzb : ↑zb = b + ↑zb - b
⊢ (b + ↑zb).inductionOn' b H0 Hs Hp = inductionOn'.pos b H0 Hs zb
tactic: convert cast_heq _ _
state_before: case h.e'_4.h.e'_3
a b✝ c d m n : ℤ
C : ℤ → Sort u_1
b : ℤ
H0 : C b
Hs : (k : ℤ) → b ≤ k → C k → C (k + 1)
Hp : (k : ℤ) → k ≤ b → C k → C (k - 1)
zb : ℕ
hz : b ≤ b + ↑zb
hzb : ↑zb = b + ↑zb - b
⊢ (b + ↑zb).inductionOn' b H0 Hs Hp = inductionOn'.pos b H0 Hs zb
state_after: no goals
tactic: rw [Int.inductionOn', cast_eq_iff_heq, ← hzb]