l3lab/ntp-mathlib huggingface dataset:
theorem div {x y : R} (hx : IsSelfAdjoint x) (hy : IsSelfAdjoint y) : IsSelfAdjoint (x / y) := by
  

Proof state:
R : Type u_1
A : Type u_2
inst✝¹ : Semifield R
inst✝ : StarRing R
x y : R
hx : IsSelfAdjoint x
hy : IsSelfAdjoint y
⊢ IsSelfAdjoint (x / y)

Next tactic:
simp only [isSelfAdjoint_iff, star_div', hx.star_eq, hy.star_eq]
theorem smul {r : R} (hr : IsSelfAdjoint r) {x : A} (hx : IsSelfAdjoint x) :
    IsSelfAdjoint (r • x) := by 

Proof state:
R : Type u_1
A : Type u_2
inst✝⁴ : Star R
inst✝³ : AddMonoid A
inst✝² : StarAddMonoid A
inst✝¹ : SMul R A
inst✝ : StarModule R A
r : R
hr : IsSelfAdjoint r
x : A
hx : IsSelfAdjoint x
⊢ IsSelfAdjoint (r • x)

Next tactic:
simp only [isSelfAdjoint_iff, star_smul, hr.star_eq, hx.star_eq]
/-- The skew-adjoint elements of a star additive group, as an additive subgroup. -/
def skewAdjoint [AddCommGroup R] [StarAddMonoid R] : AddSubgroup R where
  carrier := { x | star x = -x }
  zero_mem' := show star (0 : R) = -0 by simp only [star_zero, neg_zero]
  add_mem' := @fun x y (hx : star x = -x) (hy : star y = -y) =>
    show star (x + y) = -(x + y) by 

Proof state:
R : Type u_1
A : Type u_2
inst✝¹ : AddCommGroup R
inst✝ : StarAddMonoid R
x y : R
hx : star x = -x
hy : star y = -y
⊢ star (x + y) = -(x + y)

Next tactic:
rw [star_add x y, hx, hy, neg_add]
/-- The skew-adjoint elements of a star additive group, as an additive subgroup. -/
def skewAdjoint [AddCommGroup R] [StarAddMonoid R] : AddSubgroup R where
  carrier := { x | star x = -x }
  zero_mem' := show star (0 : R) = -0 by 

Proof state:
R : Type u_1
A : Type u_2
inst✝¹ : AddCommGroup R
inst✝ : StarAddMonoid R
⊢ star 0 = -0

Next tactic:
simp only [star_zero, neg_zero]
/-- The skew-adjoint elements of a star additive group, as an additive subgroup. -/
def skewAdjoint [AddCommGroup R] [StarAddMonoid R] : AddSubgroup R where
  carrier := { x | star x = -x }
  zero_mem' := show star (0 : R) = -0 by simp only [star_zero, neg_zero]
  add_mem' := @fun x y (hx : star x = -x) (hy : star y = -y) =>
    show star (x + y) = -(x + y) by rw [star_add x y, hx, hy, neg_add]
  neg_mem' := @fun x (hx : star x = -x) => show star (-x) = - -x by 

Proof state:
R : Type u_1
A : Type u_2
inst✝¹ : AddCommGroup R
inst✝ : StarAddMonoid R
x : R
hx : star x = -x
⊢ star (-x) = - -x

Next tactic:
simp only [hx, star_neg]
theorem mem_iff {x : R} : x ∈ selfAdjoint R ↔ star x = x := by
  

Proof state:
R : Type u_1
A : Type u_2
inst✝¹ : AddGroup R
inst✝ : StarAddMonoid R
x : R
⊢ x ∈ selfAdjoint R ↔ star x = x

Next tactic:
rw [← AddSubgroup.mem_carrier]
theorem mem_iff {x : R} : x ∈ selfAdjoint R ↔ star x = x := by
  rw [← AddSubgroup.mem_carrier]
  

Proof state:
R : Type u_1
A : Type u_2
inst✝¹ : AddGroup R
inst✝ : StarAddMonoid R
x : R
⊢ x ∈ (selfAdjoint R).toAddSubmonoid.toAddSubsemigroup.carrier ↔ star x = x

Next tactic:
exact Iff.rfl
instance instQSMul : SMul ℚ (selfAdjoint R) where
  smul a x :=
    ⟨a • (x : R), by 

Proof state:
R : Type u_1
A : Type u_2
inst✝¹ : Field R
inst✝ : StarRing R
a : ℚ
x : ↥(selfAdjoint R)
⊢ a • ↑x ∈ selfAdjoint R

Next tactic:
rw [Rat.smul_def]
instance instQSMul : SMul ℚ (selfAdjoint R) where
  smul a x :=
    ⟨a • (x : R), by rw [Rat.smul_def]; 

Proof state:
R : Type u_1
A : Type u_2
inst✝¹ : Field R
inst✝ : StarRing R
a : ℚ
x : ↥(selfAdjoint R)
⊢ ↑a * ↑x ∈ selfAdjoint R

Next tactic:
exact IsSelfAdjoint.mul (isSelfAdjoint_ratCast a) x.prop
theorem mem_iff {x : R} : x ∈ skewAdjoint R ↔ star x = -x := by
  

Proof state:
R : Type u_1
A : Type u_2
inst✝¹ : AddCommGroup R
inst✝ : StarAddMonoid R
x : R
⊢ x ∈ skewAdjoint R ↔ star x = -x

Next tactic:
rw [← AddSubgroup.mem_carrier]
theorem mem_iff {x : R} : x ∈ skewAdjoint R ↔ star x = -x := by
  rw [← AddSubgroup.mem_carrier]
  

Proof state:
R : Type u_1
A : Type u_2
inst✝¹ : AddCommGroup R
inst✝ : StarAddMonoid R
x : R
⊢ x ∈ (skewAdjoint R).toAddSubmonoid.toAddSubsemigroup.carrier ↔ star x = -x

Next tactic:
exact Iff.rfl
set_option linter.deprecated false in
@[deprecated]
theorem bit0_mem {x : R} (hx : x ∈ skewAdjoint R) : bit0 x ∈ skewAdjoint R := by
  

Proof state:
R : Type u_1
A : Type u_2
inst✝¹ : AddCommGroup R
inst✝ : StarAddMonoid R
x : R
hx : x ∈ skewAdjoint R
⊢ bit0 x ∈ skewAdjoint R

Next tactic:
rw [mem_iff, star_bit0, mem_iff.mp hx, bit0, bit0, neg_add]
theorem conjugate {x : R} (hx : x ∈ skewAdjoint R) (z : R) : z * x * star z ∈ skewAdjoint R := by
  

Proof state:
R : Type u_1
A : Type u_2
inst✝¹ : Ring R
inst✝ : StarRing R
x : R
hx : x ∈ skewAdjoint R
z : R
⊢ z * x * star z ∈ skewAdjoint R

Next tactic:
simp only [mem_iff, star_mul, star_star, mem_iff.mp hx, neg_mul, mul_neg, mul_assoc]
theorem conjugate' {x : R} (hx : x ∈ skewAdjoint R) (z : R) : star z * x * z ∈ skewAdjoint R := by
  

Proof state:
R : Type u_1
A : Type u_2
inst✝¹ : Ring R
inst✝ : StarRing R
x : R
hx : x ∈ skewAdjoint R
z : R
⊢ star z * x * z ∈ skewAdjoint R

Next tactic:
simp only [mem_iff, star_mul, star_star, mem_iff.mp hx, neg_mul, mul_neg, mul_assoc]
theorem isStarNormal_of_mem {x : R} (hx : x ∈ skewAdjoint R) : IsStarNormal x :=
  ⟨by
    

Proof state:
R : Type u_1
A : Type u_2
inst✝¹ : Ring R
inst✝ : StarRing R
x : R
hx : x ∈ skewAdjoint R
⊢ Commute (star x) x

Next tactic:
simp only [mem_iff] at hx
theorem isStarNormal_of_mem {x : R} (hx : x ∈ skewAdjoint R) : IsStarNormal x :=
  ⟨by
    simp only [mem_iff] at hx
    

Proof state:
R : Type u_1
A : Type u_2
inst✝¹ : Ring R
inst✝ : StarRing R
x : R
hx : star x = -x
⊢ Commute (star x) x

Next tactic:
simp only [hx, Commute.neg_left, Commute.refl]
@[aesop safe apply (rule_sets [SetLike])]
theorem smul_mem [Monoid R] [DistribMulAction R A] [StarModule R A] (r : R) {x : A}
    (h : x ∈ skewAdjoint A) : r • x ∈ skewAdjoint A := by
  

Proof state:
R : Type u_1
A : Type u_2
inst✝⁶ : Star R
inst✝⁵ : TrivialStar R
inst✝⁴ : AddCommGroup A
inst✝³ : StarAddMonoid A
inst✝² : Monoid R
inst✝¹ : DistribMulAction R A
inst✝ : StarModule R A
r : R
x : A
h : x ∈ skewAdjoint A
⊢ r • x ∈ skewAdjoint A

Next tactic:
rw [mem_iff, star_smul, star_trivial, mem_iff.mp h, smul_neg r]
instance isStarNormal_zero [Semiring R] [StarRing R] : IsStarNormal (0 : R) :=
  ⟨by 

Proof state:
R : Type u_1
A : Type u_2
inst✝¹ : Semiring R
inst✝ : StarRing R
⊢ Commute (star 0) 0

Next tactic:
simp only [Commute.refl, star_comm_self, star_zero]
instance isStarNormal_one [MulOneClass R] [StarMul R] : IsStarNormal (1 : R) :=
  ⟨by 

Proof state:
R : Type u_1
A : Type u_2
inst✝¹ : MulOneClass R
inst✝ : StarMul R
⊢ Commute (star 1) 1

Next tactic:
simp only [Commute.refl, star_comm_self, star_one]
instance isStarNormal_star_self [Mul R] [StarMul R] {x : R} [IsStarNormal x] :
    IsStarNormal (star x) :=
  ⟨show star (star x) * star x = star x * star (star x) by 

Proof state:
R : Type u_1
A : Type u_2
inst✝² : Mul R
inst✝¹ : StarMul R
x : R
inst✝ : IsStarNormal x
⊢ star (star x) * star x = star x * star (star x)

Next tactic:
rw [star_star, star_comm_self']
instance (priority := 100) TrivialStar.isStarNormal [Mul R] [StarMul R] [TrivialStar R]
    {x : R} : IsStarNormal x :=
  ⟨by 

Proof state:
R : Type u_1
A : Type u_2
inst✝² : Mul R
inst✝¹ : StarMul R
inst✝ : TrivialStar R
x : R
⊢ Commute (star x) x

Next tactic:
rw [star_trivial]
theorem tendsto_iff_forall_eval_tendsto {l : Filter α} {f : α → WeakBilin B} {x : WeakBilin B}
    (hB : Function.Injective B) :
    Tendsto f l (𝓝 x) ↔ ∀ y, Tendsto (fun i => B (f i) y) l (𝓝 (B x y)) := by
  

Proof state:
α : Type u_1
𝕜 : Type u_2
𝕝 : Type u_3
R : Type u_4
E : Type u_5
F : Type u_6
M : Type u_7
inst✝⁵ : TopologicalSpace 𝕜
inst✝⁴ : CommSemiring 𝕜
inst✝³ : AddCommMonoid E
inst✝² : Module 𝕜 E
inst✝¹ : AddCommMonoid F
inst✝ : Module 𝕜 F
B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜
l : Filter α
f : α → WeakBilin B
x : WeakBilin B
hB : Function.Injective ⇑B
⊢ Tendsto f l (𝓝 x) ↔ ∀ (y : F), Tendsto (fun i => (B (f i)) y) l (𝓝 ((B x) y))

Next tactic:
rw [← tendsto_pi_nhds, Embedding.tendsto_nhds_iff (embedding hB)]
theorem tendsto_iff_forall_eval_tendsto {l : Filter α} {f : α → WeakBilin B} {x : WeakBilin B}
    (hB : Function.Injective B) :
    Tendsto f l (𝓝 x) ↔ ∀ y, Tendsto (fun i => B (f i) y) l (𝓝 (B x y)) := by
  rw [← tendsto_pi_nhds, Embedding.tendsto_nhds_iff (embedding hB)]
  

Proof state:
α : Type u_1
𝕜 : Type u_2
𝕝 : Type u_3
R : Type u_4
E : Type u_5
F : Type u_6
M : Type u_7
inst✝⁵ : TopologicalSpace 𝕜
inst✝⁴ : CommSemiring 𝕜
inst✝³ : AddCommMonoid E
inst✝² : Module 𝕜 E
inst✝¹ : AddCommMonoid F
inst✝ : Module 𝕜 F
B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜
l : Filter α
f : α → WeakBilin B
x : WeakBilin B
hB : Function.Injective ⇑B
⊢ Tendsto ((fun x y => (B x) y) ∘ f) l (𝓝 fun y => (B x) y) ↔ Tendsto (fun i y => (B (f i)) y) l (𝓝 fun y => (B x) y)

Next tactic:
rfl
/-- Addition in `WeakBilin B` is continuous. -/
instance instContinuousAdd [ContinuousAdd 𝕜] : ContinuousAdd (WeakBilin B) := by
  

Proof state:
α : Type u_1
𝕜 : Type u_2
𝕝 : Type u_3
R : Type u_4
E : Type u_5
F : Type u_6
M : Type u_7
inst✝⁶ : TopologicalSpace 𝕜
inst✝⁵ : CommSemiring 𝕜
inst✝⁴ : AddCommMonoid E
inst✝³ : Module 𝕜 E
inst✝² : AddCommMonoid F
inst✝¹ : Module 𝕜 F
B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜
inst✝ : ContinuousAdd 𝕜
⊢ ContinuousAdd (WeakBilin B)

Next tactic:
refine' ⟨continuous_induced_rng.2 _⟩
/-- Addition in `WeakBilin B` is continuous. -/
instance instContinuousAdd [ContinuousAdd 𝕜] : ContinuousAdd (WeakBilin B) := by
  refine' ⟨continuous_induced_rng.2 _⟩
  

Proof state:
α : Type u_1
𝕜 : Type u_2
𝕝 : Type u_3
R : Type u_4
E : Type u_5
F : Type u_6
M : Type u_7
inst✝⁶ : TopologicalSpace 𝕜
inst✝⁵ : CommSemiring 𝕜
inst✝⁴ : AddCommMonoid E
inst✝³ : Module 𝕜 E
inst✝² : AddCommMonoid F
inst✝¹ : Module 𝕜 F
B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜
inst✝ : ContinuousAdd 𝕜
⊢ Continuous ((fun x y => (B x) y) ∘ fun p => p.1 + p.2)

Next tactic:
refine'
    cast (congr_arg _ _)
      (((coeFn_continuous B).comp continuous_fst).add ((coeFn_continuous B).comp continuous_snd))
/-- Addition in `WeakBilin B` is continuous. -/
instance instContinuousAdd [ContinuousAdd 𝕜] : ContinuousAdd (WeakBilin B) := by
  refine' ⟨continuous_induced_rng.2 _⟩
  refine'
    cast (congr_arg _ _)
      (((coeFn_continuous B).comp continuous_fst).add ((coeFn_continuous B).comp continuous_snd))
  

Proof state:
α : Type u_1
𝕜 : Type u_2
𝕝 : Type u_3
R : Type u_4
E : Type u_5
F : Type u_6
M : Type u_7
inst✝⁶ : TopologicalSpace 𝕜
inst✝⁵ : CommSemiring 𝕜
inst✝⁴ : AddCommMonoid E
inst✝³ : Module 𝕜 E
inst✝² : AddCommMonoid F
inst✝¹ : Module 𝕜 F
B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜
inst✝ : ContinuousAdd 𝕜
⊢ (fun x => ((fun x y => (B x) y) ∘ Prod.fst) x + ((fun x y => (B x) y) ∘ Prod.snd) x) =
    (fun x y => (B x) y) ∘ fun p => p.1 + p.2

Next tactic:
ext
/-- Addition in `WeakBilin B` is continuous. -/
instance instContinuousAdd [ContinuousAdd 𝕜] : ContinuousAdd (WeakBilin B) := by
  refine' ⟨continuous_induced_rng.2 _⟩
  refine'
    cast (congr_arg _ _)
      (((coeFn_continuous B).comp continuous_fst).add ((coeFn_continuous B).comp continuous_snd))
  ext
  

Proof state:
case h.h
α : Type u_1
𝕜 : Type u_2
𝕝 : Type u_3
R : Type u_4
E : Type u_5
F : Type u_6
M : Type u_7
inst✝⁶ : TopologicalSpace 𝕜
inst✝⁵ : CommSemiring 𝕜
inst✝⁴ : AddCommMonoid E
inst✝³ : Module 𝕜 E
inst✝² : AddCommMonoid F
inst✝¹ : Module 𝕜 F
B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜
inst✝ : ContinuousAdd 𝕜
x✝¹ : WeakBilin B × WeakBilin B
x✝ : F
⊢ (((fun x y => (B x) y) ∘ Prod.fst) x✝¹ + ((fun x y => (B x) y) ∘ Prod.snd) x✝¹) x✝ =
    ((fun x y => (B x) y) ∘ fun p => p.1 + p.2) x✝¹ x✝

Next tactic:
simp only [Function.comp_apply, Pi.add_apply, map_add, LinearMap.add_apply]
/-- Scalar multiplication by `𝕜` on `WeakBilin B` is continuous. -/
instance instContinuousSMul [ContinuousSMul 𝕜 𝕜] : ContinuousSMul 𝕜 (WeakBilin B) := by
  

Proof state:
α : Type u_1
𝕜 : Type u_2
𝕝 : Type u_3
R : Type u_4
E : Type u_5
F : Type u_6
M : Type u_7
inst✝⁶ : TopologicalSpace 𝕜
inst✝⁵ : CommSemiring 𝕜
inst✝⁴ : AddCommMonoid E
inst✝³ : Module 𝕜 E
inst✝² : AddCommMonoid F
inst✝¹ : Module 𝕜 F
B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜
inst✝ : ContinuousSMul 𝕜 𝕜
⊢ ContinuousSMul 𝕜 (WeakBilin B)

Next tactic:
refine' ⟨continuous_induced_rng.2 _⟩
/-- Scalar multiplication by `𝕜` on `WeakBilin B` is continuous. -/
instance instContinuousSMul [ContinuousSMul 𝕜 𝕜] : ContinuousSMul 𝕜 (WeakBilin B) := by
  refine' ⟨continuous_induced_rng.2 _⟩
  

Proof state:
α : Type u_1
𝕜 : Type u_2
𝕝 : Type u_3
R : Type u_4
E : Type u_5
F : Type u_6
M : Type u_7
inst✝⁶ : TopologicalSpace 𝕜
inst✝⁵ : CommSemiring 𝕜
inst✝⁴ : AddCommMonoid E
inst✝³ : Module 𝕜 E
inst✝² : AddCommMonoid F
inst✝¹ : Module 𝕜 F
B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜
inst✝ : ContinuousSMul 𝕜 𝕜
⊢ Continuous ((fun x y => (B x) y) ∘ fun p => p.1 • p.2)

Next tactic:
refine' cast (congr_arg _ _) (continuous_fst.smul ((coeFn_continuous B).comp continuous_snd))
/-- Scalar multiplication by `𝕜` on `WeakBilin B` is continuous. -/
instance instContinuousSMul [ContinuousSMul 𝕜 𝕜] : ContinuousSMul 𝕜 (WeakBilin B) := by
  refine' ⟨continuous_induced_rng.2 _⟩
  refine' cast (congr_arg _ _) (continuous_fst.smul ((coeFn_continuous B).comp continuous_snd))
  

Proof state:
α : Type u_1
𝕜 : Type u_2
𝕝 : Type u_3
R : Type u_4
E : Type u_5
F : Type u_6
M : Type u_7
inst✝⁶ : TopologicalSpace 𝕜
inst✝⁵ : CommSemiring 𝕜
inst✝⁴ : AddCommMonoid E
inst✝³ : Module 𝕜 E
inst✝² : AddCommMonoid F
inst✝¹ : Module 𝕜 F
B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜
inst✝ : ContinuousSMul 𝕜 𝕜
⊢ (fun x => x.1 • ((fun x y => (B x) y) ∘ Prod.snd) x) = (fun x y => (B x) y) ∘ fun p => p.1 • p.2

Next tactic:
ext
/-- Scalar multiplication by `𝕜` on `WeakBilin B` is continuous. -/
instance instContinuousSMul [ContinuousSMul 𝕜 𝕜] : ContinuousSMul 𝕜 (WeakBilin B) := by
  refine' ⟨continuous_induced_rng.2 _⟩
  refine' cast (congr_arg _ _) (continuous_fst.smul ((coeFn_continuous B).comp continuous_snd))
  ext
  

Proof state:
case h.h
α : Type u_1
𝕜 : Type u_2
𝕝 : Type u_3
R : Type u_4
E : Type u_5
F : Type u_6
M : Type u_7
inst✝⁶ : TopologicalSpace 𝕜
inst✝⁵ : CommSemiring 𝕜
inst✝⁴ : AddCommMonoid E
inst✝³ : Module 𝕜 E
inst✝² : AddCommMonoid F
inst✝¹ : Module 𝕜 F
B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜
inst✝ : ContinuousSMul 𝕜 𝕜
x✝¹ : 𝕜 × WeakBilin B
x✝ : F
⊢ (x✝¹.1 • ((fun x y => (B x) y) ∘ Prod.snd) x✝¹) x✝ = ((fun x y => (B x) y) ∘ fun p => p.1 • p.2) x✝¹ x✝

Next tactic:
simp only [Function.comp_apply, Pi.smul_apply, LinearMap.map_smulₛₗ, RingHom.id_apply,
    LinearMap.smul_apply]
/-- `WeakBilin B` is a `TopologicalAddGroup`, meaning that addition and negation are
continuous. -/
instance instTopologicalAddGroup [ContinuousAdd 𝕜] : TopologicalAddGroup (WeakBilin B) where
  toContinuousAdd := by 

Proof state:
α : Type u_1
𝕜 : Type u_2
𝕝 : Type u_3
R : Type u_4
E : Type u_5
F : Type u_6
M : Type u_7
inst✝⁶ : TopologicalSpace 𝕜
inst✝⁵ : CommRing 𝕜
inst✝⁴ : AddCommGroup E
inst✝³ : Module 𝕜 E
inst✝² : AddCommGroup F
inst✝¹ : Module 𝕜 F
B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜
inst✝ : ContinuousAdd 𝕜
⊢ ContinuousAdd (WeakBilin B)

Next tactic:
infer_instance
/-- `WeakBilin B` is a `TopologicalAddGroup`, meaning that addition and negation are
continuous. -/
instance instTopologicalAddGroup [ContinuousAdd 𝕜] : TopologicalAddGroup (WeakBilin B) where
  toContinuousAdd := by infer_instance
  continuous_neg := by
    

Proof state:
α : Type u_1
𝕜 : Type u_2
𝕝 : Type u_3
R : Type u_4
E : Type u_5
F : Type u_6
M : Type u_7
inst✝⁶ : TopologicalSpace 𝕜
inst✝⁵ : CommRing 𝕜
inst✝⁴ : AddCommGroup E
inst✝³ : Module 𝕜 E
inst✝² : AddCommGroup F
inst✝¹ : Module 𝕜 F
B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜
inst✝ : ContinuousAdd 𝕜
⊢ Continuous fun a => -a

Next tactic:
refine' continuous_induced_rng.2 (continuous_pi_iff.mpr fun y => _)
/-- `WeakBilin B` is a `TopologicalAddGroup`, meaning that addition and negation are
continuous. -/
instance instTopologicalAddGroup [ContinuousAdd 𝕜] : TopologicalAddGroup (WeakBilin B) where
  toContinuousAdd := by infer_instance
  continuous_neg := by
    refine' continuous_induced_rng.2 (continuous_pi_iff.mpr fun y => _)
    

Proof state:
α : Type u_1
𝕜 : Type u_2
𝕝 : Type u_3
R : Type u_4
E : Type u_5
F : Type u_6
M : Type u_7
inst✝⁶ : TopologicalSpace 𝕜
inst✝⁵ : CommRing 𝕜
inst✝⁴ : AddCommGroup E
inst✝³ : Module 𝕜 E
inst✝² : AddCommGroup F
inst✝¹ : Module 𝕜 F
B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜
inst✝ : ContinuousAdd 𝕜
y : F
⊢ Continuous fun a => ((fun x y => (B x) y) ∘ fun a => -a) a y

Next tactic:
refine' cast (congr_arg _ _) (eval_continuous B (-y))
/-- `WeakBilin B` is a `TopologicalAddGroup`, meaning that addition and negation are
continuous. -/
instance instTopologicalAddGroup [ContinuousAdd 𝕜] : TopologicalAddGroup (WeakBilin B) where
  toContinuousAdd := by infer_instance
  continuous_neg := by
    refine' continuous_induced_rng.2 (continuous_pi_iff.mpr fun y => _)
    refine' cast (congr_arg _ _) (eval_continuous B (-y))
    

Proof state:
α : Type u_1
𝕜 : Type u_2
𝕝 : Type u_3
R : Type u_4
E : Type u_5
F : Type u_6
M : Type u_7
inst✝⁶ : TopologicalSpace 𝕜
inst✝⁵ : CommRing 𝕜
inst✝⁴ : AddCommGroup E
inst✝³ : Module 𝕜 E
inst✝² : AddCommGroup F
inst✝¹ : Module 𝕜 F
B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜
inst✝ : ContinuousAdd 𝕜
y : F
⊢ (fun x => (B x) (-y)) = fun a => ((fun x y => (B x) y) ∘ fun a => -a) a y

Next tactic:
ext x
/-- `WeakBilin B` is a `TopologicalAddGroup`, meaning that addition and negation are
continuous. -/
instance instTopologicalAddGroup [ContinuousAdd 𝕜] : TopologicalAddGroup (WeakBilin B) where
  toContinuousAdd := by infer_instance
  continuous_neg := by
    refine' continuous_induced_rng.2 (continuous_pi_iff.mpr fun y => _)
    refine' cast (congr_arg _ _) (eval_continuous B (-y))
    ext x
    

Proof state:
case h
α : Type u_1
𝕜 : Type u_2
𝕝 : Type u_3
R : Type u_4
E : Type u_5
F : Type u_6
M : Type u_7
inst✝⁶ : TopologicalSpace 𝕜
inst✝⁵ : CommRing 𝕜
inst✝⁴ : AddCommGroup E
inst✝³ : Module 𝕜 E
inst✝² : AddCommGroup F
inst✝¹ : Module 𝕜 F
B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜
inst✝ : ContinuousAdd 𝕜
y : F
x : WeakBilin B
⊢ (B x) (-y) = ((fun x y => (B x) y) ∘ fun a => -a) x y

Next tactic:
simp only [map_neg, Function.comp_apply, LinearMap.neg_apply]
/-- `WeakBilin B` is a `TopologicalAddGroup`, meaning that addition and negation are
continuous. -/
instance instTopologicalAddGroup [ContinuousAdd 𝕜] : TopologicalAddGroup (WeakBilin B) where
  toContinuousAdd := by infer_instance
  continuous_neg := by
    refine' continuous_induced_rng.2 (continuous_pi_iff.mpr fun y => _)
    refine' cast (congr_arg _ _) (eval_continuous B (-y))
    ext x
    simp only [map_neg, Function.comp_apply, LinearMap.neg_apply]
    -- Porting note: mathlib3 proof was done here
    

Proof state:
case h
α : Type u_1
𝕜 : Type u_2
𝕝 : Type u_3
R : Type u_4
E : Type u_5
F : Type u_6
M : Type u_7
inst✝⁶ : TopologicalSpace 𝕜
inst✝⁵ : CommRing 𝕜
inst✝⁴ : AddCommGroup E
inst✝³ : Module 𝕜 E
inst✝² : AddCommGroup F
inst✝¹ : Module 𝕜 F
B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜
inst✝ : ContinuousAdd 𝕜
y : F
x : WeakBilin B
⊢ -(B x) y = (B (-x)) y

Next tactic:
rw [← (B x).neg_apply]
/-- `WeakBilin B` is a `TopologicalAddGroup`, meaning that addition and negation are
continuous. -/
instance instTopologicalAddGroup [ContinuousAdd 𝕜] : TopologicalAddGroup (WeakBilin B) where
  toContinuousAdd := by infer_instance
  continuous_neg := by
    refine' continuous_induced_rng.2 (continuous_pi_iff.mpr fun y => _)
    refine' cast (congr_arg _ _) (eval_continuous B (-y))
    ext x
    simp only [map_neg, Function.comp_apply, LinearMap.neg_apply]
    -- Porting note: mathlib3 proof was done here
    rw [← (B x).neg_apply]
    

Proof state:
case h
α : Type u_1
𝕜 : Type u_2
𝕝 : Type u_3
R : Type u_4
E : Type u_5
F : Type u_6
M : Type u_7
inst✝⁶ : TopologicalSpace 𝕜
inst✝⁵ : CommRing 𝕜
inst✝⁴ : AddCommGroup E
inst✝³ : Module 𝕜 E
inst✝² : AddCommGroup F
inst✝¹ : Module 𝕜 F
B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜
inst✝ : ContinuousAdd 𝕜
y : F
x : WeakBilin B
⊢ (-B x) y = (B (-x)) y

Next tactic:
congr
/-- `WeakBilin B` is a `TopologicalAddGroup`, meaning that addition and negation are
continuous. -/
instance instTopologicalAddGroup [ContinuousAdd 𝕜] : TopologicalAddGroup (WeakBilin B) where
  toContinuousAdd := by infer_instance
  continuous_neg := by
    refine' continuous_induced_rng.2 (continuous_pi_iff.mpr fun y => _)
    refine' cast (congr_arg _ _) (eval_continuous B (-y))
    ext x
    simp only [map_neg, Function.comp_apply, LinearMap.neg_apply]
    -- Porting note: mathlib3 proof was done here
    rw [← (B x).neg_apply]
    congr
    

Proof state:
case h.e_a
α : Type u_1
𝕜 : Type u_2
𝕝 : Type u_3
R : Type u_4
E : Type u_5
F : Type u_6
M : Type u_7
inst✝⁶ : TopologicalSpace 𝕜
inst✝⁵ : CommRing 𝕜
inst✝⁴ : AddCommGroup E
inst✝³ : Module 𝕜 E
inst✝² : AddCommGroup F
inst✝¹ : Module 𝕜 F
B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜
inst✝ : ContinuousAdd 𝕜
y : F
x : WeakBilin B
⊢ -B x = B (-x)

Next tactic:
exact (map_neg B x).symm
/-- The submodule of homogeneous `MvPolynomial`s of degree `n`. -/
def homogeneousSubmodule [CommSemiring R] (n : ℕ) : Submodule R (MvPolynomial σ R) where
  carrier := { x | x.IsHomogeneous n }
  smul_mem' r a ha c hc := by
    rw [coeff_smul] at hc
    apply ha
    intro h
    apply hc
    rw [h]
    exact smul_zero r
  zero_mem' d hd := False.elim (hd <| coeff_zero _)
  add_mem' {a b} ha hb c hc := by
    

Proof state:
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
a b : MvPolynomial σ R
ha : a ∈ {x | IsHomogeneous x n}
hb : b ∈ {x | IsHomogeneous x n}
c : σ →₀ ℕ
hc : coeff c (a + b) ≠ 0
⊢ ∑ i in c.support, c i = n

Next tactic:
rw [coeff_add] at hc
/-- The submodule of homogeneous `MvPolynomial`s of degree `n`. -/
def homogeneousSubmodule [CommSemiring R] (n : ℕ) : Submodule R (MvPolynomial σ R) where
  carrier := { x | x.IsHomogeneous n }
  smul_mem' r a ha c hc := by
    rw [coeff_smul] at hc
    apply ha
    intro h
    apply hc
    rw [h]
    exact smul_zero r
  zero_mem' d hd := False.elim (hd <| coeff_zero _)
  add_mem' {a b} ha hb c hc := by
    rw [coeff_add] at hc
    

Proof state:
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
a b : MvPolynomial σ R
ha : a ∈ {x | IsHomogeneous x n}
hb : b ∈ {x | IsHomogeneous x n}
c : σ →₀ ℕ
hc : coeff c a + coeff c b ≠ 0
⊢ ∑ i in c.support, c i = n

Next tactic:
obtain h | h : coeff c a ≠ 0 ∨ coeff c b ≠ 0 := by
      contrapose! hc
      simp only [hc, add_zero]
/-- The submodule of homogeneous `MvPolynomial`s of degree `n`. -/
def homogeneousSubmodule [CommSemiring R] (n : ℕ) : Submodule R (MvPolynomial σ R) where
  carrier := { x | x.IsHomogeneous n }
  smul_mem' r a ha c hc := by
    rw [coeff_smul] at hc
    apply ha
    intro h
    apply hc
    rw [h]
    exact smul_zero r
  zero_mem' d hd := False.elim (hd <| coeff_zero _)
  add_mem' {a b} ha hb c hc := by
    rw [coeff_add] at hc
    obtain h | h : coeff c a ≠ 0 ∨ coeff c b ≠ 0 := by
      

Proof state:
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
a b : MvPolynomial σ R
ha : a ∈ {x | IsHomogeneous x n}
hb : b ∈ {x | IsHomogeneous x n}
c : σ →₀ ℕ
hc : coeff c a + coeff c b ≠ 0
⊢ coeff c a ≠ 0 ∨ coeff c b ≠ 0

Next tactic:
contrapose! hc
/-- The submodule of homogeneous `MvPolynomial`s of degree `n`. -/
def homogeneousSubmodule [CommSemiring R] (n : ℕ) : Submodule R (MvPolynomial σ R) where
  carrier := { x | x.IsHomogeneous n }
  smul_mem' r a ha c hc := by
    rw [coeff_smul] at hc
    apply ha
    intro h
    apply hc
    rw [h]
    exact smul_zero r
  zero_mem' d hd := False.elim (hd <| coeff_zero _)
  add_mem' {a b} ha hb c hc := by
    rw [coeff_add] at hc
    obtain h | h : coeff c a ≠ 0 ∨ coeff c b ≠ 0 := by
      contrapose! hc
      

Proof state:
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
a b : MvPolynomial σ R
ha : a ∈ {x | IsHomogeneous x n}
hb : b ∈ {x | IsHomogeneous x n}
c : σ →₀ ℕ
hc : coeff c a = 0 ∧ coeff c b = 0
⊢ coeff c a + coeff c b = 0

Next tactic:
simp only [hc, add_zero]