Theorem: Nat.leRecOn_surjective
File: Mathlib/Data/Nat/Defs.lean

tactic: induction hnm with
| refl =>
  intro x
  refine ⟨x, ?_⟩
  rw [leRecOn_self]
| step hnm ih =>
  intro x
  obtain ⟨w, rfl⟩ := Hnext _ x
  obtain ⟨x, rfl⟩ := ih w
  refine ⟨x, ?_⟩
  rw [leRecOn_succ]
state_before: a b c d m✝ n✝ k : ℕ
p q : ℕ → Prop
C : ℕ → Sort u_1
n m : ℕ
hnm : n ≤ m
next : {k : ℕ} → C k → C (k + 1)
Hnext : ∀ (n : ℕ), Surjective next
⊢ Surjective (leRecOn hnm fun {k} => next)
state_after: no goals

tactic: intro x
state_before: case refl
a b c d m✝ n✝ k : ℕ
p q : ℕ → Prop
C : ℕ → Sort u_1
n m : ℕ
next : {k : ℕ} → C k → C (k + 1)
Hnext : ∀ (n : ℕ), Surjective next
⊢ Surjective (leRecOn ⋯ fun {k} => next)
state_after: case refl
a b c d m✝ n✝ k : ℕ
p q : ℕ → Prop
C : ℕ → Sort u_1
n m : ℕ
next : {k : ℕ} → C k → C (k + 1)
Hnext : ∀ (n : ℕ), Surjective next
x : C n
⊢ ∃ a, leRecOn ⋯ (fun {k} => next) a = x

tactic: refine ⟨x, ?_⟩
state_before: case refl
a b c d m✝ n✝ k : ℕ
p q : ℕ → Prop
C : ℕ → Sort u_1
n m : ℕ
next : {k : ℕ} → C k → C (k + 1)
Hnext : ∀ (n : ℕ), Surjective next
x : C n
⊢ ∃ a, leRecOn ⋯ (fun {k} => next) a = x
state_after: case refl
a b c d m✝ n✝ k : ℕ
p q : ℕ → Prop
C : ℕ → Sort u_1
n m : ℕ
next : {k : ℕ} → C k → C (k + 1)
Hnext : ∀ (n : ℕ), Surjective next
x : C n
⊢ leRecOn ⋯ (fun {k} => next) x = x

tactic: rw [leRecOn_self]
state_before: case refl
a b c d m✝ n✝ k : ℕ
p q : ℕ → Prop
C : ℕ → Sort u_1
n m : ℕ
next : {k : ℕ} → C k → C (k + 1)
Hnext : ∀ (n : ℕ), Surjective next
x : C n
⊢ leRecOn ⋯ (fun {k} => next) x = x
state_after: no goals

tactic: intro x
state_before: case step
a b c d m✝¹ n✝ k : ℕ
p q : ℕ → Prop
C : ℕ → Sort u_1
n m : ℕ
next : {k : ℕ} → C k → C (k + 1)
Hnext : ∀ (n : ℕ), Surjective next
m✝ : ℕ
hnm : n.le m✝
ih : Surjective (leRecOn hnm fun {k} => next)
⊢ Surjective (leRecOn ⋯ fun {k} => next)
state_after: case step
a b c d m✝¹ n✝ k : ℕ
p q : ℕ → Prop
C : ℕ → Sort u_1
n m : ℕ
next : {k : ℕ} → C k → C (k + 1)
Hnext : ∀ (n : ℕ), Surjective next
m✝ : ℕ
hnm : n.le m✝
ih : Surjective (leRecOn hnm fun {k} => next)
x : C m✝.succ
⊢ ∃ a, leRecOn ⋯ (fun {k} => next) a = x

tactic: obtain ⟨w, rfl⟩ := Hnext _ x
state_before: case step
a b c d m✝¹ n✝ k : ℕ
p q : ℕ → Prop
C : ℕ → Sort u_1
n m : ℕ
next : {k : ℕ} → C k → C (k + 1)
Hnext : ∀ (n : ℕ), Surjective next
m✝ : ℕ
hnm : n.le m✝
ih : Surjective (leRecOn hnm fun {k} => next)
x : C m✝.succ
⊢ ∃ a, leRecOn ⋯ (fun {k} => next) a = x
state_after: case step.intro
a b c d m✝¹ n✝ k : ℕ
p q : ℕ → Prop
C : ℕ → Sort u_1
n m : ℕ
next : {k : ℕ} → C k → C (k + 1)
Hnext : ∀ (n : ℕ), Surjective next
m✝ : ℕ
hnm : n.le m✝
ih : Surjective (leRecOn hnm fun {k} => next)
w : C m✝
⊢ ∃ a, leRecOn ⋯ (fun {k} => next) a = next w

tactic: obtain ⟨x, rfl⟩ := ih w
state_before: case step.intro
a b c d m✝¹ n✝ k : ℕ
p q : ℕ → Prop
C : ℕ → Sort u_1
n m : ℕ
next : {k : ℕ} → C k → C (k + 1)
Hnext : ∀ (n : ℕ), Surjective next
m✝ : ℕ
hnm : n.le m✝
ih : Surjective (leRecOn hnm fun {k} => next)
w : C m✝
⊢ ∃ a, leRecOn ⋯ (fun {k} => next) a = next w
state_after: case step.intro.intro
a b c d m✝¹ n✝ k : ℕ
p q : ℕ → Prop
C : ℕ → Sort u_1
n m : ℕ
next : {k : ℕ} → C k → C (k + 1)
Hnext : ∀ (n : ℕ), Surjective next
m✝ : ℕ
hnm : n.le m✝
ih : Surjective (leRecOn hnm fun {k} => next)
x : C n
⊢ ∃ a, leRecOn ⋯ (fun {k} => next) a = next (leRecOn hnm (fun {k} => next) x)

tactic: refine ⟨x, ?_⟩
state_before: case step.intro.intro
a b c d m✝¹ n✝ k : ℕ
p q : ℕ → Prop
C : ℕ → Sort u_1
n m : ℕ
next : {k : ℕ} → C k → C (k + 1)
Hnext : ∀ (n : ℕ), Surjective next
m✝ : ℕ
hnm : n.le m✝
ih : Surjective (leRecOn hnm fun {k} => next)
x : C n
⊢ ∃ a, leRecOn ⋯ (fun {k} => next) a = next (leRecOn hnm (fun {k} => next) x)
state_after: case step.intro.intro
a b c d m✝¹ n✝ k : ℕ
p q : ℕ → Prop
C : ℕ → Sort u_1
n m : ℕ
next : {k : ℕ} → C k → C (k + 1)
Hnext : ∀ (n : ℕ), Surjective next
m✝ : ℕ
hnm : n.le m✝
ih : Surjective (leRecOn hnm fun {k} => next)
x : C n
⊢ leRecOn ⋯ (fun {k} => next) x = next (leRecOn hnm (fun {k} => next) x)

tactic: rw [leRecOn_succ]
state_before: case step.intro.intro
a b c d m✝¹ n✝ k : ℕ
p q : ℕ → Prop
C : ℕ → Sort u_1
n m : ℕ
next : {k : ℕ} → C k → C (k + 1)
Hnext : ∀ (n : ℕ), Surjective next
m✝ : ℕ
hnm : n.le m✝
ih : Surjective (leRecOn hnm fun {k} => next)
x : C n
⊢ leRecOn ⋯ (fun {k} => next) x = next (leRecOn hnm (fun {k} => next) x)
state_after: no goals