Diseña una máquina matemática

Del parámetro al certificado, la prueba Lean y el diagnóstico.

Capítulos
Transcripción

Una pregunta para el atlas

Estos grafos tienen cuatro vértices. ¿Cuántas raíces de sus polinomios de emparejamientos superan siete quintos, contando multiplicidades? Diseñaremos un atlas para responder. Cada pieza debe aportar al conteo, la cobertura o el diagnóstico. Probemos primero el método con una cúbica. Su prueba en Lean es pequeña y muestra cómo pasar de las condiciones de entrada a una garantía uniforme.

Fija la salida antes de buscar

Para la cúbica p_c(t), la entrada es c, un número real. La propiedad que pedimos es que existan al menos tres raíces reales distintas. Mira qué abre la ficha. Debemos dar un polinomio no nulo, cuatro puntos estrictamente ordenados y un producto negativo para cada par de evaluaciones consecutivas.

De la exploración al certificado exacto

Los cuatro testigos serán menos dos, menos uno, uno y dos. Al mover c, la curva varía, pero conservamos estos puntos. Evaluamos de manera exacta. El primer valor es c menos dos, el segundo c más dos, y luego se repiten esos dos valores. Para obtener signos menos, más, menos, más, pedimos c menos dos negativo y c más dos positivo. Esto equivale a menos dos menor que c menor que dos.

Lee la prueba compilada

Aquí está el teorema compilado. Conserva el parámetro real y recibe las dos cotas estrictas. La conclusión pide al menos tres raíces distintas. Aplicamos el teorema de alternancia con el polinomio no nulo y el vector de testigos. Los dos interrogantes quedan para el orden y los signos. La ficha transforma esos datos en tres intervalos disjuntos con raíz. Lean comprueba una sola declaración para todos los c que cumplen las hipótesis. Probamos una rama de Newton. Compila, pero al sustituir los coeficientes queda cero mayor o igual que menos veintisiete. La dejamos fuera de la máquina.

Un diagnóstico que sirve para reparar

El polinomio y su objetivo siguen iguales, pero aparece una evaluación nula. El diagnóstico puede señalar el primer producto que deja de ser negativo. Ahora pon c igual a dos, con los testigos originales. El producto falla por otra razón: hemos salido del intervalo de la prueba uniforme. En ese borde tenemos una prueba distinta. La factorización en te menos uno al cuadrado por te más dos revela una raíz doble. Lean comprueba esa identidad por expansión.

Transfiere el método al atlas

Volvamos al atlas. Entran un grafo y un umbral racional. Pedimos intervalos disjuntos, multiplicidades y el número de raíces estrictamente por encima del umbral. Trabajamos hacia atrás: obtener los coeficientes del grafo, acotar la búsqueda, justificar los conteos y cerrar la cobertura. Esta consulta real de Excovery, desde un polinomio hasta un número de raíces, propone entre otras la cota de Budan Fourier. Una cota puede descartar intervalos. Para nuestra respuesta necesitamos además un conteo exacto con multiplicidades. Seleccionaremos la regla por esa garantía. Si queda abierto el puente desde el grafo hasta los coeficientes, una prueba sobre el polinomio aún no responde la pregunta sobre el grafo.

Las piezas del atlas

El polinomio de emparejamientos usa como coeficientes los conteos de conjuntos de aristas disjuntas por tamaño, con signos alternos. El camino de cuatro vértices tiene tres aristas y un emparejamiento de tamaño dos. Su polinomio es te a la cuarta menos tres te al cuadrado más uno. Las dos aristas disjuntas dan otro polinomio, te a la cuarta menos dos te al cuadrado más uno. Las fichas sesenta y nueve y setenta, de Heilmann y Lieb, garantizan raíces reales y una cota por el grado máximo. Con grado a lo sumo dos, partimos del intervalo de menos dos a dos. Sturm certifica el conteo exacto en cada intervalo para un factor libre de cuadrados. Si un extremo es una raíz, comprobamos ese cero y lo registramos por separado. Los factores, elevados a sus multiplicidades, deben reconstruir el polinomio. Con la escisión real, la suma de conteos ponderados debe coincidir con su grado. Así cada pieza interviene en algo concreto: legitimar el dato de entrada, decidir dónde buscar o demostrar que el atlas está completo.

Certifica el conteo por intervalo

Veamos el conteo en el camino de cuatro vértices. Preguntamos por raíces estrictamente mayores que siete quintos. La cota global es dos, y aquí el polinomio en dos vale cinco. Podemos usar dos como extremo superior. Sturm trabaja en un intervalo finito. Para aplicar la ficha trece necesitamos un factor libre de cuadrados, extremos en orden y ninguna raíz del factor en los dos extremos. Construimos la secuencia empezando por el polinomio y su derivada. Cada paso añade el opuesto del resto de la división anterior. Estos son los cinco polinomios para el camino. Evaluamos la secuencia. En siete quintos aparece un signo menos seguido de cuatro signos más. En dos todos son positivos. La diferencia de variaciones es uno menos cero. Por eso el intervalo contiene una raíz. Como el factor aparece una vez, el conteo ponderado también es uno. En dos aristas disjuntas, el factor te al cuadrado menos uno aparece dos veces. Si preguntamos a partir de uno, el extremo es una raíz y la hipótesis de Sturm requiere atención. Registramos uno como punto exacto de multiplicidad dos, lo excluimos de la consulta estricta y retiramos su factor antes de contar las raíces restantes. Así el extremo deja de ser una raíz del factor restante. El prototipo calcula los coeficientes por dos vías y usa aritmética exacta para el conteo. Este plano muestra cómo una máquina Lean tendría que reproducir y comprobar el mismo conteo.

Una consulta con respuesta exacta

Regresemos a siete quintos. El camino y las dos aristas disjuntas se comparan con el mismo umbral. En el camino, la raíz positiva más grande queda entre ocho quintos y trece octavos. La otra queda entre tres quintos y cinco octavos. Los intervalos negativos son los reflejos. Las cuatro raíces son simples, y solo el intervalo de la mayor queda por encima de siete quintos. En el otro grafo, el polinomio es te al cuadrado menos uno, todo al cuadrado. Las raíces menos uno y uno tienen multiplicidad dos. En siete quintos, el resultado es cero. Si el umbral es uno, la raíz doble igual al umbral queda excluida por la comparación estricta. Con tres cuartos, la raíz doble contribuye dos. El mismo atlas puede responder la nueva pregunta sin volver a aproximar las raíces. Estos ejemplos tienen cálculo exacto. Para datos generales todavía queda conectarlo al comprobador Lean de procedencia, factores y conteos.

Qué condiciones cierran la máquina

Cada pieza debe cerrar una obligación que cambie la respuesta, la cobertura o el diagnóstico. Si no cambia ninguna, se queda fuera. La ficha sesenta y ocho transporta el polinomio de emparejamientos al característico de adyacencia para bosques. La conectamos solo si la consulta necesita ese espectro. El prototipo de la cúbica ya tiene comprobación Lean. El atlas tiene cálculos exactos para los ejemplos y adaptadores formales pendientes. La prueba del diseño será aceptar el mismo conteo sobre un banco de grafos y rechazar un coeficiente cambiado, una raíz omitida y una multiplicidad falsa. Prueba el umbral en la simulación y descarga la prueba Lean de la familia. Una salida reproducible y un diagnóstico convierten las piezas en una máquina.

Design a mathematical machine

From a parameter to evidence, a Lean proof, and a diagnostic.

Chapters
Transcript

A question for the atlas

These graphs have four vertices. How many roots of their matching polynomials lie above seven fifths, counting multiplicities? We will design an atlas to answer that question. Each component must contribute to the count, coverage, or diagnosis. First try the method on a cubic. Its Lean proof is small, and it shows how to turn input conditions into a uniform guarantee.

Set the output before searching

For this cubic, p_c(t), the input is a real number c. The output we want is a proof of at least three distinct real roots. Look at the obligations that card opens. Supply a nonzero polynomial, four strictly increasing points, and a negative product for each pair of neighboring evaluations.

From exploration to exact evidence

Our four witnesses are minus two, minus one, one and two. Move c and the curve changes, while those four sample locations stay put. Evaluate exactly. The first value is c minus two, the second is c plus two, and those same two values repeat in that order. To get minus, plus, minus, plus, require c minus two to be negative and c plus two positive. This is equivalent to minus two less than c less than two.

Read the checked proof

Here is the checked theorem. It keeps a real parameter and takes the two strict bounds. Its conclusion asserts at least three distinct roots. Apply the alternating-sign theorem to the nonzero polynomial and the witness vector. Two holes remain, one for the ordering and another for the signs. The card turns those facts into three disjoint intervals containing roots. Lean checks a single declaration for every c satisfying its assumptions. We tried a Newton branch. It checks, but substituting the coefficients reduces it to zero at least minus twenty-seven. We leave that branch out of the machine.

A diagnostic that guides repair

The polynomial and its goal stay the same, but one evaluation becomes zero. The diagnostic can identify the first product that is no longer negative. Now set c to two with the original witnesses. The product fails for a different reason. We have reached the boundary of the uniform proof. At the boundary we have a different proof. The factorization into t minus one squared times t plus two exhibits a double root. Lean checks the identity by expansion.

Transfer the method to the atlas

Return to the atlas. The input is a graph and a rational threshold. We want disjoint intervals, multiplicities, and the number of roots strictly above the threshold. Work backwards: obtain the coefficients from the graph, bound the search, justify the counts, and prove coverage. This actual Excovery query, from a polynomial to a root count, proposes the Budan Fourier bound among other candidates. A bound can rule out intervals. But our answer also requires an exact count with multiplicities. Select a rule by that guarantee. If the bridge from graph to coefficients remains open, a proof about that polynomial does not yet answer the graph question.

The atlas components

The matching polynomial uses counts of disjoint edge sets of each size as coefficients, with alternating signs. The four-vertex path has three edges and one two-edge matching. Its polynomial is t to the fourth minus three t squared plus one. Two disjoint edges give another polynomial, t to the fourth minus two t squared plus one. Heilmann and Lieb's results in cards sixty-nine and seventy give real roots and a degree-based bound. With maximum degree at most two, start from minus two to two. Sturm certifies exact counts for square-free factors. If an endpoint is itself a root, check that zero and record it separately. The factors, raised to their multiplicities, must recover the polynomial. With real splitting established, the weighted counts must sum to its degree. Each piece has a concrete job: establish the input data, decide where to search, or prove that the atlas is complete.

Certify the interval count

Let's check the count for the four-vertex path. We want roots strictly above seven fifths. The global bound is two and the polynomial at two is five, so we can use two as the upper endpoint. Sturm works on a finite interval. Card thirteen needs a square-free factor, ordered endpoints, and neither endpoint can be a root of that factor. Start the sequence with the polynomial and its derivative. Each step appends the negative remainder of the preceding division. These are the five polynomials for the path. Evaluate the sequence. At seven fifths, a minus sign is followed by four plus signs. At two every sign is positive. The variation difference is one minus zero. That is why the interval contains one root. Since the factor occurs once, the weighted count is also one. For two disjoint edges, the factor t squared minus one occurs twice. At a threshold of one, the endpoint is a root, so the Sturm hypothesis needs attention. Record one as an exact point of multiplicity two, exclude it from the strict query, and remove its linear factor before counting the remaining roots. The remaining factor no longer vanishes at the endpoint. The prototype computes the coefficients two ways and uses exact arithmetic for the count. This panel shows how a Lean machine would reproduce and check that count.

A query with an exact answer

Return to seven fifths. Compare the path and the two disjoint edges at the same threshold. For the path, the largest positive root lies between eight fifths and thirteen eighths. The other lies between three fifths and five eighths. The negative intervals are reflections. All four roots are simple, and only the largest interval lies above seven fifths. In the other graph, the polynomial is t squared minus one, squared. The roots minus one and one each have multiplicity two. At seven fifths the count is zero. If the threshold is one, the double root at the threshold is excluded by strict comparison. At three quarters, the double root contributes two. The same atlas can answer the new question without approximating the roots again. These worked examples have exact calculations. For general inputs, those calculations still need to be wired to Lean checks of origin, factors, and counts.

What completes the machine

Each piece must close an obligation that affects the answer, coverage, or diagnosis. Otherwise leave it out. Card sixty-eight transfers the matching polynomial to the adjacency characteristic polynomial for forests. Connect it only if the query needs that spectrum. The cubic prototype already has a Lean check. The atlas has exact worked examples and formal adapters still to build. Test the design by accepting the same counts on a suite of graphs and rejecting an altered coefficient, an omitted root, and a false multiplicity. Try a threshold in the simulation and download the Lean proof for the family. A reproducible result and a diagnostic turn the pieces into a machine.