Buckets:
| import OAI.Probability.RadialTransition.SupportGeometry | |
| namespace OAI | |
| universe uE uIndex uV | |
| noncomputable section | |
| open scoped BigOperators NNReal ContDiff ENNReal | |
| open Filter MeasureTheory Set | |
| namespace RadialTransition | |
| section Shell | |
| theorem independent_of_simplex_gram | |
| {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] | |
| {ι : Type uIndex} [Fintype ι] [DecidableEq ι] (v : ι → E) {ε : ℝ} | |
| (hε : 0 ≤ ε) (hsmall : (Fintype.card ι : ℝ) * ε < 1 / 2) | |
| (hgram : ∀ i j, | |
| |inner ℝ (v i) (v j) - ((1 : ℝ) / 2 + if i = j then 1 / 2 else 0)| ≤ ε) : | |
| LinearIndependent ℝ v := by | |
| rw [Fintype.linearIndependent_iff] | |
| intro c hc i | |
| let S : ℝ := ∑ j, c j ^ 2 | |
| have hS : 0 ≤ S := Finset.sum_nonneg fun j _ => sq_nonneg (c j) | |
| have hCS : (∑ j, |c j|) ^ 2 ≤ (Fintype.card ι : ℝ) * S := by | |
| simpa only [Finset.card_univ, sq_abs] using | |
| (sq_sum_le_card_mul_sum_sq (s := Finset.univ) (f := fun j => |c j|)) | |
| have hterm (j k : ι) : | |
| c j * c k * ((1 : ℝ) / 2 + if j = k then 1 / 2 else 0) - | |
| ε * |c j| * |c k| ≤ c j * c k * inner ℝ (v j) (v k) := by | |
| have hh : |c j * c k * (inner ℝ (v j) (v k) - | |
| ((1 : ℝ) / 2 + if j = k then 1 / 2 else 0))| ≤ ε * |c j| * |c k| := by | |
| rw [abs_mul, abs_mul] | |
| nlinarith [mul_le_mul_of_nonneg_left (hgram j k) | |
| (mul_nonneg (abs_nonneg (c j)) (abs_nonneg (c k)))] | |
| have hh' := (abs_le.mp hh).1 | |
| nlinarith [hh'] | |
| have hsum := Finset.sum_le_sum (s := Finset.univ) fun j _ => | |
| Finset.sum_le_sum (s := Finset.univ) fun k _ => hterm j k | |
| have hlin : (∑ j, ∑ k, c j * c k * inner ℝ (v j) (v k)) = 0 := by | |
| have hh : inner ℝ (∑ j, c j • v j) (∑ j, c j • v j) = 0 := by rw [hc]; simp | |
| simpa only [sum_inner, inner_sum, real_inner_smul_left, | |
| real_inner_smul_right, mul_assoc, mul_left_comm, mul_comm, real_inner_comm] using hh | |
| have href : (∑ j, ∑ k, | |
| c j * c k * ((1 : ℝ) / 2 + if j = k then 1 / 2 else 0)) = | |
| (1 / 2 : ℝ) * (∑ j, c j) ^ 2 + (1 / 2 : ℝ) * S := by | |
| simp only [mul_add, Finset.sum_add_distrib, mul_ite, mul_zero, | |
| Finset.sum_ite_eq, Finset.mem_univ, ite_true] | |
| simp only [S, sq, Finset.mul_sum, Finset.sum_mul] | |
| congr 1 | |
| · apply Finset.sum_congr rfl | |
| intro j _ | |
| apply Finset.sum_congr rfl | |
| intro k _ | |
| ring | |
| · apply Finset.sum_congr rfl | |
| intro j _ | |
| ring | |
| have herr : (∑ j, ∑ k, ε * |c j| * |c k|) = ε * (∑ j, |c j|) ^ 2 := by | |
| simp only [sq, Finset.mul_sum, Finset.sum_mul] | |
| congr 1 | |
| ext j | |
| congr 1 | |
| ext k | |
| ring | |
| simp only [Finset.sum_sub_distrib] at hsum | |
| rw [hlin, href, herr] at hsum | |
| have hSzero : S = 0 := by | |
| have he := mul_le_mul_of_nonneg_left hCS hε | |
| nlinarith [sq_nonneg (∑ j, c j)] | |
| have hci : c i ^ 2 = 0 := | |
| (Finset.sum_eq_zero_iff_of_nonneg (fun j _ => sq_nonneg (c j))).mp hSzero i | |
| (Finset.mem_univ i) | |
| nlinarith [hci] | |
| theorem no_five_unit_shell (x : Fin 5 → Position) | |
| (hx : ∀ i j, i ≠ j → 1 ≤ dist (x i) (x j) ∧ | |
| dist (x i) (x j) ≤ 1 + (1 : ℝ) / 1000) : False := by | |
| let v : Fin 4 → Position := fun i => x i.succ - x 0 | |
| have hsq (i j : Fin 5) (hij : i ≠ j) : | |
| 1 ≤ ‖x i - x j‖ ^ 2 ∧ ‖x i - x j‖ ^ 2 ≤ (1001 / 1000 : ℝ) ^ 2 := by | |
| have h := hx i j hij | |
| rw [dist_eq_norm] at h | |
| constructor <;> nlinarith [h.1, h.2] | |
| have hnorm (i : Fin 4) : | |
| 1 ≤ ‖v i‖ ^ 2 ∧ ‖v i‖ ^ 2 ≤ (1001 / 1000 : ℝ) ^ 2 := | |
| hsq i.succ 0 (Fin.succ_ne_zero i) | |
| have hgram (i j : Fin 4) : | |
| |inner ℝ (v i) (v j) - ((1 : ℝ) / 2 + if i = j then 1 / 2 else 0)| ≤ | |
| (2001 / 1000000 : ℝ) := by | |
| by_cases hij : i = j | |
| · subst j | |
| rw [ite_eq_left rfl, real_inner_self_eq_norm_sq] | |
| have h := hnorm i | |
| rw [abs_le] | |
| constructor <;> nlinarith [h.1, h.2] | |
| · rw [ite_eq_right hij, add_zero, abs_le] | |
| have hi := hnorm i | |
| have hj := hnorm j | |
| have hd := hsq i.succ j.succ (by simpa using hij) | |
| have heq : v i - v j = x i.succ - x j.succ := by simp [v] | |
| have hp := norm_sub_sq_real (v i) (v j) | |
| rw [heq] at hp | |
| constructor <;> nlinarith [hi.1, hi.2, hj.1, hj.2, hd.1, hd.2, hp] | |
| have hind := independent_of_simplex_gram v (by norm_num : (0 : ℝ) ≤ 2001 / 1000000) | |
| (by norm_num : (Fintype.card (Fin 4) : ℝ) * (2001 / 1000000) < 1 / 2) hgram | |
| have hdim := hind.fintype_card_le_finrank | |
| norm_num [Position, finrank_euclideanSpace] at hdim | |
| theorem no_five_shell (x : Fin 5 → Position) {l : ℝ} (hl : 0 < l) | |
| (hx : ∀ i j, i ≠ j → l ≤ dist (x i) (x j) ∧ | |
| dist (x i) (x j) ≤ (1 + (1 : ℝ) / 1000) * l) : False := by | |
| apply no_five_unit_shell (fun i => l⁻¹ • x i) | |
| intro i j hij | |
| have h := hx i j hij | |
| rw [dist_smul₀, Real.norm_eq_abs, abs_of_pos (inv_pos.mpr hl)] | |
| constructor | |
| · have hh := mul_le_mul_of_nonneg_left h.1 (inv_nonneg.mpr hl.le) | |
| simpa [ne_of_gt hl] using hh | |
| · have hh := mul_le_mul_of_nonneg_left h.2 (inv_nonneg.mpr hl.le) | |
| calc | |
| l⁻¹ * dist (x i) (x j) ≤ l⁻¹ * ((1 + (1 : ℝ) / 1000) * l) := hh | |
| _ = 1 + (1 : ℝ) / 1000 := by field_simp | |
| theorem shell_edge_bound {V : Type uV} [Fintype V] (G : SimpleGraph V) | |
| [DecidableRel G.Adj] (hG : G.CliqueFree 5) : | |
| 8 * G.edgeFinset.card ≤ 3 * (Fintype.card V) ^ 2 := by | |
| obtain ⟨H, hdec, hmax⟩ := SimpleGraph.exists_isTuranMaximal (V := V) (r := 4) (by norm_num) | |
| let _ : DecidableRel H.Adj := hdec | |
| have hle := hmax.2 hG | |
| obtain ⟨e⟩ := (SimpleGraph.isTuranMaximal_iff_nonempty_iso_turanGraph | |
| (G := H) (by norm_num : 0 < 4)).mp hmax | |
| have heq := e.card_edgeFinset_eq | |
| have hb := SimpleGraph.mul_turanNumber_le | |
| (n := Fintype.card V) (r := 4) | |
| unfold SimpleGraph.turanNumber at hb | |
| rw [← heq] at hb | |
| norm_num at hb | |
| omega | |
| def shellGraph {V : Type uV} (x : V → Position) (l : ℝ) : SimpleGraph V where | |
| Adj i j := i ≠ j ∧ l ≤ dist (x i) (x j) ∧ | |
| dist (x i) (x j) ≤ (1 + (1 : ℝ) / 1000) * l | |
| symm := ⟨by intro i j h; exact ⟨h.1.symm, by simpa only [dist_comm] using h.2⟩⟩ | |
| loopless := ⟨by intro i h; exact h.1 rfl⟩ | |
| theorem shellGraph_cliqueFree {V : Type uV} (x : V → Position) {l : ℝ} (hl : 0 < l) : | |
| (shellGraph x l).CliqueFree 5 := by | |
| classical | |
| intro s hs | |
| let e : Fin 5 ≃ s := (Finset.equivFinOfCardEq hs.card_eq).symm | |
| apply no_five_shell (fun i => x (e i)) hl | |
| intro i j hij | |
| have hne : (e i : V) ≠ (e j : V) := fun h => hij (e.injective (Subtype.ext h)) | |
| have hh := hs.isClique (e i).property (e j).property hne | |
| exact hh.2 | |
| end Shell | |
| end RadialTransition | |
| end | |
| end OAI | |
Xet Storage Details
- Size:
- 6.66 kB
- Xet hash:
- a997a56b708078f08fbb9f17941964e4a87f624c8b930a176aa280c3e0ee87f9
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.