yang
This project has not described itself yet.
Brought by drakestapleton
yang / proofs / WilsonReplicaUncross.lean
| 1 | -- SPDX-License-Identifier: Apache-2.0 |
| 2 | import WilsonReplicaFreeShell |
| 3 | |
| 4 | namespace YangMills.PeriodicWilson.PinnedFrame |
| 5 | open WilsonPolymer |
| 6 | noncomputable section |
| 7 | variable {l : ℕ+} (P : PinnedFrame l) |
| 8 | |
| 9 | /-- Global complementation can align either mask without changing any split face. -/ |
| 10 | theorem freeBoundary_complement (m : Edge l → Bool) : |
| 11 | P.freeBoundary (fun e => !m e) = P.freeBoundary m := by |
| 12 | classical |
| 13 | ext p |
| 14 | simp only [freeBoundary, Finset.mem_filter, Finset.mem_univ, true_and] |
| 15 | apply not_congr |
| 16 | constructor <;> rintro ⟨b, h⟩ <;> refine ⟨!b, fun e he => ?_⟩ <;> |
| 17 | simpa using congrArg Bool.not (h e he) |
| 18 | |
| 19 | private theorem freeUniform_congr_on {m n : Edge l → Bool} {p : Face l} |
| 20 | (eq : ∀ e ∈ P.freeFace p, m e = n e) : P.freeUniform m p ↔ P.freeUniform n p := by |
| 21 | constructor <;> rintro ⟨b, h⟩ |
| 22 | · exact ⟨b, fun e he => (eq e he).symm.trans (h e he)⟩ |
| 23 | · exact ⟨b, fun e he => (eq e he).trans (h e he)⟩ |
| 24 | |
| 25 | /-- On each face where at least one mask is uniform, sorting the two bits |
| 26 | is a fixed permutation of the two masks on all free links of that face. -/ |
| 27 | private theorem sorted_uniformity (m n : Edge l → Bool) (p : Face l) |
| 28 | (h : P.freeUniform m p ∨ P.freeUniform n p) : |
| 29 | ((P.freeUniform (fun e => m e && n e) p ↔ P.freeUniform m p) ∧ |
| 30 | (P.freeUniform (fun e => m e || n e) p ↔ P.freeUniform n p)) ∨ |
| 31 | ((P.freeUniform (fun e => m e && n e) p ↔ P.freeUniform n p) ∧ |
| 32 | (P.freeUniform (fun e => m e || n e) p ↔ P.freeUniform m p)) := by |
| 33 | rcases h with ⟨b, hb⟩ | ⟨b, hb⟩ <;> cases b |
| 34 | · left; constructor <;> apply P.freeUniform_congr_on <;> intro e he <;> simp [hb e he] |
| 35 | · right; constructor <;> apply P.freeUniform_congr_on <;> intro e he <;> simp [hb e he] |
| 36 | · right; constructor <;> apply P.freeUniform_congr_on <;> intro e he <;> simp [hb e he] |
| 37 | · left; constructor <;> apply P.freeUniform_congr_on <;> intro e he <;> simp [hb e he] |
| 38 | |
| 39 | /-- Uncrossing preserves the entire set of split faces and counts each such |
| 40 | face in precisely one output, not necessarily in the same mask as before. -/ |
| 41 | theorem freeBoundary_uncross (m n : Edge l → Bool) |
| 42 | (hd : Disjoint (P.freeBoundary m) (P.freeBoundary n)) : |
| 43 | Disjoint (P.freeBoundary (fun e => m e && n e)) (P.freeBoundary (fun e => m e || n e)) ∧ |
| 44 | P.freeBoundary (fun e => m e && n e) ∪ P.freeBoundary (fun e => m e || n e) = |
| 45 | P.freeBoundary m ∪ P.freeBoundary n := by |
| 46 | classical |
| 47 | have h := (P.freeBoundary_disjoint m n).mp hd |
| 48 | constructor |
| 49 | · apply (P.freeBoundary_disjoint _ _).mpr |
| 50 | intro p |
| 51 | have sorted := P.sorted_uniformity m n p (h p) |
| 52 | specialize h p |
| 53 | tauto |
| 54 | · ext p |
| 55 | simp only [Finset.mem_union, freeBoundary, Finset.mem_filter, Finset.mem_univ, true_and] |
| 56 | have sorted := P.sorted_uniformity m n p (h p) |
| 57 | tauto |
| 58 | |
| 59 | theorem freeBoundary_uncross_card (m n : Edge l → Bool) |
| 60 | (hd : Disjoint (P.freeBoundary m) (P.freeBoundary n)) : |
| 61 | (P.freeBoundary (fun e => m e && n e)).card + (P.freeBoundary (fun e => m e || n e)).card = |
| 62 | (P.freeBoundary m).card + (P.freeBoundary n).card := by |
| 63 | classical |
| 64 | obtain ⟨hout, hu⟩ := P.freeBoundary_uncross m n hd |
| 65 | rw [← Finset.card_union_of_disjoint hout, hu, Finset.card_union_of_disjoint hd] |
| 66 | |
| 67 | /-- The true-link sets are nested, and sorting fixes every prescribed shared |
| 68 | label. Take the protected set to be both neighborhoods and vary the label by link. -/ |
| 69 | theorem uncross_nested_labels (m n : Edge l → Bool) (s : Finset (Edge l)) (label : Edge l → Bool) |
| 70 | (hm : ∀ e ∈ s, m e = label e) (hn : ∀ e ∈ s, n e = label e) : |
| 71 | (∀ e, (m e && n e) = true → (m e || n e) = true) ∧ |
| 72 | (∀ e ∈ s, (m e && n e) = label e ∧ (m e || n e) = label e) := by |
| 73 | constructor |
| 74 | · intro e; cases m e <;> cases n e <;> decide |
| 75 | · intro e he; simp [hm e he, hn e he] |
| 76 | |
| 77 | /-- Every aligned admissible pair has a nested representative of exactly the |
| 78 | same total geometric cost. Concrete optimization inputs remain separate data. -/ |
| 79 | theorem exists_nested_aligned_pair (m n : Edge l → Bool) (s : Finset (Edge l)) |
| 80 | (label : Edge l → Bool) (hm : ∀ e ∈ s, m e = label e) (hn : ∀ e ∈ s, n e = label e) |
| 81 | (hd : Disjoint (P.freeBoundary m) (P.freeBoundary n)) : |
| 82 | ∃ a b : Edge l → Bool, |
| 83 | (∀ e, a e = true → b e = true) ∧ |
| 84 | (∀ e ∈ s, a e = label e ∧ b e = label e) ∧ |
| 85 | Disjoint (P.freeBoundary a) (P.freeBoundary b) ∧ |
| 86 | (P.freeBoundary a).card + (P.freeBoundary b).card = |
| 87 | (P.freeBoundary m).card + (P.freeBoundary n).card := by |
| 88 | have labels := uncross_nested_labels m n s label hm hn |
| 89 | exact ⟨(fun e => m e && n e), (fun e => m e || n e), |
| 90 | labels.1, labels.2, (P.freeBoundary_uncross m n hd).1, P.freeBoundary_uncross_card m n hd⟩ |
| 91 | |
| 92 | /-- Concrete failure without input disjointness: use the same direction-zero |
| 93 | mask twice on the empty-pinned side-two torus. Both sorted masks split (0,1). -/ |
| 94 | theorem identical_split_counterexample : |
| 95 | let m := fun e : Edge 2 => decide (e.2 = 0) |
| 96 | ¬Disjoint ((empty 2).freeBoundary (fun e => m e && m e)) |
| 97 | ((empty 2).freeBoundary (fun e => m e || m e)) := by |
| 98 | classical |
| 99 | dsimp only |
| 100 | let p : Face 2 := (0, ⟨(0, 1), by decide⟩) |
| 101 | have ha : (corners p).1 ∈ (empty 2).freeFace p := by simp [freeFace, empty, faceEdges] |
| 102 | have hb : (corners p).2.2.2 ∈ (empty 2).freeFace p := by simp [freeFace, empty, faceEdges] |
| 103 | have split : p ∈ (empty 2).freeBoundary (fun e => decide (e.2 = 0)) := by |
| 104 | apply Finset.mem_filter.mpr ⟨Finset.mem_univ _, ?_⟩ |
| 105 | rintro ⟨b, uniform⟩ |
| 106 | have eq := (uniform _ ha).trans (uniform _ hb).symm |
| 107 | simp [p, corners] at eq |
| 108 | intro hd |
| 109 | exact Finset.disjoint_left.mp hd (by simpa using split) (by simpa using split) |
| 110 | |
| 111 | #print axioms freeBoundary_complement |
| 112 | #print axioms freeUniform_congr_on |
| 113 | #print axioms sorted_uniformity |
| 114 | #print axioms freeBoundary_uncross |
| 115 | #print axioms freeBoundary_uncross_card |
| 116 | #print axioms uncross_nested_labels |
| 117 | #print axioms exists_nested_aligned_pair |
| 118 | #print axioms identical_split_counterexample |
| 119 | end |
| 120 | end YangMills.PeriodicWilson.PinnedFrame |