address: Electrical Power Technologies Group
  TÜBİTAK Energy Institute
  Ankara, Turkey
  email@example.com
title: Joint Named Entity Recognition and Stance Detection in Tweets

# Introduction

With the emergence of social media applications like Twitter and Facebook, a considerable body of social media texts has accumulated. The need for the utilization of this user-generated content, for several purposes like trend analysis, has accelerated research on social media analysis.
As acknowledged in the related literature, the language used in social media texts is usually different from well-formed texts such as news articles, where the latter has been one of the most common text genre targeted by natural language processing (NLP) research so far. As a result, approaches proposed for well-formed texts have suffered from the *porting problem*, revealed with poor performance on social media texts. One of these NLP problems is named entity recognition (NER) which targets at the extraction and classification of named entities like person, location, and organization names in texts . Several recent studies on NER report performance results on social media texts and propose customized systems for this text genre . Another important research topic regarding social media analysis is sentiment analysis where the opinion or sentiment of the text owner is explored.
Stance detection is a considerably recent research field usually considered as a subproblem of sentiment analysis . In stance detection, the aim is to determine the stance of the text owner (as *Favor*, *Against*, or *Neither*) for a particular target either explicitly or implicitly mentioned in the text . The most common text genres used by stance detection studies are on-line debates and social media texts like tweets. Some of the recent studies on this topic report performance evaluation results of different classifiers using different feature sets while others present publicly-available stance-annotated data sets .
In this study, we present our experiments of using named entities for the purposes of improved stance detection in tweets. We have used the publicly-available tweet data set in Turkish annotated with stance information, together with the results of the corresponding SVM classifiers using unigrams as features in as the baselines. We first perform NER on this data set and next use the named entities as additional features during our SVM-based stance detection experiments. Our findings are particularly encouraging as they provide evidence for the contribution of a high-performance NER system to the subsequent stance detection procedure using the extracted named entities. The rest of the paper is organized as follows: In Section 2, the evaluation results of an existing NER system on the data set are presented, the subsequent stance detection experiments using the named entities from the data set are described in Section 3, and finally Section 4 summarizes the paper together with future research directions.

# Named Entity Recognition in Tweets

NER is an information extraction task that has been studied for decades, especially on well-formed texts like news articles. More recently, considerable number of studies on NER target at social media texts, like tweets. Yet, as emphasized in the related literature , porting existing NER systems to social media texts results in poor performance. Therefore, related studies usually propose customized systems and/or annotated data sets (to be used during the training of supervised systems) for this new text genre.
In this study, we have used the stance-annotated tweet data set in Turkish which includes 700 random tweets related to two sports clubs and these clubs constitute the stance targets. The data set is a balanced one in the sense that 175 tweets are in favor of *Target-1* and 175 tweets are against *Target-1*, while 175 tweets are in favor of and 175 are against *Target-2*. There are no tweet instances annotated with the class *Neither* in the data set . The names of the two target clubs are explicitly mentioned in all of the tweets although some of these mentions are neologisms or contracted forms while some others have writing errors, as expected due to the peculiarities of language use in Twitter .
In order to create the NER answer key for this data set, we have annotated it with person, location, and organization names. The resulting named entity statistics are provided in Table .

|  |  |  | ***\# of Named Entities*** |  |  |  |
|:---|:---|:---|:---|:---|:---|:---|
| 4-7 ***Target*** | ***Stance Class*** | ***\# of Tweets*** | ***Person*** | ***Location*** | ***Organization*** | ***TOTAL*** |
| Target-1 | Favor | 175 | 12 | 17 | 207 | 236 |
|  | Against | 175 | 70 | 4 | 221 | 295 |
| Target-2 | Favor | 175 | 8 | 24 | 247 | 279 |
|  | Against | 175 | 69 | 18 | 277 | 364 |
| ***TOTAL*** |  | 700 | 159 | 63 | 952 | 1,174 |

Statistical Information About the Named Entities in the Tweet Data Set.

As the NER tool, we have used the extended version of the rule-based tool proposed for news articles in order to perform better on tweets, as presented in . These extensions include relaxing the capitalization constraint to extract entities all in lowercase as well and diacritics-based extension of the lexical resources of the tool since characters with diacritics such as *ç, ı, ö, ş* are commonly replaced with the corresponding characters such as *c, i, o, s* in tweets. The evaluation results of the NER tool on the tweet data set are presented in Table , in terms of the corresponding metrics of precision (P), recall (R), and F-Measure (F), without giving credit to partial extractions. That is, a named entity extraction is considered as correct if both its type and all of its tokens are correctly identified by the system.

| ***Target*** | ***Stance Class*** | ***P (%)*** | ***R (%)*** | ***F (%)*** |
|:-------------|:-------------------|:------------|:------------|:------------|
| Target-1     | Favor              | 73.79       | 64.41       | 68.78       |
|              | Against            | 77.14       | 36.61       | 49.66       |
| Target-2     | Favor              | 78.80       | 51.97       | 62.63       |
|              | Against            | 71.01       | 40.38       | 51.49       |

Evaluation Results of the NER Tool on the Tweet Data Set.

The NER results obtained are not favorable compared to the NER results on news articles in Turkish (usually over 85% in F-Measure) but as reported in the literature, NER performance on tweets is usually considerably lower due to the particular language use in tweets. For instance, using the same version of the NER tool, the best F-Measure rate obtained on another tweet data set in Turkish is 48.13% . The F-Measure rates given in Table are all higher than 48.13%, reaching to 68.78% for the tweets marked as in favor of *Target-1*, and therefore these rates can be considered encouraging. Yet, we should also note a difference between the features of the tweet data sets in and in the current study. As pointed out at the beginning of this section, in each of the tweets of the stance data set used in the current study, the sports clubs (a named entity of organization type) which are the stance targets are explicitly mentioned while there is no such restriction for the data sets used in . Hence, the data set used in the current study can better be considered as a "targeted tweet data set" and this may be one of the reasons for the high rates compared to those reported in .
The results in Table also indicate that NER performance is higher for the tweets marked as in favor of their targets when compared with the tweets marked as against. The recall rates are particularly low for this latter set of tweets and one of the reasons for this observation may be the users' common employment of neologisms (in the negative sense) especially for the tweet targets, which are missed by the NER tool.
To summarize, we have annotated the stance data set with named entities in order to create the NER answer key and performed NER evaluations on this data set. The results obtained are promising and even higher than those results reported for similar settings in the literature. The evaluation results obtained in the current study are significant as a new set of NER evaluations on a proprietary "targeted" tweet data set in Turkish, in addition to the data sets used in studies such as , since NER on tweets is still an important research field of NLP.

# Using Named Entities for Stance Detection in Tweets

In the current study, we have used the stance-annotated tweet data set described in . Also presented in are the results of the following experiments on this data set:

-   SVM classifiers using unigrams as features,

-   SVM classifiers using bigrams as features,

-   SVM classifiers using unigrams and the existence of hashtags in tweets as features.

The corresponding results have indicated that using unigrams as features leads to favorable performance rates and using unigrams together with hashtag features improves these results further, while using bigrams as features of the SVM classifiers results in poor performance . The favorable results corresponding to the former two settings are provided in Table as excerpted from , in order to be used as reference results for comparison purposes. These are 10-fold cross validation results on the data set. As can be observed in Table , using the existence of hashtags as an additional feature improves stance detection performance in terms of average F-Measure for *Target-2* although it leads to a slight decrease in F-Measure for *Target-1* .

|  |  | ***Unigram-Based Features*** |  |  | ***Unigram$+$Hashtag-Based Features*** |  |  |
|:---|:---|:---|:---|:---|:---|:---|:---|
| 3-8 ***Target*** | ***Stance Class*** | ***P (%)*** | ***R (%)*** | ***F (%)*** | ***P (%)*** | ***R (%)*** | ***F (%)*** |
| Target-1 | Favor | 75.2 | 92.0 | 82.8 | 75.0 | 90.9 | 82.2 |
|  | Against | 89.7 | 69.7 | 78.5 | 88.4 | 69.7 | 78.0 |
|  | **Average** | **82.5** | **80.9** | **80.6** | **81.7** | **80.3** | **80.1** |
| Target-2 | Favor | 68.5 | 83.4 | 75.3 | 70.0 | 85.1 | 76.8 |
|  | Against | 78.8 | 61.7 | 69.2 | 81.0 | 63.4 | 71.2 |
|  | **Average** | **73.7** | **72.6** | **72.2** | **75.5** | **74.3** | **74.0** |

Previous Evaluation Results of the SVM Classifiers for Stance Detection with Features Based on Unigrams and Unigrams$+$Hashtags (as Reported in ).

In this study, we investigate the possible contribution of named entities to stance detection in tweets. We do not consider named entity types as features, but instead we use named entities as additional features for SVM classifiers which have used unigrams as features. Named entities which are not inflected and which comprise only single tokens are no different than existing unigrams. However, there are named entities in the form of ngrams. Additionally, Turkish is an agglutinative language and the particular NER tool that we have employed extracts named entities in their bare forms by excluding the sequence of suffixes attached to named entities, making the corresponding single-token named entities different from unigrams. We should note that during the named entity annotation procedure to create the answer key (as explained in Section 2), bare forms of the entities are annotated, making the system results and the annotations consistent.
Similar to the settings in , we have used the SVM classifier based on the SMO algorithm , available in the Weka tool , during our stance detection experiments. 10-fold cross-validation results of the classifiers using the named entities extracted by the employed NER tool from the data set are provided in Table while the corresponding results of the classifiers using the named entities in the manually-annotated version of the data set (i.e., the answer key for the NER procedure) are provided in Table .

|  |  |  |  |  |  |  |  |
|:---|:---|:---|:---|:---|:---|:---|:---|
|  |  | ***Unigrams$+$Named Entity-Based*** |  |  | ***Unigrams$+$Named Entity*** |  |  |
|  |  | ***Features*** |  |  | ***$+$Hashtag-Based Features*** |  |  |
| 3-8 ***Target*** | ***Stance Class*** | ***P (%)*** | ***R (%)*** | ***F (%)*** | ***P (%)*** | ***R (%)*** | ***F (%)*** |
| Target-1 | Favor | 75.1 | 89.7 | 81.8 | 75.6 | 90.3 | 82.3 |
|  | Against | 87.2 | 70.3 | 77.8 | 87.9 | 70.9 | 78.5 |
|  | **Average** | **81.2** | **80.0** | **79.8** | **81.8** | **80.6** | **80.4** |
| Target-2 | Favor | 72.2 | 87.4 | 79.1 | 71.8 | 84.6 | 77.7 |
|  | Against | 84.1 | 66.3 | 74.1 | 81.3 | 66.9 | 73.4 |
|  | **Average** | **78.1** | **76.9** | **76.6** | **76.5** | **75.7** | **75.5** |

Evaluation Results of the SVM Classifiers for Stance Detection with Features Based on Unigrams$+$Named Entities and Unigrams$+$Named Entities$+$Hashtags, with Named Entities Extracted by the NER Tool.

|  |  |  |  |  |  |  |  |
|:---|:---|:---|:---|:---|:---|:---|:---|
|  |  | ***Unigrams$+$Named Entity-Based*** |  |  | ***Unigrams$+$Named Entity*** |  |  |
|  |  | ***Features*** |  |  | ***$+$Hashtag-Based Features*** |  |  |
| 3-8 ***Target*** | ***Stance Class*** | ***P (%)*** | ***R (%)*** | ***F (%)*** | ***P (%)*** | ***R (%)*** | ***F (%)*** |
| Target-1 | Favor | 74.9 | 92.0 | 82.6 | 76.3 | 92.0 | 83.4 |
|  | Against | 89.6 | 69.1 | 78.1 | 89.9 | 71.4 | 79.6 |
|  | **Average** | **82.3** | **80.6** | **80.3** | **83.1** | **81.7** | **81.5** |
| Target-2 | Favor | 74.4 | 91.4 | 82.1 | 74.3 | 90.9 | 81.7 |
|  | Against | 88.9 | 68.6 | 77.4 | 88.2 | 68.6 | 77.2 |
|  | **Average** | **81.7** | **80.0** | **79.7** | **81.3** | **79.7** | **79.5** |

Evaluation Results of the SVM Classifiers for Stance Detection with Features Based on Unigrams$+$Named Entities and Unigrams$+$Named Entities$+$Hashtags, with Named Entities in the Manually-Annotated Answer Key.

Based on the results presented in Tables , , and , the following conclusions can be drawn:

-   Using named entities as additional features improves the stance detection performance considerably for *Target-2* although a slight performance decrease is observed for *Target-1*, when compared with the case in which only the unigrams are used as features. These results indicate that stance detection task can benefit from the outputs of NER tools.

-   Using manually annotated named entities (in the answer key) improves stance detection performance for both targets and for both stance classes when compared with using named entities extracted with a NER tool. This is an expected result, since there are errors in the output of the NER tool (as quantified in Table ) where some entities are missed and some other token sequences are incorrectly extracted as named entities. This finding provides evidence for the contribution of a high-performance NER tool to the stance detection task. The less errors the employed NER tool makes, the more successful the stance detection system, utilizing the output of the NER tool, will be.

-   Joint use of named entities and existence of hashtags as additional features to unigrams improves stance detection performance slightly for *Target-1* while slight decreases are observed for *Target-2* in this settings. Hence, further experiments are necessary to make sound conclusions regarding joint utilization of named entities and hastags as features of the SVM classifiers for the stance detection task.

-   As has been reported in , the overall evaluation results of the stance detection task are considerably higher for the *Favor* class when compared with the results for the *Against* class, in all settings given in Table and .

# Conclusion

Stance detection is a relatively recent research topic similar in nature to sentiment analysis. The aim of stance detection is to determine the stance of a text owner for a particular target and stance detection modules can be used within several different social media analysis applications. In this study, we have first performed NER on a stance-annotated tweet data set in Turkish and then investigated the possible contribution of named entities as SVM features for the stance detection task. During this procedure, we have first reported the evaluation results of a NER tool that has been extended to be perform better on tweets and then have utilized the extracted named entities as additional features to SVM classifiers which already employ unigrams as features. Our results indicate that named entities can considerably improve the stance detection performance when used together with unigrams. Future work includes testing the same classifier settings on larger data sets, and performing similar tests by using stance-annotated data sets and NER tools for other languages such as English and compare the corresponding test results with the ones in the current study.


author: Bjoern S. Schmekel
Theoretical Astrophysics Center
University of California, Berkeley, California 94720
bibliography: bib.bib
title: Quasi-local definitions of energy in general relativity

Defining energy is a surprisingly difficult problem in general relativity. For instance, the energy density of the gravitational field of a planet at a particular point could be determined by a comoving observer measuring the kinetic energy of a freely falling object. Due to the equivalence principle both the object and the observer fall at equal rates. Therefore, the observer would not assign any energy to the object. Other observers like an observer who is at rest with respect to the planet would measure different values. This raises the question of how energy depends on the choice of an observer which violates the philosophy of general relativity whose tensorial equations are independent of the used reference system.

In classical electrodynamics the stress-energy tensor is a measure of the energy and momentum transported by the electromagnetic field due to a source distribution $j^\mu$. A similar construction in general relativity leads to the so-called Bel-Robinson tensor $T_{\mu \nu \rho \sigma}$ which can be thought of as being induced by a stress-energy tensor $T_{\mu \nu}$. Its physical meaning however remains unknown since it does not even have units of energy density. This is a consequence of the equivalence principle which equates the gravitational mass (the "charge" of gravity) with the inertial mass. The source term, i.e. $j_\mu$ in electrodynamics and $T_{\mu \nu}$ in general relativity, does not contain the energy of the gravitational field. However, since the equations of general relativity are non-linear there may be a non-linear contribution to the stress-energy. For instance, gravitational waves do not pass through each other without distortion.

Due to the absence of Stokes theorem for second ranked tensors conserved quantities do not exist.

Landau and Lifshitz were able to prove that the stress-energy-momentum pseudotensor $$\begin{aligned}
16 \pi G t^{\mu \nu} = (-g)^{-1} \left [ (-g) \left ( g^{\mu \nu} g^{\rho \sigma}
- g^{\mu \rho} g^{\nu \sigma} \right ) \right ]_{,\rho \sigma} - 2 G^{\mu \nu}
\end{aligned}$$ is the only symmetric pseudotensor constructed only from the metric such that the four-divergence of the total stress energy vanishes like $\left [ (-g)(T^{\mu \nu} + t^{\mu \nu} ) \right ]_{,\mu}=0$ and which also vanishes locally in an inertial frame. The latter requirement is dictated by the equivalence principle as was mentioned above. However, $t^{\mu \nu}$ still does not transform as a tensor.

Because of the problems associated with defining a local energy density it may be easier to make sense of the energy enclosed by a boundary. For regions of finite extend we expect non-zero values because in general a coordinate transformation can make the connection coefficients vanish at only one point.

Therefore, it seems the only sensible way to define energy is by defining energy itself and not energy density. Of course this may seem ugly because a local covariant and tensorial formulation depends on densities evaluated at a point and its infinitesimally small neighborhood (in order to compute derivatives). A point remains a point under a Lorentz transformation, but needless to say the size of a finite region depends on the observer, so obviously such an energy will depend on the chosen coordinate system. It is therefore maybe not surprising that the first useful notions of energy were defined at infinity, i.e. they enclosed the whole system (cf. ADM mass , Bondi mass ). Like a point an infinitely large box does not change its size under a change of observer.

A successful definition of quasi-local energy (QLE) was given by Brown and York . A spacelike three-dimensional hypersurface $\Sigma$ is embedded in a four-dimensional spacetime $M$ which satisfies the Einstein field equations. This embedding defines the "time-direction". Finally, a two-dimensional boundary $B$, which encloses the energy of the region we are interested in, is embedded in the three-dimensional hypersurface $\Sigma$. $\Sigma$ is enclosed by a three-boundary $^3 B$, and their normals are constrained to be perpendicular to each other. This restriction ensures the time evolution of the system is consistent with the presence of the fixed boundary $B$. In classical mechanics the Hamiltonian is given by the variation of the classical action with respect to the endpoints times minus one. The Brown-York QLE is derived by considering the change of the classical action under a displacement of the initial and final hypersurfaces and is given by $$\begin{aligned}
E = \frac{1}{\kappa} \int_B d^2 x \sqrt{\sigma} \left ( k - k_0 \right )
\end{aligned}$$ where $k$ is the trace of the extrinsic curvature of $B$ and $\sigma$ is the metric of $B$. The surface gravity is denoted by $\kappa$, and $k_0$ is a reference term which sets the energy of flat space to zero. The subtraction term has been criticized. However, it should be mentioned that the ADM energy makes reference to flat space as well by using ordinary non-covariant derivatives.

For a Schwarzschild black hole the action can be expressed in terms of the QLE as follows $$\begin{aligned}
S = \frac{8\pi}{\kappa} \int (N dt) (r f)
\end{aligned}$$ where $-r f$ is the unreferenced QLE. The metric has been expressed as $ds^2 = - N^2(r) dt^2 + f^{-2}(r) + r^2 d \Omega^2$ where $N(r)=f(r) = \sqrt{1- 2m/r}$. Because the geodesics of infalling objects can be determined both inside and outside of a black hole it should be possible to assign a value to the energy of the gravitational field in both regions. The definition of $E$ can be continued into the region inside the horizon . Since both $N$ and $f$ become imaginary inside the horizon $-rf$ needs to be multiplied by $i$ in order to become real.

Whether the quantity defined above is useful depends on its properties and whether applications exist. At infinity the QLE is equal to the ADM energy. Furthermore, it reduces to the Newtonian binding energy in the non-relativistic limit. In the thermodynamics of black holes the QLE is just the total energy. Blau and Rollier have shown that the extended Brown-York energy describes the effective potential of a particle falling into a black hole . Also worth mentioning is the small sphere limit . In this limit the QLE reduces to the energy of the enclosed matter. The gravitational binding energy only shows up in higher orders of the radius which emphasizes the fact that one cannot make sense of the energy of the gravitational field locally. This may be seen as a hint that point particles do not exist .

The most serious drawback is that fact that not all physically interesting boundaries $B$ can be embedded in a reference space which is typically taken to be $\mathcal{R}^3$ leading to a non-existence of the reference term. An important example is the horizon of a Kerr black hole. Usually only energy differences are important, so the absence of the reference term might not lead to problems. However, the stability of flat space rests on the fact that every non-flat spacetime contains more energy that the flat ground state . Therefore, Epp and subsequently Liu und Yau considered a modification of the Brown-York energy which does not need the three-boundary $^3 B$. Rather, the two-boundary $B$ is embedded directly into the four-dimensional spacetime $M$, and the orthogonality condition is not applicable anymore. Such an embedding does always exist. However, it is not unique. The absence of the orthogonality condition implies that the observer is not at rest anymore with respect to $B$. Denoting the trace of the normal momentum surface density by $l$ which measures the expansion of $B$ in time the boost-invariant QLE becomes $$\begin{aligned}
E = \frac{1}{\kappa} \int_B d^2 x \sqrt{\sigma} \left ( \sqrt{k^2-l^2} - \sqrt{k_0^2-l_0^2} \right )
\end{aligned}$$ The most attractive feature of the boost-invariant QLE is certainly its independence of the observer. It can attain complex values if $B$ is located inside the event horizon of a black hole. Also, the integrand of the unreferenced boost-invariant QLE is always positive (if real), whereas the Brown-York QLE depends on the extrinsic curvature of $B$ which can be positive or negative.

Ultimately, the usefulness of the described quantities will depend on the availability of applications. A more thorough review of the problems associated with quasi-local energy can be found in .

# Acknowledgments

Research support has been received from the National Science Foundation under contract \#AST-0507813. The author also wishes to thank M.-T. Wang and S.-T.Yau for discussions.


abstract: Using transfer-matrix extended phenomenological renormalization-group methods the critical properties of spin-1/2 Ising model on a simple-cubic lattice with partly anisotropic coupling strengths ${\vec J}=(J',J',J)$ are studied. Universality of both fundamental critical exponents $y_t$ and $y_h$ is confirmed. It is shown that the critical finite-size scaling amplitude ratios $U=A_{\chi^{(4)}}A_\kappa/A_\chi^2$, $Y_1=A_{\kappa^{''}}/A_\chi$, and $Y_2=A_{\kappa^{(4)}}/A_{\chi^{(4)}}$ are independent of the lattice anisotropy parameter $\Delta=J'/J$. By this for the last above invariant of the three-dimensional Ising universality class we give the first quantitative estimate: $Y_2\simeq2.013$ (shape $L\times L\times\infty$, periodic boundary conditions in both transverse directions).
author: M. A. Yurishchev
date:  Institute of Problems of Chemical Physics of the Russian Academy of Sciences, 142432 Chernogolovka, Moscow Region, Russia
title:  **Universality in the partially anisotropic three-dimensional Ising lattice**

PACS numbers: 05.50.+q, 05.70.Jk, 64.60.Fr, 75.10.Hk

# Introduction

The phenomenological renormalization-group (RG) method in which the transfer-matrix technique and finite-size scaling (FSS) ideas are combined is a powerful tool for investigation of critical properties in different two-dimensional systems . Unfortunately, its application in three and more dimensions is sharply retarded due to huge sizes of transfer matrices which arise in approximations of $d$-dimensional lattices by $L^{d-1}\times\infty$ subsystems.

Indeed, even in the simplest case of systems with only two states of a site (a spin-${1\over2}$ Ising model) the order of transfer matrix in three dimensions ($d=3$) increases according to the law $2^{L^2}$ (instead of the essentially more sparing law $2^L$ in two dimensions). Hence, for the cluster $3\times3\times\infty$ it is needed to solve the eigenproblem of the transfer matrix $512\times512$, for the $4\times4\times\infty$ subsystem — $65\,536\times65\,536$, and for the $5\times5\times\infty$ cluster it is required to find the eigenvalues and eigenvectors of dense matrices with huge sizes of $33\,554\,432$ by $33\,554\,432$.

One can now solve the full eigenproblem for the transfer matrices of Ising parallelepipeds $L\times L\times\infty$ with the side length $L\le4$. Our aim in this paper is to use such solutions with the largest effect and extract as much as possible accurate information about physical properties of the bulk system.

The ordinary phenomenological RG is based on the FSS equations for correlation lengths . However, it is known that the phenomenological RG can be built up using other quantities with a power divergence at the phase-transition point. It is remarkable that the such modified renormalizations can provide more precise results by the same sizes of subsystems .

In this paper we calculate the values of different invariants of the 3D Ising universality class and discuss their universal and extrauniversal properties.

# Basic equations

Start from the ordinary FSS equations for the inverse correlation length $\kappa_L(t,h)$ and singular part of the dimensionless free-energy density $f^s_L(t,h)$, but we write them out for the derivatives with respect to the reduced temperature $t=(T-T_c)/T_c$ and external field $h$: $$\label{eq:kappa^mn}
   \kappa_L^{(m,n)}(t, h)
   = b^{my_t+ny_h-1}\kappa_{L/b}^{(m,n)}(t', h')$$ and $$\label{eq:f^smn}
   f_L^{s\,(m,n)}(t, h)
   = b^{my_t+ny_h-d}f_{L/b}^{s\,(m,n)}(t', h').$$ Here $\kappa_L^{(m,n)}(t,h)=\partial^{m+n}\kappa_L/\partial t^m\partial h^n$ and the same for $f_L^{s\,(m,n)}$; $y_t$ and $y_h$ are, respectively, the thermal and magnetic critical exponents of the system; $b=L/L'$ is the rescaling factor. Deriving Eqs. () and () we used a linearized form of RG equations $t'\simeq b^{y_t}t$ and $h'\simeq b^{y_h}h$.

In the traditional phenomenological RG theory , Eq. () with $m=n=0$ is considered as an RG mapping $(t,h)\to (t',h')$ for a cluster pair $(L,L')$. By this, the critical temperature $T_c$ is estimated from the equation $$\label{eq:kappaTc}
   L\kappa_L(T_c)=L'\kappa_{L'}(T_c).$$

Phenomenological renormalization $(t,h)\to (t',h')$ can be also realized by using any of the relations () and () or their combination. It has been shown by the author that some of such extended renormalizations lead to more rapid convergence in $L$ than the standard phenomenological RG transformation. In particular, test examples on the fully isotropic systems exhibited that the relations $$\label{eq:kappa2}
   \frac{\kappa_L^{''}}{L^{d-1}\chi_L}\Big|_{T_c}=
   \frac{\kappa_{L'}^{''}}{(L')^{d-1}\chi_{L'}}\Big|_{T_c}$$ and $$\label{eq:chi4}
   \frac{\chi_L^{(4)}}{L^d\chi_L^2}\Big|_{T_c}=
   \frac{\chi_{L'}^{(4)}}{(L')^d\chi_{L'}^2}\Big|_{T_c}$$ locate $T_c$ more accurately in comparison with the ordinary RG equation (). In the relations () and (), the derivative $\kappa_L^{''}=\partial^2\kappa_L/\partial h^2$, the zero-field susceptibility $\chi_L=f_L^{s\,(0,2)}$, and the nonlinear susceptibility $\chi_L^{(4)}=f_L^{s\,(0,4)}$ can be evaluated by standard formulas via the eigenvalues and eigenvectors of transfer matrices (see, e. g., ).

To get the thermal critical exponent $y_t$ we applied two approaches. Firstly, we used again the standard finite-size expression $$\label{eq:yt1}
   y_t=\frac{\ln[L\dot\kappa_L/(L'\dot\kappa_{L'})]}{\ln(L/L')}$$ which follows from Eq. () by $m=1$, $n=0$; $\dot\kappa_L=\partial\kappa_L/\partial t$. Secondly, we took the formula $$\label{eq:yt2}
   y_t=\frac
   {\kappa_{L'}\dot\kappa_L-\kappa_L\dot\kappa_{L'}}
   {(\kappa_L\kappa_{L'}\dot\kappa_L\dot\kappa_{L'})^{1/2}\ln(L/L')}.$$ This expression is a direct sequence of the well-known Roomany-Wyld approximant to the Callan-Symanzik $\beta$-function .

To calculate the magnetic critical exponent $y_h$ we also used two ways: $$\label{eq:yh1}
   y_h={d\over2}+\frac{\ln(\chi_L/\chi_{L'})}{2\ln(L/L')}$$ and $$\label{eq:yh2}
   y_h={1\over2}+\frac{\ln(\kappa_L^{''}/\kappa_{L'}^{''})}{2\ln(L/L')}$$ \[these finite-size relations follow from Eqs. () and ()\].

In addition, we calculated the universal ratios of critical FSS amplitudes. Such a kind of the ratios can be identified from the Privman-Fisher functional expressions . For the discussed anisotropic systems, they read $$\label{eq:kappa}
   \kappa_L(t, h)
   = L^{-1}G_0{\cal K}(C_1tL^{y_t}, C_2hL^{y_h})$$ and $$\label{eq:fs}
   f_L^{s}(t, h)
   = L^{-d}G_0{\cal F}(C_1tL^{y_t}, C_2hL^{y_h}).$$ Scaling functions ${\cal K}(x_1, x_2)$ and ${\cal F}(x_1, x_2)$ are the same within the limits of a given universality class but they may depend on the boundary conditions and the subsystem shape (a cube, infinitely long parallelepipeds, etc.). Thus, all nonuniversality *including the lattice anisotropy parameter $\Delta$* is absorbed in the geometry prefactor $G_0$ and metric coefficients $C_1$ and $C_2$. The critical amplitude ratios from which the parameters $G_0$, $C_1$, and $C_2$ drop out should be extrauniversal. In particular, the amplitude combinations $$\label{eq:Q}
   U=\frac{A_{\chi^{(4)}}A_\kappa}{A_\chi^2}=
   \frac{\kappa_L\chi_L^{(4)}}{L^{d-1}\chi_L^2}$$ (Binder-like ratio for the spatially anisotropic systems), $$\label{eq:Y1}
   Y_1=\frac{A_{\kappa^{''}}}{A_\chi}=
   \frac{\kappa_L^{''}}{L^{d-1}\chi_L},$$ and $$\label{eq:Y2}
   Y_2=\frac{A_{\kappa^{(4)}}}{A_{\chi^{(4)}}}=
   \frac{\kappa_L^{(4)}}{L^{d-1}\chi_L^{(4)}}$$ are expected to be not depend on the lattice anisotropy parameter $\Delta=J'/J$.

# Results and discussion

In the present paper we carried out calculations for the subsystems $L\times L\times\infty$ with $L=3$ and 4. To avoid undesirable surface effects the periodic boundary conditions have been imposed in both transverse directions of parallelepipeds $L\times L\times\infty$. Thus, the transfer matrices for which the eigenproblems was solved were dense matrices of sizes up to $65\,536\times 65\,536$. To solve the eigenproblem we took into account the internal and lattice symmetries of subsystems and used the block-diagonalization method (see, e. g., ). Calculations were performed on an 800 MHz Pentium III PC running the FreeBSD operating system.

## Critical temperature

The critical temperature estimates coming from solutions of the transcendental equations () and () are collected in Table .

In the purely isotropic case $(J'=J)$ there are high precision numerical estimates for the critical point of the 3D Ising model. The most precise values for it have been obtained by Monte Carlo simulations ; $K_c=0.221\,654\,59(10)$, i. e. $k_BT_c/J=1/K_c=4.511\,5240(21)$.

Inspecting Table  one can see that the estimates for $J'=J$ which follow from Eq. () and () are the lower and upper bounds respectively. By this, their mean value has the accuracy of $0.01\%$. Note also that our mean estimate is better than the value $k_BT_c/J=4.533\,71$ obtained in Ref.  (see also ) for the fully isotropic lattice by using the ordinary phenomenological renormalization of the bars with $L=4$ and 5.

Discuss now the anisotropic case. Here there is well-known exact asymptotic formula for the critical temperature $$\label{eq:TcQ1D}
   (k_BT_c/J)_{asym}=2/[\ln(J/2J') - \ln\ln(J/2J') + O(1)]$$ as $J'/J\to0$. It is a direct consequence of the molecular-field approximation in which the linear Ising chain is taken as a cluster.

Unfortunately, simple formula () yields considerable errors in the region $10^{-3}\le J'/J\le1$. Its modifications in spirit of Ref. , $k_BT_c/J\approx2/[\ln(J/J') - \ln\ln(J/J')]$, lead to a loss of monotonous convergence when $J'/J$ varies from unity to zero.

We choose infinitely long clusters $L\times L\times\infty$ stretched in a lattice direction with the dominant interaction $J$. Such a cluster geometry reflects the physical situation in the system. Therefore one may expect more precise results for the critical temperature as the anisotropy of the quasi-one-dimensional lattice increases. We may also expect the monotonous convergence for the estimates from Eq. () and () because there are must be physical reasons (finite length of clusters in the longitudinal direction, etc.) for the non-monotonous or oscillatory character of behavior; they are absent in our approximations. That is, if Eq. () yields the lower bound in the most unfavorable case $J'=J$ then it should preserve such behavior for all $J'<J$. Similar arguments are valid for the estimates following from Eq. (); these estimates are upper.

Note that the mean values from Table  are better not only than the estimates of $k_BT_c/J$ calculated with the $(3,4)$ cluster pair by the standard phenomenological RG method, but than their improvements found by means of three-point extrapolations from the sizes $L=2$, 3, and 4 to the bulk limit .

In the range $10^{-2}\leq J'/J\leq1$, there are also the data for the critical temperature of a simple-cubic Ising lattice which were extracted from the Padé-approximant analysis of the high-temperature series . For $J'=J$ according to these data, $k_BT_c/J=4.5106$ that is lower by $0.014\%$ in comparison with the results of Ref. . For $J'/J=0.1$ the authors of Ref.  found the value $k_BT_c/J=1.343$. This quantity overestimates somewhat the mean value from Table . At last, for $J'/J=0.01$ the series method yields $k_BT_c/J=0.65$ that goes out of our lower bound. This is not surprising because the calculations based on the high-temperature series rapidly deteriorate owing to the very limited number ($\le11$) of terms available in such series for the anisotropic lattices.

So, we may treat the values found from Eqs. () and () as lower and upper bounds on the real critical temperature. Their mean value for each $J'/J$ yields the best estimate which we achieve in this paper for the reduced critical temperature $k_BT_c/J$ (the last column in Table ). By this, its absolute error is not larger in any case than the half difference of the corresponding upper and lower bounds. Using data from Table  we establish that the relative errors for $k_BT_c/J$ monotonically decrease from $0.72\%$ to $0.14\%$ as $J'/J$ goes from 1 to $10^{-3}$.

## Invariants of the 3D Ising universality class

Taking the improved estimates for the critical temperature of anisotropic simple-cubic lattice we calculate now some invariants of the three-dimensional Ising model universality class.

### Critical exponents

According to the RG theory, critical exponents are determined entirely by a fixed point and do not depend on the lattice anisotropy. For a three-dimensional Ising model the universality of critical exponents has been confirmed for $\Delta\in[0.2,5]$ by the high-temperature series calculations .

At present, the most precise estimates of critical exponents are provided by the high-temperature expansions for ordinary models and for models with improved potentials characterized by suppressed leading scaling corrections . For the 3D Ising lattice (fully isotropic) these methods yield $\nu=0.630\,12(16)$ and $\gamma=1.2373(2)$. Hence, $y_t=1/\nu=1.5870(4)$ and $y_h=(d+\gamma/\nu)/2=2.481\,80(18)$.

In Table  we report our estimates for the critical exponents $y_t$ and $y_h$. It follows from those data that when the lattice anisotropy parameter $\Delta$ varies in three orders (from unity to $10^{-3}$), the estimates of critical exponents are changed only on a few per cent or less. In particular, calculations by Eqs. () and () with the cluster pair $(3,4)$ yield respectively $y_t=1.47\{6\}$ and $y_t=1.60\{7\}$. (Here and below, the numbers in curly brackets are dispersions of averages over the lattice anisotropy parameter $\Delta$.) Their variations are over the range $4-4.4\%$. Similar calculations of the magnetic critical exponent carried out by use of Eqs. () and () also with the pair $(3,4)$ leads to $y_h=2.586\{5\}$ and $y_h=2.579\{5\}$, correspondingly. Relative dispersions of these estimates are about $0.2\%$.

Thus, our calculations confirm the universality of both critical exponents in an essentially wider range of $\Delta$ than it was done in earlier investigations. Systematic errors of the achieved estimates arise due to small sizes, $L$, of subsystems used.

### Critical FSS amplitude ratios

Critical amplitudes are determined by scaling functions. As a result, their "universal ratios" like $A_{\kappa^{(4)}}/A_{\chi^{(4)}}
={\cal K}^{(0,4)}(0,0)/{\cal F}^{(0,4)}(0,0)$ depend, generally speaking, upon the lattice anisotropy because it can change the shape of subsystems. But in the case of parallelepipeds $L^{d-1}\times\infty$ with unchanged (between themselves) transverse coupling constants the shape of a sample (all its aspect ratios) will be independent of the interaction in longitudinal direction. Such a kind of the universality is studied here.

Table  contains results of our calculations for the critical FSS amplitude ratios $U=A_{\chi^{(4)}}A_\kappa/A_\chi^2$, $Y_1=A_{\kappa^{''}}/A_\chi$, and $Y_2=A_{\kappa^{(4)}}/A_{\chi^{(4)}}$. Calculations have been carried out for $\Delta\in[10^{-3},1]$ by use of a cyclic cluster $4\times4\times\infty$.

In accord with data of Table , the average ratio $U=4.900\{3\}$. Hence, when the anisotropy parameter $\Delta$ varies in three orders, this quantity changes only on $0.06\%$. With such accuracy we may consider the given ratio as a constant. In the case of fully isotropic lattice, $A_\kappa=1.26(5)$ and $A_{\chi^{(4)}}/A_\chi^2=3.9(2)$ and therefore $A_{\chi^{(4)}}A_\kappa/A_\chi^2=4.9(5)$. Our values of $U$ from Table  are in good agreement with this estimate.

It is follow from Table  that $Y_1=A_{\kappa^{''}}/A_\chi=1.759(2)$. Hence, the constancy of this universal amplitude ratio is estimated at least as a few times $10^{-3}$. Our average value for $Y_1$ agrees well with the estimate for the isotropic lattice, $A_{\kappa^{''}}/A_\chi=1.749(6)$ .

According to data of Table  the amplitude ratio $Y_2=A_{\kappa^{(4)}}/A_{\chi^{(4)}}=2.0133\{6\}$. Thus, this quantity is most stable out of all invariants of the 3D Ising universality class which were investigated in the paper. Note that we are not aware of any quantitative estimates for the $A_{\kappa^{(4)}}/A_{\chi^{(4)}}$.

# Conclusions

In this paper the large-scale transfer-matrix computations have been carried out. Application of the extended phenomenological RG schemes allowed to find the tight limits on the critical temperature in the anisotropic simple-cubic Ising lattice and improve the available estimates for it.

We calculated the thermal and magnetic critical exponents. Our results confirm the universality of $y_t$ within $4-4.4\%$ and of $y_h$ within $0.2\%$ over a remarkably wider range of $\Delta$ $(10^{-3}\le\Delta\le 1)$ than in Ref. .

Finally, the presented results give an obvious evidence that the critical FSS amplitude ratios $U=A_{\chi^{(4)}}A_\kappa/A_\chi^2$, $Y_1=A_{\kappa^{''}}/A_\chi$, and $Y_2=A_{\kappa^{(4)}}/A_{\chi^{(4)}}$ do not depend on the lattice anisotropy parameter $\Delta=J'/J$ with accuracies at least $0.1\%$. We give likely for the first time in the literature an estimate for the universal quantity $Y_2$.

# Acknowledgment

This work was supported by the Russian Foundation for Basic Research under project 03-02-16909.

|          |                |                |            |
|:---------|:--------------:|:--------------:|:----------:|
|          |                |                |            |
| $\Delta$ | ${\rm Eq.}(4)$ | ${\rm Eq.}(5)$ |    mean    |
| 1.0      |   4.47965814   |   4.54424309   | 4.51195062 |
| 0.5      |   2.91008665   |   2.94295713   | 2.92652189 |
| 0.1      |   1.33649605   |   1.34570054   | 1.34109829 |
| 0.05     |   1.03544938   |   1.04144927   | 1.03844933 |
| 0.01     |   0.65054054   |   0.65323146   | 0.65188600 |
| 0.005    |   0.55440490   |   0.55643112   | 0.55541801 |
| 0.001    |   0.40743000   |   0.40859011   | 0.40801006 |

Lower and upper bounds on the critical temperature and their mean values (improved estimates of $k_BT_c/J$) in the 3D sc spin-${1\over2}$ Ising lattice vs $\Delta=J'/J$. Calculations with a cluster pair $(3,4)$.

|  |  |  |  |  |  |  |
|:---|:--:|:--:|:--:|:--:|:--:|:--:|
|  |  |  |  |  |  |  |
|  |  | $\qquad\qquad\qquad y_t$ |  |  | $\qquad\qquad\qquad y_h$ |  |
|  |  |  |  |  |  |  |
| 3-4 |  |  |  |  |  |  |
| $\Delta$ | $k_BT_c/J$ | ${\rm Eq.}(6)$ | ${\rm Eq.}(7)$ |  | ${\rm Eq.}(8)$ | ${\rm Eq.}(9)$ |
| 1.0 | 4.51195062 | 1.5760695 | 1.7246286 |  | 2.5971647 | 2.5886128 |
| 0.5 | 2.92652189 | 1.5256373 | 1.6636718 |  | 2.5902006 | 2.5819462 |
| 0.1 | 1.34109829 | 1.4700811 | 1.5972576 |  | 2.5843305 | 2.5766511 |
| 0.05 | 1.03844933 | 1.4533899 | 1.5791439 |  | 2.5836720 | 2.5761101 |
| 0.01 | 0.65188600 | 1.4236178 | 1.5480583 |  | 2.5832982 | 2.5758028 |
| 0.005 | 0.55541801 | 1.4141719 | 1.5383503 |  | 2.5832029 | 2.5757888 |
| 0.001 | 0.40801006 | 1.3984754 | 1.5222765 |  | 2.5834573 | 2.5757953 |
|  |  | 1.47{6} | 1.60{7} |  | 2.586{5} | 2.579{5} |

Estimates of the thermal and magnetic critical exponents by different values of $\Delta=J'/J$. Calculations with a cluster pair $(3,4)$.

|          |            |           |           |           |
|:---------|:----------:|:---------:|:---------:|:---------:|
|          |            |           |           |           |
| $\Delta$ | $k_BT_c/J$ |    $U$    |   $Y_1$   |   $Y_2$   |
| 1.0      | 4.51195062 | 4.8956599 | 1.7550004 | 2.0146443 |
| 0.5      | 2.92652189 | 4.8967625 | 1.7572512 | 2.0136519 |
| 0.1      | 1.34109829 | 4.9011909 | 1.7596003 | 2.0129829 |
| 0.05     | 1.03844933 | 4.9014406 | 1.7597697 | 2.0129285 |
| 0.01     | 0.65188600 | 4.9015375 | 1.7598563 | 2.0128977 |
| 0.005    | 0.55541801 | 4.9015529 | 1.7598646 | 2.0128953 |
| 0.001    | 0.40801006 | 4.9015782 | 1.7598732 | 2.0128938 |
|          |            | 4.900{3}  | 1.759{2}  | 2.0133{6} |

Estimates of the universal critical FSS amplitude ratios $U=A_{\chi^{(4)}}A_\kappa/A_\chi^2$, $Y_1=A_{\kappa^{(2)}}/A_\chi$, and $Y_2=A_{\kappa^{(4)}}/A_{\chi^{(4)}}$ for the Ising system with the cylindrical geometry $L\times L\times\infty$ and periodic boundary conditions. Data for $L=4$.


abstract: *Magic: the Gathering* is a popular and famously complicated card game about magical combat. Recently, several authors including Chatterjee and Ibsen-Jensen (2016) and Churchill, Biderman, and Herrick (2019) have investigated the computational complexity of playing *Magic* optimally. In this paper we show that the "mate-in-$n$" problem for *Magic* is $\Delta^0_n$-hard and that optimal play in two-player Magic is non-arithmetic in general. These results apply to how real Magic is played, can be achieved using standard-size tournament legal decks, and do not rely on stochasticity or hidden information. Our paper builds upon the construction that Churchill, Biderman, and Herrick (2019) used to show that this problem was at least as hard as the halting problem.
author: Stella Biderman
bibliography: fun_submission.bib
title: Magic: the Gathering is as Hard as Arithmetic

Billy Editor and Bill Editors 2 Conference/workshop/symposium title on which this volume is based on 1 1 1

# Introduction

## Background

*Magic: the Gathering* (also known as *Magic*) is a popular trading card game owned by Wizards of the Coast. Due to it's highly complex game play and popularity with mathematically-minded players, there has been a significant amount of research on the computational complexity of the game .

Although there are many questions about games that are investigated in algorithmic game theory, the central and most important one is *how hard is it to play a game optimally?* The investigation of this question for *Magic* was begun by Churchill, Biderman, and Herrick (2019) , who proved the following theorem:

This theorem establishes *Magic* is unlike many other games in that there can be no remaining unforced moves for either player, and yet the outcome of the game can be difficult to determine. Based on this, we define an *end game* in *Magic* to be a game state in which there are no remaining decisions for either player to make and posit that the interesting version of the traditional "mate-in-$n$" question is to identify a sequences of $n$ moves that result in an end game, even if the game isn't formally over at that point in time. With this idea in mind, we prove the following theorems:

To prove this, we will use the *Magic* Turing machine and the correspondence established by Post's Theorem to create games of *Magic* where optimal play requires identifying the truth of arithmetic sentences with $n$ alternating quantifiers. As our notion of an *end game* doesn't effect anything in the limit, this generalizes to give

## Previous Work

The computational complexity of checking the legality of a particular decision in *Magic* (blocking) is investigated in and is found to be coNP-complete. There have also been a number of papers investigating practical algorithms and artificial intelligence approaches to playing *Magic* . Esche (2018) briefly considers the theoretical computational complexity of *Magic* and states an open problem that has a positive answer only if *Magic* end-games are decidable. Churchill (2012) began the investigation of the computational complexity of *Magic: the Gathering* in general and Churchill, Biderman, and Herrick (2019) prove that it is at least $\emptyset'$.

While Churchill, Biderman, and Herrick (2019) is the only work we are aware of showing that a real-world two-player game is non-computable, other puzzle games have been shown to be non-computable. The first example was the indie game Braid by Hamilton (2014) . More recently, Demaine, Kopinsky, and Lynch (2020) show that the puzzle game Recursed is not recursive.

Additionally, there has been recent success at showing that multiplayer team games are undecidable. Coulombe and Lynch (2019) show that several video games including *Super Smash Bros. Melee* and *Mario Kart* are undecidable using the Constraint Logic framework . Demaine, Kopinsky, and Lynch (2020) consider these to be real-world undecidable games, though we respectfully disagree. The constructions require creating custom game boards that do not exist in the game as it was published. While the rules of these games allow for the *potentiality* of non-computable optimal strategy, we feel that the game as it was published does not actual require non-computable optimal strategy.

## Our Contribution

Our result extends the work of Churchill, Biderman, and Herrick and proves that optimal play in *Magic: the Gathering* is at least as hard as $\emptyset^{(\omega)}$. Our result is the first result showing a real or realistic game has a $\Delta^0_n$-hard "mate-in-$n$" problem and the first result showing a real or realistic game can be non-arithmetic in general. Our review of the literature shows no sign that previous researchers had considered that real-world games could be harder than $\emptyset'$, and we hope that this example will encourage researchers to look for other games that are harder than $\emptyset'$.

## Overview

The paper is structured as follows. In Section we provide background information relevant to this work, including previous work on *Magic: the Gathering* Turing machines and some comments on "0-player" *Magic*. In Section we extend this work to games with strategic decisions to prove **Theorem ** and **Theorem **. In we discuss implementing our construction in a real-world environment. Finally, in Section we summarize our main points and identify avenues for future work.

Readers not familiar with *Magic: the Gathering* can refer to Appendix for an introduction to the rules of the game.

# Preliminaries

As discussed in Churchill, Biderman, and Herrick (2019) , *Magic: the Gathering* has an encoding problem. The rules allow players to choose numbers but doesn't specify how they are supposed to be encoded which can lead to non-computability that is incidental to the game's strategy, as determining if two different expressions represent the same number is non-computable in general. We will follow them by requiring players to specify numbers in binary notation to remove any ambiguity. Rule 107.1 of the *Magic: the Gathering Comprehensive Rules* states that all game values in *Magic* are integers[^1], so binary notation can express any possible value unambiguously.

With this restriction, Churchill, Biderman, and Herrick conjecture

*Conjecture 1*. The function that takes a board state and a legal move and returns the next board state in *Magic: the Gathering* is computable.

In this conjecture we say "a legal move" because it is also not obvious that checking to see if a move is legal is computable. This is a particularly thorny issue as *Magic* has rules for how to proceed in the event of a player making an illegal move. This means that in some scenarios a move is "illegal" in the sense that the rules tell you to not do it, but not "illegal" in the sense that you're *unable* to do it. At tournaments officials are allowed to disqualify players who, in their judgement, are deliberately making "mistakes" to gain advantage. While our construction doesn't involve these "illegal but within the rules" moves, it's possible that this is an issue future work has to grapple with. We, like Churchill, Biderman, and Herrick, leave handling checking the legality of a move to future work.

## "Zero-Player" *Magic: the Gathering*

At no point in the operation of Churchill, Biderman, and Herrick's *Magic* Turing machine does a player have the ability to make any moves or influence the game in any way, despite the fact that the game officially goes on for many more turns. This is an unusual property of *Magic*, as in most games at least one player will have non-trivial strategic decisions for nearly the entirety of the game. This means that some *Magic* board states can be thought of as simulations, akin to Conway's *Game of Life*. Like *Game of Life*, the evolution of that simulation is Turing complete in general. As a result, in order to study game-theoretic questions we need a broader notion of a game being "finished" than one would usually use. Even if a game has not formally ended, when all moves for both players are forced for the rest of the game the game is *strategically finished*.

This property of *Magic: the Gathering* motivates the following definition:

**Definition 1**. A game is in an *end game state* if there are no unforced moves for either player remaining. In such a scenario, we call the game an *end game*.

Using this definition, we can rephrase **Theorem ** as Determining the winner of a *Magic: the Gathering* end game is undecidable.

This definition also allows us to ask new questions about games, such as "can we identify end games." For *Magic*, the answer to this question is *partially*, assuming Conjecture and the following conjecture:

*Conjecture 2*. Determining if a player has a legal move in *Magic: the Gathering* is equivalent to the halting problem.

does not immediately give us an algorithm for determining the existence of a legal move because there are games of *Magic* where players appear to have infinitely many meaningfully different possible moves. We conjecture that no such algorithm exists as we believe that this is an essential difficulty, and that there are board states that require checking the legality of arbitrarily many possible moves.

**Corollary 1**. If and hold, then determining that a game of *Magic: the Gathering* is in an end game state is equivalent to the halting problem.

# Two-player *Magic: the Gathering*

Now we will move on to two-player games of *Magic: the Gathering*. The first question we wish to consider is the "mate-in-$n$ problem":

*Question 1* (the Mate-in-$n$ Problem). Given a game state and an integer $n$, is there a sequence of moves that forces a win for the first player in less than $n$ moves?

As in the previous section, we are interested in this question in the context of end games, so we will consider a mate-in-$n$ to exist if $n$ moves are sufficient to arrive at an end game that results in the first player winning.

*Proof.* We will show this by appealing to Post's Theorem in the standard way. We will modify the *Magic* Turing machine to encode an arithmetic problem, $$(\exists x)(\exists y_1)(\forall y_2)\cdots (Qy_n) (P(x,y_1,\ldots,y_n) = 0)$$ where $Q$ is the appropriate quantifier on the tape, halting if there is a solution and not halting if there is not. Exactly $n$ turns will pass before the *Magic* Turing machine "activates" and begins the computation. On each of those turns turn, the only option available to each player is to pick an integer that will be encoded as $y_i$ to a tape which will be read by the *Magic* Turing machine as an input. After $n$ turns go by, the setup from the original *Magic* Turing machine will be in place and neither player will be able to further interfere with the result of the game. This will establish a reduction from the mate-in-$n$ problem to determining the truth of a $\Delta_n^0$ sentence.

The key to this construction is the ability *suspend*. When a card with suspend is played, counters known as suspend counters are place on it. Each turn a suspend counter is removed, and when the last counter is removed the spell is actually cast. When setting up the construction, we can give any spells we wish suspend with **Delay** ("Counter target spell. If the spell is countered this way, exile it with three time counters on it instead of putting it into its owner's graveyard. If it doesn't have suspend, it gains suspend.") and can use **Clockspinning** ("Choose a counter on target permanent or suspended card. Remove that counter from that permanent or card or put another of those counters on it.") to manipulate the number of suspend counters on any card. Suspend allows us to force the players to find a winning strategy in only $n$ moves by setting it up so that after $n$ turns spells resolve that activate the Turing machine.

Many of the cards necessary for this construction would interfere with the operation of the *Magic* Turing machine. To prevent this, when we activate the *Magic* Turing machine we will also have to remove many of the permanents from the battlefield. Most of this clean-up will be accomplished by **Tetzimoc, Primal Death** ("When Tetzimoc enters the battlefield, destroy each creature your opponents control with a prey counter on it").

With the exception of **Tetzimoc, Primal Death**, every creature introduced in this section will actually be a token that is a copy of the card in question, rather than the card itself. Making them tokens means that when they are destroyed they are removed fromt the game instead of going to the graveyard, so **Wheel of Sun and Moon** doesn't put them on the bottom of Alice's library. Additionally, every one of those tokens that isn't part of the Turing tape will have a prey counter on it, to allow **Tetzimoc, Primal Death** to destroy them. We will also need some Auras enchanting creatures, which will also be tokens. These Auras are destroyed when the creature they are attached to is, so there is no need to clean them up separately.

**Tetzimoc, Primal Death** will be in play under Alice's control and hacked to be a Human, Alice will own a **Human Frailty** ("Destroy target Human creature") in exile with $n$ time counters on it, and Bob will control a **Grave Betrayal** ("Whenever a creature you don't control dies, return it to the battlefield under your control with an additional +1/+1 counter on it at the beginning of the next end step. That creature is a black Zombie in addition to its other colors and types."). When the last time counter is removed from **Human Frailty**, Alice is forced to cast it and target **Tetzimoc, Primal Death**, as there will be no other Humans on the battlefield. This will cause **Tetzimoc, Primal Death** to die and return to the battlefield under Bob's control, triggering its ability and destroying every creature under Alice's control with a prey counter and every Aura enchanting those creatures. As they are tokens, they cease to exist and are not returned by **Grave Betrayal**.

In addition to destroying permanents, we will also need to begin the Turing machine itself. To prevent the Turing machine from operating, we give Alice a **Maralen of the Mornsong** ("Players can't draw cards. At the beginning of each player's draw step, that player loses 3 life, searches their library for a card, puts it into their hand, then shuffles their library.") and a **Timelock Orb** ("Players can't search libraries"). Together, these allow us to keep Alice's hand empty until **Tetzimoc, Primal Death** destroys **Maralen of the Mornsong**. At that point she will draw her first card (**Infest**) which she will cast on her next turn to begin the computation. Although **Timelock Orb** doesn't prevent the loss of life from **Maralen of the Mornsong**'s ability, the life loss is irrelevant thanks to the life that the **Daggerdrome Imp** is gaining.

Instead of using **Blazing Archeon** ("Flying. Creatures can't attack you.") as specified in the *Magic* Turing machine we will use **Moat** ("Creatures without flying can't attack.") to allow our **Daggerdrome Imp** to attack. Additionally, **Choak** ("Islands don't untap during their controllers' untap steps") will be suspended with $n$ time counters on it[^2]. All other cards from the *Magic* Turing machine will be in play as specified by the *Magic* Turing machine for our construction. Additionally, our tape will begin pre-initialised to encode a program that reads the player-specified inputs and then searches for a solution to $(p(x,c_1,\ldots,c_n) = 0$, where $c_i$ are the values chosen in the $ith$ round.

In the *Magic* Turing machine the authors provide a two-sided infinite tape. This is not strictly speaking necessary, as the (2,18) Turing machine only requires a one-sided infinite tape. As a result, we can use the one side of the tape (say, the left side) to encode the input we wish to have the players supply. This input will be encoded in "inverse unary" notation. To denote the natural number $n$ there will be $n$-many blank cells in a row, with a non-blank cell marking the division between numbers. We choose to use the *elemental* creature type to mark the divider symbol.

To create these tokens, Alice will control an **Ageless Entity** ("Whenever you gain life, put that many +1/+1 counters on Ageless Entity") equipped with a **Helm of the Host** ("At the beginning of combat on your turn, create a token that's a copy of equipped creature, except the token isn't legendary if equipped creature is legendary"). She will also control a **Daggerdrome Imp** ("Flying. Lifelink.") that has a +1/+1 counter on it and is enchanted by a **Shade's Form** ('Enchanted creature has "B: This creature gets +1/+1 until end of turn.") and a **Cloak of Mists** ("Enchanted creature cannot be blocked") and a **Hellraiser Goblin** ("Creatures you control have haste and attack each combat if able"). Additionally, a **Pithing Needle** ("As Pithing Needle enters the battlefield, choose a card name. Activated abilities of sources with the chosen name can't be activated unless they're mana abilities.") will be in play naming **Helm of the Host**. This prevents Alice from changing which creature it is attached to, but doesn't prevent its copying ability from triggering.

Activating the **Daggerdrome Imp**'s ability requires Alice to spend black mana. She can have access to infinite amounts of black mana by the combination of **Umbral Mantle** ("Equipped creature has "3, Q: This creature gets +2/+2 until end of turn." (Q is the untap symbol.)"), **Magus of the Coffers** ("2, T: Add B for each Swamp you control."), and six **Swamp**s. The **Swamp**s will really be tokens copies of **Ancient Tomb**, but they will count as swamps due to **Prismatic Omen** ("Lands you control are every basic land type in addition to their other types."). They will also be hacked to be creatures, and will have a prey counter on each of them. This **Prismatic Omen** is why we have to suspend **Choke**.

Together, these cards mean that Alice's combat steps will go as follows:

1.  **Helm of the Host** will create a token that is a copy of **Ageless Entity**. That token will be a 3/3 due to the **Night of Souls' Betrayal** from the *Magic* Turing machine .

2.  **Hellraiser Goblin** requires Alice to attack with every creature that can. The only one that can is **Daggerdrome Imp** due to **Moat** from the *Magic* Turing machine . **Daggerdrome Imp** is unblockable due to **Cloak of Mists**.

3.  **Daggerdrome Imp** is naturally a 1/1 due to the +1/+1 counter and **Night of Soul's Betrayal** cancelling each other out. However, Alice can activate **Daggerdrome Imp**'s ability to increase its power and toughness by 1 however many times she likes.

4.  **Daggerdrome Imp** has lifelink, so Alice will gain life equal to however much damage it deals to Bob. This will trigger every **Ageless Entity** in play, giving them +1/+1 counters equal to the amount of damage **Daggerdrome Imp** deals.

This allows Alice to implement the previously described encoding of natural numbers onto the Turing tape, encoding one number per turn. The number of blank cells is equal to the number she chooses to encode, and the next turn an **Ageless Entity** token is created, forming the separation marker between strings of blank cells.

To allow Bob to write to the tape as well as Alice, we will give Bob the ability to control every other turn Alice takes. This is achieved by giving Bob a **Panoptic Mirror** ("Imprint — X, T: You may exile an instant or sorcery card with converted mana cost X from your hand. At the beginning of your upkeep, you may copy a card exiled with Panoptic Mirror. If you do, you may cast the copy without paying its mana cost.") which has exiled a **Cruel Entertainment** ("Choose target player and another target player. The first player controls the second player during the second player's next turn, and the second player controls the first player during the first player's next turn"). **Panoptic Mirror** will also be given phasing with **Teferi's Curse**.

Each round of turns will correspond to one quantifier. On the $\exists$-rounds, Alice will control her turn and Bob will control his. On Alice's turn, Alice will pick a number to input into the *Magic* Turing machine and set it by using **Daggerdrome Imp**'s ability that many times. On Bob's turn, **Panoptic Mirror** will be phased in and he will opt to cast **Cruel Entertainment** with it. This is always in his best interest, as not doing so amounts to forfeiting one of the numbers he gets to choose to Alice. On the $\forall$-rounds, Bob will control Alice's turn and Alice will control Bob's. On Alice's turn, Bob will pick a number to input into the *Magic* Turing machine and set it by using **Daggerdrome Imp**'s ability that many times. On Bob's turn, **Panoptic Mirror** will be phased out and Alice will have no decisions to make.

The only cards in this construction that cannot be cleaned up with **Tetzimoc, Primal Death** are **Panoptic Mirror**, **Tetzimoc, Primal Death**, and **Grave Betrayal** as they are all on Bob's side of the battlefield. **Panoptic Mirror** doesn't actually have to be removed at all, as trading who controls who for each turn is irrelevant once neither side has any strategic decisions to make for the rest of the game. **Tetzimoc, Primal Death** can be exiled (after it dies once to **Human Frailty** and is reanimated by **Grave Betrayal**) by using a **Ghostflame Sliver** hacked to make Dinosaurs colorless, and having an **Infernal Reckoning** ("Exile target colorless creature. You gain life equal to its power") suspended by either player. As there are no other colorless creatures in the construction, it must target **Tetzimoc, Primal Death**. **Grave Betrayal** can be handled by enchanting it with **Reality Acid** ("Enchant permanent. Vanishing 3 (This Aura enters the battlefield with three time counters on it. At the beginning of your upkeep, remove a time counter from it. When the last is removed, sacrifice it.) When Reality Acid leaves the battlefield, enchanted permanent's controller sacrifices it."). During the set-up, we can add vanishing counters to **Reality Acid** so that it runs out of counters right before the *Magic* Turing machine begins. ◻

It is an interesting question whether this problem is in fact $\Delta^0_n$-complete. While it's not $\Delta^0_n$-complete when the "mate-in-$n$" game is defined in terms of the traditional notion, we may be hopeful that it is $\Delta^0_n$-complete when defined in terms of *end games*. Finally, we present our third theorem:

*Proof.* In the proof of we give, for every $n$, constructions of board states that are $\Delta^0_n$-hard. Taking the union of those sets of board states gives a set for which identifying the winning strategy is $\Delta^0_n$-hard for every $n$, and so is non-arithmetic in general. ◻

It seems highly plausible that the correct upper bound on the computational complexity of identifying a winning strategy in *Magic: the Gathering* is precisely $\emptyset^{(\omega)}$. For that to not be the case, it would have to be that our proof of **Theorem ** is misleading in the sense that the primary complexity is not due to the fact that games of *Magic* can have arbitrary length. We can make rigorous this idea as follows: if the mate-in-$n$ problem is equivalent to $\emptyset^{(f(n))}$ for some monotonic function $f:\mathbb N\to\mathbb N$ then it is the case that the general strategy is precisely equivalent to $\emptyset^{(\omega)}$.

If the general strategy is harder than $\emptyset^{(\omega)}$ then non-arithmeticity must arise in a finite number of turns. Although another construction could potentially fit arbitrarily many choices into finitely many turns, the combinatorial structure of game actions in *Magic: the Gathering* means that this doesn't avoid the issue presented in the previous paragraph, as the non-arithmeticity must arise in a finite number of *game actions* as well. Although this is implausible, it's unclear how to prove it. One approach would be to encode the entirety of the game in the language of arithmetic so that there is a reduction of winning strategies to the truth of arithmetic expressions. Although the axiomatic nature of the rules of *Magic* makes this more straightforward than other games, it would still be a colossal undertaking. Also, as new cards get printed it is possible that the proof will be invalidated by the new cards. Therefore we leave as a conjecture:

*Conjecture 3*. Determining if there exists a winning strategy in *Magic: the Gathering* is Turing equivalent to $\emptyset^{(\omega)}$.

One plausible route for falsifying this conjecture is to construct a second-order syntax in *Magic: the Gathering*. Some cards in *Magic* have quite complicated effects, including ones that require you to choose between subsets of a set. It is plausible that some of these cards are able to express second order arithmetical statements, in which case we would expect the ideas developed in this paper to generalise to constructions in the Borel hierarchy.

# Playability in the Real World

One thing that distinguishes *Magic: the Gathering* from other games is that it's complexity is actually found in the real world. While most games are analysed based on some sort of generalisation, everything discussed in this paper is achievable in a real game of *Magic*. The following 60-card deck is legal to play in the Legacy format and allows a sufficiently tenacious player to set up a board state for which optimal play requires knowing the truth of an arithmetic statement of the player's choice:

```latex
\begin{table*}[htbp]\centering
    \caption{60-Card deck list to play the Turing machine in a Legacy tournament}
    \label{tab:decklist}
    \begin{tabular}{l|l|l|l}
    Device Set Up & Device Set Up & \textit{Magic} Turing machine & Arithmetic Sentences\\
    \hline
    1 Ancient Tomb & 1 Memnarch & 1 Rotlung Reanimator & 1 Tetzimoc, Primal Death\\
    1 Grim Monolith & 1 Artificial Evolution & 1 Infest & 1 Grave Betrayal\\
    1 Power Artifact & 1 Dread of Night & 1 Cleansing Beam & 1 Maralen of the Mornsong\\
    1 Gemstone Array & 1 Glamerdye & 1 Soul Snuffers & 1 Timelock Orb\\
    1 Staff of Domination & 1 Prismatic Lace & 1 Illusionary Gains & 1 Ageless Entity\\
    1 Karn Liberated & 1 Donate & 1 Priviledged Position & 1 Helm of the Host\\
    1 Fathom Feeder & 1 Reality Ripple & 1 Steely Resolve & 1 Daggerdrome Imp\\
    1 Cloak of Mists & 1 Riptide Replicator & 1 Wild Evocation & 1 Umbral Mantle\\
    3 Lotus Petal & 1 Stolen Identity & 1 Shared Triumph & 1 Hellraiser Goblin\\
    1 Ghostflame Sliver & 1 Capsize & 1 Xanthrid Necromancer & 1 Magus of the Coffers\\
    1 Infernal Reckoning & 1 Clockspinning & 1 Mesmeric Orb & 1 Moat\\
    1 Reality Acid & 1 Delay & 1 Coalition Victory & 1 Cruel Entertainment\\
    1 Cloak of Invisibility & 1 Wheel of Sun and Moon & 1 Choke & 1 Panoptic Mirror\\
    1 Rings of Brighthearth & 1 Teferi's Curse & 1 Vigor & 1 Pithing Needle\\
    & 1 Fungus Sliver & 1 Prismatic Omen & \\
   \end{tabular}
\end{table*}
```

As raised by Churchill, Biderman, and Herrick in their paper , the rules regarding slow play are a potential hurdle for carrying out this construction in practice. While carrying out this construction in a tournament setting would probably result in the player getting punished for deliberately delaying the game (to be honest, there isn't much else of a reason to build this), our understanding of the rules is that a player who happens to find themselves in such a position or a player who finds themselves in a less contrived but mathematically equivalent situation would not be sanctioned for slow play.

# Conclusions and Future Work

We have established that optimal play in *Magic: the Gathering* is at least as hard as $\emptyset^{(\omega)}$, the first time any real or even realistic game has been shown to be this complex. We have identified several interesting computability theoretic open questions about *Magic* that remain, most notably "is our result optimal?" Another avenue for future research is to examine other collectable card games, such as Yu-Gi-Oh and Pokemon TCG and see if similar results can be proven for those games.

# Acknowledgements

We would like to thank Alex Churchill, Austin Herrick, and Nicholas Wild for conversations about the mechanisms underlying this paper and consultation about complex rules interactions in *Magic: the Gathering*.

[^1]: While some cards refer to operations that can produce non-integers such as division, they always specify how to round non-integer results.

[^2]: As discussed later, we will have Islands we need to tap for mana every turn.