kernel-reconstructed-partial-fractions-mixed-general-case-identity
- Kind
- kernel-term
- Status
- checked
Supports: x + 1 = (-1/2)*((x-1)*(x^2+1)) + 1*(x^2+1) + ((1/2)*x + (-1/2))*((x-1)*(x-1)) at a universally quantified Rat variable x, admitted by crate::Kernel::add_declaration as Check.cas_partial_fractions_mixed_general_case. The certificate is NOT hand-copied: the test calls axeyum_cas::partial_fractions::partial_fractions(&p, &q) directly on p = x+1, q = (x-1)^2(x^2+1) (built via axeyum_ir::poly::ratpoly_mul from its two factors, matching partial_fractions::tests::mixed_general_case exactly), and separately confirms axeyum_cas::partial_fractions::verify_partial_fraction_certificate accepts it (Some(true)) before any kernel term is built. The (numerator, cofactor) pairs are re-derived on the Rust side from the certificate's own terms by grouping factors and recomputing each cofactor as product_excluding(i) * factor_i^(mult_i - power) -- transcribed from the checker's own documented recipe (partial_fractions.rs:426-442), not the producer's -- and the Rust-side sum is asserted to equal cert.p EXACTLY (not merely at a sample point) before the kernel is ever invoked. The proof is emitted by NEW code this fact required: prove_head_product_rat / prove_term_mul_rat / prove_poly_mul_rat / prove_poly_combination_rat, the Rational-coefficient generalisation of cas_geometry_mul_bridge_tests's i128-only prove_head_product/prove_term_mul/prove_poly_mul/prove_poly_combination -- needed because the quadratic-factor term's numerator (Cx+D) is genuinely non-constant, so the constant-cofactor-only prove_scale_rat/prove_merge_rat/prove_const_combination_rat the fractional-cast lane built is not by itself sufficient. Every coefficient-collapse step is either a Rat ring lemma the kernel re-derives (left_distrib, right_distrib, mul_assoc, mul_comm, mul_zero, add_zero) or a single Eq.refl ascription the kernel's OWN Rat.mul/Rat.add computation checks. The declaration's axiom_footprint is asserted EMPTY and its kind asserted Declaration::Theorem in the same test.
cargo test -p axeyum-lean-kernel --lib rat_prelude::cas_partial_fractions_bridge_tests::tests::cas_partial_fractions_mixed_general_case_kernel_checked -- --exact 2>/dev/null | grep -cE '^test rat_prelude::cas_partial_fractions_bridge_tests::tests::cas_partial_fractions_mixed_general_case_kernel_checked \.\.\. ok$' Evidence notes
Measured wall-clock 8.03s for this test alone (debug, uncontended, scripts/cargo-serialized.sh) -- comparable to the medians-concurrent sibling's 8.14s despite needing genuine poly x poly multiplication, because both polynomials involved are small (the largest product is a 2-term numerator times a 3-term cofactor). MUTATION-VERIFIED both halves through DIFFERENT guards, each reverted after checking: (a) STATEMENT guard -- `remaining_power = mult - term.power + 1` (an off-by-one in the cofactor exponent, in the Rust-side numerator_cofactor_pairs helper) kills BOTH the standalone coefficient_matching_reconstruction_equals_p_exactly test (a Rust-level assert_eq! against cert.p) and this test's own `merged == p_for_build` assertion, before add_declaration is ever called -- pinning the statement to the certificate rather than to whatever the emitter produced. (b) KERNEL GATE guard -- swapping mul_assoc's argument order in the NEW prove_head_product_rat (`&[a_rat, a_mono, b_e]` -> `&[b_e, a_mono, a_rat]`, same arity, wrong instantiation) leaves the Rust-side statement UNCHANGED (merged == p_for_build still holds) and makes add_declaration reject with TypeMismatch, showing the PROOF is genuinely re-derived by the trust anchor rather than merely restating a Rust-side computation.