Theorem: Array.anyM_cons_succ (Algdata/Data/Array/Lemmas.lean)

State before:
α : Type u
m : Type → Type v
inst✝ : Monad m
p : α → m Bool
a : α
x : Array α
start stop : Nat
⊢ anyM p (cons a x) (start + 1) (stop + 1) = anyM p x start stop
Tactic:
dsimp [anyM]
State after:
α : Type u
m : Type → Type v
inst✝ : Monad m
p : α → m Bool
a : α
x : Array α
start stop : Nat
⊢ (if h : stop + 1 ≤ Nat.succ (size x) then anyM.loop p (cons a x) (stop + 1) h (start + 1)
    else anyM.loop p (cons a x) (Nat.succ (size x)) (_ : size (cons a x) ≤ size (cons a x)) (start + 1)) =
    if h : stop ≤ size x then anyM.loop p x stop h start else anyM.loop p x (size x) (_ : size x ≤ size x) start

State before:
α : Type u
m : Type → Type v
inst✝ : Monad m
p : α → m Bool
a : α
x : Array α
start stop : Nat
⊢ (if h : stop + 1 ≤ Nat.succ (size x) then anyM.loop p (cons a x) (stop + 1) h (start + 1)
    else anyM.loop p (cons a x) (Nat.succ (size x)) (_ : size (cons a x) ≤ size (cons a x)) (start + 1)) =
    if h : stop ≤ size x then anyM.loop p x stop h start else anyM.loop p x (size x) (_ : size x ≤ size x) start
Tactic:
if h : stop ≤ x.size then
  rewrite [dif_pos h, dif_pos (Nat.succ_le_succ h)]
  exact anyM_loop_cons_succ p a x h start
else
  rewrite [dif_neg h, dif_neg (fun h' => h <| Nat.le_of_succ_le_succ h')]
  exact anyM_loop_cons_succ p a x .refl start
State after:
no goals

State before:
α : Type u
m : Type → Type v
inst✝ : Monad m
p : α → m Bool
a : α
x : Array α
start stop : Nat
h : stop ≤ size x
⊢ (if h : stop + 1 ≤ Nat.succ (size x) then anyM.loop p (cons a x) (stop + 1) h (start + 1)
    else anyM.loop p (cons a x) (Nat.succ (size x)) (_ : size (cons a x) ≤ size (cons a x)) (start + 1)) =
    if h : stop ≤ size x then anyM.loop p x stop h start else anyM.loop p x (size x) (_ : size x ≤ size x) start
Tactic:
rewrite [dif_pos h, dif_pos (Nat.succ_le_succ h)]
State after:
α : Type u
m : Type → Type v
inst✝ : Monad m
p : α → m Bool
a : α
x : Array α
start stop : Nat
h : stop ≤ size x
⊢ anyM.loop p (cons a x) (stop + 1) (_ : Nat.succ stop ≤ Nat.succ (size x)) (start + 1) = anyM.loop p x stop h start

State before:
α : Type u
m : Type → Type v
inst✝ : Monad m
p : α → m Bool
a : α
x : Array α
start stop : Nat
h : stop ≤ size x
⊢ anyM.loop p (cons a x) (stop + 1) (_ : Nat.succ stop ≤ Nat.succ (size x)) (start + 1) = anyM.loop p x stop h start
Tactic:
exact anyM_loop_cons_succ p a x h start
State after:
no goals

State before:
α : Type u
m : Type → Type v
inst✝ : Monad m
p : α → m Bool
a : α
x : Array α
start stop : Nat
h : ¬stop ≤ size x
⊢ (if h : stop + 1 ≤ Nat.succ (size x) then anyM.loop p (cons a x) (stop + 1) h (start + 1)
    else anyM.loop p (cons a x) (Nat.succ (size x)) (_ : size (cons a x) ≤ size (cons a x)) (start + 1)) =
    if h : stop ≤ size x then anyM.loop p x stop h start else anyM.loop p x (size x) (_ : size x ≤ size x) start
Tactic:
rewrite [dif_neg h, dif_neg (fun h' => h <| Nat.le_of_succ_le_succ h')]
State after:
α : Type u
m : Type → Type v
inst✝ : Monad m
p : α → m Bool
a : α
x : Array α
start stop : Nat
h : ¬stop ≤ size x
⊢ anyM.loop p (cons a x) (Nat.succ (size x)) (_ : size (cons a x) ≤ size (cons a x)) (start + 1) =
    anyM.loop p x (size x) (_ : size x ≤ size x) start

State before:
α : Type u
m : Type → Type v
inst✝ : Monad m
p : α → m Bool
a : α
x : Array α
start stop : Nat
h : ¬stop ≤ size x
⊢ anyM.loop p (cons a x) (Nat.succ (size x)) (_ : size (cons a x) ≤ size (cons a x)) (start + 1) =
    anyM.loop p x (size x) (_ : size x ≤ size x) start
Tactic:
exact anyM_loop_cons_succ p a x .refl start
State after:
no goals