math / data /lean /OAI /Geometry /PeriodicTiling /DirectionalSlices.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
5.32 kB
import OAI.Geometry.PeriodicTiling.ConfigurationDifferenceReduction
import OAI.Geometry.PeriodicTiling.ForwardDifference
import OAI.Geometry.PeriodicTiling.FiniteMasks
import OAI.Geometry.PeriodicTiling.PlaneLattices
import Mathlib.Topology.Instances.AddCircle.Defs
import Mathlib.Tactic.Choose
import Mathlib.Tactic.Linarith
namespace OAI
universe uB
namespace PeriodicTilingThree
theorem forwardDiff_slice {B : Type uB} [AddCommGroup B]
(f : Plane β†’ B) (x e : Plane) :
forwardDiff (fun n : β„€ => f (x + n β€’ e)) =
fun n => configDiff e f (x + n β€’ e) := by
ext n
simp only [forwardDiff_apply, configDiff_apply, add_zsmul, one_zsmul, add_assoc]
theorem forwardDiff_iterate_slice {B : Type uB} [AddCommGroup B]
(k : β„•) (f : Plane β†’ B) (x e : Plane) :
(forwardDiff^[k]) (fun n : β„€ => f (x + n β€’ e)) =
fun n => ((configDiff e)^[k] f) (x + n β€’ e) := by
induction k generalizing f with
| zero => rfl
| succ k ih =>
rw [Function.iterate_succ_apply, forwardDiff_slice, ih,
Function.iterate_succ_apply]
theorem circle_sum_of_indicator_decomposition {m : β„•} (A : Set Plane)
(Ο† : Fin m β†’ Plane β†’ ℝ)
(hsum : βˆ€ x, tileIndicator ℝ A x + βˆ‘ j, Ο† j x = 1) :
(βˆ‘ j, (fun x => (Ο† j x : AddCircle (1 : ℝ)))) = fun _ => 0 := by
classical
ext x
simp only [Finset.sum_apply]
change (βˆ‘ j, (Ο† j x : AddCircle (1 : ℝ))) = 0
have hcast : (βˆ‘ j, (Ο† j x : AddCircle (1 : ℝ))) =
((βˆ‘ j, Ο† j x : ℝ) : AddCircle (1 : ℝ)) := by
exact (map_sum (QuotientAddGroup.mk' (AddSubgroup.zmultiples (1 : ℝ)))
(fun j => Ο† j x) Finset.univ).symm
rw [hcast, show (βˆ‘ j, Ο† j x) = 1 - tileIndicator ℝ A x by linarith [hsum x]]
by_cases hx : x ∈ A <;> simp [tileIndicator, hx, AddCircle.coe_period]
theorem directional_circle_slice_polynomial {m : β„•} (hm : 0 < m)
(A : Set Plane) (v : Fin m β†’ Plane) (Ο† : Fin m β†’ Plane β†’ ℝ)
(e : Plane)
(hspan : βˆ€ i j, i β‰  j β†’ βˆƒ a b : β„€, e = a β€’ v i + b β€’ v j)
(hp : βˆ€ j, Function.Periodic (Ο† j) (v j))
(hsum : βˆ€ x, tileIndicator ℝ A x + βˆ‘ j, Ο† j x = 1)
(j : Fin m) (x : Plane) :
(forwardDiff^[m]) (fun n : β„€ =>
(Ο† j (x + n β€’ e) : AddCircle (1 : ℝ))) = 0 := by
classical
let ψ : Fin m β†’ Plane β†’ AddCircle (1 : ℝ) := fun i y => (Ο† i y : AddCircle (1 : ℝ))
have hψ : βˆ€ i, Function.Periodic (ψ i) (v i) := by
intro i y
change (Ο† i (y + v i) : AddCircle (1 : ℝ)) = (Ο† i y : AddCircle (1 : ℝ))
rw [hp i y]
have hrep : βˆ€ i : Fin m, βˆƒ a b : β„€, i = j ∨ e = a β€’ v i + b β€’ v j := by
intro i
by_cases hij : i = j
· exact ⟨0, 0, Or.inl hij⟩
· obtain ⟨a, b, hab⟩ := hspan i j hij
exact ⟨a, b, Or.inr hab⟩
choose Ξ± Ξ² hrep using hrep
let u : Fin m β†’ Plane := fun i => if i = j then e else Ξ± i β€’ v i
let vs : List Plane := Finset.univ.toList.map u
have hlen : vs.length = m := by simp [vs]
have hne : vs β‰  [] := by
intro h
have hz : m = 0 := by simpa only [h, List.length_nil] using hlen.symm
exact (Nat.ne_of_gt hm) hz
have hkill : βˆ€ i, i β‰  j β†’ βˆƒ w ∈ vs, Function.Periodic (ψ i) w := by
intro i hij
refine ⟨u i, ?_, ?_⟩
· exact List.mem_map.mpr ⟨i, by simp, rfl⟩
· simpa only [u, ite_eq_right hij] using (hψ i).zsmul (α i)
have hz : configDiffs vs (ψ j) = 0 :=
configDiffs_component_zero j vs hne ψ 0
(circle_sum_of_indicator_decomposition A Ο† hsum) hkill
have hreplace : βˆ€ w ∈ vs, βˆƒ k : β„€, w = e + k β€’ v j := by
intro w hw
obtain ⟨i, _hi, rfl⟩ := List.mem_map.mp hw
by_cases hij : i = j
· refine ⟨0, ?_⟩
simp [u, hij]
· refine ⟨-β i, ?_⟩
have he := (hrep i).resolve_left hij
simp only [u, ite_eq_right hij, he, neg_smul]
abel
rw [configDiffs_eq_iterate_of_period vs e (v j) (ψ j) (hψ j) hreplace,
hlen] at hz
change (forwardDiff^[m]) (fun n : β„€ => ψ j (x + n β€’ e)) = 0
rw [forwardDiff_iterate_slice, hz]
rfl
theorem directional_slice_pair_bound {m : β„•} (A : Set Plane)
(v : Fin m β†’ Plane) (Ο† : Fin m β†’ Plane β†’ ℝ) (e : Plane)
(hspan : βˆ€ i j, i β‰  j β†’ βˆƒ a b : β„€, e = a β€’ v i + b β€’ v j)
(hΟ† : βˆ€ j x, 0 ≀ Ο† j x)
(hp : βˆ€ j, Function.Periodic (Ο† j) (v j))
(hsum : βˆ€ x, tileIndicator ℝ A x + βˆ‘ j, Ο† j x = 1)
(x : Plane) (i j : Fin m) (hij : i β‰  j) (n r : β„€) :
Ο† i (x + n β€’ e) + Ο† j (x + r β€’ e) ≀ 1 := by
classical
obtain ⟨a, b, he⟩ := hspan i j hij
let y : Plane := x + n β€’ e + ((r - n) * a) β€’ v i
have hy : y = x + r β€’ e + ((n - r) * b) β€’ v j := by
dsimp [y]
rw [he]
simp only [smul_add, mul_smul, sub_smul]
abel
have hi : Ο† i y = Ο† i (x + n β€’ e) :=
(hp i).zsmul ((r - n) * a) _
have hj : Ο† j y = Ο† j (x + r β€’ e) := by
rw [hy]
exact (hp j).zsmul ((n - r) * b) _
have hle : Ο† i y + Ο† j y ≀ βˆ‘ k, Ο† k y := by
have h := Finset.sum_le_sum_of_subset_of_nonneg
(Finset.subset_univ ({i, j} : Finset (Fin m)))
(fun k _hk _hnot => hφ k y)
simpa [hij] using h
have htotal := hsum y
have ha := tileIndicator_nonneg A y
rw [hi, hj] at hle
linarith
end PeriodicTilingThree
end OAI