l3lab/ntp-mathlib huggingface dataset:
instance isIso_indexCone_lift :
    IsIso ((limitConeIsLimit.{u, u} (indexFunctor hC)).lift (indexCone hC)) :=
  haveI : CompactSpace C := by rwa [← isCompact_iff_compactSpace]
  isIso_of_bijective _
    (by
      refine ⟨fun a b h ↦ ?_, fun a ↦ ?_⟩
      · refine eq_of_forall_π_app_eq a b (fun J ↦ ?_)
        apply_fun fun f : (limitCone.{u, u} (indexFunctor hC)).pt => f.val (op J) at h
        exact h
      · rsuffices ⟨b, hb⟩ : ∃ (x : C), ∀ (J : Finset ι), π_app C (· ∈ J) x = a.val (op J)
        · use b
          apply Subtype.ext
          apply funext
          intro J
          exact hb (unop J)
        have hc : ∀ (J : Finset ι) s, IsClosed ((π_app C (· ∈ J)) ⁻¹' {s})
        · intro J s
          refine IsClosed.preimage (π_app C (· ∈ J)).continuous ?_
          exact T1Space.t1 s
        have H₁ : ∀ (Q₁ Q₂ : Finset ι), Q₁ ≤ Q₂ →
            π_app C (· ∈ Q₁) ⁻¹' {a.val (op Q₁)} ⊇
            π_app C (· ∈ Q₂) ⁻¹' {a.val (op Q₂)}
        · intro J K h x hx
          

Proof state:
case H₁
ι : Type u
X : ι → Type
inst✝² : (i : ι) → TopologicalSpace (X i)
C : Set ((i : ι) → X i)
J✝ K✝ : ι → Prop
inst✝¹ : ∀ (i : ι), T2Space (X i)
inst✝ : ∀ (i : ι), TotallyDisconnectedSpace (X i)
hC : IsCompact C
this : CompactSpace ↑C
a : (forget Profinite).obj (limitCone (indexFunctor hC)).pt
hc : ∀ (J : Finset ι) (s : ↑(obj C fun x => x ∈ J)), IsClosed (⇑(π_app C fun x => x ∈ J) ⁻¹' {s})
J K : Finset ι
h : J ≤ K
x : ↑C
hx : x ∈ ⇑(π_app C fun x => x ∈ K) ⁻¹' {↑a (op K)}
⊢ x ∈ ⇑(π_app C fun x => x ∈ J) ⁻¹' {↑a (op J)}

Next tactic:
simp only [Set.mem_preimage, Set.mem_singleton_iff] at hx ⊢
instance isIso_indexCone_lift :
    IsIso ((limitConeIsLimit.{u, u} (indexFunctor hC)).lift (indexCone hC)) :=
  haveI : CompactSpace C := by rwa [← isCompact_iff_compactSpace]
  isIso_of_bijective _
    (by
      refine ⟨fun a b h ↦ ?_, fun a ↦ ?_⟩
      · refine eq_of_forall_π_app_eq a b (fun J ↦ ?_)
        apply_fun fun f : (limitCone.{u, u} (indexFunctor hC)).pt => f.val (op J) at h
        exact h
      · rsuffices ⟨b, hb⟩ : ∃ (x : C), ∀ (J : Finset ι), π_app C (· ∈ J) x = a.val (op J)
        · use b
          apply Subtype.ext
          apply funext
          intro J
          exact hb (unop J)
        have hc : ∀ (J : Finset ι) s, IsClosed ((π_app C (· ∈ J)) ⁻¹' {s})
        · intro J s
          refine IsClosed.preimage (π_app C (· ∈ J)).continuous ?_
          exact T1Space.t1 s
        have H₁ : ∀ (Q₁ Q₂ : Finset ι), Q₁ ≤ Q₂ →
            π_app C (· ∈ Q₁) ⁻¹' {a.val (op Q₁)} ⊇
            π_app C (· ∈ Q₂) ⁻¹' {a.val (op Q₂)}
        · intro J K h x hx
          simp only [Set.mem_preimage, Set.mem_singleton_iff] at hx ⊢
          

Proof state:
case H₁
ι : Type u
X : ι → Type
inst✝² : (i : ι) → TopologicalSpace (X i)
C : Set ((i : ι) → X i)
J✝ K✝ : ι → Prop
inst✝¹ : ∀ (i : ι), T2Space (X i)
inst✝ : ∀ (i : ι), TotallyDisconnectedSpace (X i)
hC : IsCompact C
this : CompactSpace ↑C
a : (forget Profinite).obj (limitCone (indexFunctor hC)).pt
hc : ∀ (J : Finset ι) (s : ↑(obj C fun x => x ∈ J)), IsClosed (⇑(π_app C fun x => x ∈ J) ⁻¹' {s})
J K : Finset ι
h : J ≤ K
x : ↑C
hx : (π_app C fun x => x ∈ K) x = ↑a (op K)
⊢ (π_app C fun x => x ∈ J) x = ↑a (op J)

Next tactic:
rw [← map_comp_π_app C h, Function.comp_apply,
            hx, ← a.prop (homOfLE h).op]
instance isIso_indexCone_lift :
    IsIso ((limitConeIsLimit.{u, u} (indexFunctor hC)).lift (indexCone hC)) :=
  haveI : CompactSpace C := by rwa [← isCompact_iff_compactSpace]
  isIso_of_bijective _
    (by
      refine ⟨fun a b h ↦ ?_, fun a ↦ ?_⟩
      · refine eq_of_forall_π_app_eq a b (fun J ↦ ?_)
        apply_fun fun f : (limitCone.{u, u} (indexFunctor hC)).pt => f.val (op J) at h
        exact h
      · rsuffices ⟨b, hb⟩ : ∃ (x : C), ∀ (J : Finset ι), π_app C (· ∈ J) x = a.val (op J)
        · use b
          apply Subtype.ext
          apply funext
          intro J
          exact hb (unop J)
        have hc : ∀ (J : Finset ι) s, IsClosed ((π_app C (· ∈ J)) ⁻¹' {s})
        · intro J s
          refine IsClosed.preimage (π_app C (· ∈ J)).continuous ?_
          exact T1Space.t1 s
        have H₁ : ∀ (Q₁ Q₂ : Finset ι), Q₁ ≤ Q₂ →
            π_app C (· ∈ Q₁) ⁻¹' {a.val (op Q₁)} ⊇
            π_app C (· ∈ Q₂) ⁻¹' {a.val (op Q₂)}
        · intro J K h x hx
          simp only [Set.mem_preimage, Set.mem_singleton_iff] at hx ⊢
          rw [← map_comp_π_app C h, Function.comp_apply,
            hx, ← a.prop (homOfLE h).op]
          

Proof state:
case H₁
ι : Type u
X : ι → Type
inst✝² : (i : ι) → TopologicalSpace (X i)
C : Set ((i : ι) → X i)
J✝ K✝ : ι → Prop
inst✝¹ : ∀ (i : ι), T2Space (X i)
inst✝ : ∀ (i : ι), TotallyDisconnectedSpace (X i)
hC : IsCompact C
this : CompactSpace ↑C
a : (forget Profinite).obj (limitCone (indexFunctor hC)).pt
hc : ∀ (J : Finset ι) (s : ↑(obj C fun x => x ∈ J)), IsClosed (⇑(π_app C fun x => x ∈ J) ⁻¹' {s})
J K : Finset ι
h : J ≤ K
x : ↑C
hx : (π_app C fun x => x ∈ K) x = ↑a (op K)
⊢ (map C h) (↑a (op K)) = (((indexFunctor hC ⋙ profiniteToCompHaus) ⋙ compHausToTop).map (homOfLE h).op) (↑a (op K))

Next tactic:
rfl
instance isIso_indexCone_lift :
    IsIso ((limitConeIsLimit.{u, u} (indexFunctor hC)).lift (indexCone hC)) :=
  haveI : CompactSpace C := by rwa [← isCompact_iff_compactSpace]
  isIso_of_bijective _
    (by
      refine ⟨fun a b h ↦ ?_, fun a ↦ ?_⟩
      · refine eq_of_forall_π_app_eq a b (fun J ↦ ?_)
        apply_fun fun f : (limitCone.{u, u} (indexFunctor hC)).pt => f.val (op J) at h
        exact h
      · rsuffices ⟨b, hb⟩ : ∃ (x : C), ∀ (J : Finset ι), π_app C (· ∈ J) x = a.val (op J)
        · use b
          apply Subtype.ext
          apply funext
          intro J
          exact hb (unop J)
        have hc : ∀ (J : Finset ι) s, IsClosed ((π_app C (· ∈ J)) ⁻¹' {s})
        · intro J s
          refine IsClosed.preimage (π_app C (· ∈ J)).continuous ?_
          exact T1Space.t1 s
        have H₁ : ∀ (Q₁ Q₂ : Finset ι), Q₁ ≤ Q₂ →
            π_app C (· ∈ Q₁) ⁻¹' {a.val (op Q₁)} ⊇
            π_app C (· ∈ Q₂) ⁻¹' {a.val (op Q₂)}
        · intro J K h x hx
          simp only [Set.mem_preimage, Set.mem_singleton_iff] at hx ⊢
          rw [← map_comp_π_app C h, Function.comp_apply,
            hx, ← a.prop (homOfLE h).op]
          rfl
        

Proof state:
ι : Type u
X : ι → Type
inst✝² : (i : ι) → TopologicalSpace (X i)
C : Set ((i : ι) → X i)
J K : ι → Prop
inst✝¹ : ∀ (i : ι), T2Space (X i)
inst✝ : ∀ (i : ι), TotallyDisconnectedSpace (X i)
hC : IsCompact C
this : CompactSpace ↑C
a : (forget Profinite).obj (limitCone (indexFunctor hC)).pt
hc : ∀ (J : Finset ι) (s : ↑(obj C fun x => x ∈ J)), IsClosed (⇑(π_app C fun x => x ∈ J) ⁻¹' {s})
H₁ :
  ∀ (Q₁ Q₂ : Finset ι),
    Q₁ ≤ Q₂ → ⇑(π_app C fun x => x ∈ Q₁) ⁻¹' {↑a (op Q₁)} ⊇ ⇑(π_app C fun x => x ∈ Q₂) ⁻¹' {↑a (op Q₂)}
⊢ ∃ x, ∀ (J : Finset ι), (π_app C fun x => x ∈ J) x = ↑a (op J)

Next tactic:
obtain ⟨x, hx⟩ :
            Set.Nonempty (⋂ (J : Finset ι), π_app C (· ∈ J) ⁻¹' {a.val (op J)}) :=
          IsCompact.nonempty_iInter_of_directed_nonempty_compact_closed
            (fun J : Finset ι => π_app C (· ∈ J) ⁻¹' {a.val (op J)}) (directed_of_isDirected_le H₁)
            (fun J => (Set.singleton_nonempty _).preimage (surjective_π_app _))
            (fun J => (hc J (a.val (op J))).isCompact) fun J => hc J (a.val (op J))
instance isIso_indexCone_lift :
    IsIso ((limitConeIsLimit.{u, u} (indexFunctor hC)).lift (indexCone hC)) :=
  haveI : CompactSpace C := by rwa [← isCompact_iff_compactSpace]
  isIso_of_bijective _
    (by
      refine ⟨fun a b h ↦ ?_, fun a ↦ ?_⟩
      · refine eq_of_forall_π_app_eq a b (fun J ↦ ?_)
        apply_fun fun f : (limitCone.{u, u} (indexFunctor hC)).pt => f.val (op J) at h
        exact h
      · rsuffices ⟨b, hb⟩ : ∃ (x : C), ∀ (J : Finset ι), π_app C (· ∈ J) x = a.val (op J)
        · use b
          apply Subtype.ext
          apply funext
          intro J
          exact hb (unop J)
        have hc : ∀ (J : Finset ι) s, IsClosed ((π_app C (· ∈ J)) ⁻¹' {s})
        · intro J s
          refine IsClosed.preimage (π_app C (· ∈ J)).continuous ?_
          exact T1Space.t1 s
        have H₁ : ∀ (Q₁ Q₂ : Finset ι), Q₁ ≤ Q₂ →
            π_app C (· ∈ Q₁) ⁻¹' {a.val (op Q₁)} ⊇
            π_app C (· ∈ Q₂) ⁻¹' {a.val (op Q₂)}
        · intro J K h x hx
          simp only [Set.mem_preimage, Set.mem_singleton_iff] at hx ⊢
          rw [← map_comp_π_app C h, Function.comp_apply,
            hx, ← a.prop (homOfLE h).op]
          rfl
        obtain ⟨x, hx⟩ :
            Set.Nonempty (⋂ (J : Finset ι), π_app C (· ∈ J) ⁻¹' {a.val (op J)}) :=
          IsCompact.nonempty_iInter_of_directed_nonempty_compact_closed
            (fun J : Finset ι => π_app C (· ∈ J) ⁻¹' {a.val (op J)}) (directed_of_isDirected_le H₁)
            (fun J => (Set.singleton_nonempty _).preimage (surjective_π_app _))
            (fun J => (hc J (a.val (op J))).isCompact) fun J => hc J (a.val (op J))
        

Proof state:
case intro
ι : Type u
X : ι → Type
inst✝² : (i : ι) → TopologicalSpace (X i)
C : Set ((i : ι) → X i)
J K : ι → Prop
inst✝¹ : ∀ (i : ι), T2Space (X i)
inst✝ : ∀ (i : ι), TotallyDisconnectedSpace (X i)
hC : IsCompact C
this : CompactSpace ↑C
a : (forget Profinite).obj (limitCone (indexFunctor hC)).pt
hc : ∀ (J : Finset ι) (s : ↑(obj C fun x => x ∈ J)), IsClosed (⇑(π_app C fun x => x ∈ J) ⁻¹' {s})
H₁ :
  ∀ (Q₁ Q₂ : Finset ι),
    Q₁ ≤ Q₂ → ⇑(π_app C fun x => x ∈ Q₁) ⁻¹' {↑a (op Q₁)} ⊇ ⇑(π_app C fun x => x ∈ Q₂) ⁻¹' {↑a (op Q₂)}
x : ↑C
hx : x ∈ ⋂ J, ⇑(π_app C fun x => x ∈ J) ⁻¹' {↑a (op J)}
⊢ ∃ x, ∀ (J : Finset ι), (π_app C fun x => x ∈ J) x = ↑a (op J)

Next tactic:
exact ⟨x, Set.mem_iInter.1 hx⟩
/-- The canonical map from `C` to the explicit limit as an isomorphism. -/
noncomputable
def isoindexConeLift :
    @Profinite.of C _ (by 

Proof state:
ι : Type u
X : ι → Type
inst✝² : (i : ι) → TopologicalSpace (X i)
C : Set ((i : ι) → X i)
J K : ι → Prop
inst✝¹ : ∀ (i : ι), T2Space (X i)
inst✝ : ∀ (i : ι), TotallyDisconnectedSpace (X i)
hC : IsCompact C
⊢ CompactSpace ↑C

Next tactic:
rwa [← isCompact_iff_compactSpace]
/-- The self-adjoint part of an element of a star module, as a linear map. -/
@[simps]
def selfAdjointPart : A →ₗ[R] selfAdjoint A where
  toFun x :=
    ⟨(⅟ 2 : R) • (x + star x), by
      

Proof state:
R : Type u_1
A : Type u_2
inst✝⁷ : Semiring R
inst✝⁶ : StarMul R
inst✝⁵ : TrivialStar R
inst✝⁴ : AddCommGroup A
inst✝³ : Module R A
inst✝² : StarAddMonoid A
inst✝¹ : StarModule R A
inst✝ : Invertible 2
x : A
⊢ ⅟2 • (x + star x) ∈ selfAdjoint A

Next tactic:
simp only [selfAdjoint.mem_iff, star_smul, add_comm, StarAddMonoid.star_add, star_inv',
        star_bit0, star_one, star_star, star_invOf (2 : R), star_trivial]
/-- The self-adjoint part of an element of a star module, as a linear map. -/
@[simps]
def selfAdjointPart : A →ₗ[R] selfAdjoint A where
  toFun x :=
    ⟨(⅟ 2 : R) • (x + star x), by
      simp only [selfAdjoint.mem_iff, star_smul, add_comm, StarAddMonoid.star_add, star_inv',
        star_bit0, star_one, star_star, star_invOf (2 : R), star_trivial]⟩
  map_add' x y := by
    

Proof state:
R : Type u_1
A : Type u_2
inst✝⁷ : Semiring R
inst✝⁶ : StarMul R
inst✝⁵ : TrivialStar R
inst✝⁴ : AddCommGroup A
inst✝³ : Module R A
inst✝² : StarAddMonoid A
inst✝¹ : StarModule R A
inst✝ : Invertible 2
x y : A
⊢ (fun x => { val := ⅟2 • (x + star x), property := (_ : ⅟2 • (x + star x) ∈ selfAdjoint A) }) (x + y) =
    (fun x => { val := ⅟2 • (x + star x), property := (_ : ⅟2 • (x + star x) ∈ selfAdjoint A) }) x +
      (fun x => { val := ⅟2 • (x + star x), property := (_ : ⅟2 • (x + star x) ∈ selfAdjoint A) }) y

Next tactic:
ext
/-- The self-adjoint part of an element of a star module, as a linear map. -/
@[simps]
def selfAdjointPart : A →ₗ[R] selfAdjoint A where
  toFun x :=
    ⟨(⅟ 2 : R) • (x + star x), by
      simp only [selfAdjoint.mem_iff, star_smul, add_comm, StarAddMonoid.star_add, star_inv',
        star_bit0, star_one, star_star, star_invOf (2 : R), star_trivial]⟩
  map_add' x y := by
    ext
    

Proof state:
case a
R : Type u_1
A : Type u_2
inst✝⁷ : Semiring R
inst✝⁶ : StarMul R
inst✝⁵ : TrivialStar R
inst✝⁴ : AddCommGroup A
inst✝³ : Module R A
inst✝² : StarAddMonoid A
inst✝¹ : StarModule R A
inst✝ : Invertible 2
x y : A
⊢ ↑((fun x => { val := ⅟2 • (x + star x), property := (_ : ⅟2 • (x + star x) ∈ selfAdjoint A) }) (x + y)) =
    ↑((fun x => { val := ⅟2 • (x + star x), property := (_ : ⅟2 • (x + star x) ∈ selfAdjoint A) }) x +
        (fun x => { val := ⅟2 • (x + star x), property := (_ : ⅟2 • (x + star x) ∈ selfAdjoint A) }) y)

Next tactic:
simp [add_add_add_comm]
/-- The self-adjoint part of an element of a star module, as a linear map. -/
@[simps]
def selfAdjointPart : A →ₗ[R] selfAdjoint A where
  toFun x :=
    ⟨(⅟ 2 : R) • (x + star x), by
      simp only [selfAdjoint.mem_iff, star_smul, add_comm, StarAddMonoid.star_add, star_inv',
        star_bit0, star_one, star_star, star_invOf (2 : R), star_trivial]⟩
  map_add' x y := by
    ext
    simp [add_add_add_comm]
  map_smul' r x := by
    

Proof state:
R : Type u_1
A : Type u_2
inst✝⁷ : Semiring R
inst✝⁶ : StarMul R
inst✝⁵ : TrivialStar R
inst✝⁴ : AddCommGroup A
inst✝³ : Module R A
inst✝² : StarAddMonoid A
inst✝¹ : StarModule R A
inst✝ : Invertible 2
r : R
x : A
⊢ AddHom.toFun
      { toFun := fun x => { val := ⅟2 • (x + star x), property := (_ : ⅟2 • (x + star x) ∈ selfAdjoint A) },
        map_add' :=
          (_ :
            ∀ (x y : A),
              (fun x => { val := ⅟2 • (x + star x), property := (_ : ⅟2 • (x + star x) ∈ selfAdjoint A) }) (x + y) =
                (fun x => { val := ⅟2 • (x + star x), property := (_ : ⅟2 • (x + star x) ∈ selfAdjoint A) }) x +
                  (fun x => { val := ⅟2 • (x + star x), property := (_ : ⅟2 • (x + star x) ∈ selfAdjoint A) }) y) }
      (r • x) =
    (RingHom.id R) r •
      AddHom.toFun
        { toFun := fun x => { val := ⅟2 • (x + star x), property := (_ : ⅟2 • (x + star x) ∈ selfAdjoint A) },
          map_add' :=
            (_ :
              ∀ (x y : A),
                (fun x => { val := ⅟2 • (x + star x), property := (_ : ⅟2 • (x + star x) ∈ selfAdjoint A) }) (x + y) =
                  (fun x => { val := ⅟2 • (x + star x), property := (_ : ⅟2 • (x + star x) ∈ selfAdjoint A) }) x +
                    (fun x => { val := ⅟2 • (x + star x), property := (_ : ⅟2 • (x + star x) ∈ selfAdjoint A) }) y) }
        x

Next tactic:
ext
/-- The self-adjoint part of an element of a star module, as a linear map. -/
@[simps]
def selfAdjointPart : A →ₗ[R] selfAdjoint A where
  toFun x :=
    ⟨(⅟ 2 : R) • (x + star x), by
      simp only [selfAdjoint.mem_iff, star_smul, add_comm, StarAddMonoid.star_add, star_inv',
        star_bit0, star_one, star_star, star_invOf (2 : R), star_trivial]⟩
  map_add' x y := by
    ext
    simp [add_add_add_comm]
  map_smul' r x := by
    ext
    

Proof state:
case a
R : Type u_1
A : Type u_2
inst✝⁷ : Semiring R
inst✝⁶ : StarMul R
inst✝⁵ : TrivialStar R
inst✝⁴ : AddCommGroup A
inst✝³ : Module R A
inst✝² : StarAddMonoid A
inst✝¹ : StarModule R A
inst✝ : Invertible 2
r : R
x : A
⊢ ↑(AddHom.toFun
        { toFun := fun x => { val := ⅟2 • (x + star x), property := (_ : ⅟2 • (x + star x) ∈ selfAdjoint A) },
          map_add' :=
            (_ :
              ∀ (x y : A),
                (fun x => { val := ⅟2 • (x + star x), property := (_ : ⅟2 • (x + star x) ∈ selfAdjoint A) }) (x + y) =
                  (fun x => { val := ⅟2 • (x + star x), property := (_ : ⅟2 • (x + star x) ∈ selfAdjoint A) }) x +
                    (fun x => { val := ⅟2 • (x + star x), property := (_ : ⅟2 • (x + star x) ∈ selfAdjoint A) }) y) }
        (r • x)) =
    ↑((RingHom.id R) r •
        AddHom.toFun
          { toFun := fun x => { val := ⅟2 • (x + star x), property := (_ : ⅟2 • (x + star x) ∈ selfAdjoint A) },
            map_add' :=
              (_ :
                ∀ (x y : A),
                  (fun x => { val := ⅟2 • (x + star x), property := (_ : ⅟2 • (x + star x) ∈ selfAdjoint A) }) (x + y) =
                    (fun x => { val := ⅟2 • (x + star x), property := (_ : ⅟2 • (x + star x) ∈ selfAdjoint A) }) x +
                      (fun x => { val := ⅟2 • (x + star x), property := (_ : ⅟2 • (x + star x) ∈ selfAdjoint A) }) y) }
          x)

Next tactic:
simp [← mul_smul, show ⅟ 2 * r = r * ⅟ 2 from Commute.invOf_left <| (2 : ℕ).cast_commute r]
/-- The skew-adjoint part of an element of a star module, as a linear map. -/
@[simps]
def skewAdjointPart : A →ₗ[R] skewAdjoint A where
  toFun x :=
    ⟨(⅟ 2 : R) • (x - star x), by
      

Proof state:
R : Type u_1
A : Type u_2
inst✝⁷ : Semiring R
inst✝⁶ : StarMul R
inst✝⁵ : TrivialStar R
inst✝⁴ : AddCommGroup A
inst✝³ : Module R A
inst✝² : StarAddMonoid A
inst✝¹ : StarModule R A
inst✝ : Invertible 2
x : A
⊢ ⅟2 • (x - star x) ∈ skewAdjoint A

Next tactic:
simp only [skewAdjoint.mem_iff, star_smul, star_sub, star_star, star_trivial, ← smul_neg,
        neg_sub]
/-- The skew-adjoint part of an element of a star module, as a linear map. -/
@[simps]
def skewAdjointPart : A →ₗ[R] skewAdjoint A where
  toFun x :=
    ⟨(⅟ 2 : R) • (x - star x), by
      simp only [skewAdjoint.mem_iff, star_smul, star_sub, star_star, star_trivial, ← smul_neg,
        neg_sub]⟩
  map_add' x y := by
    

Proof state:
R : Type u_1
A : Type u_2
inst✝⁷ : Semiring R
inst✝⁶ : StarMul R
inst✝⁵ : TrivialStar R
inst✝⁴ : AddCommGroup A
inst✝³ : Module R A
inst✝² : StarAddMonoid A
inst✝¹ : StarModule R A
inst✝ : Invertible 2
x y : A
⊢ (fun x => { val := ⅟2 • (x - star x), property := (_ : ⅟2 • (x - star x) ∈ skewAdjoint A) }) (x + y) =
    (fun x => { val := ⅟2 • (x - star x), property := (_ : ⅟2 • (x - star x) ∈ skewAdjoint A) }) x +
      (fun x => { val := ⅟2 • (x - star x), property := (_ : ⅟2 • (x - star x) ∈ skewAdjoint A) }) y

Next tactic:
ext
/-- The skew-adjoint part of an element of a star module, as a linear map. -/
@[simps]
def skewAdjointPart : A →ₗ[R] skewAdjoint A where
  toFun x :=
    ⟨(⅟ 2 : R) • (x - star x), by
      simp only [skewAdjoint.mem_iff, star_smul, star_sub, star_star, star_trivial, ← smul_neg,
        neg_sub]⟩
  map_add' x y := by
    ext
    

Proof state:
case a
R : Type u_1
A : Type u_2
inst✝⁷ : Semiring R
inst✝⁶ : StarMul R
inst✝⁵ : TrivialStar R
inst✝⁴ : AddCommGroup A
inst✝³ : Module R A
inst✝² : StarAddMonoid A
inst✝¹ : StarModule R A
inst✝ : Invertible 2
x y : A
⊢ ↑((fun x => { val := ⅟2 • (x - star x), property := (_ : ⅟2 • (x - star x) ∈ skewAdjoint A) }) (x + y)) =
    ↑((fun x => { val := ⅟2 • (x - star x), property := (_ : ⅟2 • (x - star x) ∈ skewAdjoint A) }) x +
        (fun x => { val := ⅟2 • (x - star x), property := (_ : ⅟2 • (x - star x) ∈ skewAdjoint A) }) y)

Next tactic:
simp only [sub_add, ← smul_add, sub_sub_eq_add_sub, star_add, AddSubgroup.coe_mk,
      AddSubgroup.coe_add]
/-- The skew-adjoint part of an element of a star module, as a linear map. -/
@[simps]
def skewAdjointPart : A →ₗ[R] skewAdjoint A where
  toFun x :=
    ⟨(⅟ 2 : R) • (x - star x), by
      simp only [skewAdjoint.mem_iff, star_smul, star_sub, star_star, star_trivial, ← smul_neg,
        neg_sub]⟩
  map_add' x y := by
    ext
    simp only [sub_add, ← smul_add, sub_sub_eq_add_sub, star_add, AddSubgroup.coe_mk,
      AddSubgroup.coe_add]
  map_smul' r x := by
    

Proof state:
R : Type u_1
A : Type u_2
inst✝⁷ : Semiring R
inst✝⁶ : StarMul R
inst✝⁵ : TrivialStar R
inst✝⁴ : AddCommGroup A
inst✝³ : Module R A
inst✝² : StarAddMonoid A
inst✝¹ : StarModule R A
inst✝ : Invertible 2
r : R
x : A
⊢ AddHom.toFun
      { toFun := fun x => { val := ⅟2 • (x - star x), property := (_ : ⅟2 • (x - star x) ∈ skewAdjoint A) },
        map_add' :=
          (_ :
            ∀ (x y : A),
              (fun x => { val := ⅟2 • (x - star x), property := (_ : ⅟2 • (x - star x) ∈ skewAdjoint A) }) (x + y) =
                (fun x => { val := ⅟2 • (x - star x), property := (_ : ⅟2 • (x - star x) ∈ skewAdjoint A) }) x +
                  (fun x => { val := ⅟2 • (x - star x), property := (_ : ⅟2 • (x - star x) ∈ skewAdjoint A) }) y) }
      (r • x) =
    (RingHom.id R) r •
      AddHom.toFun
        { toFun := fun x => { val := ⅟2 • (x - star x), property := (_ : ⅟2 • (x - star x) ∈ skewAdjoint A) },
          map_add' :=
            (_ :
              ∀ (x y : A),
                (fun x => { val := ⅟2 • (x - star x), property := (_ : ⅟2 • (x - star x) ∈ skewAdjoint A) }) (x + y) =
                  (fun x => { val := ⅟2 • (x - star x), property := (_ : ⅟2 • (x - star x) ∈ skewAdjoint A) }) x +
                    (fun x => { val := ⅟2 • (x - star x), property := (_ : ⅟2 • (x - star x) ∈ skewAdjoint A) }) y) }
        x

Next tactic:
ext
/-- The skew-adjoint part of an element of a star module, as a linear map. -/
@[simps]
def skewAdjointPart : A →ₗ[R] skewAdjoint A where
  toFun x :=
    ⟨(⅟ 2 : R) • (x - star x), by
      simp only [skewAdjoint.mem_iff, star_smul, star_sub, star_star, star_trivial, ← smul_neg,
        neg_sub]⟩
  map_add' x y := by
    ext
    simp only [sub_add, ← smul_add, sub_sub_eq_add_sub, star_add, AddSubgroup.coe_mk,
      AddSubgroup.coe_add]
  map_smul' r x := by
    ext
    

Proof state:
case a
R : Type u_1
A : Type u_2
inst✝⁷ : Semiring R
inst✝⁶ : StarMul R
inst✝⁵ : TrivialStar R
inst✝⁴ : AddCommGroup A
inst✝³ : Module R A
inst✝² : StarAddMonoid A
inst✝¹ : StarModule R A
inst✝ : Invertible 2
r : R
x : A
⊢ ↑(AddHom.toFun
        { toFun := fun x => { val := ⅟2 • (x - star x), property := (_ : ⅟2 • (x - star x) ∈ skewAdjoint A) },
          map_add' :=
            (_ :
              ∀ (x y : A),
                (fun x => { val := ⅟2 • (x - star x), property := (_ : ⅟2 • (x - star x) ∈ skewAdjoint A) }) (x + y) =
                  (fun x => { val := ⅟2 • (x - star x), property := (_ : ⅟2 • (x - star x) ∈ skewAdjoint A) }) x +
                    (fun x => { val := ⅟2 • (x - star x), property := (_ : ⅟2 • (x - star x) ∈ skewAdjoint A) }) y) }
        (r • x)) =
    ↑((RingHom.id R) r •
        AddHom.toFun
          { toFun := fun x => { val := ⅟2 • (x - star x), property := (_ : ⅟2 • (x - star x) ∈ skewAdjoint A) },
            map_add' :=
              (_ :
                ∀ (x y : A),
                  (fun x => { val := ⅟2 • (x - star x), property := (_ : ⅟2 • (x - star x) ∈ skewAdjoint A) }) (x + y) =
                    (fun x => { val := ⅟2 • (x - star x), property := (_ : ⅟2 • (x - star x) ∈ skewAdjoint A) }) x +
                      (fun x => { val := ⅟2 • (x - star x), property := (_ : ⅟2 • (x - star x) ∈ skewAdjoint A) }) y) }
          x)

Next tactic:
simp [← mul_smul, ← smul_sub,
      show r * ⅟ 2 = ⅟ 2 * r from Commute.invOf_right <| (2 : ℕ).commute_cast r]
theorem StarModule.selfAdjointPart_add_skewAdjointPart (x : A) :
    (selfAdjointPart R x : A) + skewAdjointPart R x = x := by
  

Proof state:
R : Type u_1
A : Type u_2
inst✝⁷ : Semiring R
inst✝⁶ : StarMul R
inst✝⁵ : TrivialStar R
inst✝⁴ : AddCommGroup A
inst✝³ : Module R A
inst✝² : StarAddMonoid A
inst✝¹ : StarModule R A
inst✝ : Invertible 2
x : A
⊢ ↑((selfAdjointPart R) x) + ↑((skewAdjointPart R) x) = x

Next tactic:
simp only [smul_sub, selfAdjointPart_apply_coe, smul_add, skewAdjointPart_apply_coe,
    add_add_sub_cancel, invOf_two_smul_add_invOf_two_smul]
theorem IsSelfAdjoint.coe_selfAdjointPart_apply {x : A} (hx : IsSelfAdjoint x) :
    (selfAdjointPart R x : A) = x := by
  

Proof state:
R : Type u_1
A : Type u_2
inst✝⁷ : Semiring R
inst✝⁶ : StarMul R
inst✝⁵ : TrivialStar R
inst✝⁴ : AddCommGroup A
inst✝³ : Module R A
inst✝² : StarAddMonoid A
inst✝¹ : StarModule R A
inst✝ : Invertible 2
x : A
hx : IsSelfAdjoint x
⊢ ↑((selfAdjointPart R) x) = x

Next tactic:
rw [selfAdjointPart_apply_coe, hx.star_eq, smul_add, invOf_two_smul_add_invOf_two_smul]
theorem IsSelfAdjoint.skewAdjointPart_apply {x : A} (hx : IsSelfAdjoint x) :
    skewAdjointPart R x = 0 := Subtype.eq <| by
  

Proof state:
R : Type u_1
A : Type u_2
inst✝⁷ : Semiring R
inst✝⁶ : StarMul R
inst✝⁵ : TrivialStar R
inst✝⁴ : AddCommGroup A
inst✝³ : Module R A
inst✝² : StarAddMonoid A
inst✝¹ : StarModule R A
inst✝ : Invertible 2
x : A
hx : IsSelfAdjoint x
⊢ ↑((skewAdjointPart R) x) = ↑0

Next tactic:
rw [skewAdjointPart_apply_coe, hx.star_eq, sub_self, smul_zero, ZeroMemClass.coe_zero]