l3lab/ntp-mathlib huggingface dataset:
theorem HasLineDerivWithinAt.smul (h : HasLineDerivWithinAt 𝕜 f f' s x v) (c : 𝕜) :
    HasLineDerivWithinAt 𝕜 f (c • f') s x (c • v) := by
  

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
f : E → F
s : Set E
x v : E
f' : F
h : HasLineDerivWithinAt 𝕜 f f' s x v
c : 𝕜
⊢ HasLineDerivWithinAt 𝕜 f (c • f') s x (c • v)

Next tactic:
simp only [HasLineDerivWithinAt] at h ⊢
theorem HasLineDerivWithinAt.smul (h : HasLineDerivWithinAt 𝕜 f f' s x v) (c : 𝕜) :
    HasLineDerivWithinAt 𝕜 f (c • f') s x (c • v) := by
  simp only [HasLineDerivWithinAt] at h ⊢
  

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
f : E → F
s : Set E
x v : E
f' : F
h : HasDerivWithinAt (fun t => f (x + t • v)) f' ((fun t => x + t • v) ⁻¹' s) 0
c : 𝕜
⊢ HasDerivWithinAt (fun t => f (x + t • c • v)) (c • f') ((fun t => x + t • c • v) ⁻¹' s) 0

Next tactic:
let g := fun (t : 𝕜) ↦ c • t
theorem HasLineDerivWithinAt.smul (h : HasLineDerivWithinAt 𝕜 f f' s x v) (c : 𝕜) :
    HasLineDerivWithinAt 𝕜 f (c • f') s x (c • v) := by
  simp only [HasLineDerivWithinAt] at h ⊢
  let g := fun (t : 𝕜) ↦ c • t
  

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
f : E → F
s : Set E
x v : E
f' : F
h : HasDerivWithinAt (fun t => f (x + t • v)) f' ((fun t => x + t • v) ⁻¹' s) 0
c : 𝕜
g : 𝕜 → 𝕜 := fun t => c • t
⊢ HasDerivWithinAt (fun t => f (x + t • c • v)) (c • f') ((fun t => x + t • c • v) ⁻¹' s) 0

Next tactic:
let s' := (fun (t : 𝕜) ↦ x + t • v) ⁻¹' s
theorem HasLineDerivWithinAt.smul (h : HasLineDerivWithinAt 𝕜 f f' s x v) (c : 𝕜) :
    HasLineDerivWithinAt 𝕜 f (c • f') s x (c • v) := by
  simp only [HasLineDerivWithinAt] at h ⊢
  let g := fun (t : 𝕜) ↦ c • t
  let s' := (fun (t : 𝕜) ↦ x + t • v) ⁻¹' s
  

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
f : E → F
s : Set E
x v : E
f' : F
h : HasDerivWithinAt (fun t => f (x + t • v)) f' ((fun t => x + t • v) ⁻¹' s) 0
c : 𝕜
g : 𝕜 → 𝕜 := fun t => c • t
s' : Set 𝕜 := (fun t => x + t • v) ⁻¹' s
⊢ HasDerivWithinAt (fun t => f (x + t • c • v)) (c • f') ((fun t => x + t • c • v) ⁻¹' s) 0

Next tactic:
have A : HasDerivAt g c 0 := by simpa using (hasDerivAt_id (0 : 𝕜)).const_smul c
theorem HasLineDerivWithinAt.smul (h : HasLineDerivWithinAt 𝕜 f f' s x v) (c : 𝕜) :
    HasLineDerivWithinAt 𝕜 f (c • f') s x (c • v) := by
  simp only [HasLineDerivWithinAt] at h ⊢
  let g := fun (t : 𝕜) ↦ c • t
  let s' := (fun (t : 𝕜) ↦ x + t • v) ⁻¹' s
  have A : HasDerivAt g c 0 := by 

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
f : E → F
s : Set E
x v : E
f' : F
h : HasDerivWithinAt (fun t => f (x + t • v)) f' ((fun t => x + t • v) ⁻¹' s) 0
c : 𝕜
g : 𝕜 → 𝕜 := fun t => c • t
s' : Set 𝕜 := (fun t => x + t • v) ⁻¹' s
⊢ HasDerivAt g c 0

Next tactic:
simpa using (hasDerivAt_id (0 : 𝕜)).const_smul c
theorem HasLineDerivWithinAt.smul (h : HasLineDerivWithinAt 𝕜 f f' s x v) (c : 𝕜) :
    HasLineDerivWithinAt 𝕜 f (c • f') s x (c • v) := by
  simp only [HasLineDerivWithinAt] at h ⊢
  let g := fun (t : 𝕜) ↦ c • t
  let s' := (fun (t : 𝕜) ↦ x + t • v) ⁻¹' s
  have A : HasDerivAt g c 0 := by simpa using (hasDerivAt_id (0 : 𝕜)).const_smul c
  

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
f : E → F
s : Set E
x v : E
f' : F
h : HasDerivWithinAt (fun t => f (x + t • v)) f' ((fun t => x + t • v) ⁻¹' s) 0
c : 𝕜
g : 𝕜 → 𝕜 := fun t => c • t
s' : Set 𝕜 := (fun t => x + t • v) ⁻¹' s
A : HasDerivAt g c 0
⊢ HasDerivWithinAt (fun t => f (x + t • c • v)) (c • f') ((fun t => x + t • c • v) ⁻¹' s) 0

Next tactic:
have B : HasDerivWithinAt (fun t ↦ f (x + t • v)) f' s' (g 0) := by simpa using h
theorem HasLineDerivWithinAt.smul (h : HasLineDerivWithinAt 𝕜 f f' s x v) (c : 𝕜) :
    HasLineDerivWithinAt 𝕜 f (c • f') s x (c • v) := by
  simp only [HasLineDerivWithinAt] at h ⊢
  let g := fun (t : 𝕜) ↦ c • t
  let s' := (fun (t : 𝕜) ↦ x + t • v) ⁻¹' s
  have A : HasDerivAt g c 0 := by simpa using (hasDerivAt_id (0 : 𝕜)).const_smul c
  have B : HasDerivWithinAt (fun t ↦ f (x + t • v)) f' s' (g 0) := by 

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
f : E → F
s : Set E
x v : E
f' : F
h : HasDerivWithinAt (fun t => f (x + t • v)) f' ((fun t => x + t • v) ⁻¹' s) 0
c : 𝕜
g : 𝕜 → 𝕜 := fun t => c • t
s' : Set 𝕜 := (fun t => x + t • v) ⁻¹' s
A : HasDerivAt g c 0
⊢ HasDerivWithinAt (fun t => f (x + t • v)) f' s' (g 0)

Next tactic:
simpa using h
theorem HasLineDerivWithinAt.smul (h : HasLineDerivWithinAt 𝕜 f f' s x v) (c : 𝕜) :
    HasLineDerivWithinAt 𝕜 f (c • f') s x (c • v) := by
  simp only [HasLineDerivWithinAt] at h ⊢
  let g := fun (t : 𝕜) ↦ c • t
  let s' := (fun (t : 𝕜) ↦ x + t • v) ⁻¹' s
  have A : HasDerivAt g c 0 := by simpa using (hasDerivAt_id (0 : 𝕜)).const_smul c
  have B : HasDerivWithinAt (fun t ↦ f (x + t • v)) f' s' (g 0) := by simpa using h
  

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
f : E → F
s : Set E
x v : E
f' : F
h : HasDerivWithinAt (fun t => f (x + t • v)) f' ((fun t => x + t • v) ⁻¹' s) 0
c : 𝕜
g : 𝕜 → 𝕜 := fun t => c • t
s' : Set 𝕜 := (fun t => x + t • v) ⁻¹' s
A : HasDerivAt g c 0
B : HasDerivWithinAt (fun t => f (x + t • v)) f' s' (g 0)
⊢ HasDerivWithinAt (fun t => f (x + t • c • v)) (c • f') ((fun t => x + t • c • v) ⁻¹' s) 0

Next tactic:
have Z := B.scomp (0 : 𝕜) A.hasDerivWithinAt (mapsTo_preimage g s')
theorem HasLineDerivWithinAt.smul (h : HasLineDerivWithinAt 𝕜 f f' s x v) (c : 𝕜) :
    HasLineDerivWithinAt 𝕜 f (c • f') s x (c • v) := by
  simp only [HasLineDerivWithinAt] at h ⊢
  let g := fun (t : 𝕜) ↦ c • t
  let s' := (fun (t : 𝕜) ↦ x + t • v) ⁻¹' s
  have A : HasDerivAt g c 0 := by simpa using (hasDerivAt_id (0 : 𝕜)).const_smul c
  have B : HasDerivWithinAt (fun t ↦ f (x + t • v)) f' s' (g 0) := by simpa using h
  have Z := B.scomp (0 : 𝕜) A.hasDerivWithinAt (mapsTo_preimage g s')
  

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
f : E → F
s : Set E
x v : E
f' : F
h : HasDerivWithinAt (fun t => f (x + t • v)) f' ((fun t => x + t • v) ⁻¹' s) 0
c : 𝕜
g : 𝕜 → 𝕜 := fun t => c • t
s' : Set 𝕜 := (fun t => x + t • v) ⁻¹' s
A : HasDerivAt g c 0
B : HasDerivWithinAt (fun t => f (x + t • v)) f' s' (g 0)
Z : HasDerivWithinAt ((fun t => f (x + t • v)) ∘ g) (c • f') (g ⁻¹' s') 0
⊢ HasDerivWithinAt (fun t => f (x + t • c • v)) (c • f') ((fun t => x + t • c • v) ⁻¹' s) 0

Next tactic:
simp only [Function.comp, smul_eq_mul, mul_comm c, ← smul_smul] at Z
theorem HasLineDerivWithinAt.smul (h : HasLineDerivWithinAt 𝕜 f f' s x v) (c : 𝕜) :
    HasLineDerivWithinAt 𝕜 f (c • f') s x (c • v) := by
  simp only [HasLineDerivWithinAt] at h ⊢
  let g := fun (t : 𝕜) ↦ c • t
  let s' := (fun (t : 𝕜) ↦ x + t • v) ⁻¹' s
  have A : HasDerivAt g c 0 := by simpa using (hasDerivAt_id (0 : 𝕜)).const_smul c
  have B : HasDerivWithinAt (fun t ↦ f (x + t • v)) f' s' (g 0) := by simpa using h
  have Z := B.scomp (0 : 𝕜) A.hasDerivWithinAt (mapsTo_preimage g s')
  simp only [Function.comp, smul_eq_mul, mul_comm c, ← smul_smul] at Z
  

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
f : E → F
s : Set E
x v : E
f' : F
h : HasDerivWithinAt (fun t => f (x + t • v)) f' ((fun t => x + t • v) ⁻¹' s) 0
c : 𝕜
g : 𝕜 → 𝕜 := fun t => c • t
s' : Set 𝕜 := (fun t => x + t • v) ⁻¹' s
A : HasDerivAt g c 0
B : HasDerivWithinAt (fun t => f (x + t • v)) f' s' (g 0)
Z : HasDerivWithinAt (fun x_1 => f (x + x_1 • c • v)) (c • f') ((fun t => t * c) ⁻¹' ((fun t => x + t • v) ⁻¹' s)) 0
⊢ HasDerivWithinAt (fun t => f (x + t • c • v)) (c • f') ((fun t => x + t • c • v) ⁻¹' s) 0

Next tactic:
convert Z
theorem HasLineDerivWithinAt.smul (h : HasLineDerivWithinAt 𝕜 f f' s x v) (c : 𝕜) :
    HasLineDerivWithinAt 𝕜 f (c • f') s x (c • v) := by
  simp only [HasLineDerivWithinAt] at h ⊢
  let g := fun (t : 𝕜) ↦ c • t
  let s' := (fun (t : 𝕜) ↦ x + t • v) ⁻¹' s
  have A : HasDerivAt g c 0 := by simpa using (hasDerivAt_id (0 : 𝕜)).const_smul c
  have B : HasDerivWithinAt (fun t ↦ f (x + t • v)) f' s' (g 0) := by simpa using h
  have Z := B.scomp (0 : 𝕜) A.hasDerivWithinAt (mapsTo_preimage g s')
  simp only [Function.comp, smul_eq_mul, mul_comm c, ← smul_smul] at Z
  convert Z
  

Proof state:
case h.e'_8
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
f : E → F
s : Set E
x v : E
f' : F
h : HasDerivWithinAt (fun t => f (x + t • v)) f' ((fun t => x + t • v) ⁻¹' s) 0
c : 𝕜
g : 𝕜 → 𝕜 := fun t => c • t
s' : Set 𝕜 := (fun t => x + t • v) ⁻¹' s
A : HasDerivAt g c 0
B : HasDerivWithinAt (fun t => f (x + t • v)) f' s' (g 0)
Z : HasDerivWithinAt (fun x_1 => f (x + x_1 • c • v)) (c • f') ((fun t => t * c) ⁻¹' ((fun t => x + t • v) ⁻¹' s)) 0
⊢ (fun t => x + t • c • v) ⁻¹' s = (fun t => t * c) ⁻¹' ((fun t => x + t • v) ⁻¹' s)

Next tactic:
ext t
theorem HasLineDerivWithinAt.smul (h : HasLineDerivWithinAt 𝕜 f f' s x v) (c : 𝕜) :
    HasLineDerivWithinAt 𝕜 f (c • f') s x (c • v) := by
  simp only [HasLineDerivWithinAt] at h ⊢
  let g := fun (t : 𝕜) ↦ c • t
  let s' := (fun (t : 𝕜) ↦ x + t • v) ⁻¹' s
  have A : HasDerivAt g c 0 := by simpa using (hasDerivAt_id (0 : 𝕜)).const_smul c
  have B : HasDerivWithinAt (fun t ↦ f (x + t • v)) f' s' (g 0) := by simpa using h
  have Z := B.scomp (0 : 𝕜) A.hasDerivWithinAt (mapsTo_preimage g s')
  simp only [Function.comp, smul_eq_mul, mul_comm c, ← smul_smul] at Z
  convert Z
  ext t
  

Proof state:
case h.e'_8.h
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
f : E → F
s : Set E
x v : E
f' : F
h : HasDerivWithinAt (fun t => f (x + t • v)) f' ((fun t => x + t • v) ⁻¹' s) 0
c : 𝕜
g : 𝕜 → 𝕜 := fun t => c • t
s' : Set 𝕜 := (fun t => x + t • v) ⁻¹' s
A : HasDerivAt g c 0
B : HasDerivWithinAt (fun t => f (x + t • v)) f' s' (g 0)
Z : HasDerivWithinAt (fun x_1 => f (x + x_1 • c • v)) (c • f') ((fun t => t * c) ⁻¹' ((fun t => x + t • v) ⁻¹' s)) 0
t : 𝕜
⊢ t ∈ (fun t => x + t • c • v) ⁻¹' s ↔ t ∈ (fun t => t * c) ⁻¹' ((fun t => x + t • v) ⁻¹' s)

Next tactic:
simp [← smul_smul]
theorem hasLineDerivWithinAt_smul_iff {c : 𝕜} (hc : c ≠ 0) :
    HasLineDerivWithinAt 𝕜 f (c • f') s x (c • v) ↔ HasLineDerivWithinAt 𝕜 f f' s x v :=
  ⟨fun h ↦ by 

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
f : E → F
s : Set E
x v : E
f' : F
c : 𝕜
hc : c ≠ 0
h : HasLineDerivWithinAt 𝕜 f (c • f') s x (c • v)
⊢ HasLineDerivWithinAt 𝕜 f f' s x v

Next tactic:
simpa [smul_smul, inv_mul_cancel hc] using h.smul (c ⁻¹)
theorem HasLineDerivAt.smul (h : HasLineDerivAt 𝕜 f f' x v) (c : 𝕜) :
    HasLineDerivAt 𝕜 f (c • f') x (c • v) := by
  

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
f : E → F
s : Set E
x v : E
f' : F
h : HasLineDerivAt 𝕜 f f' x v
c : 𝕜
⊢ HasLineDerivAt 𝕜 f (c • f') x (c • v)

Next tactic:
simp only [← hasLineDerivWithinAt_univ] at h ⊢
theorem HasLineDerivAt.smul (h : HasLineDerivAt 𝕜 f f' x v) (c : 𝕜) :
    HasLineDerivAt 𝕜 f (c • f') x (c • v) := by
  simp only [← hasLineDerivWithinAt_univ] at h ⊢
  

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
f : E → F
s : Set E
x v : E
f' : F
c : 𝕜
h : HasLineDerivWithinAt 𝕜 f f' univ x v
⊢ HasLineDerivWithinAt 𝕜 f (c • f') univ x (c • v)

Next tactic:
exact HasLineDerivWithinAt.smul h c
theorem hasLineDerivAt_smul_iff {c : 𝕜} (hc : c ≠ 0) :
    HasLineDerivAt 𝕜 f (c • f') x (c • v) ↔ HasLineDerivAt 𝕜 f f' x v :=
  ⟨fun h ↦ by 

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
f : E → F
s : Set E
x v : E
f' : F
c : 𝕜
hc : c ≠ 0
h : HasLineDerivAt 𝕜 f (c • f') x (c • v)
⊢ HasLineDerivAt 𝕜 f f' x v

Next tactic:
simpa [smul_smul, inv_mul_cancel hc] using h.smul (c ⁻¹)
theorem lineDifferentiableWithinAt_smul_iff {c : 𝕜} (hc : c ≠ 0) :
    LineDifferentiableWithinAt 𝕜 f s x (c • v) ↔ LineDifferentiableWithinAt 𝕜 f s x v :=
  ⟨fun h ↦ by 

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
f : E → F
s : Set E
x v : E
f' : F
c : 𝕜
hc : c ≠ 0
h : LineDifferentiableWithinAt 𝕜 f s x (c • v)
⊢ LineDifferentiableWithinAt 𝕜 f s x v

Next tactic:
simpa [smul_smul, inv_mul_cancel hc] using h.smul (c ⁻¹)
theorem lineDifferentiableAt_smul_iff {c : 𝕜} (hc : c ≠ 0) :
    LineDifferentiableAt 𝕜 f x (c • v) ↔ LineDifferentiableAt 𝕜 f x v :=
  ⟨fun h ↦ by 

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
f : E → F
s : Set E
x v : E
f' : F
c : 𝕜
hc : c ≠ 0
h : LineDifferentiableAt 𝕜 f x (c • v)
⊢ LineDifferentiableAt 𝕜 f x v

Next tactic:
simpa [smul_smul, inv_mul_cancel hc] using h.smul (c ⁻¹)
theorem lineDeriv_smul {c : 𝕜} : lineDeriv 𝕜 f x (c • v) = c • lineDeriv 𝕜 f x v := by
  

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
f : E → F
s : Set E
x v : E
f' : F
c : 𝕜
⊢ lineDeriv 𝕜 f x (c • v) = c • lineDeriv 𝕜 f x v

Next tactic:
rcases eq_or_ne c 0 with rfl|hc
theorem lineDeriv_smul {c : 𝕜} : lineDeriv 𝕜 f x (c • v) = c • lineDeriv 𝕜 f x v := by
  rcases eq_or_ne c 0 with rfl|hc
  · 

Proof state:
case inl
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
f : E → F
s : Set E
x v : E
f' : F
⊢ lineDeriv 𝕜 f x (0 • v) = 0 • lineDeriv 𝕜 f x v

Next tactic:
simp [lineDeriv_zero]
theorem lineDeriv_smul {c : 𝕜} : lineDeriv 𝕜 f x (c • v) = c • lineDeriv 𝕜 f x v := by
  rcases eq_or_ne c 0 with rfl|hc
  · simp [lineDeriv_zero]
  

Proof state:
case inr
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
f : E → F
s : Set E
x v : E
f' : F
c : 𝕜
hc : c ≠ 0
⊢ lineDeriv 𝕜 f x (c • v) = c • lineDeriv 𝕜 f x v

Next tactic:
by_cases H : LineDifferentiableAt 𝕜 f x v
theorem lineDeriv_smul {c : 𝕜} : lineDeriv 𝕜 f x (c • v) = c • lineDeriv 𝕜 f x v := by
  rcases eq_or_ne c 0 with rfl|hc
  · simp [lineDeriv_zero]
  by_cases H : LineDifferentiableAt 𝕜 f x v
  · 

Proof state:
case pos
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
f : E → F
s : Set E
x v : E
f' : F
c : 𝕜
hc : c ≠ 0
H : LineDifferentiableAt 𝕜 f x v
⊢ lineDeriv 𝕜 f x (c • v) = c • lineDeriv 𝕜 f x v

Next tactic:
exact (H.hasLineDerivAt.smul c).lineDeriv
theorem lineDeriv_smul {c : 𝕜} : lineDeriv 𝕜 f x (c • v) = c • lineDeriv 𝕜 f x v := by
  rcases eq_or_ne c 0 with rfl|hc
  · simp [lineDeriv_zero]
  by_cases H : LineDifferentiableAt 𝕜 f x v
  · exact (H.hasLineDerivAt.smul c).lineDeriv
  · 

Proof state:
case neg
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
f : E → F
s : Set E
x v : E
f' : F
c : 𝕜
hc : c ≠ 0
H : ¬LineDifferentiableAt 𝕜 f x v
⊢ lineDeriv 𝕜 f x (c • v) = c • lineDeriv 𝕜 f x v

Next tactic:
have H' : ¬ (LineDifferentiableAt 𝕜 f x (c • v)) :=
      by simpa [lineDifferentiableAt_smul_iff hc] using H
theorem lineDeriv_smul {c : 𝕜} : lineDeriv 𝕜 f x (c • v) = c • lineDeriv 𝕜 f x v := by
  rcases eq_or_ne c 0 with rfl|hc
  · simp [lineDeriv_zero]
  by_cases H : LineDifferentiableAt 𝕜 f x v
  · exact (H.hasLineDerivAt.smul c).lineDeriv
  · have H' : ¬ (LineDifferentiableAt 𝕜 f x (c • v)) :=
      by 

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
f : E → F
s : Set E
x v : E
f' : F
c : 𝕜
hc : c ≠ 0
H : ¬LineDifferentiableAt 𝕜 f x v
⊢ ¬LineDifferentiableAt 𝕜 f x (c • v)

Next tactic:
simpa [lineDifferentiableAt_smul_iff hc] using H
theorem lineDeriv_smul {c : 𝕜} : lineDeriv 𝕜 f x (c • v) = c • lineDeriv 𝕜 f x v := by
  rcases eq_or_ne c 0 with rfl|hc
  · simp [lineDeriv_zero]
  by_cases H : LineDifferentiableAt 𝕜 f x v
  · exact (H.hasLineDerivAt.smul c).lineDeriv
  · have H' : ¬ (LineDifferentiableAt 𝕜 f x (c • v)) :=
      by simpa [lineDifferentiableAt_smul_iff hc] using H
    

Proof state:
case neg
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
f : E → F
s : Set E
x v : E
f' : F
c : 𝕜
hc : c ≠ 0
H : ¬LineDifferentiableAt 𝕜 f x v
H' : ¬LineDifferentiableAt 𝕜 f x (c • v)
⊢ lineDeriv 𝕜 f x (c • v) = c • lineDeriv 𝕜 f x v

Next tactic:
simp [lineDeriv_zero_of_not_lineDifferentiableAt, H, H']
theorem lineDeriv_neg : lineDeriv 𝕜 f x (-v) = - lineDeriv 𝕜 f x v := by
  

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
f : E → F
s : Set E
x v : E
f' : F
⊢ lineDeriv 𝕜 f x (-v) = -lineDeriv 𝕜 f x v

Next tactic:
rw [← neg_one_smul (R := 𝕜) v, lineDeriv_smul, neg_one_smul]
theorem Sbtw.dist_lt_max_dist (p : P) {p₁ p₂ p₃ : P} (h : Sbtw ℝ p₁ p₂ p₃) :
    dist p₂ p < max (dist p₁ p) (dist p₃ p) := by
  

Proof state:
V : Type u_1
P : Type u_2
inst✝⁴ : NormedAddCommGroup V
inst✝³ : NormedSpace ℝ V
inst✝² : StrictConvexSpace ℝ V
inst✝¹ : PseudoMetricSpace P
inst✝ : NormedAddTorsor V P
p p₁ p₂ p₃ : P
h : Sbtw ℝ p₁ p₂ p₃
⊢ dist p₂ p < max (dist p₁ p) (dist p₃ p)

Next tactic:
have hp₁p₃ : p₁ -ᵥ p ≠ p₃ -ᵥ p := by simpa using h.left_ne_right
theorem Sbtw.dist_lt_max_dist (p : P) {p₁ p₂ p₃ : P} (h : Sbtw ℝ p₁ p₂ p₃) :
    dist p₂ p < max (dist p₁ p) (dist p₃ p) := by
  have hp₁p₃ : p₁ -ᵥ p ≠ p₃ -ᵥ p := by 

Proof state:
V : Type u_1
P : Type u_2
inst✝⁴ : NormedAddCommGroup V
inst✝³ : NormedSpace ℝ V
inst✝² : StrictConvexSpace ℝ V
inst✝¹ : PseudoMetricSpace P
inst✝ : NormedAddTorsor V P
p p₁ p₂ p₃ : P
h : Sbtw ℝ p₁ p₂ p₃
⊢ p₁ -ᵥ p ≠ p₃ -ᵥ p

Next tactic:
simpa using h.left_ne_right
theorem Sbtw.dist_lt_max_dist (p : P) {p₁ p₂ p₃ : P} (h : Sbtw ℝ p₁ p₂ p₃) :
    dist p₂ p < max (dist p₁ p) (dist p₃ p) := by
  have hp₁p₃ : p₁ -ᵥ p ≠ p₃ -ᵥ p := by simpa using h.left_ne_right
  

Proof state:
V : Type u_1
P : Type u_2
inst✝⁴ : NormedAddCommGroup V
inst✝³ : NormedSpace ℝ V
inst✝² : StrictConvexSpace ℝ V
inst✝¹ : PseudoMetricSpace P
inst✝ : NormedAddTorsor V P
p p₁ p₂ p₃ : P
h : Sbtw ℝ p₁ p₂ p₃
hp₁p₃ : p₁ -ᵥ p ≠ p₃ -ᵥ p
⊢ dist p₂ p < max (dist p₁ p) (dist p₃ p)

Next tactic:
rw [Sbtw, ← wbtw_vsub_const_iff p, Wbtw, affineSegment_eq_segment, ← insert_endpoints_openSegment,
    Set.mem_insert_iff, Set.mem_insert_iff] at h
theorem Sbtw.dist_lt_max_dist (p : P) {p₁ p₂ p₃ : P} (h : Sbtw ℝ p₁ p₂ p₃) :
    dist p₂ p < max (dist p₁ p) (dist p₃ p) := by
  have hp₁p₃ : p₁ -ᵥ p ≠ p₃ -ᵥ p := by simpa using h.left_ne_right
  rw [Sbtw, ← wbtw_vsub_const_iff p, Wbtw, affineSegment_eq_segment, ← insert_endpoints_openSegment,
    Set.mem_insert_iff, Set.mem_insert_iff] at h
  

Proof state:
V : Type u_1
P : Type u_2
inst✝⁴ : NormedAddCommGroup V
inst✝³ : NormedSpace ℝ V
inst✝² : StrictConvexSpace ℝ V
inst✝¹ : PseudoMetricSpace P
inst✝ : NormedAddTorsor V P
p p₁ p₂ p₃ : P
h : (p₂ -ᵥ p = p₁ -ᵥ p ∨ p₂ -ᵥ p = p₃ -ᵥ p ∨ p₂ -ᵥ p ∈ openSegment ℝ (p₁ -ᵥ p) (p₃ -ᵥ p)) ∧ p₂ ≠ p₁ ∧ p₂ ≠ p₃
hp₁p₃ : p₁ -ᵥ p ≠ p₃ -ᵥ p
⊢ dist p₂ p < max (dist p₁ p) (dist p₃ p)

Next tactic:
rcases h with ⟨h | h | h, hp₂p₁, hp₂p₃⟩
theorem Sbtw.dist_lt_max_dist (p : P) {p₁ p₂ p₃ : P} (h : Sbtw ℝ p₁ p₂ p₃) :
    dist p₂ p < max (dist p₁ p) (dist p₃ p) := by
  have hp₁p₃ : p₁ -ᵥ p ≠ p₃ -ᵥ p := by simpa using h.left_ne_right
  rw [Sbtw, ← wbtw_vsub_const_iff p, Wbtw, affineSegment_eq_segment, ← insert_endpoints_openSegment,
    Set.mem_insert_iff, Set.mem_insert_iff] at h
  rcases h with ⟨h | h | h, hp₂p₁, hp₂p₃⟩
  · 

Proof state:
case intro.inl.intro
V : Type u_1
P : Type u_2
inst✝⁴ : NormedAddCommGroup V
inst✝³ : NormedSpace ℝ V
inst✝² : StrictConvexSpace ℝ V
inst✝¹ : PseudoMetricSpace P
inst✝ : NormedAddTorsor V P
p p₁ p₂ p₃ : P
hp₁p₃ : p₁ -ᵥ p ≠ p₃ -ᵥ p
h : p₂ -ᵥ p = p₁ -ᵥ p
hp₂p₁ : p₂ ≠ p₁
hp₂p₃ : p₂ ≠ p₃
⊢ dist p₂ p < max (dist p₁ p) (dist p₃ p)

Next tactic:
rw [vsub_left_cancel_iff] at h
theorem Sbtw.dist_lt_max_dist (p : P) {p₁ p₂ p₃ : P} (h : Sbtw ℝ p₁ p₂ p₃) :
    dist p₂ p < max (dist p₁ p) (dist p₃ p) := by
  have hp₁p₃ : p₁ -ᵥ p ≠ p₃ -ᵥ p := by simpa using h.left_ne_right
  rw [Sbtw, ← wbtw_vsub_const_iff p, Wbtw, affineSegment_eq_segment, ← insert_endpoints_openSegment,
    Set.mem_insert_iff, Set.mem_insert_iff] at h
  rcases h with ⟨h | h | h, hp₂p₁, hp₂p₃⟩
  · rw [vsub_left_cancel_iff] at h
    

Proof state:
case intro.inl.intro
V : Type u_1
P : Type u_2
inst✝⁴ : NormedAddCommGroup V
inst✝³ : NormedSpace ℝ V
inst✝² : StrictConvexSpace ℝ V
inst✝¹ : PseudoMetricSpace P
inst✝ : NormedAddTorsor V P
p p₁ p₂ p₃ : P
hp₁p₃ : p₁ -ᵥ p ≠ p₃ -ᵥ p
h : p₂ = p₁
hp₂p₁ : p₂ ≠ p₁
hp₂p₃ : p₂ ≠ p₃
⊢ dist p₂ p < max (dist p₁ p) (dist p₃ p)

Next tactic:
exact False.elim (hp₂p₁ h)
theorem Sbtw.dist_lt_max_dist (p : P) {p₁ p₂ p₃ : P} (h : Sbtw ℝ p₁ p₂ p₃) :
    dist p₂ p < max (dist p₁ p) (dist p₃ p) := by
  have hp₁p₃ : p₁ -ᵥ p ≠ p₃ -ᵥ p := by simpa using h.left_ne_right
  rw [Sbtw, ← wbtw_vsub_const_iff p, Wbtw, affineSegment_eq_segment, ← insert_endpoints_openSegment,
    Set.mem_insert_iff, Set.mem_insert_iff] at h
  rcases h with ⟨h | h | h, hp₂p₁, hp₂p₃⟩
  · rw [vsub_left_cancel_iff] at h
    exact False.elim (hp₂p₁ h)
  · 

Proof state:
case intro.inr.inl.intro
V : Type u_1
P : Type u_2
inst✝⁴ : NormedAddCommGroup V
inst✝³ : NormedSpace ℝ V
inst✝² : StrictConvexSpace ℝ V
inst✝¹ : PseudoMetricSpace P
inst✝ : NormedAddTorsor V P
p p₁ p₂ p₃ : P
hp₁p₃ : p₁ -ᵥ p ≠ p₃ -ᵥ p
h : p₂ -ᵥ p = p₃ -ᵥ p
hp₂p₁ : p₂ ≠ p₁
hp₂p₃ : p₂ ≠ p₃
⊢ dist p₂ p < max (dist p₁ p) (dist p₃ p)

Next tactic:
rw [vsub_left_cancel_iff] at h