-- Module: Mathlib.Analysis.Analytic.Composition
Goal:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst : NontriviallyNormedField 𝕜
inst_1 : NormedAddCommGroup E
inst_2 : NormedSpace 𝕜 E
inst_3 : NormedAddCommGroup F
inst_4 : NormedSpace 𝕜 F
inst_5 : NormedAddCommGroup G
inst_6 : NormedSpace 𝕜 G
inst_7 : NormedAddCommGroup H
inst_8 : NormedSpace 𝕜 H
r : FormalMultilinearSeries 𝕜 G H
q : FormalMultilinearSeries 𝕜 F G
p : FormalMultilinearSeries 𝕜 E F
n : ℕ
v : (i : Fin n) → E
f : (a : Composition n) × Composition a.length → H :=
  fun (c : (a : Composition n) × Composition a.length) ↦
    (r c.snd (β := fun (a : Composition n) ↦ Composition a.length).length : (a : (i : Fin c.snd.length) → G) → H)
      (q.applyComposition (c.snd (β := fun (a : Composition n) ↦ Composition a.length))
        (p.applyComposition (c.fst (β := fun (a : Composition n) ↦ Composition a.length)) v))
g : (c : Composition n) × ((i : Fin c.length) → Composition (c.blocksFun i)) → H :=
  fun (c : (c : Composition n) × ((i : Fin c.length) → Composition (c.blocksFun i))) ↦
    (r c.fst (β := fun (c : Composition n) ↦ (i : Fin c.length) → Composition (c.blocksFun i)).length :
        (a : (i : Fin c.fst.length) → G) → H)
      fun (i : Fin c.fst (β := fun (c : Composition n) ↦ (i : Fin c.length) → Composition (c.blocksFun i)).length) ↦
      (q (c.snd (β := fun (c : Composition n) ↦ (i : Fin c.length) → Composition (c.blocksFun i)) i).length :
          (a : (i : Fin (c.snd i).length) → F) → G)
        (p.applyComposition (c.snd (β := fun (c : Composition n) ↦ (i : Fin c.length) → Composition (c.blocksFun i)) i)
          (v ∘
            (⇑(c.fst (β := fun (c : Composition n) ↦ (i : Fin c.length) → Composition (c.blocksFun i)).embedding i) :
              (a : Fin (c.fst.blocksFun i)) → Fin n)))
a : Composition n
b : Composition a.length
h_1 :
  Membership.mem (γ := Finset ((a : Composition n) × Composition a.length)) Finset.univ
    (Sigma.mk (β := fun (a : Composition n) ↦ Composition a.length) a b)
i : ℕ
hi1 : i < b.length
hi2 : i < (a.gather b).length
j : ℕ
hj1 : j < b.blocksFun ⟨i, hi1⟩
hj2 :
  j <
    Composition.length (n := (a.gather b).blocksFun ⟨(↑(⟨i, hi1⟩ : Fin b.length) : ℕ), ⋯⟩)
      (a.sigmaCompositionAux b ⟨(↑(⟨i, hi1⟩ : Fin b.length) : ℕ), ⋯⟩)
k : ℕ
hk1 : k < a.blocksFun ((b.embedding ⟨i, hi1⟩ : (a_1 : Fin (b.blocksFun ⟨i, hi1⟩)) → Fin a.length) ⟨j, hj1⟩)
hk2 :
  k <
    blocksFun (n := (a.gather b).blocksFun ⟨(↑(⟨i, hi1⟩ : Fin b.length) : ℕ), ⋯⟩)
      (a.sigmaCompositionAux b ⟨(↑(⟨i, hi1⟩ : Fin b.length) : ℕ), ⋯⟩)
      ⟨(↑(⟨j, hj1⟩ : Fin (b.blocksFun (⟨i, hi1⟩ : Fin b.length))) : ℕ), ⋯⟩
h :
  (↑((RelEmbedding.trans (r := fun (x1 x2 : Fin (a.blocksFun (⟨b.sizeUpTo i + j, ⋯⟩ : Fin a.length))) ↦ x1 ≤ x2) (s :=
              fun (x1 x2 : Fin (a.sizeUpTo (b.sizeUpTo i + j) + a.blocksFun (⟨b.sizeUpTo i + j, ⋯⟩ : Fin a.length))) ↦
              x1 ≤ x2) (t := fun (x1 x2 : Fin n) ↦ x1 ≤ x2) (Fin.natAddOrderEmb (a.sizeUpTo (b.sizeUpTo i + j)))
              (Fin.castLEOrderEmb ⋯) :
            (a : Fin (a.blocksFun ⟨b.sizeUpTo i + j, ⋯⟩)) → Fin n)
          (⟨k, hk1⟩ : Fin (a.blocksFun (⟨b.sizeUpTo i + j, ⋯⟩ : Fin a.length)))) :
      ℕ) =
    a.sizeUpTo (b.sizeUpTo i + j) + k
⊢ (↑((RelEmbedding.trans (r := fun (x1 x2 : Fin (a.blocksFun (⟨b.sizeUpTo i + j, ⋯⟩ : Fin a.length))) ↦ x1 ≤ x2) (s :=
              fun (x1 x2 : Fin (a.sizeUpTo (b.sizeUpTo i + j) + a.blocksFun (⟨b.sizeUpTo i + j, ⋯⟩ : Fin a.length))) ↦
              x1 ≤ x2) (t := fun (x1 x2 : Fin n) ↦ x1 ≤ x2) (Fin.natAddOrderEmb (a.sizeUpTo (b.sizeUpTo i + j)))
              (Fin.castLEOrderEmb ⋯) :
            (a : Fin (a.blocksFun ⟨b.sizeUpTo i + j, ⋯⟩)) → Fin n)
          (⟨k, hk1⟩ : Fin (a.blocksFun (⟨b.sizeUpTo i + j, ⋯⟩ : Fin a.length)))) :
      ℕ) =
    (a.gather b).sizeUpTo i +
      (sizeUpTo (n := (a.gather b).blocksFun (⟨i, hi2⟩ : Fin (a.gather b).length))
          (a.sigmaCompositionAux b (⟨i, hi2⟩ : Fin (a.gather b).length)) j +
        k)

Tactic:
rw [← add_assoc, ← sizeUpTo_sizeUpTo_add _ _ hi1 hj1]

Premises used: add_assoc, Composition.sizeUpTo_sizeUpTo_add