Theorem: Set.enumerate_eq_none
File: Mathlib/Data/Set/Enumerate.lean

tactic: cases hs : sel s
state_before: α : Type u_1
sel : Set α → Option α
s : Set α
n m : ℕ
h : enumerate sel s (n + 1) = none
hm : n + 1 ≤ m
⊢ enumerate sel s m = none
state_after: case none
α : Type u_1
sel : Set α → Option α
s : Set α
n m : ℕ
h : enumerate sel s (n + 1) = none
hm : n + 1 ≤ m
hs : sel s = none
⊢ enumerate sel s m = none

case some
α : Type u_1
sel : Set α → Option α
s : Set α
n m : ℕ
h : enumerate sel s (n + 1) = none
hm : n + 1 ≤ m
val✝ : α
hs : sel s = some val✝
⊢ enumerate sel s m = none

tactic: exact enumerate_eq_none_of_sel sel hs
state_before: case none
α : Type u_1
sel : Set α → Option α
s : Set α
n m : ℕ
h : enumerate sel s (n + 1) = none
hm : n + 1 ≤ m
hs : sel s = none
⊢ enumerate sel s m = none
state_after: no goals

tactic: cases m with
| zero => contradiction
| succ m' =>
  simp? [hs, enumerate] at h ⊢ says
    simp only [enumerate, hs, Option.bind_eq_bind, Option.some_bind] at h ⊢
  have hm : n ≤ m' := Nat.le_of_succ_le_succ hm
  exact enumerate_eq_none h hm
state_before: case some
α : Type u_1
sel : Set α → Option α
s : Set α
n m : ℕ
h : enumerate sel s (n + 1) = none
hm : n + 1 ≤ m
val✝ : α
hs : sel s = some val✝
⊢ enumerate sel s m = none
state_after: no goals

tactic: contradiction
state_before: case some.zero
α : Type u_1
sel : Set α → Option α
s : Set α
n : ℕ
h : enumerate sel s (n + 1) = none
val✝ : α
hs : sel s = some val✝
hm : n + 1 ≤ 0
⊢ enumerate sel s 0 = none
state_after: no goals

tactic: simp? [hs, enumerate] at h ⊢ says
  simp only [enumerate, hs, Option.bind_eq_bind, Option.some_bind] at h ⊢
state_before: case some.succ
α : Type u_1
sel : Set α → Option α
s : Set α
n : ℕ
h : enumerate sel s (n + 1) = none
val✝ : α
hs : sel s = some val✝
m' : ℕ
hm : n + 1 ≤ m' + 1
⊢ enumerate sel s (m' + 1) = none
state_after: case some.succ
α : Type u_1
sel : Set α → Option α
s : Set α
n : ℕ
val✝ : α
hs : sel s = some val✝
m' : ℕ
hm : n + 1 ≤ m' + 1
h : enumerate sel (s \ {val✝}) n = none
⊢ enumerate sel (s \ {val✝}) m' = none

tactic: have hm : n ≤ m' := Nat.le_of_succ_le_succ hm
state_before: case some.succ
α : Type u_1
sel : Set α → Option α
s : Set α
n : ℕ
val✝ : α
hs : sel s = some val✝
m' : ℕ
hm : n + 1 ≤ m' + 1
h : enumerate sel (s \ {val✝}) n = none
⊢ enumerate sel (s \ {val✝}) m' = none
state_after: case some.succ
α : Type u_1
sel : Set α → Option α
s : Set α
n : ℕ
val✝ : α
hs : sel s = some val✝
m' : ℕ
hm✝ : n + 1 ≤ m' + 1
h : enumerate sel (s \ {val✝}) n = none
hm : n ≤ m'
⊢ enumerate sel (s \ {val✝}) m' = none

tactic: exact enumerate_eq_none h hm
state_before: case some.succ
α : Type u_1
sel : Set α → Option α
s : Set α
n : ℕ
val✝ : α
hs : sel s = some val✝
m' : ℕ
hm✝ : n + 1 ≤ m' + 1
h : enumerate sel (s \ {val✝}) n = none
hm : n ≤ m'
⊢ enumerate sel (s \ {val✝}) m' = none
state_after: no goals

tactic: simp only [enumerate, hs, Option.bind_eq_bind, Option.some_bind] at h ⊢
state_before: case some.succ
α : Type u_1
sel : Set α → Option α
s : Set α
n : ℕ
h : enumerate sel s (n + 1) = none
val✝ : α
hs : sel s = some val✝
m' : ℕ
hm : n + 1 ≤ m' + 1
⊢ enumerate sel s (m' + 1) = none
state_after: case some.succ
α : Type u_1
sel : Set α → Option α
s : Set α
n : ℕ
val✝ : α
hs : sel s = some val✝
m' : ℕ
hm : n + 1 ≤ m' + 1
h : enumerate sel (s \ {val✝}) n = none
⊢ enumerate sel (s \ {val✝}) m' = none