Repository: sympy/sympy

Issue:
ln(n) is not known to be nonnegative for positive integer n
If `n` is a positive integer, it is as least 1, hence `ln(n)` is at least 0, hence I'd expect
```python
>>> ln(n).is_nonnegative
```
to return `True` (but it returns `None`).

Discussion:
aktech: > Can you also verify that if
>
>p = Symbol('p', prime=True)
>then
>
>assert ln(p).is_positive == True
>?

Sure.

> In fact, I must say that I don't like comparing with == to constants such as True, False, etc.

Even I don't, but since I saw that in lot of tests, that's why I did that to maintain consistency.
Anyways, I have fixed that.
aktech: There is some problem with Travis: 
```
sympy/simplify/tests/test_hyperexpand.py[13] .....
No output has been received in the last 10 minutes, this potentially indicates a stalled build or something wrong with the build itself.
```

This test Passes on local computer:
```
sympy/simplify/tests/test_hyperexpand.py[43] .....fffff...wwwwwwwwwwwww.........
........                                                                    [OK]

= tests finished: 25 passed, 13 skipped, 5 expected to fail, in 235.27 seconds =
amit@amit-UDell:~/Desktop/myrepo/sympy$ 
```

Patch:
diff --git a/AUTHORS b/AUTHORS
index f4cfe080ae..47a4f03692 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -387,6 +387,5 @@ harshil goel <harshil158@gmail.com>
 Lokesh Sharma <lokeshhsharma@gmail.com>
 Sartaj Singh <singhsartaj94@gmail.com>
 Chris Swierczewski <cswiercz@gmail.com>
-Sumith <sumith1896@gmail.com>
 Konstantin Togoi <togoi.konstantin@outlook.com>
 Param Singh <paramsingh258@gmail.com>
diff --git a/doc/src/aboutus.rst b/doc/src/aboutus.rst
index c40452b128..66cdf0e007 100644
--- a/doc/src/aboutus.rst
+++ b/doc/src/aboutus.rst
@@ -392,7 +392,6 @@ want to be mentioned here, so see our repository history for a full list).
 #. Lokesh Sharma: reorder setup.py file imports to correct NameError
 #. Sartaj Singh: use \left \| instead of \lvert for latex Abs
 #. Chris Swierczewski: RootOf.evalf watches for root on interval boundary
-#. Sumith: implemented columnspace of a matrix
 #. Konstantin Togoi: added truth_table and binary digit utilities to boolalg
 #. Param Singh: added missing units from mks system
 
diff --git a/sympy/core/expr.py b/sympy/core/expr.py
index 0de02ff424..14142321ad 100644
--- a/sympy/core/expr.py
+++ b/sympy/core/expr.py
@@ -682,6 +682,10 @@ def equals(self, other, failing_expression=False):
             return diff
         return None
 
+    def _eval_is_composite(self):
+        if self.is_integer and self.is_positive and self.is_prime is False:
+            return True
+
     def _eval_is_positive(self):
         from sympy.polys.numberfields import minimal_polynomial
         from sympy.polys.polyerrors import NotAlgebraic
diff --git a/sympy/core/exprtools.py b/sympy/core/exprtools.py
index 654b7f3bf4..7e786424f3 100644
--- a/sympy/core/exprtools.py
+++ b/sympy/core/exprtools.py
@@ -72,7 +72,7 @@ def _monotonic_sign(self):
         rv = _monotonic_sign(-self)
         return rv if rv is None else -rv
 
-    if not self.is_Add and self.as_numer_denom()[1].is_number:
+    if self.is_Symbol:
         s = self
         if s.is_prime:
             if s.is_odd:
diff --git a/sympy/core/facts.py b/sympy/core/facts.py
index 4cc36ac997..ef4af6b5ad 100644
--- a/sympy/core/facts.py
+++ b/sympy/core/facts.py
@@ -186,7 +186,7 @@ def apply_beta_to_alpha_route(alpha_implications, beta_rules):
                     ximpls.add(bimpl)
 
                     # we introduced new implication - now we have to restore
-                    # completeness of the whole set.
+                    # completness of the whole set.
                     bimpl_impl = x_impl.get(bimpl)
                     if bimpl_impl is not None:
                         ximpls |= bimpl_impl[0]
diff --git a/sympy/functions/elementary/exponential.py b/sympy/functions/elementary/exponential.py
index 8b9881d7e3..35b6c8f4cf 100644
--- a/sympy/functions/elementary/exponential.py
+++ b/sympy/functions/elementary/exponential.py
@@ -301,7 +301,7 @@ def taylor_term(n, x, *previous_terms):
             p = previous_terms[-1]
             if p is not None:
                 return p * x / n
-        return x**n/factorial(n)
+        return x**n/factorial()(n)
 
     def as_real_imag(self, deep=True, **hints):
         """
@@ -687,6 +687,9 @@ def _eval_is_positive(self):
     def _eval_is_zero(self):
         return (self.args[0] - 1).is_zero
 
+    def _eval_is_nonnegative(self):
+        return (self.args[0] - 1).is_nonnegative
+
     def _eval_nseries(self, x, n, logx):
         # NOTE Please see the comment at the beginning of this file, labelled
         #      IMPORTANT.
diff --git a/sympy/matrices/expressions/matexpr.py b/sympy/matrices/expressions/matexpr.py
index b07b3750ad..01b7420823 100644
--- a/sympy/matrices/expressions/matexpr.py
+++ b/sympy/matrices/expressions/matexpr.py
@@ -322,14 +322,6 @@ class MatrixElement(Expr):
     j = property(lambda self: self.args[2])
     _diff_wrt = True
 
-    def doit(self, **kwargs):
-        deep = kwargs.get('deep', True)
-        if deep:
-            args = [arg.doit(**kwargs) for arg in self.args]
-        else:
-            args = self.args
-        return args[0][args[1], args[2]]
-
 
 class MatrixSymbol(MatrixExpr):
     """Symbolic representation of a Matrix object
diff --git a/sympy/physics/quantum/qubit.py b/sympy/physics/quantum/qubit.py
index 216f9d556f..58ba60d675 100644
--- a/sympy/physics/quantum/qubit.py
+++ b/sympy/physics/quantum/qubit.py
@@ -481,7 +481,7 @@ def matrix_to_density(mat):
 
 
 def qubit_to_matrix(qubit, format='sympy'):
-    """Converts an Add/Mul of Qubit objects into it's matrix representation
+    """Coverts an Add/Mul of Qubit objects into it's matrix representation
 
     This function is the inverse of ``matrix_to_qubit`` and is a shorthand
     for ``represent(qubit)``.


Test patch:
diff --git a/bin/coverage_doctest.py b/bin/coverage_doctest.py
index dfe02413e7..02e4c77198 100755
--- a/bin/coverage_doctest.py
+++ b/bin/coverage_doctest.py
@@ -396,7 +396,7 @@ def coverage(module_path, verbose=False, no_color=False, sphinx=True):
     contained. It then goes through each of the classes/functions to get
     the docstring and doctest coverage of the module. """
 
-    # Import the package and find members
+    # Import the package and find membmers
     m = None
     try:
         __import__(module_path)
diff --git a/sympy/core/tests/test_assumptions.py b/sympy/core/tests/test_assumptions.py
index 4e29f4e8ca..3c62a807f0 100644
--- a/sympy/core/tests/test_assumptions.py
+++ b/sympy/core/tests/test_assumptions.py
@@ -1,4 +1,4 @@
-from sympy import I, sqrt, log, exp, sin, asin, factorial
+from sympy import I, sqrt, log, exp, sin, asin
 from sympy.core import Symbol, S, Rational, Integer, Dummy, Wild, Pow
 from sympy.core.facts import InconsistentAssumptions
 from sympy import simplify
@@ -479,7 +479,7 @@ def test_composite():
     assert S(17).is_composite is False
     assert S(4).is_composite is True
     x = Dummy(integer=True, positive=True, prime=False)
-    assert x.is_composite is None # x could be 1
+    assert x.is_composite
     assert (x + 1).is_composite is None
 
 
@@ -900,8 +900,3 @@ def test_issues_8632_8633_8638_8675_8992():
     assert ((p + 2)**3 - S.Half).is_positive
     n = Dummy(negative=True)
     assert (n - 3).is_nonpositive
-
-def test_issue_9115():
-    n = Dummy('n', integer=True, nonnegative=True)
-    assert (factorial(n) >= 1) == True
-    assert (factorial(n) < 1) == False
diff --git a/sympy/functions/elementary/tests/test_exponential.py b/sympy/functions/elementary/tests/test_exponential.py
index 279254d9dd..a3e9ccb572 100644
--- a/sympy/functions/elementary/tests/test_exponential.py
+++ b/sympy/functions/elementary/tests/test_exponential.py
@@ -1,5 +1,5 @@
 from sympy import (
-    symbols, log, Float, nan, oo, zoo, I, pi, E, exp, Symbol,
+    symbols, log, ln, Float, nan, oo, zoo, I, pi, E, exp, Symbol,
     LambertW, sqrt, Rational, expand_log, S, sign, conjugate,
     sin, cos, sinh, cosh, tanh, exp_polar, re, Function, simplify)
 
@@ -131,10 +131,6 @@ def test_exp_leading_term():
     assert exp(1/x).as_leading_term(x) == exp(1/x)
     assert exp(2 + x).as_leading_term(x) == exp(2)
 
-def test_exp_taylor_term():
-    x = symbols('x')
-    assert exp(x).taylor_term(1, x) == x
-    assert exp(x).taylor_term(3, x) == x**3/6
 
 def test_log_values():
     assert log(nan) == nan
@@ -444,6 +440,7 @@ def test_log_product():
     expr = log(Product(-2, (n, 0, 4)))
     assert simplify(expr) == expr
 
+
 def test_issue_8866():
     x = Symbol('x')
     assert simplify(log(x, 10, evaluate=False)) == simplify(log(x, 10))
@@ -456,3 +453,10 @@ def test_issue_8866():
     b2 = log(exp(y), exp(5), evaluate=False)
     assert simplify(log(l1, b1)) == simplify(log(l2, b2))
     assert expand_log(log(l1, b1)) == expand_log(log(l2, b2))
+
+
+def test_issue_9116():
+    n = Symbol('n', positive=True, integer=True)
+
+    assert ln(n).is_nonnegative is True
+    assert log(n).is_nonnegative is True
diff --git a/sympy/matrices/expressions/tests/test_matrix_exprs.py b/sympy/matrices/expressions/tests/test_matrix_exprs.py
index d1f0dcbb23..77a8f1f9ed 100644
--- a/sympy/matrices/expressions/tests/test_matrix_exprs.py
+++ b/sympy/matrices/expressions/tests/test_matrix_exprs.py
@@ -207,9 +207,3 @@ def test_single_indexing():
 
 def test_MatrixElement_diff():
     assert (A[3, 0]*A[0, 0]).diff(A[0, 0]) == A[3, 0]
-
-
-def test_MatrixElement_doit():
-    u = MatrixSymbol('u', 2, 1)
-    v = ImmutableMatrix([3, 5])
-    assert u[0, 0].subs(u, v).doit() == v[0, 0]