Download data/lean/OAI/Probability/ContinuumTransition/CubeBoundary.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 3.51 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/ContinuumTransition/CubeBoundary.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/ContinuumTransition/CubeBoundary.lean
-
curl -L -o CubeBoundary.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/ContinuumTransition/CubeBoundary.lean
3.51 kB
| import OAI.Probability.ContinuumTransition.GridBoundary | |
| namespace OAI | |
| section | |
| open scoped BigOperators | |
| open MeasureTheory Set | |
| namespace ContinuumTemperature | |
| open Classical | |
| noncomputable def gridIndices (m q : β) : Finset Lattice := | |
| Fintype.piFinset (fun _ : Fin 3 => indexInterval m q) | |
| noncomputable def boundaryIndices (m q H : β) : Finset Lattice := | |
| Finset.univ.biUnion (fun i : Fin 3 => Fintype.piFinset | |
| (fun j : Fin 3 => if j = i then edgeIndices m q H else indexInterval m q)) | |
| theorem card_gridIndices (m q : β) : (gridIndices m q).card = (2*m*q+1)^3 := by | |
| simp only [gridIndices, Fintype.card_piFinset, card_indexInterval, Finset.prod_const, | |
| Finset.card_univ, Fintype.card_fin] | |
| theorem card_boundaryIndices_le (m q H : β) (hq : 0 < q) : | |
| (boundaryIndices m q H).card β€ 3*((2*m+1)*(2*H))*(2*m*q+1)^2 := by | |
| have hc (i : Fin 3) : (Fintype.piFinset (fun j : Fin 3 => | |
| if j = i then edgeIndices m q H else indexInterval m q)).card β€ | |
| ((2*m+1)*(2*H))*(2*m*q+1)^2 := by | |
| rw [Fintype.card_piFinset] | |
| have he : (β j : Fin 3, (if j = i then edgeIndices m q H else indexInterval m q).card) = | |
| (edgeIndices m q H).card*(indexInterval m q).card^2 := by | |
| fin_cases i <;> simp [Fin.prod_univ_succ] <;> ring | |
| rw [he, card_indexInterval] | |
| exact Nat.mul_le_mul_right _ (card_edgeIndices_le m q H hq) | |
| have hh := Finset.card_biUnion_le (s := (Finset.univ : Finset (Fin 3))) | |
| (t := fun i : Fin 3 => Fintype.piFinset | |
| (fun j : Fin 3 => if j = i then edgeIndices m q H else indexInterval m q)) | |
| have hh' := hh.trans (Finset.sum_le_sum (fun i (_ : i β (Finset.univ : Finset (Fin 3))) => hc i)) | |
| simpa only [boundaryIndices, Finset.sum_const, Finset.card_univ, Fintype.card_fin, | |
| smul_eq_mul, mul_assoc] using hh' | |
| theorem mem_boundaryIndices {m q H : β} {k : Lattice} (hk : k β gridIndices m q) | |
| (he : β i, k i β edgeIndices m q H) : k β boundaryIndices m q H := by | |
| obtain β¨i, hiβ© := he | |
| apply Finset.mem_biUnion.mpr β¨i, Finset.mem_univ i, ?_β© | |
| apply Fintype.mem_piFinset.mpr | |
| intro j | |
| by_cases hj : j = i | |
| Β· simpa only [ite_eq_left hj, hj, ite_true] using hi | |
| Β· simpa only [ite_eq_right hj] using (Fintype.mem_piFinset.mp hk j) | |
| theorem cellIndex_mem_gridIndices {m q : β} {x : Space} | |
| (hx : x β cube ((m : β)*(q : β)/2)) : cellIndex x β gridIndices m q := by | |
| apply Fintype.mem_piFinset.mpr | |
| intro i | |
| apply Finset.mem_Icc.mpr | |
| have hxi := hx i | |
| change -βm*βq β€ β4*x iβ β§ β4*x iβ β€ βm*βq | |
| constructor | |
| Β· apply Int.le_floor.mpr | |
| push_cast | |
| change -((m : β)*(q : β)/2)/2 β€ x i β§ x i β€ ((m : β)*(q : β)/2)/2 at hxi | |
| linarith [hxi.1] | |
| Β· apply Int.floor_le_iff.mpr | |
| push_cast | |
| change -((m : β)*(q : β)/2)/2 β€ x i β§ x i β€ ((m : β)*(q : β)/2)/2 at hxi | |
| linarith [hxi.2] | |
| theorem boundary_of_close_crossing {q H : β} (hq : 0 < q) {m : β} {x y : Space} | |
| (hx : x β cube ((m : β)*(q : β)/2)) | |
| (hd : β i, |cellIndex x i-cellIndex y i| β€ (H : β€)) | |
| (hc : gridIndex ((q : β)/4) x β gridIndex ((q : β)/4) y) : | |
| cellIndex x β boundaryIndices m q H := by | |
| have hk := cellIndex_mem_gridIndices hx | |
| apply mem_boundaryIndices hk | |
| rw [gridIndex_quarter_nat, gridIndex_quarter_nat] at hc | |
| obtain β¨i, hiβ© := Function.ne_iff.mp hc | |
| refine β¨i, Finset.mem_filter.mpr β¨Fintype.mem_piFinset.mp hk i, ?_β©β© | |
| exact edgeResidue_of_crossing hq (hd i) hi | |
| end ContinuumTemperature | |
| end | |
| end OAI | |