Layer sorting
1. Which layer decides that cDj+D−1 is a score?
The coefficient layout and its index proof.
2. Which layer hides the query values?
Encryption.
3. Which layer makes the polynomial product amazingly fast?
The forward and inverse NTT representation.
4. A Δ-scaled ciphertext is multiplied by another Δ-scaled ciphertext. What divisor decodes the result?
Δ².
5. Why are three limbs not the same as three ciphertext components?
Limbs are just modular views of each coefficient; components are powers of the secret s in the ciphertext expression.
6. A result beautifully avoids modular wrap but has a large decoded error. Is that contradictory?
No. Numeric headroom and decoded precision are totally different obligations. The integer can fit the modulus while the accumulated approximation is still just way too large for the application.
7. Two decoded candidates are 0.700±0.003 and 0.696±0.003. Can the stated bound certify their order?
No. Their gap is 0.004 while the combined uncertainty is 0.006, so the intervals dangerously overlap.
8. In which representation may software actually extract coefficient 127?
Coefficient form, only after the inverse transform and decryption path has fully reconstructed the message. Transform index 127 is definitely not coefficient 127.
Mastery gate
Choose the complete, correctly layered statement.
Chapter 6 complete
The alphabet soup has layers
Fixed-point scale approximates reals. The negacyclic ring supplies fixed storage. residue limbs supply huge numeric range. ciphertext components encode dependence on the secret. the NTT accelerates the already-defined product. None replaces our packing proof. Let's head to Chapter 7.
Repository layer · second pass
Can you diagnose a failure at the correct representation layer?
A single score passes through semantic vectors, scaled integers, ring coefficients, residues, transform positions, ciphertext components, and finally decoded reals. Each layer has different invariants. Debugging improves dramatically when logs and tests label the layer rather than printing untyped arrays.
The studio asks you to explain every transition in both directions. If you cannot say what one index means at a layer, do not optimize that layer yet.
Reasoning chain
- 1
Name the current representation.
- 2
State reversible and lossy transitions.
- 3
List invariants available at that layer.
- 4
Compare with a reference one layer earlier.
- 5
Stop at the first divergence.
- 6
Preserve a minimal failing artifact.
Worked trace
Triage a wrong score tap
- Decoded value at expected tap is wrong.
- Integer packed multiplication is correct.
- RNS/NTT product disagrees after inverse transform.
- The defect is below layout and above decoding.
Result. The layer boundary narrows investigation without guessing.
Executable lens · Python
Make the hidden state visible
layers = ["semantic", "scaled", "ring", "rns", "ntt", "ciphertext", "decoded"]
for before, after in zip(layers, layers[1:]):
print(f"verify {before} -> {after}")Retype this example, predict each intermediate value, and then change one input that touches a boundary.
Misconception clinic
Tempting mistakes
- Comparing arrays whose indices mean different things.
- Changing security parameters before locating the first divergence.
Retrieval and transfer
Close the book first
- Create a diagnostic decision tree.
- State which transitions are approximate.
- Explain the full path without using “magic” or “just.”