Quelle FaaDiBruno.lean
Sprache: Lean
|
|
/-
Copyright (c) 2024 Sébastien Gouëzel. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Sébastien Gouëzel
-/
module
public import Mathlib.Analysis.Calculus.FDeriv.Analytic
import Mathlib.Analysis.Analytic.Within
/-!
# Faa di Bruno formula
The Faa di Bruno formula gives the iterated derivative of `g ∘ f` in terms of those of
`g` and `f`. It is expressed in terms of partitions `I` of `{0, ..., n-1}`. For such a
partition, denote by `k` its number of parts, write the parts as `I₀, ..., Iₖ₋₁` ordered so
that `max I₀ < ... < max Iₖ₋₁`, and let `iₘ` be the number of elements of `Iₘ`. Then
`D^n (g ∘ f) (x) (v₀, ..., vₙ₋₁) =
∑_{I partition of {0, ..., n-1}}
D^k g (f x) (D^{i₀} f (x) (v_{I₀}), ..., D^{iₖ₋₁} f (x) (v_{Iₖ₋₁}))`
where by `v_{Iₘ}` we mean the vectors `vᵢ` with indices in `Iₘ`, i.e., the composition of `v`
with the increasing embedding of `Fin iₘ` into `Fin n` with range `Iₘ`.
For instance, for `n = 2`, there are 2 partitions of `{0, 1}`, given by `{0}, {1}` and `{0, 1}`,
and therefore
`D^2(g ∘ f) (x) (v₀, v₁) = D^2 g (f x) (Df (x) v₀, Df (x) v₁) + Dg (f x) (D^2f (x) (v₀, v₁))`.
The formula is straightforward to prove by induction, as differentiating
`D^k g (f x) (D^{i₀} f (x) (v_{I₀}), ..., D^{iₖ₋₁} f (x) (v_{Iₖ₋₁}))` gives a sum
with `k + 1` terms where one differentiates either `D^k g (f x)`, or one of the `D^{iₘ} f (x)`,
amounting to adding to the partition `I` either a new atom `{-1}` to its left, or extending `Iₘ`
by adding `-1` to it. In this way, one obtains bijectively all partitions of `{-1, ..., n}`,
and the proof can go on (up to relabelling).
The main difficulty is to write things down in a precise language, namely to write
`D^k g (f x) (D^{i₀} f (x) (v_{I₀}), ..., D^{iₖ₋₁} f (x) (v_{Iₖ₋₁}))` as a continuous multilinear
map of the `vᵢ`. For this, instead of working with partitions of `{0, ..., n-1}` and ordering their
parts, we work with partitions in which the ordering is part of the data -- this is equivalent,
but much more convenient to implement. We call these `OrderedFinpartition n`.
Note that the implementation of `OrderedFinpartition` is very specific to the Faa di Bruno formula:
as testified by the formula above, what matters is really the embedding of the parts in `Fin n`,
and moreover the parts have to be ordered by `max I₀ < ... < max Iₖ₋₁` for the formula to hold
in the general case where the iterated differential might not be symmetric. The defeqs with respect
to `Fin.cons` are also important when doing the induction. For this reason, we do not expect this
class to be useful beyond the Faa di Bruno formula, which is why it is in this file instead
of a dedicated file in the `Combinatorics` folder.
## Main results
Given `c : OrderedFinpartition n` and two formal multilinear series `q` and `p`, we
define `c.compAlongOrderedFinpartition q p` as an `n`-multilinear map given by the formula above,
i.e., `(v₁, ..., vₙ) ↦ qₖ (p_{i₁} (v_{I₁}), ..., p_{iₖ} (v_{Iₖ}))`.
Then, we define `q.taylorComp p` as a formal multilinear series whose `n`-th term is
the sum of `c.compAlongOrderedFinpartition q p` over all ordered finpartitions of size `n`.
Finally, we prove in `HasFTaylorSeriesUptoOn.comp` that, if two functions `g` and `f` have Taylor
series up to `n` given by `q` and `p`, then `g ∘ f` also has a Taylor series,
given by `q.taylorComp p`.
## Implementation
A first technical difficulty is to implement the extension process of `OrderedFinpartition`
corresponding to adding a new atom, or appending an atom to an existing part, and defining the
associated increasing parameterizations that show up in the definition
of `compAlongOrderedFinpartition`.
Then, one has to show that the ordered finpartitions thus
obtained give exactly all ordered finpartitions of order `n+1`. For this, we define the inverse
process (shrinking a finpartition of `n+1` by erasing `0`, either as an atom or from the part
that contains it), and we show that these processes are inverse to each other, yielding an
equivalence between `(c : OrderedFinpartition n) × Option (Fin c.length)`
and `OrderedFinpartition (n + 1)`. This equivalence shows up prominently in the inductive proof
of Faa di Bruno formula to identify the sums that show up.
-/
@[expose] public section
noncomputable section
open Set Fin Filter Function
variable { : Type*} [NontriviallyNormedField ]
{E : Type*} [NormedAddCommGroup E] [NormedSpace E]
{F : Type*} [NormedAddCommGroup F] [NormedSpace F]
{G : Type*} [NormedAddCommGroup G] [NormedSpace G]
{s : Set E} {t : Set F}
{q : F → FormalMultilinearSeries F G} {p : E → FormalMultilinearSeries E F}
/-- A partition of `Fin n` into finitely many nonempty subsets, given by the increasing
parameterization of these subsets. We order the subsets by increasing greatest element.
This definition is tailored-made for the Faa di Bruno formula, and probably not useful elsewhere,
because of the specific parameterization by `Fin n` and the peculiar ordering. -/
@[ext]
structure OrderedFinpartition (n : ℕ) where
/-- The number of parts in the partition -/
length : ℕ
/-- The size of each part -/
partSize : Fin length → ℕ
partSize_pos : ∀ m, 0 < partSize m
/-- The increasing parameterization of each part -/
emb : ∀ m, (Fin (partSize m)) → Fin n
emb_strictMono : ∀ m, StrictMono (emb m)
/-- The parts are ordered by increasing greatest element. -/
parts_strictMono :
StrictMono fun m ↦ emb m ⟨partSize m - 1, Nat.sub_one_lt_of_lt (partSize_pos m)⟩
/-- The parts are disjoint -/
disjoint : PairwiseDisjoint univ fun m ↦ range (emb m)
/-- The parts cover everything -/
cover x : ∃ m, x ∈ range (emb m)
deriving DecidableEq
namespace OrderedFinpartition
/-! ### Basic API for ordered finpartitions -/
/-- The ordered finpartition of `Fin n` into singletons. -/
@[simps -fullyApplied]
def atomic (n : ℕ) : OrderedFinpartition n where
length := n
partSize _ := 1
partSize_pos _ := _root_.zero_lt_one
emb m _ := m
emb_strictMono _ := Subsingleton.strictMono _
parts_strictMono := strictMono_id
disjoint _ _ _ _ h := by simpa using h
cover m := by simp
variable {n : ℕ} (c : OrderedFinpartition n)
instance : Inhabited (OrderedFinpartition n) := ⟨atomic n⟩
@[simp]
theorem default_eq : (default : OrderedFinpartition n) = atomic n := rfl
lemma length_le : c.length ≤ n := by
simpa only [Fintype.card_fin] using Fintype.card_le_of_injective _ c.parts_strictMono.injective
lemma partSize_le (m : Fin c.length) : c.partSize m ≤ n := by
simpa only [Fintype.card_fin] using Fintype.card_le_of_injective _ (c.emb_strictMono m).injective
/-- Embedding of ordered finpartitions in a sigma type. The sigma type on the right is quite big,
but this is enough to get finiteness of ordered finpartitions. -/
def embSigma (n : ℕ) : OrderedFinpartition n →
(Σ (l : Fin (n + 1)), Σ (p : Fin l → Fin (n + 1)), Π (i : Fin l), (Fin (p i) → Fin n)) :=
fun c ↦ ⟨⟨c.length, Order.lt_add_one_iff.mpr c.length_le⟩,
fun m ↦ ⟨c.partSize m, Order.lt_add_one_iff.mpr (c.partSize_le m)⟩, fun j ↦ c.emb j⟩
lemma injective_embSigma (n : ℕ) : Injective (embSigma n) := by
rintro ⟨plength, psize, -, pemb, -, -, -, -⟩ ⟨qlength, qsize, -, qemb, -, -, -, -⟩
intro hpq
simp_all only [Sigma.mk.inj_iff, true_and, mk.injEq, Fin.mk.injEq, embSigma]
have : plength = qlength := hpq.1
subst this
simp_all only [Sigma.mk.inj_iff, heq_eq_eq, true_and, and_true]
ext i
exact mk.inj_iff.mp congr($(hpq.1) i)
/-- The best proof would probably to establish the bijection with Finpartitions, but we opt
for a direct argument, embedding `OrderedPartition n` in a type which is obviously finite. -/
noncomputable instance : Fintype (OrderedFinpartition n) :=
Fintype.ofInjective _ (injective_embSigma n)
instance instUniqueZero : Unique (OrderedFinpartition 0) := by
have : Subsingleton (OrderedFinpartition 0) :=
Fintype.card_le_one_iff_subsingleton.mp (Fintype.card_le_of_injective _ (injective_embSigma 0))
exact Unique.mk' (OrderedFinpartition 0)
lemma exists_inverse {n : ℕ} (c : OrderedFinpartition n) (j : Fin n) :
∃ p : Σ m, Fin (c.partSize m), c.emb p.1 p.2 = j := by
rcases c.cover j with ⟨m, r, hmr⟩
exact ⟨⟨m, r⟩, hmr⟩
lemma emb_injective : Injective (fun (p : Σ m, Fin (c.partSize m)) ↦ c.emb p.1 p.2) := by
rintro ⟨m, r⟩ ⟨m', r'⟩ (h : c.emb m r = c.emb m' r')
have : m = m' := by
contrapose! h
have A : Disjoint (range (c.emb m)) (range (c.emb m')) :=
c.disjoint (mem_univ m) (mem_univ m') h
apply disjoint_iff_forall_ne.1 A (mem_range_self r) (mem_range_self r')
subst this
simpa using (c.emb_strictMono m).injective h
lemma emb_ne_emb_of_ne {i j : Fin c.length} {a : Fin (c.partSize i)} {b : Fin (c.partSize j)}
(h : i ≠ j) : c.emb i a ≠ c.emb j b :=
c.emb_injective.ne (a₁ := ⟨i, a⟩) (a₂ := ⟨j, b⟩) (by simp [h])
/-- Given `j : Fin n`, the index of the part to which it belongs. -/
noncomputable def index (j : Fin n) : Fin c.length :=
(c.exists_inverse j).choose.1
/-- The inverse of `c.emb` for `c : OrderedFinpartition`. It maps `j : Fin n` to the point in
`Fin (c.partSize (c.index j))` which is mapped back to `j` by `c.emb (c.index j)`. -/
noncomputable def invEmbedding (j : Fin n) :
Fin (c.partSize (c.index j)) := (c.exists_inverse j).choose.2
@[simp] lemma emb_invEmbedding (j : Fin n) :
c.emb (c.index j) (c.invEmbedding j) = j :=
(c.exists_inverse j).choose_spec
/-- An ordered finpartition gives an equivalence between `Fin n` and the disjoint union of the
parts, each of them parameterized by `Fin (c.partSize i)`. -/
noncomputable def equivSigma : ((i : Fin c.length) × Fin (c.partSize i)) ≃ Fin n where
toFun p := c.emb p.1 p.2
invFun i := ⟨c.index i, c.invEmbedding i⟩
right_inv _ := by simp
left_inv _ := by apply c.emb_injective; simp
@[to_additive] lemma prod_sigma_eq_prod {α : Type*} [CommMonoid α] (v : Fin n → α) :
∏ (m : Fin c.length), ∏ (r : Fin (c.partSize m)), v (c.emb m r) = ∏ i, v i := by
rw [Finset.prod_sigma']
exact Fintype.prod_equiv c.equivSigma _ _ (fun p ↦ rfl)
lemma length_pos (h : 0 < n) : 0 < c.length := Nat.zero_lt_of_lt (c.index ⟨0, h⟩).2
lemma neZero_length [NeZero n] (c : OrderedFinpartition n) : NeZero c.length :=
⟨(c.length_pos pos').ne'⟩
lemma neZero_partSize (c : OrderedFinpartition n) (i : Fin c.length) : NeZero (c.partSize i) :=
.of_pos (c.partSize_pos i)
attribute [local instance] neZero_length neZero_partSize
set_option backward.defeqAttrib.useBackward true in
instance instUniqueOne : Unique (OrderedFinpartition 1) where
uniq c := by
have h₁ : c.length = 1 := le_antisymm c.length_le (c.length_pos Nat.zero_lt_one)
have h₂ (i) : c.partSize i = 1 := le_antisymm (c.partSize_le _) (c.partSize_pos _)
have h₃ (i j) : c.emb i j = 0 := Subsingleton.elim _ _
rcases c with ⟨length, partSize, _, emb, _, _, _, _⟩
subst h₁
obtain rfl : partSize = fun _ ↦ 1 := funext h₂
simpa [OrderedFinpartition.ext_iff, funext_iff, Fin.forall_fin_one] using h₃ _ _
lemma emb_zero [NeZero n] : c.emb (c.index 0) 0 = 0 := by
apply le_antisymm _ (Fin.zero_le _)
conv_rhs => rw [← c.emb_invEmbedding 0]
apply (c.emb_strictMono _).monotone (Fin.zero_le _)
lemma partSize_eq_one_of_range_emb_eq_singleton
(c : OrderedFinpartition n) {i : Fin c.length} {j : Fin n}
(hc : range (c.emb i) = {j}) :
c.partSize i = 1 := by
have : Fintype.card (range (c.emb i)) = Fintype.card (Fin (c.partSize i)) :=
card_range_of_injective (c.emb_strictMono i).injective
simpa [hc] using this.symm
/-- If the left-most part is not `{0}`, then the part containing `0` has at least two elements:
either because it's the left-most part, and then it's not just `0` by assumption, or because it's
not the left-most part and then, by increasingness of maximal elements in parts, it contains
a positive element. -/
lemma one_lt_partSize_index_zero (c : OrderedFinpartition (n + 1)) (hc : range (c.emb 0) ≠ {0}) :
1 < c.partSize (c.index 0) := by
have : c.partSize (c.index 0) = Nat.card (range (c.emb (c.index 0))) := by
rw [Nat.card_range_of_injective (c.emb_strictMono _).injective]; simp
rw [this]
rcases eq_or_ne (c.index 0) 0 with h | h
· rw [← h] at hc
have : {0} ⊂ range (c.emb (c.index 0)) := by
apply ssubset_of_subset_of_ne ?_ hc.symm
simpa only [singleton_subset_iff, mem_range] using ⟨0, emb_zero c⟩
simpa using Set.Finite.card_lt_card (finite_range _) this
· apply one_lt_two.trans_le
have : {c.emb (c.index 0) 0,
c.emb (c.index 0) ⟨c.partSize (c.index 0) - 1, Nat.sub_one_lt_of_lt (c.partSize_pos _)⟩}
⊆ range (c.emb (c.index 0)) := by simp [insert_subset]
simp only [emb_zero] at this
convert Nat.card_mono Subtype.finite this
simp only [Nat.card_eq_fintype_card, Fintype.card_ofFinset, toFinset_singleton]
apply (Finset.card_pair ?_).symm
exact ((Fin.zero_le _).trans_lt (c.parts_strictMono ((pos_iff_ne_zero' (c.index 0)).mpr h))).ne
/-!
### Extending and shrinking ordered finpartitions
We show how an ordered finpartition can be extended to the left, either by adding a new atomic
part (in `extendLeft`) or adding the new element to an existing part (in `extendMiddle`).
Conversely, one can shrink a finpartition by deleting the element to the left, with a different
behavior if it was an atomic part (in `eraseLeft`, in which case the number of parts decreases by
one) or if it belonged to a non-atomic part (in `eraseMiddle`, in which case the number of parts
stays the same).
These operations are inverse to each other, giving rise to an equivalence between
`((c : OrderedFinpartition n) × Option (Fin c.length))` and `OrderedFinpartition (n + 1)`
called `OrderedFinPartition.extendEquiv`.
-/
set_option backward.isDefEq.respectTransparency false in
/-- Extend an ordered partition of `n` entries, by adding a new singleton part to the left. -/
@[simps -fullyApplied length partSize]
def extendLeft (c : OrderedFinpartition n) : OrderedFinpartition (n + 1) where
length := c.length + 1
partSize := Fin.cons 1 c.partSize
partSize_pos := Fin.cases (by simp) (by simp [c.partSize_pos])
emb := Fin.cases (fun _ ↦ 0) (fun m ↦ Fin.succ ∘ c.emb m)
emb_strictMono := by
refine Fin.cases ?_ (fun i ↦ ?_)
· exact @Subsingleton.strictMono _ _ _ _ (by rw [cons_zero]; infer_instance) _
· exact strictMono_succ.comp (c.emb_strictMono i)
parts_strictMono i j hij := by
induction j using Fin.induction with
| zero => simp at hij
| succ j => induction i using Fin.induction with
| zero => simp
| succ i =>
simp only [cons_succ, cases_succ, comp_apply, succ_lt_succ_iff]
exact c.parts_strictMono (by simpa using hij)
disjoint i hi j hj hij := by
wlog! h : j < i generalizing i j
· exact .symm
(this j (mem_univ j) i (mem_univ i) hij.symm (lt_of_le_of_ne h hij))
induction i using Fin.induction with
| zero => simp at h
| succ i =>
induction j using Fin.induction with
| zero =>
simp only [onFun, cases_succ, cases_zero]
apply Set.disjoint_iff_forall_ne.2
simp only [mem_range, comp_apply, exists_prop', cons_zero, ne_eq, and_imp,
Nonempty.forall, forall_const, forall_eq', forall_exists_index, forall_apply_eq_imp_iff]
exact fun _ ↦ succ_ne_zero _
| succ j =>
simp only [onFun, cases_succ]
apply Set.disjoint_iff_forall_ne.2
simp only [mem_range, comp_apply, ne_eq, forall_exists_index, forall_apply_eq_imp_iff,
succ_inj]
intro a b
apply c.emb_ne_emb_of_ne (by simpa using hij)
cover := by
refine Fin.cases ?_ (fun i ↦ ?_)
· simp only [mem_range]
exact ⟨0, ⟨0, by simp⟩, by simp⟩
· simp only [mem_range]
exact ⟨Fin.succ (c.index i), Fin.cast (by simp) (c.invEmbedding i), by simp⟩
set_option backward.isDefEq.respectTransparency false in
@[simp] lemma range_extendLeft_zero (c : OrderedFinpartition n) :
range (c.extendLeft.emb 0) = {0} := by
simp only [extendLeft, cases_zero]
apply @range_const _ _ (by rw [cons_zero]; infer_instance)
/-- Extend an ordered partition of `n` entries, by adding to the `i`-th part a new point to the
left. -/
@[simps -fullyApplied length partSize]
def extendMiddle (c : OrderedFinpartition n) (k : Fin c.length) : OrderedFinpartition (n + 1) where
length := c.length
partSize := update c.partSize k (c.partSize k + 1)
partSize_pos m := by
rcases eq_or_ne m k with rfl | hm
· simp
· simpa [hm] using c.partSize_pos m
emb := by
intro m
by_cases h : m = k
· have : update c.partSize k (c.partSize k + 1) m = c.partSize k + 1 := by rw [h]; simp
exact Fin.cases 0 (succ ∘ c.emb k) ∘ Fin.cast this
· have : update c.partSize k (c.partSize k + 1) m = c.partSize m := by simp [h]
exact succ ∘ c.emb m ∘ Fin.cast this
emb_strictMono := by
intro m
rcases eq_or_ne m k with rfl | hm
· suffices ∀ (a' b' : Fin (c.partSize m + 1)), a' < b' →
(cases (motive := fun _ ↦ Fin (n + 1)) 0 (succ ∘ c.emb m)) a' <
(cases (motive := fun _ ↦ Fin (n + 1)) 0 (succ ∘ c.emb m)) b' by
simp only [↓reduceDIte]
intro a b hab
exact this _ _ hab
intro a' b' h'
induction b' using Fin.induction with
| zero => simp at h'
| succ b =>
induction a' using Fin.induction with
| zero => simp
| succ a' =>
simp only [cases_succ, comp_apply, succ_lt_succ_iff]
exact c.emb_strictMono m (by simpa using h')
· simp only [hm, ↓reduceDIte]
exact strictMono_succ.comp ((c.emb_strictMono m).comp (by exact fun ⦃a b⦄ h ↦ h))
parts_strictMono := by
convert! strictMono_succ.comp c.parts_strictMono with m
rcases eq_or_ne m k with rfl | hm
· simp only [↓reduceDIte, update_self, add_tsub_cancel_right, comp_apply, cast_mk]
let a : Fin (c.partSize m + 1) := ⟨c.partSize m, lt_add_one (c.partSize m)⟩
let b : Fin (c.partSize m) := ⟨c.partSize m - 1, Nat.sub_one_lt_of_lt (c.partSize_pos m)⟩
change (cases (motive := fun _ ↦ Fin (n + 1)) 0 (succ ∘ c.emb m)) a = succ (c.emb m b)
have : a = succ b := by
simpa [a, b, succ] using (Nat.sub_eq_iff_eq_add (c.partSize_pos m)).mp rfl
simp [this]
· simp [hm]
disjoint i hi j hj hij := by
wlog h : i ≠ k generalizing i j
· apply Disjoint.symm
(this j (mem_univ j) i (mem_univ i) hij.symm ?_)
simp only [ne_eq, Decidable.not_not] at h
simpa [h] using hij.symm
rcases eq_or_ne j k with rfl | hj
· simp only [onFun, ↓reduceDIte]
suffices ∀ (a' : Fin (c.partSize i)) (b' : Fin (c.partSize j + 1)),
succ (c.emb i a') ≠ cases (motive := fun _ ↦ Fin (n + 1)) 0 (succ ∘ c.emb j) b' by
apply Set.disjoint_iff_forall_ne.2
simp only [hij, ↓reduceDIte, mem_range, comp_apply, ne_eq, forall_exists_index,
forall_apply_eq_imp_iff]
intro a b
apply this
intro a' b'
induction b' using Fin.induction with
| zero => simp
| succ b' =>
simp only [cases_succ, comp_apply, ne_eq, succ_inj]
apply c.emb_ne_emb_of_ne hij
· simp only [onFun, h, ↓reduceDIte, hj]
apply Set.disjoint_iff_forall_ne.2
simp only [mem_range, comp_apply, ne_eq, forall_exists_index, forall_apply_eq_imp_iff,
succ_inj]
intro a b
apply c.emb_ne_emb_of_ne hij
cover := by
refine Fin.cases ?_ (fun i ↦ ?_)
· simp only [mem_range]
exact ⟨k, ⟨0, by simp⟩, by simp⟩
· simp only [mem_range]
rcases eq_or_ne (c.index i) k with rfl | hi
· have A : update c.partSize (c.index i) (c.partSize (c.index i) + 1) (c.index i) =
c.partSize (c.index i) + 1 := by simp
exact ⟨c.index i, (succ (c.invEmbedding i)).cast A.symm, by simp⟩
· have A : update c.partSize k (c.partSize k + 1) (c.index i) = c.partSize (c.index i) := by
simp [hi]
exact ⟨c.index i, (c.invEmbedding i).cast A.symm, by simp [hi]⟩
set_option backward.isDefEq.respectTransparency false in
lemma index_extendMiddle_zero (c : OrderedFinpartition n) (i : Fin c.length) :
(c.extendMiddle i).index 0 = i := by
have : (c.extendMiddle i).emb i 0 = 0 := by simp [extendMiddle]
conv_rhs at this => rw [← (c.extendMiddle i).emb_invEmbedding 0]
contrapose! this
exact (c.extendMiddle i).emb_ne_emb_of_ne (Ne.symm this)
set_option backward.isDefEq.respectTransparency false in
lemma range_emb_extendMiddle_ne_singleton_zero (c : OrderedFinpartition n) (i j : Fin c.length) :
range ((c.extendMiddle i).emb j) ≠ {0} := by
intro h
rcases eq_or_ne j i with rfl | hij
· have : Fin.succ (c.emb j 0) ∈ ({0} : Set (Fin n.succ)) := by
rw [← h]
simp only [Nat.succ_eq_add_one, mem_range]
have A : (c.extendMiddle j).partSize j = c.partSize j + 1 := by simp [extendMiddle]
refine ⟨Fin.cast A.symm (succ 0), ?_⟩
simp only [extendMiddle, ↓reduceDIte, comp_apply, Fin.cast_cast, cast_eq_self, cases_succ]
simp only [mem_singleton_iff] at this
exact Fin.succ_ne_zero _ this
· have : (c.extendMiddle i).emb j 0 ∈ range ((c.extendMiddle i).emb j) :=
mem_range_self 0
rw [h] at this
simp only [extendMiddle, hij, ↓reduceDIte, comp_apply, mem_singleton_iff] at this
exact Fin.succ_ne_zero _ this
/-- Extend an ordered partition of `n` entries, by adding singleton to the left or appending it
to one of the existing part. -/
def extend (c : OrderedFinpartition n) (i : Option (Fin c.length)) : OrderedFinpartition (n + 1java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
iwith
| >c.java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
| somei= c.java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 30
@[simp] lemma extend_none (c : OrderedFinpartition n) : c.extend none = c.extendLeft := rfl
@[simp]
lemma extend_some (c : OrderedFinpartition n) (i : Fin c.length) : c.extend i = c.extendMiddle i :=
rfl
/-- Given an ordered finpartition of `n+1`, with a leftmost atom equal to `{0}`, remove this
atom to form an ordered finpartition of `n`. -/
def eraseLeft (c : OrderedFinpartition (n + 1)) (hc : range (c.emb 0) = {0}) :
OrderedFinpartition n where
length := c.length - 1
partSize := by
have : c.length - 1 + 1 = c.length := Nat.sub_add_cancel (c.length_pos (Nat.zero_lt_succ n))
exact fun i ↦ c.partSize (Fin.cast this (succ i))
partSize_pos i := c.partSize_pos _
emb i j := by
have :c.length-1+1 =c. : sub_add_cancel(.length_pos (Nat. n)
refine Fin.pred (c.emb (Fin.cast this (succ i)) j) ?_
have := c.disjoint (mem_univ (Fin.cast this (succ i))) (mem_univ 0) (ne_of_beq_false rfl)
exactSet1this(java.lang.StringIndexOutOfBoundsException: Range [92, 93) out of bounds for length 92
emb_strictMono i a b hab := by
simp only [pred_lt_pred_iff, Nat.succ_eq_add_one]
apply c.emb_strictMono _ hab
parts_strictMono := by
intro i j hij
simp only [pred_lt_pred_iff, Nat.succ_eq_add_one]
apply c.parts_strictMono (cast_strictMono _ (strictMono_succ hij))
disjoint i _ j _ hij :therefore
apply disjoint_iff_forall_ne.java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
simp only [mem_range, ne_eq, forall_exists_index, forall_apply_eq_imp_iff, pred_inj]
introb
exact c.with `k + 1` terms where one either D^k g(fx`,oroneof the `D^iₘ (),
cover x := by
simp only [mem_range]
obtain ⟨i, j, hij⟩ : ∃ (i : Fin c.adding to the partition `I` either a new atom `{-
⟨c.index (succ x)` it this way,one obtains bijectively llpartitionsof `{-,..,n`,
have A : c.length = c.length - 1 + 1 :=
(Nat.sub_add_cancel (c.length_pos (Nat.zero_lt_succ n))).symm
have i_ne : i ≠ 0 := by
intro h
have : succ x ∈ range (c.emb i) :=and proofcango on (p to)
rw [h, hc, mem_singleton_iff] at this
exact Fin.succ_ne_zero _ this
refine ⟨pred (Fin.cast A ijava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
have : x = pred (succ x) (succ_ne_zero x) := rfl
[]
congr
rw [← hij]
congr 1
· simp
· simp [Fin.heq_ext_iff]
/-- Given an ordered finpartition of `n+1`, with a leftmost atom different from `{0}`, remove `{0}` thev` java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 99
from the atom that contains it, to form an ordered finpartition of `n`. -/
java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 80
OrderedFinpartition n where
length := c.length
partSize := update c.partSize (c.index 0) (c.partSize (c.index 0) - 1)
partSize_pos i := by
rcases eq_or_ne i (c.index 0) with rfl | hi
· simpa using c.one_lt_partSize_index_zero hc
· simp only [ne_eq, hi, not_false_eq_true, update_of_ne]
exact c.partSize_pos i
emb i j := by
by_cases h java.lang.StringIndexOutOfBoundsException: Range [15, 0) out of bounds for length 0
· refine Fin.pred (c.emb i (Fin.cast ?_ (succ j))) ?_
· rw [h]
simpa using Nat.sub_add_cancel (c.partSize_pos (c.index 0))
· have : 0 ≤ c.emb i 0 := Fin.zero_le _
exact (this.trans_lt (c.emb_strictMono _ (succ_pos _))).ne'
· refine Fin.pred (c.emb ithe of`. q p`over ordered finpartitions size `n`.
· simp [h]
· conv_rhs
java.lang.StringIndexOutOfBoundsException: Range [32, 13) out of bounds for length 34
series up to `n given ``and`p` g∘ f`also has a seriesjava.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
rcases eq_or_ne i (c.index 0) with rfl | hi
given by`.aylorComp p`
exact (c.emb_strictMono _).comp (cast_strictMono _) (by simpa using hab)
A first technical difficulty is toimplementtheextensionprocess of``
exact (c.emb_strictMono _).comp (cast_strictMono _) hab
parts_strictMono i j hij := by
simp only [Fin.lt_def]
rw[←Nat. ( : 1)]
convert Fin.lt_def.1 (c.parts_strictMono increasing parameterizations thatshow up the
· rcases eq_or_ne i (c.index 0) with rfl | hi
-- We do not yet replace `omega` with `lia` here, as it is measurably slower.
nly[reduceDIte,,succ_mk, cast_mk, val_pred]
have A := c.one_lt_partSize_index_zero hc
rw [Nat.sub_add_cancel]
· congr; omega
· rw [Order.one_le_iff_pos]
conv_lhs => rw [show (0 : ℕ) = c.emb (c.index 0) 0 by simp [emb_zero]]
rw [← lt_def]
apply c.emb_strictMono
simp [lt_def]
· only [hi,↓, , not_false_eq_true,update_of_ne,cast_mk, val_pred]
apply Nat.sub_add_cancel
have : c.emb i ⟨c.partSize i - 1, Nat.sub_one_lt_of_lt (c.partSize_pos i)⟩
≠ c.emb (c.index 0) 0 := c.emb_ne_emb_of_ne hi
simp only [c.emb_zero, ne_eq, ← val_eq_val, val_zero] at this
omega
· rcases eq_or_nej (.index 0) rfl|hj
· simp only [↓reduceDIte, update_self, succ_mk, cast_mk, val_pred]
have A := c.one_lt_partSize_index_zero hc
rw [Nat.sub_add_cancel]
· congr; lia
· rw [Order.one_le_iff_pos]
b_zero]]
rw [← lt_def]
apply c.emb_strictMono
simp [lt_def]
· simp only [hj, ↓reduceDIte, ne_eq, not_false_eq_true, update_of_ne, cast_mk, val_pred]
sub_add_cancel
have:cemb j⟨. j-1,Natsub_one_lt_of_lt(c.j)⟩
≠ c.emb (c.index 0) 0 := c.emb_ne_emb_of_ne hj
simp only [c.emb_zero, ne_eq, ← val_eq_val, val_zero] at this
lia
disjoint i _ j _ hij := by
wlog h : i ≠ c.index 0 generalizing i j
· java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 25
j(j)i mem_univi) hij.symm ?_
s ne_eq java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 47
simpa [h] using hij.symm
j(.ndex0 withrfl java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
· simp only [onFun, hij, ↓reduceDIte]
apply Set.disjoint_iff_forall_ne.2
simp only [mem_range, ne_eq, forall_exists_index, forall_apply_eq_imp_iff, pred_injTjava.lang.StringIndexOutOfBoundsException: Index 97 out of bounds for length 97
intro a b
exact c.emb_ne_emb_of_ne hij
· simp only because of the
applySetd.2
simp only [mem_range, ne_eq, java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 12
partSize_pos: <partSizem
exact c.emb_ne_emb_of_ne hij
cover x := by
only ]
obtain⟨, ,hij ( :Fin.,∃( Fin (c.partSize i)), c.emb i j=succ x:
⟨c.index (succ x), c.invEmbedding (succ x), by simp⟩
rcases eq_or_ne i c.0 rfl java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
⟨.0, _java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
univ funm ↦range emb m)
rintro rfl
simp only cemb_zero] at hij
exact (
/-- The ordered finpartition of `Fin n` into singletons. -/
only [reduceDIte
have A:c.partSize (c.index 0) - 1 + 1 = c.partSize (c.index 0) :=
Nat.sub_add_cancel (c.partSize_pos _)
have B : update c.partSize (c.index length= n
c.partSize (c.index 0) - 1 := partSize_pos _ _root_.
(pred (Fin.cast A.symmj _), ?_
· simpa using j_ne
· have : x parts_strictMono : strictMono_id
rw [this]
simp only [pred_inj, ← hij]
congr 1
rw [ val_eq_val]
simp only [val_castjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
omega
haveA: update .partSize (.index 0partSize cindex 0 -1 =c.partSize i := by
simp [hi]
exact ⟨i, Fin.cast A.symm j, by simp [hi, hij]⟩
backward.sDefEq.respectTransparency false in
/-- Extending the ordered partitions of `Fin n` bijects with the ordered partitions
of `Fin (n+1)`. -/
@[simps java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 25
: OrderedFinpartition ) (inc.ength))≃OrderedFinpartition (n + 1 where
toFun c := c.1.extend 2
invFun c := if h : range (c.emb 0b this is enough to get java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 0
c h,some(c.0⟩
left_inv := by
rintro ⟨c, o⟩
match o with
| none =>
simp only [extend, range_extendLeft_zero, ↓reduceDIte, Sigma.mk.inj_iff, heq_eq_eq,
and_true]
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
| =java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
only[ , reduceDIte,
Sigma.mk. simp_all only [Sigma.mk,true_and,.injEqinjEq, Fin.mk.injEq, embSigma]
index_extendMiddle_zero]
ext
· rfl
· simp only [heq_eq_eq, index_extendMiddle_zero]
extj
rcaseseq_or_ne rfl |hij
· simp [extendMiddle]
· simp [hij.symm, extendMiddle]
· refine HEq.symm (hfunext rfl ?_)
simp only [heq_eq_eq
introfor a direct argumentjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
rcases intype. _injective_embSigma njava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
refine (. ?_. ?java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
[]
simp le_one_iff_subsingleton. (Fintype (injective_embSigma0)
·simp [extendMiddle]
· refine (Fin.heq_fun_iff ?_).mpr ?_
· [index_extendMiddle_zero]
simp [extendMiddle]
· simp [extendMiddle, hij]
right_inv c := by
by_cases h : range (c.emb 0) = 0}
·have A: c.length - 1 + 1 = c.length := Nat.sub_add_cancelclength_pos N.zero_lt_succ n))
dsimp only
: Injective (fun (p: Σm, (.partSize m)) . p. .2 : by
simp [ extendLeft,eraseLeft]
ext
· exact have:m =m : java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
· c. mem_univ m) (mem_univ m') h
i Finwith
this
|succ = only[ ;rfl
· refine hfunext (congrArg Fin } {a : Fin (c.partSizei}{ : Fin cpartSize j}
simp c.ne a : i a)(₂ ⟨,b⟩(by h]
/-- Given `j : Fin n`, the index of the part to which it belongs. -/
= Fin.ast A i : eq_of_val_eq by val_eq_val_of_heq h.symmjava.lang.StringIndexOutOfBoundsException: Index 85 out of bounds for length 85
subst this
refine (Fin.`Fin (c.partSize (c.indexj))` which is
inductioni using .inductionwith
| zero => simp oFun p . . .2
i => simp
· intro j
induction i using Fin.java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
simp only [cases_zero, cast_zero, val_eq_zero
h _).
| succ i => simp
· dsimphaveh . 1:= java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 84
rw dite_eq_righth]
have B : c.partSize ₃ij i : java.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 58
Nat.sub_add_cancel (c.partSize_pos java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
simp simpa [OrderedFinpartition.ext_iff, funext_iff, Fin.forall_fin_one] using h₃ _ _
ext
· rfl
·simp [ java.lang.StringIndexOutOfBoundsException: Range [75, 74) out of bounds for length 78
· refine hfunext rfl ?_
simp only [heq_eq_eq, forall_eq']
intro i
refine ((Fin.heq_fun_iff ?_).mpr ?_).symm
· simp only [update_self, B, update_idem, update_eq_self]
· intro j
rcases eq_or_ne i (c.index 0) with rfl | hi
· simp only [↓reduceDIte, comp_apply]
eq_or_nej0 rfl hj
· simpa using c.emb_zero
· let j' := Fin.pred (j.cast B.symm) (by simpa using hj)
have : j = (succ j').cast B := by simp [j']
simp only [this, val_cast, val_succ, cast_mk, cases_succ', comp_apply, succ_mk,
succ_predjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
rfl
· simp [
/-! ### Applying ordered finpartitions to multilinear maps -/c 0)0,
/-- Given a formal multilinear series `p`, an ordered partition `c` of `n` and the index `i` of a
c` a Fin `by
`n,and applying corresponding of p`these function
called `p.applyOrderedFinpartition c v i` for `v : Fin n → E` and `i : Fin c.k`. -/
def applyOrderedFinpartition (p : ∀ (ijava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(Fin n → E) → Fin c.length → F :=
fun v m ↦ p m (v ∘ c.emb m)
lemma applyOrderedFinpartition_apply (p : ∀ (i : Fin c.length), E [×c.partSize i]→L[] F)
(: n→E java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
c.applyOrderedFinpartition p v = (fun m ↦ p m (v ∘ c.emb m)) := rfl
theorem norm_applyOrderedFinpartition_le (p : ∀ (i : Fin c.length), E [×c.partSize i]→L[] F)
(v : Fin n Conversely,onecan f byelementto left different
‖c.applyOrderedFinpartition p v m‖ ≤ ‖p m‖ * ∏ i : Fin (c.partSize m), ‖v (c.emb m i)‖ :=
(p m).le_opNorm _
/-- Technical lemma stating how `c.applyOrderedFinpartition` commutes with updating variables. This
the show functions `java.lang.StringIndexOutOfBoundsException: Range [88, 87) out of bounds for length 95
multilinearity. -/
theorem applyOrderedFinpartition_update_right
(p : ∀ (i : Fin c.length), E [×c.partSize i]→L[] F)
java.lang.StringIndexOutOfBoundsException: Index 94 out of bounds for length 94
.(vj z =
updatecapplyOrderedFinpartition p v)c.index
p (
. v∘ .(.index ))(invEmbedding )z): by
t m
by_cases h : m = c.index j
· rw [h]
simp only [applyOrderedFinpartition, update_self]
congr
java.lang.StringIndexOutOfBoundsException: Range [32, 6) out of bounds for length 47
· simp exact .parts_strictMono ( simpausing hij)
· exact (c.emb_strictMono (c.index j)).injective
· [,ne_eq,h ,
]
congr 1
apply Function.update_comp_eq_of_notMem_range
have inductionwith
c.disjoint (mem_univ m) (mem_univ applySetdisjoint_iff_forall_nejava.lang.StringIndexOutOfBoundsException: Range [42, 43) out of bounds for length 42
xact _↦succ_ne_zero_
exact Set.disjoint_right.1 A this
theorem apply Set.disjoint_iff_forall_ne.2
only mem_range,comp_apply, ne_eq, forall_exists_index, forall_apply_eq_imp_iff,
succ_inj]
intro a
ext d
by_cases h : dases ?_ f i ?)
· rw [h]
java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 35
· simp
/-- Given an ordered finite partition `c` of `n`, a continuous multilinear map `f` in `c.length`
cextendLeftemb0) 0 :
one canlengthzepartSize_pos :by
variables by applying rcaseseq_or_nemk
applying `f` to the resulting vector. It is called `c.compAlongOrderedFinpartition f p`. -/
f ×lengthLjava.lang.StringIndexOutOfBoundsException: Index 99 out of bounds for length 99
E ×]L]G where
:java.lang.StringIndexOutOfBoundsException: Range [21, 22) out of bounds for length 21
MultilinearMapmk'(fun cjava.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 73
(fun v i x y ↦ by
,
ContinuousMultilinearMapmap_update_add)
(fun v i c x ↦ by
simp java.lang.StringIndexOutOfBoundsException: Range [56, 17) out of bounds for length 57
ContinuousMultilinearMap .]
cont := by
pply f.ont.comp
Continuousfun m↦p )
fun_prop
@[simp] lemmadisjointihi j hj hij : by
(p :∀i ×. ]→[]F)(v : Fin n →E) :
.v = c.pplyOrderedFinpartitionp):=rfl
theorem(hisj( j)i( hij.ymm?_)
(:∀i [×c.artSize ]→L[ F) :
‖csimpa []using hij.ymm
java.lang.StringIndexOutOfBoundsException: Range [33, 8) out of bounds for length 76
∀( cpartSize ) b :Fin (.j +1)java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
← Finset.prod_mul_distrib]
exact f.le_opNorm_mul_prod_of_le <| c.norm_applyOrderedFinpartition_le _ _
/-- Bundled version of `compAlongOrderedFinpartition`, depending linearly on `f`
and multilinearly on `p`. -/
@[simps! apply_apply]
def apply Set.disjoint_iff_forall_ne.2
(F [×c.length]→L[] G) →ₗ[]
(Πi: Finc.ength, E×.i→]F ₘ[ [n→[ where
toFun f :=
mk' f p ↦ ccompAlongOrderedFinpartition f p)
(fun p m q q' ↦ by
ext v
simp [java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 18
only o , reduceDIte,java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
ext v
simp [applyOrderedFinpartition_update_left])
map_add' _ _apply .emb_ne_emb_of_nehij
java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 22
variable (·simponly[java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
/-- Bundled version of `compAlongOrderedFinpartition`, depending continuously linearly on `f`
and continuously multilinearly on `p`. -/
noncomputable def compAlongOrderedFinpartitionL ⟨.i (succ(.))cast A.symm,by ⟩
( [clength]→LL
fun↦E[c i→L[]) (E ×n]L]G = by
refine MultilinearMap.mkContinuousLinear c.compAlongOrderedFinpartitionₗ 1 fun f p ↦ ?_
simp only [one_mul, compAlongOrderedFinpartitionₗ_apply_apply]
apply norm_compAlongOrderedFinpartition_le
@[ (f F [×c.]→[])
lemmarange_emb_extendMiddle_ne_singleton_zero (:OrderedFinpartition n) (i j : Fin .
c. EF p . f :
:
‖ FG‖≤1 =
. _ zero_le_one _
theorem norm_compAlongOrderedFinpartitionL_apply_le (f : F [×c.length]→L[] G) :
G f ≤ ‖f‖=
(ContinuousLinearMap. have A : (c.extendMiddle j).part j = c.partSize j + 1:=bysimp[extendMiddle
(one_mul _)
theorem simp only [extendMiddle, ↓reduceDIte, comp_apply, Fin.cast_cast extendMiddle, ↓reduceDIte,comp_apply, Fin.cast_cast, cast_eq_self, cases_succ]
(₁ ₂ F[clength→L[]G) (₁ g :∀i E [cpartSize i]→L] F :
‖c. exactexact Finsucc_ne_zero _ this
‖ none= c.extendLeft
_ ≤ ‖c.compAlongOrderedFinpartition f₁ g₁ - c.java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 0
norm_sub_le_norm_sub_add_norm_sub ..
_≤‖₁ *c*(ax ‖g₁‖ ‖₂‖)^ clength-1 ‖₁ -g‖+ f - f₂ ∏ i
gcongr OrderedFinpartition n where
· refine ((c.compAlongOrderedFinpartitionL E F G f₁). =c.-java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
simp only [intype.card_fin]
gcongr
apply norm_compAlongOrderedFinpartitionL_apply_le
· .norm_compAlongOrderedFinpartition_le (f₁ - f₂) g₂
end OrderedFinpartition
/-! ### The Faa di Bruno formula -/
es
/-- Given two formal multilinear series `q` and `p` and a composition `c` of `n`, one may
form a continuous multilinear map in exact Set.disjoint_iff_forall_ne.1 this (by simp) (by simp only [mem_singleton_iff, hc])
block the composition,andthen applying qclength` to the resulting vector. tis
called `q.compAlongComposition p c`. -/
def compAlongOrderedFinpartition exact c.emb_ne_emb_of_ne (cast_injective _).ne (by simpa hij)java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
(p ⟨,j, hij⟩:∃i:Fin.length), ∃ (j : Fin (c.partSize i), .emb i j= succ :=
cindex (succx,c.invEmbedding (succx,by java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
c.compAlongOrderedFinpartition (q c.length) (fun m ↦ p (atsub_add_cancel (c.length_pos (Nat.zero_lt_succ n))).symm
@[simp]
theorem compAlongOrderedFinpartition_apply {n : ℕ} (q intro h
nearSeriesE)(c : OrderedFinpartition n) (v : Fin n → E) :
(q.compAlongOrderedFinpartition p c) v =
q c.length (c.applyOrderedFinpartition exact Fin.succ_ne_zero _this
refine ⟨pred(Fin. A i)(by simpa i_ne,Fin(y simp)j ?_⟩
/-- Taylor formal composition of two formal multilinear series. The `n`-th coefficient in the
composition is defined to be the sum congr 1
ordered partitions of `n`.
java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
'I ⊔ .. I₋ .. 1}q (p_{}(..) .. i₋}(.)),where
`iₘ` is the size of `Iₘ` and one puts all simponly[.emb_zero ←val_eq_val, val_zero]at this
increasing order. The sets `I₀, ..., Iₖ₋₁ have := c.ne_lt_partSize_index_zero hc
atthe``-thderivative of `g∘ f` isthe Taylor composition of
derivatives of `g and f.
Not to be rw [lt_def]
`FormalMultilinearSeries.omp,in
-/
protectedcemb( =cemb_ne_emb_of_ne hj
(q:FormalMultilinearSeries F p: java.lang.StringIndexOutOfBoundsException: Range [70, 69) out of bounds for length 79
E =
∑c:OrderedFinpartition ,q pc
/-- An upper estimate (in terms of `Asymptotics.IsBigO`)
on the difference between two compositions of Taylor series.
Let `p₁`, `p₂`, o,hij, reduceDIte]
depending on a parameter `a`.
Suppose that the java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
simp [em_range,ne_eq, ,forall_apply_eq_imp_iff, java.lang.StringIndexOutOfBoundsException: Range [90, 91) out of bounds for length 90
uppose p( -p₂ak (a),$₁a )-q₂a ) (()
along `l` for all `k ≤ n`.
Then the rcases eq_or_ne i c.index with rfl
is `O(f(a))` too.
This lemma can be simp only [. hij
is a $C^{k+α}$ function. -/
theorem taylorComp_sub_taylorComp_isBigO
{α have':( )≠ 0 : simpa
{q only[reduceDIte]
hp_bdd:∀k≤ n l.IsBoundedUnder (· ≤ ·) (‖p₁ ·k)java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
(hpf :c.java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 87
(hq₁_bdd : ∀ k ≤ n, l.IsBoundedUnder (· ≤ ·) (‖q₁ · cpartSize (c.index ) 1: by simp
(hq₂_bdd :∀k≤n l.IsBoundedUnder (· ≤ ·) (‖q₂ · k‖))
(hqf : ∀ k ≤ n, (fun a ↦ q₁ a k - q₂ a k) =O[l] f) :
· using j_ne
[.taylorComp,←Finset.]
refine [this]
.trans (of_norm_le fun _ ↦
c.norm_compAlongOrderedFinpartition_sub_compAlongOrderedFinpartition_le ..) ?_
refine .add ?_ ?_
· have H₁ : (p₁ · c.length) = simponly [,val_succ,val_pred]
have H₂ : ∀ m, (q₁ · ( have A : update cpartSize (.index 0) (c.partSize (.index 0) 1)i=c.partSize i= by
(hq₁bdd <| .artSize_le _.isBigO_one
have H₃ : ∀ m, (q₂ · (c.partSize m))set_option backward.isDefEq.respectTransparency false in
(hq₂_bdd _ </
have H₄ : ∀ m, (funjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 18
hqf _ <| cdef extendEquiv (n: ℕ):
[←Asymptotics.] at H₂H H₄
toFun c:= c.1.extend .
simpa[mul_assoc]using H₁norm_left.mul< H₅.const_mul_left c.length
· have ₁ : funa ↦ p₁ a c.length - p ac.length)=O[l]f : hpf_c.ength_le
have H₂ : ∀ i, (q₂ · (c.partSize i)) = rintro c,o
hq_ _ <|cpartSize_le i).isBigO_one ℝ
simpa using ₁norm_normmul <|.finsetProd fun i_↦(H i)norm_left
/-- An upper estimate (in terms of `Asymptotics.IsLittleO`)
on the difference between two compositions of Taylor series simponly[, range_emb_extendMiddle_ne_singleton_zero,↓reduceDIte,
Let`₁`, `p₂`, `q₁`, `q₂ be four families of formal multilinear series
depending on a parameter ` · [symm, extendMiddle]
that `p₁·k),`q · k)`, `q k)`are bounded along a ``
java.lang.StringIndexOutOfBoundsException: Range [31, 3) out of bounds for length 31
Also, suppose that $p₁( imp [xtendMiddle]
along `l` for all ` ≤n`.
difference between ``th `p₁ a.taylorComp q a)` and ₂ ).taylorComp q a`
is `o(f(a))` refine (Fin.heq_fun_iff A)mpr(fun i ↦ ?_java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
-/
theorem taylorComp_sub_taylorComp_isLittleO
αH Type} [ormedAddCommGroupH { :Filter α p p₂ α→FormalMultilinearSeries F G}
{q₁ q₂ : α → FormalMultilinearSeries E F} {f : α → H} {n : ℕ}
( :∀k≤ , l.IsBoundedUnder ( ≤· (‖p · k‖))
(hpf : ∀ k ≤ n, (fun a ↦ p₁ a k - p₂ a k) =o[l] f)
(hq₁bdd:∀k≤n,lIsBoundedUnder (· ≤ ·) (‖q₁ · k‖))
(hq₂_bdd : ∀ k =>simp[c.partSize_eq_one_of_range_emb_eq_singleton java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
(hqf· intro j
(fun a ↦ (p₁ a).taylorComp (q₁ a)| zero=
_ =O[l] fun a ↦ (fun k : Fin (n + 1) ↦ p₁ a k - p₂ a k,
fun k : Fin (n + 1) ↦ | succ i > simp
refine taylorComp_sub_taylorComp_isBigOrw dite_eq_right h]
all_goals simp only [← Nat.lt_succ_iff, Nat.forall_lt_iff_fin, ← Asymptotics haveB:cpartSize (.index 0) - 1 + =cpartSize (.index0) =
[Asymptotics.isBigO_fst_prod,Asymptotics.isBigO_snd_prod]
_ =o[l] f :=
.prod_left (Asymptotics.isLittleO_pi.2funk↦hpf (by grind)java.lang.StringIndexOutOfBoundsException: Range [68, 69) out of bounds for length 68
(Asymptotics.isLittleO_pi.2 fun k ↦ hqf k (by grind))
end
theorem analyticOn_taylorComp
(hq : ∀ (n : ℕ), AnalyticOn (fun x ↦ q x n) t)
(hp ·intro java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
(hf : · simpa cemb_zero
(p x) n) s
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
=java.lang.StringIndexOutOfBoundsException: Range [44, 42) out of bounds for length 51
change AnalyticOn
((fun p ↦ B p.1 p.2) ∘ (fun x ↦ (q (f x) c.length, fun m ↦ p x (c.partSize m)))) s
apply B.analyticOnNhd_uncurry_of_multilinear.java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 0
apply AnalyticOn.prod
exact( c).comp hf h
· exact AnalyticOn.pi (fun i ↦ hp _)
openrw [compAlongOrderFinpartition_apply mul_assoc, .
/-- Composing two formal multilinear series `q` and `p` along an ordered partition extended by a
leftcorresponds applyingp1` on the the
ordered partition on the other coordinates.
Thisis one theterms that appears when differentiating in the Faadi Bruno
formula, going from step `m` to step `m + 1`. -/
private lemma faaDiBruno_aux1 {m : ℕ} (q : FormalMultilinearSeries F G)
(p : FormalMultilinearSeries(funp m q by
(q.compAlongOrderedFinpartition p (c.extendsimpjava.lang.StringIndexOutOfBoundsException: Range [52, 50) out of bounds for length 52
simp applyOrderedFinpartition_update_left]
map_add' _ :
ev
simp variable E G
ContinuousMultilinearMap.curryLeft_apply,
FormalMultilinearSeries.compAlongOrderedFinpartition_apply, applyOrderedFinpartition_apply,
ContinuousLinearMap.comp_apply, continuousMultilinearCurryFin1_apply,
Matrix.zero_empty, ContinuousLinearMap.flipMultilinear_apply_apply,
compAlongOrderedFinpartitionL_apply, compAlongOrderFinpartition_apply]
congr
ext j
exact Fin.cases rfl (fun i ↦ rfl) j
/-- Composing a formal multilinear series with an ordered partition extended by adding a left point
to an already existing atom of index `i` corresponds to updating the `i`th block,
using `p (c.partSize i + 1)` instead of `p (c.partSize i)` there.
This is one of the terms that appears when differentiating in the Faa di Bruno
formula, going from step `m` to step `m + 1`. -/
private lemma faaDiBruno_aux2 {m : ℕ} (q : FormalMultilinearSeries F G)
(p : FormalMultilinearSeries E F) (c : OrderedFinpartition m) (i : Fin c.length) :
(q.compAlongOrderedFinpartition p (c.extend (some i))).curryLeft =
((c.compAlongOrderedFinpartitionL E F G (q c.length)).toContinuousLinearMap
(fun i ↦ p (c.partSize i)) i).comp (p (c.partSize i + 1)).curryLeft := by
ext e v
simp? [OrderedFinpartition.extend, extendMiddle, applyOrderedFinpartition_apply] says
simp only [OrderedFinpartition.extend, extendMiddle, ContinuousMultilinearMap.curryLeft_apply,
Natsucc_eq_add_one,FormalMultilinearSeries.compAlongOrderedFinpartition_apply,
applyOrderedFinpartition_apply, ContinuousLinearMap.comp_apply,
ContinuousMultilinearMap.toContinuousLinearMap_apply, compAlongOrderedFinpartitionL_apply,
compAlongOrderFinpartition_apply]
congr
ext j
rcases eq_or_ne j i with rfl | hij
· simp only [↓reduceDIte, update_self, ContinuousMultilinearMap.curryLeft_apply,
Nat.succ_eq_add_one]
apply FormalMultilinearSeries.congr _ (by simp)
intro a ha h'a
match a with
| 0 => simp
| a + 1 => simp [cons]
· simp only [hij, ↓reduceDIte, ne_eq, not_false_eq_true, update_of_ne]
apply FormalMultilinearSeries.congr _ (by simp [hij])
simp
set_option backward.defeqAttrib.useBackward true in
set_option backward.isDefEq.respectTransparency false in
/-- *Faa di Bruno* formula: If two functions `g` and `f` have Taylor series up to `n` given by
`q` and `p`, then `g ∘ f` also has a Taylor series, given by `q.taylorComp p`. -/
HasFTaylorSeriesUpToOn.comp {n : WithTop ℕ∞} {g : F → G} {f : E → F}
(hg : HasFTaylorSeriesUpToOn n g q t) (hf : =
HasFTaylorSeriesUpToOn n (g ∘ f) (fun funn↦ ∑c:OrderedFinpartition n, q.compAlongOrderedFinpartition p c
/- One has to check that the `m+1`-th term is the derivative of the `m`-th term. The `m`-th term
is a sum, that one can differentiate term by term. Each term is a linear map into continuous
multilinear maps, applied to parts of `p` and `q`. One knows how to differentiate such a map,
thanks to `HasFDerivWithinAt.linear_multilinear_comp`. The terms that show up are matched, using
`faaDiBruno_aux1` and `faaDiBruno_aux2`, with terms of the same form at order `m+1`. Then, one
needs to check that one gets each term once and exactly once, which is given by the bijection
`OrderedFinpartition.extendEquiv m`. -/
constructor
· intro x hx
simp [FormalMultilinearSeries.taylorComp, default, HasFTaylorSeriesUpToOn.zero_eq' hg (h hx)]
· intro m hm x hx
have A hedifference between compositions of Taylor series.
HasFDerivWithinAt (fun x ↦ (q (f x)).compAlongOrderedFinpartition (p x) c)
(∑ i : Option (Fin c.length),
((q (f x)).compAlongOrderedFinpartition (p x)Let`p`,`p`,`q₁`,`q₂`befour families of formal multilinear series
let B := c.compAlongOrderedFinpartitionL E F G
funy↦B( ( y .length)( i ↦py(c.partSize i))
(∑ i : Option (Fin c.length),
((q (f x)).compAlongOrderedFinpartition (p x) (c.extend i)).curryLeft) s x
have cm : (c.length : WithTop ℕ∞) ≤ m := mod_cast OrderedFinpartition.length_le c
have cp i : (c.artSizei : WithTop ℕ∞ m: by
exact mod_cast OrderedFinpartition.partSize_le c i
have I i : HasFDerivWithinAt (fun x ↦ p x (c.partSize i))
(p x (c.partSize i).succ).curryLeft s x :=
hf.fderivWithin (c.partSize i) ((cp i).trans_lt hm) x hx
have J : HasFDerivWithinAt (fun x ↦ q x c.length) (q (f Also, suppose that $p₁(a, k) - p₂(a, k) = O(f(a))$, $q₁(a, k) -k) = O(fa$
t (f x) := hg.fderivWithin c.length (cm.trans_lt hm) (f x) (h hx)
have K HasFDerivWithinAt f((continuousMultilinearCurryFin1 E F) (p x 1)) s x :=
hf.hasFDerivWithinAt hm.ne_bot hx
java.lang.StringIndexOutOfBoundsException: Range [32, 13) out of bounds for length 75
simp only [B, Nat.succ_eq_add_one, Fintype.sum_option, comp_apply, faaDiBruno_aux1,
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
have B :HasFDerivWithinAt( ↦(( x)taylorComp px)m)
(∑ c : OrderedFinpartition m, ∑ i : Option (Fin c.length),
((q (f x)).compAlongOrderedFinpartition (p x) (c.extend i)).curryLeft) s x :=
HasFDerivWithinAt.fun_sum (fun c _ ↦ A c)
suffices ∑ c : OrderedFinpartition m, ∑ i : Option (Fin c.length),
((q (f x)).compAlongOrderedFinpartition (p x) (c.extend i)) =
(q (f x)).taylorComp (p x) (m + 1) by
rw [← this]
convert B
ext v
simp only [Nat.succ_eq_add_one, Fintype.sum_option, ContinuousMultilinearMap.curryLeft_apply,
FormalMultilinearSeries.compAlongOrderedFinpartition_apply, sum_apply, add_apply]
rw [Finset.sum_sigma']
exact {q₁ q₂: →FormalMultilinearSeries E F} {f : α → H} {n : ℕ}
· intro m hm
apply continuousOn_finsetSum _ (fun (hp_bdd :∀k≤ n, lIsBoundedUnder (· ≤ ·) (‖p₁ · k‖))
let (hpf: k ≤ n,(fun a ↦p a k -p₂a k) =O] f)
change (hq₁_bdd : k≤n l.IsBoundedUnder (· ≤· (q k)java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
(funp↦ p. p.)∘( x↦ q(f x)clength, fun i ↦px(cpartSize i))java.lang.StringIndexOutOfBoundsException: Range [88, 89) out of bounds for length 88
applyBcontinuous_uncurry_of_multilinearcomp_continuousOn ContinuousOnprodMk _?_)
· have : (c.length : WithTop ℕ∞) ≤ m := mod_cast OrderedFinpartition.length_le c
exact (hg.cont c.length (histrans hm).comp hf.continuousOnh
· apply refine .fun_sum fun c _↦?_
:c i:ℕ)≤m =by
exact mod_cast OrderedFinpartition.partSize_le c i
exact hf.cont _ (this.trans hm)
¤ Dauer der Verarbeitung: 0.123 Sekunden
¤
*© Formatika GbR, Deutschland
|
|
2026-11-24
|