@@ -43,6 +43,23 @@ def _matrix(rows: list[list[int | Fraction]]) -> dict[str, Any]:
4343 }
4444
4545
46+ def _truncated_legendre_matrix (prime : int ) -> dict [str , Any ]:
47+ order = (prime - 5 ) // 2
48+
49+ def entry (row : int , column : int ) -> int :
50+ residue = (row - column ) % prime
51+ character = (
52+ 0
53+ if residue == 0
54+ else (1 if pow (residue , (prime - 1 ) // 2 , prime ) == 1 else - 1 )
55+ )
56+ return 1 + character
57+
58+ return _matrix (
59+ [[entry (row , column ) for column in range (order )] for row in range (order )]
60+ )
61+
62+
4663def _reference_determinant (rows : list [list [Fraction ]]) -> Fraction :
4764 total = Fraction (0 )
4865 for permutation in permutations (range (len (rows ))):
@@ -183,6 +200,55 @@ def test_matrix_determinant_verify_independently_recomputes_exact_value(
183200 assert verified .assurance .level is CapabilityAssuranceLevel .VERIFIED
184201
185202
203+ def test_matrix_determinant_computes_and_verifies_order_33_sun_conjecture_case (
204+ matrix_checker_services : _MatrixRuntime ,
205+ ) -> None :
206+ """Reproduce Yang--Yang--Zhang, arXiv:2606.22548, Theorem 1.1 at p=71."""
207+
208+ matrix = _truncated_legendre_matrix (71 )
209+ computed = matrix_checker_services .core .capabilities .invoke (
210+ CapabilityRequest (
211+ capability_id = "matrix.determinant.compute" ,
212+ input = {"matrix" : matrix },
213+ )
214+ )
215+ verified = matrix_checker_services .core .capabilities .invoke (
216+ CapabilityRequest (
217+ capability_id = "matrix.determinant.verify" ,
218+ mode = CapabilityMode .VERIFY ,
219+ input = {
220+ "input" : {"matrix" : matrix },
221+ "candidate" : computed .output ["result" ],
222+ },
223+ )
224+ )
225+
226+ assert computed .output ["result" ]["determinant" ] == _rational (529 )
227+ assert computed .assurance .level is CapabilityAssuranceLevel .COMPUTED
228+ assert verified .execution .status is ExecutionStatus .COMPLETED
229+ assert verified .output ["status" ] == "VERIFIED"
230+ assert verified .output ["conclusion" ] == "TRUE"
231+ assert verified .assurance .level is CapabilityAssuranceLevel .VERIFIED
232+
233+
234+ def test_matrix_determinant_rejects_order_above_64 (
235+ matrix_services : _MatrixRuntime ,
236+ ) -> None :
237+ matrix = _matrix (
238+ [[1 if row == column else 0 for column in range (65 )] for row in range (65 )]
239+ )
240+
241+ result = matrix_services .core .capabilities .invoke (
242+ CapabilityRequest (
243+ capability_id = "matrix.determinant.compute" ,
244+ input = {"matrix" : matrix },
245+ )
246+ )
247+
248+ assert result .execution .status is ExecutionStatus .ERROR
249+ assert result .diagnostics [0 ].code == "INVALID_REQUEST"
250+
251+
186252def test_matrix_determinant_verify_rejects_wrong_bound_value (
187253 matrix_checker_services : _MatrixRuntime ,
188254) -> None :
0 commit comments