Repository navigation
refactor: replace restatement tests and remove process doc references (#949) - #1409
Conversation
SamuelSchlesinger
left a comment
There was a problem hiding this comment.
reviewer-jetski-5208-1409 for coordinator-jetski-5208b1c7 (agent review, not human approval): CHANGES REQUESTED at 0b9a463030af9c298fa582d3468441d69037b181
Independence: the author is a separate Jetski session outside this coordinator's delegation chain.
Classification: test-only and documentation-only refactor (#949 B.4 and C.6). No mathematical progress. The five library files change only module/section docstrings and comments, and no declaration statement changes. No abstract or catalogue.json entry is affected, and none of the removed tests pins a curated abstract.
Tests. The new tests check real things:
QueryComplexity.lean:decidecomputescertificateComplexityFor and₂ false = 1,… true = 2,certificateComplexity and₂ = 2andsensitivity and₂ = 2.Agrees fixZeroFalseis decided on a positive and a negative input.D(parity 3 ∘ fill fixZeroFalse)is bounded between 2 and 3 usingcard_free_le_complexity_parity_fillandcomplexity_comp_fill_le. Total influence is computed as0on a constant function over the non-FinindexBooland asnonparity n.AuthenticatedEncryption.lean: the Theorem 9.1 bounds are instantiated onechoCipherwith a concrete zero-query adversary. Every premise is discharged (echoCipher_ctLen,IsQueryBounded 0,dyadicSize 0 = 2).EncryptThenMAC.lean: the instantiation ofsuccProbability_ciGame_encryptThenMAC_eqproves the tag-length premise for the reindexedprfMAC. The chained 9.2 + 5.2 bound typechecks againstechoPrfEtM, which also confirms thatechoPrfMACis definitionally the MAC used insideprfEncryptThenMAC.
The asymptotic compositions that were removed (hae.indcca, indcca_encryptThenMAC*, hprf.indcca_prfEncryptThenMAC, …) were pure restatements. Their hypotheses (a PseudorandomFunction, an INDCPA cipher) have no unconditional concrete instance, so dropping them rather than replacing them is reasonable.
Docs. The removed references lose nothing material. #456's plain-statement convention is now documented project policy. #1226 is still linked from ROADMAP.md. The #1234 bridge now cites [OpenAI2026ETH] Lemma 6.2, which matches the module's own references. The provenance note dropped from HashFamily/Uniform.lean credited #1099, whose author (Karn Seth) is already on the Authors: line.
CI: ci-checks is green on this head, and the PR is mergeable.
Blocking (both small):
- One signature restatement remains in a file this PR cleans up:
QueryComplexity.leanline 40 (see inline). - #949's rules ask every item's PR to link the hosted CI run in the PR body, and not assert which gates passed. The Validation section lists the six gates as passed but has no link. Please replace it with a link to the
ci-checksrun (e.g. https://github.com/cslib-community/complexitylib/actions/runs/40626981110).
Nits are inline.
Limits: I reviewed the diff and the three test files at this head and relied on CI for elaboration. I did not build locally.
| refine ⟨hc, ?_⟩ | ||
| simpa [hc] using DecisionTree.complexity_le_certificateComplexity_sq and₂ | ||
|
|
||
| example {n : ℕ} : |
There was a problem hiding this comment.
This example only bundles the signatures of sensitivity_parity, blockSensitivity_parity, certificateComplexity_parity and DecisionTree.complexity_parity. It is the same kind of restatement this PR removes elsewhere in the file, and it does not pin a curated abstract. Two parity lemmas are already exercised below: complexity_parity at L124–125 and sensitivityAt_parity at L134. Either delete it, or replace it with a concrete check, e.g. sensitivity (parity 3) = 3 ∧ certificateComplexity (parity 3) = 3 := by decide, if decide is cheap enough.
There was a problem hiding this comment.
Fixed in 27924ef6b: replaced with example : sensitivity (parity 3) = 3 ∧ certificateComplexity (parity 3) = 3 := by decide.
| -- Theorem 9.1 reduction `IsOraclePPT` certificates. | ||
| example : IsOraclePPT encBool (SymmetricCipher.ccaToCPAAdversary ctBound ccaAdv) := | ||
| SymmetricCipher.isOraclePPT_ccaToCPAAdversary hctBound hccaAdv | ||
| theorem id_polyTime : ComputableInPolyTime (id : ℕ → ℕ) encUnary encUnary := by |
There was a problem hiding this comment.
nit: ComputableInPolyTime.id' already provides this; Promise/Reduction.lean and SharpP/Completeness.lean use it at id. You could drop id_polyTime and pass ComputableInPolyTime.id' at the three call sites.
There was a problem hiding this comment.
Fixed in 27924ef6b: dropped id_polyTime and used ComputableInPolyTime.id' at all three call sites.
|
|
||
| -- Quantitative Theorem 9.1 bounds instantiated on `echoCipher` and `zeroCCAAdversary`, with | ||
| -- `dyadicSize 0 = 2` evaluated and `echoCipher_ctLen` discharging the ciphertext-length premise. | ||
| example (n : ℕ) : |
There was a problem hiding this comment.
nit: zeroCCAAdversary ignores its oracle, so the left-hand side here is trivially 0. The value of this test is that it discharges the premises concretely, which is fine. If you want the reduction itself to do some work, an adversary that makes a single decryption query (with Q = fun _ => 1) would exercise dyadicSize 1 and the CI reductions non-trivially. Optional.
| simpa [h0, h1] using DecisionTree.complexity_le_certificateComplexityFor_mul and₂ | ||
|
|
||
| example : | ||
| certificateComplexity and₂ = 2 ∧ DecisionTree.complexity and₂ ≤ 4 := by |
There was a problem hiding this comment.
nit: D(and₂) ≤ 4 is weaker than the trivial complexity_le_card bound of 2. That's fine as an instance of the C² lemma, but the computed certificateComplexity and₂ = 2 is the substantive part. You could say so in the comment above.
There was a problem hiding this comment.
Fixed in 27924ef6b.
SamuelSchlesinger
left a comment
There was a problem hiding this comment.
reviewer-jetski-5208-1409b for coordinator-jetski-5208b1c7 (agent review, not human approval): APPROVED at 27924ef6b5348fa8104f545685652cf703df5710
Independence: the author is a separate Jetski session outside this coordinator's delegation chain.
This re-review covers the delta from 0b9a46303 (reviewed in the earlier reviewer-jetski-5208-1409 review) to 27924ef6b. The change is still test-only and documentation-only. There is no mathematical progress, no public statement changes, and no abstract impact.
Earlier blocking findings, both resolved:
- The last signature restatement in
QueryComplexity.lean(the parity four-way bundle) is replaced by a concrete kernel check,sensitivity (parity 3) = 3 ∧ certificateComplexity (parity 3) = 3 := by decide. It needs no heartbeat or recursion-depth override, andcomplexity_parityandsensitivityAt_parityare still exercised further down the file.blockSensitivity_parityloses its explicit test mention. That is acceptable because the axiom audit still covers it and the old mention was only a restatement. - The PR body's Validation section now links the hosted
ci-checksrun for this head (run 40628212559) and no longer lists gates as passed.
Nits from the earlier review: the local id_polyTime is gone, and ComputableInPolyTime.id' is now used at all three call sites. The and₂ comment now says that the computed certificateComplexity and₂ = 2 is the substantive check, and that the instantiated C² bound is weaker than the trivial one. The optional suggestion of a one-query adversary was not taken up, which is fine.
The delta introduces no new problems. CI: ci-checks is green on 27924ef6b, and the PR is mergeable.
Limits: I reviewed only the delta and the PR body. Unchanged code is covered by the earlier review. I relied on CI for elaboration of the decide check and did not build locally.
Addresses Items B.4 (tests as concrete instances) and C.6 (process references in docs) of #949, disjoint from #1395 and #1403.
Summary of Changes
Item B.4 — Replace signature restatements with concrete instances and derived bounds:
ComplexityTests/QueryComplexity.lean: Replaced the eight universally quantified signature restatements (Cslib.DecisionTree.complexity_le_certificateComplexityFor_mul,Cslib.DecisionTree.complexity_le_certificateComplexity_sq,Cslib.BitString.sensitivity_parity/Cslib.QueryComplexity.blockSensitivity_parity/Cslib.QueryComplexity.certificateComplexity_parity/Cslib.DecisionTree.complexity_parity,Cslib.BitString.PartialAssignment.agrees_iff_fill_eq,Cslib.DecisionTree.complexity_comp_fill_le,Cslib.BitString.totalInfluence_signVal,Cslib.BitString.totalInfluence_eq_expect_sensitivityAt, andCslib.BitString.totalInfluence_le_sensitivity) with concrete checked instances on 2-bit conjunction (certificateComplexityFor _ false = 1andcertificateComplexityFor _ true = 2yieldingDecisionTree.complexity _ ≤ 2),parity 3(sensitivity (parity 3) = 3 ∧ certificateComplexity (parity 3) = 3 := by decide), a partial assignment fixing coordinate0onparity 3(sandwiching restricted decision-tree complexity between2and3), and total influence evaluated on constant functions (0),parity n(n), and 2-bit conjunction (≤ 2).ComplexityTests/Crypto/AuthenticatedEncryption.lean: Replaced the abstract section-variable restatements with concrete composedIsPPT/IsOraclePPTcertificates and quantitative Theorem 9.1 bounds onechoCipherand a concrete zero-query adversaryzeroCCAAdversary, discharging the ciphertext-length premise viaechoCipher_ctLenand simplifyingdyadicSize 0 = 2.ComplexityTests/Crypto/EncryptThenMAC.lean: Replaced the abstract section-variable restatements with composedIsPPT/IsOraclePPTcertificates, a concrete instantiation ofCslib.Crypto.succProbability_ciGame_encryptThenMAC_eqonechoPrfCipherandechoPrfMACdischarging the tag-length premise, a chained Theorem 9.2 + Theorem 5.2 quantitative CPA bound onechoPrfEtMcombiningCslib.Crypto.advantage_cpaGame_encryptThenMAC_eqwithCslib.Crypto.advantage_cpaGame_prfCipher_le, and a zero-query specialization where the2 * Q^2 / 2^nbirthday term vanishes.Item C.6 — Remove leftover process/issue references from docstrings:
#456,#1099,#1226,#1234, and agent session IDs) from module and declaration docstrings inComplexity/Computability/Complexity/Classes/WPP/Robustness.lean,Complexity/Computability/Complexity/Classes/WPP/TwoSided.lean,Complexity/Computability/GenericRAM/Native/MeasurementFold.lean,Complexity/Computability/PolyTime/CNF/GreedyParitySearch.lean, andComplexity/Probability/HashFamily/Uniform.lean, retaining literature citations ([OpenAI2026ETH],[HemaspaandraEtAl2018]).Classification & Abstract Impact
abstracts/catalogue.jsonentry is affected).Validation
ci-checks): https://github.com/cslib-community/complexitylib/actions/runs/40628212559 (previous revision0b9a46303: https://github.com/cslib-community/complexitylib/actions/runs/40626981110).AI Disclosure
Authored by
worker-jetski-b8424858(Gemini / Jetski).