verify/after - Maple Help

verify/after

verify after calling a function

 Calling Sequence verify(x, y, 'after'(f, verification, other, arguments))

Parameters

 x, y - expressions to be verified f - transformer that will be applied to x and y before verification verification - (optional) verification to be used other, arguments - (optional) arguments passed to f after x or y

Description

 • The verify(x, y, after(f)) calling sequence returns true if f(x) and f(y) are equal.
 • The verify(x, y, after(f, ver, other, arguments)) calling sequence returns true if f(x, other, arguments) and f(y, other, arguments) compare as equal under the verification verification.
 • If you want to specify extra arguments to be passed to f, you must specify verification, too. The default verification is boolean, which tests for equality.

Examples

To see if two values have the same absolute value, you could use the verification after(abs).

 > $a≔-5$
 ${a}{≔}{-5}$ (1)
 > $b≔3+4I$
 ${b}{≔}{3}{+}{4}{}{I}$ (2)
 > $\mathrm{verify}\left(a,b,\mathrm{after}\left(\mathrm{abs}\right)\right)$
 ${\mathrm{true}}$ (3)

To see if two expressions are the same, except for the arguments to the function f, you can use this verification. Note that we have to explicitly have to specify the boolean verification in order to pass extra arguments to subsindets.

 > $a≔2+\mathrm{sin}\left(f\left(3,4\right)\right)f\left(5\right)$
 ${a}{≔}{2}{+}{\mathrm{sin}}{}\left({f}{}\left({3}{,}{4}\right)\right){}{f}{}\left({5}\right)$ (4)
 > $b≔2+\mathrm{sin}\left(f\left(1\right)\right)f\left(2,6\right)$
 ${b}{≔}{2}{+}{\mathrm{sin}}{}\left({f}{}\left({1}\right)\right){}{f}{}\left({2}{,}{6}\right)$ (5)
 > $\mathrm{verify}\left(a,b,\mathrm{after}\left(\mathrm{subsindets},\mathrm{boolean},\mathrm{specfunc}\left(f\right),\mathrm{fx}↦f\left(\right)\right)\right)$
 ${\mathrm{true}}$ (6)

To see if two lists are the same when considered as sets, except for arguments to the function f, use a variation on the previous calling sequence that uses the as_set verification.

 > $a≔\left[2+\mathrm{sin}\left(f\left(3,4\right)\right)f\left(5\right),f\left(2\right)+\mathrm{cos}\left(x\right)\right]$
 ${a}{≔}\left[{2}{+}{\mathrm{sin}}{}\left({f}{}\left({3}{,}{4}\right)\right){}{f}{}\left({5}\right){,}{f}{}\left({2}\right){+}{\mathrm{cos}}{}\left({x}\right)\right]$ (7)
 > $b≔\left[\mathrm{cos}\left(x\right)+f\left(3,5\right),\mathrm{sin}\left(f\left(2,5\right)\right)f\left(6\right)+2\right]$
 ${b}{≔}\left[{\mathrm{cos}}{}\left({x}\right){+}{f}{}\left({3}{,}{5}\right){,}{\mathrm{sin}}{}\left({f}{}\left({2}{,}{5}\right)\right){}{f}{}\left({6}\right){+}{2}\right]$ (8)
 > $\mathrm{verify}\left(a,b,\mathrm{after}\left(\mathrm{subsindets},\mathrm{as_set},\mathrm{specfunc}\left(f\right),\mathrm{fx}↦f\left(\right)\right)\right)$
 ${\mathrm{true}}$ (9)

Compatibility

 • The verify/after command was introduced in Maple 2021.