Skip to content

Commit f48b2e9

Browse files
committed
chore(Algebra/Order/Group): golf entire max_sub_max_le_max using grind (leanprover-community#29850)
1 parent 7a743c4 commit f48b2e9

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

Mathlib/Algebra/Order/Group/MinMax.lean

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,7 @@ section LinearOrderedAddCommGroup
6565
variable {α : Type*} [AddCommGroup α] [LinearOrder α] [IsOrderedAddMonoid α]
6666

6767
theorem max_sub_max_le_max (a b c d : α) : max a b - max c d ≤ max (a - c) (b - d) := by
68-
simp only [sub_le_iff_le_add, max_le_iff]; constructor
69-
· calc
70-
a = a - c + c := (sub_add_cancel a c).symm
71-
_ ≤ max (a - c) (b - d) + max c d := add_le_add (le_max_left _ _) (le_max_left _ _)
72-
· calc
73-
b = b - d + d := (sub_add_cancel b d).symm
74-
_ ≤ max (a - c) (b - d) + max c d := add_le_add (le_max_right _ _) (le_max_right _ _)
68+
grind
7569

7670
theorem abs_max_sub_max_le_max (a b c d : α) : |max a b - max c d| ≤ max |a - c| |b - d| := by
7771
refine abs_sub_le_iff.2 ⟨?_, ?_⟩

0 commit comments

Comments
 (0)