File size: 3,462 Bytes
135052a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
import Mathlib
import OAI.Probability.SKBarriers.Calculus.ParameterSpace

namespace OAI

section
section
noncomputable section
open scoped BigOperators Topology
open MeasureTheory ProbabilityTheory Filter
noncomputable section
open MeasureTheory Set Filter
open scoped Topology Interval
noncomputable section
open MeasureTheory Set
open scoped Interval
namespace SK.Analytic

def parameter : (n : ℕ) → ParameterSpace n →L[ℝ] ℝ
  | 0 => ContinuousLinearMap.id ℝ ℝ
  | n+1 => (parameter n).comp (ContinuousLinearMap.fst ℝ (ParameterSpace n) ℝ)

def parameterAxis : (n : ℕ) → ParameterSpace n
  | 0 => 1
  | n+1 => (parameterAxis n, 0)

@[simp] theorem parameter_axis (n : ℕ) : parameter n (parameterAxis n) = 1 := by
  induction n with
  | zero => rfl
  | succ n ih => exact ih

@[simp] theorem coordinateSquare_axis (n : ℕ) : coordinateSquare n (parameterAxis n) = 0 := by
  induction n with
  | zero => rfl
  | succ n ih => simpa only [coordinateSquare, parameterAxis, pow_two, mul_zero, add_zero] using ih

def cubeIntegral : (n : ℕ) → (ParameterSpace n → ℝ) → ℝ → ℝ → ℝ → ℝ
  | 0, f, _, _ => f
  | n+1, f, a, b => cubeIntegral n (fun x => ∫ y in a..b, f (x,y)) a b

def parameterDerivative (n : ℕ) (f : ParameterSpace n → ℝ) (z : ParameterSpace n) : ℝ :=
  fderiv ℝ f z (parameterAxis n)

theorem contDiff_cubeIntegral (n r : ℕ) (f : ParameterSpace n → ℝ)
    (hf : ContDiff ℝ r f) (a b : ℝ) : ContDiff ℝ r (cubeIntegral n f a b) := by
  induction n with
  | zero => exact hf
  | succ n ih => exact ih _ (contDiff_intervalIntegral r f hf a b)

theorem parameterDerivative_intervalIntegral (n : ℕ) (f : ParameterSpace (n+1) → ℝ)
    (hf : ContDiff ℝ 1 f) (a b : ℝ) (x : ParameterSpace n) :
    parameterDerivative n (fun x => ∫ y in a..b, f (x,y)) x =
      ∫ y in a..b, parameterDerivative (n+1) f (x,y) := by
  let f₁ : ParameterSpace n × ℝ → ParameterSpace n →L[ℝ] ℝ := fun z =>
    (fderiv ℝ f z).comp (ContinuousLinearMap.inl ℝ (ParameterSpace n) ℝ)
  have hf₁ : Continuous f₁ := (hf.continuous_fderiv (by norm_num)).clm_comp continuous_const
  have hd (x : ParameterSpace n) (y : ℝ) : HasFDerivAt (fun z => f (z,y)) (f₁ (x,y)) x := by
    exact (hf.differentiable (by norm_num) (x,y)).hasFDerivAt.comp x
      ((hasFDerivAt_id x).prodMk (hasFDerivAt_const y x))
  have hI := hasFDerivAt_intervalIntegral (fun x y => f (x,y)) (fun x y => f₁ (x,y))
    hf.continuous hf₁ hd a b x
  have hInt : IntervalIntegrable (fun y => f₁ (x,y)) volume a b :=
    (hf₁.comp (continuous_const.prodMk continuous_id)).intervalIntegrable a b
  rw [parameterDerivative, hI.fderiv, ContinuousLinearMap.intervalIntegral_apply hInt]
  rfl

theorem hasDerivAt_cubeIntegral (n : ℕ) (f : ParameterSpace n → ℝ)
    (hf : ContDiff ℝ 1 f) (a b x : ℝ) :
    HasDerivAt (cubeIntegral n f a b) (cubeIntegral n (parameterDerivative n f) a b x) x := by
  induction n with
  | zero => exact (hf.differentiable (by norm_num) x).hasFDerivAt.hasDerivAt
  | succ n ih =>
    have hh := ih (fun z => ∫ y in a..b, f (z,y)) (contDiff_intervalIntegral 1 f hf a b)
    have he : parameterDerivative n (fun z => ∫ y in a..b, f (z,y)) =
        fun z => ∫ y in a..b, parameterDerivative (n+1) f (z,y) := by
      funext z
      exact parameterDerivative_intervalIntegral n f hf a b z
    rw [he] at hh
    exact hh

end SK.Analytic

end
end
end
end
end

end OAI