Theorem: conjugate_nonneg
File: Mathlib/Algebra/Star/Order.lean

tactic: rw [StarOrderedRing.nonneg_iff] at ha
state_before: R : Type u
inst✝³ : NonUnitalSemiring R
inst✝² : PartialOrder R
inst✝¹ : StarRing R
inst✝ : StarOrderedRing R
a : R
ha : 0 ≤ a
c : R
⊢ 0 ≤ star c * a * c
state_after: R : Type u
inst✝³ : NonUnitalSemiring R
inst✝² : PartialOrder R
inst✝¹ : StarRing R
inst✝ : StarOrderedRing R
a : R
ha : a ∈ AddSubmonoid.closure (range fun s => star s * s)
c : R
⊢ 0 ≤ star c * a * c

tactic: refine AddSubmonoid.closure_induction ha (fun x hx => ?_)
  (by rw [mul_zero, zero_mul]) fun x y hx hy => ?_
state_before: R : Type u
inst✝³ : NonUnitalSemiring R
inst✝² : PartialOrder R
inst✝¹ : StarRing R
inst✝ : StarOrderedRing R
a : R
ha : a ∈ AddSubmonoid.closure (range fun s => star s * s)
c : R
⊢ 0 ≤ star c * a * c
state_after: case refine_1
R : Type u
inst✝³ : NonUnitalSemiring R
inst✝² : PartialOrder R
inst✝¹ : StarRing R
inst✝ : StarOrderedRing R
a : R
ha : a ∈ AddSubmonoid.closure (range fun s => star s * s)
c x : R
hx : x ∈ range fun s => star s * s
⊢ 0 ≤ star c * x * c

case refine_2
R : Type u
inst✝³ : NonUnitalSemiring R
inst✝² : PartialOrder R
inst✝¹ : StarRing R
inst✝ : StarOrderedRing R
a : R
ha : a ∈ AddSubmonoid.closure (range fun s => star s * s)
c x y : R
hx : 0 ≤ star c * x * c
hy : 0 ≤ star c * y * c
⊢ 0 ≤ star c * (x + y) * c

tactic: rw [mul_zero, zero_mul]
state_before: R : Type u
inst✝³ : NonUnitalSemiring R
inst✝² : PartialOrder R
inst✝¹ : StarRing R
inst✝ : StarOrderedRing R
a : R
ha : a ∈ AddSubmonoid.closure (range fun s => star s * s)
c : R
⊢ 0 ≤ star c * 0 * c
state_after: no goals

tactic: obtain ⟨x, rfl⟩ := hx
state_before: case refine_1
R : Type u
inst✝³ : NonUnitalSemiring R
inst✝² : PartialOrder R
inst✝¹ : StarRing R
inst✝ : StarOrderedRing R
a : R
ha : a ∈ AddSubmonoid.closure (range fun s => star s * s)
c x : R
hx : x ∈ range fun s => star s * s
⊢ 0 ≤ star c * x * c
state_after: case refine_1.intro
R : Type u
inst✝³ : NonUnitalSemiring R
inst✝² : PartialOrder R
inst✝¹ : StarRing R
inst✝ : StarOrderedRing R
a : R
ha : a ∈ AddSubmonoid.closure (range fun s => star s * s)
c x : R
⊢ 0 ≤ star c * (fun s => star s * s) x * c

tactic: convert star_mul_self_nonneg (x * c) using 1
state_before: case refine_1.intro
R : Type u
inst✝³ : NonUnitalSemiring R
inst✝² : PartialOrder R
inst✝¹ : StarRing R
inst✝ : StarOrderedRing R
a : R
ha : a ∈ AddSubmonoid.closure (range fun s => star s * s)
c x : R
⊢ 0 ≤ star c * (fun s => star s * s) x * c
state_after: case h.e'_4
R : Type u
inst✝³ : NonUnitalSemiring R
inst✝² : PartialOrder R
inst✝¹ : StarRing R
inst✝ : StarOrderedRing R
a : R
ha : a ∈ AddSubmonoid.closure (range fun s => star s * s)
c x : R
⊢ star c * (fun s => star s * s) x * c = star (x * c) * (x * c)

tactic: rw [star_mul, ← mul_assoc, mul_assoc _ _ c]
state_before: case h.e'_4
R : Type u
inst✝³ : NonUnitalSemiring R
inst✝² : PartialOrder R
inst✝¹ : StarRing R
inst✝ : StarOrderedRing R
a : R
ha : a ∈ AddSubmonoid.closure (range fun s => star s * s)
c x : R
⊢ star c * (fun s => star s * s) x * c = star (x * c) * (x * c)
state_after: no goals

tactic: calc
  0 ≤ star c * x * c + 0 := by rw [add_zero]; exact hx
  _ ≤ star c * x * c + star c * y * c := add_le_add_left hy _
  _ ≤ _ := by rw [mul_add, add_mul]
state_before: case refine_2
R : Type u
inst✝³ : NonUnitalSemiring R
inst✝² : PartialOrder R
inst✝¹ : StarRing R
inst✝ : StarOrderedRing R
a : R
ha : a ∈ AddSubmonoid.closure (range fun s => star s * s)
c x y : R
hx : 0 ≤ star c * x * c
hy : 0 ≤ star c * y * c
⊢ 0 ≤ star c * (x + y) * c
state_after: no goals

tactic: rw [add_zero]
state_before: R : Type u
inst✝³ : NonUnitalSemiring R
inst✝² : PartialOrder R
inst✝¹ : StarRing R
inst✝ : StarOrderedRing R
a : R
ha : a ∈ AddSubmonoid.closure (range fun s => star s * s)
c x y : R
hx : 0 ≤ star c * x * c
hy : 0 ≤ star c * y * c
⊢ 0 ≤ star c * x * c + 0
state_after: R : Type u
inst✝³ : NonUnitalSemiring R
inst✝² : PartialOrder R
inst✝¹ : StarRing R
inst✝ : StarOrderedRing R
a : R
ha : a ∈ AddSubmonoid.closure (range fun s => star s * s)
c x y : R
hx : 0 ≤ star c * x * c
hy : 0 ≤ star c * y * c
⊢ 0 ≤ star c * x * c

tactic: exact hx
state_before: R : Type u
inst✝³ : NonUnitalSemiring R
inst✝² : PartialOrder R
inst✝¹ : StarRing R
inst✝ : StarOrderedRing R
a : R
ha : a ∈ AddSubmonoid.closure (range fun s => star s * s)
c x y : R
hx : 0 ≤ star c * x * c
hy : 0 ≤ star c * y * c
⊢ 0 ≤ star c * x * c
state_after: no goals

tactic: rw [mul_add, add_mul]
state_before: R : Type u
inst✝³ : NonUnitalSemiring R
inst✝² : PartialOrder R
inst✝¹ : StarRing R
inst✝ : StarOrderedRing R
a : R
ha : a ∈ AddSubmonoid.closure (range fun s => star s * s)
c x y : R
hx : 0 ≤ star c * x * c
hy : 0 ≤ star c * y * c
⊢ star c * x * c + star c * y * c ≤ star c * (x + y) * c
state_after: no goals