Algebra and coalgebra in polynomial differential equations 1 Michele Boreale D I SIA - University of Florence OPTC 2017 IST Vienna, June 27, 2017 1 (Based on work appeared in FoSSaCS17’) M. Boreale (D I SIA - University of Florence) Algebra and coalgebra in polynomial differential equations OPTC 2017 IST Vienna, June 27, 2017 1 / 17
Systems of polynomial ODE ’s Initial Value Problems (IVP) � ˙ = F ( x ) F = vector field x = ( x 1 ,..., x N ) = variables x x ( 0 ) = x 0 = initial conditions x 0 Hybrid systems ˙ x ( t ) = x ( t ) z ( t )+ z ( t ) Markov chains ˙ y ( t ) = y ( t ) w ( t )+ z ( t ) System Biology ˙ z ( t ) = z ( t ) Fluid-flow approximations of ˙ w ( t ) = w ( t ) stochastic systems x ( 0 ) = x 0 = ( 0 , 0 , 1 , 1 ) ... M. Boreale (D I SIA - University of Florence) Algebra and coalgebra in polynomial differential equations OPTC 2017 IST Vienna, June 27, 2017 2 / 17
Motivations and goals Reasoning . Prove and automatically discover conservation laws of the system ˙ θ = ω g ω ˙ = ℓ x 1 2 m · ( ℓ ω ) 2 = m · y θ ˙ = − y · ω ⇒ x kinetic energy = lost potential energy ˙ = x · ω y x ( 0 ) = ( 0 , 0 ,ℓ, 0 ) Reduction. Minimize number of variables and equations ˙ x = x · z + z ˙ y = y · w + z ˙ = z z = ⇒ ? ˙ = w w x ( 0 ) = ( 0 , 0 , 1 , 1 ) M. Boreale (D I SIA - University of Florence) Algebra and coalgebra in polynomial differential equations OPTC 2017 IST Vienna, June 27, 2017 3 / 17
Example: safety assertions (e.g. in hybrid systems) If x 0 ∈ ψ then x ( t ) ∈ φ In this talk: - ψ is a singleton - φ is an algebraic variety = common zeros of a set of polynomials. Challenge Can we put coalgebra to use to pursue these goals? M. Boreale (D I SIA - University of Florence) Algebra and coalgebra in polynomial differential equations OPTC 2017 IST Vienna, June 27, 2017 4 / 17
Semantics of Initial Value Problems Semantic domain: analytic functions A def = { f : R → R | f admits a Taylor expansion in a neighborhood of 0 } . Theorem (Picard-Lindelöf) Every polynomial IVP has a unique solution x ( t ) = ( x 1 ( t ) ,..., x N ( t )) , with x i ( t ) ∈ A . x ( t ) : R → R N is the system’s trajectory M. Boreale (D I SIA - University of Florence) Algebra and coalgebra in polynomial differential equations OPTC 2017 IST Vienna, June 27, 2017 5 / 17
Coalgebraic semantics of IVP On polynomials R [ x ] , Lie derivatives are the syntactic counterpart of (time) derivatives on A : d dt ( · ) in A ↔ L F ( · ) in R [ x ] L ( xy ) = L ( x ) y + x L ( y ) = ( xz + z ) y + x ( wy + z ) o ( xy ) = x 0 · y 0 = 0 C = ( R [ x ] , L ( · ) , o ( · )) forms a coalgebra over polynomials. Theorem (Coinduction) x i ∼ x j in C if and only if x i ( t ) = x j ( t ) in A (can be extended to polynomial expressions). Proof : x i ∼ x j means x i ( t ) and x j ( t ) have the same Taylor expansion. M. Boreale (D I SIA - University of Florence) Algebra and coalgebra in polynomial differential equations OPTC 2017 IST Vienna, June 27, 2017 6 / 17
� � Proving identities via bisimulation � ˙ x = − y Prove x 2 + y 2 ∼ 1 with R = � ( x 2 + y 2 , 1 ) , ( 0 , 0 ) � ˙ y = x . ( x ( 0 ) , y ( 0 )) = ( 1 , 0 ) � x 2 + y 2 , 1 ) L L � − 2 xy + 2 yx = 0 , 0 ) = ( 0 , 0 ) This is the familiar cos 2 ( t )+sin 2 ( t ) = 1. This technique can be enhanced with up to techniques à la Sangiorgi. M. Boreale (D I SIA - University of Florence) Algebra and coalgebra in polynomial differential equations OPTC 2017 IST Vienna, June 27, 2017 7 / 17
Mechanizing proofs of equivalence x 2 ( t )+ y 2 ( t ) = 1 p ( t ) def = x 2 ( 2 )+ y 2 ( t ) − 1 is identically zero p ( t ) = p ( x 0 )+ p ( 1 ) ( x 0 ) t + p ( 2 ) ( x 0 ) t 2 + p ( 3 ) ( x 0 ) t 3 + ··· 2 3 ! Equivalently p ( j ) ( x 0 ) = 0 for each j ≥ 0 M. Boreale (D I SIA - University of Florence) Algebra and coalgebra in polynomial differential equations OPTC 2017 IST Vienna, June 27, 2017 8 / 17
� � � An algorithm for of equivalence checking/1 ˙ x = x · z + z ˙ = y · w + z y ˙ = Prove x ( t ) = y ( t ) . z z ˙ = w w x ( 0 ) = x 0 = ( 0 , 0 , 1 , 1 ) p = x − y p ( x 0 ) = 0 L p ( 1 ) = p ( 1 ) ( x 0 ) = 0 xz + z − yw + z L p ( 2 ) = xz 2 + xz + z 2 − yw 2 + yw + wz p ( 2 ) ( x 0 ) = 0 L p ( 3 ) = h 1 · p + h 2 · p ( 1 ) + h 3 · p ( 2 ) p ( 2 ) ( x 0 ) = 0 So p ( j ) ( x 0 ) = 0 for all j ≥ 3 M. Boreale (D I SIA - University of Florence) Algebra and coalgebra in polynomial differential equations OPTC 2017 IST Vienna, June 27, 2017 9 / 17
An algorithm for of equivalence checking/2 p ( t ) def = p ( x ( t )) e ( t ) = f ( t ) iff p ( t ) def = ( e ( t ) − f ( t )) is identically 0: p is a polynomial invariant Algorithm to check if p is an invariant Consider p , p ( 1 ) , p ( 2 ) ,... . Stop when reaching m such that either: a. p ( m ) ( x 0 ) � = 0: return NO b. p ( m + 1 ) ∈ Ideal � � { p , p ( 1 ) ,..., p ( m ) } : return YES . Ideal For S = { p 1 ,..., p m } , the set Ideal ( S ) contains all sums ∑ i h i · p i ( h i polynomials) M. Boreale (D I SIA - University of Florence) Algebra and coalgebra in polynomial differential equations OPTC 2017 IST Vienna, June 27, 2017 10 / 17
Underlying algebraic geometry Ideal membership p ∈ Ideal ( S ) can be decided: compute a Gröbner basis G for Ideal ( S ) (Buchberger algorithm) and check if p mod G = 0. Ascending chain condition (ASC) Any infinite ascending chain of ideals I 1 ⊆ I 2 ⊆ I 3 ⊆ ··· stabilizes in a finite number of steps (from Hilbert basis theorem). So the given procedure to check invariants is effective and always terminates. M. Boreale (D I SIA - University of Florence) Algebra and coalgebra in polynomial differential equations OPTC 2017 IST Vienna, June 27, 2017 11 / 17
Discovering polynomial invariants (p.i.) Polynomial template : π = ∑ n i = 1 a i · α i ( a i parameters , α i monomials) Theorem (finding invariants) There is an algorithm that, given an IVP and a template π , returns π ′ , the most general instance of π all of whom instances are valid p.i. Proof : L ( j ) ( π )( x 0 ) = 0, j = 0 , 1 , 2 ,... , imply successive constraints on the parameters space R n , until stabilization. For instance, one can find all polynomial invariants (= conservation laws) up to a given degree. Example . Find all invariants of degree ≤ 2 of the pendulum equation: + a 2 · ( 1 π ′ = a 1 · � x 2 + y 2 − ℓ 2 � 2 ( ℓ · ω ) 2 − g · y ) � �� � � �� � Pythagorean identity energy conservation Values of a 1 , a 2 can be chosen arbitrarily. M. Boreale (D I SIA - University of Florence) Algebra and coalgebra in polynomial differential equations OPTC 2017 IST Vienna, June 27, 2017 12 / 17
Minimization Algorithm 1. compute a basis B of W = span { x ( t ) : t in a neighborhood of 0 } 2. work out equations for the coordinates y ( t ) of x ( t ) in W y = BF ( B T x ) y ( 0 ) = B T x 0 ˙ Basically, we project the system onto the subspace W spanned by x ( t ) . Theorem (minimality) x ( t ) = B y ( t ) . Moreover y ( t ) has min- imal no. of components among all z ( t ) ’s s.t. x ( t ) = C · z ( t ) . ˙ = x · z + z x − 1 1 ˙ = y · w + z ˙ = 2 y 1 · y 2 + y 2 y y 1 √ 0 1 1 0 − 1 ˙ = ˙ = z z = ⇒ y 2 y 2 ˙ = w w √ 2 ) T . y ( 0 ) = ( 0 , ( 0 , 0 , 1 , 1 ) T x ( 0 ) = M. Boreale (D I SIA - University of Florence) Algebra and coalgebra in polynomial differential equations OPTC 2017 IST Vienna, June 27, 2017 13 / 17
Conclusion Contributions : (co)algebraic methods to (1) reason on (prove & discover identities) and (2) reduce systems of polynomial ODE ’s Preliminary experimentation & implementation, check out at local.disia.unifi.it/boreale/papers/DoubleChain.py Related work : relation with weighted automata and bisimulation: see Boreale (CONCUR’09,ICALP’15), Bonchi et al. (I&C’12) Cardelli et al. differential equivalences (POPL ’16): partition of variables into equivalence classes; less general than projection ⇒ finer equivalence Platzer et al. dynamic logic for hybrid systems (e.g. TACAS’14): related goals, very different computational prerequisites, not (relatively) complete in our sense. Further work : further experimentation (algebraic) regions of initial values rather than just IVP: relevant to hybrid systems approximate linearization and reduction, akin to methods in Control Theory. M. Boreale (D I SIA - University of Florence) Algebra and coalgebra in polynomial differential equations OPTC 2017 IST Vienna, June 27, 2017 14 / 17
Recommend
More recommend