Theorem: Monotone.biUnion_Ico_Ioc_map_succ
File: Mathlib/Order/SuccPred/IntervalSucc.lean

tactic: cases' le_total n m with hnm hmn
state_before: α : Type u_1
β : Type u_2
inst✝³ : LinearOrder α
inst✝² : SuccOrder α
inst✝¹ : IsSuccArchimedean α
inst✝ : LinearOrder β
f : α → β
hf : Monotone f
m n : α
⊢ (⋃ (i : α) (_ : i ∈ Ico m n), Ioc (f i) (f (succ i))) = Ioc (f m) (f n)

tactic: rw [Ico_eq_empty_of_le hnm, Ioc_eq_empty_of_le (hf hnm), biUnion_empty]
state_before: case inl
α : Type u_1
β : Type u_2
inst✝³ : LinearOrder α
inst✝² : SuccOrder α
inst✝¹ : IsSuccArchimedean α
inst✝ : LinearOrder β
f : α → β
hf : Monotone f
m n : α
hnm : n ≤ m
⊢ (⋃ (i : α) (_ : i ∈ Ico m n), Ioc (f i) (f (succ i))) = Ioc (f m) (f n)

tactic: refine' Succ.rec _ _ hmn
state_before: case inr
α : Type u_1
β : Type u_2
inst✝³ : LinearOrder α
inst✝² : SuccOrder α
inst✝¹ : IsSuccArchimedean α
inst✝ : LinearOrder β
f : α → β
hf : Monotone f
m n : α
hmn : m ≤ n
⊢ (⋃ (i : α) (_ : i ∈ Ico m n), Ioc (f i) (f (succ i))) = Ioc (f m) (f n)

tactic: simp only [Ioc_self, Ico_self, biUnion_empty]
state_before: case inr.refine'_1
α : Type u_1
β : Type u_2
inst✝³ : LinearOrder α
inst✝² : SuccOrder α
inst✝¹ : IsSuccArchimedean α
inst✝ : LinearOrder β
f : α → β
hf : Monotone f
m n : α
hmn : m ≤ n
⊢ (⋃ (i : α) (_ : i ∈ Ico m m), Ioc (f i) (f (succ i))) = Ioc (f m) (f m)

tactic: intro k hmk ihk
state_before: case inr.refine'_2
α : Type u_1
β : Type u_2
inst✝³ : LinearOrder α
inst✝² : SuccOrder α
inst✝¹ : IsSuccArchimedean α
inst✝ : LinearOrder β
f : α → β
hf : Monotone f
m n : α
hmn : m ≤ n
⊢ ∀ (n : α),
    m ≤ n →
      (⋃ (i : α) (_ : i ∈ Ico m n), Ioc (f i) (f (succ i))) = Ioc (f m) (f n) →
        (⋃ (i : α) (_ : i ∈ Ico m (succ n)), Ioc (f i) (f (succ i))) = Ioc (f m) (f (succ n))

tactic: rw [← Ioc_union_Ioc_eq_Ioc (hf hmk) (hf <| le_succ _), union_comm, ← ihk]
state_before: case inr.refine'_2
α : Type u_1
β : Type u_2
inst✝³ : LinearOrder α
inst✝² : SuccOrder α
inst✝¹ : IsSuccArchimedean α
inst✝ : LinearOrder β
f : α → β
hf : Monotone f
m n : α
hmn : m ≤ n
k : α
hmk : m ≤ k
ihk : (⋃ (i : α) (_ : i ∈ Ico m k), Ioc (f i) (f (succ i))) = Ioc (f m) (f k)
⊢ (⋃ (i : α) (_ : i ∈ Ico m (succ k)), Ioc (f i) (f (succ i))) = Ioc (f m) (f (succ k))

tactic: by_cases hk : IsMax k
state_before: case inr.refine'_2
α : Type u_1
β : Type u_2
inst✝³ : LinearOrder α
inst✝² : SuccOrder α
inst✝¹ : IsSuccArchimedean α
inst✝ : LinearOrder β
f : α → β
hf : Monotone f
m n : α
hmn : m ≤ n
k : α
hmk : m ≤ k
ihk : (⋃ (i : α) (_ : i ∈ Ico m k), Ioc (f i) (f (succ i))) = Ioc (f m) (f k)
⊢ (⋃ (i : α) (_ : i ∈ Ico m (succ k)), Ioc (f i) (f (succ i))) =
    Ioc (f k) (f (succ k)) ∪ ⋃ (i : α) (_ : i ∈ Ico m k), Ioc (f i) (f (succ i))

tactic: rw [hk.succ_eq, Ioc_self, empty_union]
state_before: case pos
α : Type u_1
β : Type u_2
inst✝³ : LinearOrder α
inst✝² : SuccOrder α
inst✝¹ : IsSuccArchimedean α
inst✝ : LinearOrder β
f : α → β
hf : Monotone f
m n : α
hmn : m ≤ n
k : α
hmk : m ≤ k
ihk : (⋃ (i : α) (_ : i ∈ Ico m k), Ioc (f i) (f (succ i))) = Ioc (f m) (f k)
hk : IsMax k
⊢ (⋃ (i : α) (_ : i ∈ Ico m (succ k)), Ioc (f i) (f (succ i))) =
    Ioc (f k) (f (succ k)) ∪ ⋃ (i : α) (_ : i ∈ Ico m k), Ioc (f i) (f (succ i))

tactic: rw [Ico_succ_right_eq_insert_of_not_isMax hmk hk, biUnion_insert]
state_before: case neg
α : Type u_1
β : Type u_2
inst✝³ : LinearOrder α
inst✝² : SuccOrder α
inst✝¹ : IsSuccArchimedean α
inst✝ : LinearOrder β
f : α → β
hf : Monotone f
m n : α
hmn : m ≤ n
k : α
hmk : m ≤ k
ihk : (⋃ (i : α) (_ : i ∈ Ico m k), Ioc (f i) (f (succ i))) = Ioc (f m) (f k)
hk : ¬IsMax k
⊢ (⋃ (i : α) (_ : i ∈ Ico m (succ k)), Ioc (f i) (f (succ i))) =
    Ioc (f k) (f (succ k)) ∪ ⋃ (i : α) (_ : i ∈ Ico m k), Ioc (f i) (f (succ i))