File size: 3,700 Bytes
4a56cd6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | import OAI.Geometry.PeriodicTiling.ConfigurationDifferences
import OAI.Geometry.PeriodicTiling.ForwardDifference
import Mathlib.Algebra.Order.Archimedean.Real.Basic
import Mathlib.Tactic.Linarith
namespace OAI
universe uG uA
namespace PeriodicTilingThree
variable {G : Type uG} [AddCommGroup G]
theorem configDiff_bounded (v : G) (f : G β β)
(hf : β B : β, β x, |f x| β€ B) :
β B : β, β x, |configDiff v f x| β€ B := by
obtain β¨B, hBβ© := hf
refine β¨B + B, fun x => ?_β©
calc
|configDiff v f x| = |f (x + v) + -f x| := rfl
_ β€ |f (x + v)| + |-f x| := abs_add_le _ _
_ = |f (x + v)| + |f x| := by rw [abs_neg]
_ β€ B + B := add_le_add (hB _) (hB _)
theorem configDiff_eq_zero_of_second (v : G) (f : G β β)
(hf : β B : β, β x, |f x| β€ B)
(hsecond : configDiff v (configDiff v f) = 0) : configDiff v f = 0 := by
obtain β¨B, hBβ© := hf
let g := configDiff v f
have hg : Function.Periodic g v := (configDiff_eq_zero_iff v g).mp hsecond
ext x
have hg_nat : β n : β, g (x + n β’ v) = g x := by
intro n
induction n with
| zero => simp
| succ n ih =>
simpa only [succ_nsmul, β add_assoc] using (hg (x + n β’ v)).trans ih
have hf_nat : β n : β, f (x + n β’ v) = f x + (n : β) * g x := by
intro n
induction n with
| zero => simp
| succ n ih =>
have hd := hg_nat n
change f (x + n β’ v + v) - f (x + n β’ v) = g x at hd
simp only [succ_nsmul, β add_assoc, Nat.cast_add, Nat.cast_one]
linarith
have hx := abs_le.mp (hB x)
have hz : g x = 0 := by
rcases lt_trichotomy (g x) 0 with hneg | hzero | hpos
Β· obtain β¨n, hnβ© := exists_nat_gt (2 * B / (-g x))
have hn' : 2 * B < (n : β) * (-g x) :=
(div_lt_iffβ (neg_pos.mpr hneg)).mp hn
have hy := abs_le.mp (hB (x + n β’ v))
have he := hf_nat n
nlinarith
Β· exact hzero
Β· obtain β¨n, hnβ© := exists_nat_gt (2 * B / g x)
have hn' : 2 * B < (n : β) * g x := (div_lt_iffβ hpos).mp hn
have hy := abs_le.mp (hB (x + n β’ v))
have he := hf_nat n
nlinarith
exact hz
theorem configDiff_eq_zero_of_iterate (v : G) (n : β) (f : G β β)
(hf : β B : β, β x, |f x| β€ B)
(hn : 0 < n) (hiter : (configDiff v)^[n] f = 0) :
configDiff v f = 0 := by
induction n generalizing f with
| zero => exact (Nat.not_lt_zero _ hn).elim
| succ n ih =>
cases n with
| zero =>
change configDiff v f = 0 at hiter
exact hiter
| succ n =>
have hnext : (configDiff v)^[n + 1] (configDiff v f) = 0 := by
simpa only [Function.iterate_succ_apply] using hiter
have hsecond : configDiff v (configDiff v f) = 0 :=
ih (configDiff v f) (configDiff_bounded v f hf) (Nat.succ_pos _) hnext
exact configDiff_eq_zero_of_second v f hf hsecond
theorem periodic_of_bounded_configDiff_iterate (v : G) (n : β) (f : G β β)
(hf : β B : β, β x, |f x| β€ B)
(hn : 0 < n) (hiter : (configDiff v)^[n] f = 0) :
Function.Periodic f v :=
(configDiff_eq_zero_iff v f).mp (configDiff_eq_zero_of_iterate v n f hf hn hiter)
theorem forwardDiff_eq_configDiff {A : Type uA} [AddCommGroup A] :
(forwardDiff : (β€ β A) β β€ β A) = configDiff (1 : β€) := rfl
theorem forwardDiff_eq_zero_of_bounded_iterate (n : β) (f : β€ β β)
(hf : β B : β, β x, |f x| β€ B)
(hn : 0 < n) (hiter : (forwardDiff^[n]) f = 0) : forwardDiff f = 0 := by
rw [forwardDiff_eq_configDiff] at hiter β’
exact configDiff_eq_zero_of_iterate 1 n f hf hn hiter
end PeriodicTilingThree
end OAI
|