l3lab/ntp-mathlib huggingface dataset:
theorem incMatrix_transpose_mul_diag [DecidableRel G.Adj] :
    ((G.incMatrix R)ᵀ * G.incMatrix R) e e = if e ∈ G.edgeSet then 2 else 0 := by
  classical
    simp only [Matrix.mul_apply, incMatrix_apply', transpose_apply, ite_zero_mul_ite_zero, one_mul,
      sum_boole, and_self_iff]
    split_ifs with h
    · revert h
      

Proof state:
case pos
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝² : Fintype α
inst✝¹ : NonAssocSemiring R
a b : α
e : Sym2 α
inst✝ : DecidableRel G.Adj
⊢ e ∈ edgeSet G → ↑(card (filter (fun x => e ∈ incidenceSet G x) univ)) = 2

Next tactic:
refine' e.ind _
theorem incMatrix_transpose_mul_diag [DecidableRel G.Adj] :
    ((G.incMatrix R)ᵀ * G.incMatrix R) e e = if e ∈ G.edgeSet then 2 else 0 := by
  classical
    simp only [Matrix.mul_apply, incMatrix_apply', transpose_apply, ite_zero_mul_ite_zero, one_mul,
      sum_boole, and_self_iff]
    split_ifs with h
    · revert h
      refine' e.ind _
      

Proof state:
case pos
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝² : Fintype α
inst✝¹ : NonAssocSemiring R
a b : α
e : Sym2 α
inst✝ : DecidableRel G.Adj
⊢ ∀ (x y : α), ⟦(x, y)⟧ ∈ edgeSet G → ↑(card (filter (fun x_1 => ⟦(x, y)⟧ ∈ incidenceSet G x_1) univ)) = 2

Next tactic:
intro v w h
theorem incMatrix_transpose_mul_diag [DecidableRel G.Adj] :
    ((G.incMatrix R)ᵀ * G.incMatrix R) e e = if e ∈ G.edgeSet then 2 else 0 := by
  classical
    simp only [Matrix.mul_apply, incMatrix_apply', transpose_apply, ite_zero_mul_ite_zero, one_mul,
      sum_boole, and_self_iff]
    split_ifs with h
    · revert h
      refine' e.ind _
      intro v w h
      

Proof state:
case pos
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝² : Fintype α
inst✝¹ : NonAssocSemiring R
a b : α
e : Sym2 α
inst✝ : DecidableRel G.Adj
v w : α
h : ⟦(v, w)⟧ ∈ edgeSet G
⊢ ↑(card (filter (fun x => ⟦(v, w)⟧ ∈ incidenceSet G x) univ)) = 2

Next tactic:
rw [← Nat.cast_two, ← card_doubleton (G.ne_of_adj h)]
theorem incMatrix_transpose_mul_diag [DecidableRel G.Adj] :
    ((G.incMatrix R)ᵀ * G.incMatrix R) e e = if e ∈ G.edgeSet then 2 else 0 := by
  classical
    simp only [Matrix.mul_apply, incMatrix_apply', transpose_apply, ite_zero_mul_ite_zero, one_mul,
      sum_boole, and_self_iff]
    split_ifs with h
    · revert h
      refine' e.ind _
      intro v w h
      rw [← Nat.cast_two, ← card_doubleton (G.ne_of_adj h)]
      

Proof state:
case pos
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝² : Fintype α
inst✝¹ : NonAssocSemiring R
a b : α
e : Sym2 α
inst✝ : DecidableRel G.Adj
v w : α
h : ⟦(v, w)⟧ ∈ edgeSet G
⊢ ↑(card (filter (fun x => ⟦(v, w)⟧ ∈ incidenceSet G x) univ)) = ↑(card {(v, w).1, (v, w).2})

Next tactic:
simp only [mk'_mem_incidenceSet_iff, G.mem_edgeSet.mp h, true_and, mem_univ, forall_true_left,
        forall_eq_or_imp, forall_eq, and_self, mem_singleton, ne_eq]
theorem incMatrix_transpose_mul_diag [DecidableRel G.Adj] :
    ((G.incMatrix R)ᵀ * G.incMatrix R) e e = if e ∈ G.edgeSet then 2 else 0 := by
  classical
    simp only [Matrix.mul_apply, incMatrix_apply', transpose_apply, ite_zero_mul_ite_zero, one_mul,
      sum_boole, and_self_iff]
    split_ifs with h
    · revert h
      refine' e.ind _
      intro v w h
      rw [← Nat.cast_two, ← card_doubleton (G.ne_of_adj h)]
      simp only [mk'_mem_incidenceSet_iff, G.mem_edgeSet.mp h, true_and, mem_univ, forall_true_left,
        forall_eq_or_imp, forall_eq, and_self, mem_singleton, ne_eq]
      

Proof state:
case pos
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝² : Fintype α
inst✝¹ : NonAssocSemiring R
a b : α
e : Sym2 α
inst✝ : DecidableRel G.Adj
v w : α
h : ⟦(v, w)⟧ ∈ edgeSet G
⊢ ↑(card (filter (fun x => x = v ∨ x = w) univ)) = ↑(card {v, w})

Next tactic:
congr 2
theorem incMatrix_transpose_mul_diag [DecidableRel G.Adj] :
    ((G.incMatrix R)ᵀ * G.incMatrix R) e e = if e ∈ G.edgeSet then 2 else 0 := by
  classical
    simp only [Matrix.mul_apply, incMatrix_apply', transpose_apply, ite_zero_mul_ite_zero, one_mul,
      sum_boole, and_self_iff]
    split_ifs with h
    · revert h
      refine' e.ind _
      intro v w h
      rw [← Nat.cast_two, ← card_doubleton (G.ne_of_adj h)]
      simp only [mk'_mem_incidenceSet_iff, G.mem_edgeSet.mp h, true_and, mem_univ, forall_true_left,
        forall_eq_or_imp, forall_eq, and_self, mem_singleton, ne_eq]
      congr 2
      

Proof state:
case pos.e_a.e_s
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝² : Fintype α
inst✝¹ : NonAssocSemiring R
a b : α
e : Sym2 α
inst✝ : DecidableRel G.Adj
v w : α
h : ⟦(v, w)⟧ ∈ edgeSet G
⊢ filter (fun x => x = v ∨ x = w) univ = {v, w}

Next tactic:
ext u
theorem incMatrix_transpose_mul_diag [DecidableRel G.Adj] :
    ((G.incMatrix R)ᵀ * G.incMatrix R) e e = if e ∈ G.edgeSet then 2 else 0 := by
  classical
    simp only [Matrix.mul_apply, incMatrix_apply', transpose_apply, ite_zero_mul_ite_zero, one_mul,
      sum_boole, and_self_iff]
    split_ifs with h
    · revert h
      refine' e.ind _
      intro v w h
      rw [← Nat.cast_two, ← card_doubleton (G.ne_of_adj h)]
      simp only [mk'_mem_incidenceSet_iff, G.mem_edgeSet.mp h, true_and, mem_univ, forall_true_left,
        forall_eq_or_imp, forall_eq, and_self, mem_singleton, ne_eq]
      congr 2
      ext u
      

Proof state:
case pos.e_a.e_s.a
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝² : Fintype α
inst✝¹ : NonAssocSemiring R
a b : α
e : Sym2 α
inst✝ : DecidableRel G.Adj
v w : α
h : ⟦(v, w)⟧ ∈ edgeSet G
u : α
⊢ u ∈ filter (fun x => x = v ∨ x = w) univ ↔ u ∈ {v, w}

Next tactic:
simp
theorem incMatrix_transpose_mul_diag [DecidableRel G.Adj] :
    ((G.incMatrix R)ᵀ * G.incMatrix R) e e = if e ∈ G.edgeSet then 2 else 0 := by
  classical
    simp only [Matrix.mul_apply, incMatrix_apply', transpose_apply, ite_zero_mul_ite_zero, one_mul,
      sum_boole, and_self_iff]
    split_ifs with h
    · revert h
      refine' e.ind _
      intro v w h
      rw [← Nat.cast_two, ← card_doubleton (G.ne_of_adj h)]
      simp only [mk'_mem_incidenceSet_iff, G.mem_edgeSet.mp h, true_and, mem_univ, forall_true_left,
        forall_eq_or_imp, forall_eq, and_self, mem_singleton, ne_eq]
      congr 2
      ext u
      simp
    · 

Proof state:
case neg
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝² : Fintype α
inst✝¹ : NonAssocSemiring R
a b : α
e : Sym2 α
inst✝ : DecidableRel G.Adj
h : e ∉ edgeSet G
⊢ ↑(card (filter (fun x => e ∈ incidenceSet G x) univ)) = 0

Next tactic:
revert h
theorem incMatrix_transpose_mul_diag [DecidableRel G.Adj] :
    ((G.incMatrix R)ᵀ * G.incMatrix R) e e = if e ∈ G.edgeSet then 2 else 0 := by
  classical
    simp only [Matrix.mul_apply, incMatrix_apply', transpose_apply, ite_zero_mul_ite_zero, one_mul,
      sum_boole, and_self_iff]
    split_ifs with h
    · revert h
      refine' e.ind _
      intro v w h
      rw [← Nat.cast_two, ← card_doubleton (G.ne_of_adj h)]
      simp only [mk'_mem_incidenceSet_iff, G.mem_edgeSet.mp h, true_and, mem_univ, forall_true_left,
        forall_eq_or_imp, forall_eq, and_self, mem_singleton, ne_eq]
      congr 2
      ext u
      simp
    · revert h
      

Proof state:
case neg
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝² : Fintype α
inst✝¹ : NonAssocSemiring R
a b : α
e : Sym2 α
inst✝ : DecidableRel G.Adj
⊢ e ∉ edgeSet G → ↑(card (filter (fun x => e ∈ incidenceSet G x) univ)) = 0

Next tactic:
refine' e.ind _
theorem incMatrix_transpose_mul_diag [DecidableRel G.Adj] :
    ((G.incMatrix R)ᵀ * G.incMatrix R) e e = if e ∈ G.edgeSet then 2 else 0 := by
  classical
    simp only [Matrix.mul_apply, incMatrix_apply', transpose_apply, ite_zero_mul_ite_zero, one_mul,
      sum_boole, and_self_iff]
    split_ifs with h
    · revert h
      refine' e.ind _
      intro v w h
      rw [← Nat.cast_two, ← card_doubleton (G.ne_of_adj h)]
      simp only [mk'_mem_incidenceSet_iff, G.mem_edgeSet.mp h, true_and, mem_univ, forall_true_left,
        forall_eq_or_imp, forall_eq, and_self, mem_singleton, ne_eq]
      congr 2
      ext u
      simp
    · revert h
      refine' e.ind _
      

Proof state:
case neg
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝² : Fintype α
inst✝¹ : NonAssocSemiring R
a b : α
e : Sym2 α
inst✝ : DecidableRel G.Adj
⊢ ∀ (x y : α), ⟦(x, y)⟧ ∉ edgeSet G → ↑(card (filter (fun x_1 => ⟦(x, y)⟧ ∈ incidenceSet G x_1) univ)) = 0

Next tactic:
intro v w h
theorem incMatrix_transpose_mul_diag [DecidableRel G.Adj] :
    ((G.incMatrix R)ᵀ * G.incMatrix R) e e = if e ∈ G.edgeSet then 2 else 0 := by
  classical
    simp only [Matrix.mul_apply, incMatrix_apply', transpose_apply, ite_zero_mul_ite_zero, one_mul,
      sum_boole, and_self_iff]
    split_ifs with h
    · revert h
      refine' e.ind _
      intro v w h
      rw [← Nat.cast_two, ← card_doubleton (G.ne_of_adj h)]
      simp only [mk'_mem_incidenceSet_iff, G.mem_edgeSet.mp h, true_and, mem_univ, forall_true_left,
        forall_eq_or_imp, forall_eq, and_self, mem_singleton, ne_eq]
      congr 2
      ext u
      simp
    · revert h
      refine' e.ind _
      intro v w h
      

Proof state:
case neg
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝² : Fintype α
inst✝¹ : NonAssocSemiring R
a b : α
e : Sym2 α
inst✝ : DecidableRel G.Adj
v w : α
h : ⟦(v, w)⟧ ∉ edgeSet G
⊢ ↑(card (filter (fun x => ⟦(v, w)⟧ ∈ incidenceSet G x) univ)) = 0

Next tactic:
simp [mk'_mem_incidenceSet_iff, G.mem_edgeSet.not.mp h]
theorem incMatrix_mul_transpose_apply_of_adj (h : G.Adj a b) :
    (G.incMatrix R * (G.incMatrix R)ᵀ) a b = (1 : R) := by
  

Proof state:
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝¹ : Fintype (Sym2 α)
inst✝ : Semiring R
a b : α
e : Sym2 α
h : Adj G a b
⊢ (incMatrix R G * (incMatrix R G)ᵀ) a b = 1

Next tactic:
classical
    simp_rw [Matrix.mul_apply, Matrix.transpose_apply, incMatrix_apply_mul_incMatrix_apply,
      Set.indicator_apply, Pi.one_apply, sum_boole]
    convert @Nat.cast_one R _
    convert card_singleton ⟦(a, b)⟧
    rw [← coe_eq_singleton, coe_filter_univ]
    exact G.incidenceSet_inter_incidenceSet_of_adj h
theorem incMatrix_mul_transpose_apply_of_adj (h : G.Adj a b) :
    (G.incMatrix R * (G.incMatrix R)ᵀ) a b = (1 : R) := by
  classical
    

Proof state:
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝¹ : Fintype (Sym2 α)
inst✝ : Semiring R
a b : α
e : Sym2 α
h : Adj G a b
⊢ (incMatrix R G * (incMatrix R G)ᵀ) a b = 1

Next tactic:
simp_rw [Matrix.mul_apply, Matrix.transpose_apply, incMatrix_apply_mul_incMatrix_apply,
      Set.indicator_apply, Pi.one_apply, sum_boole]
theorem incMatrix_mul_transpose_apply_of_adj (h : G.Adj a b) :
    (G.incMatrix R * (G.incMatrix R)ᵀ) a b = (1 : R) := by
  classical
    simp_rw [Matrix.mul_apply, Matrix.transpose_apply, incMatrix_apply_mul_incMatrix_apply,
      Set.indicator_apply, Pi.one_apply, sum_boole]
    

Proof state:
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝¹ : Fintype (Sym2 α)
inst✝ : Semiring R
a b : α
e : Sym2 α
h : Adj G a b
⊢ ↑(card (filter (fun x => x ∈ incidenceSet G a ∩ incidenceSet G b) univ)) = 1

Next tactic:
convert @Nat.cast_one R _
theorem incMatrix_mul_transpose_apply_of_adj (h : G.Adj a b) :
    (G.incMatrix R * (G.incMatrix R)ᵀ) a b = (1 : R) := by
  classical
    simp_rw [Matrix.mul_apply, Matrix.transpose_apply, incMatrix_apply_mul_incMatrix_apply,
      Set.indicator_apply, Pi.one_apply, sum_boole]
    convert @Nat.cast_one R _
    

Proof state:
case h.e'_2.h.e'_3
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝¹ : Fintype (Sym2 α)
inst✝ : Semiring R
a b : α
e : Sym2 α
h : Adj G a b
⊢ card (filter (fun x => x ∈ incidenceSet G a ∩ incidenceSet G b) univ) = 1

Next tactic:
convert card_singleton ⟦(a, b)⟧
theorem incMatrix_mul_transpose_apply_of_adj (h : G.Adj a b) :
    (G.incMatrix R * (G.incMatrix R)ᵀ) a b = (1 : R) := by
  classical
    simp_rw [Matrix.mul_apply, Matrix.transpose_apply, incMatrix_apply_mul_incMatrix_apply,
      Set.indicator_apply, Pi.one_apply, sum_boole]
    convert @Nat.cast_one R _
    convert card_singleton ⟦(a, b)⟧
    

Proof state:
case h.e'_2.h.e'_2.h
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝¹ : Fintype (Sym2 α)
inst✝ : Semiring R
a b : α
e : Sym2 α
h : Adj G a b
e_1✝ : Sym2 α = Quotient (Rel.setoid α)
⊢ filter (fun x => x ∈ incidenceSet G a ∩ incidenceSet G b) univ = {⟦(a, b)⟧}

Next tactic:
rw [← coe_eq_singleton, coe_filter_univ]
theorem incMatrix_mul_transpose_apply_of_adj (h : G.Adj a b) :
    (G.incMatrix R * (G.incMatrix R)ᵀ) a b = (1 : R) := by
  classical
    simp_rw [Matrix.mul_apply, Matrix.transpose_apply, incMatrix_apply_mul_incMatrix_apply,
      Set.indicator_apply, Pi.one_apply, sum_boole]
    convert @Nat.cast_one R _
    convert card_singleton ⟦(a, b)⟧
    rw [← coe_eq_singleton, coe_filter_univ]
    

Proof state:
case h.e'_2.h.e'_2.h
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝¹ : Fintype (Sym2 α)
inst✝ : Semiring R
a b : α
e : Sym2 α
h : Adj G a b
e_1✝ : Sym2 α = Quotient (Rel.setoid α)
⊢ {x | x ∈ incidenceSet G a ∩ incidenceSet G b} = {⟦(a, b)⟧}

Next tactic:
exact G.incidenceSet_inter_incidenceSet_of_adj h
theorem incMatrix_mul_transpose [Fintype α] [DecidableEq α] [DecidableRel G.Adj] :
    G.incMatrix R * (G.incMatrix R)ᵀ = fun a b =>
      if a = b then (G.degree a : R) else if G.Adj a b then 1 else 0 := by
  

Proof state:
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝⁴ : Fintype (Sym2 α)
inst✝³ : Semiring R
a b : α
e : Sym2 α
inst✝² : Fintype α
inst✝¹ : DecidableEq α
inst✝ : DecidableRel G.Adj
⊢ incMatrix R G * (incMatrix R G)ᵀ = fun a b => if a = b then ↑(degree G a) else if Adj G a b then 1 else 0

Next tactic:
ext a b
theorem incMatrix_mul_transpose [Fintype α] [DecidableEq α] [DecidableRel G.Adj] :
    G.incMatrix R * (G.incMatrix R)ᵀ = fun a b =>
      if a = b then (G.degree a : R) else if G.Adj a b then 1 else 0 := by
  ext a b
  

Proof state:
case a.h
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝⁴ : Fintype (Sym2 α)
inst✝³ : Semiring R
a✝ b✝ : α
e : Sym2 α
inst✝² : Fintype α
inst✝¹ : DecidableEq α
inst✝ : DecidableRel G.Adj
a b : α
⊢ (incMatrix R G * (incMatrix R G)ᵀ) a b = if a = b then ↑(degree G a) else if Adj G a b then 1 else 0

Next tactic:
split_ifs with h h'
theorem incMatrix_mul_transpose [Fintype α] [DecidableEq α] [DecidableRel G.Adj] :
    G.incMatrix R * (G.incMatrix R)ᵀ = fun a b =>
      if a = b then (G.degree a : R) else if G.Adj a b then 1 else 0 := by
  ext a b
  split_ifs with h h'
  · 

Proof state:
case pos
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝⁴ : Fintype (Sym2 α)
inst✝³ : Semiring R
a✝ b✝ : α
e : Sym2 α
inst✝² : Fintype α
inst✝¹ : DecidableEq α
inst✝ : DecidableRel G.Adj
a b : α
h : a = b
⊢ (incMatrix R G * (incMatrix R G)ᵀ) a b = ↑(degree G a)

Next tactic:
subst b
theorem incMatrix_mul_transpose [Fintype α] [DecidableEq α] [DecidableRel G.Adj] :
    G.incMatrix R * (G.incMatrix R)ᵀ = fun a b =>
      if a = b then (G.degree a : R) else if G.Adj a b then 1 else 0 := by
  ext a b
  split_ifs with h h'
  · subst b
    

Proof state:
case pos
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝⁴ : Fintype (Sym2 α)
inst✝³ : Semiring R
a✝ b : α
e : Sym2 α
inst✝² : Fintype α
inst✝¹ : DecidableEq α
inst✝ : DecidableRel G.Adj
a : α
⊢ (incMatrix R G * (incMatrix R G)ᵀ) a a = ↑(degree G a)

Next tactic:
rename Semiring R => sr
theorem incMatrix_mul_transpose [Fintype α] [DecidableEq α] [DecidableRel G.Adj] :
    G.incMatrix R * (G.incMatrix R)ᵀ = fun a b =>
      if a = b then (G.degree a : R) else if G.Adj a b then 1 else 0 := by
  ext a b
  split_ifs with h h'
  · subst b
    rename Semiring R => sr
    

Proof state:
case pos
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝³ : Fintype (Sym2 α)
sr : Semiring R
a✝ b : α
e : Sym2 α
inst✝² : Fintype α
inst✝¹ : DecidableEq α
inst✝ : DecidableRel G.Adj
a : α
⊢ (incMatrix R G * (incMatrix R G)ᵀ) a a = ↑(degree G a)

Next tactic:
convert @incMatrix_mul_transpose_diag _ _ _ _ sr.toNonAssocSemiring _ _ _
theorem incMatrix_mul_transpose [Fintype α] [DecidableEq α] [DecidableRel G.Adj] :
    G.incMatrix R * (G.incMatrix R)ᵀ = fun a b =>
      if a = b then (G.degree a : R) else if G.Adj a b then 1 else 0 := by
  ext a b
  split_ifs with h h'
  · subst b
    rename Semiring R => sr
    convert @incMatrix_mul_transpose_diag _ _ _ _ sr.toNonAssocSemiring _ _ _
  · 

Proof state:
case pos
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝⁴ : Fintype (Sym2 α)
inst✝³ : Semiring R
a✝ b✝ : α
e : Sym2 α
inst✝² : Fintype α
inst✝¹ : DecidableEq α
inst✝ : DecidableRel G.Adj
a b : α
h : ¬a = b
h' : Adj G a b
⊢ (incMatrix R G * (incMatrix R G)ᵀ) a b = 1

Next tactic:
exact G.incMatrix_mul_transpose_apply_of_adj h'
theorem incMatrix_mul_transpose [Fintype α] [DecidableEq α] [DecidableRel G.Adj] :
    G.incMatrix R * (G.incMatrix R)ᵀ = fun a b =>
      if a = b then (G.degree a : R) else if G.Adj a b then 1 else 0 := by
  ext a b
  split_ifs with h h'
  · subst b
    rename Semiring R => sr
    convert @incMatrix_mul_transpose_diag _ _ _ _ sr.toNonAssocSemiring _ _ _
  · exact G.incMatrix_mul_transpose_apply_of_adj h'
  · 

Proof state:
case neg
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝⁴ : Fintype (Sym2 α)
inst✝³ : Semiring R
a✝ b✝ : α
e : Sym2 α
inst✝² : Fintype α
inst✝¹ : DecidableEq α
inst✝ : DecidableRel G.Adj
a b : α
h : ¬a = b
h' : ¬Adj G a b
⊢ (incMatrix R G * (incMatrix R G)ᵀ) a b = 0

Next tactic:
simp only [Matrix.mul_apply, Matrix.transpose_apply,
      G.incMatrix_apply_mul_incMatrix_apply_of_not_adj h h', sum_const_zero]
theorem expSeries_apply_eq (x : 𝔸) (n : ℕ) : (expSeries 𝕂 𝔸 n fun _ => x) = (n !⁻¹ : 𝕂) • x ^ n :=
  by 

Proof state:
𝕂 : Type u_1
𝔸 : Type u_2
inst✝⁴ : Field 𝕂
inst✝³ : Ring 𝔸
inst✝² : Algebra 𝕂 𝔸
inst✝¹ : TopologicalSpace 𝔸
inst✝ : TopologicalRing 𝔸
x : 𝔸
n : ℕ
⊢ ((expSeries 𝕂 𝔸 n) fun x_1 => x) = (↑n !)⁻¹ • x ^ n

Next tactic:
simp [expSeries]
theorem expSeries_apply_zero (n : ℕ) :
    (expSeries 𝕂 𝔸 n fun _ => (0 : 𝔸)) = Pi.single (f := fun _ => 𝔸) 0 1 n := by
  

Proof state:
𝕂 : Type u_1
𝔸 : Type u_2
inst✝⁴ : Field 𝕂
inst✝³ : Ring 𝔸
inst✝² : Algebra 𝕂 𝔸
inst✝¹ : TopologicalSpace 𝔸
inst✝ : TopologicalRing 𝔸
n : ℕ
⊢ ((expSeries 𝕂 𝔸 n) fun x => 0) = Pi.single 0 1 n

Next tactic:
rw [expSeries_apply_eq]
theorem expSeries_apply_zero (n : ℕ) :
    (expSeries 𝕂 𝔸 n fun _ => (0 : 𝔸)) = Pi.single (f := fun _ => 𝔸) 0 1 n := by
  rw [expSeries_apply_eq]
  

Proof state:
𝕂 : Type u_1
𝔸 : Type u_2
inst✝⁴ : Field 𝕂
inst✝³ : Ring 𝔸
inst✝² : Algebra 𝕂 𝔸
inst✝¹ : TopologicalSpace 𝔸
inst✝ : TopologicalRing 𝔸
n : ℕ
⊢ (↑n !)⁻¹ • 0 ^ n = Pi.single 0 1 n

Next tactic:
cases' n with n
theorem expSeries_apply_zero (n : ℕ) :
    (expSeries 𝕂 𝔸 n fun _ => (0 : 𝔸)) = Pi.single (f := fun _ => 𝔸) 0 1 n := by
  rw [expSeries_apply_eq]
  cases' n with n
  · 

Proof state:
case zero
𝕂 : Type u_1
𝔸 : Type u_2
inst✝⁴ : Field 𝕂
inst✝³ : Ring 𝔸
inst✝² : Algebra 𝕂 𝔸
inst✝¹ : TopologicalSpace 𝔸
inst✝ : TopologicalRing 𝔸
⊢ (↑Nat.zero !)⁻¹ • 0 ^ Nat.zero = Pi.single 0 1 Nat.zero

Next tactic:
rw [pow_zero, Nat.factorial_zero, Nat.cast_one, inv_one, one_smul, Pi.single_eq_same]
theorem expSeries_apply_zero (n : ℕ) :
    (expSeries 𝕂 𝔸 n fun _ => (0 : 𝔸)) = Pi.single (f := fun _ => 𝔸) 0 1 n := by
  rw [expSeries_apply_eq]
  cases' n with n
  · rw [pow_zero, Nat.factorial_zero, Nat.cast_one, inv_one, one_smul, Pi.single_eq_same]
  · 

Proof state:
case succ
𝕂 : Type u_1
𝔸 : Type u_2
inst✝⁴ : Field 𝕂
inst✝³ : Ring 𝔸
inst✝² : Algebra 𝕂 𝔸
inst✝¹ : TopologicalSpace 𝔸
inst✝ : TopologicalRing 𝔸
n : ℕ
⊢ (↑(Nat.succ n)!)⁻¹ • 0 ^ Nat.succ n = Pi.single 0 1 (Nat.succ n)

Next tactic:
rw [zero_pow (Nat.succ_pos _), smul_zero, Pi.single_eq_of_ne n.succ_ne_zero]
@[simp]
theorem exp_zero : exp 𝕂 (0 : 𝔸) = 1 := by
  

Proof state:
𝕂 : Type u_1
𝔸 : Type u_2
inst✝⁴ : Field 𝕂
inst✝³ : Ring 𝔸
inst✝² : Algebra 𝕂 𝔸
inst✝¹ : TopologicalSpace 𝔸
inst✝ : TopologicalRing 𝔸
⊢ exp 𝕂 0 = 1

Next tactic:
simp_rw [exp_eq_tsum, ← expSeries_apply_eq, expSeries_apply_zero, tsum_pi_single]
@[simp]
theorem exp_op [T2Space 𝔸] (x : 𝔸) : exp 𝕂 (MulOpposite.op x) = MulOpposite.op (exp 𝕂 x) := by
  

Proof state:
𝕂 : Type u_1
𝔸 : Type u_2
inst✝⁵ : Field 𝕂
inst✝⁴ : Ring 𝔸
inst✝³ : Algebra 𝕂 𝔸
inst✝² : TopologicalSpace 𝔸
inst✝¹ : TopologicalRing 𝔸
inst✝ : T2Space 𝔸
x : 𝔸
⊢ exp 𝕂 (MulOpposite.op x) = MulOpposite.op (exp 𝕂 x)

Next tactic:
simp_rw [exp, expSeries_sum_eq, ← MulOpposite.op_pow, ← MulOpposite.op_smul, tsum_op]
@[simp]
theorem exp_unop [T2Space 𝔸] (x : 𝔸ᵐᵒᵖ) : exp 𝕂 (MulOpposite.unop x) = MulOpposite.unop (exp 𝕂 x) :=
  by 

Proof state:
𝕂 : Type u_1
𝔸 : Type u_2
inst✝⁵ : Field 𝕂
inst✝⁴ : Ring 𝔸
inst✝³ : Algebra 𝕂 𝔸
inst✝² : TopologicalSpace 𝔸
inst✝¹ : TopologicalRing 𝔸
inst✝ : T2Space 𝔸
x : 𝔸ᵐᵒᵖ
⊢ exp 𝕂 (MulOpposite.unop x) = MulOpposite.unop (exp 𝕂 x)

Next tactic:
simp_rw [exp, expSeries_sum_eq, ← MulOpposite.unop_pow, ← MulOpposite.unop_smul, tsum_unop]
theorem star_exp [T2Space 𝔸] [StarRing 𝔸] [ContinuousStar 𝔸] (x : 𝔸) :
    star (exp 𝕂 x) = exp 𝕂 (star x) := by
  

Proof state:
𝕂 : Type u_1
𝔸 : Type u_2
inst✝⁷ : Field 𝕂
inst✝⁶ : Ring 𝔸
inst✝⁵ : Algebra 𝕂 𝔸
inst✝⁴ : TopologicalSpace 𝔸
inst✝³ : TopologicalRing 𝔸
inst✝² : T2Space 𝔸
inst✝¹ : StarRing 𝔸
inst✝ : ContinuousStar 𝔸
x : 𝔸
⊢ star (exp 𝕂 x) = exp 𝕂 (star x)

Next tactic:
simp_rw [exp_eq_tsum, ← star_pow, ← star_inv_nat_cast_smul, ← tsum_star]
theorem _root_.Commute.exp_right [T2Space 𝔸] {x y : 𝔸} (h : Commute x y) :
    Commute x (exp 𝕂 y) := by
  

Proof state:
𝕂 : Type u_1
𝔸 : Type u_2
inst✝⁵ : Field 𝕂
inst✝⁴ : Ring 𝔸
inst✝³ : Algebra 𝕂 𝔸
inst✝² : TopologicalSpace 𝔸
inst✝¹ : TopologicalRing 𝔸
inst✝ : T2Space 𝔸
x y : 𝔸
h : Commute x y
⊢ Commute x (exp 𝕂 y)

Next tactic:
rw [exp_eq_tsum]
theorem _root_.Commute.exp_right [T2Space 𝔸] {x y : 𝔸} (h : Commute x y) :
    Commute x (exp 𝕂 y) := by
  rw [exp_eq_tsum]
  

Proof state:
𝕂 : Type u_1
𝔸 : Type u_2
inst✝⁵ : Field 𝕂
inst✝⁴ : Ring 𝔸
inst✝³ : Algebra 𝕂 𝔸
inst✝² : TopologicalSpace 𝔸
inst✝¹ : TopologicalRing 𝔸
inst✝ : T2Space 𝔸
x y : 𝔸
h : Commute x y
⊢ Commute x ((fun x => ∑' (n : ℕ), (↑n !)⁻¹ • x ^ n) y)

Next tactic:
exact Commute.tsum_right x fun n => (h.pow_right n).smul_right _
theorem expSeries_apply_eq_div (x : 𝔸) (n : ℕ) : (expSeries 𝕂 𝔸 n fun _ => x) = x ^ n / n ! := by
  

Proof state:
𝕂 : Type u_1
𝔸 : Type u_2
inst✝⁴ : Field 𝕂
inst✝³ : DivisionRing 𝔸
inst✝² : Algebra 𝕂 𝔸
inst✝¹ : TopologicalSpace 𝔸
inst✝ : TopologicalRing 𝔸
x : 𝔸
n : ℕ
⊢ ((expSeries 𝕂 𝔸 n) fun x_1 => x) = x ^ n / ↑n !

Next tactic:
rw [div_eq_mul_inv, ← (Nat.cast_commute n ! (x ^ n)).inv_left₀.eq, ← smul_eq_mul,
    expSeries_apply_eq, inv_nat_cast_smul_eq 𝕂 𝔸]
theorem norm_expSeries_summable_of_mem_ball' (x : 𝔸)
    (hx : x ∈ EMetric.ball (0 : 𝔸) (expSeries 𝕂 𝔸).radius) :
    Summable fun n => ‖(n !⁻¹ : 𝕂) • x ^ n‖ := by
  

Proof state:
𝕂 : Type u_1
𝔸 : Type u_2
𝔹 : Type u_3
inst✝⁴ : NontriviallyNormedField 𝕂
inst✝³ : NormedRing 𝔸
inst✝² : NormedRing 𝔹
inst✝¹ : NormedAlgebra 𝕂 𝔸
inst✝ : NormedAlgebra 𝕂 𝔹
x : 𝔸
hx : x ∈ EMetric.ball 0 (FormalMultilinearSeries.radius (expSeries 𝕂 𝔸))
⊢ Summable fun n => ‖(↑n !)⁻¹ • x ^ n‖

Next tactic:
change Summable (norm ∘ _)
theorem norm_expSeries_summable_of_mem_ball' (x : 𝔸)
    (hx : x ∈ EMetric.ball (0 : 𝔸) (expSeries 𝕂 𝔸).radius) :
    Summable fun n => ‖(n !⁻¹ : 𝕂) • x ^ n‖ := by
  change Summable (norm ∘ _)
  

Proof state:
𝕂 : Type u_1
𝔸 : Type u_2
𝔹 : Type u_3
inst✝⁴ : NontriviallyNormedField 𝕂
inst✝³ : NormedRing 𝔸
inst✝² : NormedRing 𝔹
inst✝¹ : NormedAlgebra 𝕂 𝔸
inst✝ : NormedAlgebra 𝕂 𝔹
x : 𝔸
hx : x ∈ EMetric.ball 0 (FormalMultilinearSeries.radius (expSeries 𝕂 𝔸))
⊢ Summable (norm ∘ fun n => (↑n !)⁻¹ • x ^ n)

Next tactic:
rw [← expSeries_apply_eq']
theorem norm_expSeries_summable_of_mem_ball' (x : 𝔸)
    (hx : x ∈ EMetric.ball (0 : 𝔸) (expSeries 𝕂 𝔸).radius) :
    Summable fun n => ‖(n !⁻¹ : 𝕂) • x ^ n‖ := by
  change Summable (norm ∘ _)
  rw [← expSeries_apply_eq']
  

Proof state:
𝕂 : Type u_1
𝔸 : Type u_2
𝔹 : Type u_3
inst✝⁴ : NontriviallyNormedField 𝕂
inst✝³ : NormedRing 𝔸
inst✝² : NormedRing 𝔹
inst✝¹ : NormedAlgebra 𝕂 𝔸
inst✝ : NormedAlgebra 𝕂 𝔹
x : 𝔸
hx : x ∈ EMetric.ball 0 (FormalMultilinearSeries.radius (expSeries 𝕂 𝔸))
⊢ Summable (norm ∘ fun n => (expSeries 𝕂 𝔸 n) fun x_1 => x)

Next tactic:
exact norm_expSeries_summable_of_mem_ball x hx