import Mathlib import OAI.Geometry.CubicTorus.Reflection.SiblingReflectNormal namespace OAI section section noncomputable section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology RealInnerProductSpace namespace CubicTorus lemma coverAEAgreement_common_model {A B S : Set Cover} {x : Cover} (hA : x∈coverAEAgreement A S ∨ x∈coverAEAgreement A Sᶜ) (hB : x∈coverAEAgreement B S ∨ x∈coverAEAgreement B Sᶜ) : x∈coverAEAgreement A B ∨ x∈coverAEAgreement A Bᶜ := by rcases hA with ha|ha <;> rcases hB with hb|hb · exact Or.inl (coverAEAgreement_trans ha (coverAEAgreement_symm hb)) · right have hh := coverAEAgreement_compl (coverAEAgreement_symm hb) rw [compl_compl] at hh exact coverAEAgreement_trans ha hh · exact Or.inr (coverAEAgreement_trans ha (coverAEAgreement_compl (coverAEAgreement_symm hb))) · exact Or.inl (coverAEAgreement_trans ha (coverAEAgreement_symm hb)) lemma off_essential_boundary_phase {A : Set Cover} {x : Cover} (h : x∉coverEssentialBoundary A) : x∈coverAEAgreement A ∅ ∨ x∈coverAEAgreement A (∅ : Set Cover)ᶜ := by rw [coverEssentialBoundary_eq_support] at h have h' := not_and_or.mp h have he1 : {y : Cover | ¬(y∈A ↔ y∈(∅ : Set Cover))}=A := by ext y; simp have he2 : {y : Cover | ¬(y∈A ↔ y∈(∅ : Set Cover)ᶜ)}=Aᶜ := by ext y; simp change x∉(volume.restrict {y | ¬(y∈A ↔ y∈(∅ : Set Cover))}).support ∨ x∉(volume.restrict {y | ¬(y∈A ↔ y∈(∅ : Set Cover)ᶜ)}).support rw [he1,he2] exact h' lemma graph_boundary_local_phase {A : Set Cover} (hA : MeasurableSet A) {a n : Cover} (hn : ‖n‖=1) {g : Plane → ℝ} (hg : Continuous g) (ha : a∈coverEssentialBoundary A) (hbd : ∀ᶠ x in 𝓝 a,x∈coverEssentialBoundary A → normalGraph n g (normalPlaneCoordinates n (x-a))=x-a) : a∈coverAEAgreement A {x | 0