Download rocq/NoiseNum.v from phanerozoic/threshold-computers: direct link, hf CLI and curl.
- Browser
- Download file 6.53 kB
-
https://huggingface.co/phanerozoic/threshold-computers/resolve/main/rocq/NoiseNum.v
- Command line
-
hf download hf://phanerozoic/threshold-computers/rocq/NoiseNum.v
-
curl -L -o NoiseNum.v https://huggingface.co/phanerozoic/threshold-computers/resolve/main/rocq/NoiseNum.v
6.53 kB
| (* The numbers of Section 8 that follow from the bounds on erfc: the failure probability p at s = 0.05, the | |
| union bounds over the self-reproducing run of the host, the threshold for output flips, the redundancy for noise on | |
| every synapse, and the deviations up to which a generation of the stored host runs exactly (Corollary 8.15). | |
| Each is evaluated between the bounds lo1 <= erfc <= up3 with the interval tactic. *) | |
| From Stdlib Require Import Reals Lra. | |
| From Interval Require Import Tactic. | |
| Set Warnings "-ambiguous-paths". | |
| From TH Require Import Erfc. | |
| Set Warnings "ambiguous-paths". | |
| Local Open Scope R_scope. | |
| Lemma erfc_between : forall x, 0 < x -> lo1 x <= erfc x <= up3 x. | |
| Proof. intros x Hx. split; [apply erfc_lower1 | apply erfc_upper3]; exact Hx. Qed. | |
| Ltac erfc_upper x := let H := fresh in pose proof (proj2 (erfc_between x ltac:(interval))) as H; unfold up3 in H. | |
| Ltac erfc_lower x := let H := fresh in pose proof (proj1 (erfc_between x ltac:(interval))) as H; unfold lo1 in H. | |
| (* ---- Section 8.1: the host, M = 41,967 rows, over the T = 1,664,939 steps of its self-reproducing run ---------------- *) | |
| (* p = erfc(1/(2 sqrt 2 s)) at s = 0.05 *) | |
| Theorem p_005 : 1.52e-23 <= erfc (1 / (2 * sqrt 2 * 0.05)) <= 1.53e-23. | |
| Proof. | |
| erfc_lower (1 / (2 * sqrt 2 * 0.05)). erfc_upper (1 / (2 * sqrt 2 * 0.05)). | |
| split; [eapply Rle_trans; [|eassumption] | eapply Rle_trans; [eassumption|]]; interval with (i_prec 80). | |
| Qed. | |
| (* Proposition 8.4 bounds a deviation over the run by T M p <= 1.1e-12 at s = 0.05; at s = 0.10 the bound exceeds one *) | |
| Theorem TMp_005 : 1664939 * 41967 * erfc (1 / (2 * sqrt 2 * 0.05)) <= 1.1e-12. | |
| Proof. | |
| erfc_upper (1 / (2 * sqrt 2 * 0.05)). | |
| eapply Rle_trans; [apply Rmult_le_compat_l; [lra | eassumption]|]. interval with (i_prec 80). | |
| Qed. | |
| Theorem TMp_010 : 1 < 1664939 * 41967 * erfc (1 / (2 * sqrt 2 * 0.10)). | |
| Proof. | |
| erfc_lower (1 / (2 * sqrt 2 * 0.10)). | |
| eapply Rlt_le_trans; [|apply Rmult_le_compat_l; [lra | eassumption]]. interval with (i_prec 80). | |
| Qed. | |
| (* Proposition 8.10 for the host, whose largest fan-in is 256: the threshold 1/(2 e 256) is below 7.2e-4 *) | |
| Theorem flip_threshold : 1 / (2 * exp 1 * 256) < 7.2e-4. | |
| Proof. interval. Qed. | |
| (* Corollary 8.9 with K* = 8: the bound falls below 1e-3 with r = 5 at s_w = 0.05 and with r = 21 at s_w = 0.10, | |
| and not with r = 3 and r = 19 *) | |
| Theorem synapse_005 : | |
| 1664939 * 5 * 41967 * erfc (sqrt 5 / (2 * sqrt (2 * 8) * 0.05)) < 1e-3 | |
| /\ 1e-3 < 1664939 * 3 * 41967 * erfc (sqrt 3 / (2 * sqrt (2 * 8) * 0.05)). | |
| Proof. | |
| erfc_upper (sqrt 5 / (2 * sqrt (2 * 8) * 0.05)). erfc_lower (sqrt 3 / (2 * sqrt (2 * 8) * 0.05)). split. | |
| - eapply Rle_lt_trans; [apply Rmult_le_compat_l; [lra | eassumption]|]. interval with (i_prec 80). | |
| - eapply Rlt_le_trans; [|apply Rmult_le_compat_l; [lra | eassumption]]. interval with (i_prec 80). | |
| Qed. | |
| Theorem synapse_010 : | |
| 1664939 * 21 * 41967 * erfc (sqrt 21 / (2 * sqrt (2 * 8) * 0.10)) < 1e-3 | |
| /\ 1e-3 < 1664939 * 19 * 41967 * erfc (sqrt 19 / (2 * sqrt (2 * 8) * 0.10)). | |
| Proof. | |
| erfc_upper (sqrt 21 / (2 * sqrt (2 * 8) * 0.10)). erfc_lower (sqrt 19 / (2 * sqrt (2 * 8) * 0.10)). split. | |
| - eapply Rle_lt_trans; [apply Rmult_le_compat_l; [lra | eassumption]|]. interval with (i_prec 80). | |
| - eapply Rlt_le_trans; [|apply Rmult_le_compat_l; [lra | eassumption]]. interval with (i_prec 80). | |
| Qed. | |
| (* Theorem 8.8 (ii) for N_3 over the run: 1.54e-39, 3.19e-12, 1.34e-2 and more than 4e2 at s = 0.10, 0.15, 0.20, 0.25 *) | |
| Theorem N3_first_order : | |
| 1.53e-39 <= 1664939 * 3 * 41967 * erfc (3 / (2 * sqrt 2 * 0.10)) <= 1.55e-39 | |
| /\ 3.18e-12 <= 1664939 * 3 * 41967 * erfc (3 / (2 * sqrt 2 * 0.15)) <= 3.20e-12 | |
| /\ 1.33e-2 <= 1664939 * 3 * 41967 * erfc (3 / (2 * sqrt 2 * 0.20)) <= 1.35e-2 | |
| /\ 4.1e2 <= 1664939 * 3 * 41967 * erfc (3 / (2 * sqrt 2 * 0.25)) <= 4.2e2. | |
| Proof. | |
| erfc_lower (3 / (2 * sqrt 2 * 0.10)). erfc_upper (3 / (2 * sqrt 2 * 0.10)). | |
| erfc_lower (3 / (2 * sqrt 2 * 0.15)). erfc_upper (3 / (2 * sqrt 2 * 0.15)). | |
| erfc_lower (3 / (2 * sqrt 2 * 0.20)). erfc_upper (3 / (2 * sqrt 2 * 0.20)). | |
| erfc_lower (3 / (2 * sqrt 2 * 0.25)). erfc_upper (3 / (2 * sqrt 2 * 0.25)). | |
| repeat split; | |
| first [ eapply Rle_trans; [|apply Rmult_le_compat_l; [lra | eassumption]]; interval with (i_prec 80) | |
| | eapply Rle_trans; [apply Rmult_le_compat_l; [lra | eassumption]|]; interval with (i_prec 80) ]. | |
| Qed. | |
| (* ---- Corollary 8.15: a generation of the stored host, T = 95,762,842,100 applications of a network of | |
| M = 470,604,761 rows, runs exactly with probability at least 0.999 for s <= 0.050, and its threefold and fivefold | |
| amplifications for s <= 0.148 and s <= 0.247 -------------------------------------------------------------------------- *) | |
| Lemma erfc_at_most : forall r s s0, 0 < r -> 0 < s -> s <= s0 -> erfc (r / (2 * sqrt 2 * s)) <= erfc (r / (2 * sqrt 2 * s0)). | |
| Proof. | |
| intros r s s0 Hr Hs Hle. apply erfc_decr. pose proof sqrt2_pos. | |
| apply Rmult_le_compat_l; [lra|]. apply Rinv_le_contravar; [nra | nra]. | |
| Qed. | |
| Lemma generation_1_at : 95762842100 * 470604761 * erfc (1 / (2 * sqrt 2 * 0.050)) <= 1e-3. | |
| Proof. | |
| erfc_upper (1 / (2 * sqrt 2 * 0.050)). | |
| eapply Rle_trans; [apply Rmult_le_compat_l; [lra | eassumption]|]. interval with (i_prec 100). | |
| Qed. | |
| Lemma generation_3_at : 95762842100 * 3 * 470604761 * erfc (3 / (2 * sqrt 2 * 0.148)) <= 1e-3. | |
| Proof. | |
| erfc_upper (3 / (2 * sqrt 2 * 0.148)). | |
| eapply Rle_trans; [apply Rmult_le_compat_l; [lra | eassumption]|]. interval with (i_prec 100). | |
| Qed. | |
| Lemma generation_5_at : 95762842100 * 5 * 470604761 * erfc (5 / (2 * sqrt 2 * 0.247)) <= 1e-3. | |
| Proof. | |
| erfc_upper (5 / (2 * sqrt 2 * 0.247)). | |
| eapply Rle_trans; [apply Rmult_le_compat_l; [lra | eassumption]|]. interval with (i_prec 120). | |
| Qed. | |
| Theorem generation_1 : forall s, 0 < s <= 0.050 -> | |
| 95762842100 * 470604761 * erfc (1 / (2 * sqrt 2 * s)) <= 1e-3. | |
| Proof. | |
| intros s [Hs Hle]. eapply Rle_trans; [apply Rmult_le_compat_l; [lra | apply (erfc_at_most 1 s 0.050); lra]|]. | |
| exact generation_1_at. | |
| Qed. | |
| Theorem generation_3 : forall s, 0 < s <= 0.148 -> | |
| 95762842100 * 3 * 470604761 * erfc (3 / (2 * sqrt 2 * s)) <= 1e-3. | |
| Proof. | |
| intros s [Hs Hle]. eapply Rle_trans; [apply Rmult_le_compat_l; [lra | apply (erfc_at_most 3 s 0.148); lra]|]. | |
| exact generation_3_at. | |
| Qed. | |
| Theorem generation_5 : forall s, 0 < s <= 0.247 -> | |
| 95762842100 * 5 * 470604761 * erfc (5 / (2 * sqrt 2 * s)) <= 1e-3. | |
| Proof. | |
| intros s [Hs Hle]. eapply Rle_trans; [apply Rmult_le_compat_l; [lra | apply (erfc_at_most 5 s 0.247); lra]|]. | |
| exact generation_5_at. | |
| Qed. | |