| 1 | module |
| 2 | |
| 3 | public import E424.Input.Defs |
| 4 | |
| 5 | @[expose] public section |
| 6 | |
| 7 | /-! |
| 8 | # Input, part 4: the finite certificate |
| 9 | |
| 10 | `U κ j` are the weights of the six exponential potentials, `z = 51/50`, `lam = 2499/2500`. |
| 11 | `cert` is the one-step drift inequality with denominators cleared. The data were found with |
| 12 | `docs/input-certificate.py`, which checks them too. |
| 13 | -/ |
| 14 | |
| 15 | set_option linter.style.header false |
| 16 | open Finset |
| 17 | |
| 18 | namespace E424.Inp |
| 19 | |
| 20 | def Utab : List (List ℕ) := [ |
| 21 | [0, 0, 0, 3000, 3198, 3174, 3284, 3577, 3487, 3665, 3439, 3796, 3665, 3009, 3323, 3500, 3210, |
| 22 | 3174, 3284, 3615, 3328, 3597, 3729, 3933, 3480, 3557, 3328, 3597, 3611, 3995, 3669, 3611, 3965, |
| 23 | 3795, 4046, 4407], |
| 24 | [0, 0, 0, 4267, 4075, 3942, 3969, 3692, 3744, 3333, 3726, 3502, 3468, 3262, 3966, 3673, 3720, |
| 25 | 3942, 4028, 3691, 3864, 3720, 3411, 3483, 3244, 3681, 3692, 3720, 3655, 3322, 3337, 3572, 3362, |
| 26 | 3330, 3225, 3000], |
| 27 | [0, 0, 0, 3919, 4046, 3000, 3006, 3137, 3385, 3421, 3148, 3347, 3315, 3517, 3056, 3181, 3172, |
| 28 | 3000, 3006, 3215, 3151, 3176, 3475, 3371, 3489, 3185, 3151, 3176, 3231, 3495, 3407, 3231, 3434, |
| 29 | 3389, 3484, 3635], |
| 30 | [0, 0, 0, 3129, 3000, 4104, 4029, 3878, 3664, 3579, 3869, 3585, 3656, 3551, 4015, 3828, 3894, |
| 31 | 4104, 3876, 3810, 3485, 3770, 3553, 3656, 3535, 3847, 3923, 3770, 3558, 3536, 3621, 3774, 3480, |
| 32 | 3627, 3486, 3356], |
| 33 | [0, 0, 0, 3249, 3357, 3150, 3243, 3383, 3130, 3000, 3071, 3098, 3164, 3256, 3256, 3060, 3229, |
| 34 | 3150, 3265, 3196, 3322, 3299, 3130, 3150, 3278, 3224, 3257, 3299, 3381, 3206, 3320, 3347, 3363, |
| 35 | 3404, 3455, 3604], |
| 36 | [0, 0, 0, 3334, 3205, 3450, 3310, 3187, 3458, 3611, 3534, 3417, 3431, 3348, 3321, 3523, 3369, |
| 37 | 3450, 3310, 3268, 3345, 3227, 3468, 3104, 3325, 3357, 3345, 3227, 3224, 3224, 3278, 3224, 3163, |
| 38 | 3189, 3116, 3000]] |
| 39 | |
| 40 | def U (κ : Fin 6) (j : ℕ) : ℕ := (Utab.getD κ []).getD j 0 |
| 41 | |
| 42 | /-- `10 +` the increment of `g κ` under the letter `a`. -/ |
| 43 | def ed (κ : Fin 6) (a : ℕ) : ℕ := |
| 44 | ((if a = 2 then [12, 8, 11, 9, 11, 9] |
| 45 | else if a = 3 then [8, 12, 8, 12, 10, 10] |
| 46 | else if a = 5 then [12, 8, 11, 9, 8, 12] |
| 47 | else if a = 9 then [6, 14, 6, 14, 10, 10] |
| 48 | else [3, 17, 20, 0, 11, 9]) : List ℕ).getD κ 0 |
| 49 | |
| 50 | /-- The letters possible at state `j` when `0 < g κ`. -/ |
| 51 | def letters (κ : Fin 6) (j : ℕ) : List ℕ := |
| 52 | if j ≤ 4 then [14] else if j ≤ 7 then [9] else if j ≤ 12 then [5] |
| 53 | else if j = 13 then (if κ = 0 then [3] else if κ = 1 then [5] else [3, 5]) |
| 54 | else if j ≤ 19 then [3] |
| 55 | else if j = 20 then (if κ = 2 then [3] else if κ = 3 then [2] else [3, 2]) |
| 56 | else if j = 21 then [3] |
| 57 | else if j = 22 then [2] |
| 58 | else if j = 23 then (if κ = 4 then [2] else if κ = 5 then [3] else [2, 3]) |
| 59 | else [2] |
| 60 | |
| 61 | theorem cert : ∀ κ : Fin 6, ∀ j ∈ Ico 3 36, ∀ a ∈ letters κ j, |
| 62 | (∑ r ∈ range a, U κ (a * j - 36 + r)) * 51 ^ ed κ a * 50 ^ (20 - ed κ a) * 2500 ^ ell a ≤ |
| 63 | a * 2499 ^ ell a * U κ j * 51 ^ 10 * 50 ^ 10 := by |
| 64 | decide +kernel |
| 65 | |
| 66 | theorem U_pos : ∀ κ : Fin 6, ∀ j ∈ Ico 3 36, 1 ≤ U κ j := by decide +kernel |
| 67 | |
| 68 | theorem U_le (κ : Fin 6) (j : ℕ) : U κ j ≤ 5000 := by |
| 69 | by_cases h : j < 36 |
| 70 | · have : ∀ κ : Fin 6, ∀ j < 36, U κ j ≤ 5000 := by decide +kernel |
| 71 | exact this κ j h |
| 72 | · have : ∀ κ : Fin 6, (Utab.getD κ []).length = 36 := by decide +kernel |
| 73 | rw [U, List.getD_eq_default _ _ (by rw [this]; omega)] |
| 74 | omega |
| 75 | |
| 76 | /-- The letter chosen by `act` is one of the listed ones. -/ |
| 77 | theorem act_mem_letters {κ : Fin 6} {ν : Ex} (j : ℕ) (hg : 0 < g κ ν) : act ν j ∈ letters κ j := by |
| 78 | rcases eq_or_ne j 13 with rfl | h13 |
| 79 | · by_cases h : 0 < h1 ν <;> fin_cases κ <;> simp_all [g, act, letters] |
| 80 | omega |
| 81 | rcases eq_or_ne j 20 with rfl | h20 |
| 82 | · by_cases h : 0 < h2 ν <;> fin_cases κ <;> simp_all [g, act, letters] |
| 83 | omega |
| 84 | rcases eq_or_ne j 23 with rfl | h23 |
| 85 | · by_cases h : 0 < h3 ν <;> fin_cases κ <;> simp_all [g, act, letters] |
| 86 | omega |
| 87 | simp only [act, letters, if_neg h13, if_neg h20, if_neg h23] |
| 88 | split_ifs <;> simp |
| 89 | |
| 90 | end E424.Inp |
| 91 | |