-- Lean 4 proof step from Mathlib.Analysis.Calculus.ContDiff.Bounds (goal)
Goal:
𝕜 : Type u_1
inst : NontriviallyNormedField 𝕜
E : Type uE
inst_1 : NormedAddCommGroup E
inst_2 : NormedSpace 𝕜 E
s : Set E
ι : Type u_2
A' : Type u_4
inst_3 : NormedCommRing A'
inst_4 : NormedAlgebra 𝕜 A'
inst_5 : DecidableEq ι
inst_6 : NormOneClass A'
f : ι → E → A'
N : ℕ∞ω
hs : UniqueDiffOn 𝕜 s
x : E
hx : x ∈ s
i : ι
u : Finset ι
hi : i ∉ u
IH :
  ∀ (hf : ∀ i ∈ u, ContDiffOn 𝕜 N (f i) s) {n : ℕ} (hn : (↑n : ℕ∞ω) ≤ N),
    norm (E := ContinuousMultilinearMap.{u_1, 0, uE, u_4} 𝕜 (fun (i : Fin n) ↦ E) A')
        (iteratedFDerivWithin 𝕜 n (fun (x : E) ↦ ∏ j ∈ u, f j x) s x) ≤
      ∑ p ∈ u.sym n,
        HMul.hMul (α := ℝ) (↑(↑p : Multiset ι).countPerms : ℝ)
          (∏ j ∈ u,
            norm (E :=
              ContinuousMultilinearMap.{u_1, 0, uE, u_4} 𝕜 (fun (i : Fin (Multiset.count j (↑p : Multiset ι))) ↦ E) A')
              (iteratedFDerivWithin 𝕜 (Multiset.count j (↑p : Multiset ι)) (f j) s x))
n : ℕ
hn : (↑n : ℕ∞ω) ≤ N
hf : ContDiffOn 𝕜 N (f i) s ∧ ∀ a ∈ u, ContDiffOn 𝕜 N (f a) s
⊢ LE.le (α := ℝ)
    (∑ i_1 ∈ Finset.range (n + 1),
      (↑(n.choose i_1) : ℝ) *
          norm (E := ContinuousMultilinearMap.{u_1, 0, uE, u_4} 𝕜 (fun (i : Fin i_1) ↦ E) A')
            (iteratedFDerivWithin 𝕜 i_1 (f i) s x) *
        norm (E := ContinuousMultilinearMap.{u_1, 0, uE, u_4} 𝕜 (fun (i : Fin (n - i_1)) ↦ E) A')
          (iteratedFDerivWithin 𝕜 (n - i_1) (fun (y : E) ↦ ∏ i ∈ u, f i y) s x))
    (∑ i_1 : ↥((insert i u).sym n),
      HMul.hMul (α := ℝ) (↑(↑(↑i_1 : Sym ι n) : Multiset ι).countPerms : ℝ)
        (∏ j ∈ insert i u,
          norm (E :=
            ContinuousMultilinearMap.{u_1, 0, uE, u_4} 𝕜
              (fun (i : Fin (Multiset.count j (↑(↑i_1 : Sym ι n) : Multiset ι))) ↦ E) A')
            (iteratedFDerivWithin 𝕜 (Multiset.count j (↑(↑i_1 : Sym ι n) : Multiset ι)) (f j) s x)))
have insert : LE.le (α := ℝ)
  (∑ i_1 ∈ Finset.range (n + 1),
    (↑(n.choose i_1) : ℝ) *
        norm (E := ContinuousMultilinearMap.{u_1, 0, uE, u_4} 𝕜 (fun (i : Fin i_1) ↦ E) A')
          (iteratedFDerivWithin 𝕜 i_1 (f i) s x) *
      norm (E := ContinuousMultilinearMap.{u_1, 0, uE, u_4} 𝕜 (fun (i : Fin (n - i_1)) ↦ E) A')
        (iteratedFDerivWithin 𝕜 (n - i_1) (fun (y : E) ↦ ∏ i ∈ u, f i y) s x))
  (∑ i_1 : (i : Fin (n + 1)) × ↥(u.sym (n - (↑i : ℕ))),
    ((fun (v : Multiset ι) ↦
          HMul.hMul (α := ℝ) (↑v.countPerms : ℝ)
            (∏ j ∈ insert i u,
              norm (E := ContinuousMultilinearMap.{u_1, 0, uE, u_4} 𝕜 (fun (i : Fin (Multiset.count j v)) ↦ E) A')
                (iteratedFDerivWithin 𝕜 (Multiset.count j v) (f j) s x))) ∘
        comp (β := Sym ι n) Sym.toMultiset
          (comp (β := ↥((insert i u).sym n)) (Subtype.val (p := fun (x : Sym ι n) ↦ x ∈ (insert i u).sym n))
            (⇑(Equiv.symm (Finset.symInsertEquiv hi)) :
              (a : (i : Fin (n + 1)) × ↥(u.sym (n - (↑i : ℕ)))) → ↥((insert i u).sym n))))
      i_1)
Tactic: rw [Finset.sum_equiv (Finset.symInsertEquiv hi) (t := Finset.univ)
      (g := (fun v ↦ v.countPerms *
          ∏ j ∈ insert i u, ‖iteratedFDerivWithin 𝕜 (v.count j) (f j) s x‖) ∘
        Sym.toMultiset ∘ Subtype.val ∘ (Finset.symInsertEquiv hi).symm)
      (by simp) (by simp only [← comp_apply (g := Finset.symInsertEquiv hi), comp_assoc]; simp)]