IndisputableMonolith.Verification.GWTC3RingdownFamilyGuard
IndisputableMonolith/Verification/GWTC3RingdownFamilyGuard.lean · 172 lines · 23 declarations
show as:
view math explainer →
1import Mathlib
2import IndisputableMonolith.Verification.GWTC3RingdownLikelihoodSelector
3
4/-!
5# GWTC-3 Ringdown Runtime Family Guard
6
7## Status: STRUCTURAL THEOREM (0 sorry, 0 RS-internal axiom; closure 2026-05-22).
8
9This module records the runtime guard induced by the Session 131
10family-stratified likelihood selector.
11
12The guard accepts only the three mapped model families:
13
14* `DS_1mode_10M`
15* `Kerr_220_0M`
16* `Kerr_220_10M`
17
18and rejects all blocked/unknown model families, including representative
19blocked families:
20
21* `Kerr_221_0M`
22* `Kerr_221_domega_221_0M`
23* `MMRDNP_10M`
24* `pseobnrv4hm`
25* unknown models
26
27This is runtime-policy formalization only. It computes no posterior
28likelihood.
29Zero `sorry`. Zero new RS-specific axioms.
30-/
31
32namespace IndisputableMonolith
33namespace Verification
34namespace GWTC3RingdownFamilyGuard
35
36open IndisputableMonolith.Verification.GWTC3RingdownLikelihoodSelector
37
38/-! ## §1. Model-family guard -/
39
40inductive GuardDecision where
41 | accept
42 | reject
43deriving DecidableEq
44
45def guardModel (model : String) : GuardDecision :=
46 if model = "DS_1mode_10M" then .accept
47 else if model = "Kerr_220_0M" then .accept
48 else if model = "Kerr_220_10M" then .accept
49 else .reject
50
51theorem guard_accepts_DS :
52 guardModel "DS_1mode_10M" = .accept := by
53 unfold guardModel
54 simp
55
56theorem guard_accepts_Kerr2200 :
57 guardModel "Kerr_220_0M" = .accept := by
58 unfold guardModel
59 simp
60
61theorem guard_accepts_Kerr22010 :
62 guardModel "Kerr_220_10M" = .accept := by
63 unfold guardModel
64 simp
65
66theorem guard_rejects_Kerr2210 :
67 guardModel "Kerr_221_0M" = .reject := by
68 unfold guardModel
69 simp
70
71theorem guard_rejects_Kerr221Domega :
72 guardModel "Kerr_221_domega_221_0M" = .reject := by
73 unfold guardModel
74 simp
75
76theorem guard_rejects_MMRDNP :
77 guardModel "MMRDNP_10M" = .reject := by
78 unfold guardModel
79 simp
80
81theorem guard_rejects_pseobnrv4hm :
82 guardModel "pseobnrv4hm" = .reject := by
83 unfold guardModel
84 simp
85
86theorem guard_rejects_unknown :
87 guardModel "not_a_real_family" = .reject := by
88 unfold guardModel
89 simp
90
91/-! ## §2. Counts from the runtime test -/
92
93def guardEligibleModelCount : Nat := 3
94def guardBlockedModelCount : Nat := 11
95def guardTestCount : Nat := 8
96def guardAcceptedTestCount : Nat := 3
97def guardRejectedTestCount : Nat := 5
98def guardAllTestsPassed : Bool := true
99
100theorem guard_counts_match_selector :
101 guardEligibleModelCount = selectorEligibleModels ∧
102 guardBlockedModelCount = selectorBlockedModels := by
103 unfold guardEligibleModelCount guardBlockedModelCount selectorEligibleModels selectorBlockedModels
104 simp
105
106theorem guard_test_count_partition :
107 guardAcceptedTestCount + guardRejectedTestCount = guardTestCount := by
108 unfold guardAcceptedTestCount guardRejectedTestCount guardTestCount
109 decide
110
111theorem guard_all_tests_passed :
112 guardAllTestsPassed = true := rfl
113
114/-! ## §3. Master cert -/
115
116structure GWTC3RingdownFamilyGuardCert where
117 accepts_DS : guardModel "DS_1mode_10M" = .accept
118 accepts_Kerr2200 : guardModel "Kerr_220_0M" = .accept
119 accepts_Kerr22010 : guardModel "Kerr_220_10M" = .accept
120 rejects_Kerr2210 : guardModel "Kerr_221_0M" = .reject
121 rejects_MMRDNP : guardModel "MMRDNP_10M" = .reject
122 rejects_pseobnrv4hm : guardModel "pseobnrv4hm" = .reject
123 rejects_unknown : guardModel "not_a_real_family" = .reject
124 counts_match_selector :
125 guardEligibleModelCount = selectorEligibleModels ∧
126 guardBlockedModelCount = selectorBlockedModels
127 test_count_partition :
128 guardAcceptedTestCount + guardRejectedTestCount = guardTestCount
129 all_tests_passed : guardAllTestsPassed = true
130 selector_available : Nonempty GWTC3RingdownLikelihoodSelectorCert
131
132def gwtc3RingdownFamilyGuardCert :
133 GWTC3RingdownFamilyGuardCert where
134 accepts_DS := guard_accepts_DS
135 accepts_Kerr2200 := guard_accepts_Kerr2200
136 accepts_Kerr22010 := guard_accepts_Kerr22010
137 rejects_Kerr2210 := guard_rejects_Kerr2210
138 rejects_MMRDNP := guard_rejects_MMRDNP
139 rejects_pseobnrv4hm := guard_rejects_pseobnrv4hm
140 rejects_unknown := guard_rejects_unknown
141 counts_match_selector := guard_counts_match_selector
142 test_count_partition := guard_test_count_partition
143 all_tests_passed := guard_all_tests_passed
144 selector_available := gwtc3RingdownLikelihoodSelectorCert_inhabited
145
146theorem gwtc3RingdownFamilyGuardCert_inhabited :
147 Nonempty GWTC3RingdownFamilyGuardCert :=
148 ⟨gwtc3RingdownFamilyGuardCert⟩
149
150/-- One-statement runtime guard theorem. -/
151theorem gwtc3_ringdown_family_guard_one_statement :
152 (guardModel "DS_1mode_10M" = .accept) ∧
153 (guardModel "Kerr_220_0M" = .accept) ∧
154 (guardModel "Kerr_220_10M" = .accept) ∧
155 (guardModel "Kerr_221_0M" = .reject) ∧
156 (guardModel "MMRDNP_10M" = .reject) ∧
157 (guardModel "pseobnrv4hm" = .reject) ∧
158 (guardAllTestsPassed = true) ∧
159 Nonempty GWTC3RingdownFamilyGuardCert :=
160 ⟨guard_accepts_DS,
161 guard_accepts_Kerr2200,
162 guard_accepts_Kerr22010,
163 guard_rejects_Kerr2210,
164 guard_rejects_MMRDNP,
165 guard_rejects_pseobnrv4hm,
166 guard_all_tests_passed,
167 gwtc3RingdownFamilyGuardCert_inhabited⟩
168
169end GWTC3RingdownFamilyGuard
170end Verification
171end IndisputableMonolith
172