l3lab/ntp-mathlib huggingface dataset:
/-- The substitution `y = x ^ p` in integrals over `Ioi 0` preserves integrability. -/
theorem integrableOn_Ioi_comp_rpow_iff [NormedSpace ℝ E] (f : ℝ → E) {p : ℝ} (hp : p ≠ 0) :
    IntegrableOn (fun x => (|p| * x ^ (p - 1)) • f (x ^ p)) (Ioi 0) ↔ IntegrableOn f (Ioi 0) := by
  let S := Ioi (0 : ℝ)
  have a1 : ∀ x : ℝ, x ∈ S → HasDerivWithinAt (fun t : ℝ => t ^ p) (p * x ^ (p - 1)) S x :=
    fun x hx => (hasDerivAt_rpow_const (Or.inl (mem_Ioi.mp hx).ne')).hasDerivWithinAt
  have a2 : InjOn (fun x : ℝ => x ^ p) S := by
    rcases lt_or_gt_of_ne hp with (h | h)
    · apply StrictAntiOn.injOn
      intro x hx y hy hxy
      rw [← inv_lt_inv (rpow_pos_of_pos hx p) (rpow_pos_of_pos hy p), ← rpow_neg (le_of_lt hx), ←
        rpow_neg (le_of_lt hy)]
      exact rpow_lt_rpow (le_of_lt hx) hxy (neg_pos.mpr h)
    exact StrictMonoOn.injOn fun x hx y _hy hxy => rpow_lt_rpow (mem_Ioi.mp hx).le hxy h
  have a3 : (fun t : ℝ => t ^ p) '' S = S := by
    ext1 x; rw [mem_image]; constructor
    · rintro ⟨y, hy, rfl⟩; exact rpow_pos_of_pos hy p
    · intro hx; refine' ⟨x ^ (1 / p), rpow_pos_of_pos hx _, _⟩
      rw [← rpow_mul (le_of_lt hx), one_div_mul_cancel hp, rpow_one]
  have := integrableOn_image_iff_integrableOn_abs_deriv_smul measurableSet_Ioi a1 a2 f
  

Proof state:
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
f : ℝ → E
p : ℝ
hp : p ≠ 0
S : Set ℝ := Ioi 0
a1 : ∀ x ∈ S, HasDerivWithinAt (fun t => t ^ p) (p * x ^ (p - 1)) S x
a2 : InjOn (fun x => x ^ p) S
a3 : (fun t => t ^ p) '' S = S
this : IntegrableOn f ((fun t => t ^ p) '' Ioi 0) ↔ IntegrableOn (fun x => |p * x ^ (p - 1)| • f (x ^ p)) (Ioi 0)
⊢ IntegrableOn (fun x => (|p| * x ^ (p - 1)) • f (x ^ p)) (Ioi 0) ↔ IntegrableOn f (Ioi 0)

Next tactic:
rw [a3] at this
/-- The substitution `y = x ^ p` in integrals over `Ioi 0` preserves integrability. -/
theorem integrableOn_Ioi_comp_rpow_iff [NormedSpace ℝ E] (f : ℝ → E) {p : ℝ} (hp : p ≠ 0) :
    IntegrableOn (fun x => (|p| * x ^ (p - 1)) • f (x ^ p)) (Ioi 0) ↔ IntegrableOn f (Ioi 0) := by
  let S := Ioi (0 : ℝ)
  have a1 : ∀ x : ℝ, x ∈ S → HasDerivWithinAt (fun t : ℝ => t ^ p) (p * x ^ (p - 1)) S x :=
    fun x hx => (hasDerivAt_rpow_const (Or.inl (mem_Ioi.mp hx).ne')).hasDerivWithinAt
  have a2 : InjOn (fun x : ℝ => x ^ p) S := by
    rcases lt_or_gt_of_ne hp with (h | h)
    · apply StrictAntiOn.injOn
      intro x hx y hy hxy
      rw [← inv_lt_inv (rpow_pos_of_pos hx p) (rpow_pos_of_pos hy p), ← rpow_neg (le_of_lt hx), ←
        rpow_neg (le_of_lt hy)]
      exact rpow_lt_rpow (le_of_lt hx) hxy (neg_pos.mpr h)
    exact StrictMonoOn.injOn fun x hx y _hy hxy => rpow_lt_rpow (mem_Ioi.mp hx).le hxy h
  have a3 : (fun t : ℝ => t ^ p) '' S = S := by
    ext1 x; rw [mem_image]; constructor
    · rintro ⟨y, hy, rfl⟩; exact rpow_pos_of_pos hy p
    · intro hx; refine' ⟨x ^ (1 / p), rpow_pos_of_pos hx _, _⟩
      rw [← rpow_mul (le_of_lt hx), one_div_mul_cancel hp, rpow_one]
  have := integrableOn_image_iff_integrableOn_abs_deriv_smul measurableSet_Ioi a1 a2 f
  rw [a3] at this
  

Proof state:
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
f : ℝ → E
p : ℝ
hp : p ≠ 0
S : Set ℝ := Ioi 0
a1 : ∀ x ∈ S, HasDerivWithinAt (fun t => t ^ p) (p * x ^ (p - 1)) S x
a2 : InjOn (fun x => x ^ p) S
a3 : (fun t => t ^ p) '' S = S
this : IntegrableOn f S ↔ IntegrableOn (fun x => |p * x ^ (p - 1)| • f (x ^ p)) (Ioi 0)
⊢ IntegrableOn (fun x => (|p| * x ^ (p - 1)) • f (x ^ p)) (Ioi 0) ↔ IntegrableOn f (Ioi 0)

Next tactic:
rw [this]
/-- The substitution `y = x ^ p` in integrals over `Ioi 0` preserves integrability. -/
theorem integrableOn_Ioi_comp_rpow_iff [NormedSpace ℝ E] (f : ℝ → E) {p : ℝ} (hp : p ≠ 0) :
    IntegrableOn (fun x => (|p| * x ^ (p - 1)) • f (x ^ p)) (Ioi 0) ↔ IntegrableOn f (Ioi 0) := by
  let S := Ioi (0 : ℝ)
  have a1 : ∀ x : ℝ, x ∈ S → HasDerivWithinAt (fun t : ℝ => t ^ p) (p * x ^ (p - 1)) S x :=
    fun x hx => (hasDerivAt_rpow_const (Or.inl (mem_Ioi.mp hx).ne')).hasDerivWithinAt
  have a2 : InjOn (fun x : ℝ => x ^ p) S := by
    rcases lt_or_gt_of_ne hp with (h | h)
    · apply StrictAntiOn.injOn
      intro x hx y hy hxy
      rw [← inv_lt_inv (rpow_pos_of_pos hx p) (rpow_pos_of_pos hy p), ← rpow_neg (le_of_lt hx), ←
        rpow_neg (le_of_lt hy)]
      exact rpow_lt_rpow (le_of_lt hx) hxy (neg_pos.mpr h)
    exact StrictMonoOn.injOn fun x hx y _hy hxy => rpow_lt_rpow (mem_Ioi.mp hx).le hxy h
  have a3 : (fun t : ℝ => t ^ p) '' S = S := by
    ext1 x; rw [mem_image]; constructor
    · rintro ⟨y, hy, rfl⟩; exact rpow_pos_of_pos hy p
    · intro hx; refine' ⟨x ^ (1 / p), rpow_pos_of_pos hx _, _⟩
      rw [← rpow_mul (le_of_lt hx), one_div_mul_cancel hp, rpow_one]
  have := integrableOn_image_iff_integrableOn_abs_deriv_smul measurableSet_Ioi a1 a2 f
  rw [a3] at this
  rw [this]
  

Proof state:
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
f : ℝ → E
p : ℝ
hp : p ≠ 0
S : Set ℝ := Ioi 0
a1 : ∀ x ∈ S, HasDerivWithinAt (fun t => t ^ p) (p * x ^ (p - 1)) S x
a2 : InjOn (fun x => x ^ p) S
a3 : (fun t => t ^ p) '' S = S
this : IntegrableOn f S ↔ IntegrableOn (fun x => |p * x ^ (p - 1)| • f (x ^ p)) (Ioi 0)
⊢ IntegrableOn (fun x => (|p| * x ^ (p - 1)) • f (x ^ p)) (Ioi 0) ↔
    IntegrableOn (fun x => |p * x ^ (p - 1)| • f (x ^ p)) (Ioi 0)

Next tactic:
refine' integrableOn_congr_fun (fun x hx => _) measurableSet_Ioi
/-- The substitution `y = x ^ p` in integrals over `Ioi 0` preserves integrability. -/
theorem integrableOn_Ioi_comp_rpow_iff [NormedSpace ℝ E] (f : ℝ → E) {p : ℝ} (hp : p ≠ 0) :
    IntegrableOn (fun x => (|p| * x ^ (p - 1)) • f (x ^ p)) (Ioi 0) ↔ IntegrableOn f (Ioi 0) := by
  let S := Ioi (0 : ℝ)
  have a1 : ∀ x : ℝ, x ∈ S → HasDerivWithinAt (fun t : ℝ => t ^ p) (p * x ^ (p - 1)) S x :=
    fun x hx => (hasDerivAt_rpow_const (Or.inl (mem_Ioi.mp hx).ne')).hasDerivWithinAt
  have a2 : InjOn (fun x : ℝ => x ^ p) S := by
    rcases lt_or_gt_of_ne hp with (h | h)
    · apply StrictAntiOn.injOn
      intro x hx y hy hxy
      rw [← inv_lt_inv (rpow_pos_of_pos hx p) (rpow_pos_of_pos hy p), ← rpow_neg (le_of_lt hx), ←
        rpow_neg (le_of_lt hy)]
      exact rpow_lt_rpow (le_of_lt hx) hxy (neg_pos.mpr h)
    exact StrictMonoOn.injOn fun x hx y _hy hxy => rpow_lt_rpow (mem_Ioi.mp hx).le hxy h
  have a3 : (fun t : ℝ => t ^ p) '' S = S := by
    ext1 x; rw [mem_image]; constructor
    · rintro ⟨y, hy, rfl⟩; exact rpow_pos_of_pos hy p
    · intro hx; refine' ⟨x ^ (1 / p), rpow_pos_of_pos hx _, _⟩
      rw [← rpow_mul (le_of_lt hx), one_div_mul_cancel hp, rpow_one]
  have := integrableOn_image_iff_integrableOn_abs_deriv_smul measurableSet_Ioi a1 a2 f
  rw [a3] at this
  rw [this]
  refine' integrableOn_congr_fun (fun x hx => _) measurableSet_Ioi
  

Proof state:
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
f : ℝ → E
p : ℝ
hp : p ≠ 0
S : Set ℝ := Ioi 0
a1 : ∀ x ∈ S, HasDerivWithinAt (fun t => t ^ p) (p * x ^ (p - 1)) S x
a2 : InjOn (fun x => x ^ p) S
a3 : (fun t => t ^ p) '' S = S
this : IntegrableOn f S ↔ IntegrableOn (fun x => |p * x ^ (p - 1)| • f (x ^ p)) (Ioi 0)
x : ℝ
hx : x ∈ Ioi 0
⊢ (|p| * x ^ (p - 1)) • f (x ^ p) = |p * x ^ (p - 1)| • f (x ^ p)

Next tactic:
simp_rw [abs_mul, abs_of_nonneg (rpow_nonneg_of_nonneg (le_of_lt hx) _)]
/-- The substitution `y = x ^ p` in integrals over `Ioi 0` preserves integrability (version
without `|p|` factor) -/
theorem integrableOn_Ioi_comp_rpow_iff' [NormedSpace ℝ E] (f : ℝ → E) {p : ℝ} (hp : p ≠ 0) :
    IntegrableOn (fun x => x ^ (p - 1) • f (x ^ p)) (Ioi 0) ↔ IntegrableOn f (Ioi 0) := by
  

Proof state:
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
f : ℝ → E
p : ℝ
hp : p ≠ 0
⊢ IntegrableOn (fun x => x ^ (p - 1) • f (x ^ p)) (Ioi 0) ↔ IntegrableOn f (Ioi 0)

Next tactic:
simpa only [← integrableOn_Ioi_comp_rpow_iff f hp, mul_smul] using
    (integrable_smul_iff (abs_pos.mpr hp).ne' _).symm
theorem integrableOn_Ioi_comp_mul_left_iff (f : ℝ → E) (c : ℝ) {a : ℝ} (ha : 0 < a) :
    IntegrableOn (fun x => f (a * x)) (Ioi c) ↔ IntegrableOn f (Ioi <| a * c) := by
  

Proof state:
E : Type u_1
inst✝ : NormedAddCommGroup E
f : ℝ → E
c a : ℝ
ha : 0 < a
⊢ IntegrableOn (fun x => f (a * x)) (Ioi c) ↔ IntegrableOn f (Ioi (a * c))

Next tactic:
rw [← integrable_indicator_iff (measurableSet_Ioi : MeasurableSet <| Ioi c)]
theorem integrableOn_Ioi_comp_mul_left_iff (f : ℝ → E) (c : ℝ) {a : ℝ} (ha : 0 < a) :
    IntegrableOn (fun x => f (a * x)) (Ioi c) ↔ IntegrableOn f (Ioi <| a * c) := by
  rw [← integrable_indicator_iff (measurableSet_Ioi : MeasurableSet <| Ioi c)]
  

Proof state:
E : Type u_1
inst✝ : NormedAddCommGroup E
f : ℝ → E
c a : ℝ
ha : 0 < a
⊢ Integrable (indicator (Ioi c) fun x => f (a * x)) ↔ IntegrableOn f (Ioi (a * c))

Next tactic:
rw [← integrable_indicator_iff (measurableSet_Ioi : MeasurableSet <| Ioi <| a * c)]
theorem integrableOn_Ioi_comp_mul_left_iff (f : ℝ → E) (c : ℝ) {a : ℝ} (ha : 0 < a) :
    IntegrableOn (fun x => f (a * x)) (Ioi c) ↔ IntegrableOn f (Ioi <| a * c) := by
  rw [← integrable_indicator_iff (measurableSet_Ioi : MeasurableSet <| Ioi c)]
  rw [← integrable_indicator_iff (measurableSet_Ioi : MeasurableSet <| Ioi <| a * c)]
  

Proof state:
E : Type u_1
inst✝ : NormedAddCommGroup E
f : ℝ → E
c a : ℝ
ha : 0 < a
⊢ Integrable (indicator (Ioi c) fun x => f (a * x)) ↔ Integrable (indicator (Ioi (a * c)) f)

Next tactic:
convert integrable_comp_mul_left_iff ((Ioi (a * c)).indicator f) ha.ne' using 2
theorem integrableOn_Ioi_comp_mul_left_iff (f : ℝ → E) (c : ℝ) {a : ℝ} (ha : 0 < a) :
    IntegrableOn (fun x => f (a * x)) (Ioi c) ↔ IntegrableOn f (Ioi <| a * c) := by
  rw [← integrable_indicator_iff (measurableSet_Ioi : MeasurableSet <| Ioi c)]
  rw [← integrable_indicator_iff (measurableSet_Ioi : MeasurableSet <| Ioi <| a * c)]
  convert integrable_comp_mul_left_iff ((Ioi (a * c)).indicator f) ha.ne' using 2
  

Proof state:
case h.e'_1.h.e'_5
E : Type u_1
inst✝ : NormedAddCommGroup E
f : ℝ → E
c a : ℝ
ha : 0 < a
⊢ (indicator (Ioi c) fun x => f (a * x)) = fun x => indicator (Ioi (a * c)) f (a * x)

Next tactic:
ext1 x
theorem integrableOn_Ioi_comp_mul_left_iff (f : ℝ → E) (c : ℝ) {a : ℝ} (ha : 0 < a) :
    IntegrableOn (fun x => f (a * x)) (Ioi c) ↔ IntegrableOn f (Ioi <| a * c) := by
  rw [← integrable_indicator_iff (measurableSet_Ioi : MeasurableSet <| Ioi c)]
  rw [← integrable_indicator_iff (measurableSet_Ioi : MeasurableSet <| Ioi <| a * c)]
  convert integrable_comp_mul_left_iff ((Ioi (a * c)).indicator f) ha.ne' using 2
  ext1 x
  

Proof state:
case h.e'_1.h.e'_5.h
E : Type u_1
inst✝ : NormedAddCommGroup E
f : ℝ → E
c a : ℝ
ha : 0 < a
x : ℝ
⊢ indicator (Ioi c) (fun x => f (a * x)) x = indicator (Ioi (a * c)) f (a * x)

Next tactic:
rw [← indicator_comp_right, preimage_const_mul_Ioi _ ha, mul_comm a c, mul_div_cancel _ ha.ne']
theorem integrableOn_Ioi_comp_mul_left_iff (f : ℝ → E) (c : ℝ) {a : ℝ} (ha : 0 < a) :
    IntegrableOn (fun x => f (a * x)) (Ioi c) ↔ IntegrableOn f (Ioi <| a * c) := by
  rw [← integrable_indicator_iff (measurableSet_Ioi : MeasurableSet <| Ioi c)]
  rw [← integrable_indicator_iff (measurableSet_Ioi : MeasurableSet <| Ioi <| a * c)]
  convert integrable_comp_mul_left_iff ((Ioi (a * c)).indicator f) ha.ne' using 2
  ext1 x
  rw [← indicator_comp_right, preimage_const_mul_Ioi _ ha, mul_comm a c, mul_div_cancel _ ha.ne']
  

Proof state:
case h.e'_1.h.e'_5.h
E : Type u_1
inst✝ : NormedAddCommGroup E
f : ℝ → E
c a : ℝ
ha : 0 < a
x : ℝ
⊢ indicator (Ioi c) (fun x => f (a * x)) x = indicator (Ioi c) (f ∘ HMul.hMul a) x

Next tactic:
rfl
theorem integrableOn_Ioi_comp_mul_right_iff (f : ℝ → E) (c : ℝ) {a : ℝ} (ha : 0 < a) :
    IntegrableOn (fun x => f (x * a)) (Ioi c) ↔ IntegrableOn f (Ioi <| c * a) := by
  

Proof state:
E : Type u_1
inst✝ : NormedAddCommGroup E
f : ℝ → E
c a : ℝ
ha : 0 < a
⊢ IntegrableOn (fun x => f (x * a)) (Ioi c) ↔ IntegrableOn f (Ioi (c * a))

Next tactic:
simpa only [mul_comm, mul_zero] using integrableOn_Ioi_comp_mul_left_iff f c ha
theorem smul_neg_iff_of_pos (hc : 0 < c) : c • a < 0 ↔ a < 0 := by
  

Proof state:
ι : Type u_1
k : Type u_2
M : Type u_3
N : Type u_4
inst✝³ : OrderedSemiring k
inst✝² : OrderedAddCommGroup M
inst✝¹ : Module k M
inst✝ : OrderedSMul k M
a b : M
c : k
hc : 0 < c
⊢ c • a < 0 ↔ a < 0

Next tactic:
rw [← neg_neg a, smul_neg, neg_neg_iff_pos, neg_neg_iff_pos]
theorem smul_neg_iff_of_pos (hc : 0 < c) : c • a < 0 ↔ a < 0 := by
  rw [← neg_neg a, smul_neg, neg_neg_iff_pos, neg_neg_iff_pos]
  

Proof state:
ι : Type u_1
k : Type u_2
M : Type u_3
N : Type u_4
inst✝³ : OrderedSemiring k
inst✝² : OrderedAddCommGroup M
inst✝¹ : Module k M
inst✝ : OrderedSMul k M
a b : M
c : k
hc : 0 < c
⊢ 0 < c • -a ↔ 0 < -a

Next tactic:
exact smul_pos_iff_of_pos hc
theorem smul_lt_smul_of_neg (h : a < b) (hc : c < 0) : c • b < c • a := by
  

Proof state:
ι : Type u_1
k : Type u_2
M : Type u_3
N : Type u_4
inst✝³ : OrderedRing k
inst✝² : OrderedAddCommGroup M
inst✝¹ : Module k M
inst✝ : OrderedSMul k M
a b : M
c d : k
h : a < b
hc : c < 0
⊢ c • b < c • a

Next tactic:
rw [← neg_neg c, neg_smul, neg_smul (-c), neg_lt_neg_iff]
theorem smul_lt_smul_of_neg (h : a < b) (hc : c < 0) : c • b < c • a := by
  rw [← neg_neg c, neg_smul, neg_smul (-c), neg_lt_neg_iff]
  

Proof state:
ι : Type u_1
k : Type u_2
M : Type u_3
N : Type u_4
inst✝³ : OrderedRing k
inst✝² : OrderedAddCommGroup M
inst✝¹ : Module k M
inst✝ : OrderedSMul k M
a b : M
c d : k
h : a < b
hc : c < 0
⊢ -c • a < -c • b

Next tactic:
exact smul_lt_smul_of_pos h (neg_pos_of_neg hc)
theorem smul_le_smul_of_nonpos (h : a ≤ b) (hc : c ≤ 0) : c • b ≤ c • a := by
  

Proof state:
ι : Type u_1
k : Type u_2
M : Type u_3
N : Type u_4
inst✝³ : OrderedRing k
inst✝² : OrderedAddCommGroup M
inst✝¹ : Module k M
inst✝ : OrderedSMul k M
a b : M
c d : k
h : a ≤ b
hc : c ≤ 0
⊢ c • b ≤ c • a

Next tactic:
rw [← neg_neg c, neg_smul, neg_smul (-c), neg_le_neg_iff]
theorem smul_le_smul_of_nonpos (h : a ≤ b) (hc : c ≤ 0) : c • b ≤ c • a := by
  rw [← neg_neg c, neg_smul, neg_smul (-c), neg_le_neg_iff]
  

Proof state:
ι : Type u_1
k : Type u_2
M : Type u_3
N : Type u_4
inst✝³ : OrderedRing k
inst✝² : OrderedAddCommGroup M
inst✝¹ : Module k M
inst✝ : OrderedSMul k M
a b : M
c d : k
h : a ≤ b
hc : c ≤ 0
⊢ -c • a ≤ -c • b

Next tactic:
exact smul_le_smul_of_nonneg h (neg_nonneg_of_nonpos hc)
theorem eq_of_smul_eq_smul_of_neg_of_le (hab : c • a = c • b) (hc : c < 0) (h : a ≤ b) : a = b := by
  

Proof state:
ι : Type u_1
k : Type u_2
M : Type u_3
N : Type u_4
inst✝³ : OrderedRing k
inst✝² : OrderedAddCommGroup M
inst✝¹ : Module k M
inst✝ : OrderedSMul k M
a b : M
c d : k
hab : c • a = c • b
hc : c < 0
h : a ≤ b
⊢ a = b

Next tactic:
rw [← neg_neg c, neg_smul, neg_smul (-c), neg_inj] at hab
theorem eq_of_smul_eq_smul_of_neg_of_le (hab : c • a = c • b) (hc : c < 0) (h : a ≤ b) : a = b := by
  rw [← neg_neg c, neg_smul, neg_smul (-c), neg_inj] at hab
  

Proof state:
ι : Type u_1
k : Type u_2
M : Type u_3
N : Type u_4
inst✝³ : OrderedRing k
inst✝² : OrderedAddCommGroup M
inst✝¹ : Module k M
inst✝ : OrderedSMul k M
a b : M
c d : k
hab : -c • a = -c • b
hc : c < 0
h : a ≤ b
⊢ a = b

Next tactic:
exact eq_of_smul_eq_smul_of_pos_of_le hab (neg_pos_of_neg hc) h
theorem lt_of_smul_lt_smul_of_nonpos (h : c • a < c • b) (hc : c ≤ 0) : b < a := by
  

Proof state:
ι : Type u_1
k : Type u_2
M : Type u_3
N : Type u_4
inst✝³ : OrderedRing k
inst✝² : OrderedAddCommGroup M
inst✝¹ : Module k M
inst✝ : OrderedSMul k M
a b : M
c d : k
h : c • a < c • b
hc : c ≤ 0
⊢ b < a

Next tactic:
rw [← neg_neg c, neg_smul, neg_smul (-c), neg_lt_neg_iff] at h
theorem lt_of_smul_lt_smul_of_nonpos (h : c • a < c • b) (hc : c ≤ 0) : b < a := by
  rw [← neg_neg c, neg_smul, neg_smul (-c), neg_lt_neg_iff] at h
  

Proof state:
ι : Type u_1
k : Type u_2
M : Type u_3
N : Type u_4
inst✝³ : OrderedRing k
inst✝² : OrderedAddCommGroup M
inst✝¹ : Module k M
inst✝ : OrderedSMul k M
a b : M
c d : k
h : -c • b < -c • a
hc : c ≤ 0
⊢ b < a

Next tactic:
exact lt_of_smul_lt_smul_of_nonneg h (neg_nonneg_of_nonpos hc)
theorem smul_lt_smul_iff_of_neg (hc : c < 0) : c • a < c • b ↔ b < a := by
  

Proof state:
ι : Type u_1
k : Type u_2
M : Type u_3
N : Type u_4
inst✝³ : OrderedRing k
inst✝² : OrderedAddCommGroup M
inst✝¹ : Module k M
inst✝ : OrderedSMul k M
a b : M
c d : k
hc : c < 0
⊢ c • a < c • b ↔ b < a

Next tactic:
rw [← neg_neg c, neg_smul, neg_smul (-c), neg_lt_neg_iff]
theorem smul_lt_smul_iff_of_neg (hc : c < 0) : c • a < c • b ↔ b < a := by
  rw [← neg_neg c, neg_smul, neg_smul (-c), neg_lt_neg_iff]
  

Proof state:
ι : Type u_1
k : Type u_2
M : Type u_3
N : Type u_4
inst✝³ : OrderedRing k
inst✝² : OrderedAddCommGroup M
inst✝¹ : Module k M
inst✝ : OrderedSMul k M
a b : M
c d : k
hc : c < 0
⊢ -c • b < -c • a ↔ b < a

Next tactic:
exact smul_lt_smul_iff_of_pos (neg_pos_of_neg hc)
theorem smul_neg_iff_of_neg (hc : c < 0) : c • a < 0 ↔ 0 < a := by
  

Proof state:
ι : Type u_1
k : Type u_2
M : Type u_3
N : Type u_4
inst✝³ : OrderedRing k
inst✝² : OrderedAddCommGroup M
inst✝¹ : Module k M
inst✝ : OrderedSMul k M
a b : M
c d : k
hc : c < 0
⊢ c • a < 0 ↔ 0 < a

Next tactic:
rw [← neg_neg c, neg_smul, neg_neg_iff_pos]
theorem smul_neg_iff_of_neg (hc : c < 0) : c • a < 0 ↔ 0 < a := by
  rw [← neg_neg c, neg_smul, neg_neg_iff_pos]
  

Proof state:
ι : Type u_1
k : Type u_2
M : Type u_3
N : Type u_4
inst✝³ : OrderedRing k
inst✝² : OrderedAddCommGroup M
inst✝¹ : Module k M
inst✝ : OrderedSMul k M
a b : M
c d : k
hc : c < 0
⊢ 0 < -c • a ↔ 0 < a

Next tactic:
exact smul_pos_iff_of_pos (neg_pos_of_neg hc)
theorem smul_pos_iff_of_neg (hc : c < 0) : 0 < c • a ↔ a < 0 := by
  

Proof state:
ι : Type u_1
k : Type u_2
M : Type u_3
N : Type u_4
inst✝³ : OrderedRing k
inst✝² : OrderedAddCommGroup M
inst✝¹ : Module k M
inst✝ : OrderedSMul k M
a b : M
c d : k
hc : c < 0
⊢ 0 < c • a ↔ a < 0

Next tactic:
rw [← neg_neg c, neg_smul, neg_pos]
theorem smul_pos_iff_of_neg (hc : c < 0) : 0 < c • a ↔ a < 0 := by
  rw [← neg_neg c, neg_smul, neg_pos]
  

Proof state:
ι : Type u_1
k : Type u_2
M : Type u_3
N : Type u_4
inst✝³ : OrderedRing k
inst✝² : OrderedAddCommGroup M
inst✝¹ : Module k M
inst✝ : OrderedSMul k M
a b : M
c d : k
hc : c < 0
⊢ -c • a < 0 ↔ a < 0

Next tactic:
exact smul_neg_iff_of_pos (neg_pos_of_neg hc)
/-- Binary **rearrangement inequality**. -/
theorem smul_add_smul_le_smul_add_smul [ContravariantClass M M (· + ·) (· ≤ ·)] {a b : k} {c d : M}
    (hab : a ≤ b) (hcd : c ≤ d) : a • d + b • c ≤ a • c + b • d := by
  

Proof state:
ι : Type u_1
k : Type u_2
M : Type u_3
N : Type u_4
inst✝⁴ : OrderedRing k
inst✝³ : OrderedAddCommGroup M
inst✝² : Module k M
inst✝¹ : OrderedSMul k M
a✝ b✝ : M
c✝ d✝ : k
inst✝ : ContravariantClass M M (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
a b : k
c d : M
hab : a ≤ b
hcd : c ≤ d
⊢ a • d + b • c ≤ a • c + b • d

Next tactic:
obtain ⟨b, rfl⟩ := exists_add_of_le hab
/-- Binary **rearrangement inequality**. -/
theorem smul_add_smul_le_smul_add_smul [ContravariantClass M M (· + ·) (· ≤ ·)] {a b : k} {c d : M}
    (hab : a ≤ b) (hcd : c ≤ d) : a • d + b • c ≤ a • c + b • d := by
  obtain ⟨b, rfl⟩ := exists_add_of_le hab
  

Proof state:
case intro
ι : Type u_1
k : Type u_2
M : Type u_3
N : Type u_4
inst✝⁴ : OrderedRing k
inst✝³ : OrderedAddCommGroup M
inst✝² : Module k M
inst✝¹ : OrderedSMul k M
a✝ b✝ : M
c✝ d✝ : k
inst✝ : ContravariantClass M M (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
a : k
c d : M
hcd : c ≤ d
b : k
hab : a ≤ a + b
⊢ a • d + (a + b) • c ≤ a • c + (a + b) • d

Next tactic:
obtain ⟨d, rfl⟩ := exists_add_of_le hcd
/-- Binary **rearrangement inequality**. -/
theorem smul_add_smul_le_smul_add_smul [ContravariantClass M M (· + ·) (· ≤ ·)] {a b : k} {c d : M}
    (hab : a ≤ b) (hcd : c ≤ d) : a • d + b • c ≤ a • c + b • d := by
  obtain ⟨b, rfl⟩ := exists_add_of_le hab
  obtain ⟨d, rfl⟩ := exists_add_of_le hcd
  

Proof state:
case intro.intro
ι : Type u_1
k : Type u_2
M : Type u_3
N : Type u_4
inst✝⁴ : OrderedRing k
inst✝³ : OrderedAddCommGroup M
inst✝² : Module k M
inst✝¹ : OrderedSMul k M
a✝ b✝ : M
c✝ d✝ : k
inst✝ : ContravariantClass M M (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
a : k
c : M
b : k
hab : a ≤ a + b
d : M
hcd : c ≤ c + d
⊢ a • (c + d) + (a + b) • c ≤ a • c + (a + b) • (c + d)

Next tactic:
rw [smul_add, add_right_comm, smul_add, ← add_assoc, add_smul _ _ d]
/-- Binary **rearrangement inequality**. -/
theorem smul_add_smul_le_smul_add_smul [ContravariantClass M M (· + ·) (· ≤ ·)] {a b : k} {c d : M}
    (hab : a ≤ b) (hcd : c ≤ d) : a • d + b • c ≤ a • c + b • d := by
  obtain ⟨b, rfl⟩ := exists_add_of_le hab
  obtain ⟨d, rfl⟩ := exists_add_of_le hcd
  rw [smul_add, add_right_comm, smul_add, ← add_assoc, add_smul _ _ d]
  

Proof state:
case intro.intro
ι : Type u_1
k : Type u_2
M : Type u_3
N : Type u_4
inst✝⁴ : OrderedRing k
inst✝³ : OrderedAddCommGroup M
inst✝² : Module k M
inst✝¹ : OrderedSMul k M
a✝ b✝ : M
c✝ d✝ : k
inst✝ : ContravariantClass M M (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
a : k
c : M
b : k
hab : a ≤ a + b
d : M
hcd : c ≤ c + d
⊢ a • c + (a + b) • c + a • d ≤ a • c + (a + b) • c + (a • d + b • d)

Next tactic:
rw [le_add_iff_nonneg_right] at hab hcd
/-- Binary **rearrangement inequality**. -/
theorem smul_add_smul_le_smul_add_smul [ContravariantClass M M (· + ·) (· ≤ ·)] {a b : k} {c d : M}
    (hab : a ≤ b) (hcd : c ≤ d) : a • d + b • c ≤ a • c + b • d := by
  obtain ⟨b, rfl⟩ := exists_add_of_le hab
  obtain ⟨d, rfl⟩ := exists_add_of_le hcd
  rw [smul_add, add_right_comm, smul_add, ← add_assoc, add_smul _ _ d]
  rw [le_add_iff_nonneg_right] at hab hcd
  

Proof state:
case intro.intro
ι : Type u_1
k : Type u_2
M : Type u_3
N : Type u_4
inst✝⁴ : OrderedRing k
inst✝³ : OrderedAddCommGroup M
inst✝² : Module k M
inst✝¹ : OrderedSMul k M
a✝ b✝ : M
c✝ d✝ : k
inst✝ : ContravariantClass M M (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
a : k
c : M
b : k
hab : 0 ≤ b
d : M
hcd : 0 ≤ d
⊢ a • c + (a + b) • c + a • d ≤ a • c + (a + b) • c + (a • d + b • d)

Next tactic:
exact add_le_add_left (le_add_of_nonneg_right <| smul_nonneg hab hcd) _
/-- Binary **rearrangement inequality**. -/
theorem smul_add_smul_le_smul_add_smul' [ContravariantClass M M (· + ·) (· ≤ ·)] {a b : k} {c d : M}
    (hba : b ≤ a) (hdc : d ≤ c) : a • d + b • c ≤ a • c + b • d := by
  

Proof state:
ι : Type u_1
k : Type u_2
M : Type u_3
N : Type u_4
inst✝⁴ : OrderedRing k
inst✝³ : OrderedAddCommGroup M
inst✝² : Module k M
inst✝¹ : OrderedSMul k M
a✝ b✝ : M
c✝ d✝ : k
inst✝ : ContravariantClass M M (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
a b : k
c d : M
hba : b ≤ a
hdc : d ≤ c
⊢ a • d + b • c ≤ a • c + b • d

Next tactic:
rw [add_comm (a • d), add_comm (a • c)]
/-- Binary **rearrangement inequality**. -/
theorem smul_add_smul_le_smul_add_smul' [ContravariantClass M M (· + ·) (· ≤ ·)] {a b : k} {c d : M}
    (hba : b ≤ a) (hdc : d ≤ c) : a • d + b • c ≤ a • c + b • d := by
  rw [add_comm (a • d), add_comm (a • c)]
  

Proof state:
ι : Type u_1
k : Type u_2
M : Type u_3
N : Type u_4
inst✝⁴ : OrderedRing k
inst✝³ : OrderedAddCommGroup M
inst✝² : Module k M
inst✝¹ : OrderedSMul k M
a✝ b✝ : M
c✝ d✝ : k
inst✝ : ContravariantClass M M (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
a b : k
c d : M
hba : b ≤ a
hdc : d ≤ c
⊢ b • c + a • d ≤ b • d + a • c

Next tactic:
exact smul_add_smul_le_smul_add_smul hba hdc
/-- Binary strict **rearrangement inequality**. -/
theorem smul_add_smul_lt_smul_add_smul [CovariantClass M M (· + ·) (· < ·)]
    [ContravariantClass M M (· + ·) (· < ·)] {a b : k} {c d : M} (hab : a < b) (hcd : c < d) :
    a • d + b • c < a • c + b • d := by
  

Proof state:
ι : Type u_1
k : Type u_2
M : Type u_3
N : Type u_4
inst✝⁵ : OrderedRing k
inst✝⁴ : OrderedAddCommGroup M
inst✝³ : Module k M
inst✝² : OrderedSMul k M
a✝ b✝ : M
c✝ d✝ : k
inst✝¹ : CovariantClass M M (fun x x_1 => x + x_1) fun x x_1 => x < x_1
inst✝ : ContravariantClass M M (fun x x_1 => x + x_1) fun x x_1 => x < x_1
a b : k
c d : M
hab : a < b
hcd : c < d
⊢ a • d + b • c < a • c + b • d

Next tactic:
obtain ⟨b, rfl⟩ := exists_add_of_le hab.le