Skip to content

Forcing zero-dimensionality for rational function field computation: Part I, field membership #394

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Mar 14, 2025

Conversation

pogudingleb
Copy link
Collaborator

This PR extends the approach already used in the identifiability assessment (originally inspired by this paper) to membership queries for rational function fields.

The idea is to reduce the Groebner basis computations to zero-dimensional ones. This is based on the observation is that a function f algebraic over Q(f_1, ..., f_n) belongs to this field iff it belongs to Q(f_1,..., f_n, a_1, ..., a_k) , where a_1, ..., a_k is a transcendence basis over Q(f_1, ..., f_n). Algebraicity can be checked by Jacobian condition and MQS ideal of Q(f_1,..., f_n, a_1, ..., a_k) will be zero-dimensional.

Here is an example of the speedup (functions derived from a linear compartment model):

using StructuralIdentifiability
using StructuralIdentifiability: field_contains, RationalFunctionField
using Nemo

function foo()
   R, (a_2_1, a_3_2, a_4_3, a_5_4, a_1_5, a_0_2, a_0_3) =
        polynomial_ring(QQ, ["a_2_1", "a_3_2", "a_4_3", "a_5_4", "a_1_5", "a_0_2", "a_0_3"])

    F = RationalFunctionField([
        (
            -a_2_1 * a_3_2 * a_4_3 - a_2_1 * a_3_2 * a_5_4 - a_2_1 * a_3_2 * a_1_5 -
            a_2_1 * a_3_2 * a_0_3 - a_2_1 * a_4_3 * a_5_4 - a_2_1 * a_4_3 * a_1_5 -
            a_2_1 * a_4_3 * a_0_2 - a_2_1 * a_5_4 * a_1_5 - a_2_1 * a_5_4 * a_0_2 -
            a_2_1 * a_5_4 * a_0_3 - a_2_1 * a_1_5 * a_0_2 - a_2_1 * a_1_5 * a_0_3 -
            a_2_1 * a_0_2 * a_0_3 - a_3_2 * a_4_3 * a_5_4 - a_3_2 * a_4_3 * a_1_5 -
            a_3_2 * a_5_4 * a_1_5 - a_3_2 * a_5_4 * a_0_3 - a_3_2 * a_1_5 * a_0_3 -
            a_4_3 * a_5_4 * a_1_5 - a_4_3 * a_5_4 * a_0_2 - a_4_3 * a_1_5 * a_0_2 -
            a_5_4 * a_1_5 * a_0_2 - a_5_4 * a_1_5 * a_0_3 - a_5_4 * a_0_2 * a_0_3 -
            a_1_5 * a_0_2 * a_0_3
        ) // (a_2_1 * a_3_2 * a_4_3 * a_5_4),
        (-a_3_2 * a_1_5 * a_0_3 - a_4_3 * a_1_5 * a_0_2 - a_1_5 * a_0_2 * a_0_3) //
        (a_3_2 * a_4_3),
        (-a_2_1 - a_3_2 - a_4_3 - a_5_4 - a_1_5 - a_0_2 - a_0_3) //
        (a_2_1 * a_3_2 * a_4_3 * a_5_4),
        (
            -a_2_1 * a_3_2 * a_4_3 * a_5_4 - a_2_1 * a_3_2 * a_4_3 * a_1_5 -
            a_2_1 * a_3_2 * a_5_4 * a_1_5 - a_2_1 * a_3_2 * a_5_4 * a_0_3 -
            a_2_1 * a_3_2 * a_1_5 * a_0_3 - a_2_1 * a_4_3 * a_5_4 * a_1_5 -
            a_2_1 * a_4_3 * a_5_4 * a_0_2 - a_2_1 * a_4_3 * a_1_5 * a_0_2 -
            a_2_1 * a_5_4 * a_1_5 * a_0_2 - a_2_1 * a_5_4 * a_1_5 * a_0_3 -
            a_2_1 * a_5_4 * a_0_2 * a_0_3 - a_2_1 * a_1_5 * a_0_2 * a_0_3 -
            a_3_2 * a_4_3 * a_5_4 * a_1_5 - a_3_2 * a_5_4 * a_1_5 * a_0_3 -
            a_4_3 * a_5_4 * a_1_5 * a_0_2 - a_5_4 * a_1_5 * a_0_2 * a_0_3
        ) // (a_2_1 * a_3_2 * a_4_3 * a_5_4),
        (
            -a_2_1 * a_3_2 - a_2_1 * a_4_3 - a_2_1 * a_5_4 - a_2_1 * a_1_5 - a_2_1 * a_0_2 - a_2_1 * a_0_3 - a_3_2 * a_4_3 - a_3_2 * a_5_4 -
            a_3_2 * a_1_5 - a_3_2 * a_0_3 - a_4_3 * a_5_4 - a_4_3 * a_1_5 -
            a_4_3 * a_0_2 - a_5_4 * a_1_5 - a_5_4 * a_0_2 - a_5_4 * a_0_3 -
            a_1_5 * a_0_2 - a_1_5 * a_0_3 - a_0_2 * a_0_3
        ) // (a_2_1 * a_3_2 * a_4_3 * a_5_4),
        -1 // (a_2_1 * a_3_2 * a_4_3 * a_5_4),
    ])

    field_contains(F, gens(R), 0.99)
end

@time foo()

The computation time reduced from 100s to 20s.

Next step would be to make similar arrangements in the simplification functionality.

@pogudingleb pogudingleb merged commit 37d2b8a into master Mar 14, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant