roseking's picture
Add lean source and binary files (part 16)
159357f verified
Raw History Blame Contribute Delete
6.83 kB
20
lemma sum_cellCount (c : Fin N → C) :
    ∑ a ∈ Finset.univ.image c, cellCount c a = N := by
proof · 5 lines
  classical
  have hc (a : C) : cellCount c a = ∑ i ∈ Finset.univ.filter (fun i => c i=a), (1:ℕ) := by simp [cellCount]
  simp_rw [hc]
  rw [Finset.sum_fiberwise_of_maps_to (fun i _ => Finset.mem_image_of_mem c (Finset.mem_univ i))]
  simp
28
lemma cellCount_le (c : Fin N → C) (a : C) : cellCount c a ≤ N := by
proof · 1 line
  exact (Finset.card_filter_le _ _).trans_eq (Finset.card_fin N)
31
lemma sum_cell_boundary (c : Fin N → C) :
    ∑ a ∈ Finset.univ.image c, ((cellCount c a:ℝ)^(4/3:ℝ)+(cellCount c a:ℝ)) ≤
      (N:ℝ)^(4/3:ℝ)+(N:ℝ) := by
proof · 15 lines
  have hp (x : ℝ) (hx : 0 ≤ x) : x^(4/3:ℝ) = x*x^(1/3:ℝ) := by
    rw [show (4/3:ℝ) = 1+(1/3:ℝ) by norm_num,Real.rpow_add' hx (by norm_num)]
    rw [Real.rpow_one]
  have hn : (∑ a ∈ Finset.univ.image c, (cellCount c a:ℝ)) = N := by
    exact_mod_cast sum_cellCount c
  calc
    _ ≤ ∑ a ∈ Finset.univ.image c, ((cellCount c a:ℝ)*(N:ℝ)^(1/3:ℝ)+(cellCount c a:ℝ)) := by
      apply Finset.sum_le_sum
      intro a _
      rw [hp _ (Nat.cast_nonneg _)]
      have hle : (cellCount c a:ℝ) ≤ (N:ℝ) := by exact_mod_cast cellCount_le c a
      have hr := Real.rpow_le_rpow (Nat.cast_nonneg (cellCount c a)) hle (by norm_num : 0 ≤ (1/3:ℝ))
      have hm := mul_le_mul_of_nonneg_left hr (Nat.cast_nonneg (cellCount c a))
      linarith
    _ = _ := by rw [Finset.sum_add_distrib,←Finset.sum_mul,hn,hp _ (Nat.cast_nonneg N)]
50
lemma cellLowerEnergy_bound (c : Fin N → C) :
    tfKinetic*(∑ a ∈ Finset.univ.image c, (cellCount c a:ℝ)^(5/3:ℝ)) -
      neumannRemainderConstant*((N:ℝ)^(4/3:ℝ)+(N:ℝ)) ≤ cellLowerEnergy c := by
proof · 4 lines
  unfold cellLowerEnergy neumannLowerEnergy
  rw [Finset.sum_sub_distrib,←Finset.mul_sum,←Finset.mul_sum]
  exact sub_le_sub_left (mul_le_mul_of_nonneg_left (sum_cell_boundary c)
    neumannRemainderConstant_pos.le) _
58
lemma selected_cell_pressure_le (c : Fin N → C) (S : Finset (Fin N)) :
    (∑ a ∈ Finset.univ.image c,
      ((S.filter (fun i => c i=a)).card:ℝ)^(5/3:ℝ)) ≤
      ∑ a ∈ Finset.univ.image c, (cellCount c a:ℝ)^(5/3:ℝ) := by
proof · 5 lines
  apply Finset.sum_le_sum
  intro a _
  apply Real.rpow_le_rpow (Nat.cast_nonneg _)
  · exact_mod_cast Finset.card_le_card (Finset.filter_subset_filter (fun i => c i=a) (Finset.subset_univ S))
  · norm_num
68
theorem neumann_cells_pressure_lower (c : Fin N → C)
    {f : (Fin N → Fin 2) → ((Fin N × Fin 3) → ℝ) → ℂ}
    (hf : ∀ s, ContDiff ℝ 1 (f s))
    (hanti : CellAntisymmetric c (fun s => finiteCubeFunction (hf s)))
    (s : Fin N → Fin 2) :
    tfKinetic*(∑ a ∈ Finset.univ.image c, (cellCount c a:ℝ)^(5/3:ℝ)) *
        (∫ x, ‖finiteCubeFunction (hf s) x‖^2) ≤
      (1/2:ℝ)*(∑ i, ∫ x, ‖finiteCubeGradient (hf s) i x‖^2) +
        neumannRemainderConstant*((N:ℝ)^(4/3:ℝ)+(N:ℝ)) *
          (∫ x, ‖finiteCubeFunction (hf s) x‖^2) := by
proof · 4 lines
  have hb := mul_le_mul_of_nonneg_right (cellLowerEnergy_bound c)
    (integral_nonneg (μ := volume) (fun x => sq_nonneg ‖finiteCubeFunction (hf s) x‖))
  have hl := neumann_cell_component_lower c hf hanti s
  nlinarith
91
def cellPressure (c : Fin N → C) : ℝ := ∑ i, (cellCount c (c i):ℝ)^(2/3:ℝ)
93
lemma cellPressure_eq (c : Fin N → C) :
    cellPressure c = ∑ a ∈ Finset.univ.image c, (cellCount c a:ℝ)^(5/3:ℝ) := by
proof · 15 lines
  classical
  unfold cellPressure
  rw [←Finset.sum_fiberwise_of_maps_to (g := c) (t := Finset.univ.image c)
    (fun i _ => Finset.mem_image_of_mem c (Finset.mem_univ i))]
  apply Finset.sum_congr rfl
  intro a _
  calc
    _ = ∑ i ∈ Finset.univ.filter (fun i => c i=a), (cellCount c a:ℝ)^(2/3:ℝ) := by
      apply Finset.sum_congr rfl
      intro i hi
      rw [(Finset.mem_filter.mp hi).2]
    _ = (cellCount c a:ℝ)*(cellCount c a:ℝ)^(2/3:ℝ) := by simp [cellCount]
    _ = _ := by
      rw [show (5/3:ℝ)=1+(2/3:ℝ) by norm_num,
        Real.rpow_add' (Nat.cast_nonneg _) (by norm_num),Real.rpow_one]
111
lemma cellPressure_nonneg (c : Fin N → C) : 0 ≤ cellPressure c :=
proof · 1 line
  Finset.sum_nonneg (fun _i _ => Real.rpow_nonneg (Nat.cast_nonneg _) _)
114
lemma cellPressure_le (c : Fin N → C) : cellPressure c ≤ (N:ℝ)^(5/3:ℝ) := by
proof · 9 lines
  calc
    _ ≤ ∑ i : Fin N, (N:ℝ)^(2/3:ℝ) := by
      apply Finset.sum_le_sum
      intro i _
      exact Real.rpow_le_rpow (Nat.cast_nonneg _) (by exact_mod_cast cellCount_le c (c i)) (by norm_num)
    _ = (N:ℝ)*(N:ℝ)^(2/3:ℝ) := by simp
    _ = _ := by
      rw [show (5/3:ℝ)=1+(2/3:ℝ) by norm_num,
        Real.rpow_add' (Nat.cast_nonneg _) (by norm_num),Real.rpow_one]
125
def pointCell (x : (Fin N × Fin 3) → ℝ) (i : Fin N) : Fin 3 → ℤ := fun a => ⌊x (i,a)⌋
126
def indexCell (z : (Fin N × Fin 3) → ℤ) (i : Fin N) : Fin 3 → ℤ := fun a => z (i,a)
128
lemma pointCell_measurable : Measurable (pointCell (N := N)) := by
proof · 5 lines
  apply Measurable.of_eval
  intro i
  apply Measurable.of_eval
  intro a
  exact Int.measurable_floor.comp (measurable_pi_apply (i,a))
135
lemma flatPressure_measurable : Measurable (fun x : (Fin N × Fin 3) → ℝ => cellPressure (pointCell x)) :=
proof · 1 line
  (measurable_of_countable (fun c : Fin N → Fin 3 → ℤ => cellPressure c)).comp pointCell_measurable
138
lemma pointCell_of_mem_floorCube {z : (Fin N × Fin 3) → ℤ} {x : (Fin N × Fin 3) → ℝ}
    (hx : x ∈ floorCube z) : pointCell x = indexCell z := by
proof · 2 lines
  ext i a
  exact hx (i,a)
143
lemma flatPressure_integrable {f : ((Fin N × Fin 3) → ℝ) → ℂ} (hf : MemLp f 2) :
    Integrable (fun x => cellPressure (pointCell x)*‖f x‖^2) := by
proof · 4 lines
  apply hf.norm.integrable_sq.bdd_mul flatPressure_measurable.aestronglyMeasurable
  exact Filter.Eventually.of_forall (fun x => by
    rw [Real.norm_of_nonneg (cellPressure_nonneg _)]
    exact cellPressure_le _)
150
lemma integral_floorCube_pressure (z : (Fin N × Fin 3) → ℤ)
    (f : ((Fin N × Fin 3) → ℝ) → ℂ) :
    (∫ x in floorCube z, cellPressure (pointCell x)*‖f x‖^2) =
      cellPressure (indexCell z)*(∫ x in floorCube z, ‖f x‖^2) := by
proof · 4 lines
  rw [←integral_const_mul]
  apply setIntegral_congr_fun (floorCube_measurable z)
  intro x hx
  simp only [pointCell_of_mem_floorCube hx]