def prove(Eq): from axiom import discrete, algebra x = Symbol.x(real=True, shape=(oo, )) n = Symbol.n(integer=True, positive=True, given=False) Eq << apply(alpha(x[:n + 2])) Eq.initial = Eq[-1].subs(n, 1) Eq << Eq.initial.this.lhs.doit() Eq << Eq[-1].this.find(alpha).defun() Eq << Eq[-1].this.find(alpha).defun() Eq << Eq[-1].this.find(alpha).defun() Eq << Eq[-1].this.find(alpha).defun() Eq << Eq[-1].this.find(alpha).defun() Eq.induct = Eq[0].subs(n, n + 1) Eq << Eq.induct.this.find(alpha).defun() Eq << Eq[-1].this.rhs.rhs.defun() Eq << algebra.cond.imply.cond.subs.apply(Eq[0], x[:n + 2], x[1:n + 3]) i = Eq[0].lhs.variable Eq << Eq[-1].this.lhs.limits_subs(i, i - 1) Eq << Eq[-1].this.lhs.apply(algebra.all.given.all.limits.relax, domain=Range(1, n + 3)) Eq << Suffice(All[i:1:n + 3](x[i] > 0), Unequal(alpha(x[1:n + 3]), 0), plausible=True) Eq << Eq[-1].this.lhs.apply( discrete.all_is_positive.imply.is_nonzero.alpha.offset) Eq <<= Eq[-1] & Eq[-2] Eq << Eq[-1].this.rhs.apply(algebra.is_nonzero.eq.imply.eq.inverse) Eq << Suffice(Eq[0], Eq.induct, plausible=True) Eq << algebra.cond.suffice.imply.cond.induct.apply( Eq.initial, Eq[-1], n=n, start=1)
def apply(given): (x, _j), (j, n) = given.of(All[Indexed > 0, Tuple[0, Expr]]) offset = _j - j if offset != 0: assert not offset._has(j) x = x[offset:] return Equal(alpha(x[:n]), H(x[:n]) / K(x[:n]))
def prove(Eq): from axiom import discrete, algebra x = Symbol.x(real=True, positive=True, shape=(oo, )) n = Symbol.n(integer=True, positive=True) Eq << apply(x[:n + 1]) Eq << discrete.alpha.to.mul.HK.st.is_positive.apply(alpha(x[:n + 1])) Eq << Eq[-1].this.lhs.defun() Eq << discrete.alpha.to.mul.HK.st.is_positive.apply(alpha(x[1:n + 1])) Eq << algebra.eq.eq.imply.eq.subs.apply(Eq[-1], Eq[-2]) Eq << Eq[-1] - x[0]
def apply(A): assert A.is_alpha assert len(A.args) == 1 block = A.arg args = block.of(BlockMatrix) return Equal(A, alpha(*args))
def prove(Eq): from axiom import discrete, algebra x = Symbol.x(real=True, positive=True, shape=(oo, )) n = Symbol.n(integer=True, positive=True, given=False) Eq << apply(alpha(x[:n + 2])) Eq.initial = Eq[-1].subs(n, 1) Eq << Eq.initial.this.find(alpha).defun() Eq << Eq[-1].this.find(alpha).defun() Eq << Eq[-1].this.find(alpha).defun() Eq << Eq[-1].this.find(alpha).defun() Eq << Eq[-1].this.find(alpha).defun() Eq.induct = Eq[0].subs(n, n + 1) Eq << Eq.induct.this.find(alpha).defun() Eq << Eq[-1].this.find(alpha).defun() Eq << algebra.eq.imply.eq.subs.apply(Eq[0], x[:n + 2], x[1:n + 3]) Eq << discrete.imply.is_nonzero.alpha.apply(x[1:n + 3]) Eq << algebra.is_nonzero.eq.imply.eq.inverse.apply(Eq[-1], Eq[-2]) Eq << Suffice(Eq[0], Eq.induct, plausible=True) Eq << algebra.cond.suffice.imply.cond.induct.apply( Eq.initial, Eq[-1], n=n, start=1)
def apply(A): assert A.is_alpha assert len(A.args) == 1 mat = A.arg assert mat.is_Matrix return Equal(A, alpha(*mat._args))
def prove(Eq): from axiom import discrete, algebra x = Symbol.x(real=True, positive=True, shape=(oo, )) n = Symbol.n(integer=True) Eq.hypothesis = apply(alpha(x[:n + 1])) Eq.n2 = Suffice(n >= 2, Eq.hypothesis, plausible=True) Eq << Eq.n2.this.apply(algebra.suffice.to.all) _n = Symbol.n(domain=Range(2, oo)) Eq << discrete.alpha.to.mul.HK.induct.apply(alpha(x[:_n + 1])) Eq << algebra.cond.imply.all.apply(Eq[-1], _n) Eq.n1 = Suffice(Equal(n, 1), Eq.hypothesis, plausible=True) Eq << Eq.n1.this.apply(algebra.suffice.subs) Eq << Eq[-1].this.rhs.subs( alpha(x[:2]).this.defun(), alpha(x[1]).this.defun(), H(x[:2]).this.defun(), K(x[:2]).this.defun()) Eq << Eq[-1].this.rhs.rhs.apart(x=x[1]) Eq.n1 = algebra.suffice.suffice.imply.suffice.ou.apply(Eq.n1, Eq.n2) Eq.n0 = Suffice(Equal(n, 0), Eq.hypothesis, plausible=True) Eq << Eq.n0.this.apply(algebra.suffice.subs) Eq << Eq[-1].this.rhs.subs( alpha(x[0]).this.defun(), H(x[0]).this.defun(), K(x[0]).this.defun()) Eq << algebra.suffice.suffice.imply.suffice.ou.apply(Eq.n1, Eq.n0) Eq << Eq[-1].this.apply(algebra.suffice.to.all, wrt=n) Eq << Eq[-1].simplify()
def apply(given): (x, _j), (j, a, n) = given.of(All[Indexed > 0]) offset = _j - j if offset != 0: assert not offset._has(j) a += offset n += offset return Unequal(alpha(x[a:n]), 0)
def prove(Eq): from axiom import discrete, algebra x = Symbol.x(real=True, shape=(oo, )) n = Symbol.n(integer=True, positive=True) i = Symbol.i(integer=True) Eq << apply(All[i:1:n + 2](x[i] > 0)) Eq << discrete.imply.suffice.alpha.recurrence.apply(alpha(x[:n + 2])) Eq << algebra.cond.suffice.imply.cond.transit.apply(Eq[0], Eq[-1])
def apply(A): assert A.is_alpha assert len(A.args) == 1 x = A.arg n = x.shape[0] - 2 assert n > 0 x = x.base assert x.is_positive return Equal(A, alpha(x[:n], x[n] + 1 / x[n + 1]))
def apply(x, wrt=None): n = x.shape[0] assert n.is_finite assert n >= 3 if wrt is None: i = x.generate_var(integer=True, var='i') else: i = wrt return Suffice(All[i:1:n](x[i] > 0), Equal(alpha(x), H(x) / K(x)))
def apply(A): assert A.is_alpha assert len(A.args) == 1 x = A.arg n = x.shape[0] - 2 assert n > 0 x = x.base i = A.generate_var(integer=True, var='i') return Suffice(All[i:1:n + 2](x[i] > 0), Equal(A, alpha(x[:n], x[n] + 1 / x[n + 1])))
def prove(Eq): x = Symbol.x(real=True, positive=True, shape=(oo,)) Eq << apply(alpha(Matrix((x[0], x[1], x[2])))) Eq << Eq[-1].this.find(alpha).defun() Eq << Eq[-1].this.find(alpha).defun() Eq << Eq[-1].this.find(alpha).defun() Eq << Eq[-1].this.find(alpha).defun() Eq << Eq[-1].this.find(alpha).defun() Eq << Eq[-1].this.find(alpha).defun()
def prove(Eq): from axiom import discrete, algebra x = Symbol.x(real=True, shape=(oo, )) n = Symbol.n(integer=True, positive=True) i = Symbol.i(integer=True) Eq << apply(All[i:0:n](x[i] > 0)) x_ = Symbol.x(real=True, positive=True, shape=(oo, )) Eq << discrete.alpha.to.mul.HK.st.is_positive.apply(alpha(x_[:n])) Eq << Eq[-1].subs(x_[:n], x[:n]) Eq << algebra.all.imply.suffice.apply(Eq[-1]) Eq << algebra.cond.suffice.imply.cond.transit.apply(Eq[0], Eq[-1])
def apply(x): n = x.shape[0] n -= 1 assert n >= 2 return Equal(alpha(x[:n + 1]), alpha(x[:n - 1]) + (-1) ** n * x[n] / (K(x[:n + 1]) * K(x[:n - 1])))
def apply(given): (x, _j), (j, n) = given.of(All[Indexed > 0, Tuple[0, Expr]]) assert _j == j return Unequal(alpha(x[:n]), 0)
def apply(given, n): from axiom.discrete.imply.is_positive.alpha import alpha (x, _j), j = given.of(All[Indexed > 0, Tuple[1, oo]]) assert _j == j assert n > 0 return Greater(alpha(x[:2 * n]), alpha(x[:2 * n + 2]))
def apply(x): n = x.shape[0] assert x.is_positive n -= 1 assert n >= 1 return Equal(alpha(reverse(x[1:n + 1])), K(x[:n + 1]) / K(x[:n]))
def apply(given, n): (x, _j), j = given.of(All[Indexed > 0, Tuple[1, oo]]) assert _j == j assert n > 0 return Less(alpha(x[:2 * n - 1]), alpha(x[:2 * n + 1]))
def apply(x): n = x.shape[0] n -= 1 assert n >= 1 return Equal(alpha(x[:n + 1]), alpha(x[:n]) + (-1)**(n + 1) / (K(x[:n + 1]) * K(x[:n])))
def apply(x): from axiom.discrete.imply.is_positive.alpha import alpha return Unequal(alpha(x), 0)
def apply(given): (x, _j), (j, n) = given.of(All[Indexed > 0, Tuple[1, Expr]]) assert _j == j n = n - 2 return Equal(alpha(x[:n + 2]), alpha(x[:n], x[n] + 1 / x[n + 1]))
def apply(x): n = x.shape[0] assert x.is_positive assert n >= 2 return Equal(alpha(reverse(x)), H(x[:n]) / H(x[:n - 1]))
def apply(given): (x, _j), (j, n) = given.of(All[Indexed > 0, Tuple[1, Expr]]) assert _j == j return Equal(alpha(x[:n]), H(x[:n]) / K(x[:n]))