l3lab/ntp-mathlib huggingface dataset:
theorem Preadditive.isCoseparator_iff (G : C) :
    IsCoseparator G ↔ ∀ ⦃X Y : C⦄ (f : X ⟶ Y), (∀ h : Y ⟶ G, f ≫ h = 0) → f = 0 :=
  ⟨fun hG X Y f hf => hG.def _ _ (by simpa only [Limits.zero_comp] using hf), fun hG =>
    (isCoseparator_def _).2 fun X Y f g hfg =>
      sub_eq_zero.1 <| hG _ (by 

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : Preadditive C
G : C
hG : ∀ ⦃X Y : C⦄ (f : X ⟶ Y), (∀ (h : Y ⟶ G), f ≫ h = 0) → f = 0
X Y : C
f g : X ⟶ Y
hfg : ∀ (h : Y ⟶ G), f ≫ h = g ≫ h
⊢ ∀ (h : Y ⟶ G), (f - g) ≫ h = 0

Next tactic:
simpa only [Preadditive.sub_comp, sub_eq_zero] using hfg
theorem isSeparator_iff_faithful_preadditiveCoyoneda (G : C) :
    IsSeparator G ↔ Faithful (preadditiveCoyoneda.obj (op G)) := by
  

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : Preadditive C
G : C
⊢ IsSeparator G ↔ Faithful (preadditiveCoyoneda.obj (op G))

Next tactic:
rw [isSeparator_iff_faithful_coyoneda_obj, ← whiskering_preadditiveCoyoneda, Functor.comp_obj,
    whiskeringRight_obj_obj]
theorem isSeparator_iff_faithful_preadditiveCoyoneda (G : C) :
    IsSeparator G ↔ Faithful (preadditiveCoyoneda.obj (op G)) := by
  rw [isSeparator_iff_faithful_coyoneda_obj, ← whiskering_preadditiveCoyoneda, Functor.comp_obj,
    whiskeringRight_obj_obj]
  

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : Preadditive C
G : C
⊢ Faithful (preadditiveCoyoneda.obj (op G) ⋙ forget AddCommGroupCat) ↔ Faithful (preadditiveCoyoneda.obj (op G))

Next tactic:
exact ⟨fun h => Faithful.of_comp _ (forget AddCommGroupCat), fun h => Faithful.comp _ _⟩
theorem isSeparator_iff_faithful_preadditiveCoyonedaObj (G : C) :
    IsSeparator G ↔ Faithful (preadditiveCoyonedaObj (op G)) := by
  

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : Preadditive C
G : C
⊢ IsSeparator G ↔ Faithful (preadditiveCoyonedaObj (op G))

Next tactic:
rw [isSeparator_iff_faithful_preadditiveCoyoneda, preadditiveCoyoneda_obj]
theorem isSeparator_iff_faithful_preadditiveCoyonedaObj (G : C) :
    IsSeparator G ↔ Faithful (preadditiveCoyonedaObj (op G)) := by
  rw [isSeparator_iff_faithful_preadditiveCoyoneda, preadditiveCoyoneda_obj]
  

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : Preadditive C
G : C
⊢ Faithful (preadditiveCoyonedaObj (op G) ⋙ forget₂ (ModuleCat (End (op G))) AddCommGroupCat) ↔
    Faithful (preadditiveCoyonedaObj (op G))

Next tactic:
exact ⟨fun h => Faithful.of_comp _ (forget₂ _ AddCommGroupCat.{v}), fun h => Faithful.comp _ _⟩
theorem isCoseparator_iff_faithful_preadditiveYoneda (G : C) :
    IsCoseparator G ↔ Faithful (preadditiveYoneda.obj G) := by
  

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : Preadditive C
G : C
⊢ IsCoseparator G ↔ Faithful (preadditiveYoneda.obj G)

Next tactic:
rw [isCoseparator_iff_faithful_yoneda_obj, ← whiskering_preadditiveYoneda, Functor.comp_obj,
    whiskeringRight_obj_obj]
theorem isCoseparator_iff_faithful_preadditiveYoneda (G : C) :
    IsCoseparator G ↔ Faithful (preadditiveYoneda.obj G) := by
  rw [isCoseparator_iff_faithful_yoneda_obj, ← whiskering_preadditiveYoneda, Functor.comp_obj,
    whiskeringRight_obj_obj]
  

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : Preadditive C
G : C
⊢ Faithful (preadditiveYoneda.obj G ⋙ forget AddCommGroupCat) ↔ Faithful (preadditiveYoneda.obj G)

Next tactic:
exact ⟨fun h => Faithful.of_comp _ (forget AddCommGroupCat), fun h => Faithful.comp _ _⟩
theorem isCoseparator_iff_faithful_preadditiveYonedaObj (G : C) :
    IsCoseparator G ↔ Faithful (preadditiveYonedaObj G) := by
  

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : Preadditive C
G : C
⊢ IsCoseparator G ↔ Faithful (preadditiveYonedaObj G)

Next tactic:
rw [isCoseparator_iff_faithful_preadditiveYoneda, preadditiveYoneda_obj]
theorem isCoseparator_iff_faithful_preadditiveYonedaObj (G : C) :
    IsCoseparator G ↔ Faithful (preadditiveYonedaObj G) := by
  rw [isCoseparator_iff_faithful_preadditiveYoneda, preadditiveYoneda_obj]
  

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : Preadditive C
G : C
⊢ Faithful (preadditiveYonedaObj G ⋙ forget₂ (ModuleCat (End G)) AddCommGroupCat) ↔ Faithful (preadditiveYonedaObj G)

Next tactic:
exact ⟨fun h => Faithful.of_comp _ (forget₂ _ AddCommGroupCat.{v}), fun h => Faithful.comp _ _⟩
theorem bit_zero (b : Bool) : (b :: zero b) = zero b := by 

Proof state:
b : Bool
⊢ (b::zero b) = zero b

Next tactic:
cases b
theorem bit_zero (b : Bool) : (b :: zero b) = zero b := by cases b <;> 

Proof state:
case false
⊢ (false::zero false) = zero false

Next tactic:
rfl
theorem bit_zero (b : Bool) : (b :: zero b) = zero b := by cases b <;> 

Proof state:
case true
⊢ (true::zero true) = zero true

Next tactic:
rfl
theorem bit_one (b : Bool) : (b :: zero (Not b)) = msb b := by 

Proof state:
b : Bool
⊢ (b::zero (decide ¬b = true)) = nz (msb b)

Next tactic:
cases b
theorem bit_one (b : Bool) : (b :: zero (Not b)) = msb b := by cases b <;> 

Proof state:
case false
⊢ (false::zero (decide ¬false = true)) = nz (msb false)

Next tactic:
rfl
theorem bit_one (b : Bool) : (b :: zero (Not b)) = msb b := by cases b <;> 

Proof state:
case true
⊢ (true::zero (decide ¬true = true)) = nz (msb true)

Next tactic:
rfl
/-- A dependent induction principle for `NzsNum`, with base cases
      `0 : SNum` and `(-1) : SNum`. -/
def drec' {C : SNum → Sort*} (z : ∀ b, C (SNum.zero b)) (s : ∀ b p, C p → C (b :: p)) :
    ∀ p : NzsNum, C p
  | msb b => by 

Proof state:
C : SNum → Sort u_1
z : (b : Bool) → C (zero b)
s : (b : Bool) → (p : SNum) → C p → C (b::p)
b : Bool
⊢ C (nz (msb b))

Next tactic:
rw [← bit_one]
/-- A dependent induction principle for `NzsNum`, with base cases
      `0 : SNum` and `(-1) : SNum`. -/
def drec' {C : SNum → Sort*} (z : ∀ b, C (SNum.zero b)) (s : ∀ b p, C p → C (b :: p)) :
    ∀ p : NzsNum, C p
  | msb b => by rw [← bit_one]; 

Proof state:
C : SNum → Sort u_1
z : (b : Bool) → C (zero b)
s : (b : Bool) → (p : SNum) → C p → C (b::p)
b : Bool
⊢ C (b::zero (decide ¬b = true))

Next tactic:
exact s b (SNum.zero (Not b)) (z (Not b))
theorem IsPositive.inner_nonneg_right {T : E →L[𝕜] E} (hT : IsPositive T) (x : E) :
    0 ≤ re ⟪x, T x⟫ := by 

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedAddCommGroup F
inst✝³ : InnerProductSpace 𝕜 E
inst✝² : InnerProductSpace 𝕜 F
inst✝¹ : CompleteSpace E
inst✝ : CompleteSpace F
T : E →L[𝕜] E
hT : IsPositive T
x : E
⊢ 0 ≤ re (inner x (T x))

Next tactic:
rw [inner_re_symm]
theorem IsPositive.inner_nonneg_right {T : E →L[𝕜] E} (hT : IsPositive T) (x : E) :
    0 ≤ re ⟪x, T x⟫ := by rw [inner_re_symm]; 

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedAddCommGroup F
inst✝³ : InnerProductSpace 𝕜 E
inst✝² : InnerProductSpace 𝕜 F
inst✝¹ : CompleteSpace E
inst✝ : CompleteSpace F
T : E →L[𝕜] E
hT : IsPositive T
x : E
⊢ 0 ≤ re (inner (T x) x)

Next tactic:
exact hT.inner_nonneg_left x
theorem isPositive_zero : IsPositive (0 : E →L[𝕜] E) := by
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedAddCommGroup F
inst✝³ : InnerProductSpace 𝕜 E
inst✝² : InnerProductSpace 𝕜 F
inst✝¹ : CompleteSpace E
inst✝ : CompleteSpace F
⊢ IsPositive 0

Next tactic:
refine' ⟨isSelfAdjoint_zero _, fun x => _⟩
theorem isPositive_zero : IsPositive (0 : E →L[𝕜] E) := by
  refine' ⟨isSelfAdjoint_zero _, fun x => _⟩
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedAddCommGroup F
inst✝³ : InnerProductSpace 𝕜 E
inst✝² : InnerProductSpace 𝕜 F
inst✝¹ : CompleteSpace E
inst✝ : CompleteSpace F
x : E
⊢ 0 ≤ reApplyInnerSelf 0 x

Next tactic:
change 0 ≤ re ⟪_, _⟫
theorem isPositive_zero : IsPositive (0 : E →L[𝕜] E) := by
  refine' ⟨isSelfAdjoint_zero _, fun x => _⟩
  change 0 ≤ re ⟪_, _⟫
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedAddCommGroup F
inst✝³ : InnerProductSpace 𝕜 E
inst✝² : InnerProductSpace 𝕜 F
inst✝¹ : CompleteSpace E
inst✝ : CompleteSpace F
x : E
⊢ 0 ≤ re (inner (0 x) x)

Next tactic:
rw [zero_apply, inner_zero_left, ZeroHomClass.map_zero]
theorem IsPositive.add {T S : E →L[𝕜] E} (hT : T.IsPositive) (hS : S.IsPositive) :
    (T + S).IsPositive := by
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedAddCommGroup F
inst✝³ : InnerProductSpace 𝕜 E
inst✝² : InnerProductSpace 𝕜 F
inst✝¹ : CompleteSpace E
inst✝ : CompleteSpace F
T S : E →L[𝕜] E
hT : IsPositive T
hS : IsPositive S
⊢ IsPositive (T + S)

Next tactic:
refine' ⟨hT.isSelfAdjoint.add hS.isSelfAdjoint, fun x => _⟩
theorem IsPositive.add {T S : E →L[𝕜] E} (hT : T.IsPositive) (hS : S.IsPositive) :
    (T + S).IsPositive := by
  refine' ⟨hT.isSelfAdjoint.add hS.isSelfAdjoint, fun x => _⟩
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedAddCommGroup F
inst✝³ : InnerProductSpace 𝕜 E
inst✝² : InnerProductSpace 𝕜 F
inst✝¹ : CompleteSpace E
inst✝ : CompleteSpace F
T S : E →L[𝕜] E
hT : IsPositive T
hS : IsPositive S
x : E
⊢ 0 ≤ reApplyInnerSelf (T + S) x

Next tactic:
rw [reApplyInnerSelf, add_apply, inner_add_left, map_add]
theorem IsPositive.add {T S : E →L[𝕜] E} (hT : T.IsPositive) (hS : S.IsPositive) :
    (T + S).IsPositive := by
  refine' ⟨hT.isSelfAdjoint.add hS.isSelfAdjoint, fun x => _⟩
  rw [reApplyInnerSelf, add_apply, inner_add_left, map_add]
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedAddCommGroup F
inst✝³ : InnerProductSpace 𝕜 E
inst✝² : InnerProductSpace 𝕜 F
inst✝¹ : CompleteSpace E
inst✝ : CompleteSpace F
T S : E →L[𝕜] E
hT : IsPositive T
hS : IsPositive S
x : E
⊢ 0 ≤ re (inner (T x) x) + re (inner (S x) x)

Next tactic:
exact add_nonneg (hT.inner_nonneg_left x) (hS.inner_nonneg_left x)
theorem IsPositive.conj_adjoint {T : E →L[𝕜] E} (hT : T.IsPositive) (S : E →L[𝕜] F) :
    (S ∘L T ∘L S†).IsPositive := by
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedAddCommGroup F
inst✝³ : InnerProductSpace 𝕜 E
inst✝² : InnerProductSpace 𝕜 F
inst✝¹ : CompleteSpace E
inst✝ : CompleteSpace F
T : E →L[𝕜] E
hT : IsPositive T
S : E →L[𝕜] F
⊢ IsPositive (comp S (comp T (adjoint S)))

Next tactic:
refine' ⟨hT.isSelfAdjoint.conj_adjoint S, fun x => _⟩
theorem IsPositive.conj_adjoint {T : E →L[𝕜] E} (hT : T.IsPositive) (S : E →L[𝕜] F) :
    (S ∘L T ∘L S†).IsPositive := by
  refine' ⟨hT.isSelfAdjoint.conj_adjoint S, fun x => _⟩
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedAddCommGroup F
inst✝³ : InnerProductSpace 𝕜 E
inst✝² : InnerProductSpace 𝕜 F
inst✝¹ : CompleteSpace E
inst✝ : CompleteSpace F
T : E →L[𝕜] E
hT : IsPositive T
S : E →L[𝕜] F
x : F
⊢ 0 ≤ reApplyInnerSelf (comp S (comp T (adjoint S))) x

Next tactic:
rw [reApplyInnerSelf, comp_apply, ← adjoint_inner_right]
theorem IsPositive.conj_adjoint {T : E →L[𝕜] E} (hT : T.IsPositive) (S : E →L[𝕜] F) :
    (S ∘L T ∘L S†).IsPositive := by
  refine' ⟨hT.isSelfAdjoint.conj_adjoint S, fun x => _⟩
  rw [reApplyInnerSelf, comp_apply, ← adjoint_inner_right]
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedAddCommGroup F
inst✝³ : InnerProductSpace 𝕜 E
inst✝² : InnerProductSpace 𝕜 F
inst✝¹ : CompleteSpace E
inst✝ : CompleteSpace F
T : E →L[𝕜] E
hT : IsPositive T
S : E →L[𝕜] F
x : F
⊢ 0 ≤ re (inner ((comp T (adjoint S)) x) ((adjoint S) x))

Next tactic:
exact hT.inner_nonneg_left _
theorem IsPositive.adjoint_conj {T : E →L[𝕜] E} (hT : T.IsPositive) (S : F →L[𝕜] E) :
    (S† ∘L T ∘L S).IsPositive := by
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedAddCommGroup F
inst✝³ : InnerProductSpace 𝕜 E
inst✝² : InnerProductSpace 𝕜 F
inst✝¹ : CompleteSpace E
inst✝ : CompleteSpace F
T : E →L[𝕜] E
hT : IsPositive T
S : F →L[𝕜] E
⊢ IsPositive (comp (adjoint S) (comp T S))

Next tactic:
convert hT.conj_adjoint (S†)
theorem IsPositive.adjoint_conj {T : E →L[𝕜] E} (hT : T.IsPositive) (S : F →L[𝕜] E) :
    (S† ∘L T ∘L S).IsPositive := by
  convert hT.conj_adjoint (S†)
  

Proof state:
case h.e'_7.h.e'_24.h.e'_24
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedAddCommGroup F
inst✝³ : InnerProductSpace 𝕜 E
inst✝² : InnerProductSpace 𝕜 F
inst✝¹ : CompleteSpace E
inst✝ : CompleteSpace F
T : E →L[𝕜] E
hT : IsPositive T
S : F →L[𝕜] E
⊢ S = adjoint (adjoint S)

Next tactic:
rw [adjoint_adjoint]
theorem IsPositive.conj_orthogonalProjection (U : Submodule 𝕜 E) {T : E →L[𝕜] E} (hT : T.IsPositive)
    [CompleteSpace U] :
    (U.subtypeL ∘L
        orthogonalProjection U ∘L T ∘L U.subtypeL ∘L orthogonalProjection U).IsPositive := by
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝⁷ : IsROrC 𝕜
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : InnerProductSpace 𝕜 E
inst✝³ : InnerProductSpace 𝕜 F
inst✝² : CompleteSpace E
inst✝¹ : CompleteSpace F
U : Submodule 𝕜 E
T : E →L[𝕜] E
hT : IsPositive T
inst✝ : CompleteSpace ↥U
⊢ IsPositive
    (comp (Submodule.subtypeL U)
      (comp (orthogonalProjection U) (comp T (comp (Submodule.subtypeL U) (orthogonalProjection U)))))

Next tactic:
have := hT.conj_adjoint (U.subtypeL ∘L orthogonalProjection U)
theorem IsPositive.conj_orthogonalProjection (U : Submodule 𝕜 E) {T : E →L[𝕜] E} (hT : T.IsPositive)
    [CompleteSpace U] :
    (U.subtypeL ∘L
        orthogonalProjection U ∘L T ∘L U.subtypeL ∘L orthogonalProjection U).IsPositive := by
  have := hT.conj_adjoint (U.subtypeL ∘L orthogonalProjection U)
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝⁷ : IsROrC 𝕜
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : InnerProductSpace 𝕜 E
inst✝³ : InnerProductSpace 𝕜 F
inst✝² : CompleteSpace E
inst✝¹ : CompleteSpace F
U : Submodule 𝕜 E
T : E →L[𝕜] E
hT : IsPositive T
inst✝ : CompleteSpace ↥U
this :
  IsPositive
    (comp (comp (Submodule.subtypeL U) (orthogonalProjection U))
      (comp T (adjoint (comp (Submodule.subtypeL U) (orthogonalProjection U)))))
⊢ IsPositive
    (comp (Submodule.subtypeL U)
      (comp (orthogonalProjection U) (comp T (comp (Submodule.subtypeL U) (orthogonalProjection U)))))

Next tactic:
rwa [(orthogonalProjection_isSelfAdjoint U).adjoint_eq] at this
theorem IsPositive.orthogonalProjection_comp {T : E →L[𝕜] E} (hT : T.IsPositive) (U : Submodule 𝕜 E)
    [CompleteSpace U] : (orthogonalProjection U ∘L T ∘L U.subtypeL).IsPositive := by
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝⁷ : IsROrC 𝕜
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : InnerProductSpace 𝕜 E
inst✝³ : InnerProductSpace 𝕜 F
inst✝² : CompleteSpace E
inst✝¹ : CompleteSpace F
T : E →L[𝕜] E
hT : IsPositive T
U : Submodule 𝕜 E
inst✝ : CompleteSpace ↥U
⊢ IsPositive (comp (orthogonalProjection U) (comp T (Submodule.subtypeL U)))

Next tactic:
have := hT.conj_adjoint (orthogonalProjection U : E →L[𝕜] U)
theorem IsPositive.orthogonalProjection_comp {T : E →L[𝕜] E} (hT : T.IsPositive) (U : Submodule 𝕜 E)
    [CompleteSpace U] : (orthogonalProjection U ∘L T ∘L U.subtypeL).IsPositive := by
  have := hT.conj_adjoint (orthogonalProjection U : E →L[𝕜] U)
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝⁷ : IsROrC 𝕜
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : InnerProductSpace 𝕜 E
inst✝³ : InnerProductSpace 𝕜 F
inst✝² : CompleteSpace E
inst✝¹ : CompleteSpace F
T : E →L[𝕜] E
hT : IsPositive T
U : Submodule 𝕜 E
inst✝ : CompleteSpace ↥U
this : IsPositive (comp (orthogonalProjection U) (comp T (adjoint (orthogonalProjection U))))
⊢ IsPositive (comp (orthogonalProjection U) (comp T (Submodule.subtypeL U)))

Next tactic:
rwa [U.adjoint_orthogonalProjection] at this
theorem isPositive_iff_complex (T : E' →L[ℂ] E') :
    IsPositive T ↔ ∀ x, (re ⟪T x, x⟫_ℂ : ℂ) = ⟪T x, x⟫_ℂ ∧ 0 ≤ re ⟪T x, x⟫_ℂ := by
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝⁹ : IsROrC 𝕜
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : InnerProductSpace 𝕜 E
inst✝⁵ : InnerProductSpace 𝕜 F
inst✝⁴ : CompleteSpace E
inst✝³ : CompleteSpace F
E' : Type u_4
inst✝² : NormedAddCommGroup E'
inst✝¹ : InnerProductSpace ℂ E'
inst✝ : CompleteSpace E'
T : E' →L[ℂ] E'
⊢ IsPositive T ↔ ∀ (x : E'), ↑(re (inner (T x) x)) = inner (T x) x ∧ 0 ≤ re (inner (T x) x)

Next tactic:
simp_rw [IsPositive, forall_and, isSelfAdjoint_iff_isSymmetric,
    LinearMap.isSymmetric_iff_inner_map_self_real, conj_eq_iff_re]
theorem isPositive_iff_complex (T : E' →L[ℂ] E') :
    IsPositive T ↔ ∀ x, (re ⟪T x, x⟫_ℂ : ℂ) = ⟪T x, x⟫_ℂ ∧ 0 ≤ re ⟪T x, x⟫_ℂ := by
  simp_rw [IsPositive, forall_and, isSelfAdjoint_iff_isSymmetric,
    LinearMap.isSymmetric_iff_inner_map_self_real, conj_eq_iff_re]
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝⁹ : IsROrC 𝕜
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : InnerProductSpace 𝕜 E
inst✝⁵ : InnerProductSpace 𝕜 F
inst✝⁴ : CompleteSpace E
inst✝³ : CompleteSpace F
E' : Type u_4
inst✝² : NormedAddCommGroup E'
inst✝¹ : InnerProductSpace ℂ E'
inst✝ : CompleteSpace E'
T : E' →L[ℂ] E'
⊢ ((∀ (v : E'), ↑(re (inner (↑T v) v)) = inner (↑T v) v) ∧ ∀ (x : E'), 0 ≤ reApplyInnerSelf T x) ↔
    (∀ (x : E'), ↑(re (inner (T x) x)) = inner (T x) x) ∧ ∀ (x : E'), 0 ≤ re (inner (T x) x)

Next tactic:
rfl
instance : NonUnitalStarAlgHomClass (A →⋆ₙₐ[R] B) R A B
    where
  coe f := f.toFun
  coe_injective' := by 

Proof state:
R : Type u_1
A : Type u_2
B : Type u_3
C : Type u_4
D : Type u_5
inst✝¹² : Monoid R
inst✝¹¹ : NonUnitalNonAssocSemiring A
inst✝¹⁰ : DistribMulAction R A
inst✝⁹ : Star A
inst✝⁸ : NonUnitalNonAssocSemiring B
inst✝⁷ : DistribMulAction R B
inst✝⁶ : Star B
inst✝⁵ : NonUnitalNonAssocSemiring C
inst✝⁴ : DistribMulAction R C
inst✝³ : Star C
inst✝² : NonUnitalNonAssocSemiring D
inst✝¹ : DistribMulAction R D
inst✝ : Star D
⊢ Function.Injective fun f => f.toFun

Next tactic:
rintro ⟨⟨⟨⟨f, _⟩, _⟩, _⟩, _⟩ ⟨⟨⟨⟨g, _⟩, _⟩, _⟩, _⟩ h
@[simp]
theorem mk_coe (f : A →⋆ₙₐ[R] B) (h₁ h₂ h₃ h₄ h₅) :
    (⟨⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩, h₅⟩ : A →⋆ₙₐ[R] B) = f := by
  

Proof state:
R : Type u_1
A : Type u_2
B : Type u_3
C : Type u_4
D : Type u_5
inst✝¹² : Monoid R
inst✝¹¹ : NonUnitalNonAssocSemiring A
inst✝¹⁰ : DistribMulAction R A
inst✝⁹ : Star A
inst✝⁸ : NonUnitalNonAssocSemiring B
inst✝⁷ : DistribMulAction R B
inst✝⁶ : Star B
inst✝⁵ : NonUnitalNonAssocSemiring C
inst✝⁴ : DistribMulAction R C
inst✝³ : Star C
inst✝² : NonUnitalNonAssocSemiring D
inst✝¹ : DistribMulAction R D
inst✝ : Star D
f : A →⋆ₙₐ[R] B
h₁ : ∀ (m : R) (x : A), f (m • x) = m • f x
h₂ : MulActionHom.toFun { toFun := ⇑f, map_smul' := h₁ } 0 = 0
h₃ :
  ∀ (x y : A),
    MulActionHom.toFun { toFun := ⇑f, map_smul' := h₁ } (x + y) =
      MulActionHom.toFun { toFun := ⇑f, map_smul' := h₁ } x + MulActionHom.toFun { toFun := ⇑f, map_smul' := h₁ } y
h₄ :
  ∀ (x y : A),
    MulActionHom.toFun
        { toMulActionHom := { toFun := ⇑f, map_smul' := h₁ }, map_zero' := h₂, map_add' := h₃ }.toMulActionHom (x * y) =
      MulActionHom.toFun
          { toMulActionHom := { toFun := ⇑f, map_smul' := h₁ }, map_zero' := h₂, map_add' := h₃ }.toMulActionHom x *
        MulActionHom.toFun
          { toMulActionHom := { toFun := ⇑f, map_smul' := h₁ }, map_zero' := h₂, map_add' := h₃ }.toMulActionHom y
h₅ :
  ∀ (a : A),
    MulActionHom.toFun
        {
              toDistribMulActionHom :=
                { toMulActionHom := { toFun := ⇑f, map_smul' := h₁ }, map_zero' := h₂, map_add' := h₃ },
              map_mul' := h₄ }.toDistribMulActionHom.toMulActionHom
        (star a) =
      star
        (MulActionHom.toFun
          {
                toDistribMulActionHom :=
                  { toMulActionHom := { toFun := ⇑f, map_smul' := h₁ }, map_zero' := h₂, map_add' := h₃ },
                map_mul' := h₄ }.toDistribMulActionHom.toMulActionHom
          a)
⊢ {
      toNonUnitalAlgHom :=
        {
          toDistribMulActionHom :=
            { toMulActionHom := { toFun := ⇑f, map_smul' := h₁ }, map_zero' := h₂, map_add' := h₃ },
          map_mul' := h₄ },
      map_star' := h₅ } =
    f

Next tactic:
ext
@[simp]
theorem mk_coe (f : A →⋆ₙₐ[R] B) (h₁ h₂ h₃ h₄ h₅) :
    (⟨⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩, h₅⟩ : A →⋆ₙₐ[R] B) = f := by
  ext
  

Proof state:
case h
R : Type u_1
A : Type u_2
B : Type u_3
C : Type u_4
D : Type u_5
inst✝¹² : Monoid R
inst✝¹¹ : NonUnitalNonAssocSemiring A
inst✝¹⁰ : DistribMulAction R A
inst✝⁹ : Star A
inst✝⁸ : NonUnitalNonAssocSemiring B
inst✝⁷ : DistribMulAction R B
inst✝⁶ : Star B
inst✝⁵ : NonUnitalNonAssocSemiring C
inst✝⁴ : DistribMulAction R C
inst✝³ : Star C
inst✝² : NonUnitalNonAssocSemiring D
inst✝¹ : DistribMulAction R D
inst✝ : Star D
f : A →⋆ₙₐ[R] B
h₁ : ∀ (m : R) (x : A), f (m • x) = m • f x
h₂ : MulActionHom.toFun { toFun := ⇑f, map_smul' := h₁ } 0 = 0
h₃ :
  ∀ (x y : A),
    MulActionHom.toFun { toFun := ⇑f, map_smul' := h₁ } (x + y) =
      MulActionHom.toFun { toFun := ⇑f, map_smul' := h₁ } x + MulActionHom.toFun { toFun := ⇑f, map_smul' := h₁ } y
h₄ :
  ∀ (x y : A),
    MulActionHom.toFun
        { toMulActionHom := { toFun := ⇑f, map_smul' := h₁ }, map_zero' := h₂, map_add' := h₃ }.toMulActionHom (x * y) =
      MulActionHom.toFun
          { toMulActionHom := { toFun := ⇑f, map_smul' := h₁ }, map_zero' := h₂, map_add' := h₃ }.toMulActionHom x *
        MulActionHom.toFun
          { toMulActionHom := { toFun := ⇑f, map_smul' := h₁ }, map_zero' := h₂, map_add' := h₃ }.toMulActionHom y
h₅ :
  ∀ (a : A),
    MulActionHom.toFun
        {
              toDistribMulActionHom :=
                { toMulActionHom := { toFun := ⇑f, map_smul' := h₁ }, map_zero' := h₂, map_add' := h₃ },
              map_mul' := h₄ }.toDistribMulActionHom.toMulActionHom
        (star a) =
      star
        (MulActionHom.toFun
          {
                toDistribMulActionHom :=
                  { toMulActionHom := { toFun := ⇑f, map_smul' := h₁ }, map_zero' := h₂, map_add' := h₃ },
                map_mul' := h₄ }.toDistribMulActionHom.toMulActionHom
          a)
x✝ : A
⊢ {
        toNonUnitalAlgHom :=
          {
            toDistribMulActionHom :=
              { toMulActionHom := { toFun := ⇑f, map_smul' := h₁ }, map_zero' := h₂, map_add' := h₃ },
            map_mul' := h₄ },
        map_star' := h₅ }
      x✝ =
    f x✝

Next tactic:
rfl
/-- The composition of non-unital ⋆-algebra homomorphisms, as a non-unital ⋆-algebra
homomorphism. -/
def comp (f : B →⋆ₙₐ[R] C) (g : A →⋆ₙₐ[R] B) : A →⋆ₙₐ[R] C :=
  { f.toNonUnitalAlgHom.comp g.toNonUnitalAlgHom with
    map_star' := by
      

Proof state:
R : Type u_1
A : Type u_2
B : Type u_3
C : Type u_4
D : Type u_5
inst✝¹² : Monoid R
inst✝¹¹ : NonUnitalNonAssocSemiring A
inst✝¹⁰ : DistribMulAction R A
inst✝⁹ : Star A
inst✝⁸ : NonUnitalNonAssocSemiring B
inst✝⁷ : DistribMulAction R B
inst✝⁶ : Star B
inst✝⁵ : NonUnitalNonAssocSemiring C
inst✝⁴ : DistribMulAction R C
inst✝³ : Star C
inst✝² : NonUnitalNonAssocSemiring D
inst✝¹ : DistribMulAction R D
inst✝ : Star D
f : B →⋆ₙₐ[R] C
g : A →⋆ₙₐ[R] B
src✝ : A →ₙₐ[R] C := NonUnitalAlgHom.comp f.toNonUnitalAlgHom g.toNonUnitalAlgHom
⊢ ∀ (a : A),
    MulActionHom.toFun
        { toDistribMulActionHom := src✝.toDistribMulActionHom,
              map_mul' :=
                (_ :
                  ∀ (x y : A),
                    MulActionHom.toFun src✝.toMulActionHom (x * y) =
                      MulActionHom.toFun src✝.toMulActionHom x *
                        MulActionHom.toFun src✝.toMulActionHom y) }.toDistribMulActionHom.toMulActionHom
        (star a) =
      star
        (MulActionHom.toFun
          { toDistribMulActionHom := src✝.toDistribMulActionHom,
                map_mul' :=
                  (_ :
                    ∀ (x y : A),
                      MulActionHom.toFun src✝.toMulActionHom (x * y) =
                        MulActionHom.toFun src✝.toMulActionHom x *
                          MulActionHom.toFun src✝.toMulActionHom y) }.toDistribMulActionHom.toMulActionHom
          a)

Next tactic:
simp only [map_star, NonUnitalAlgHom.toFun_eq_coe, eq_self_iff_true, NonUnitalAlgHom.coe_comp,
        coe_toNonUnitalAlgHom, Function.comp_apply, forall_const]