Theorem: Nat.least_number (Logic/Vorspiel/Vorspiel.lean)

State before:
α : ℕ → Sort u
P : ℕ → Prop
hP : ∃ x, P x
⊢ ∃ x, P x ∧ ∀ z < x, ¬P z
Tactic:
rcases hP with ⟨n, hn⟩
State after:
case intro
α : ℕ → Sort u
P : ℕ → Prop
n : ℕ
hn : P n
⊢ ∃ x, P x ∧ ∀ z < x, ¬P z

State before:
case intro
α : ℕ → Sort u
P : ℕ → Prop
n : ℕ
hn : P n
⊢ ∃ x, P x ∧ ∀ z < x, ¬P z
Tactic:
induction' n using Nat.strongRec with n ih
State after:
case intro.ind
α : ℕ → Sort u
P : ℕ → Prop
n : ℕ
ih : ∀ m < n, P m → ∃ x, P x ∧ ∀ z < x, ¬P z
hn : P n
⊢ ∃ x, P x ∧ ∀ z < x, ¬P z

State before:
case intro.ind
α : ℕ → Sort u
P : ℕ → Prop
n : ℕ
ih : ∀ m < n, P m → ∃ x, P x ∧ ∀ z < x, ¬P z
hn : P n
⊢ ∃ x, P x ∧ ∀ z < x, ¬P z
Tactic:
by_cases H : ∃ m < n, P m
State after:
case pos
α : ℕ → Sort u
P : ℕ → Prop
n : ℕ
ih : ∀ m < n, P m → ∃ x, P x ∧ ∀ z < x, ¬P z
hn : P n
H : ∃ m < n, P m
⊢ ∃ x, P x ∧ ∀ z < x, ¬P z

case neg
α : ℕ → Sort u
P : ℕ → Prop
n : ℕ
ih : ∀ m < n, P m → ∃ x, P x ∧ ∀ z < x, ¬P z
hn : P n
H : ¬∃ m < n, P m
⊢ ∃ x, P x ∧ ∀ z < x, ¬P z

State before:
case pos
α : ℕ → Sort u
P : ℕ → Prop
n : ℕ
ih : ∀ m < n, P m → ∃ x, P x ∧ ∀ z < x, ¬P z
hn : P n
H : ∃ m < n, P m
⊢ ∃ x, P x ∧ ∀ z < x, ¬P z
Tactic:
rcases H with ⟨m, hm, hPm⟩
State after:
case pos.intro.intro
α : ℕ → Sort u
P : ℕ → Prop
n : ℕ
ih : ∀ m < n, P m → ∃ x, P x ∧ ∀ z < x, ¬P z
hn : P n
m : ℕ
hm : m < n
hPm : P m
⊢ ∃ x, P x ∧ ∀ z < x, ¬P z

State before:
case pos.intro.intro
α : ℕ → Sort u
P : ℕ → Prop
n : ℕ
ih : ∀ m < n, P m → ∃ x, P x ∧ ∀ z < x, ¬P z
hn : P n
m : ℕ
hm : m < n
hPm : P m
⊢ ∃ x, P x ∧ ∀ z < x, ¬P z
Tactic:
exact ih m hm hPm
State after:
no goals

State before:
case neg
α : ℕ → Sort u
P : ℕ → Prop
n : ℕ
ih : ∀ m < n, P m → ∃ x, P x ∧ ∀ z < x, ¬P z
hn : P n
H : ¬∃ m < n, P m
⊢ ∃ x, P x ∧ ∀ z < x, ¬P z
Tactic:
exact ⟨n, hn, by simpa using H⟩
State after:
no goals

State before:
α : ℕ → Sort u
P : ℕ → Prop
n : ℕ
ih : ∀ m < n, P m → ∃ x, P x ∧ ∀ z < x, ¬P z
hn : P n
H : ¬∃ m < n, P m
⊢ ∀ z < n, ¬P z
Tactic:
simpa using H
State after:
no goals