+
    ‹°³j¥�  ã                   óh  € R t ^ RIt^ RIHtHtHt ^ RIHt ^ RIH	t	 ^ RI
HtHtHtHt ^ RIHtHt ^ RIHtHtHtHt ^ RIHt ^ R	IHt ^ R
IHt ^ RIHt ^ RIH t H!t!H"t" ^ RI#H$t$ ^ RI%H&t&H't' ^ RI(H)t)H*t* ^ RI+H,t, R t-R t.R t/RR lt0R t1R t2R]Pf                  R3R lt4R t5RR lt6R t7. 3R lt8R# ) z<Tools for solving inequalities and systems of inequalities. N)Úcontinuous_domainÚperiodicityÚfunction_range)Úsympify)Úfactor_terms)Ú
RelationalÚLtÚGeÚEq)ÚSymbolÚDummy)ÚIntervalÚ	FiniteSetÚUnionÚIntersection)ÚS)Ú
expand_mul)ÚAbs)ÚAnd)ÚPolyÚPolynomialErrorÚparallel_poly_from_expr)Ú_nsort)ÚsolvifyÚsolveset)ÚsiftÚiterable)Ú
filldedentc           
     óT  € \        V \        4      '       g   \        R4      hV P                  4       P                  '       dx   \        V P                  4       ^ V4      pV\        P                  J d   \        P                  .# V\        P                  J d   \        P                  .# \        RV,          4      hV P                  RR7      . rCVR8X  d*   V F!  w  rV\        WU4      pVP                  V4       K#  	  V# VR8X  dV   \        P                  pV\        P                   ^3.,            F%  w  r–\        W‰RR4      pVP                  V4       T	pK'  	  V# V P#                  4       ^ 8”  d   ^p
MRp
RRrËVR	8X  d   ^pM2VR
8X  d   RpM(VR8X  d   ^RrËMVR8X  d   RRrËM\        RV,          4      h\        P                   RrÙ\%        V4       F¥  w  rŽV^,          '       d5   W«8X  d#   VP'                  ^ \        W‰V'       * V4      4       V
) YŒ'       * rÙp
KH  W«8X  d+   V'       g#   VP'                  ^ \        W‰RV4      4       TRrÙKx  W«8w  g   K€  V'       g   KŠ  VP'                  ^ \        Wˆ4      4       K§  	  W«8X  d-   VP'                  ^ \        \        P                  V	RV4      4       V# )aÚ  Solve a polynomial inequality with rational coefficients.

Examples
========

>>> from sympy import solve_poly_inequality, Poly
>>> from sympy.abc import x

>>> solve_poly_inequality(Poly(x, x, domain='ZZ'), '==')
[{0}]

>>> solve_poly_inequality(Poly(x**2 - 1, x, domain='ZZ'), '!=')
[Interval.open(-oo, -1), Interval.open(-1, 1), Interval.open(1, oo)]

>>> solve_poly_inequality(Poly(x**2 - 1, x, domain='ZZ'), '==')
[{-1}, {1}]

See Also
========
solve_poly_inequalities
z8For efficiency reasons, `poly` should be a Poly instanceú%could not determine truth value of %sF)Úmultipleú==ú!=TNÚ>Ú<ú>=ú<=z'%s' is not a valid relationéÿÿÿÿ)Ú
isinstancer   Ú
ValueErrorÚas_exprÚ	is_numberr   r   ÚtrueÚRealsÚfalseÚEmptySetÚNotImplementedErrorÚ
real_rootsr   ÚappendÚNegativeInfinityÚInfinityÚLCÚreversedÚinsert)ÚpolyÚrelÚtÚrealsÚ	intervalsÚrootÚ_ÚintervalÚleftÚrightÚsignÚeq_signÚequalÚ
right_openÚmultiplicitys   &&             Ú[/home/luca/screen-checking/.venv/lib/python3.14/site-packages/sympy/solvers/inequalities.pyÚsolve_poly_inequalityrH      sq  € ô, �dœD×!Ò!ÜØFóHð 	Hà‡|�|ƒ~××ÐÜ�t—|‘|“~ q¨#Ó.ˆØ”—‘‹;Ü—G‘G�9ÐØ”!—'‘'‹\Ü—J‘J�<Ðä%Ø7¸!Õ;ó=ð =ð —‘°�Ó6¸ˆ9à
ˆd„{Û‰GˆDÜ Ó+ˆHØ×Ñ˜XÖ&ñ ðd Ðð_ 
�ŒÜ×!Ñ!ˆà¤!§*¡*¨a Ð 1×1Ð1‰HˆEÜ ¨T°4Ó8ˆHØ×Ñ˜XÔ&ØŠDñ 2ðX ÐðO �7‰7‹9�qŒ=Ø‰DàˆDà˜u�à�#Œ:Ø‰GØ�CŒZØ‰GØ�DŒ[Ø ‘UØ�DŒ[Ø ‘UäÐ;¸cÕAÓBÐBäŸJ™J¨ˆzä"*¨5¦/ÑˆDØ˜a×ÔØ”?Ø×$Ñ$Øœ8 D°U´¸JÓGôIð ,0¨%°´y˜Z�™Zà”?¯5Ø×$Ñ$Øœ8 D°°zÓBôDà(,¨dš:Ø–_¯©Ø×$Ñ$ Q¬°Ó(<Ö=ñ #2ð Œ?Ø×ÑØ”8œA×.Ñ.°°t¸ZÓHôJð Ðó    c           
     ób   € \        V  UUu. uF  p\        V!   F  q"NK  	  K  	  upp!  # u uppi )au  Solve polynomial inequalities with rational coefficients.

Examples
========

>>> from sympy import Poly
>>> from sympy.solvers.inequalities import solve_poly_inequalities
>>> from sympy.abc import x
>>> solve_poly_inequalities(((
... Poly(x**2 - 3), ">"), (
... Poly(-x**2 + 1), ">")))
Union(Interval.open(-oo, -sqrt(3)), Interval.open(-1, 1), Interval.open(sqrt(3), oo))
)r   rH   )ÚpolysÚpÚss   &  rG   Úsolve_poly_inequalitiesrN   q   s0   € ô ™eÔG™e˜Ô-BÀAÔ-F¨’1Ñ-F‘1™eÒGÑHÐHùÓGs   ‹+
c                ó‚  € \         P                  pV  EF'  pV'       g   K  \        \         P                  \         P                  4      .pV FÐ  w  w  rEp\        WE,          V4      p\        VR4      p. p	\        P                  ! Ws4       F=  w  r«V
P                  V4      pV\         P                  Jg   K,  V	P                  V4       K?  	  T	p. p	V F;  pV F  pW½,          pK  	  V\         P                  Jg   K*  V	P                  V4       K=  	  T	pV'       d   KÐ   M	  V F  pVP                  V4      pK  	  EK*  	  V# )aó  Solve a system of rational inequalities with rational coefficients.

Examples
========

>>> from sympy.abc import x
>>> from sympy import solve_rational_inequalities, Poly

>>> solve_rational_inequalities([[
... ((Poly(-x + 1), Poly(1, x)), '>='),
... ((Poly(-x + 1), Poly(1, x)), '<=')]])
{1}

>>> solve_rational_inequalities([[
... ((Poly(x), Poly(1, x)), '!='),
... ((Poly(-x + 1), Poly(1, x)), '>=')]])
Union(Interval.open(-oo, 0), Interval.Lopen(0, 1))

See Also
========
solve_poly_inequality
r!   )r   r/   r   r3   r4   rH   Ú	itertoolsÚproductÚ	intersectr2   Úunion)ÚeqsÚresultÚ_eqsÚglobal_intervalsÚnumerÚdenomr9   Únumer_intervalsÚdenom_intervalsr<   Únumer_intervalÚglobal_intervalr?   Údenom_intervals   &             rG   Úsolve_rational_inequalitiesr_   ‚   s%  € ô. �Z‰Z€FäˆßÙä$¤Q×%7Ñ%7¼¿¹ÓDÐEÐã#'Ñ‰NˆU˜CÜ3°EµKÀÓEˆOÜ3°E¸4Ó@ˆOàˆIä3<×3DÒ3DØ#ö47Ñ/�à)×3Ñ3°OÓD�à¤1§:¡:Õ-Ø×$Ñ$ XÖ.ñ47ð  )ÐàˆIã#3�Û&5�NØ#Õ5’Oñ '6ð #¬!¯*©*Õ4Ø×$Ñ$ _Ö5ñ $4ð  )Ðç#Ñ#Ùñ7 $(ó: )ˆHØ—\‘\ (Ó+ŠFô )ñG ðL €MrI   Tc                óÄ  € Rp. p\         P                  pV  EF`  pV'       g   K  . p\         P                  pV EF¶  p	\        V	\        4      '       d   V	w  ršM=V	P
                  '       d*   V	P                  V	P                  ,
          V	P                  r©MRp
V	\         P                  J d#   \         P                  \         P                  Rr¬pMVV	\         P                  J d#   \         P                  \         P                  Rr¬pM V	P                  4       P                  4       w  r¼ \        W¼3V4      w  w  r¼pTP$                  P&                  '       g"   TP)                  4       TP)                  4       Rr<pTP$                  P+                  4       pTP,                  '       g?   TP.                  '       g-   Y¼,          p	\1        T	^ T
4      p	T\3        Y‘RR7      ,          pEK¢  TP5                  Y¼3T
34       EK¹  	  V'       dt   V\7        V.4      ,          p\7        V UUUUu. uF:  qÿ F2  w  w  pppVP9                  V4      '       g   K"  VVP:                  3R3NK4  	  K<  	  upppp.4      pVV,          pWX,          pEKc  	  V'       g   V'       d   VP=                  4       pV'       d   VP?                  V4      pV#   \          d    \!        \#        R4      4      hi ; iu uppppi )aè  Reduce a system of rational inequalities with rational coefficients.

Examples
========

>>> from sympy import Symbol
>>> from sympy.solvers.inequalities import reduce_rational_inequalities

>>> x = Symbol('x', real=True)

>>> reduce_rational_inequalities([[x**2 <= 0]], x)
Eq(x, 0)

>>> reduce_rational_inequalities([[x + 2 > 0]], x)
-2 < x
>>> reduce_rational_inequalities([[(x + 2, ">")]], x)
-2 < x
>>> reduce_rational_inequalities([[x + 2]], x)
Eq(x, -2)

This function find the non-infinite solution set so if the unknown symbol
is declared as extended real rather than real then the result may include
finiteness conditions:

>>> y = Symbol('y', extended_real=True)
>>> reduce_rational_inequalities([[y + 2 > 0]], y)
(-2 < y) & (y < oo)
Tr!   z„
                    only polynomials and rational functions are
                    supported in this context.
                    F)Ú
relational) r   r/   r-   r(   ÚtupleÚis_RelationalÚlhsÚrhsÚrel_opr,   ÚZeroÚOner.   ÚtogetherÚas_numer_denomr   r   r   ÚdomainÚis_ExactÚto_exactÚ	get_exactÚis_ZZÚis_QQr   Úsolve_univariate_inequalityr2   r_   ÚhasÚoneÚevalfÚas_relational)ÚexprsÚgenra   ÚexactrT   ÚsolutionÚ_exprsrV   Ú_solÚexprr9   rX   rY   Úoptrk   ÚiÚnÚdr>   Úexcludes   &&&                 rG   Úreduce_rational_inequalitiesr‚   Ä   s]  € ð: €EØ
€CÜ�z‰z€HÜˆßÙØˆÜ�w‰wˆÜˆDÜ˜$¤×&Ò&Ø ‘	��cà×%×%Ð%Ø $§¡¨4¯8©8Õ 3°T·[±[™#à�Cà”q—v‘v‹~Ü$%§F¡F¬A¯E©E°4˜c�˜cØœŸ™“Ü$%§E¡E¬1¯5©5°$˜c�˜cà#Ÿ}™}›×=Ñ=Ó?‘�ðÜ&=Ø�N Có')Ñ#‘� ð —:‘:×&×&Ð&Ø&+§n¡nÓ&6¸¿¹Ó8HÈ%˜e�à—Z‘Z×)Ñ)Ó+ˆFà—L—L�L F§L§L LØ•{�Ü! $¨¨3Ó/�ØÔ3°DÈ%ÔPÕP“à—‘˜e˜^¨SÐ1×2ñG ÷J ØÔ/°°Ó7Õ7ˆDÜ1Ùö4AÙ�A²¡¡& 1 a¨!°Q·U±U¸3·Zô 5G°a¸¿¹°ZÀÓ4FÙ01ñ 5GÙô4Að 3Bó CˆGà�G�OˆDàÕ‹ña ÷d —XØ—>‘>Ó#ˆçØ×)Ñ)¨#Ó.ˆà€OøôA #ô Ü%¤jð 2ó 'ó ð ðüõ(4As   Ä"J7È#KÉKÊ7 Kc                ó>  a€ VP                   RJ d   \        \        R4      4      hV3R loRRRR/p. pS! V 4       FT  w  rWP                  4       9  d   \	        V ^ V4      p M\	        V ) ^ W1,          4      p VP                  V .V,           4       KV  	  \        WB4      # )a]  Reduce an inequality with nested absolute values.

Examples
========

>>> from sympy import reduce_abs_inequality, Abs, Symbol
>>> x = Symbol('x', real=True)

>>> reduce_abs_inequality(Abs(x - 5) - 3, '<', x)
(2 < x) & (x < 8)

>>> reduce_abs_inequality(Abs(x + 2)*3 - 13, '<', x)
(-19/3 < x) & (x < 7/3)

See Also
========

reduce_abs_inequalities
Fzs
            Cannot solve inequalities with absolute values containing
            non-real variables.
            c                 ó6  <a€ . pV P                   '       g   V P                  '       dv   V P                  pV P                   FW  pS	! V4      pV'       g   TpK  \        P
                  ! W4       U UUUu. uF  w  w  rw  rgV! W4      WW,           3NK  	  pppp pKY  	  V# V P                  '       dW   V P                  oSP                  '       g   \        R 4      hVP                  V3R lS	! V P                  4       4       4       V# \        V \        4      '       dq   S	! V P                  ^ ,          4      pV FO  w  rVP                  W\        V ^ 4      .,           34       VP                  V ) V\!        V ^ 4      .,           34       KQ  	  V# V . 3.pV# u upppp i )z'Only Integer Powers are allowed on Abs.c              3   ó>   <"  € T F  w  rVS,          V3x € K  	  R # 5i©N© )Ú.0r|   Úcondsr   s   &  €rG   Ú	<genexpr>ÚAreduce_abs_inequality.<locals>._bottom_up_scan.<locals>.<genexpr>L  s   øé € ÐXÑ=W©k¨d˜$ �' 5Õ)Ó=Wùs   ƒ)Úis_AddÚis_MulÚfuncÚargsrP   rQ   Úis_PowÚexpÚ
is_Integerr)   ÚextendÚbaser(   r   r2   r	   r   )
r|   rv   ÚopÚargrz   r‰   Ú_exprÚ_condsr   Ú_bottom_up_scans
   &       @€rG   r™   Ú.reduce_abs_inequality.<locals>._bottom_up_scan9  sa  ù€ Øˆà�;�;ˆ;˜$Ÿ+Ÿ+˜+Ø—‘ˆBà—y”y�Ù(¨Ó-�çØ"’Eô &×-Ò-¨eÔ<ö>Ù<ñ DbÁ=ÀDÑRaÐSX™b ›o¨u­~Ó>Ù<ð ó >‘Eñ !ð. ˆð �[�[ˆ[Ø—‘ˆAØ—<—<�<Ü Ð!JÓKÐKà�L‰LÔX¹_ÈTÏYÉYÔ=WÓXÔXð ˆô ˜œc×"Ò"Ù$ T§Y¡Y¨q¥\Ó2ˆFã%‘�Ø—‘˜t¬b°°q«k¨]Õ%:Ð;Ô<Ø—‘˜t˜e U¬b°°q«k¨]Õ%:Ð;Ö<ñ  &ð ˆð ˜B�Z�LˆEàˆùõ#>s   Á3 Fr$   r#   r&   r%   )Úis_extended_realÚ	TypeErrorr   Úkeysr   r2   r‚   )r|   r9   rw   ÚmappingÚinequalitiesr‰   r™   s   &&&   @rG   Úreduce_abs_inequalityr      s¤   ø€ ð( ×Ñ˜uÓ$Üœ
ð $ó ó ð 	õ
ð> �C˜˜tÐ$€GØ€Lá& tÖ,‰ˆØ—l‘l“nÔ$Ü˜t Q¨Ó,‰Dä˜t˜e Q¨­Ó5ˆDà×Ñ˜T˜F U�NÖ+ñ -ô (¨Ó:Ð:rI   c                ó\   € \        V  UUu. uF  w  r#\        W#V4      NK  	  upp!  # u uppi )aÜ  Reduce a system of inequalities with nested absolute values.

Examples
========

>>> from sympy import reduce_abs_inequalities, Abs, Symbol
>>> x = Symbol('x', extended_real=True)

>>> reduce_abs_inequalities([(Abs(3*x - 5) - 7, '<'),
... (Abs(x + 25) - 13, '>')], x)
(-2/3 < x) & (x < 4) & (((-oo < x) & (x < -38)) | ((-12 < x) & (x < oo)))

>>> reduce_abs_inequalities([(Abs(x - 4) + Abs(3*x - 5) - 7, '<')], x)
(1/2 < x) & (x < 4)

See Also
========

reduce_abs_inequality
)r   r    )rv   rw   r|   r9   s   &&  rG   Úreduce_abs_inequalitiesr¢   f  s:   € ô* Ùô!Ù‰IˆDô (¨°3Ö7Ùò!ñ "ð "ùó !s   ‹(
Fc                ó$  a aa)€ ^ RI Hp VP                  \        P                  4      RJ d   \        \        R4      4      hV\        P                  Jd:   \        S SRVR7      P                  V4      pV'       d   VP                  S4      pV#  SpTpSP                  RJ d,   \        P                  pV'       g   V# VP                  V4      # SP                  f"   \        RRR7      o S P                  VS/4      o RpS \        P                  J d   TpEM!S \        P                   J d   \        P                  pEMûS P"                  S P$                  ,
          p	\'        V	S4      p
V
\        P(                  8X  d\   \+        V	4      p	S P-                  V	^ 4      pV\        P                  J d   TpEMQV\        P                   J d   \        P                  pEM+V
Ee'   \/        V	SV4      pS P0                  pVR9   dY   S P-                  VP2                  ^ 4      '       d   TpM‘S P-                  VP4                  ^ 4      '       g   \        P                  pM^VR9   dX   S P-                  VP4                  ^ 4      '       d   TpM2S P-                  VP2                  ^ 4      '       g   \        P                  pVP4                  VP2                  rþWþ,
          \        P6                  J d    \9        ^ V
RR4      P;                  V4      pTpVEf3   V	P=                  4       w  pp SVP>                  9  d!   \A        V	P>                  4      ^8”  d   \B        h\E        V	SV4      pVf   \B        h \+        T	4      o)T)T T3R lp. pT! S S4       F  pTPK                  \E        TST4      4       K!  	  T'       g   \M        S)ST4      pRS P0                  9   ;'       d    S P0                  R8g  p \O        TPP                  \S        TP4                  TP2                  4      ,
          4      p\S        TT,           \U        T4      ,           !  P                  \9        TP4                  TP2                  TP4                  T9  TP2                  T9  4      4      p\V        ;QJ d    R T 4       F  '       d   K   RM	  RM! R T 4       4      '       d   \Y        TRR7      ^ ,          pMG\[        TR 4      pTR,          '       d   \
        h TR,          p\A        T4      ^8”  d   \]        T4      p\        P                  pS)P_                  \        P`                  4      ;p\        P(                  8w  Edÿ   Rp\S        4       p \c        TST4      p\e        T\8        4      '       gK   T FB  pTT9  g   K  T! T4      '       g   K  TP                  '       g   K0  T\S        T4      ,          pKD  	  EM2TP4                  TP2                  p!p \Y        T\S        T!4      ,           4       Fß  pT! T 4      p"T T!8w  dÌ   T! T4      p#\g        T T4      p$T$T9  d±   T$P                  '       dŸ   T! T$4      '       d‘   T"'       d   T#'       d   T\9        T T4      ,          pMlT"'       d    T\8        Ph                  ! T T4      ,          pMET#'       d    T\8        Pj                  ! T T4      ,          pMT\8        Pl                  ! T T4      ,          pTp Ká  	  T F  p%T\S        T%4      ,          pK  	   T\        P                  J d.   \C        \        RS PG                  ST4      : RT: R24      4      hTP;                  T4      p\        P                  .p&TP4                  p T T9   d;   T! T 4      '       d-   T Pn                  '       d   T&Pq                  \S        T 4      4       T Fš  p'T'p!T! \g        T T!4      4      '       d   T&Pq                  \9        T T!RR4      4       T'T9   d   TPs                  T'4       MET'T9   d   TPs                  T'4       T! T'4      p(MTp(T('       d   T&Pq                  \S        T'4      4       T!p Kœ  	  TP2                  p!T!T9   d;   T! T!4      '       d-   T!Pn                  '       d   T&Pq                  \S        T!4      4       T! \g        T T!4      4      '       d'   T&Pq                  \8        Pl                  ! T T!4      4       T\        P(                  8w  d   X'       d   TP;                  T4      pM$\u        \w        T&!  TT4      PG                  ST4      pV'       g   V# VP                  V4      #   \         d    \        \        R	4      4      hi ; i  \B        \
        3 d6    \        \        R
S PG                  S\I        R4      4      ,          4      4      hi ; i  \         d    \
        hi ; i  \
         d    \        R4      hi ; i  \         d    \        P                  pRp ELi ; i)a´  Solves a real univariate inequality.

Parameters
==========

expr : Relational
    The target inequality
gen : Symbol
    The variable for which the inequality is solved
relational : bool
    A Relational type output is expected or not
domain : Set
    The domain over which the equation is solved
continuous: bool
    True if expr is known to be continuous over the given domain
    (and so continuous_domain() does not need to be called on it)

Raises
======

NotImplementedError
    The solution of the inequality cannot be determined due to limitation
    in :func:`sympy.solvers.solveset.solvify`.

Notes
=====

Currently, we cannot solve all the inequalities due to limitations in
:func:`sympy.solvers.solveset.solvify`. Also, the solution returned for trigonometric inequalities
are restricted in its periodic interval.

See Also
========

sympy.solvers.solveset.solvify: solver returning solveset solutions with solve's output API

Examples
========

>>> from sympy import solve_univariate_inequality, Symbol, sin, Interval, S
>>> x = Symbol('x')

>>> solve_univariate_inequality(x**2 >= 4, x)
((2 <= x) & (x < oo)) | ((-oo < x) & (x <= -2))

>>> solve_univariate_inequality(x**2 >= 4, x, relational=False)
Union(Interval(-oo, -2), Interval(2, oo))

>>> domain = Interval(0, S.Infinity)
>>> solve_univariate_inequality(x**2 >= 4, x, False, domain)
Interval(2, oo)

>>> solve_univariate_inequality(sin(x) > 0, x, relational=False)
Interval.open(0, pi)

©ÚdenomsFz|
        Inequalities in the complex domain are
        not supported. Try the real domain by
        setting domain=S.Reals)ra   Ú
continuousNrw   T©Úextended_realz–
                When gen is real, the relational has a complex part
                which leads to an invalid comparison like I < 0.
                z…
                    The inequality, %s, cannot be solved using
                    solve_univariate_inequality.
                    Úxc                 ó¾  <€ SP                  S\        V 4      4      p SP                  V^ 4      pV\        P                  \        P
                  39   d   V# VP                  RJ d   \        P
                  # VP                  ^4      pVP                  '       d   SP                  V^ 4      # \        RV,          4      h  \         d    \        P
                  p L«i ; i)é    Fz!relationship did not evaluate: %s)Úsubsr   rŽ   rœ   r   r.   r,   r›   r   Úis_comparabler0   )r©   ÚvÚrÚ
expanded_er|   rw   s   &  €€€rG   ÚvalidÚ*solve_univariate_inequality.<locals>.valid  s·   ø€ ð —O‘O C¬°A«Ó7�ð ØŸ	™	 ! Q›�Að œŸ™¤§¡Ð)Ô)Ø�HØ×%Ñ%¨Ó.ÜŸ7™7�NàŸ™˜A›�AØ——�Ø#Ÿy™y¨¨A›Ð.ä-Ø;¸aÕ?óAð Aøô !ô  ÜŸ™’Að ús   žB> Â>CÃCÚ=r"   c              3   ó8   "  € T F  qP                   x € K  	  R # 5ir†   )r+   )rˆ   r¯   s   & rG   rŠ   Ú.solve_univariate_inequality.<locals>.<genexpr>@  s   é € Ð<©O q—{–{«Oùs   ‚)Ú	separatedc                 ó   € V P                   # r†   ©r›   )r©   s   &rG   Ú<lambda>Ú-solve_univariate_inequality.<locals>.<lambda>C  s
   € ¸Q×=OÒ=OrI   z'sorting of these roots is not supportedz
                        zZ contains imaginary parts which cannot be
                        made 0 for any value of zm satisfying the
                        inequality, leading to relations like I < 0.
                        )r$   r&   )r#   r%   )<Úsympy.solvers.solversr¥   Ú	is_subsetr   r-   r0   r   rq   Úintersectionru   r›   r/   r   Úxreplacerœ   r,   r.   rd   re   r   rg   r   rŽ   r   rf   ÚsupÚinfr4   r   rR   rj   Úfree_symbolsÚlenr)   r   r¬   r   r“   r   ÚsetÚboundaryr   ÚlistÚallr   r   ÚsortedÚcoeffÚImaginaryUnitr   r(   Ú_ptÚRopenÚLopenÚopenÚ	is_finiter2   Úremover   r   )*r|   rw   ra   rk   r¦   r¥   ÚrvÚ_genÚ_domainÚeÚperiodÚconstÚfranger9   rÀ   r¿   r   r€   Úsolnsr±   ÚsingularitiesÚ	include_xÚdiscontinuitiesÚcritical_pointsr;   ÚsiftedÚ	make_realÚcoeffIÚcheckÚim_solÚaÚzÚstartÚendÚvalid_startÚvalid_zÚptrM   Úsol_setsr©   Ú_validr°   s*   ff&&&                                    @rG   rq   rq     s)  ú€ õr -à×ÑœŸ™Ó  EÓ)Ü!¤*ð ."ó ##ó $ð 	$ð 
”q—w‘wÓ	Ü(Øˆc˜e°
ô<ß<H¹LÈÓ<Pð 	çØ×!Ñ! #Ó&ˆBØˆ	àð
 €DØ€GØ
×Ñ˜uÓ$Ü�Z‰Zˆß#ˆrÐ?¨×)9Ñ)9¸$Ó)?Ð?Ø	×	Ñ	Ò	%Ü�E¨Ô.ˆð	Ø—=‘= $¨ Ó-ˆDð 
€BàŒq�v‰vƒ~ØŠà	”—‘‹Ü�Z‰ZŠð �H‰H�t—x‘xÕˆÜ˜Q Ó$ˆØ”Q—V‘VÔÜ˜1“ˆAØ—I‘I˜a “OˆEØœŸ™‹Ø’Øœ!Ÿ'™'Ó!Ü—Z‘Z�ùØÓÜ# A s¨FÓ3ˆFà—+‘+ˆCØ�kÔ!Ø—9‘9˜VŸZ™Z¨×+Ò+Ø‘BØŸ™ 6§:¡:¨q×1Ò1ÜŸ™�Bøà˜Ô#Ø—9‘9˜VŸZ™Z¨×+Ò+Ø‘BØŸ™ 6§:¡:¨q×1Ò1ÜŸ™�Bà—z‘z 6§:¡:�Ø�yœAŸJ™JÓ&Ü! ! V¨U°DÓ9×CÑCÀGÓL�Ø �à‹:Ø×#Ñ#Ó%‰DˆAˆqð8Ø˜aŸn™nÔ,´°Q·^±^Ó1DÀqÔ1HÜ$Ð$ô    3¨Ó/�Ø’=ä$Ð$ð !ô $ A›ˆJ÷Að6 ˆMÙ˜D #Ö&�Ø×$Ñ$¤W¨Q°°VÓ%<Ö=ñ 'çÜ*¨:°s¸FÓC�à˜tŸ{™{Ñ*×BÐB¨t¯{©{¸dÑ/BˆIðUÜ"% f§o¡oÜ˜fŸj™j¨&¯*©*Ó5õ'6ó #7�ô #,¨e°mÕ.CÄdØ#óG%õ /%ñ #'ß'3¡|Ü˜VŸZ™Z¨¯©Ø—J‘J fÑ,¨f¯j©jÀÑ.FóHó(Ið  ÷ “3Ñ<©OÓ<—3—3’3Ñ<©OÓ<×<Ò<Ü" ?¸dÔCÀAÕF‘Eä! /Ñ3OÓP�FØ˜d—|”|ô 2Ð1ð2Ø & t¥˜Ü˜u›:¨œ>Ü$*¨5£M˜Eô Ÿ™ˆIØ$×*Ñ*¬1¯?©?Ó;Ð;�ÄÇÁÕFØ�Ü"›�ð"Ü  ¨¨fÓ5�AÜ% a¬×2Ò2Û!"˜AØ ¨Ö5¹%À¿(¼(Àq×GY×GYÒGYØ &¬)°A«,Õ 6¢ó "#ð &'§U¡U¨A¯E©E˜s˜Ü!'¨¼)ÀC».Õ(HÖ!I˜AÙ*/°«,˜KØ$¨œ|Ù*/°«( Ü%(¨°£] Ø#%¨]Ô#:¸r×?R×?RÐ?RÑW\Ð]_×W`ÒW`ß'2·wØ(.´(¸5À!Ó2DÕ(D©ß)4Ø(.´(·.².ÀÈÓ2JÕ(J©ß)0Ø(.´(·.².ÀÈÓ2JÕ(J©à(.´(·-²-ÀÀqÓ2IÕ(I¨Ø$%šEñ "Jó "/˜AØ"¤i°£lÕ2šFò "/ð œQŸZ™ZÓ'Ü$¥Zð !%§	¡	¨#¨tÖ 4³dð	1<ó &=ó >ð >ð &×/Ñ/°Ó7�	äŸ
™
�|ˆHà—J‘JˆEØ˜Œ¡5¨§<¢<°E·O·O°OØ—‘¤	¨%Ó 0Ô1ã�Ø�áœ˜U C›×)Ò)Ø—O‘O¤H¨U°C¸¸tÓ$DÔEà˜Ô%Ø!×(Ñ(¨Õ+à˜OÔ+Ø'×.Ñ.¨qÔ1Ù!& q£™à!*˜ßØ Ÿ™¬	°!«Ô5à’ñ# ð& —*‘*ˆCØ�fŒ}¡ s§¢°··°Ø—‘¤	¨#£Ô/á”S˜ “_×%Ò%Ø—‘¤§¢¨e°SÓ 9Ô:àœŸ™Ô§EØ×*Ñ*¨7Ó3‘ä!Ü˜HÑ%¨	°7ó<ß<@¹DÀÀd»Oð ÷  ˆ2Ð; R×%5Ñ%5°dÓ%;Ð;øô_ ô 	ÜœJð (ó ó ð ð	ûôp Ô 3Ð4ô 8ô *¬*ð 6ð Ÿ)™) C¬°«Ó5õ66ó +7ó 8ð 8ð8ûô@ %ô 2Ü1Ð1ð2ûä&ô UÜ)Ð*SÓTÐTðUûôD "ô "ÜŸW™W�FØ!“Eð"ús›   Ã*e ÌAe6 Ï B?g Ò"g Ò=g Ó"g Ó5$f? Õ+,g. Ög. Ö,g. × g. ×A1g. Ù
g. Ùg. Ù g. Ù(g. Ú&g. Ú+Ag. å e3å6Af<æ?gçg çg+ç.hèhc                ó˜  € V P                   '       g$   VP                   '       g   W,           ^,          pV# V P                   '       d%   VP                   '       d   \        P                  pV# V P                   '       d   V P                  e!   VP                   '       d   VP                  f   \	        R4      hVP                   '       d   VP
                  '       g%   V P                   '       d   V P                  '       d   YrVP                   '       dU   V P                  '       d   V ^,          pV# V P
                  '       d   V \        P                  ,          pV# V ^,           p V# V P                   '       dR   VP                  '       d   V\        P                  ,          pV# VP
                  '       d   V^,          pV# V^,
          pX# )z$Return a point between start and endz,cannot proceed with unsigned infinite values)Úis_infiniter   rg   Úis_extended_positiver)   Úis_extended_negativeÚHalf)rã   rä   rç   s   && rG   rÊ   rÊ   ¦  sn  € à××Ð S§_§_ _Ø�k˜1�_ˆð6 €Ið5 
×	×	Ð	˜sŸŸ˜Ü�V‰Vˆð2 €Ið/ ××Ð %×"<Ñ"<Ò"DØ——� C×$<Ñ$<Ò$DÜÐKÓLÐLØ�O�OˆO × 8× 8Ð 8Ø×!×!Ð! e×&@×&@Ð&@Ø�3ð �?�?ˆ?Ø×)×)Ð)Ø˜1•W�ð €Ið ×+×+Ð+Øœ1Ÿ6™6•\�ð €Ið ˜Q•Y‘ð €Ið ××ÐØ×'×'Ð'ØœŸ™•Z�ð
 €Ið	 ×)×)Ð)Ø˜•U�ð €Ið ˜1•W�Ø€IrI   c                ó*	  € ^ RI Hp WP                  9  d   V # V P                  V8X  d   V P                  p V P
                  V8X  d   WP                  P                  9  d   V # R pRp\        P                  pV P
                  V P                  ,
          p \        Wq4      pVP                  4       ^ 8X  d"   V P                  VP                  4       ^ 4      pM#V'       g   VP                  4       ^8”  d   \        h. pVEf   XP                  4       p^ pVP)                  VRR7      w  rïWÎ,          pWÞ,          p\+        V4      pVP)                  VRR7      w  ppVP,                  R8w  g6   VP.                  VP0                  u;8X  d    f'   M M#V P2                  R9  d   Tp\        P4                  pVV,          pVP0                  '       d   V P                  WÍ4      pMV P                  P                  WÍ4      pV! V P
                  4      V! V P                  4      ,          pV! V4      pVV,
           F~  p\7        \9        V^ 4      WR7      p\;        V\8        4      '       g   K2  VP
                  V8X  g   KE  V! WQVP                  4      \        P                   J g   Kl  VP=                  V( 4       K€  	  V) V3 F\  pV! WQV4      \        P                   J g   K   V! WV4      \        P                   Jg   K=  TP=                  VVJ d   VV8  MVV8  4       K^  	  VP=                  V4       \'        V!  #   \        \        3 EdM    T'       Eg5    \        T ..T4      pM  \         d    \        Y4      p Mi ; iT! YT4      p	T	\        P                   J d0   T! YQT4      \        P"                  J d   TP%                  Y8  R4      pT! YT) 4      p
T
\        P                   J dH   T! YQT) 4      \        P"                  J d,   TP%                  T) T8  R4      pTP%                  Y) 8„  R4      pT\        P                   J dA   T	\        P                   J d   Y8*  MY8  pT
\        P                   Jd   \'        T) T8  T4      p EL‰\        T4      p EL—i ; i)	a¼  Return the inequality with s isolated on the left, if possible.
If the relationship is non-linear, a solution involving And or Or
may be returned. False or True are returned if the relationship
is never True or always True, respectively.

If `linear` is True (default is False) an `s`-dependent expression
will be isolated on the left, if possible
but it will not be solved for `s` unless the expression is linear
in `s`. Furthermore, only "safe" operations which do not change the
sense of the relationship are applied: no division by an unsigned
value is attempted unless the relationship involves Eq or Ne and
no division by a value not known to be nonzero is ever attempted.

Examples
========

>>> from sympy import Eq, Symbol
>>> from sympy.solvers.inequalities import _solve_inequality as f
>>> from sympy.abc import x, y

For linear expressions, the symbol can be isolated:

>>> f(x - 2 < 0, x)
x < 2
>>> f(-x - 6 < x, x)
x > -3

Sometimes nonlinear relationships will be False

>>> f(x**2 + 4 < 0, x)
False

Or they may involve more than one region of values:

>>> f(x**2 - 4 < 0, x)
(-2 < x) & (x < 2)

To restrict the solution to a relational, set linear=True
and only the x-dependent portion will be isolated on the left:

>>> f(x**2 - 4 < 0, x, linear=True)
x**2 < 4

Division of only nonzero quantities is allowed, so x cannot
be isolated by dividing by y:

>>> y.is_nonzero is None  # it is unknown whether it is 0 or not
True
>>> f(x*y < 1, x)
x*y < 1

And while an equality (or inequality) still holds after dividing by a
non-zero quantity

>>> nz = Symbol('nz', nonzero=True)
>>> f(Eq(x*nz, 1), x)
Eq(x, 1/nz)

the sign must be known for other inequalities involving > or <:

>>> f(x*nz <= 1, x)
nz*x <= 1
>>> p = Symbol('p', positive=True)
>>> f(x*p <= 1, x)
x <= 1/p

When there are denominators in the original expression that
are removed by expansion, conditions for them will be returned
as part of the result:

>>> f(x < x*(2/x - 1), x)
(x < 1) & Ne(x, 0)
r¤   c                 óª   €  V P                  W4      pV\        P                  J d   V# VR9  d   R# V#   \         d    \        P                  u # i ; i)TN©TF)r¬   r   ÚNaNrœ   )ÚierM   r~   r®   s   &&& rG   ÚclassifyÚ#_solve_inequality.<locals>.classify  sL   € ð	Ø—‘˜“ˆAØ”A—E‘E‹zØ�Ø˜-Ô'ÙØˆHøÜô 	Ü—5‘5ŠLð	ús   ‚&4 ©4 ²4 ´AÁANT)Úas_AddF)Úlinear)r"   r!   )r»   r¥   rÁ   re   r6   rd   r   r4   r   ÚdegreerŽ   r*   r0   r   r‚   rq   r,   r.   r¬   r   Úas_independentr   Úis_zeroÚis_negativeÚis_positiverf   rh   Ú_solve_inequalityr
   r(   r2   )ró   rM   r÷   r¥   rô   rÐ   Úoor|   rL   ÚokooÚoknoor‰   rÓ   re   ÚbÚaxÚefrá   Úbeginning_denomsÚcurrent_denomsr€   Úcr~   s   &&&                    rG   rý   rý   Ç  s©  € õT -Ø—‘ÔØˆ	Ø	‡v�v�„{Ø�[‰[ˆØ	‡v�v�„{�q§¡× 3Ñ 3Ô3Øˆ	òð 
€BÜ	
�‰€BØ�6‰6�B—F‘F�?€DðÜ�‹MˆØ�8‰8‹:˜Œ?Ø—‘˜Ÿ™› aÓ(‰Bß˜AŸH™H›J¨œNä%Ð%ð0 €EØ	ƒzØ�I‰I‹Kˆð
 ˆØ× Ñ  ¨4Ð Ó0‰ˆØ	�ˆØ�ˆÜ˜!‹_ˆØ× Ñ  ¨5Ð Ó1‰ˆˆ1Ø�I‰I˜ÔØ—‘Ø—‘ö&Ø!%õ&à—	‘	 Ô-ØˆAÜ—‘ˆAØˆq�ˆØ�=�=ˆ=Ø—‘˜“‰Bà—‘×!Ñ! !Ó)ˆBñ " "§&¡&›>©F°2·6±6«NÕ:ÐÙ ›ˆØ! N×2Ð2ˆAÜ!¤" Q¨£(¨AÔ=ˆAÜ˜!œR× Ô  Q§U¡U¨a¦ZÙ˜B 1§5¡5Ó)¬Q¯V©VÕ3à—L‘L ! Ö$ñ 3ð �#�r“ˆAÙ˜ Ó"¤a§f¡fÕ,Ù˜R AÓ&¬a¯f©fÕ4Ø—‘ a¨2£g˜Q šU°1°q±5Ö9ñ ð
 
‡L�L�ÔÜ�‰;ÐøôA Ô0Ð1õ ßˆvð8Ü1°B°4°&¸!Ó<‘øÜ"ô 8Ü0°Ó7’ð8úñ ˜B 2Ó&ˆDØ”q—v‘v‹~¡(¨2°"Ó"5¼¿¹Ó"@Ø—W‘W˜Q™V TÓ*�Ù˜R R CÓ(ˆEØœŸ™“Ù˜R R CÓ(¬A¯G©GÓ3Ø—W‘W˜b˜S 1™W dÓ+�Ø—W‘W˜Q ™W dÓ+�Ø”Q—V‘V‹|Ø"&¬!¯&©&£.�a’g°q±v�Ø¤§¡Ó&Ü˜b˜S 1™W bÓ)�Búä�T“
‹Að+úsJ   ÂA L4 ÃL4 ÃL4 Ì4RÍMÍRÍM8Í5RÍ7M8Í8DRÒRÒRc           
      óN  a€ / / r2. pV  EF�  pVP                   VP                  rvVP                  \        4      p\	        V4      ^8X  d   VP                  4       oMoVP                  V,          p	\	        V	4      ^8X  d9   V	P                  4       oVP                  \        \        V^ V4      S4      4       K¬  \        \        R4      4      hVP                  S4      '       d%   VP                  S. 4      P                  Wg34       Kû  VP                  V3R l4      p
V
'       d`   \        ;QJ d    R V
 4       F  '       d   K   RM	  RM! R V
 4       4      '       d&   VP                  S. 4      P                  Wg34       EKw  VP                  \        \        V^ V4      S4      4       EK   	  VP!                  4        UUu. uF  w  r¼\#        V.V4      NK  	  pppVP!                  4        UUu. uF  w  r¼\%        WË4      NK  	  ppp\'        WÞ,           V,           !  # u uppi u uppi )é   zZ
                    inequality has more than one symbol of interest.
                    c                 ó¼   <€ V P                  S4      ;'       dD    V P                  ;'       g0    V P                  ;'       d    V P                  P                  '       * # r†   )rr   Úis_Functionr�   r‘   r’   )Úurw   s   &€rG   r¹   Ú&_reduce_inequalities.<locals>.<lambda>“  sH   ø€ Ø—‘�c“
÷ Dð DØ—‘×BÐB §¡×!BÐ!B°!·%±%×2BÑ2BÔ.BðDrI   c              3   óB   "  € T F  p\        V\        4      x € K  	  R # 5ir†   )r(   r   ©rˆ   r~   s   & rG   rŠ   Ú'_reduce_inequalities.<locals>.<genexpr>–  s   é € Ð!I¹j¸¤*¨Q´×"4Ð"4»jùs   ‚FT)rd   rf   Úatomsr   rÂ   ÚpoprÁ   r2   rý   r   r0   r   Úis_polynomialÚ
setdefaultÚfindrÆ   Úitemsr‚   r¢   r   )rŸ   ÚsymbolsÚ	poly_partÚabs_partÚotherÚ
inequalityr|   r9   ÚgensÚcommonÚ
componentsrw   rv   Úpoly_reducedÚabs_reduceds   &&         `   rG   Ú_reduce_inequalitiesr   t  sÇ  ø€ ð ˜bˆxØ€Eä"ˆ
à—N‘N J×$5Ñ$5ˆcð
 �z‰zœ&Ó!ˆäˆt‹9˜Œ>Ø—(‘(“*‰Cà×&Ñ&¨Õ0ˆFÜ�6‹{˜aÔØ—j‘j“l�Ø—‘Ô.¬z¸$ÀÀ3Ó/GÈÓMÔNÙä)¬*ð 6ó +ó ð ð ×Ñ˜c×"Ò"Ø× Ñ   bÓ)×0Ñ0°$°Ö=àŸ™ô $Dó EˆJ÷ Ÿc›cÑ!I¹jÓ!IŸcŸcšcÑ!I¹jÓ!I×IÒIØ×#Ñ# C¨Ó,×3Ñ3°T°K×@à—‘Ô.¬z¸$ÀÀ3Ó/GÈÓM×Nñ? #ðB R[×Q`ÑQ`ÔQbÔcÑQbÁ:À3Ô0°%°¸#Ö>ÑQb€LÑcØIQÏÉÔIYÔZÑIY¹:¸3Ô*¨5Ö6ÑIY€KÑZä�Õ+¨eÕ3Ñ5Ð5ùó dùÛZs   Æ>HÇ,H!c           	     ó"  € \        V 4      '       g   V .p V  Uu. uF  p\        V4      NK  	  p p\        4       P                  ! V  Uu. uF  q"P                  NK  	  up!  p\        V4      '       g   V.p\        V4      ;'       g    TV,          p\
        ;QJ d    R V 4       F  '       g   K   RM	  RM! R V 4       4      '       d   \        \        R4      4      hV Uu/ uF*  q"P                  e   K  V\        VP                  RR7      bK,  	  ppV  Uu. uF  q"P                  V4      NK  	  p pV Uu0 uF  q"P                  V4      kK  	  pp. pV  F×  p\        V\        4      '       dK   VP                  VP                  P!                  4       VP"                  P!                  4       ,
          ^ 4      pMVR9  d   \%        V^ 4      pVR8X  d   K  VR8X  d   \&        P(                  u # VP                  P*                  '       d   \-        RV,          4      hVP/                  V4       KÙ  	  Tp ?\1        W4      pTP                  VP3                  4        UUu/ uF  w  rxW‡bK	  	  upp4      # u upi u upi u upi u upi u upi u uppi )a!  Reduce a system of inequalities with rational coefficients.

Examples
========

>>> from sympy.abc import x, y
>>> from sympy import reduce_inequalities

>>> reduce_inequalities(0 <= x + 3, [])
(-3 <= x) & (x < oo)

>>> reduce_inequalities(0 <= x + y*2 - 1, [x])
(x < oo) & (x >= 1 - 2*y)
c              3   ó<   "  € T F  qP                   R J x € K  	  R# 5i)FNr¸   r  s   & rG   rŠ   Ú&reduce_inequalities.<locals>.<genexpr>¹  s   é € Ð
8±¨1×Ñ Õ&³ùs   ‚TFzP
            inequalities cannot contain symbols that are not real.
            r§   r   rñ   )r   r   rÃ   rS   rÁ   Úanyrœ   r   r›   r   Únamer¾   r(   r   rŽ   rd   r*   re   r
   r   r.   r+   r0   r2   r   r  )	rŸ   r  r~   r  ÚrecastÚkeeprÐ   Úkr®   s	   &&       rG   Úreduce_inequalitiesr)  ¡  s  € ô �L×!Ò!Ø$�~ˆÙ(4Ó5© 1”G˜A–J©€LÐ5ä‹5�;Š;±Ó>±¨AŸœ±Ñ>Ñ?€Dä�G×ÒØ�)ˆÜ�7‹|×#Ð#˜t tÕ+€Gß
ƒsÑ
8±Ó
8‡s‡s‚sÑ
8±Ó
8×8Ò8Üœ
ð $ó ó ð 	ñ ó5ÙˆA×+Ñ+ô 3ˆa”�q—v‘v¨TÔ2Ò2Ùð ð 5á0<Ó=±¨1—J‘J˜vÖ&±€LÐ=Ù+2Ó3©7 a�z‰z˜&Ö!©7€GÐ3ð €DÛˆÜ�aœ×$Ò$Ø—‘�q—u‘u—}‘}“¨¯©¯©«Õ8¸!Ó<‰AØ�mÔ#Ü�1�a“ˆAØ�Œ9ÙØ�%ŒZÜ—7‘7ŠNØ�5‰5�?�?ˆ?Ü%Ø7¸!Õ;ó=ð =à�‰�AŽñ ð €LØô 
˜lÓ	4€Bð �;‰;¨¯©¬Ô8©¡ ˜š©Ò8Ó9Ð9ùòQ 6ùâ>ùò5ùâ=ùÚ3ùó0 9s)   ™I2ÁI7Ã"I<Ã6I<ÄJÄ7JÉJ
)T)F)9Ú__doc__rP   Úsympy.calculus.utilr   r   r   Ú
sympy.corer   Úsympy.core.exprtoolsr   Úsympy.core.relationalr   r   r	   r
   Úsympy.core.symbolr   r   Úsympy.sets.setsr   r   r   r   Úsympy.core.singletonr   Úsympy.core.functionr   Ú$sympy.functions.elementary.complexesr   Úsympy.logicr   Úsympy.polysr   r   r   Úsympy.polys.polyutilsr   Úsympy.solvers.solvesetr   r   Úsympy.utilities.iterablesr   r   Úsympy.utilities.miscr   rH   rN   r_   r‚   r    r¢   r-   rq   rÊ   rý   r   r)  r‡   rI   rG   Ú<module>r:     s    ðÙ BÛ ÷ñ å Ý -ß 8Ó 8ß +ß DÓ DÝ "Ý *Ý 4Ý ß FÑ FÝ (ß 4ß 4Ý +òXòvIò"?ôDXòvD;òN"ð2 7;À1Ç7Á7ÐW\ô d<òN	ôBjòZ*6ðZ /1ö 9:rI   