-- Mathlib/Analysis/BoundedVariation.lean
theorem ae_differentiableWithinAt_of_mem_pi {ι : Type*} [Fintype ι] {f : ℝ → ι → ℝ} {s : Set ℝ}
    (h : LocallyBoundedVariationOn f s) : ∀ᵐ x, x ∈ s → DifferentiableWithinAt ℝ f s x

Proof state:
ι : Type u_4
inst✝ : Fintype ι
f : ℝ → ι → ℝ
s : Set ℝ
h : LocallyBoundedVariationOn f s
⊢ ∀ᵐ (x : ℝ), x ∈ s → DifferentiableWithinAt ℝ f s x

Tactic:
have A : ∀ i : ι, LipschitzWith 1 fun x : ι → ℝ => x i := fun i => LipschitzWith.eval i

Result:
ι : Type u_4
inst✝ : Fintype ι
f : ℝ → ι → ℝ
s : Set ℝ
h : LocallyBoundedVariationOn f s
A : ∀ (i : ι), LipschitzWith 1 fun x => x i
⊢ ∀ᵐ (x : ℝ), x ∈ s → DifferentiableWithinAt ℝ f s x

Proof state:
ι : Type u_4
inst✝ : Fintype ι
f : ℝ → ι → ℝ
s : Set ℝ
h : LocallyBoundedVariationOn f s
A : ∀ (i : ι), LipschitzWith 1 fun x => x i
⊢ ∀ᵐ (x : ℝ), x ∈ s → DifferentiableWithinAt ℝ f s x

Tactic:
have : ∀ i : ι, ∀ᵐ x, x ∈ s → DifferentiableWithinAt ℝ (fun x : ℝ => f x i) s x := fun i ↦ by
  apply ae_differentiableWithinAt_of_mem_real
  exact LipschitzWith.comp_locallyBoundedVariationOn (A i) h

Result:
ι : Type u_4
inst✝ : Fintype ι
f : ℝ → ι → ℝ
s : Set ℝ
h : LocallyBoundedVariationOn f s
A : ∀ (i : ι), LipschitzWith 1 fun x => x i
this : ∀ (i : ι), ∀ᵐ (x : ℝ), x ∈ s → DifferentiableWithinAt ℝ (fun x => f x i) s x
⊢ ∀ᵐ (x : ℝ), x ∈ s → DifferentiableWithinAt ℝ f s x

Proof state:
case h
ι : Type u_4
inst✝ : Fintype ι
f : ℝ → ι → ℝ
s : Set ℝ
h : LocallyBoundedVariationOn f s
A : ∀ (i : ι), LipschitzWith 1 fun x => x i
this : ∀ (i : ι), ∀ᵐ (x : ℝ), x ∈ s → DifferentiableWithinAt ℝ (fun x => f x i) s x
x : ℝ
hx : ∀ (i : ι), x ∈ s → DifferentiableWithinAt ℝ (fun x => f x i) s x
xs : x ∈ s
⊢ DifferentiableWithinAt ℝ f s x

Tactic:
exact differentiableWithinAt_pi.2 fun i => hx i xs

Result:
no goals

Proof state:
ι : Type u_4
inst✝ : Fintype ι
f : ℝ → ι → ℝ
s : Set ℝ
h : LocallyBoundedVariationOn f s
A : ∀ (i : ι), LipschitzWith 1 fun x => x i
i : ι
⊢ ∀ᵐ (x : ℝ), x ∈ s → DifferentiableWithinAt ℝ (fun x => f x i) s x

Tactic:
apply ae_differentiableWithinAt_of_mem_real

Result:
case h
ι : Type u_4
inst✝ : Fintype ι
f : ℝ → ι → ℝ
s : Set ℝ
h : LocallyBoundedVariationOn f s
A : ∀ (i : ι), LipschitzWith 1 fun x => x i
i : ι
⊢ LocallyBoundedVariationOn (fun x => f x i) s

Proof state:
ι : Type u_4
inst✝ : Fintype ι
f : ℝ → ι → ℝ
s : Set ℝ
h : LocallyBoundedVariationOn f s
A : ∀ (i : ι), LipschitzWith 1 fun x => x i
this : ∀ (i : ι), ∀ᵐ (x : ℝ), x ∈ s → DifferentiableWithinAt ℝ (fun x => f x i) s x
⊢ ∀ᵐ (x : ℝ), x ∈ s → DifferentiableWithinAt ℝ f s x

Tactic:
filter_upwards [ae_all_iff.2 this] with x hx xs

Result:
case h
ι : Type u_4
inst✝ : Fintype ι
f : ℝ → ι → ℝ
s : Set ℝ
h : LocallyBoundedVariationOn f s
A : ∀ (i : ι), LipschitzWith 1 fun x => x i
this : ∀ (i : ι), ∀ᵐ (x : ℝ), x ∈ s → DifferentiableWithinAt ℝ (fun x => f x i) s x
x : ℝ
hx : ∀ (i : ι), x ∈ s → DifferentiableWithinAt ℝ (fun x => f x i) s x
xs : x ∈ s
⊢ DifferentiableWithinAt ℝ f s x

Proof state:
case h
ι : Type u_4
inst✝ : Fintype ι
f : ℝ → ι → ℝ
s : Set ℝ
h : LocallyBoundedVariationOn f s
A : ∀ (i : ι), LipschitzWith 1 fun x => x i
i : ι
⊢ LocallyBoundedVariationOn (fun x => f x i) s

Tactic:
exact LipschitzWith.comp_locallyBoundedVariationOn (A i) h

Result:
no goals