# Reliable testing of identities (example: modular functions)

Take, for illustration, the following function (bonus points for anyone who identifies where it comes from!), defined on the upper half plane:

$Assumptions = Im[τ]>0 z[τ_] = Sum[Abs[EllipticTheta[a, 0, E^(I π τ)]],{a, 2, 4}]/ (2 Abs[DedekindEta[τ]]) // FullSimplify  Now, it happens that this function is modular invariant, which means that$z(\tau+1)=z(-1/\tau)=z(\tau)\$. Now it's unsurprising that Mathematica doesn't recognise these identities using FullSimplify. But one might hope that there is another way to check and search for these and similar identities.

An obvious approach is to use PossibleZeroQ, for example:

 PossibleZeroQ[z[-1/τ] - z[τ], Assumptions -> Im[τ] > 0]


But this evaluates to False! Let's just check that we're not doing something silly by choosing some random point and checking the identity to high accuracy:

N[z[-1/τ] - z[τ] /. τ -> Sqrt[π] + 3/17 I, {Infinity, 1000}]


evaluates to zero to the given accuracy. That's convincing evidence to me!

So: what's going wrong with PossibleZeroQ? And how to write a decent identity checking function?

ContourPlot[z[x + I y] - z[-1/(x + I y)], {x, -1, 1}, {y, .001, 1},
{"ft_lang_label":"__label__en","ft_lang_prob":0.87565315,"math_prob":0.9491572,"size":1072,"snap":"2019-51-2020-05","text_gpt3_token_len":302,"char_repetition_ratio":0.09644195,"word_repetition_ratio":0.0,"special_character_ratio":0.27705225,"punctuation_ratio":0.13461539,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9892134,"pos_list":[0,1,2],"im_url_duplicate_count":[null,3,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-01-22T05:21:15Z\",\"WARC-Record-ID\":\"<urn:uuid:ed23a5cf-9242-4273-8230-24f473311ada>\",\"Content-Length\":\"136508\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:d54308aa-1f61-451c-badb-079aa0d921b3>\",\"WARC-Concurrent-To\":\"<urn:uuid:0151287b-0afd-418e-8136-acc2651cbfe4>\",\"WARC-IP-Address\":\"151.101.129.69\",\"WARC-Target-URI\":\"https://mathematica.stackexchange.com/questions/98811/reliable-testing-of-identities-example-modular-functions\",\"WARC-Payload-Digest\":\"sha1:PQEI3TAS736Z72VQWUZQX6MO2NQ66IGB\",\"WARC-Block-Digest\":\"sha1:IF2GP3NK7E6O2HONH6IOGKRYOW6LZFXB\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-05/CC-MAIN-2020-05_segments_1579250606696.26_warc_CC-MAIN-20200122042145-20200122071145-00077.warc.gz\"}"}