math / data /lean /OAI /Probability /CriticalPercolation /GraphGeometry /ColumnHitOthersOffdiag.lean
Download data/lean/OAI/Probability/CriticalPercolation/GraphGeometry/ColumnHitOthersOffdiag.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 5.96 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/CriticalPercolation/GraphGeometry/ColumnHitOthersOffdiag.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/CriticalPercolation/GraphGeometry/ColumnHitOthersOffdiag.lean
-
curl -L -o ColumnHitOthersOffdiag.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/CriticalPercolation/GraphGeometry/ColumnHitOthersOffdiag.lean
5.96 kB
| import Mathlib | |
| import OAI.Probability.CriticalPercolation.Clusters.DeleteBot | |
| import OAI.Probability.CriticalPercolation.ProductMeasure.DensityMulExpect | |
| import OAI.Probability.CriticalPercolation.GraphGeometry.Column | |
| import OAI.Probability.CriticalPercolation.Clusters.HitOthers | |
| import OAI.Probability.CriticalPercolation.LinearGroups.ClusterMatrix | |
| namespace OAI | |
| section | |
| section | |
| open Set MeasureTheory ProbabilityTheory | |
| open scoped BigOperators | |
| namespace CriticalPercolation.BondGraph | |
| open CriticalPercolation.FiniteProduct CriticalPercolation.ClusterDeletion | |
| open CriticalPercolation.ClusterColumns | |
| open scoped Classical Matrix | |
| variable {V E : Type*} [Fintype V] [Fintype E] (G : BondGraph V E) | |
| omit [Fintype V] in | |
| lemma column_hitOthers_offdiag {n : β} (w : E β Prop β β) (x : Fin n β V) | |
| (k i : Fin n) (hik : i β k) : | |
| G.column w x k (hitOthers x k) i = G.column w x k (fun _ => 1) i := by | |
| unfold column | |
| congr 1 | |
| funext Ο | |
| by_cases hc : first (G.openGraph Ο) x k β§ x i β component (G.openGraph Ο) (x k) | |
| Β· have hh : β j, j β k β§ x j β component (G.openGraph Ο) (x k) := β¨i, hik, hc.2β© | |
| simp [select, hitOthers, hc, hh] | |
| Β· simp [select, hc] | |
| omit [Fintype V] in | |
| lemma column_hitOthers_gap_pos {n : β} (w : E β Prop β β) | |
| (hpos : β e b, 0 β€ w e b) (hclosed : β e, 0 < w e False) | |
| (x : Fin n β V) (hx : Function.Injective x) (k : Fin n) : | |
| 0 < G.column w x k (fun _ => 1) k - G.column w x k (hitOthers x k) k := by | |
| have he : G.column w x k (fun _ => 1) k - G.column w x k (hitOthers x k) k = | |
| expect w (fun Ο => select (G.openGraph Ο) x k k * | |
| (1 - hitOthers x k (component (G.openGraph Ο) (x k)))) := by | |
| unfold column | |
| erw [β expect_sub] | |
| congr 1 | |
| funext Ο | |
| ring | |
| rw [he] | |
| have hf (Ο : E β Prop) : 0 β€ select (G.openGraph Ο) x k k * | |
| (1 - hitOthers x k (component (G.openGraph Ο) (x k))) := | |
| mul_nonneg (select_nonneg _ _ _ _) (sub_nonneg.mpr (hitOthers_le_one _ _ _)) | |
| have hd := density_mul_le_expect hpos hf (fun _ => False) | |
| have hs : first (β₯ : SimpleGraph V) x k := by | |
| simpa only [first, roots_bot] using root_not_mem_earlier hx k | |
| simp only [show (fun _ : E => False) = (β : Set E) from rfl, | |
| G.openGraph_empty, component_bot, hitOthers_singleton x hx, sub_zero, | |
| select_diag, hs, ite_true, mul_one] at hd | |
| have hp : 0 < density w (β : Set E) := Finset.prod_pos (fun e _ => hclosed e) | |
| simpa only [select_diag] using hp.trans_le hd | |
| lemma inverseMatrix_offdiag_nonpos {n : β} (w : E β Prop β β) | |
| (hw : β e, β b, w e b = 1) (hpos : β e b, 0 β€ w e b) | |
| (hclosed : β e, 0 < w e False) (x : Fin n β V) (hx : Function.Injective x) | |
| (k i : Fin n) (hik : i β k) : (G.clusterMatrix w x)β»ΒΉ i k β€ 0 := by | |
| let a := G.column w x k (fun _ => 1) k - G.column w x k (hitOthers x k) k | |
| have ha : 0 < a := G.column_hitOthers_gap_pos w hpos hclosed x hx k | |
| have he : G.column w x k (fun _ => 1) = | |
| G.column w x k (hitOthers x k) + a β’ Pi.single k 1 := by | |
| ext j | |
| by_cases hj : j = k | |
| Β· subst j | |
| simp [a] | |
| Β· simp only [Pi.add_apply, Pi.smul_apply, smul_eq_mul, Pi.single_eq_of_ne hj, mul_zero, | |
| add_zero] | |
| exact (G.column_hitOthers_offdiag w x k j hj).symm | |
| have he' := congrArg (fun v => (G.clusterMatrix w x)β»ΒΉ *α΅₯ v) he | |
| change G.inverseColumn w x k (fun _ => 1) = _ at he' | |
| rw [G.inverseColumn_const w hpos hclosed x hx, Matrix.mulVec_add, | |
| Matrix.mulVec_smul, Matrix.mulVec_single_one] at he' | |
| have he'' := congrFun he' i | |
| simp only [Pi.single_eq_of_ne hik, Pi.add_apply, Pi.smul_apply, | |
| smul_eq_mul, Matrix.col_apply] at he'' | |
| have hp := G.inverseColumn_nonneg w hw hpos hclosed x hx k | |
| (hitOthers_monotone x k) (hitOthers_nonneg x k) i | |
| change 0 β€ ((G.clusterMatrix w x)β»ΒΉ *α΅₯ G.column w x k (hitOthers x k)) i at hp | |
| nlinarith only [he'', hp, ha] | |
| omit [Fintype V] in | |
| lemma clusterMatrix_row_mass {n : β} (w : E β Prop β β) | |
| (hw : β e, β b, w e b = 1) (x : Fin n β V) : | |
| G.clusterMatrix w x *α΅₯ (fun _ => 1) = fun _ => 1 := by | |
| ext i | |
| change (β k, G.column w x k (fun _ => 1) i * 1) = 1 | |
| simp only [mul_one, column] | |
| erw [β expect_sum] | |
| simpa only [mul_one, select_mass] using expect_const w hw 1 | |
| omit [Fintype V] in | |
| lemma inverseMatrix_row_mass {n : β} (w : E β Prop β β) | |
| (hw : β e, β b, w e b = 1) (hpos : β e b, 0 β€ w e b) | |
| (hclosed : β e, 0 < w e False) (x : Fin n β V) (hx : Function.Injective x) : | |
| (G.clusterMatrix w x)β»ΒΉ *α΅₯ (fun _ => 1) = fun _ => 1 := by | |
| have h := congrArg (fun v => (G.clusterMatrix w x)β»ΒΉ *α΅₯ v) | |
| (G.clusterMatrix_row_mass w hw x) | |
| have hu : IsUnit (G.clusterMatrix w x).det := | |
| isUnit_iff_ne_zero.mpr (ne_of_gt (G.clusterMatrix_det_pos w hpos hclosed x hx)) | |
| rw [Matrix.mulVec_mulVec, Matrix.nonsing_inv_mul _ hu, Matrix.one_mulVec] at h | |
| exact h.symm | |
| omit [Fintype V] in | |
| lemma clusterFunction_sum_columns {n : β} (w : E β Prop β β) | |
| (x : Fin n β V) (F : Set V β β) : | |
| (fun i => expect w (fun Ο => F (component (G.openGraph Ο) (x i)))) = | |
| β k, G.column w x k F := by | |
| ext i | |
| simp only [Finset.sum_apply, column] | |
| erw [β expect_sum] | |
| congr 1 | |
| funext Ο | |
| exact cluster_partition (G.openGraph Ο) x F i | |
| lemma inverse_clusterFunction_nonneg {n : β} (w : E β Prop β β) | |
| (hw : β e, β b, w e b = 1) (hpos : β e b, 0 β€ w e b) | |
| (hclosed : β e, 0 < w e False) (x : Fin n β V) (hx : Function.Injective x) | |
| {F : Set V β β} (hF : Monotone F) (hF0 : β U, 0 β€ F U) (i : Fin n) : | |
| 0 β€ ((G.clusterMatrix w x)β»ΒΉ *α΅₯ | |
| (fun j => expect w (fun Ο => F (component (G.openGraph Ο) (x j))))) i := by | |
| rw [G.clusterFunction_sum_columns, Matrix.mulVec_sum, Finset.sum_apply] | |
| exact Finset.sum_nonneg (fun k _ => G.inverseColumn_nonneg w hw hpos hclosed x hx k hF hF0 i) | |
| end CriticalPercolation.BondGraph | |
| end | |
| end | |
| end OAI | |