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

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
⊢ (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: obtain ⟨n, hn⟩ := Int.eq_negSucc_of_lt_zero (show z - 1 - b < 0 by omega)
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: 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 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: obtain _|n := n
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: omega
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 - b < 0
state_after: no goals

tactic: change _ = -1 at hn
state_before: 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))
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 = -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))

tactic: have : z = b := by omega
state_before: 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 = -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))
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 = -1
this : z = b
⊢ 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))

tactic: subst this
state_before: 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 = -1
this : z = b
⊢ 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))
state_after: case intro.zero
a b c d m n : ℤ
C : ℤ → Sort u_1
z : ℤ
H0 : C z
Hs : (k : ℤ) → z ≤ k → C k → C (k + 1)
Hp : (k : ℤ) → k ≤ z → C k → C (k - 1)
hz : z ≤ z
hn : z - 1 - z = -1
⊢ HEq
    (match -[0+1] with
    | ofNat n => inductionOn'.pos z H0 Hs n
    | -[n+1] => inductionOn'.neg z H0 Hp n)
    (Hp z hz (z.inductionOn' z H0 Hs Hp))

tactic: rw [inductionOn'_self]
state_before: case intro.zero
a b c d m n : ℤ
C : ℤ → Sort u_1
z : ℤ
H0 : C z
Hs : (k : ℤ) → z ≤ k → C k → C (k + 1)
Hp : (k : ℤ) → k ≤ z → C k → C (k - 1)
hz : z ≤ z
hn : z - 1 - z = -1
⊢ HEq
    (match -[0+1] with
    | ofNat n => inductionOn'.pos z H0 Hs n
    | -[n+1] => inductionOn'.neg z H0 Hp n)
    (Hp z hz (z.inductionOn' z H0 Hs Hp))
state_after: case intro.zero
a b c d m n : ℤ
C : ℤ → Sort u_1
z : ℤ
H0 : C z
Hs : (k : ℤ) → z ≤ k → C k → C (k + 1)
Hp : (k : ℤ) → k ≤ z → C k → C (k - 1)
hz : z ≤ z
hn : z - 1 - z = -1
⊢ HEq
    (match -[0+1] with
    | ofNat n => inductionOn'.pos z H0 Hs n
    | -[n+1] => inductionOn'.neg z H0 Hp n)
    (Hp z hz H0)

tactic: exact heq_of_eq rfl
state_before: case intro.zero
a b c d m n : ℤ
C : ℤ → Sort u_1
z : ℤ
H0 : C z
Hs : (k : ℤ) → z ≤ k → C k → C (k + 1)
Hp : (k : ℤ) → k ≤ z → C k → C (k - 1)
hz : z ≤ z
hn : z - 1 - z = -1
⊢ HEq
    (match -[0+1] with
    | ofNat n => inductionOn'.pos z H0 Hs n
    | -[n+1] => inductionOn'.neg z H0 Hp n)
    (Hp z hz H0)
state_after: no goals

tactic: omega
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
hn : z - 1 - b = -1
⊢ z = b
state_after: no goals

tactic: have : z = b + -[n+1] := by rw [Int.negSucc_eq] at hn ⊢; omega
state_before: 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))
state_after: 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]
this : z = b + -[n+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: subst this
state_before: 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]
this : z = b + -[n+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))
state_after: case intro.succ
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)
n : ℕ
hz : b + -[n+1] ≤ b
hn : b + -[n+1] - 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 (b + -[n+1]) hz ((b + -[n+1]).inductionOn' b H0 Hs Hp))

tactic: convert cast_heq _ _
state_before: case intro.succ
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)
n : ℕ
hz : b + -[n+1] ≤ b
hn : b + -[n+1] - 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 (b + -[n+1]) hz ((b + -[n+1]).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)
n : ℕ
hz : b + -[n+1] ≤ b
hn : b + -[n+1] - 1 - b = -[n + 1+1]
⊢ (b + -[n+1]).inductionOn' b H0 Hs Hp = inductionOn'.neg b H0 Hp n

tactic: rw [Int.inductionOn', cast_eq_iff_heq, show b + -[n+1] - b = -[n+1] by omega]
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)
n : ℕ
hz : b + -[n+1] ≤ b
hn : b + -[n+1] - 1 - b = -[n + 1+1]
⊢ (b + -[n+1]).inductionOn' b H0 Hs Hp = inductionOn'.neg b H0 Hp n
state_after: no goals

tactic: rw [Int.negSucc_eq] at hn ⊢
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
n : ℕ
hn : z - 1 - b = -[n + 1+1]
⊢ z = b + -[n+1]
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
n : ℕ
hn : z - 1 - b = -(↑(n + 1) + 1)
⊢ z = b + -(↑n + 1)

tactic: omega
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
n : ℕ
hn : z - 1 - b = -(↑(n + 1) + 1)
⊢ z = b + -(↑n + 1)
state_after: no goals

tactic: omega
state_before: 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)
n : ℕ
hz : b + -[n+1] ≤ b
hn : b + -[n+1] - 1 - b = -[n + 1+1]
⊢ b + -[n+1] - b = -[n+1]
state_after: no goals