Theorem: Set.abs_projIcc_sub_projIcc
File: Mathlib/Topology/UnitInterval.lean

tactic: wlog hdc : d ≤ c generalizing c d
state_before: α : Type u_1
inst✝ : LinearOrderedAddCommGroup α
a b c d : α
h : a ≤ b
δ : α
⊢ |↑(projIcc a b h c) - ↑(projIcc a b h d)| ≤ |c - d|
state_after: case inr
α : Type u_1
inst✝ : LinearOrderedAddCommGroup α
a b c d : α
h : a ≤ b
δ : α
this : ∀ {c d : α}, d ≤ c → |↑(projIcc a b h c) - ↑(projIcc a b h d)| ≤ |c - d|
hdc : ¬d ≤ c
⊢ |↑(projIcc a b h c) - ↑(projIcc a b h d)| ≤ |c - d|

α : Type u_1
inst✝ : LinearOrderedAddCommGroup α
a b c✝ d✝ : α
h : a ≤ b
δ c d : α
hdc : d ≤ c
⊢ |↑(projIcc a b h c) - ↑(projIcc a b h d)| ≤ |c - d|

tactic: rw [abs_eq_self.2 (sub_nonneg.2 hdc), abs_eq_self.2 (sub_nonneg.2 <| monotone_projIcc h hdc)]
state_before: α : Type u_1
inst✝ : LinearOrderedAddCommGroup α
a b c✝ d✝ : α
h : a ≤ b
δ c d : α
hdc : d ≤ c
⊢ |↑(projIcc a b h c) - ↑(projIcc a b h d)| ≤ |c - d|
state_after: α : Type u_1
inst✝ : LinearOrderedAddCommGroup α
a b c✝ d✝ : α
h : a ≤ b
δ c d : α
hdc : d ≤ c
⊢ (fun a_1 => ↑a_1) (projIcc a b h c) - (fun a_1 => ↑a_1) (projIcc a b h d) ≤ c - d

tactic: rw [← sub_nonneg] at hdc
state_before: α : Type u_1
inst✝ : LinearOrderedAddCommGroup α
a b c✝ d✝ : α
h : a ≤ b
δ c d : α
hdc : d ≤ c
⊢ (fun a_1 => ↑a_1) (projIcc a b h c) - (fun a_1 => ↑a_1) (projIcc a b h d) ≤ c - d
state_after: α : Type u_1
inst✝ : LinearOrderedAddCommGroup α
a b c✝ d✝ : α
h : a ≤ b
δ c d : α
hdc : 0 ≤ c - d
⊢ (fun a_1 => ↑a_1) (projIcc a b h c) - (fun a_1 => ↑a_1) (projIcc a b h d) ≤ c - d

tactic: refine (max_sub_max_le_max _ _ _ _).trans (max_le (by rwa [sub_self]) ?_)
state_before: α : Type u_1
inst✝ : LinearOrderedAddCommGroup α
a b c✝ d✝ : α
h : a ≤ b
δ c d : α
hdc : 0 ≤ c - d
⊢ (fun a_1 => ↑a_1) (projIcc a b h c) - (fun a_1 => ↑a_1) (projIcc a b h d) ≤ c - d
state_after: α : Type u_1
inst✝ : LinearOrderedAddCommGroup α
a b c✝ d✝ : α
h : a ≤ b
δ c d : α
hdc : 0 ≤ c - d
⊢ min b c - min b d ≤ c - d

tactic: refine ((le_abs_self _).trans <| abs_min_sub_min_le_max _ _ _ _).trans (max_le ?_ ?_)
state_before: α : Type u_1
inst✝ : LinearOrderedAddCommGroup α
a b c✝ d✝ : α
h : a ≤ b
δ c d : α
hdc : 0 ≤ c - d
⊢ min b c - min b d ≤ c - d
state_after: case refine_1
α : Type u_1
inst✝ : LinearOrderedAddCommGroup α
a b c✝ d✝ : α
h : a ≤ b
δ c d : α
hdc : 0 ≤ c - d
⊢ |b - b| ≤ c - d

case refine_2
α : Type u_1
inst✝ : LinearOrderedAddCommGroup α
a b c✝ d✝ : α
h : a ≤ b
δ c d : α
hdc : 0 ≤ c - d
⊢ |c - d| ≤ c - d

tactic: rw [abs_sub_comm, abs_sub_comm c]
state_before: case inr
α : Type u_1
inst✝ : LinearOrderedAddCommGroup α
a b c d : α
h : a ≤ b
δ : α
this : ∀ {c d : α}, d ≤ c → |↑(projIcc a b h c) - ↑(projIcc a b h d)| ≤ |c - d|
hdc : ¬d ≤ c
⊢ |↑(projIcc a b h c) - ↑(projIcc a b h d)| ≤ |c - d|
state_after: case inr
α : Type u_1
inst✝ : LinearOrderedAddCommGroup α
a b c d : α
h : a ≤ b
δ : α
this : ∀ {c d : α}, d ≤ c → |↑(projIcc a b h c) - ↑(projIcc a b h d)| ≤ |c - d|
hdc : ¬d ≤ c
⊢ |↑(projIcc a b h d) - ↑(projIcc a b h c)| ≤ |d - c|

tactic: exact this (le_of_not_le hdc)
state_before: case inr
α : Type u_1
inst✝ : LinearOrderedAddCommGroup α
a b c d : α
h : a ≤ b
δ : α
this : ∀ {c d : α}, d ≤ c → |↑(projIcc a b h c) - ↑(projIcc a b h d)| ≤ |c - d|
hdc : ¬d ≤ c
⊢ |↑(projIcc a b h d) - ↑(projIcc a b h c)| ≤ |d - c|
state_after: no goals

tactic: rwa [sub_self]
state_before: α : Type u_1
inst✝ : LinearOrderedAddCommGroup α
a b c✝ d✝ : α
h : a ≤ b
δ c d : α
hdc : 0 ≤ c - d
⊢ a - a ≤ c - d
state_after: no goals

tactic: rwa [sub_self, abs_zero]
state_before: case refine_1
α : Type u_1
inst✝ : LinearOrderedAddCommGroup α
a b c✝ d✝ : α
h : a ≤ b
δ c d : α
hdc : 0 ≤ c - d
⊢ |b - b| ≤ c - d
state_after: no goals

tactic: exact (abs_eq_self.mpr hdc).le
state_before: case refine_2
α : Type u_1
inst✝ : LinearOrderedAddCommGroup α
a b c✝ d✝ : α
h : a ≤ b
δ c d : α
hdc : 0 ≤ c - d
⊢ |c - d| ≤ c - d
state_after: no goals