
    g$                     $   d dl mZ d dlmZ  G d de      Z G d de      Z G d de      Z G d	 d
e      Z G d de      Z G d de      Z	 G d de      Z
 G d de      Z G d de      Z G d de      Z G d de      Z G d de      Zy)    )	Predicate)
Dispatcherc                   (    e Zd ZdZdZ edd      Zy)IntegerPredicatean  
    Integer predicate.

    Explanation
    ===========

    ``Q.integer(x)`` is true iff ``x`` belongs to the set of integer
    numbers.

    Examples
    ========

    >>> from sympy import Q, ask, S
    >>> ask(Q.integer(5))
    True
    >>> ask(Q.integer(S(1)/2))
    False

    References
    ==========

    .. [1] https://en.wikipedia.org/wiki/Integer

    integerIntegerHandlerzXHandler for Q.integer.

Test that an expression belongs to the field of integer numbers.docN__name__
__module____qualname____doc__namer   handler     V/var/www/openai/venv/lib/python3.12/site-packages/sympy/assumptions/predicates/sets.pyr   r      s!    0 DKGr   r   c                   (    e Zd ZdZdZ edd      Zy)NonIntegerPredicatez.
    Non-integer extended real predicate.
    
nonintegerNonIntegerHandlerzYHandler for Q.noninteger.

Test that an expression is a non-integer extended real number.r	   Nr   r   r   r   r   r   &   s!     DIGr   r   c                   (    e Zd ZdZdZ edd      Zy)RationalPredicatea  
    Rational number predicate.

    Explanation
    ===========

    ``Q.rational(x)`` is true iff ``x`` belongs to the set of
    rational numbers.

    Examples
    ========

    >>> from sympy import ask, Q, pi, S
    >>> ask(Q.rational(0))
    True
    >>> ask(Q.rational(S(1)/2))
    True
    >>> ask(Q.rational(pi))
    False

    References
    ==========

    .. [1] https://en.wikipedia.org/wiki/Rational_number

    rationalRationalHandlerzZHandler for Q.rational.

Test that an expression belongs to the field of rational numbers.r	   Nr   r   r   r   r   r   2   s!    4 DLGr   r   c                   (    e Zd ZdZdZ edd      Zy)IrrationalPredicatea  
    Irrational number predicate.

    Explanation
    ===========

    ``Q.irrational(x)`` is true iff ``x``  is any real number that
    cannot be expressed as a ratio of integers.

    Examples
    ========

    >>> from sympy import ask, Q, pi, S, I
    >>> ask(Q.irrational(0))
    False
    >>> ask(Q.irrational(S(1)/2))
    False
    >>> ask(Q.irrational(pi))
    True
    >>> ask(Q.irrational(I))
    False

    References
    ==========

    .. [1] https://en.wikipedia.org/wiki/Irrational_number

    
irrationalIrrationalHandlerzIHandler for Q.irrational.

Test that an expression is irrational numbers.r	   Nr   r   r   r   r   r   U   s     8 D9Gr   r   c                   (    e Zd ZdZdZ edd      Zy)RealPredicatea  
    Real number predicate.

    Explanation
    ===========

    ``Q.real(x)`` is true iff ``x`` is a real number, i.e., it is in the
    interval `(-\infty, \infty)`.  Note that, in particular the
    infinities are not real. Use ``Q.extended_real`` if you want to
    consider those as well.

    A few important facts about reals:

    - Every real number is positive, negative, or zero.  Furthermore,
        because these sets are pairwise disjoint, each real number is
        exactly one of those three.

    - Every real number is also complex.

    - Every real number is finite.

    - Every real number is either rational or irrational.

    - Every real number is either algebraic or transcendental.

    - The facts ``Q.negative``, ``Q.zero``, ``Q.positive``,
        ``Q.nonnegative``, ``Q.nonpositive``, ``Q.nonzero``,
        ``Q.integer``, ``Q.rational``, and ``Q.irrational`` all imply
        ``Q.real``, as do all facts that imply those facts.

    - The facts ``Q.algebraic``, and ``Q.transcendental`` do not imply
        ``Q.real``; they imply ``Q.complex``. An algebraic or
        transcendental number may or may not be real.

    - The "non" facts (i.e., ``Q.nonnegative``, ``Q.nonzero``,
        ``Q.nonpositive`` and ``Q.noninteger``) are not equivalent to
        not the fact, but rather, not the fact *and* ``Q.real``.
        For example, ``Q.nonnegative`` means ``~Q.negative & Q.real``.
        So for example, ``I`` is not nonnegative, nonzero, or
        nonpositive.

    Examples
    ========

    >>> from sympy import Q, ask, symbols
    >>> x = symbols('x')
    >>> ask(Q.real(x), Q.positive(x))
    True
    >>> ask(Q.real(0))
    True

    References
    ==========

    .. [1] https://en.wikipedia.org/wiki/Real_number

    realRealHandlerzRHandler for Q.real.

Test that an expression belongs to the field of real numbers.r	   Nr   r   r   r   r"   r"   z   s"    8r DHGr   r"   c                   (    e Zd ZdZdZ edd      Zy)ExtendedRealPredicatea  
    Extended real predicate.

    Explanation
    ===========

    ``Q.extended_real(x)`` is true iff ``x`` is a real number or
    `\{-\infty, \infty\}`.

    See documentation of ``Q.real`` for more information about related
    facts.

    Examples
    ========

    >>> from sympy import ask, Q, oo, I
    >>> ask(Q.extended_real(1))
    True
    >>> ask(Q.extended_real(I))
    False
    >>> ask(Q.extended_real(oo))
    True

    extended_realExtendedRealHandlerzHandler for Q.extended_real.

Test that an expression belongs to the field of extended real
numbers, that is real numbers union {Infinity, -Infinity}.r	   Nr   r   r   r   r&   r&      s!    0 DEGr   r&   c                   (    e Zd ZdZdZ edd      Zy)HermitianPredicatez
    Hermitian predicate.

    Explanation
    ===========

    ``ask(Q.hermitian(x))`` is true iff ``x`` belongs to the set of
    Hermitian operators.

    References
    ==========

    .. [1] https://mathworld.wolfram.com/HermitianOperator.html

    	hermitianHermitianHandlerz^Handler for Q.hermitian.

Test that an expression belongs to the field of Hermitian operators.r	   Nr   r   r   r   r*   r*      s!      DOGr   r*   c                   (    e Zd ZdZdZ edd      Zy)ComplexPredicatea  
    Complex number predicate.

    Explanation
    ===========

    ``Q.complex(x)`` is true iff ``x`` belongs to the set of complex
    numbers. Note that every complex number is finite.

    Examples
    ========

    >>> from sympy import Q, Symbol, ask, I, oo
    >>> x = Symbol('x')
    >>> ask(Q.complex(0))
    True
    >>> ask(Q.complex(2 + 3*I))
    True
    >>> ask(Q.complex(oo))
    False

    References
    ==========

    .. [1] https://en.wikipedia.org/wiki/Complex_number

    complexComplexHandlerzXHandler for Q.complex.

Test that an expression belongs to the field of complex numbers.r	   Nr   r   r   r   r.   r.      s!    6 DKGr   r.   c                   (    e Zd ZdZdZ edd      Zy)ImaginaryPredicatea  
    Imaginary number predicate.

    Explanation
    ===========

    ``Q.imaginary(x)`` is true iff ``x`` can be written as a real
    number multiplied by the imaginary unit ``I``. Please note that ``0``
    is not considered to be an imaginary number.

    Examples
    ========

    >>> from sympy import Q, ask, I
    >>> ask(Q.imaginary(3*I))
    True
    >>> ask(Q.imaginary(2 + 3*I))
    False
    >>> ask(Q.imaginary(0))
    False

    References
    ==========

    .. [1] https://en.wikipedia.org/wiki/Imaginary_number

    	imaginaryImaginaryHandlerzHandler for Q.imaginary.

Test that an expression belongs to the field of imaginary numbers,
that is, numbers in the form x*I, where x is real.r	   Nr   r   r   r   r2   r2     s     6 D=Gr   r2   c                   (    e Zd ZdZdZ edd      Zy)AntihermitianPredicateaJ  
    Antihermitian predicate.

    Explanation
    ===========

    ``Q.antihermitian(x)`` is true iff ``x`` belongs to the field of
    antihermitian operators, i.e., operators in the form ``x*I``, where
    ``x`` is Hermitian.

    References
    ==========

    .. [1] https://mathworld.wolfram.com/HermitianOperator.html

    antihermitianAntiHermitianHandlerzHandler for Q.antihermitian.

Test that an expression belongs to the field of anti-Hermitian
operators, that is, operators in the form x*I, where x is Hermitian.r	   Nr   r   r   r   r6   r6   @  s!    " DOGr   r6   c                   (    e Zd ZdZdZ edd      Zy)AlgebraicPredicatea#  
    Algebraic number predicate.

    Explanation
    ===========

    ``Q.algebraic(x)`` is true iff ``x`` belongs to the set of
    algebraic numbers. ``x`` is algebraic if there is some polynomial
    in ``p(x)\in \mathbb\{Q\}[x]`` such that ``p(x) = 0``.

    Examples
    ========

    >>> from sympy import ask, Q, sqrt, I, pi
    >>> ask(Q.algebraic(sqrt(2)))
    True
    >>> ask(Q.algebraic(I))
    True
    >>> ask(Q.algebraic(pi))
    False

    References
    ==========

    .. [1] https://en.wikipedia.org/wiki/Algebraic_number

    	algebraicAlgebraicHandlerzHandler for Q.algebraic key.r	   N)r   r   r   r   r   r   r<   r   r   r   r:   r:   [  s    6 D!.r   r:   c                   (    e Zd ZdZdZ edd      Zy)TranscendentalPredicatez
    Transcedental number predicate.

    Explanation
    ===========

    ``Q.transcendental(x)`` is true iff ``x`` belongs to the set of
    transcendental numbers. A transcendental number is a real
    or complex number that is not algebraic.

    transcendentalTranscendentalz!Handler for Q.transcendental key.r	   Nr   r   r   r   r>   r>   ~  s    
 D3Gr   r>   N)sympy.assumptionsr   sympy.multipledispatchr   r   r   r   r   r"   r&   r*   r.   r2   r6   r:   r>   r   r   r   <module>rC      s    ' -y B	) 	 	  F") "J?I ?DI D 2!y !H" "JY 6   Fi r   