l3lab/ntp-mathlib huggingface dataset:
instance : Linear S (ModuleCat.{v} S) where
  homModule X Y := LinearMap.module
  smul_comp := by
    intros
    ext
    dsimp
    rw [LinearMap.smul_apply, LinearMap.smul_apply, map_smul]
    rfl
  comp_smul := by
    

Proof state:
R : Type u
inst✝¹ : Ring R
X₁ X₂ : Type v
S : Type u
inst✝ : CommRing S
⊢ ∀ (X Y Z : ModuleCat S) (f : X ⟶ Y) (r : S) (g : Y ⟶ Z), f ≫ (r • g) = r • f ≫ g

Next tactic:
intros
instance : Linear S (ModuleCat.{v} S) where
  homModule X Y := LinearMap.module
  smul_comp := by
    intros
    ext
    dsimp
    rw [LinearMap.smul_apply, LinearMap.smul_apply, map_smul]
    rfl
  comp_smul := by
    intros
    

Proof state:
R : Type u
inst✝¹ : Ring R
X₁ X₂ : Type v
S : Type u
inst✝ : CommRing S
X✝ Y✝ Z✝ : ModuleCat S
f✝ : X✝ ⟶ Y✝
r✝ : S
g✝ : Y✝ ⟶ Z✝
⊢ f✝ ≫ (r✝ • g✝) = r✝ • f✝ ≫ g✝

Next tactic:
ext
instance : Linear S (ModuleCat.{v} S) where
  homModule X Y := LinearMap.module
  smul_comp := by
    intros
    ext
    dsimp
    rw [LinearMap.smul_apply, LinearMap.smul_apply, map_smul]
    rfl
  comp_smul := by
    intros
    ext
    

Proof state:
case h
R : Type u
inst✝¹ : Ring R
X₁ X₂ : Type v
S : Type u
inst✝ : CommRing S
X✝ Y✝ Z✝ : ModuleCat S
f✝ : X✝ ⟶ Y✝
r✝ : S
g✝ : Y✝ ⟶ Z✝
x✝ : ↑X✝
⊢ (f✝ ≫ (r✝ • g✝)) x✝ = (r✝ • f✝ ≫ g✝) x✝

Next tactic:
rfl
/-- The scalar multiplication on an object of `ModuleCat R` considered as
a morphism of rings from `R` to the endomorphisms of the underlying abelian group. -/
def smul : R →+* End ((forget₂ (ModuleCat R) AddCommGroupCat).obj M) where
  toFun r :=
    { toFun := fun (m : M) => r • m
      map_zero' := by 

Proof state:
R : Type u
inst✝ : Ring R
X₁ X₂ : Type v
M N : ModuleCat R
r : R
⊢ (fun m => r • m) 0 = 0

Next tactic:
dsimp
/-- The scalar multiplication on an object of `ModuleCat R` considered as
a morphism of rings from `R` to the endomorphisms of the underlying abelian group. -/
def smul : R →+* End ((forget₂ (ModuleCat R) AddCommGroupCat).obj M) where
  toFun r :=
    { toFun := fun (m : M) => r • m
      map_zero' := by dsimp; 

Proof state:
R : Type u
inst✝ : Ring R
X₁ X₂ : Type v
M N : ModuleCat R
r : R
⊢ r • 0 = 0

Next tactic:
rw [smul_zero]
/-- The scalar multiplication on an object of `ModuleCat R` considered as
a morphism of rings from `R` to the endomorphisms of the underlying abelian group. -/
def smul : R →+* End ((forget₂ (ModuleCat R) AddCommGroupCat).obj M) where
  toFun r :=
    { toFun := fun (m : M) => r • m
      map_zero' := by dsimp; rw [smul_zero]
      map_add' := fun x y => by 

Proof state:
R : Type u
inst✝ : Ring R
X₁ X₂ : Type v
M N : ModuleCat R
r : R
x y : ↑((forget₂ (ModuleCat R) AddCommGroupCat).obj M)
⊢ ZeroHom.toFun { toFun := fun m => r • m, map_zero' := (_ : (fun m => r • m) 0 = 0) } (x + y) =
    ZeroHom.toFun { toFun := fun m => r • m, map_zero' := (_ : (fun m => r • m) 0 = 0) } x +
      ZeroHom.toFun { toFun := fun m => r • m, map_zero' := (_ : (fun m => r • m) 0 = 0) } y

Next tactic:
dsimp
/-- The scalar multiplication on an object of `ModuleCat R` considered as
a morphism of rings from `R` to the endomorphisms of the underlying abelian group. -/
def smul : R →+* End ((forget₂ (ModuleCat R) AddCommGroupCat).obj M) where
  toFun r :=
    { toFun := fun (m : M) => r • m
      map_zero' := by dsimp; rw [smul_zero]
      map_add' := fun x y => by dsimp; 

Proof state:
R : Type u
inst✝ : Ring R
X₁ X₂ : Type v
M N : ModuleCat R
r : R
x y : ↑((forget₂ (ModuleCat R) AddCommGroupCat).obj M)
⊢ r • (x + y) = r • x + r • y

Next tactic:
rw [smul_add]
/-- The scalar multiplication on an object of `ModuleCat R` considered as
a morphism of rings from `R` to the endomorphisms of the underlying abelian group. -/
def smul : R →+* End ((forget₂ (ModuleCat R) AddCommGroupCat).obj M) where
  toFun r :=
    { toFun := fun (m : M) => r • m
      map_zero' := by dsimp; rw [smul_zero]
      map_add' := fun x y => by dsimp; rw [smul_add] }
  map_one' := AddMonoidHom.ext (fun x => by 

Proof state:
R : Type u
inst✝ : Ring R
X₁ X₂ : Type v
M N : ModuleCat R
x : ↑((forget₂ (ModuleCat R) AddCommGroupCat).obj M)
⊢ ((fun r =>
          { toZeroHom := { toFun := fun m => r • m, map_zero' := (_ : (fun m => r • m) 0 = 0) },
            map_add' :=
              (_ :
                ∀ (x y : ↑((forget₂ (ModuleCat R) AddCommGroupCat).obj M)),
                  ZeroHom.toFun { toFun := fun m => r • m, map_zero' := (_ : (fun m => r • m) 0 = 0) } (x + y) =
                    ZeroHom.toFun { toFun := fun m => r • m, map_zero' := (_ : (fun m => r • m) 0 = 0) } x +
                      ZeroHom.toFun { toFun := fun m => r • m, map_zero' := (_ : (fun m => r • m) 0 = 0) } y) })
        1)
      x =
    1 x

Next tactic:
dsimp
/-- The scalar multiplication on an object of `ModuleCat R` considered as
a morphism of rings from `R` to the endomorphisms of the underlying abelian group. -/
def smul : R →+* End ((forget₂ (ModuleCat R) AddCommGroupCat).obj M) where
  toFun r :=
    { toFun := fun (m : M) => r • m
      map_zero' := by dsimp; rw [smul_zero]
      map_add' := fun x y => by dsimp; rw [smul_add] }
  map_one' := AddMonoidHom.ext (fun x => by dsimp; 

Proof state:
R : Type u
inst✝ : Ring R
X₁ X₂ : Type v
M N : ModuleCat R
x : ↑((forget₂ (ModuleCat R) AddCommGroupCat).obj M)
⊢ 1 • x = x

Next tactic:
rw [one_smul]
/-- The scalar multiplication on an object of `ModuleCat R` considered as
a morphism of rings from `R` to the endomorphisms of the underlying abelian group. -/
def smul : R →+* End ((forget₂ (ModuleCat R) AddCommGroupCat).obj M) where
  toFun r :=
    { toFun := fun (m : M) => r • m
      map_zero' := by dsimp; rw [smul_zero]
      map_add' := fun x y => by dsimp; rw [smul_add] }
  map_one' := AddMonoidHom.ext (fun x => by dsimp; rw [one_smul])
  map_zero' := AddMonoidHom.ext (fun x => by dsimp; 

Proof state:
R : Type u
inst✝ : Ring R
X₁ X₂ : Type v
M N : ModuleCat R
x : ↑((forget₂ (ModuleCat R) AddCommGroupCat).obj M)
⊢ 0 • x = 0

Next tactic:
rw [zero_smul]
lemma smul_naturality {M N : ModuleCat.{v} R} (f : M ⟶ N) (r : R) :
    (forget₂ (ModuleCat R) AddCommGroupCat).map f ≫ N.smul r =
      M.smul r ≫ (forget₂ (ModuleCat R) AddCommGroupCat).map f := by
  

Proof state:
R : Type u
inst✝ : Ring R
X₁ X₂ : Type v
M✝ N✝ M N : ModuleCat R
f : M ⟶ N
r : R
⊢ (forget₂ (ModuleCat R) AddCommGroupCat).map f ≫ (smul N) r =
    (smul M) r ≫ (forget₂ (ModuleCat R) AddCommGroupCat).map f

Next tactic:
ext x
lemma smul_naturality {M N : ModuleCat.{v} R} (f : M ⟶ N) (r : R) :
    (forget₂ (ModuleCat R) AddCommGroupCat).map f ≫ N.smul r =
      M.smul r ≫ (forget₂ (ModuleCat R) AddCommGroupCat).map f := by
  ext x
  

Proof state:
case w
R : Type u
inst✝ : Ring R
X₁ X₂ : Type v
M✝ N✝ M N : ModuleCat R
f : M ⟶ N
r : R
x : ↑((forget₂ (ModuleCat R) AddCommGroupCat).obj M)
⊢ ((forget₂ (ModuleCat R) AddCommGroupCat).map f ≫ (smul N) r) x =
    ((smul M) r ≫ (forget₂ (ModuleCat R) AddCommGroupCat).map f) x

Next tactic:
exact (f.map_smul r x).symm
/-- The scalar multiplication on `ModuleCat R` considered as a morphism of rings
to the endomorphisms of the forgetful functor to `AddCommGroupCat)`. -/
@[simps]
def smulNatTrans : R →+* End (forget₂ (ModuleCat R) AddCommGroupCat) where
  toFun r :=
    { app := fun M => M.smul r
      naturality := fun _ _ _ => smul_naturality _ r }
  map_one' := NatTrans.ext _ _ (by 

Proof state:
R : Type u
inst✝ : Ring R
X₁ X₂ : Type v
M N : ModuleCat R
⊢ ((fun r => NatTrans.mk fun M => (smul M) r) 1).app = 1.app

Next tactic:
aesop_cat
/-- The scalar multiplication on `ModuleCat R` considered as a morphism of rings
to the endomorphisms of the forgetful functor to `AddCommGroupCat)`. -/
@[simps]
def smulNatTrans : R →+* End (forget₂ (ModuleCat R) AddCommGroupCat) where
  toFun r :=
    { app := fun M => M.smul r
      naturality := fun _ _ _ => smul_naturality _ r }
  map_one' := NatTrans.ext _ _ (by aesop_cat)
  map_zero' := NatTrans.ext _ _ (by aesop_cat)
  map_mul' _ _ := NatTrans.ext _ _ (by 

Proof state:
R : Type u
inst✝ : Ring R
X₁ X₂ : Type v
M N : ModuleCat R
x✝¹ x✝ : R
⊢ (OneHom.toFun
        { toFun := fun r => NatTrans.mk fun M => (smul M) r,
          map_one' := (_ : (fun r => NatTrans.mk fun M => (smul M) r) 1 = 1) }
        (x✝¹ * x✝)).app =
    (OneHom.toFun
          { toFun := fun r => NatTrans.mk fun M => (smul M) r,
            map_one' := (_ : (fun r => NatTrans.mk fun M => (smul M) r) 1 = 1) }
          x✝¹ *
        OneHom.toFun
          { toFun := fun r => NatTrans.mk fun M => (smul M) r,
            map_one' := (_ : (fun r => NatTrans.mk fun M => (smul M) r) 1 = 1) }
          x✝).app

Next tactic:
aesop_cat
/-- The scalar multiplication on `ModuleCat R` considered as a morphism of rings
to the endomorphisms of the forgetful functor to `AddCommGroupCat)`. -/
@[simps]
def smulNatTrans : R →+* End (forget₂ (ModuleCat R) AddCommGroupCat) where
  toFun r :=
    { app := fun M => M.smul r
      naturality := fun _ _ _ => smul_naturality _ r }
  map_one' := NatTrans.ext _ _ (by aesop_cat)
  map_zero' := NatTrans.ext _ _ (by 

Proof state:
R : Type u
inst✝ : Ring R
X₁ X₂ : Type v
M N : ModuleCat R
⊢ (OneHom.toFun
        (↑{
            toOneHom :=
              { toFun := fun r => NatTrans.mk fun M => (smul M) r,
                map_one' := (_ : (fun r => NatTrans.mk fun M => (smul M) r) 1 = 1) },
            map_mul' :=
              (_ :
                ∀ (x x_1 : R),
                  OneHom.toFun
                      { toFun := fun r => NatTrans.mk fun M => (smul M) r,
                        map_one' := (_ : (fun r => NatTrans.mk fun M => (smul M) r) 1 = 1) }
                      (x * x_1) =
                    OneHom.toFun
                        { toFun := fun r => NatTrans.mk fun M => (smul M) r,
                          map_one' := (_ : (fun r => NatTrans.mk fun M => (smul M) r) 1 = 1) }
                        x *
                      OneHom.toFun
                        { toFun := fun r => NatTrans.mk fun M => (smul M) r,
                          map_one' := (_ : (fun r => NatTrans.mk fun M => (smul M) r) 1 = 1) }
                        x_1) })
        0).app =
    0.app

Next tactic:
aesop_cat
instance : AddCommGroup (mkOfSMul' φ) := by
  

Proof state:
R : Type u
inst✝ : Ring R
X₁ X₂ : Type v
M N : ModuleCat R
A : AddCommGroupCat
φ : R →+* End A
⊢ AddCommGroup ↑(mkOfSMul' φ)

Next tactic:
dsimp only [mkOfSMul']
instance : AddCommGroup (mkOfSMul' φ) := by
  dsimp only [mkOfSMul']
  

Proof state:
R : Type u
inst✝ : Ring R
X₁ X₂ : Type v
M N : ModuleCat R
A : AddCommGroupCat
φ : R →+* End A
⊢ AddCommGroup ↑A

Next tactic:
infer_instance
instance : Module R (mkOfSMul' φ) where
  smul_zero _ := map_zero _
  smul_add _ _ _ := map_add _ _ _
  one_smul := by 

Proof state:
R : Type u
inst✝ : Ring R
X₁ X₂ : Type v
M N : ModuleCat R
A : AddCommGroupCat
φ : R →+* End A
⊢ ∀ (b : ↑(mkOfSMul' φ)), 1 • b = b

Next tactic:
simp
instance : Module R (mkOfSMul' φ) where
  smul_zero _ := map_zero _
  smul_add _ _ _ := map_add _ _ _
  one_smul := by simp
  mul_smul := by 

Proof state:
R : Type u
inst✝ : Ring R
X₁ X₂ : Type v
M N : ModuleCat R
A : AddCommGroupCat
φ : R →+* End A
⊢ ∀ (x y : R) (b : ↑(mkOfSMul' φ)), (x * y) • b = x • y • b

Next tactic:
simp
instance : Module R (mkOfSMul' φ) where
  smul_zero _ := map_zero _
  smul_add _ _ _ := map_add _ _ _
  one_smul := by simp
  mul_smul := by simp
  add_smul _ _ _ := by 

Proof state:
R : Type u
inst✝ : Ring R
X₁ X₂ : Type v
M N : ModuleCat R
A : AddCommGroupCat
φ : R →+* End A
x✝² x✝¹ : R
x✝ : ↑(mkOfSMul' φ)
⊢ (x✝² + x✝¹) • x✝ = x✝² • x✝ + x✝¹ • x✝

Next tactic:
simp
instance : Module R (mkOfSMul' φ) where
  smul_zero _ := map_zero _
  smul_add _ _ _ := map_add _ _ _
  one_smul := by simp
  mul_smul := by simp
  add_smul _ _ _ := by simp; 

Proof state:
R : Type u
inst✝ : Ring R
X₁ X₂ : Type v
M N : ModuleCat R
A : AddCommGroupCat
φ : R →+* End A
x✝² x✝¹ : R
x✝ : ↑(mkOfSMul' φ)
⊢ (φ x✝² + φ x✝¹) x✝ = (φ x✝²) x✝ + (φ x✝¹) x✝

Next tactic:
rfl
instance : Module R (mkOfSMul' φ) where
  smul_zero _ := map_zero _
  smul_add _ _ _ := map_add _ _ _
  one_smul := by simp
  mul_smul := by simp
  add_smul _ _ _ := by simp; rfl
  zero_smul := by 

Proof state:
R : Type u
inst✝ : Ring R
X₁ X₂ : Type v
M N : ModuleCat R
A : AddCommGroupCat
φ : R →+* End A
⊢ ∀ (x : ↑(mkOfSMul' φ)), 0 • x = 0

Next tactic:
simp
/-- The derivative (in the analysis sense) of a polynomial `p` is given by `p.derivative`. -/
protected theorem hasStrictDerivAt (x : 𝕜) :
    HasStrictDerivAt (fun x => p.eval x) (p.derivative.eval x) x := by
  

Proof state:
𝕜 : Type u
inst✝⁶ : NontriviallyNormedField 𝕜
F : Type v
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
E : Type w
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace 𝕜 E
f f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x✝ : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
R : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Algebra R 𝕜
p : 𝕜[X]
q : R[X]
x : 𝕜
⊢ HasStrictDerivAt (fun x => eval x p) (eval x (derivative p)) x

Next tactic:
induction p using Polynomial.induction_on'
/-- The derivative (in the analysis sense) of a polynomial `p` is given by `p.derivative`. -/
protected theorem hasStrictDerivAt (x : 𝕜) :
    HasStrictDerivAt (fun x => p.eval x) (p.derivative.eval x) x := by
  induction p using Polynomial.induction_on'
  

Proof state:
case h_add
𝕜 : Type u
inst✝⁶ : NontriviallyNormedField 𝕜
F : Type v
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
E : Type w
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace 𝕜 E
f f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x✝ : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
R : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Algebra R 𝕜
p : 𝕜[X]
q : R[X]
x : 𝕜
p✝ q✝ : 𝕜[X]
a✝¹ : HasStrictDerivAt (fun x => eval x p✝) (eval x (derivative p✝)) x
a✝ : HasStrictDerivAt (fun x => eval x q✝) (eval x (derivative q✝)) x
⊢ HasStrictDerivAt (fun x => eval x (p✝ + q✝)) (eval x (derivative (p✝ + q✝))) x
case h_monomial
𝕜 : Type u
inst✝⁶ : NontriviallyNormedField 𝕜
F : Type v
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
E : Type w
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace 𝕜 E
f f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x✝ : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
R : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Algebra R 𝕜
p : 𝕜[X]
q : R[X]
x : 𝕜
n✝ : ℕ
a✝ : 𝕜
⊢ HasStrictDerivAt (fun x => eval x ((monomial n✝) a✝)) (eval x (derivative ((monomial n✝) a✝))) x

Next tactic:
case h_add p q hp hq => simpa using hp.add hq
/-- The derivative (in the analysis sense) of a polynomial `p` is given by `p.derivative`. -/
protected theorem hasStrictDerivAt (x : 𝕜) :
    HasStrictDerivAt (fun x => p.eval x) (p.derivative.eval x) x := by
  induction p using Polynomial.induction_on'
  

Proof state:
𝕜 : Type u
inst✝⁶ : NontriviallyNormedField 𝕜
F : Type v
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
E : Type w
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace 𝕜 E
f f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x✝ : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
R : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Algebra R 𝕜
p✝ : 𝕜[X]
q✝ : R[X]
x : 𝕜
p q : 𝕜[X]
hp : HasStrictDerivAt (fun x => eval x p) (eval x (derivative p)) x
hq : HasStrictDerivAt (fun x => eval x q) (eval x (derivative q)) x
⊢ HasStrictDerivAt (fun x => eval x (p + q)) (eval x (derivative (p + q))) x

Next tactic:
case h_add p q hp hq => simpa using hp.add hq
/-- The derivative (in the analysis sense) of a polynomial `p` is given by `p.derivative`. -/
protected theorem hasStrictDerivAt (x : 𝕜) :
    HasStrictDerivAt (fun x => p.eval x) (p.derivative.eval x) x := by
  induction p using Polynomial.induction_on'
  case h_add p q hp hq => 

Proof state:
𝕜 : Type u
inst✝⁶ : NontriviallyNormedField 𝕜
F : Type v
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
E : Type w
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace 𝕜 E
f f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x✝ : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
R : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Algebra R 𝕜
p✝ : 𝕜[X]
q✝ : R[X]
x : 𝕜
p q : 𝕜[X]
hp : HasStrictDerivAt (fun x => eval x p) (eval x (derivative p)) x
hq : HasStrictDerivAt (fun x => eval x q) (eval x (derivative q)) x
⊢ HasStrictDerivAt (fun x => eval x (p + q)) (eval x (derivative (p + q))) x

Next tactic:
simpa using hp.add hq
/-- The derivative (in the analysis sense) of a polynomial `p` is given by `p.derivative`. -/
protected theorem hasStrictDerivAt (x : 𝕜) :
    HasStrictDerivAt (fun x => p.eval x) (p.derivative.eval x) x := by
  induction p using Polynomial.induction_on'
  case h_add p q hp hq => simpa using hp.add hq
  

Proof state:
case h_monomial
𝕜 : Type u
inst✝⁶ : NontriviallyNormedField 𝕜
F : Type v
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
E : Type w
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace 𝕜 E
f f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x✝ : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
R : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Algebra R 𝕜
p : 𝕜[X]
q : R[X]
x : 𝕜
n✝ : ℕ
a✝ : 𝕜
⊢ HasStrictDerivAt (fun x => eval x ((monomial n✝) a✝)) (eval x (derivative ((monomial n✝) a✝))) x

Next tactic:
case h_monomial n a => simpa [mul_assoc] using (hasStrictDerivAt_pow n x).const_mul a
/-- The derivative (in the analysis sense) of a polynomial `p` is given by `p.derivative`. -/
protected theorem hasStrictDerivAt (x : 𝕜) :
    HasStrictDerivAt (fun x => p.eval x) (p.derivative.eval x) x := by
  induction p using Polynomial.induction_on'
  case h_add p q hp hq => simpa using hp.add hq
  

Proof state:
𝕜 : Type u
inst✝⁶ : NontriviallyNormedField 𝕜
F : Type v
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
E : Type w
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace 𝕜 E
f f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x✝ : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
R : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Algebra R 𝕜
p : 𝕜[X]
q : R[X]
x : 𝕜
n : ℕ
a : 𝕜
⊢ HasStrictDerivAt (fun x => eval x ((monomial n) a)) (eval x (derivative ((monomial n) a))) x

Next tactic:
case h_monomial n a => simpa [mul_assoc] using (hasStrictDerivAt_pow n x).const_mul a
/-- The derivative (in the analysis sense) of a polynomial `p` is given by `p.derivative`. -/
protected theorem hasStrictDerivAt (x : 𝕜) :
    HasStrictDerivAt (fun x => p.eval x) (p.derivative.eval x) x := by
  induction p using Polynomial.induction_on'
  case h_add p q hp hq => simpa using hp.add hq
  case h_monomial n a => 

Proof state:
𝕜 : Type u
inst✝⁶ : NontriviallyNormedField 𝕜
F : Type v
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
E : Type w
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace 𝕜 E
f f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x✝ : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
R : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Algebra R 𝕜
p : 𝕜[X]
q : R[X]
x : 𝕜
n : ℕ
a : 𝕜
⊢ HasStrictDerivAt (fun x => eval x ((monomial n) a)) (eval x (derivative ((monomial n) a))) x

Next tactic:
simpa [mul_assoc] using (hasStrictDerivAt_pow n x).const_mul a
protected theorem hasStrictDerivAt_aeval (x : 𝕜) :
    HasStrictDerivAt (fun x => aeval x q) (aeval x (derivative q)) x := by
  

Proof state:
𝕜 : Type u
inst✝⁶ : NontriviallyNormedField 𝕜
F : Type v
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
E : Type w
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace 𝕜 E
f f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x✝ : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
R : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Algebra R 𝕜
p : 𝕜[X]
q : R[X]
x : 𝕜
⊢ HasStrictDerivAt (fun x => (aeval x) q) ((aeval x) (derivative q)) x

Next tactic:
simpa only [aeval_def, eval₂_eq_eval_map, derivative_map] using
    (q.map (algebraMap R 𝕜)).hasStrictDerivAt x
protected theorem derivWithin (hxs : UniqueDiffWithinAt 𝕜 s x) :
    derivWithin (fun x => p.eval x) s x = p.derivative.eval x := by
  

Proof state:
𝕜 : Type u
inst✝⁶ : NontriviallyNormedField 𝕜
F : Type v
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
E : Type w
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace 𝕜 E
f f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
R : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Algebra R 𝕜
p : 𝕜[X]
q : R[X]
hxs : UniqueDiffWithinAt 𝕜 s x
⊢ derivWithin (fun x => eval x p) s x = eval x (derivative p)

Next tactic:
rw [DifferentiableAt.derivWithin p.differentiableAt hxs]
protected theorem derivWithin (hxs : UniqueDiffWithinAt 𝕜 s x) :
    derivWithin (fun x => p.eval x) s x = p.derivative.eval x := by
  rw [DifferentiableAt.derivWithin p.differentiableAt hxs]
  

Proof state:
𝕜 : Type u
inst✝⁶ : NontriviallyNormedField 𝕜
F : Type v
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
E : Type w
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace 𝕜 E
f f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
R : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Algebra R 𝕜
p : 𝕜[X]
q : R[X]
hxs : UniqueDiffWithinAt 𝕜 s x
⊢ deriv (fun x => eval x p) x = eval x (derivative p)

Next tactic:
exact p.deriv
protected theorem derivWithin_aeval (hxs : UniqueDiffWithinAt 𝕜 s x) :
    derivWithin (fun x => aeval x q) s x = aeval x (derivative q) := by
  

Proof state:
𝕜 : Type u
inst✝⁶ : NontriviallyNormedField 𝕜
F : Type v
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
E : Type w
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace 𝕜 E
f f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
R : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Algebra R 𝕜
p : 𝕜[X]
q : R[X]
hxs : UniqueDiffWithinAt 𝕜 s x
⊢ derivWithin (fun x => (aeval x) q) s x = (aeval x) (derivative q)

Next tactic:
simpa only [aeval_def, eval₂_eq_eval_map, derivative_map] using
    (q.map (algebraMap R 𝕜)).derivWithin hxs
/-- The definition for an impartial game, defined using Conway induction. -/
def ImpartialAux : PGame → Prop
  | G => (G ≈ -G) ∧ (∀ i, ImpartialAux (G.moveLeft i)) ∧ ∀ j, ImpartialAux (G.moveRight j)
termination_by _ G => G -- Porting note: Added `termination_by`
decreasing_by 

Proof state:
a✝ : PGame
G : PGame := a✝
i : LeftMoves G
⊢ (invImage (fun a => a) instWellFoundedRelationPGame).1 (moveLeft G i) a✝

Next tactic:
pgame_wf_tac
/-- The definition for an impartial game, defined using Conway induction. -/
def ImpartialAux : PGame → Prop
  | G => (G ≈ -G) ∧ (∀ i, ImpartialAux (G.moveLeft i)) ∧ ∀ j, ImpartialAux (G.moveRight j)
termination_by _ G => G -- Porting note: Added `termination_by`
decreasing_by 

Proof state:
a✝ : PGame
G : PGame := a✝
j : RightMoves G
⊢ (invImage (fun a => a) instWellFoundedRelationPGame).1 (moveRight G j) a✝

Next tactic:
pgame_wf_tac
theorem impartialAux_def {G : PGame} :
    G.ImpartialAux ↔
      (G ≈ -G) ∧ (∀ i, ImpartialAux (G.moveLeft i)) ∧ ∀ j, ImpartialAux (G.moveRight j) := by
  

Proof state:
G : PGame
⊢ ImpartialAux G ↔
    G ≈ -G ∧ (∀ (i : LeftMoves G), ImpartialAux (moveLeft G i)) ∧ ∀ (j : RightMoves G), ImpartialAux (moveRight G j)

Next tactic:
rw [ImpartialAux]
theorem impartial_def {G : PGame} :
    G.Impartial ↔ (G ≈ -G) ∧ (∀ i, Impartial (G.moveLeft i)) ∧ ∀ j, Impartial (G.moveRight j) := by
  

Proof state:
G : PGame
⊢ Impartial G ↔
    G ≈ -G ∧ (∀ (i : LeftMoves G), Impartial (moveLeft G i)) ∧ ∀ (j : RightMoves G), Impartial (moveRight G j)

Next tactic:
simpa only [impartial_iff_aux] using impartialAux_def
instance impartial_zero : Impartial 0 := by 

Proof state:
⊢ Impartial 0

Next tactic:
rw [impartial_def]
instance impartial_zero : Impartial 0 := by rw [impartial_def]; 

Proof state:
⊢ 0 ≈ -0 ∧ (∀ (i : LeftMoves 0), Impartial (moveLeft 0 i)) ∧ ∀ (j : RightMoves 0), Impartial (moveRight 0 j)

Next tactic:
dsimp
instance impartial_zero : Impartial 0 := by rw [impartial_def]; dsimp; 

Proof state:
⊢ 0 ≈ -0 ∧
    (∀ (i : PEmpty.{?u.2615 + 1}), Impartial (moveLeft 0 i)) ∧ ∀ (j : PEmpty.{?u.2615 + 1}), Impartial (moveRight 0 j)

Next tactic:
simp
instance impartial_star : Impartial star := by
  

Proof state:
⊢ Impartial star

Next tactic:
rw [impartial_def]
instance impartial_star : Impartial star := by
  rw [impartial_def]; 

Proof state:
⊢ star ≈ -star ∧
    (∀ (i : LeftMoves star), Impartial (moveLeft star i)) ∧ ∀ (j : RightMoves star), Impartial (moveRight star j)

Next tactic:
simpa using Impartial.impartial_zero
theorem impartial_congr : ∀ {G H : PGame} (_ : G ≡r H) [G.Impartial], H.Impartial
  | G, H => fun e => by
    

Proof state:
G H : PGame
e : G ≡r H
⊢ ∀ [inst : Impartial G], Impartial H

Next tactic:
intro h