l3lab/ntp-mathlib huggingface dataset:
/-- When `IsEmpty ι`, this lemma does not hold without the additional assumption `p ≠ ∞` because
the left-hand side simplifies to `0`, while the right-hand side simplifies to `‖b‖₊`. See
`PiLp.nnnorm_equiv_symm_const` for a version which exchanges the hypothesis `Nonempty ι`.
for `p ≠ ∞`. -/
theorem nnnorm_equiv_symm_const' {β} [SeminormedAddCommGroup β] [Nonempty ι] (b : β) :
    ‖(WithLp.equiv p (ι → β)).symm (Function.const _ b)‖₊ =
      (Fintype.card ι : ℝ≥0) ^ (1 / p).toReal * ‖b‖₊ := by
  clear x y -- Porting note: added to avoid spurious arguments
  

Proof state:
p : ℝ≥0∞
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β✝ : ι → Type u_5
inst✝¹⁰ : Fintype ι
inst✝⁹ : Fact (1 ≤ p)
inst✝⁸ : NormedField 𝕜
inst✝⁷ : NormedField 𝕜'
inst✝⁶ : (i : ι) → SeminormedAddCommGroup (β✝ i)
inst✝⁵ : (i : ι) → NormedSpace 𝕜 (β✝ i)
c : 𝕜
x' y' : (i : ι) → β✝ i
i : ι
ι' : Type u_6
inst✝⁴ : Fintype ι'
E : Type u_7
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace 𝕜 E
β : Type u_8
inst✝¹ : SeminormedAddCommGroup β
inst✝ : Nonempty ι
b : β
⊢ ‖(WithLp.equiv p (ι → β)).symm (Function.const ι b)‖₊ = ↑(Fintype.card ι) ^ ENNReal.toReal (1 / p) * ‖b‖₊

Next tactic:
rcases em <| p = ∞ with (rfl | hp)
/-- When `IsEmpty ι`, this lemma does not hold without the additional assumption `p ≠ ∞` because
the left-hand side simplifies to `0`, while the right-hand side simplifies to `‖b‖₊`. See
`PiLp.nnnorm_equiv_symm_const` for a version which exchanges the hypothesis `Nonempty ι`.
for `p ≠ ∞`. -/
theorem nnnorm_equiv_symm_const' {β} [SeminormedAddCommGroup β] [Nonempty ι] (b : β) :
    ‖(WithLp.equiv p (ι → β)).symm (Function.const _ b)‖₊ =
      (Fintype.card ι : ℝ≥0) ^ (1 / p).toReal * ‖b‖₊ := by
  clear x y -- Porting note: added to avoid spurious arguments
  rcases em <| p = ∞ with (rfl | hp)
  · 

Proof state:
case inl
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β✝ : ι → Type u_5
inst✝¹⁰ : Fintype ι
inst✝⁹ : NormedField 𝕜
inst✝⁸ : NormedField 𝕜'
inst✝⁷ : (i : ι) → SeminormedAddCommGroup (β✝ i)
inst✝⁶ : (i : ι) → NormedSpace 𝕜 (β✝ i)
c : 𝕜
x' y' : (i : ι) → β✝ i
i : ι
ι' : Type u_6
inst✝⁵ : Fintype ι'
E : Type u_7
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace 𝕜 E
β : Type u_8
inst✝² : SeminormedAddCommGroup β
inst✝¹ : Nonempty ι
b : β
inst✝ : Fact (1 ≤ ⊤)
⊢ ‖(WithLp.equiv ⊤ (ι → β)).symm (Function.const ι b)‖₊ = ↑(Fintype.card ι) ^ ENNReal.toReal (1 / ⊤) * ‖b‖₊

Next tactic:
simp only [WithLp.equiv_symm_pi_apply, ENNReal.div_top, ENNReal.zero_toReal, NNReal.rpow_zero,
      one_mul, nnnorm_eq_ciSup, Function.const_apply, ciSup_const]
/-- When `IsEmpty ι`, this lemma does not hold without the additional assumption `p ≠ ∞` because
the left-hand side simplifies to `0`, while the right-hand side simplifies to `‖b‖₊`. See
`PiLp.nnnorm_equiv_symm_const` for a version which exchanges the hypothesis `Nonempty ι`.
for `p ≠ ∞`. -/
theorem nnnorm_equiv_symm_const' {β} [SeminormedAddCommGroup β] [Nonempty ι] (b : β) :
    ‖(WithLp.equiv p (ι → β)).symm (Function.const _ b)‖₊ =
      (Fintype.card ι : ℝ≥0) ^ (1 / p).toReal * ‖b‖₊ := by
  clear x y -- Porting note: added to avoid spurious arguments
  rcases em <| p = ∞ with (rfl | hp)
  · simp only [WithLp.equiv_symm_pi_apply, ENNReal.div_top, ENNReal.zero_toReal, NNReal.rpow_zero,
      one_mul, nnnorm_eq_ciSup, Function.const_apply, ciSup_const]
  · 

Proof state:
case inr
p : ℝ≥0∞
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β✝ : ι → Type u_5
inst✝¹⁰ : Fintype ι
inst✝⁹ : Fact (1 ≤ p)
inst✝⁸ : NormedField 𝕜
inst✝⁷ : NormedField 𝕜'
inst✝⁶ : (i : ι) → SeminormedAddCommGroup (β✝ i)
inst✝⁵ : (i : ι) → NormedSpace 𝕜 (β✝ i)
c : 𝕜
x' y' : (i : ι) → β✝ i
i : ι
ι' : Type u_6
inst✝⁴ : Fintype ι'
E : Type u_7
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace 𝕜 E
β : Type u_8
inst✝¹ : SeminormedAddCommGroup β
inst✝ : Nonempty ι
b : β
hp : ¬p = ⊤
⊢ ‖(WithLp.equiv p (ι → β)).symm (Function.const ι b)‖₊ = ↑(Fintype.card ι) ^ ENNReal.toReal (1 / p) * ‖b‖₊

Next tactic:
exact nnnorm_equiv_symm_const hp b
/-- When `p = ∞`, this lemma does not hold without the additional assumption `Nonempty ι` because
the left-hand side simplifies to `0`, while the right-hand side simplifies to `‖b‖₊`. See
`PiLp.norm_equiv_symm_const'` for a version which exchanges the hypothesis `p ≠ ∞` for
`Nonempty ι`. -/
theorem norm_equiv_symm_const {β} [SeminormedAddCommGroup β] (hp : p ≠ ∞) (b : β) :
    ‖(WithLp.equiv p (ι → β)).symm (Function.const _ b)‖ =
      (Fintype.card ι : ℝ≥0) ^ (1 / p).toReal * ‖b‖ :=
  (congr_arg ((↑) : ℝ≥0 → ℝ) <| nnnorm_equiv_symm_const hp b).trans <| by 

Proof state:
p : ℝ≥0∞
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β✝ : ι → Type u_5
inst✝⁹ : Fintype ι
inst✝⁸ : Fact (1 ≤ p)
inst✝⁷ : NormedField 𝕜
inst✝⁶ : NormedField 𝕜'
inst✝⁵ : (i : ι) → SeminormedAddCommGroup (β✝ i)
inst✝⁴ : (i : ι) → NormedSpace 𝕜 (β✝ i)
c : 𝕜
x y : PiLp p β✝
x' y' : (i : ι) → β✝ i
i : ι
ι' : Type u_6
inst✝³ : Fintype ι'
E : Type u_7
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace 𝕜 E
β : Type u_8
inst✝ : SeminormedAddCommGroup β
hp : p ≠ ⊤
b : β
⊢ ↑(↑(Fintype.card ι) ^ ENNReal.toReal (1 / p) * ‖b‖₊) = ↑↑(Fintype.card ι) ^ ENNReal.toReal (1 / p) * ‖b‖

Next tactic:
simp
/-- When `IsEmpty ι`, this lemma does not hold without the additional assumption `p ≠ ∞` because
the left-hand side simplifies to `0`, while the right-hand side simplifies to `‖b‖₊`. See
`PiLp.norm_equiv_symm_const` for a version which exchanges the hypothesis `Nonempty ι`.
for `p ≠ ∞`. -/
theorem norm_equiv_symm_const' {β} [SeminormedAddCommGroup β] [Nonempty ι] (b : β) :
    ‖(WithLp.equiv p (ι → β)).symm (Function.const _ b)‖ =
      (Fintype.card ι : ℝ≥0) ^ (1 / p).toReal * ‖b‖ :=
  (congr_arg ((↑) : ℝ≥0 → ℝ) <| nnnorm_equiv_symm_const' b).trans <| by 

Proof state:
p : ℝ≥0∞
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β✝ : ι → Type u_5
inst✝¹⁰ : Fintype ι
inst✝⁹ : Fact (1 ≤ p)
inst✝⁸ : NormedField 𝕜
inst✝⁷ : NormedField 𝕜'
inst✝⁶ : (i : ι) → SeminormedAddCommGroup (β✝ i)
inst✝⁵ : (i : ι) → NormedSpace 𝕜 (β✝ i)
c : 𝕜
x y : PiLp p β✝
x' y' : (i : ι) → β✝ i
i : ι
ι' : Type u_6
inst✝⁴ : Fintype ι'
E : Type u_7
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace 𝕜 E
β : Type u_8
inst✝¹ : SeminormedAddCommGroup β
inst✝ : Nonempty ι
b : β
⊢ ↑(↑(Fintype.card ι) ^ ENNReal.toReal (1 / p) * ‖b‖₊) = ↑↑(Fintype.card ι) ^ ENNReal.toReal (1 / p) * ‖b‖

Next tactic:
simp
@[simp]
theorem basisFun_apply [DecidableEq ι] (i) :
    basisFun p 𝕜 ι i = (WithLp.equiv p _).symm (Pi.single i 1) := by
  

Proof state:
p : ℝ≥0∞
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β : ι → Type u_5
inst✝⁹ : Fintype ι
inst✝⁸ : Fact (1 ≤ p)
inst✝⁷ : NormedField 𝕜
inst✝⁶ : NormedField 𝕜'
inst✝⁵ : (i : ι) → SeminormedAddCommGroup (β i)
inst✝⁴ : (i : ι) → NormedSpace 𝕜 (β i)
c : 𝕜
x y : PiLp p β
x' y' : (i : ι) → β i
i✝ : ι
ι' : Type u_6
inst✝³ : Fintype ι'
E : Type u_7
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace 𝕜 E
inst✝ : DecidableEq ι
i : ι
⊢ (basisFun p 𝕜 ι) i = (WithLp.equiv p ((j : ι) → (fun x => 𝕜) j)).symm (Pi.single i 1)

Next tactic:
simp_rw [basisFun, Basis.coe_ofEquivFun, WithLp.linearEquiv_symm_apply, Pi.single]
nonrec theorem basis_toMatrix_basisFun_mul (b : Basis ι 𝕜 (PiLp p fun _ : ι => 𝕜))
    (A : Matrix ι ι 𝕜) :
    b.toMatrix (PiLp.basisFun _ _ _) * A =
      Matrix.of fun i j => b.repr ((WithLp.equiv _ _).symm (Aᵀ j)) i := by
  

Proof state:
p : ℝ≥0∞
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β : ι → Type u_5
inst✝⁸ : Fintype ι
inst✝⁷ : Fact (1 ≤ p)
inst✝⁶ : NormedField 𝕜
inst✝⁵ : NormedField 𝕜'
inst✝⁴ : (i : ι) → SeminormedAddCommGroup (β i)
inst✝³ : (i : ι) → NormedSpace 𝕜 (β i)
c : 𝕜
x y : PiLp p β
x' y' : (i : ι) → β i
i : ι
ι' : Type u_6
inst✝² : Fintype ι'
E : Type u_7
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
b : Basis ι 𝕜 (PiLp p fun x => 𝕜)
A : Matrix ι ι 𝕜
⊢ Basis.toMatrix b ⇑(basisFun p 𝕜 ι) * A =
    of fun i j => (b.repr ((WithLp.equiv p ((i : ι) → (fun x => 𝕜) i)).symm (Aᵀ j))) i

Next tactic:
have := basis_toMatrix_basisFun_mul (b.map (WithLp.linearEquiv _ 𝕜 _)) A
nonrec theorem basis_toMatrix_basisFun_mul (b : Basis ι 𝕜 (PiLp p fun _ : ι => 𝕜))
    (A : Matrix ι ι 𝕜) :
    b.toMatrix (PiLp.basisFun _ _ _) * A =
      Matrix.of fun i j => b.repr ((WithLp.equiv _ _).symm (Aᵀ j)) i := by
  have := basis_toMatrix_basisFun_mul (b.map (WithLp.linearEquiv _ 𝕜 _)) A
  

Proof state:
p : ℝ≥0∞
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β : ι → Type u_5
inst✝⁸ : Fintype ι
inst✝⁷ : Fact (1 ≤ p)
inst✝⁶ : NormedField 𝕜
inst✝⁵ : NormedField 𝕜'
inst✝⁴ : (i : ι) → SeminormedAddCommGroup (β i)
inst✝³ : (i : ι) → NormedSpace 𝕜 (β i)
c : 𝕜
x y : PiLp p β
x' y' : (i : ι) → β i
i : ι
ι' : Type u_6
inst✝² : Fintype ι'
E : Type u_7
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
b : Basis ι 𝕜 (PiLp p fun x => 𝕜)
A : Matrix ι ι 𝕜
this :
  Basis.toMatrix (Basis.map b (WithLp.linearEquiv p 𝕜 ((i : ι) → (fun x => 𝕜) i))) ⇑(Pi.basisFun 𝕜 ι) * A =
    of fun i j => ((Basis.map b (WithLp.linearEquiv p 𝕜 ((i : ι) → (fun x => 𝕜) i))).repr (Aᵀ j)) i
⊢ Basis.toMatrix b ⇑(basisFun p 𝕜 ι) * A =
    of fun i j => (b.repr ((WithLp.equiv p ((i : ι) → (fun x => 𝕜) i)).symm (Aᵀ j))) i

Next tactic:
simp_rw [← PiLp.basisFun_map p, Basis.map_repr, LinearEquiv.trans_apply,
    WithLp.linearEquiv_symm_apply, Basis.toMatrix_map, Function.comp, Basis.map_apply,
    LinearEquiv.symm_apply_apply] at this
nonrec theorem basis_toMatrix_basisFun_mul (b : Basis ι 𝕜 (PiLp p fun _ : ι => 𝕜))
    (A : Matrix ι ι 𝕜) :
    b.toMatrix (PiLp.basisFun _ _ _) * A =
      Matrix.of fun i j => b.repr ((WithLp.equiv _ _).symm (Aᵀ j)) i := by
  have := basis_toMatrix_basisFun_mul (b.map (WithLp.linearEquiv _ 𝕜 _)) A
  simp_rw [← PiLp.basisFun_map p, Basis.map_repr, LinearEquiv.trans_apply,
    WithLp.linearEquiv_symm_apply, Basis.toMatrix_map, Function.comp, Basis.map_apply,
    LinearEquiv.symm_apply_apply] at this
  

Proof state:
p : ℝ≥0∞
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β : ι → Type u_5
inst✝⁸ : Fintype ι
inst✝⁷ : Fact (1 ≤ p)
inst✝⁶ : NormedField 𝕜
inst✝⁵ : NormedField 𝕜'
inst✝⁴ : (i : ι) → SeminormedAddCommGroup (β i)
inst✝³ : (i : ι) → NormedSpace 𝕜 (β i)
c : 𝕜
x y : PiLp p β
x' y' : (i : ι) → β i
i : ι
ι' : Type u_6
inst✝² : Fintype ι'
E : Type u_7
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
b : Basis ι 𝕜 (PiLp p fun x => 𝕜)
A : Matrix ι ι 𝕜
this :
  (Basis.toMatrix b fun x => (basisFun p 𝕜 ι) x) * A = of fun i j => (b.repr ((WithLp.equiv p (ι → 𝕜)).symm (Aᵀ j))) i
⊢ Basis.toMatrix b ⇑(basisFun p 𝕜 ι) * A =
    of fun i j => (b.repr ((WithLp.equiv p ((i : ι) → (fun x => 𝕜) i)).symm (Aᵀ j))) i

Next tactic:
exact this
instance smoothFunctionsAlgebra : Algebra 𝕜 C^∞⟮I, M; 𝕜⟯ := by 

Proof state:
𝕜 : Type u_1
inst✝⁵ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace 𝕜 E
H : Type u_3
inst✝² : TopologicalSpace H
I : ModelWithCorners 𝕜 E H
M : Type u_4
inst✝¹ : TopologicalSpace M
inst✝ : ChartedSpace H M
n : ℕ∞
⊢ Algebra 𝕜 C^⊤⟮I, M; 𝓘(𝕜, 𝕜), 𝕜⟯

Next tactic:
infer_instance
instance smooth_functions_tower : IsScalarTower 𝕜 C^∞⟮I, M; 𝕜⟯ C^∞⟮I, M; 𝕜⟯ := by 

Proof state:
𝕜 : Type u_1
inst✝⁵ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace 𝕜 E
H : Type u_3
inst✝² : TopologicalSpace H
I : ModelWithCorners 𝕜 E H
M : Type u_4
inst✝¹ : TopologicalSpace M
inst✝ : ChartedSpace H M
n : ℕ∞
⊢ IsScalarTower 𝕜 C^⊤⟮I, M; 𝓘(𝕜, 𝕜), 𝕜⟯ C^⊤⟮I, M; 𝓘(𝕜, 𝕜), 𝕜⟯

Next tactic:
infer_instance
instance (x : M) : IsScalarTower 𝕜 C^∞⟮I, M; 𝕜⟯⟨x⟩ 𝕜 where
  smul_assoc k f h := by
    

Proof state:
𝕜 : Type u_1
inst✝⁵ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace 𝕜 E
H : Type u_3
inst✝² : TopologicalSpace H
I : ModelWithCorners 𝕜 E H
M : Type u_4
inst✝¹ : TopologicalSpace M
inst✝ : ChartedSpace H M
n : ℕ∞
x : M
k : 𝕜
f : C^⊤⟮I, M; 𝕜⟯⟨x⟩
h : 𝕜
⊢ (k • f) • h = k • f • h

Next tactic:
rw [smul_def, smul_def, SmoothMap.coe_smul, Pi.smul_apply, smul_eq_mul, smul_eq_mul, mul_assoc]
/-- The heterogeneous differential as a linear map. Instead of taking a function as an argument this
differential takes `h : f x = y`. It is particularly handy to deal with situations where the points
on where it has to be evaluated are equal but not definitionally equal. -/
def hfdifferential {f : C^∞⟮I, M; I', M'⟯} {x : M} {y : M'} (h : f x = y) :
    PointDerivation I x →ₗ[𝕜] PointDerivation I' y where
  toFun v :=
    Derivation.mk'
      { toFun := fun g => v (g.comp f)
        map_add' := fun g g' => by 

Proof state:
𝕜 : Type u_1
inst✝¹⁰ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedSpace 𝕜 E
H : Type u_3
inst✝⁷ : TopologicalSpace H
I : ModelWithCorners 𝕜 E H
M : Type u_4
inst✝⁶ : TopologicalSpace M
inst✝⁵ : ChartedSpace H M
n : ℕ∞
X Y : Derivation 𝕜 C^⊤⟮I, M; 𝓘(𝕜, 𝕜), 𝕜⟯ C^⊤⟮I, M; 𝓘(𝕜, 𝕜), 𝕜⟯
f✝ g✝ : C^⊤⟮I, M; 𝓘(𝕜, 𝕜), 𝕜⟯
r : 𝕜
E' : Type u_5
inst✝⁴ : NormedAddCommGroup E'
inst✝³ : NormedSpace 𝕜 E'
H' : Type u_6
inst✝² : TopologicalSpace H'
I' : ModelWithCorners 𝕜 E' H'
M' : Type u_7
inst✝¹ : TopologicalSpace M'
inst✝ : ChartedSpace H' M'
f : C^⊤⟮I, M; I', M'⟯
x : M
y : M'
h : f x = y
v : PointDerivation I x
g g' : C^⊤⟮I', M'; 𝕜⟯⟨y⟩
⊢ (fun g => v (ContMDiffMap.comp g f)) (g + g') =
    (fun g => v (ContMDiffMap.comp g f)) g + (fun g => v (ContMDiffMap.comp g f)) g'

Next tactic:
dsimp
/-- The heterogeneous differential as a linear map. Instead of taking a function as an argument this
differential takes `h : f x = y`. It is particularly handy to deal with situations where the points
on where it has to be evaluated are equal but not definitionally equal. -/
def hfdifferential {f : C^∞⟮I, M; I', M'⟯} {x : M} {y : M'} (h : f x = y) :
    PointDerivation I x →ₗ[𝕜] PointDerivation I' y where
  toFun v :=
    Derivation.mk'
      { toFun := fun g => v (g.comp f)
        map_add' := fun g g' => by dsimp; 

Proof state:
𝕜 : Type u_1
inst✝¹⁰ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedSpace 𝕜 E
H : Type u_3
inst✝⁷ : TopologicalSpace H
I : ModelWithCorners 𝕜 E H
M : Type u_4
inst✝⁶ : TopologicalSpace M
inst✝⁵ : ChartedSpace H M
n : ℕ∞
X Y : Derivation 𝕜 C^⊤⟮I, M; 𝓘(𝕜, 𝕜), 𝕜⟯ C^⊤⟮I, M; 𝓘(𝕜, 𝕜), 𝕜⟯
f✝ g✝ : C^⊤⟮I, M; 𝓘(𝕜, 𝕜), 𝕜⟯
r : 𝕜
E' : Type u_5
inst✝⁴ : NormedAddCommGroup E'
inst✝³ : NormedSpace 𝕜 E'
H' : Type u_6
inst✝² : TopologicalSpace H'
I' : ModelWithCorners 𝕜 E' H'
M' : Type u_7
inst✝¹ : TopologicalSpace M'
inst✝ : ChartedSpace H' M'
f : C^⊤⟮I, M; I', M'⟯
x : M
y : M'
h : f x = y
v : PointDerivation I x
g g' : C^⊤⟮I', M'; 𝕜⟯⟨y⟩
⊢ v (ContMDiffMap.comp (g + g') f) = v (ContMDiffMap.comp g f) + v (ContMDiffMap.comp g' f)

Next tactic:
rw [SmoothMap.add_comp, Derivation.map_add]
/-- The heterogeneous differential as a linear map. Instead of taking a function as an argument this
differential takes `h : f x = y`. It is particularly handy to deal with situations where the points
on where it has to be evaluated are equal but not definitionally equal. -/
def hfdifferential {f : C^∞⟮I, M; I', M'⟯} {x : M} {y : M'} (h : f x = y) :
    PointDerivation I x →ₗ[𝕜] PointDerivation I' y where
  toFun v :=
    Derivation.mk'
      { toFun := fun g => v (g.comp f)
        map_add' := fun g g' => by dsimp; rw [SmoothMap.add_comp, Derivation.map_add]
        map_smul' := fun k g => by
          

Proof state:
𝕜 : Type u_1
inst✝¹⁰ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedSpace 𝕜 E
H : Type u_3
inst✝⁷ : TopologicalSpace H
I : ModelWithCorners 𝕜 E H
M : Type u_4
inst✝⁶ : TopologicalSpace M
inst✝⁵ : ChartedSpace H M
n : ℕ∞
X Y : Derivation 𝕜 C^⊤⟮I, M; 𝓘(𝕜, 𝕜), 𝕜⟯ C^⊤⟮I, M; 𝓘(𝕜, 𝕜), 𝕜⟯
f✝ g✝ : C^⊤⟮I, M; 𝓘(𝕜, 𝕜), 𝕜⟯
r : 𝕜
E' : Type u_5
inst✝⁴ : NormedAddCommGroup E'
inst✝³ : NormedSpace 𝕜 E'
H' : Type u_6
inst✝² : TopologicalSpace H'
I' : ModelWithCorners 𝕜 E' H'
M' : Type u_7
inst✝¹ : TopologicalSpace M'
inst✝ : ChartedSpace H' M'
f : C^⊤⟮I, M; I', M'⟯
x : M
y : M'
h : f x = y
v : PointDerivation I x
k : 𝕜
g : C^⊤⟮I', M'; 𝕜⟯⟨y⟩
⊢ AddHom.toFun
      { toFun := fun g => v (ContMDiffMap.comp g f),
        map_add' :=
          (_ :
            ∀ (g g' : C^⊤⟮I', M'; 𝕜⟯⟨y⟩),
              (fun g => v (ContMDiffMap.comp g f)) (g + g') =
                (fun g => v (ContMDiffMap.comp g f)) g + (fun g => v (ContMDiffMap.comp g f)) g') }
      (k • g) =
    (RingHom.id 𝕜) k •
      AddHom.toFun
        { toFun := fun g => v (ContMDiffMap.comp g f),
          map_add' :=
            (_ :
              ∀ (g g' : C^⊤⟮I', M'; 𝕜⟯⟨y⟩),
                (fun g => v (ContMDiffMap.comp g f)) (g + g') =
                  (fun g => v (ContMDiffMap.comp g f)) g + (fun g => v (ContMDiffMap.comp g f)) g') }
        g

Next tactic:
dsimp
/-- The heterogeneous differential as a linear map. Instead of taking a function as an argument this
differential takes `h : f x = y`. It is particularly handy to deal with situations where the points
on where it has to be evaluated are equal but not definitionally equal. -/
def hfdifferential {f : C^∞⟮I, M; I', M'⟯} {x : M} {y : M'} (h : f x = y) :
    PointDerivation I x →ₗ[𝕜] PointDerivation I' y where
  toFun v :=
    Derivation.mk'
      { toFun := fun g => v (g.comp f)
        map_add' := fun g g' => by dsimp; rw [SmoothMap.add_comp, Derivation.map_add]
        map_smul' := fun k g => by
          dsimp; 

Proof state:
𝕜 : Type u_1
inst✝¹⁰ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedSpace 𝕜 E
H : Type u_3
inst✝⁷ : TopologicalSpace H
I : ModelWithCorners 𝕜 E H
M : Type u_4
inst✝⁶ : TopologicalSpace M
inst✝⁵ : ChartedSpace H M
n : ℕ∞
X Y : Derivation 𝕜 C^⊤⟮I, M; 𝓘(𝕜, 𝕜), 𝕜⟯ C^⊤⟮I, M; 𝓘(𝕜, 𝕜), 𝕜⟯
f✝ g✝ : C^⊤⟮I, M; 𝓘(𝕜, 𝕜), 𝕜⟯
r : 𝕜
E' : Type u_5
inst✝⁴ : NormedAddCommGroup E'
inst✝³ : NormedSpace 𝕜 E'
H' : Type u_6
inst✝² : TopologicalSpace H'
I' : ModelWithCorners 𝕜 E' H'
M' : Type u_7
inst✝¹ : TopologicalSpace M'
inst✝ : ChartedSpace H' M'
f : C^⊤⟮I, M; I', M'⟯
x : M
y : M'
h : f x = y
v : PointDerivation I x
k : 𝕜
g : C^⊤⟮I', M'; 𝕜⟯⟨y⟩
⊢ v (ContMDiffMap.comp (k • g) f) = k * v (ContMDiffMap.comp g f)

Next tactic:
rw [SmoothMap.smul_comp, Derivation.map_smul, smul_eq_mul]
/-- The heterogeneous differential as a linear map. Instead of taking a function as an argument this
differential takes `h : f x = y`. It is particularly handy to deal with situations where the points
on where it has to be evaluated are equal but not definitionally equal. -/
def hfdifferential {f : C^∞⟮I, M; I', M'⟯} {x : M} {y : M'} (h : f x = y) :
    PointDerivation I x →ₗ[𝕜] PointDerivation I' y where
  toFun v :=
    Derivation.mk'
      { toFun := fun g => v (g.comp f)
        map_add' := fun g g' => by dsimp; rw [SmoothMap.add_comp, Derivation.map_add]
        map_smul' := fun k g => by
          dsimp; rw [SmoothMap.smul_comp, Derivation.map_smul, smul_eq_mul] }
      fun g g' => by
        dsimp
        

Proof state:
𝕜 : Type u_1
inst✝¹⁰ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedSpace 𝕜 E
H : Type u_3
inst✝⁷ : TopologicalSpace H
I : ModelWithCorners 𝕜 E H
M : Type u_4
inst✝⁶ : TopologicalSpace M
inst✝⁵ : ChartedSpace H M
n : ℕ∞
X Y : Derivation 𝕜 C^⊤⟮I, M; 𝓘(𝕜, 𝕜), 𝕜⟯ C^⊤⟮I, M; 𝓘(𝕜, 𝕜), 𝕜⟯
f✝ g✝ : C^⊤⟮I, M; 𝓘(𝕜, 𝕜), 𝕜⟯
r : 𝕜
E' : Type u_5
inst✝⁴ : NormedAddCommGroup E'
inst✝³ : NormedSpace 𝕜 E'
H' : Type u_6
inst✝² : TopologicalSpace H'
I' : ModelWithCorners 𝕜 E' H'
M' : Type u_7
inst✝¹ : TopologicalSpace M'
inst✝ : ChartedSpace H' M'
f : C^⊤⟮I, M; I', M'⟯
x : M
y : M'
h : f x = y
v : PointDerivation I x
g g' : C^⊤⟮I', M'; 𝕜⟯⟨y⟩
⊢ v (ContMDiffMap.comp (g * g') f) = g • v (ContMDiffMap.comp g' f) + g' • v (ContMDiffMap.comp g f)

Next tactic:
rw [SmoothMap.mul_comp, Derivation.leibniz,
          PointedSmoothMap.smul_def, ContMDiffMap.comp_apply,
          PointedSmoothMap.smul_def, ContMDiffMap.comp_apply, h]
/-- The heterogeneous differential as a linear map. Instead of taking a function as an argument this
differential takes `h : f x = y`. It is particularly handy to deal with situations where the points
on where it has to be evaluated are equal but not definitionally equal. -/
def hfdifferential {f : C^∞⟮I, M; I', M'⟯} {x : M} {y : M'} (h : f x = y) :
    PointDerivation I x →ₗ[𝕜] PointDerivation I' y where
  toFun v :=
    Derivation.mk'
      { toFun := fun g => v (g.comp f)
        map_add' := fun g g' => by dsimp; rw [SmoothMap.add_comp, Derivation.map_add]
        map_smul' := fun k g => by
          dsimp; rw [SmoothMap.smul_comp, Derivation.map_smul, smul_eq_mul] }
      fun g g' => by
        dsimp
        rw [SmoothMap.mul_comp, Derivation.leibniz,
          PointedSmoothMap.smul_def, ContMDiffMap.comp_apply,
          PointedSmoothMap.smul_def, ContMDiffMap.comp_apply, h]
        

Proof state:
𝕜 : Type u_1
inst✝¹⁰ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedSpace 𝕜 E
H : Type u_3
inst✝⁷ : TopologicalSpace H
I : ModelWithCorners 𝕜 E H
M : Type u_4
inst✝⁶ : TopologicalSpace M
inst✝⁵ : ChartedSpace H M
n : ℕ∞
X Y : Derivation 𝕜 C^⊤⟮I, M; 𝓘(𝕜, 𝕜), 𝕜⟯ C^⊤⟮I, M; 𝓘(𝕜, 𝕜), 𝕜⟯
f✝ g✝ : C^⊤⟮I, M; 𝓘(𝕜, 𝕜), 𝕜⟯
r : 𝕜
E' : Type u_5
inst✝⁴ : NormedAddCommGroup E'
inst✝³ : NormedSpace 𝕜 E'
H' : Type u_6
inst✝² : TopologicalSpace H'
I' : ModelWithCorners 𝕜 E' H'
M' : Type u_7
inst✝¹ : TopologicalSpace M'
inst✝ : ChartedSpace H' M'
f : C^⊤⟮I, M; I', M'⟯
x : M
y : M'
h : f x = y
v : PointDerivation I x
g g' : C^⊤⟮I', M'; 𝕜⟯⟨y⟩
⊢ g y * v (ContMDiffMap.comp g' f) + g' y * v (ContMDiffMap.comp g f) =
    g • v (ContMDiffMap.comp g' f) + g' • v (ContMDiffMap.comp g f)

Next tactic:
norm_cast
@[to_additive]
theorem mulIndicator_eventuallyEq (hf : f =ᶠ[l ⊓ 𝓟 s] g) (hs : s =ᶠ[l] t) :
    mulIndicator s f =ᶠ[l] mulIndicator t g :=
  (eventually_inf_principal.1 hf).mp <| hs.mem_iff.mono fun x hst hfg =>
    by_cases
      (fun hxs : x ∈ s => by 

Proof state:
α : Type u_1
β : Type u_2
M : Type u_3
E : Type u_4
inst✝ : One M
s t : Set α
f g : α → M
a : α
l : Filter α
hf : f =ᶠ[l ⊓ 𝓟 s] g
hs : s =ᶠ[l] t
x : α
hst : x ∈ s ↔ x ∈ t
hfg : x ∈ s → f x = g x
hxs : x ∈ s
⊢ mulIndicator s f x = mulIndicator t g x

Next tactic:
simp only [*, hst.1 hxs, mulIndicator_of_mem]
@[to_additive]
theorem mulIndicator_eventuallyEq (hf : f =ᶠ[l ⊓ 𝓟 s] g) (hs : s =ᶠ[l] t) :
    mulIndicator s f =ᶠ[l] mulIndicator t g :=
  (eventually_inf_principal.1 hf).mp <| hs.mem_iff.mono fun x hst hfg =>
    by_cases
      (fun hxs : x ∈ s => by simp only [*, hst.1 hxs, mulIndicator_of_mem])
      (fun hxs => by 

Proof state:
α : Type u_1
β : Type u_2
M : Type u_3
E : Type u_4
inst✝ : One M
s t : Set α
f g : α → M
a : α
l : Filter α
hf : f =ᶠ[l ⊓ 𝓟 s] g
hs : s =ᶠ[l] t
x : α
hst : x ∈ s ↔ x ∈ t
hfg : x ∈ s → f x = g x
hxs : x ∉ s
⊢ mulIndicator s f x = mulIndicator t g x

Next tactic:
simp only [mulIndicator_of_not_mem, hxs, mt hst.2 hxs, not_false_eq_true]
@[to_additive]
theorem Monotone.mulIndicator_eventuallyEq_iUnion {ι} [Preorder ι] [One β] (s : ι → Set α)
    (hs : Monotone s) (f : α → β) (a : α) :
    (fun i => mulIndicator (s i) f a) =ᶠ[atTop] fun _ ↦ mulIndicator (⋃ i, s i) f a := by
  

Proof state:
α : Type u_1
β : Type u_2
M : Type u_3
E : Type u_4
ι : Type u_5
inst✝¹ : Preorder ι
inst✝ : One β
s : ι → Set α
hs : Monotone s
f : α → β
a : α
⊢ (fun i => mulIndicator (s i) f a) =ᶠ[atTop] fun x => mulIndicator (⋃ i, s i) f a

Next tactic:
classical exact hs.piecewise_eventually_eq_iUnion f 1 a
@[to_additive]
theorem Monotone.mulIndicator_eventuallyEq_iUnion {ι} [Preorder ι] [One β] (s : ι → Set α)
    (hs : Monotone s) (f : α → β) (a : α) :
    (fun i => mulIndicator (s i) f a) =ᶠ[atTop] fun _ ↦ mulIndicator (⋃ i, s i) f a := by
  classical 

Proof state:
α : Type u_1
β : Type u_2
M : Type u_3
E : Type u_4
ι : Type u_5
inst✝¹ : Preorder ι
inst✝ : One β
s : ι → Set α
hs : Monotone s
f : α → β
a : α
⊢ (fun i => mulIndicator (s i) f a) =ᶠ[atTop] fun x => mulIndicator (⋃ i, s i) f a

Next tactic:
exact hs.piecewise_eventually_eq_iUnion f 1 a