Conceptio › Archive › arXiv CS
arXiv CS open access

Testability of Homomorphism Inadmissibility: Property Testing Meets Database Theory

Hubie Chen et al. · arxiv_cs
arXiv CS · Papers
Open Source ↗Direct PDF ↓
data-managementdatabasessqlstorage
In this paper, we utilize the perspective of property testing to consider the testability of relational database queries. A primary motivation is the desire to avoid reading an entire database to decide a property thereof. We focus on conjunctive queries, which are the most basic and heavily studied
Conceptio Open Archive

Analyze & explore related research in Conceptio

Connect this record directly into your research workflow or AI agent. Explore citations across open repositories, query full text, and export structured proof bundles.

arXiv:2611.26861v1 [cs.DB] 19 Nov 2026

Testability of Homomorphism Inadmissibility: Property Testing Meets Database Theory Hubie Chen∗

Yuichi Yoshida†

Dept. of Informatics King’s College London London, United Kingdom hubie@kcl.ac.uk

National Institute of Informatics Tokyo, Japan yyoshida@nii.ac.jp

ABSTRACT In this paper, we utilize the perspective of property testing to consider the testability of relational database queries. A primary motivation is the desire to avoid reading an entire database to decide a property thereof. We focus on conjunctive queries, which are the most basic and heavily studied database queries. Each conjunctive query can be represented as a relational structure A such that deciding if the conjunctive query is satisfied by a relational structure B is equivalent to deciding if there exists a homomorphism from A to B. We phrase our results in terms of homomorphisms. Precisely, we study, for each relational structure A, the testability of homomorphism inadmissibility from A. We consider algorithms that have oracle access to an input relational structure B and that distinguish, with high probability, the case where there is no homomorphism from A to B, from the case where one needs to remove a constant fraction of tuples from B in order to suppress all such homomorphisms. We provide a complete characterization of the structures A from which one can test homomorphism inadmissibility with onesided error by making a constant number of queries to B. Our characterization shows that homomorphism inadmissibility from A is constant-query testable with one-sided error if and only if the core of A is 𝛼-acyclic. We also show that the injective version of the problem is constant-query testable with one-sided error if A is 𝛼-acyclic; this result generalizes existing results for testing subgraph-freeness in the general graph model.

CCS CONCEPTS • Theory of computation → Streaming, sublinear and near linear time algorithms; Database query processing and optimization (theory).

KEYWORDS property testing; conjunctive queries; query evaluation; hypergraph acyclicity ∗ Acknowledges the support of Spanish Project TIN2017-86727-C2-2-R. † Supported by JSPS KAKENHI Grant Number JP17H04676.

1 INTRODUCTION 1.1 Background Property testing. Traditional notions of algorithmic efficiency, such as that of polynomial time, permit each input to be read in its entirety. However, the modern necessity of performing computations on large bodies of data poses situations where inputs are so large that it is prohibitively expensive to fully read them. These situations motivate the study of algorithms that only read a part of each input. Property testing provides a framework wherein it is possible to present such algorithms. In property testing, the input is typically read via random access queries, and an algorithm’s desideratum is to distinguish between inputs that satisfy a property and inputs that are 𝜖-far from satisfying the property. Intuitively speaking, an object is called 𝜖-far from satisfying a property if one needs to modify more than an 𝜖-fraction of the object in order for it satisfy the property; the exact definition depends on the context. The restriction on the allowed inputs leads to the possibility of algorithms that do not read the entire input. A diversity of combinatorial objects have been studied in property testing, including functions [12, 45], graphs [30, 31], and constraint satisfaction problems (CSPs) [3, 51]; many properties have been shown to be testable with a constant number of queries, a most positive type of result. Moreover, general characterizations of constant-query testable properties have been achieved in several settings, including affineinvariant properties of functions over finite fields [49, 50], properties on dense graphs [4], and assignment testing of CSPs [11, 23]. See the surveys [43, 44] and the book [29]. Database theory, conjunctive queries, and relational homomorphisms. A central, fundamental computational task in the field of databases is the evaluation of a query on a relational database. In this article, we focus on conjunctive queries, the most basic and heavily studied class of database queries [46]. While there are numerous equivalent definitions, a conjunctive query may be defined as a first-order logical sentence built from predicate applications, conjunction,

and existential quantification. (We focus here on Boolean conjunctive queries, which are conjunctive queries without so-called free variables and which evaluate to either true or false on a given database.) As is usual in database theory, we formalize a relational database as a relational structure, defined as an indexed set of relations, all over the same domain. As an example, consider the evaluation of the conjunctive query 𝜓 = ∃𝑣 1 ∃𝑣 2 ∃𝑣 3 (𝐸 (𝑣 1, 𝑣 2 ) ∧ 𝐸 (𝑣 2, 𝑣 3 ) ∧ 𝐸 (𝑣 3, 𝑣 1 )) on a simple undirected graph, whose edges are represented by a symmetric binary relation; this conjunctive query evaluates to true if and only if the graph contains a triangle. A classical result in database theory [16] is that each conjunctive query 𝜙 can be naturally passed to a relational structure A[𝜙], in a way such that, for any relational structure B, the query 𝜙 evaluates to true on B if and only if there exists a homomorphism from A[𝜙] to B. Moreover, this passage can be naturally inverted. Hence, the problem of conjunctive query evaluation is equivalent to the relational homomorphism problem where, given a pair of relational structures, the goal is to decide if there exists a homomorphism from the first structure to the second. Let us briefly present the relevant definitions and notions. Define a relational structure A = (𝐴; 𝑅1A, . . . , 𝑅𝑘A ) to consist of a finite set 𝐴, called the domain, and relations 𝑅𝑖A (𝑖 ∈ {1, . . . , 𝑘 }). Each relation symbol 𝑅𝑖 has an associated arity ar(𝑅𝑖 ), and each 𝑅𝑖A is a relation of arity ar(𝑅𝑖 ) over 𝐴, that is, a collection of tuples where each has length ar(𝑅𝑖 ) and has entries drawn from 𝐴. When A = (𝐴; 𝑅1A, . . . , 𝑅𝑘A ) and B = (𝐵; 𝑅1B, . . . , 𝑅𝑘B ) are structures defined on the same symbols (that is, having the same vocabulary), a homomorphism from A to B is a mapping ℎ : 𝐴 → 𝐵 such that for every 𝑖 ∈ {1, . . . , 𝑘 } and every tuple (𝑎 1, . . . , 𝑎 ar(𝑅𝑖 ) ) ∈ 𝑅𝑖A , it holds that the tuple (ℎ(𝑎 1 ), . . . , ℎ(𝑎 ar(𝑅𝑖 ) )) belongs to 𝑅𝑖B . The relational structure A[𝜙] corresponding to a conjunctive query 𝜙 (where all quantifiers are in front) has as domain the set of variables that occur, and, interprets each symbol 𝑅 as the relation containing each tuple that 𝑅 is applied to, in 𝜙; for example, A[𝜓 ] for 𝜓 = ∃𝑣 1 ∃𝑣 2 ∃𝑣 3 (𝐸 (𝑣 1, 𝑣 2 ) ∧ 𝐸 (𝑣 2, 𝑣 3 ) ∧ 𝐸 (𝑣 3, 𝑣 1 )) is equal to ({𝑣 1, 𝑣 2, 𝑣 3 }; 𝐸 A[𝜓 ] ), where 𝐸 A[𝜓 ] = {(𝑣 1, 𝑣 2 ), (𝑣 2, 𝑣 3 ), (𝑣 3, 𝑣 1 )}. The problem of conjunctive query evaluation and the relational homomorphism problem are, in fact, both considered formulations of the constraint satisfaction problem [26]. The complexity-theoretic aspects of these problems have been heavily studied over the years; see for example [1, 7, 20, 21, 33–35, 40, 41, 46] and the references therein.

1.2

Contributions

Despite the centrality of query evaluation as a computational problem in the field of databases, and the ability of the property testing framework to provide meaningful theoretical

results for problems where examining the entire input is exceedingly costly, there has not been—to the best of our knowledge—any systematic study of database query evaluation from the viewpoint of property testing, on general relational databases. In this article, we initiate such a study: we present a natural oracle model under which relational structures can be accessed; and, we establish a dichotomy theorem that, in a certain precise sense, completely classifies the conjunctive queries that give rise to properties that are constant-query testable. For cleanliness and ease of discussion, we work primarily with the homomorphism formulation of conjunctive query evaluation. When A and B are structures having the same vocabulary, let us say that B is A-free if B does not admit a homomorphism from A. We characterize precisely when, for a structure A, one has constant-query testability of the property of A-freeness; this property is here also referred to as the property of homomorphism inadmissibility from A. Stated in the parlance of conjunctive queries, we characterize precisely when, for a conjunctive query 𝜙, one has constantquery testability of the property of being false under 𝜙; as each problem studied corresponds to a fixed conjunctive query 𝜙 and takes as input a structure B to be evaluated on 𝜙, our study can be taken as a property testing characterization of the data complexity of each conjunctive query. Model studied. Let A and B be relational structures over the same vocabulary, and let 𝜖 ∈ (0, 1); the structure B is called 𝜖-far from A-free if it is necessary to remove more than an 𝜖-fraction of tuples from B in order to ensure that it does not admit a homomorphism from A; it is called 𝜖-close to A-free otherwise. In the problem of testing homomorphism inadmissibility from A, an algorithm is given an error parameter 𝜖 ∈ (0, 1) and is permitted query access to a relational structure B with the same vocabulary as A; its goal is to distinguish the case that B is A-free from the case that B is 𝜖-far from A-free. An algorithm achieving this goal is called a tester for A-freeness. Such a tester is constant-query if the number of queries to B is a function only of 𝜖; is said to use 𝑄 queries, where 𝑄 is a family of functions on the natural numbers, if for each 𝜖 there exists 𝑞𝜖 ∈ 𝑄 such that at most 𝑞𝜖 (|𝐵|) queries are used when the presented error parameter is 𝜖; and, is of one-sided error if it accepts every structure B that is A-free. In our model, access to the structure B is via queries to what we term the completion oracle. Consider a relation 𝑅 B of arity 𝑟 in B and a tuple q = (𝑞 1, . . . , 𝑞𝑟 ) ∈ (𝐵 ∪ {∗})𝑟 , where 𝐵 is the domain of B and ∗ is a special wildcard symbol. A tuple t = (𝑡 1, . . . , 𝑡𝑟 ) is called a completion of q in 𝑅 B if (i) 𝑡𝑖 = 𝑞𝑖 for every 𝑖 ∈ {1, . . . , 𝑟 } with 𝑞𝑖 ∈ 𝐵 and (ii) t ∈ 𝑅 B . The completion oracle allows two types of queries; for each, the oracle receives a relation symbol 𝑅 and a tuple q = (𝑞 1, . . . , 𝑞𝑟 ) ∈ (𝐵 ∪ {∗})𝑟 :

• To a completion query, the oracle returns a random completion of q in 𝑅 B ; if no such completion exists, it returns a special symbol ⊥. • To a size query, the oracle returns the number of completions of q in 𝑅 B . We discuss the relation between the completion oracle and the established general graph model later, in Section 1.3. One may wonder why we do not test homomorphism admissibility instead of homomorphism inadmissibility. The reason is that, for any fixed structure A, we can add a constant number of tuples to a structure B to realize a homomorphism from A to B. Hence, we need to choose 𝜖 = 𝑂 (1/∥B∥) to make the testing problem meaningful, where ∥B∥ is the total number of tuples in B; otherwise, no 𝜖-far instance exists and we can always answer that there is a homomorphism from A to B. However, when 𝜖 is so small, we can obtain the whole structure B with 𝑂 (1/𝜖) queries, and can then exactly check whether there is no homomorphism from A to B. Hence, testing homomorphism admissibility is an uninteresting problem, under the employed lens of property testing. We remark that the introduced model may permit the study of further properties, beyond A-freeness, that are antimonotone; here, by an anti-monotone property, we mean a property on structures such that, when B is a structure that does not satisfy the property, adding tuples to B always results in a structure that also does not satisfy the property. We leave such a study as a potential avenue for future work. Main results. The primary technical contribution of this work is a dichotomy theorem that completely characterizes the structures A for which the property of A-freeness is constant-query testable with one-sided error. In the following, 𝑛 denotes the domain size |𝐵| of the structure B being tested. Theorem 1.1. Let A be any relational structure. The property of A-freeness is constant-query testable with one-sided error if and only if the core of A is 𝛼-acyclic. In particular, when the core of A is not 𝛼-acyclic, there exists a constant 𝑐 ≥ 1 such that testing A-freeness, with one-sided error, requires Ω(𝑛 1/𝑐 ) queries. Here, 𝛼-acyclicity is an established notion of acyclicity for hypergraphs, and is applied to structures in a natural way; precise definitions are given in Section 2, where the definition of core is also given. Indeed, the notion of 𝛼-acyclicity is classical in database theory; it is known that there is a polynomial-time algorithm for the problem of deciding if an 𝛼-acyclic structure admits a homomorphism to another structure (see for example [1, Chapter 6.4]). The just-presented dichotomy theorem may be restated in database parlance, as follows. By a positive first-order query, we here refer to a first-order logical sentence that does not

contain negation; such a sentence evaluates to true or false when given a structure over the query’s vocabulary. When 𝜙 is a positive first-order query, we say that a structure B is 𝜖-far from 𝜙-falsity if it is necessary to remove more than an 𝜖-fraction of tuples from B to ensure that 𝜙 evaluates to false on B; we define the problem of testing 𝜙-falsity analogously to how we defined the problem of testing A-freeness. Theorem 1.2. (Restatement of Theorem 1.1’s dichotomy) Let 𝜙 be any conjunctive query; the property of 𝜙-falsity is constant-query testable with one-sided error if and only if the core of A[𝜙] is 𝛼-acyclic. In the area of databases, a heavily studied generalization of the class of conjunctive queries is the class of so-called unions of conjunctive queries [18, 25]. We formalize these logically as follows. A union of conjunctive queries is a disjunction of conjunctive queries; so, the class of structures on which it evaluates to true is equal to the union, over its constituent conjunctive queries 𝜃 , of the structures on which 𝜃 evaluates to true. From Theorem 1.1, we may derive a more general dichotomy theorem, which describes the testability of each union of conjunctive queries. It is known that any union 𝜙 of conjunctive queries can be computably rewritten to a form, which we call the normalization of 𝜙, wherein none of its disjuncts are redundant; see [13, Section 3].1 Corollary 1.3. Let 𝜙 be any union of conjunctive queries, and let 𝜙 ′ = 𝜙 1 ∨ · · · ∨ 𝜙𝑘 be the normalization of 𝜙. The property of 𝜙-falsity is constant-query testable with one-sided error if and only if the following condition holds: for each 𝑖 ∈ [𝑘], the core of A[𝜙𝑖 ] is 𝛼-acyclic. When this condition does not hold, there exists a constant 𝑐 ≥ 1 such that testing 𝜙-falsity, with one-sided error, requires Ω(𝑛 1/𝑐 ) queries. In this article, we also consider the injective version of testing A-freeness [22]. We say that a relational structure B is injectively A-free if there is no injective homomorphism from A to B. Then, the testing problem is to distinguish the case that B is injectively A-free from the case that B is 𝜖-far from being so. By building on and slightly modifying the positive result of Theorem 1.1, we show the positive testability result that, for any relational structure A that is 𝛼-acyclic, injective A-freeness is constant-query testable (Theorem 3.12). Oracle implementation issues. In our view, the theory developed in this article evidences that our oracle model is mathematically robust and natural; again, we regard the presentation of this model as a contribution of this article. In Theorem 1.1 and the other dichotomy theorems presented 1 In particular, a union of conjunctive queries as defined here is, in [13],

referred to as an existential positive sentence in disjunctive form; by the normalization of 𝜙, we mean an existential positive sentence in disjunctive form that is irredundant in the sense of [13].

• A query to the random edge oracle corresponds to the completion query (𝐸, (∗, ∗)) to the completion oracle. • The query 𝑢 ∈ 𝑉 to the random neighbor oracle corresponds to the two completion queries (𝐸, (𝑢, ∗)) and (𝐸, (∗, 𝑢)) to the completion oracle. A response of 𝑣 from the random neighbor oracle corresponds to the response of (𝑢, 𝑣) or (𝑣, 𝑢) from the completion oracle (respectively); a response of ⊥ from the random neighbor oracle corresponds to the response of ⊥ from the completion oracle. • The query (𝑢, 𝑣) ∈ 𝑉 2 to the adjacency oracle corresponds to the completion query (𝐸, (𝑢, 𝑣)) to the completion oracle. The response of yes from the adjacency oracle corresponds to the response of (𝑢, 𝑣) from the completion oracle; the response of no from the adjacency oracle corresponds to the response of ⊥ from the completion oracle. • The query 𝑢 ∈ 𝑉 to the degree oracle corresponds to the size queries (𝐸, (𝑢, ∗)) and (𝐸, (∗, 𝑢)) to the completion oracle.

above, however, oracle queries are treated as primitives; these theorems are agnostic about the particulars of how oracle queries are answered. While we hope that this article will engender further interaction between property testing and database theory, we here would like to point out that the oracle queries of our model can be resolved in polylogarithmic time in the case that the relations of the structure B being tested are represented as range trees [10], where we identify elements in 𝐵 with values 1, . . . , |𝐵| through an arbitrary one-to-one correspondence. Precisely, consider the representation of each relation 𝑅 B of B by a range tree 𝑇𝑅 B of dimension ar(𝑅). In each one-dimensional range tree 𝑇 used in 𝑇𝑅 B , a leaf node with value 𝑏 ∈ 𝐵 is annotated with the number of tuples, in the relation represented by 𝑇 , that begin with 𝑏; and each internal node 𝑣 is annotated with the sum of the annotations over all leaf descendants of 𝑣. It is straightforward to verify that both completion queries and size queries concerning a relation 𝑅 B can be answered in time 𝑂 (log𝑑 |𝑅 B |), where 𝑑 = ar(𝑅).

1.3

Relationship between our model and the general graph model

We may view each undirected graph as a relational structure G = (𝑉 ; 𝐸 G ) where 𝐸 G is a symmetric binary relation. Previous work [5, 39] studied the problem of testing, relative to a fixed graph H, whether a given graph G is injectively H-free or is 𝜖-far from being injectively H-free.2 Here, one often assumes that each graph G = (𝑉 ; 𝐸 G ) to be tested has |𝐸 G | = Ω(|𝑉 |), to avoid technical triviality. In the general graph model [5, 39], in addition to |𝑉 | and |𝐸 G |, the graph G is provided through query access; the following four types of oracles are provided: • Random edge oracle: It returns a random edge chosen uniformly at random from 𝐸. • Random neighbor oracle: Given a vertex 𝑢 ∈ 𝑉 , it returns a random neighbor of 𝑣 if a neighbor exists, and a special symbol ⊥ otherwise. • Adjacency oracle: Given a vertex pair (𝑢, 𝑣) ∈ 𝑉 2 , it returns yes if the edge {𝑢, 𝑣 } exists in 𝐸, and no otherwise. • Degree oracle: Given a vertex 𝑣 ∈ 𝑉 , it returns the degree of 𝑢.

We note that the answer to the size query (𝐸, (∗, ∗)) to the completion oracle is |𝐸 G |, and that the answer to the size query (𝐸, (𝑢, 𝑣)) to the completion oracle can be answered by asking the adjacency oracle whether 𝑢 and 𝑣 are adjacent: the answer is 1 if 𝑢 and 𝑣 are adjacent and 0 otherwise. It was previously shown that the property of injective Hfreeness is constant-query testable if H is a path of a constant length [37], and requires 𝜔 (|𝑉 | 1/2 ) queries when H is nonbipartite [5]. We can conceive of a generalization of the general graph model for 𝑘-uniform hypergraphs where, by specifying a set 𝑆 of vertices of size at most 𝑘, an algorithm can obtain a random hyperedge containing 𝑆, as well as the number of such hyperedges. Our model encompasses testing injective Hfreeness in such a model, though to the best of our knowledge, no prior work focused on this problem. Although testing properties of hypergraphs has been extensively studied [28, 38, 42], most works considered the dense model, in which we can ask whether there is a hyperedge spanning specific 𝑘 vertices.

1.4 Allowing these four types of oracles is equivalent to allowing queries to the completion oracle; this is seen as follows: 2 Let us remark that, in the previous literature, injective H-freeness as defined

in this article is sometimes referred to simply as H-freeness. In the present article, as the notion of homomorphism is of primary interest, we adhere to the terminology established in Section 1.2. Note that for a graph G to be injectively H-free is equivalent to G not containing H as a subgraph (up to isomorphism).

Proof Idea

We explain the proof idea of Theorem 1.1. We first note that, for a structure A and its core C, testing A-freeness and Cfreeness are equivalent. Hence, we can assume that A itself is a core. Algorithm. We here explain the idea of our algorithm, which only uses completion queries (that is, it does not use size queries). By the definition of 𝛼-acyclicity, we can order tuples in relations of A as a1, . . . , a𝑚 so that, for each 𝑖 > 1, all

the variables in a𝑖 that appeared in a1, . . . , a𝑖 −1 are contained in a single tuple a 𝑗 with 𝑗 < 𝑖. Let {a𝑘 } be the set of variables that appear in a𝑘 . Then, starting with an empty map 𝑓 0 : ∅ → Ð 𝐵, we iteratively create a partial map 𝑓 𝑘 : ℓ ∈ {1,...,𝑘 } {aℓ } → 𝐵 from 𝑓 𝑘 −1 by assigning values to unassigned variables in a𝑘 using completion queries. If a completion query returns ⊥ along the way, then the algorithm accepts, claiming that there is no homomorphism from A to B. Otherwise, the algorithm rejects, claiming that B is 𝜖-far from A-freeness. If the algorithm successfully obtains a map 𝑓 𝑚 without ever getting ⊥ from the completion oracle, this map always gives rise to a homomorphism from A to B. This means that the algorithm always accepts when B is A-free because there is no homomorphism from A to B. The proof that the algorithm, with high probability, rejects any structure B that is 𝜖-far from A-free consists of the following three steps. First, we take a large set of homomorphic images of A in B that are disjoint in a certain sense, and construct a substructure B′ of B consisting of tuples used in the homomorphic images. Then, we show that, if the probability that the algorithm rejects B′ is high, then the probability that the algorithm rejects B is also high. Finally, we show that the probability that the algorithm rejects B′ is high using the disjointness property, which establishes the correctness of the algorithm. Lower bound. We now explain how we obtain a superconstant lower bound for testing A-freeness when it is not 𝛼-acyclic. We first show that there exists a structure A′ such that (i) a super-constant lower bound for testing A′ -freeness implies a super-constant lower bound for testing A-freeness, (ii) A′ is symbol-distinct in the sense that each relation contains exactly one tuple, and (iii) the hypergraph constructed by regarding each tuple in A′ a hyperedge is (essentially) either a cycle or a 𝑘-simplex, which is, up to isomorphism, a (𝑘+1)-vertex hypergraph with a hyperedge {1, . . . , 𝑘+1}\{𝑖} for each 𝑖 ∈ {1, . . . , 𝑘 + 1}. From (i), it suffices to show a super-constant lower bound for A′ . We consider the cycle and simplex cases separately. When the hypergraph is a cycle, we can show a superconstant lower bound by using the known lower bound for testing triangle-freeness in the general graph model [5] by a relatively simple reduction. When the hypergraph is a simplex, we can show a superconstant lower bound by generalizing the argument used in [5]. Namely, we consider a distribution D over 𝑘-uniform hypergraphs generated as follows: We partition the vertex set into 𝑘 + 1 parts 𝑉1, . . . , 𝑉𝑘+1 of the same size, and for each set of 𝑘 parts {𝑉𝑖 1 , . . . , 𝑉𝑖𝑘 }, we take random 𝑘-dimensional matchings spanning them. We can show that the created hypergraph 𝐺 has many disjoint 𝑘-simplices and hence is Ω(1)-far from 𝑘-simplex-freeness with high probability. Note

that a one-sided error tester A can reject a hypergraph only when it finds a 𝑘-simplex as a subgraph. Considering when A finds the last hyperedge of a 𝑘-simplex, this means that A should query a tuple q with wildcard symbols and the returned completion t of q should consist only of vertices that already appeared in the process of A. From the random construction of the hypergraph, however, we can show that the wildcard symbols in q are completed by vertices that have never appeared in the process as long as the number of queries is constant.

1.5

Related work

To the best of our knowledge, testing homomorphism inadmissibility, as formalized in this article, has not been systematically studied in the literature. The most relevant line of research is testing subgraph-freeness in the general graph model, as discussed above. There are several variations on the general graph model regarding the provided oracles. In [32, 39], a model with (a non-random version of) the random neighbor, adjacency, and degree oracles is considered. In [24], a model with essentially the random edge oracle is considered. In [37], a model with all of the random edge, random neighbor, adjacency, and degree oracles is considered. From the perspective of relational structures, it is natural to consider the model with all the oracles. The computational problem of deciding, given a pair (A, B) of relational structures over the same vocabulary, if there exists a homomorphism from A to B, is a formulation of the constraint satisfaction problem, which is well-known to be NP-complete. There is an extensive literature that aims to identify restricted cases of this problem that are polynomialtime tractable. One main stream in this literature studies restricted cases where the target structure B is fixed, see for example [7, 15, 19, 52] and the references therein. Another stream, which is more closely aligned with the present study, considers cases that are based on limiting the permitted source structures A, see for example [18, 20, 21, 33–35] and the references therein. In property testing, constraint satisfaction problems have been extensively studied; previous work can be classified into two categories: • The first category is testing whether a given CSP instance, provided through a query access, is satisfiable. In the dense model, one restricts attention to CSP instances whose constraints have a fixed arity 𝑘, and an instance is considered 𝜖-far from being satisfiable if one needs to remove more than 𝜖𝑛𝑘 constraints in order to make it satisfiable, where 𝑛 is the number of variables. In this model, any CSP is known to be constant-query testable [3, 6, 47]. In the bounded-degree model, one restricts attention to

CSP instances where each variable participates in a constant number, say, 𝑑, of constraints, and an instance is considered 𝜖-far from being satisfiable if one needs to remove more than 𝜖𝑑𝑛 constraints in order to make it satisfiable. In this model, a characterization is obtained via the LP integrality gap of the CSP [48]. • The second category is testing whether a given assignment to a CSP instance, through query access, is a satisfying assignment. This testing problem has been considered relative to fixed target structures B. Here, the CSP instance is explicitly provided to the algorithms. It was shown that 2-SAT is testable √ with 𝑂 ( 𝑛) queries [27] and testing 3-SAT requires Ω(𝑛) queries [9], where 𝑛 is the number of variables. In [51], universal algebra is used to systematically study this problem. A characterization of constantquery testable Boolean CSPs was achieved in [11], and it was generalized to finite-domain CSPs in [23].

We also mention that, in the context of database theory, Ben-Moshe et al. [8, Section 6] studied the testability of a notion called near-sortedness. In their study, near-sortedness is a property of relations presented as an ordered list of tuples, whereas (as mentioned) in the present work, the oracle access to the structure being tested is not tied to a fixed representation of relations. In [2], the authors introduced a bounded-degree model for databases and showed that, if the databases have bounded tree-width, then every query definable in monadic second-order logic with modulo counting is testable with a constant number of oracle queries.

1.6

Organization

We introduce notions used throughout this paper in Section 2. We show that A-freeness is constant-query testable if the core of A is 𝛼-acyclic in Section 3; and, that it is not constantquery testable otherwise, in Section 4. We provide the proof of Corollary 1.3, our result on unions of conjunctive queries, in Section 5.

2

PRELIMINARIES

For each integer 𝑛, we use [𝑛] to denote the set {1, 2, . . . , 𝑛}. We use bold symbols, such as t, to denote tuples. For a tuple t = (𝑡 1, . . . , 𝑡𝑘 ), we use {t} to denote the set {𝑡 1, . . . , 𝑡𝑘 }. For a function 𝑓 : 𝐴 → 𝐵 and a tuple a = (𝑎 1, . . . , 𝑎𝑘 ) of elements of 𝐴, we define 𝑓 (a) to be the tuple (𝑓 (𝑎 1 ), . . . , 𝑓 (𝑎𝑘 )). We use double brackets, as in {{𝑎, 𝑎, 𝑏, 𝑐}}, to denote a multiset. When 𝑆 is a multiset, we sometimes use #𝑆 to denote its size.

2.1

Relational structures and homomorphisms

A vocabulary is a set of relational symbols, where each relational symbol 𝑅 has an associated arity, which is a positive integer and is denoted by ar(𝑅). Throughout this paper, we assume that each vocabulary is finite. A relational structure (for short, structure) with vocabulary 𝜎 is a pair of the form A = (𝐴, {𝑅 A }𝑅 ∈𝜎 ), where 𝐴 is a set, called the domain of A, and each relation 𝑅 A is a subset of 𝐴ar(𝑅) . We define a multiset relational structure (for short, multiset structure) similarly, with the difference that each relation 𝑅 A is a multiset whose elements are drawn from 𝐴ar(𝑅) . In this article, each relational structure and each multiset relational structure under discussion is assumed to be finite in the sense that its domain is finite. We generally use the letters A, B, C, . . . to denote structures and multiset structures, and the letters 𝐴, 𝐵, 𝐶, . . . to denote their respective domains. For a structure or multiset structure A = (𝐴, {𝑅 A }𝑅 ∈𝜎 ), we denote by ∥A∥ the total number of tuples in the relations of A, that is, Í A 𝑅 ∈𝜎 |𝑅 |. For a structure A = (𝐴, {𝑅 A }𝑅 ∈𝜎 ) and a structure or multiset structure B = (𝐵, {𝑅 B }𝑅 ∈𝜎 ) having the same vocabulary 𝜎, a homomorphism from A to B is a mapping ℎ : 𝐴 → 𝐵 such that, for any 𝑅 ∈ 𝜎 and t = (𝑎 1, . . . , 𝑎𝑟 ) ∈ 𝑅 A , the image ℎ(t) = (ℎ(𝑎 1 ), . . . , ℎ(𝑎𝑟 )) belongs to 𝑅 B . An endomorphism of a structure C = (𝐶, {𝑅 C }𝑅 ∈𝜎 ) is a homomorphism from C to itself. A core is a structure such that each endomorphism thereof is a bijection. A substructure of a structure A = (𝐴, {𝑅 A }𝑅 ∈𝜎 ) is a structure C = (𝐶, {𝑅 C }𝑅 ∈𝜎 ) such that 𝐶 ⊆ 𝐴 and 𝑅 C ⊆ 𝑅 A for each 𝑅 ∈ 𝜎.3 A core of a structure A = (𝐴, {𝑅 A }𝑅 ∈𝜎 ) is a substructure of A that is a core and that receives a homomorphism from A. It is known that each structure has at least one core, and that all cores of a structure are isomorphic [36]; following a standard abuse, we thus speak of the core of a structure. Example 2.1. Undirected graphs can be naturally represented as structures having a single binary relation that is symmetric. Under this representation, the following are wellknown and straightforward to verify: • any odd cycle is a core (that is, each endomorphism of an odd cycle is a bijection), and hence the core of any odd cycle is the odd cycle itself; and, • the core of any even cycle is a single edge, that is, a two-vertex graph having a single edge between the two vertices. Indeed, the core of any bipartite graph (which contains at least one edge) is a single edge.

3 Since a substructure C of a structure A is, by definition, a structure itself,

it indeed holds that 𝑅 C ⊆ 𝑅 A ∩ 𝐶 ar(𝑅) , for each symbol 𝑅.

2.2

Hypergraphs and 𝛼-acyclicity

Let 𝑉 be a set, and let 𝑆, 𝑆 1, . . . , 𝑆𝑘 ⊆ 𝑉 . We say that 𝑆 is an ear with respect to 𝑆 1, . . . ,Ð 𝑆𝑘 when either 𝑘 = 0 or there exists 𝑗 ∈ [𝑘] such that 𝑆 ∩ ( 𝑖 ∈ [𝑘 ] 𝑆𝑖 ) ⊆ 𝑆 𝑗 . A hypergraph 𝐺 = (𝑉 , E) with 𝑚 hyperedges is called 𝛼-acyclic if there exists an ordering 𝑆 1, . . . , 𝑆𝑚 of the hyperedges so that, for each 𝑖 ∈ [𝑚], the hyperedge 𝑆𝑖 is an ear with respect to the previous edges 𝑆 1, . . . , 𝑆𝑖 −1 . For a relational structure A = (𝐴, {𝑅 A }𝑅 ∈𝜎 ), its associated hypergraph is defined as 𝐺 A = (𝐴, E), where E = {{t} | 𝑅 ∈ 𝜎, t ∈ 𝑅 A }. We say that a relational structure A is 𝛼-acyclic if its associated hypergraph 𝐺 A is 𝛼-acyclic. We say that a hypergraph 𝐺 = (𝑉 , E) on 𝑘 + 1 vertices is (𝑘-)simplex if, up to isomorphism, 𝑉 = [𝑘 + 1] and E consists of the 𝑘 + 1 hyperedges of the form [𝑘 + 1] \ {𝑖}, where 𝑖 ∈ [𝑘 + 1]. We say that a hypergraph (𝑉 , E) is a cycle if, up to isomorphism, it holds that 𝑉 = {𝑣 1, . . . , 𝑣𝑚 } and E = {(𝑣𝑖 , 𝑣𝑖+1 ) | 𝑖 ∈ [𝑚]}, where 𝑣𝑚+1 = 𝑣 1 . Let 𝐺 = (𝑉 , E) be a hypergraph. For a subset 𝑆 ⊆ 𝑉 , the hypergraph induced by 𝑆, denoted by 𝐺 [𝑆], is defined as (𝑆, {𝑒 ∩ 𝑆 | 𝑒 ∈ E} \ {∅}). The hypergraph M (𝐺) is defined as (𝑉 , {𝑒 ∈ E | š𝑓 ∈ E, 𝑒 ⊊ 𝑓 }), that is, it is the hypergraph whose hyperedges are the inclusion maximal hyperedges of 𝐺. We will make use of the following known characterization; we recommend [14, Characterization 2.5] as a reference. Theorem 2.2. A hypergraph 𝐺 = (𝑉 , E) is not 𝛼-acyclic if and only if there exists 𝑆 ⊆ 𝑉 with |𝑆 | ≥ 3 such that M (𝐺 [𝑆]) is either a simplex or a cycle.

2.3

Testing Homomorphism Inadmissibility

Throughout this paper, whenever we speak of testing A-freeness, A will be a structure, and the object B being tested will be a multiset structure. The study of relational databases whose relations are multisets is established and natural in the database context; it is in line with so-called multiset or bag semantics [17]. For a structure A, we say that a multiset structure B is 𝜖-far from A-freeness if we must remove more than 𝜖 ∥B∥ tuples from relations in B in order to ensure that it does not receive a homomorphism from A. Formally, a multiset structure B is 𝜖-far from A-freeness if, for any structure B′ obtained from B by removing tuples from relations, ∥B∥ − ∥B′ ∥ ≤ 𝜖 ∥B∥ implies that B′ admits a homomorphism from A. When testing a multiset structure B, two types of queries are permitted. Each type of query receives a pair (𝑅, q) of a relation symbol 𝑅 in the vocabulary of B and a tuple q ∈ (𝐵 ∪ {∗}) ar(𝑅) , where ∗ ∉ 𝐵 is a special symbol. Let 𝑆 B (𝑡) = 𝐵 1 × · · · × 𝐵 ar(𝑅) , where 𝐵𝑖 = 𝐵 if 𝑡𝑖 = ∗ and 𝐵𝑖 = {𝑡𝑖 } otherwise. We call each tuple in 𝑆 B (q) a completion of q. The

answer to a completion query is a random completion of q in 𝑅 B , if a completion exists; formally, the result is a tuple chosen uniformly at random from the multiset {{t ∈ 𝑅 B | t ∈ 𝑆 B (q)}} when this multiset is non-empty, and a special symbol ⊥ otherwise. The answer to a size query is the size of the multiset {{t ∈ 𝑅 B | t ∈ 𝑆 B (q)}}. We use deg𝑅,B (q) to denote |{{t ∈ 𝑅 B | t ∈ 𝑆 B (q)}}|, which is the number of completions of q in 𝑅 B . For a structure A with a finite vocabulary 𝜎, we say that an algorithm is a tester for A-freeness if, given a domain 𝐵, query access to a multiset structure B with the vocabulary 𝜎, and an error parameter 𝜖 ∈ (0, 1), it accepts with probability at least 2/3 if B is A-free, and it rejects with probability at least 2/3 if B is 𝜖-far from A-freeness. The notions of injective A-freeness, of a tester for injective A-freeness, etc. are defined analogously using injective homomorphisms.

3

CONSTANT-QUERY TESTERS FOR 𝛼-ACYCLIC RELATIONAL STRUCTURES

In this section, we present a constant-query tester for homomorphism inadmissibility from an 𝛼-acyclic relational structure. This positive result applies directly to any 𝛼-acyclic relational structure, even those that are not cores. We describe our algorithm in Section 3.1 and analyze it in Section 3.2. The modification needed to test injective homomorphism inadmissibility is given in Section 3.3. Throughout the section, we fix A to be an 𝛼-acyclic relational structure, and let 𝑚 = ∥A∥.

3.1

Algorithm

First, the algorithm preprocesses A before querying B. Consider the set A = {(a, 𝑅) | 𝑅 ∈ 𝜎, a ∈ 𝑅 A }. By the 𝛼-acyclicity of A, there is an ordering (a1, 𝑅1 ), . . . , (a𝑚 , 𝑅𝑚 ) of the elements in A such that, for each 𝑘 ∈ [𝑚], the set {a𝑘 } is an ear with respect to the sets {a1 }, . . . , {a𝑘 −1 }. Our algorithm is a random process, called HI-TestA and detailed precisely in Algorithm 1. We give an overview here. The algorithm HI-TestA proceeds in 𝑚 stages. Starting with an empty map 𝑓 0 : ∅ → 𝐵, the algorithm attempts to conÐ struct a partial map 𝑓 𝑘 : ℓ ∈ [𝑘 ] {aℓ } → 𝐵 in the 𝑘-th stage. More specifically, in the 𝑘-th stage, the algorithm tries to extend the domain of 𝑓 𝑘 −1 so that it is defined on all entries of the tuple a𝑘 , by making a completion query; if the answer to the query is ⊥, then the algorithm gives up and claims that there is no homomorphism, by accepting. Let us say that the algorithm is 𝑘-successful if it did not fail in the first 𝑘-th stages and succeeded to define 𝑓 𝑘 . If the algorithm is 𝑚-successful, then the algorithm claims that there is a homomorphism, by rejecting. It is clear that HI-TestA has a constant query complexity. Also, note that if we have succeeded to define the map 𝑓 𝑘 ,

Algorithm 1 1: procedure HI-TestA (𝐵, B) 2: ⊲ B is a multiset structure with domain 𝐵 and having

the same vocabulary as A. Let (a1, 𝑅1 ), . . . , (a𝑚 , 𝑅𝑚 ) be the ordering, as explained in the text. 4: Let 𝑓 0 : ∅ → 𝐵 be the empty map. 5: for 𝑘 = 1 to 𝑚 do 6: Let q𝑘 = (𝑞𝑘1 , . . . , 𝑞𝑘ar(𝑅 ) ) be the tuple defined as 𝑘 ( 𝑘 −1 𝑘 𝑘 𝑓 (𝑎𝑖 ) if 𝑎𝑖 ∈ ∪ℓ ∈ [𝑘 −1] {aℓ } 𝑞𝑖𝑘 = ∗ otherwise.

3:

Pose the completion query (𝑅𝑖 , q𝑘 ) to B. if The answer is ⊥ then Accept. else 11: Let b𝑘 = (𝑏 𝑘1 , . . . , 𝑏 𝑘ar(𝑅 ) ) be the answer. 𝑘 Ð 12: Define 𝑓 𝑘 : ℓ ∈ [𝑘 ] {aℓ } → 𝐵 by ( Ð 𝑓 𝑘 −1 (𝑎) if 𝑎 ∈ ℓ ∈ [𝑘 −1] {aℓ } 𝑘 𝑓 (𝑎) = 𝑘 Ð 𝑏𝑖 if 𝑎 ∈ {a𝑘 } \ ℓ ∈ [𝑘 −1] {aℓ } and 𝑎 = 𝑞𝑖𝑘 . 7: 8: 9: 10:

13:

Reject.

then it is a homomorphism from A to B by construction. Hence, HI-TestA always accepts when B is A-free. In the next section, we show that HI-TestA rejects with a certain probability if B is 𝜖-far from A-freeness.

3.2

Soundness analysis

The goal of this subsection is to establish the following. Lemma 3.1. Suppose that B is 𝜖-far from A-freeness for A (𝜖) > 0 such that HI𝜖 ∈ (0, 1). Then, there exists 𝛿 = 𝛿 3.1 TestA (𝐵, B) rejects with probability at least 𝛿. Here, we can  A (𝜖) = Ω 𝜖/(𝑚2𝑟¯ ) 𝑚 , where 𝑟¯ = max choose 𝛿 3.1 𝑅 ∈𝜎 ar(𝑅). In Section 3.2.1, we introduce the notion of a tuple-disjoint A-image, and show that we can restrict our attention to a relational structure constructed from tuple-disjoint A-images. Then, we analyze the rejection probability for it in Section 3.2.2. 3.2.1 Restriction to the tuple-disjoint case. Let B be a multiset structure that is 𝜖-far from A-freeness. For a homomorphism ℎ : 𝐴 → 𝐵 from A to B, we define ℎ(A) as the relational structure whose domain is 𝐵 and 𝑅ℎ (A) = {ℎ(a) | a ∈ 𝑅 A } for each 𝑅 ∈ 𝜎. We call ℎ(A) an A-image in B. We say that a multiset I = {{I1, . . . , I𝑘 }} of A-images are tupledisjoint if, for each relation symbol 𝑅 ∈ 𝜎, the multiset union of 𝑅 I1 , . . . , 𝑅 I𝑘 is a subset of 𝑅 B . For a set I of tuple-disjoint Ð A-images in B, we define I as the relational structure

Ð Ð whose domain is 𝐵 and 𝑅 I = I∈ I 𝑅 I for each 𝑅 ∈ 𝜎; here, the union is taken as a multiset. The following lemma states that we can analyze the rejection probability on B by analyzing the rejection probability on an instance induced by tuple-disjoint A-images.

Lemma 3.2. Suppose that B is a multiset structure, and I is a set of tuple-disjoint A-images in B where |I| ≥ 𝛼 ∥B∥ for a A (𝛼) > 0 and value 𝛼 ∈ (0, 1). Then, there is a constant 𝜅 = 𝜅 3.2 ′ ′ a subset I ⊆ I with Ð |I | ≥ |I|/2 such that, if the probability that HI-TestA (𝐵, I ′ ) rejects is 𝑝, then the probability that HI-TestA (𝐵, B) rejects is at least 𝜅𝑚 𝑝. Here, we can choose A (𝛼) = 𝛼/21+max𝑅 ∈𝜎 ar(𝑅) , where 𝑟¯ = max 𝜅 3.2 𝑅 ∈𝜎 ar(𝑅). Í Proof. Consider the sum 𝑅,t deg𝑅,B (t) over all pairs (𝑅, t) where 𝑅 ∈ 𝜎 and t ∈ (𝐵 ∪ {∗}) ar(𝑅) . For any relaB ar(𝑅) tion symbol 𝑅, a tuple Í b ∈ 𝑅 is a completion of 2 𝑟¯ tuples t. Thus, we have 𝑅,t deg𝑅,B (t) ≤ 𝐶 ∥B∥ for 𝐶 = 2 . Set 𝜅 = 𝛼/2𝐶 and initialize I ′ to be I. Now, iterate the following process: if, for a pair (𝑅, t) of the described form, it holds that deg𝑅,Ð I ′ (t) < 𝜅 · deg𝑅,B (t), remove each image I in I ′ such that 𝑅 I includes a completion of t. As each pair (𝑅, t) is considered at most once in the process, at the end of theÍprocess, the total number of images removed is at most 𝑅,t 𝜅 · deg𝑅,B (t) ≤ 𝜅𝐶 ∥B∥ = 𝛼 ∥B∥/2. In particular, I ′ is non-empty. Moreover, we have deg𝑅,Ð I ′ (t) = 0 or deg𝑅,Ð I ′ (t) ≥ 𝜅 · deg𝑅,B (t) for every pair (𝑅, t). Now, we relate Ð ′ the probabilities that HI-TestA (𝐵, B) and HI-Test (𝐵, I ) reject. this end, fix a sequence of tuples ÐA ′ Ð To I I′ 1 𝑚 b ∈ 𝑅1 , . . . , b ∈ 𝑅𝑚 that forms a homomorphism 𝑔 : Ð A → I ′ , that is, 𝑔(a𝑖 ) = b𝑖 for each 𝑖 ∈ [𝑚]. For 𝑘 ∈ [𝑚], let 𝑝 B (b1, . . . , b𝑘 ) and 𝑝 Ð I ′ (b1, . .Ð . , b𝑘 ) be probabilities that HI-TestA (𝐵, B) and HI-TestA (𝐵, I ′ ) obtain the sequence b1, . . . , b𝑘 , respectively. Now, we show that 𝑝 B (b1, . . . , b𝑘 ) is at least 𝜅 𝑘 times 𝑝 Ð I ′ (b1, . . . , b𝑘 ). Considering the case 𝑘 = 𝑚 and summing up the inequalities over the sequence b1, . . . , b𝑚 , we get the claim. Suppose that we have obtained b1, . . . , b𝑘 −1 Ð through the oracle (both in HI-TestA (𝐵, B) and HI-TestA (𝐵, I ′ )). Then, the probability that HI-TestA (𝐵, B) obtains b𝑘 in the 𝑘-th stage is 1 𝜅 𝜅 = ≥ , deg𝑅𝑘 ,B (q𝑘 ) 𝜅 deg𝑅𝑘 ,B (q𝑘 ) deg𝑅𝑘 ,Ð I ′ (q𝑘 ) Ð which is 𝜅 times the probability that HI-TestA (𝐵, I ′ ) obtains b𝑘 . Note that deg𝑅𝑘 ,Ð I ′ (q𝑘 ) is not zero because of the Ð

′

existence of b𝑘 ∈ 𝑅𝑘 I . By induction on 𝑘, it follows that 𝑝 B (b1, . . . , b𝑘 ) ≥ 𝜅 𝑘 · 𝑝 Ð I ′ (b1, . . . , b𝑘 ). □ In light of Lemma 3.2, it suffices to find a set of tupledisjoint A-images, and then analyze the rejection probability thereof.

3.2.2 Analysis on a relational structure constructed from tuple-disjoint A-images. Now, we construct a large multiset of tuple-disjoint A-images in B. Let B be a multiset structure that is 𝜖-far from A-free, and let 𝐺 be a maximal multiset of homomorphisms from A to B such that the multiset of the A-images {{𝑔(A) | 𝑔 ∈ 𝐺 }} are tuple-disjoint. Let 𝐺 ′ ⊆ 𝐺 be the subset with |𝐺 ′ | ≥ |𝐺 |/2 given by apply′ ing Lemma 3.2 on 𝐺. Let B′ = (𝐵, {𝑅 B }𝑅 ∈𝜎 ) be the multiset structure obtained by taking the union of the images {{𝑔(A) | ′ 𝑔 ∈ 𝐺 ′ }}, that is, the structure where 𝑅 B = ∪𝑔∈𝐺 ′ 𝑅𝑔 (A) for each 𝑅 ∈ 𝜎. For 𝑘 ∈ {0, . . . , 𝑚}, we say that the algorithm is truly 𝑘-successful if, for each ℓ ∈ [𝑘], there exists 𝑔 ∈ 𝐺 ′ such that bℓ = 𝑔(aℓ ), where bℓ is the answer to the ℓ-th query. Let 𝑇𝑘 denote the event of being truly 𝑘-successful. Lemma 3.3. Suppose we run HI-TestA (𝐵, B′ ). Then, it holds that Pr [𝑇𝑘 | 𝑇𝑘 −1 ] ≥ 𝑚1 for every 𝑘 ∈ [𝑚]. Lemma 3.4. We have |𝐺 | > 𝜖 ∥B∥/𝑚. Proof. We could remove all A-images in B by removing all tuples in {{𝑔(a) | 𝑔 ∈ 𝐺, 𝑅 ∈ 𝜎, a ∈ 𝑅 A }}. This means that we can delete all homomorphisms from A to B by removing at most 𝑚 · |𝐺 | tuples from B. From the 𝜖-farness of B, we have 𝑚 · |𝐺 | > 𝜖 ∥B∥, which yields the claim. □ Lemma 3.5. After the 𝑘-th stage of HI-TestA (𝐵, B′ ), for any map ℎ : {a𝑘 } → 𝐵, we have h i #{{𝑔 ∈ 𝐺 ′ | 𝑔 extends ℎ}} . Pr 𝑓 𝑘 | {a𝑘 } = ℎ | 𝑇𝑘 = |𝐺 ′ | Proof. We prove this by induction. It is clear for 𝑘 = 1, since each of the tuples in {{𝑔(a1 ) | 𝑔 ∈ 𝐺 ′ }} is chosen with equal probability. For 𝑘 > 1, let ℓ < 𝑘 denote an index such that 𝑃𝑘 := Ð ′ {a𝑘 } ∩ ℓ ′ ∈ [𝑘 −1] {aℓ } ⊆ {aℓ }; such an index ℓ exists due to A being 𝛼-acyclic. From the induction hypothesis on the ℓ-th stage, we have (by summing) that for any map ℎ : 𝑃𝑘 → 𝐵, h i h i Pr 𝑓 ℓ |𝑃𝑘 = ℎ | 𝑇𝑘 = Pr 𝑓 ℓ |𝑃𝑘 = ℎ | 𝑇ℓ #{{𝑔 ∈ 𝐺 ′ | 𝑔 extends ℎ}} . |𝐺 ′ | We then have h i Pr 𝑓 𝑘 | {a𝑘 } = ℎ | 𝑇𝑘 h i = Pr 𝑓 ℓ |𝑃𝑘 = ℎ|𝑃𝑘 | 𝑇𝑘 h i × Pr 𝑓 𝑘 | {a𝑘 }\𝑃𝑘 = ℎ| {a𝑘 }\𝑃𝑘 | 𝑇𝑘 ∧ 𝑓 ℓ |𝑃𝑘 = ℎ|𝑃𝑘 h i = Pr 𝑓 ℓ |𝑃𝑘 = ℎ|𝑃𝑘 | 𝑇ℓ h i × Pr 𝑓 𝑘 | {a𝑘 }\𝑃𝑘 = ℎ| {a𝑘 }\𝑃𝑘 | 𝑇𝑘 ∧ 𝑓 ℓ |𝑃𝑘 = ℎ|𝑃𝑘 . =

The latter quantity is equal to the product of #{{𝑔 ∈ 𝐺 ′ | 𝑔 extends ℎ|𝑃𝑘 }}/|𝐺 ′ | and #{{𝑔 ∈ 𝐺 ′ | 𝑔 extends ℎ}}/#{{𝑔 ∈ 𝐺 ′ | 𝑔 extends ℎ|𝑃𝑘 }} which yields the lemma.

□

Ð ′ Proof of Lemma 3.3. Let 𝑃𝑘 := {a𝑘 } ∩ ℓ ′ ∈ [𝑘 −1] {aℓ } be the set of elements previously appeared. Suppose that 𝑃𝑘 = {a𝑘 }. Then, there exists ℓ ∈ [𝑘 −1] such that {a𝑘 } ⊆ {aℓ }. Then, as q𝑘 = 𝑓 ℓ (aℓ )| {a𝑘 } = 𝑔(aℓ )| {a𝑘 } for some homomorphism 𝑔 ∈ 𝐺 ′ , we have q𝑘 = 𝑔(a𝑘 ) and hence the process is truly 𝑘-successful. Suppose that 𝑃𝑘 ⊊ {a𝑘 }. We define 𝑄 ⊆ (𝐵 ∪ {∗}) ar(𝑅𝑘 ) as the set of tuples q such that (i) q(𝑎) ≠ ∗ for 𝑎 ∈ 𝑃𝑘 , (ii) q(𝑎) = ∗ for 𝑎 ∈ {a𝑘 } \ 𝑃𝑘 , and (iii) q has a completion in {{𝑔(a𝑘 ) | 𝑔 ∈ 𝐺 ′ }}. For q ∈ 𝑄, we define 𝑛 q as the number of completions b of q such that b = 𝑔(a𝑘 ) for some 𝑔 ∈ 𝐺 ′ . Í Note that q∈𝑄 𝑛 q = |𝐺 ′ |. For q ∈ 𝑄, we define 𝑚 q as the ′ total number of completions b ∈ 𝑅𝑘B of q, that is, b = 𝑔(aℓ ) Í for some ℓ ∈ [𝑚] with 𝑅ℓ = 𝑅𝑘 . Note that q∈𝑄 𝑚 q ≤ 𝑚 · Í ′ q∈𝑄 𝑛 q = 𝑚|𝐺 | because A-images of homomorphisms in ′ 𝐺 are tuple-disjoint. Also, 𝑚 q ≥ 𝑛 q > 0 for any q ∈ 𝑄 from the definition of 𝑄. Let ℓ ∈ [𝑘 − 1] be such that 𝑃𝑘 ⊆ {aℓ }. For q ∈ 𝑄, define ℎ q : 𝑃𝑘 → 𝐵 as ℎ(𝑎) = q(𝑎) for every 𝑎 ∈ 𝑃𝑘 . By Lemma 3.5, we have h i h i Pr q𝑘 = q | 𝑇𝑘 −1 = Pr 𝑓 𝑘 −1 |𝑃𝑘 = ℎ q | 𝑇𝑘 −1 𝑛q #{{𝑔 ∈ 𝐺 ′ | 𝑔 extends ℎ q }} = ′ . ′ |𝐺 | |𝐺 | Hence, we have h i ∑︁ 𝑛 q 𝑛 q Pr 𝑇𝑘 | 𝑇𝑘 −1 = . |𝐺 ′ | 𝑚 q q∈𝑄 =

(1)

Now we look at (1) as a function of 𝒎 = {𝑚 q }q∈𝑄 and write it as 𝑝 (𝒎). Then, to get a lower bound on (1), we extend 𝑄 𝑄 the Í domain of 𝑝Ífrom N to R+ and minimize it subject to q∈𝑄 𝑚 q ≤ 𝑚 · q∈𝑄 𝑛 q . Notice that 2    − 𝑛′ q 2 if 𝑚 q > 0,  |𝐺 |𝑚 q (∇𝑝) q =  0 otherwise.  This in particular means that when 𝑚 q = 0 for some q ∈ 𝑄, we can decrease the value of 𝑝 by increasing 𝑚 q while decreasing another element. Hence, an optimizer 𝒎 ∗ = {𝑚 ∗q }q∈𝑄

𝑄

to (1) is not on the boundary of the domain R+ . Then, we have for any q, q′ ∈ 𝑄 that 2 𝑛 2q  1  𝑛 q′ ∇𝑝 (𝒎 ∗ ) · (𝒆 q − 𝒆 q′ ) = ′ − , |𝐺 | (𝑚 ∗q′ ) 2 (𝑚 ∗q ) 2

where 𝒆 q is the characteristic vector with one in the q-th element and zeros elsewhere. As 𝒎 ∗ satisfies ∇𝑓 (𝒎 ∗ ) · (𝒆 q − 𝒆 q′ ) = 0 for all q, q′ ∈ 𝐵, 𝑛 q /𝑚 q is constant regardless of the choice of q. It follows that ∑︁ 𝑛 q 𝑛 q 1 𝑝 (𝒎 ∗ ) ≥ = , ′ | 𝑚𝑛 |𝐺 𝑚 q q∈𝑄 which implies the claim.

□

Corollary 3.6. The rejection probability of HI-TestA (𝐵, B′ ) is at least 1/𝑚𝑚 . Proof. By Lemma 3.3, the probability that the algorithm is truly 𝑚-successful and hence finds a homomorphism from A to B′ is at least 1/𝑚𝑚 . □ The proof of Lemma 3.1 is immediate from Lemma 3.2 and Corollary 3.6. With Lemma 3.1, we can easily get a tester for A-freeness: Theorem 3.7. There exists a one-sided error tester for Afreeness with a constant number of queries. The query com𝑚 plexity is 𝑂 (𝑚2𝑟¯ /𝜖) , where 𝑟¯ = max𝑅 ∈𝜎 ar(𝑅).

Algorithm 2 1: procedure IHI-TestA (𝐵, B)

⊲ 𝐵 is a domain, B is a multiset structure with the domain 𝐵 and the same vocabulary as A provided through a query access. if HI-TestA (𝐵, B) accepts (by claiming that B is A2: free) then 3: Accept. 4: else 5: Let 𝑔 : 𝐴 → 𝐵 be the obtained homomorphism. 6: if 𝑔 is not injective then 7: Accept. 8: else 9: Reject. on a relational structure constructed from tuple-disjoint Aimages. However, we carefully choose the images so that we get an injective homomorphism with high probability. Now, we construct a large set of tuple-disjoint A-images. Let B be a multiset structure 𝜖-far from injective A-freeness, and let 𝐺 be a maximal set of injective homomorphisms from A to B such that the multiset of A-images {{𝑔(A) | 𝑔 ∈ 𝐺 }} is tuple-disjoint.

Proof. Our algorithm runs HI-TestA (𝐵, B) Θ(1/𝛿) many A (𝜖), and accepts if and only if all the runs times for 𝛿 = 𝛿 3.1 accept. If B is A-free, then HI-TestA always accepts, and the algorithm also always accepts. If B is 𝜖-far from A-freeness, then the rejection probability of the algorithm is at least 1 − (1 − 𝛿) Θ(1/𝛿 ) ≥ 23 by setting the hidden constant to be large enough. □

Proof. We could remove all A-images in B by removing all tuples in {{𝑔(a) | 𝑔 ∈ 𝐺, 𝑅 ∈ 𝜎, a ∈ 𝑅 A }}. This means that we can delete all injective homomorphisms from A to B by removing at most 𝑚|𝐺 | tuples from B. From the 𝜖-farness of B, we have 𝑚|𝐺 | > 𝜖 ∥B∥, which yields the claim. □

Theorem 3.7 gives the “if” part of Theorem 1.1 because, if the core A′ of A is 𝛼-acyclic, then we can test A-freeness just by testing A′ -freeness. Suppose A represents an undirected graph 𝐻 as in Section 1.3. Then, as 𝑟¯ = 2, the query complexity is 𝑂 (𝑚/𝜖)𝑚 , where 𝑚 is the number of edges in 𝐻 . This bound matches the previous result for testing 𝑘-path-freeness [37].

Lemma 3.9. There exists a coloring 𝜙 : 𝐵 → 𝐴 such that |𝐺𝜙 | ≥ |𝐺 |/|𝐴| |𝐴| .

3.3

Injective homomorphism inadmissibility

In this section, we discuss how to test injective homomorphism inadmissibility. The modification to Algorithm 1 is simple: we check whether the obtained homomorphism is injective at the end of the algorithm. See Algorithm 2, called IHI-TestA for details. It is clear that IHI-TestA always accepts B that is injective A-free and that the query complexity is constant. Hence, we analyze its rejection probability when B is 𝜖-far from injective A-freeness. The analysis of IHI-TestA is very similar to the one of HITestA . We use the reduction given by Lemma 3.2 and focus

Lemma 3.8. We have |𝐺 | > 𝜖 ∥B∥/𝑚.

Let 𝜙 : 𝐵 → 𝐴 be a map, which we call a coloring of 𝐵 with |𝐴| colors. Then, we say that a homomorphism 𝑔 : 𝐴 → 𝐵 admits the coloring 𝜙 if 𝜙 (𝑔(𝑎)) = 𝑎. We define 𝐺𝜙 as the multiset of injective homomorphisms in 𝐺 that admit 𝜙.

Proof. Suppose that a coloring 𝜓 : 𝐵 → 𝐴 is randomly chosen, that is, Pr[𝜓 (𝑏)] = 1/|𝐴| for every 𝑏 ∈ 𝐵 independently from others. Then, the probability that an injective homomorphism 𝑔 : 𝐴 → 𝐵 admits the coloring 𝜓 is 1/|𝐴| |𝐴| . It follows that the expected number of homomorphisms in 𝐺 that admit 𝜓 is |𝐺 |/|𝐴| |𝐴| . Hence, there exists a coloring 𝜙 : 𝐵 → 𝐴 with |𝐺𝜙 | ≥ |𝐺 |/|𝐴| |𝐴| . □ Fix a coloring 𝜙 : 𝐵 → 𝐴 with |𝐺𝜙 | ≥ |𝐺 |/|𝐴| |𝐴| , given by Lemma 3.9. Let 𝐺𝜙′ ⊆ 𝐺 be the subset with |𝐺𝜙′ | ≥ |𝐺𝜙 |/2 given by applying Lemma 3.2 on 𝐺𝜙 . Then, we define a multiset structure B𝜙′ and the notion of being truly 𝑘-successful using 𝐺𝜙′ , as in Section 3.2.2. The advantage of working with 𝐺𝜙′ is that, if the algorithm is truly 𝑚-successful with respect to 𝐺𝜙′ , then the obtained

homomorphism is injective because any homomorphism 𝑔 obtained when truly 𝑚-successful satisfies 𝜙 (𝑔(𝑎)) = 𝑎 for every 𝑎 ∈ 𝐴 and hence 𝑔(𝑎)’s are distinct. Modifying the proof of Corollary 3.6 by replacing B′ with ′ B𝜙 , we obtain the following: Corollary 3.10. HI-TestA (𝐵, B𝜙′ ) finds an injective homomorphism with probability at least 1/𝑚𝑚 . Lemma 3.11. Suppose that the multiset structure B is 𝜖-far from injective A-freeness for 𝜖 ∈ (0, 1). Then, there exists 𝛿 = A (𝜖) > 0 such that IHI-Test (𝐵, B) rejects with probability 𝛿 3.11 A at least 𝛿. Proof. It is immediate from Lemma 3.2 and Corollary 3.10 that there exists 𝛿 = 𝛿 (𝜖) > 0 such that HI-TestA (𝐵, B) rejects and returns an injective homomorphism 𝑔 : 𝐴 → 𝐵 from 𝐴 to B𝜙′ with probability at least 𝛿. As 𝑔 is injective, IHI-TestA (𝐵, B) also rejects with probability at least 𝛿. □ Theorem 3.12. When A is 𝛼-acyclic, there exists a one-sided error tester for injective A-freeness with a constant number of queries. Proof. Our algorithm run IHI-TestA (𝐵, B) Θ(1/𝛿) many A (𝜖), and accepts if and only if all the runs times for 𝛿 = 𝛿 3.11 accept. If there is no injective homomorphism from A to B, then IHI-TestA always accepts, and the algorithm also always accept. If B is 𝜖-far from injective A-freeness, then the rejection probability of the algorithm is at least 1 − (1 − 𝛿) Θ(1/𝛿 ) ≥ 23 by setting the hidden constant to be large enough. □

4

LOWER BOUND

In this section, we establish the following lower bound result. Theorem 4.1. Suppose that A is a relational structure whose core is not 𝛼-acyclic; then, testing A-freeness is not constantquery testable with one-sided error.

(iv) There exists a function 𝑔(𝑛) ∈ 𝑂 (𝑛) such that, for each structure B1 , it holds that |𝐵 2 | ≤ 𝑔(|𝐵 1 |). We will make tacit use of the following straightforwardly verified facts. Proposition 4.3. Suppose that A1 , A2 are structures such that testing A1 -freeness reduces to testing A2 -freeness. • If A2 -freeness is constant-query testable with one-sided error, then so is A1 -freeness. • If 𝑘 ≥ 1 is a constant such that A2 -freeness is testable in 𝑂 (𝑛 1/𝑘 ) queries with one-sided error, then A1 -freeness is also so testable. Towards proving Theorem 4.1, we next present two reductions. The first allows us to restrict attention to symboldistinct structures, and the second allows us to pass to induced hypergraphs. Here, we say that a structure is symboldistinct if each relation has exactly one tuple. The full proofs of the following two theorems are included in the appendix. Theorem 4.4. For each structure A that is a core, there exists a symbol-distinct structure A′ such that testing A′ -freeness reduces to testing A-freeness, and such that A and A′ share the same hypergraph, that is, 𝐺 A and 𝐺 A′ are isomorphic. The idea behind the proof of Theorem 4.4 is as follows. The structure A′ is defined on a vocabulary 𝜎 ′ having a relation symbol 𝑅t interpreted as {t}, for every relation symbol 𝑅 of the vocabulary 𝜎 of A and for each t ∈ 𝑅 A . To reduce from testing A′ -freeness to testing A-freeness, a structure B′ with vocabulary 𝜎 ′ is translated to a structure B with vocabulary ′ 𝜎 by marking the elements of 𝑅tB with t and then placing B them in 𝑅 . Establishing the correctness of the reduction uses the assumption that A is a core.

In order to establish this lower bound, we will make use of the following notion of reduction.

Theorem 4.5. Let A be a symbol-distinct structure whose hypergraph is 𝐺 A , and let 𝑆 ⊆ 𝐴. There exists a symbol-distinct structure A′ whose hypergraph is 𝐺 A [𝑆] such that testing A′ freeness reduces to testing A-freeness.

Definition 4.2. Let A1 , A2 be structures. We say that testing A1 -freeness reduces to testing A2 -freeness if there exists a map 𝑓 sending each multiset structure B1 to a multiset structure B2 = 𝑓 (B1 ) such that the following hold: (i) For each structure B1 , if B1 is A1 -free, then B2 is A2 -free. (ii) For each 𝜖1 ∈ (0, 1), there exists 𝜖2 ∈ (0, 1) such that, for each structure B1 , if B1 is 𝜖1 -far from being A1 -free, then B2 is 𝜖2 -far from being A2 -free. (iii) There exists a constant 𝐶 ≥ 1 such that, for each structure B1 , the answer to a query to the completion oracle for B2 can be computed from the answers to 𝐶 many queries to the completion oracle for B1 .

On a high level, Theorem 4.5 is established in the following way. For each relation symbol 𝑅 in the signature 𝜎 of A, the structure A′ has a relation whenever the tuple (𝑎 1, . . . , 𝑎𝑟 ) ∈ 𝑅 A contains an entry from 𝑆; that relation is interpreted as the relation having one tuple whose entries are the values among 𝑎 1, . . . , 𝑎𝑟 that are contained in 𝑆; the other coordinates are effectively removed. To reduce from testing A′ -freeness to testing A-freeness, a structure B′ over signature 𝜎 ′ is translated to a structure B over signature 𝜎 essentially by filling out the coordinates that were removed, in each relation, with a value + that is fresh in that it is not contained in 𝐵. In this way, any mapping 𝑓 : 𝑆 → 𝐵 ′ can be naturally extended to a mapping 𝑓 ′ : 𝐴 → 𝐵 where each

element of 𝐴 \ 𝑆 is sent to +; this correspondence has the property that 𝑓 is a homomorphism from A′ to B′ if and only if 𝑓 ′ is a homomorphism from A to B. We now give a proof of Theorem 4.1 based on the following two theorems, whose proofs are deferred to Sections 4.1 and 4.2. Theorem 4.6. Let A be a symbol-distinct relational structure such √ that M (𝐺 A ) is a cycle. Then, testing A-freeness requires Ω( 𝑛) queries, where 𝑛 is the domain size of the input structure. Theorem 4.7. Let A be a symbol-distinct relational structure such that M (𝐺 A ) is a 𝑘-simplex for 𝑘 ≥ 2. Then, testing A-freeness with one-sided error requires Ω(𝑛 1/𝑘 ) queries, where 𝑛 is the domain size of the input structure. Proof of Theorem 4.1. Let C be the core of A. Since A and C are homomorphically equivalent (that is, there exist homomorphisms from each to the other), the properties of A-freeness and C-freeness are equivalent. Hence, it suffices to prove the lower bound for testing C-freeness. By Theorem 4.4, there exists a symbol-distinct structure C′ whose hypergraph 𝐺 is not 𝛼-acyclic, and such that it suffices to prove the lower bound for testing C′ -freeness. We now invoke Theorem 2.2; by this theorem, there exists a subset 𝑆 of the domain of C′ , with |𝑆 | ≥ 3, such that M (𝐺 [𝑆]) is either a cycle or a simplex. By Theorem 4.5, there exists a symbol-distinct structure C′′ whose hypergraph is 𝐻 = 𝐺 [𝑆] such that it suffices to prove the lower bound for testing C′′ freeness. We have that M (𝐻 ) is either a cycle or a simplex. The result follows from Theorems 4.6 and 4.7. □

4.1

Lower Bounds for Cycles

In this section, we prove Theorem 4.6. We use a reduction from testing triangle-freeness, which is hard as in the following theorem: Theorem 4.8 ([5]). Testing √ triangle-freeness in the general graph model requires Ω( 𝑛) queries, where 𝑛 is the number of vertices in the input graph. The model studied in [5] did not consider queries of the form (∗, ∗). However, as the hardness is shown on a distribution over 𝑑-regular graphs for a fixed 𝑑, we can answer to the size query (∗, ∗) by returning 𝑑𝑛/2 and to the completion query (∗, ∗) by sampling a vertex uniformly at random and returning a random edge incident to it using the random neighbor oracle. Proof of Theorem 4.6. Let 𝐴 = {𝑎 1, . . . , 𝑎𝑘 }, where 𝑘 ≥ 3. From the assumption, every relation in A is unary or binary, and any binary relation of A has a single tuple of the form (𝑎𝑖 , 𝑎𝑖+1 ) for 𝑖 ∈ [𝑚], where 𝑎𝑘+1 = 𝑎 1 .

Now, we reduce testing triangle-freeness in the general graph model to testing A-freeness. Given a query access to a (regular) graph 𝐺 = (𝑉 , 𝐸), we construct a multiset structure B on the domain 𝑉 as follows. For each unary relation 𝑅 A , we define 𝑅 B as the set containing 2|𝐸|/|𝑉 | many copies of (𝑣) for each 𝑣 ∈ 𝑉 . Note that, as 𝐺 is regular, |𝑉 | always divides 2|𝐸|. For each binary relation of the form 𝑅 A = {(𝑎𝑖 , 𝑎𝑖+1 )} for 𝑖 ∈ [3], we define 𝑅 B = {(𝑢, 𝑣), (𝑣, 𝑢) | {𝑢, 𝑣 } ∈ 𝐸}. For each binary relation of the form 𝑅 A = {(𝑎𝑖 , 𝑎𝑖+1 )} for 𝑖 ∈ {4, . . . , 𝑘 }, we define 𝑅 B as the set containing 2|𝐸|/|𝑉 | many copies of (𝑣, 𝑣) for each 𝑣 ∈ 𝑉 . Now, note that every relation contains exactly 2|𝐸| tuples. Hence, ∥B∥ = 2∥A∥ · |𝐸|. Now, we check the reduction above satisfies the conditions of Definition 4.2. If 𝐺 is triangle-free, then clearly B is Afree, which confirms (i). Suppose that 𝐺 is 𝜖-far from Afreeness whereas B is 𝛿-close to A-freeness. Removing 𝛿 ∥B∥ tuples from relations in B corresponds to removing at most 2𝛿 ∥A∥ · |𝐸| = 2𝛿 ∥A∥ · |𝐸| edges and at most 2𝛿 ∥A∥ · |𝐸| · |𝑉 |/2|𝐸| = 𝛿 ∥A∥ · |𝑉 | vertices from 𝐺. Recalling that 𝐺 is regular, it results in removing at most 4𝛿 ∥A∥ · |𝐸| edges. Hence, we must have 4𝛿 ∥A∥ ≥ 𝜖, which confirms (ii). It is easy to see that we can answer to a query to the oracle for B using a constant number of queries to the oracle for 𝐺, which confirms (iii). Hence, testing A-freeness requires √ Ω( 𝑛) queries by Theorem 4.8. □

4.2

Lower Bounds for Simplices

In this section, we prove Theorem 4.7. The main ingredient of our proof is a hardness for testing simplex-freeness of hypergraphs. To state the hardness, we first introduce the general hypergraph model, which is an extension of the general graph model. In this model, an algorithm is given an integer 𝑛 and a query access to a 𝑘-uniform hypergraph 𝐺 = (𝑉 , E) on 𝑛 vertices. There are two types of queries, called size queries and completion queries. Each type of query receives a subset 𝑄 ⊆ 𝑉 of size at most 𝑘. A hyperedge 𝑆 ∈ E is called a completion of 𝑄 in 𝐺 if 𝑆 ∩ 𝑄 = 𝑄. Then, the answer to the size query 𝑄 is the number of completions of 𝑄 in 𝐺, and the answer to the completion query 𝑄 is a random completion of 𝑄 in 𝐺 if exists and a special symbol ⊥ otherwise. In particular, if 𝑄 is empty, then it returns a random hyperedge (unless 𝐺 is empty), and if 𝑄 is of size 𝑘, then it returns whether 𝐺 has the hyperedge 𝑄. A hypergraph 𝐺 = (𝑉 , E) is called 𝜖-far from simplex-freeness if we must remove more than 𝜖 |𝐸| hyperedges so that the resulting hypergraph has no simplex as its subgraph. A tester for simplex-freeness is an algorithm that, given an integer 𝑛, a query access to a graph 𝐺 = (𝑉 , E), and an error parameter 𝜖 ∈ (0, 1), accepts with probability at least 2/3 if 𝐺 is simplex-free and rejects with probability at least 2/3 if 𝐺 is

𝜖-far from simplex-freeness. Then, we show the following lower bound for testing simplex-freeness.

4.2.3 Proof of Theorem 4.7. We first show that testing Afreeness requires Ω(𝑛 1/𝑘 ) queries. Suppose A is of the form

Theorem 4.9. For any 𝑘 ≥ 2, testing 𝑘-simplex in a (𝑘 + 1)uniform hypergraph with one-sided error requires Ω(𝑛 1/𝑘 ) queries, where 𝑛 is the number of vertices in the input hypergraph.

(𝐴 = {𝑎 1, . . . , 𝑎𝑘+1 }, {𝑅 A }𝑅 ∈𝜎 ).

In Section 4.2.1, we provide a distribution of 𝑘-uniform hypergraphs that have many edge-disjoint 𝑘-simplices. In Section 4.2.2, we show that any one-sided error tester on a hypergraph sampled from the distribution requires Ω(𝑛 1/𝑘 ) queries. We note that the proof of Lemma 4.9 follows the line of the proof of Theorem 4.8, but is more cumbersome. The proof of Theorem 4.7 is provided in Section 4.2.3. Missing proofs are given in Appendix C. 4.2.1 Lower-bound distribution. Let D𝑛,𝑘 be a distribution over 𝑘-uniform hypergraphs with 𝑛 vertices and degree 𝑘 𝑛 𝑘 −1−1/𝑘 𝑑 = 𝑘+1 · ( 𝑘+1 ) defined as follows. A hypergraph is generated by first partitioning the vertices into equal-size subsets of size 𝑛¯ = 𝑛/(𝑘 + 1), denoted 𝑉1, . . . , 𝑉𝑘+1 . Next, for each subset {𝑖 1, . . . , 𝑖𝑘 } ⊆ [𝑘 + 1] of size 𝑘, we select 𝑑¯ = 𝑑/𝑘 = 𝑛¯𝑘 −1−1/𝑘 /(𝑘 + 1) random perfect 𝑘-dimensional matchings among 𝑉𝑖 1 , . . . , 𝑉𝑖𝑘 . In what follows, we assume that 𝑛¯ is sufficiently large. Lemma 4.10. For any 𝑛 and 𝑘, a hypergraph sampled uniformly from D𝑛,𝑘 is Ω(1)-far from simplex-freeness with probability at least 𝛿 4.10 (𝑘) = 1 𝑘 . 4(𝑘+1)

4.2.2 Lower bound for one-sided error testers. The goal of this section is proving Theorem 4.9. Let A be any one-sided error tester for simplex-freeness. We can assume the probability that A errs is an arbitrarily small constant, say, 𝛿 4.10 (𝑘)/2 (Otherwise, we can run A many times to reduce the failure probability). If A views a simplex in the tested hypergraph, then clearly it can reject the hypergraph. However, since A is a one-sided error tester, if it terminates before viewing a simplex, then it must accept. Suppose that we run A on a hypergraph chosen according to D𝑛,𝑘 introduced in Section 4.2.1, with some (sufficiently small) constant 𝜖. Since we have shown in Lemma 4.10 that, with probability at least 𝛿 4.10 (𝑘), such a hypergraph is 𝜖-far from being simplex free and the failure probability of A is at most 𝛿 4.10 (𝑘)/2, the probability that A terminates before viewing a simplex must be less than 1 − 𝛿 4.10 (𝑘)/2. Hence, Theorem 4.9 follows from the following lemma: Lemma 4.11. For any fixed 𝑘, any deterministic algorithm that detects a simplex in a hypergraph selected according to D𝑛,𝑘 with probability at least 𝛿 4.10 (𝑘)/2 (over the choice of the hypergraph and internal randomness) requires Ω(𝑛 1/𝑘 ) queries.

From the assumption, for every 𝑖 ∈ [𝑘 + 1], there exists a 𝑘-ary relation 𝑅 A = {(𝑎 1, . . . , 𝑎𝑖 −1, 𝑎𝑖+1, . . . , 𝑎𝑘+1 )}. We reduce testing simplex-freeness on regular 𝑘-uniform hypergraphs to testing A-freeness. We only consider hypergraphs generated by the distribution given in Section 4.2.1. In particular, the input hypergraph 𝐺 = (𝑉 , E) is 𝑑-regular for 𝑑 = Θ(𝑛𝑘 −1−1/𝑘 ) and the vertex set can be partitioned into 𝑉1, . . . , 𝑉𝑘+1 of the same size. For a set 𝐼 ⊆ [𝑘 + 1] of size 𝑘, we define E𝐼 as the set of hyperedges spanning 𝑉𝑖 ’s for 𝑖 ∈ 𝐼. Now, we construct a multiset relational structure B on the domain 𝑉 as follows. For a 𝑘-ary relation 𝑅 A of the form {(𝑎 1, 𝑎 2, . . . , 𝑎𝑖 −1, 𝑎𝑖+1, . . . , 𝑎𝑘+1 )}, we define 𝑅 B = E [𝑘+1]\{𝑖 } . Here, we identify a tuple (𝑣 1, . . . , 𝑣𝑖 −1, 𝑣𝑖+1, . . . , 𝑣𝑘+1 ) and a hyperedge {𝑣 1, . . . , 𝑣𝑖 −1, 𝑣𝑖+1, . . . , 𝑣𝑘+1 } with 𝑣 1 ∈ 𝑉1, . . . , 𝑣𝑖 −1 ∈ 𝑉𝑖 −1, 𝑣𝑖+1 ∈ 𝑉𝑖+1, . . . , 𝑣𝑘+1 ∈ 𝑉𝑘+1 . For any other relation 𝑅 A = {(𝑎𝑖 1 , . . . , 𝑎𝑖 ℓ )} of arity ℓ ≤ 𝑘 − 1, we define 𝑅 B as the set consisting of |E |/𝑛¯ℓ many copies of each tuple in 𝑉𝑖 1 × · · · × 𝑉𝑖 ℓ , where 𝑛¯ = 𝑛/(𝑘 + 1). For simplicity, we assume that 𝑛¯ℓ divides |E | for every ℓ ≤ 𝑘 − 1, but we can easily extend the argument to the general case. Now, note that every relation in B has exactly |E | many tuples, which means that ∥B∥ ≤ ∥A∥ · |E | Now, we check the reduction above satisfies the conditions of Definition 4.2. If 𝐺 is simplex-free, then B is A-free, which confirms (i). Suppose that 𝐺 is 𝜖-far from simplexfreeness, and B is 𝛿-close to simplex-freeness. Then, removing at most 𝛿 ∥B∥ tuples from B corresponds to removing 𝑂 (𝛿 ∥A∥ ∥B∥) = 𝑂 (𝛿 ∥A∥ 2 |E |) hyperedges from 𝐺. Hence, we have 𝛿 = Ω(𝜖/∥A∥ 2 ), which confirms (ii). It is easy to see that we can answer to a query to the completion oracle for B with a constant number of queries to the completion oracle for 𝐺, which confirms (iii). Hence, testing A-freeness requires Ω(𝑛 1/𝑘 ) queries by Theorem 4.9. This concludes the proof of Theorem 4.7.

5

UNIONS OF CONJUNCTIVE QUERIES

In this section, we give a proof of Corollary 1.3. By the results in [13, Section 3], 𝜙 may be computably rewritten to the form 𝜙 ′ = 𝜙 1 ∨ · · · ∨ 𝜙𝑘 that is normalized in the sense that for distinct 𝑖, 𝑗 ∈ [𝑘], there does not exist a homomorphism from A[𝜙𝑖 ] to A[𝜙 𝑗 ]. Note that, given a structure B, it holds that 𝜙 evaluates to true on B if and only

if there exists 𝑖 ∈ [𝑘] such that there is a homomorphism from A[𝜙𝑖 ] to B (equivalently, B is not A[𝜙𝑖 ]-free). For the positive result, assume that the condition in the statement of Corollary 1.3 holds. Given a structure B, use the positive algorithmic result of Theorem 1.1 with an error parameter 𝜖/𝑘 to test, for each 𝑖 ∈ [𝑘], whether or not B is A[𝜙𝑖 ]-free. Reject to claim that 𝜙 is true if and only if one of the tests rejects (indicating that there is a homomorphism from some A[𝜙𝑖 ] to B). This algorithm rejects with probability at least 2/3 when B is 𝜖-far from 𝜙-falsity because then B is 𝜖/𝑘-far from being A[𝜙𝑖 ]-free for some 𝑖 ∈ [𝑘]. For the lower bound, assume that the condition in the statement of Corollary 1.3 does not hold; then, there exists ℓ ∈ [𝑘] such that the core of A[𝜙 ℓ ] is 𝛼-acyclic. By Theorem 1.1, it suffices to reduce from testing A[𝜙 ℓ ]-freeness to testing 𝜙-falsity. We perform this by using the natural generalization of Definition 4.2. The reduction is to map a multiset structure B to the product A[𝜙 ℓ ] × B, by which we mean the structure with domain 𝐴[𝜙 ℓ ] ×𝐵 and where, for each relation symbol 𝑅, it holds that 𝑅 A[𝜙 ℓ ] ×B = {{((𝑎 1, 𝑏 1 ), . . . , (𝑎𝑟 , 𝑏𝑟 )) | (𝑎 1, . . . , 𝑎𝑟 ) ∈ 𝑅 A[𝜙 ℓ ] , (𝑏 1, . . . , 𝑏𝑟 ) ∈ 𝑅 B }}; here, 𝑟 denotes the arity of 𝑅. It is straightforward to verify that the first and second projections are homomorphisms from A[𝜙 ℓ ] × B to A[𝜙 ℓ ] and B, respectively. Set C = A[𝜙 ℓ ] × B. Let us verify that this is indeed a reduction. (i) We claim that if B is A[𝜙 ℓ ]-free, then A[𝜙 ℓ ] ×B causes 𝜙 to evaluate to false. Let us argue the contrapositive. Suppose that 𝜙 is true on the product. Then, there exists 𝑖 ∈ [𝑘] such that A[𝜙𝑖 ] has a homomorphism to the product C = A[𝜙 ℓ ] × B; but since this product has a homomorphism to A[𝜙 ℓ ], it follows that A[𝜙𝑖 ] has a homomorphism to A[𝜙 ℓ ], implying (by normalization) that 𝑖 = ℓ. Thus, A[𝜙 ℓ ] has a homomorphism to this product, and hence to B. (ii) Let 𝑅 be a relation symbol. By the definition of the product A[𝜙 ℓ ] × B, each tuple (𝑏 1, . . . , 𝑏𝑟 ) in 𝑅 B gives rise to |𝑅 A[𝜙 ℓ ] | tuples in 𝑅 A[𝜙 ℓ ] ×B ; let us call these the offshoots of the tuple (𝑏 1, . . . , 𝑏𝑟 ). It is evident that each tuple in 𝑅 A[𝜙 ℓ ]×B is the offshoot of exactly one tuple in 𝑅 B . Let 𝐾 be the maximum, over relation symbols 𝑅, of |𝑅 A[𝜙 ℓ ] |. We have ||C|| ≤ 𝐾 ||B||. We claim that if a structure B is 𝜖-far from being A[𝜙 ℓ ]free, then C is 𝜖/𝐾-far from 𝜙-falsity. Suppose that C′ is obtained from C by removing (𝜖/𝐾)||C|| tuples from relations. Let us say that a tuple (𝑏 1, . . . , 𝑏𝑟 ) in a relation 𝑅 B of B is partly removed in C′ if one of its offshoots was removed to obtain C′ from C. Then, the number of tuples of B that are partly removed in C′ is bounded above by (𝜖/𝐾)||C|| ≤ (𝜖/𝐾)𝐾 ||B|| = 𝜖 ||B||. Let B′ be the structure obtained from B by removing each tuple that is partly removed in C′ . By assumption, there exists a homomorphism 𝑔 from A[𝜙 ℓ ] to B′ . It is straightforward to verify that the

mapping ℎ defined by ℎ(𝑎) = (𝑎, 𝑔(𝑎)) is a homomorphism from A[𝜙 ℓ ] to C′ , and so 𝜙 is true on C′ . (iii) Consider a query (𝑅, (𝑐 1, . . . , 𝑐𝑟 )) concerning the relation 𝑅 C ; here, (𝑐 1, . . . , 𝑐𝑟 ) ∈ (𝐶 ∪ {∗})𝑟 Define (𝑎 1, . . . , 𝑎𝑟 ) ∈ (𝐴[𝜙 ℓ ] ∪ {∗})𝑟 to be the tuple such that 𝑎𝑖 = ∗ if 𝑐𝑖 = ∗, and 𝑎𝑖 = 𝑑𝑖 if 𝑐𝑖 has the form (𝑑𝑖 , 𝑒𝑖 ). Analogously, define (𝑏 1, . . . , 𝑏𝑟 ) ∈ (𝐵 ∪ {∗})𝑟 to be the tuple such that 𝑏𝑖 = ∗ if 𝑐𝑖 = ∗, and 𝑏𝑖 = 𝑒𝑖 if 𝑐𝑖 has the form (𝑑𝑖 , 𝑒𝑖 ). If the query is a completion query, then to answer it, one can choose a random completion a′ of (𝑎 1, . . . , 𝑎𝑟 ), call the completion query for B to obtain a random completion b′ of (𝑏 1, . . . , 𝑏𝑟 ), and then return the product of a′ and b′ . If the query is a size query, then to answer it, one can count the number 𝑀 of completions of (𝑎 1, . . . , 𝑎𝑟 ), call the size query for B to obtain the number 𝑁 of completions of (𝑏 1, . . . , 𝑏𝑟 ), and return 𝑀 · 𝑁. (iv) We have |𝐶 | = |𝐴[𝜙 ℓ ] | · |𝐵|. Acknowledgements. The first author thanks Amélie Gheerbrant and Cristina Sirangelo for a useful discussion.

REFERENCES [1] S. Abiteboul, R. Hull, and V. Vianu. 1995. Foundations of Databases. Addison-Wesley. [2] Isolde Adler and Frederik Harwath. 2018. Property Testing for Bounded Degree Databases. In STACS. 6:1–6:14. [3] Noga Alon, W Fernandez de la Vega, Ravi Kannan, and Marek Karpinski. 2003. Random sampling and approximation of MAX-CSPs. J. Comput. System Sci. 67, 2 (2003), 212–243. [4] Noga Alon, Eldar Fischer, Ilan Newman, and Asaf Shapira. 2009. A Combinatorial Characterization of the Testable Graph Properties: It’s All About Regularity. SIAM J. Comput. 39, 1 (2009), 143–167. [5] Noga Alon, Tali Kaufman, Michael Krivelevich, and Dana Ron. 2008. Testing Triangle-Freeness in General Graphs. SIAM Journal on Discrete Mathematics 22, 2 (2008), 786–819. [6] Noga Alon and Asaf Shapira. 2002. Testing satisfiability. In SODA. 645–654. [7] L. Barto and M. Kozik. 2009. Constraint Satisfaction Problems of Bounded Width. In FOCS. 595–603. [8] Sagi Ben-Moshe, Yaron Kanza, Eldar Fischer, Arie Matsliah, Mani Fischer, and Carl Staelin. 2011. Detecting and exploiting near-sortedness for efficient relational query evaluation. In ICDT. 256–267. [9] Eli Ben-Sasson, Prahladh Harsha, and Sofya Raskhodnikova. 2005. Some 3CNF Properties Are Hard to Test. SIAM J. Comput. 35, 1 (2005), 1–21. [10] Jon Louis Bentley. 1979. Decomposable searching problems. Inform. Process. Lett. 8, 5 (1979), 244–251. [11] Arnab Bhattacharyya and Yuichi Yoshida. 2013. An Algebraic Characterization of Testable Boolean CSPs. In ICALP. 123–134. [12] Manuel Blum, Michael Luby, and Ronitt Rubinfeld. 1993. Selftesting/correcting with applications to numerical problems. J. Comput. System Sci. 47, 3 (1993), 549–595. [13] Simone Bova and Hubie Chen. 2014. The Complexity of Width Minimization for Existential Positive Queries. In ICDT. 235–244. [14] Johann Brault-Baron. 2016. Hypergraph Acyclicity Revisited. Comput. Surveys 49, 3 (2016), 54:1–54:26. [15] Andrei A. Bulatov. 2017. A Dichotomy Theorem for Nonuniform CSPs. In FOCS. 319–330.

[16] Ashok K Chandra and Philip M Merlin. 1977. Optimal implementation of conjunctive queries in relational data bases. In STOC. 77–90. [17] Surajit Chaudhuri and Moshe Y. Vardi. 1993. Optimization of Real Conjunctive Queries. In PODS. 59–70. [18] Hubie Chen. 2014. On the complexity of existential positive queries. ACM Trans. Comput. Log. 15, 1 (2014). [19] Hubie Chen and Benoit Larose. 2017. Asking the Metaquestions in Constraint Tractability. TOCT 9, 3 (2017), 11:1–11:27. [20] Hubie Chen and Moritz Müller. 2015. The Fine Classification of Conjunctive Queries and Parameterized Logarithmic Space. Transactions on Computation Theory 7, 2 (2015), 7. [21] Hubie Chen and Moritz Müller. 2017. One Hierarchy Spawns Another: Graph Deconstructions and the Complexity Classification of Conjunctive Queries. ACM Trans. Comput. Log. 18, 4 (2017), 29:1–29:37. [22] Hubie Chen and Moritz Müller. 2017. The Parameterized Space Complexity of Embedding Along a Path. Theory Comput. Syst. 61, 3 (2017), 851–870. [23] Hubie Chen, Matt Valeriote, and Yuichi Yoshida. 2016. Testing Assignments to Constraint Satisfaction Problems. In FOCS. 525–534. [24] Anirban Dasgupta, Ravi Kumar, and Tamas Sarlos. 2014. On estimating the average degree. In WWW. 795–806. [25] Ronald Fagin, Phokion G Kolaitis, Renée J Miller, and Lucian Popa. 2005. Data exchange: semantics and query answering. Theoretical Computer Science 336, 1 (2005), 89–124. [26] T. Feder and M. Vardi. 1999. The computational structure of monotone monadic SNP and constraint satisfaction: A study through Datalog and group theory. SIAM J. Comput. 28 (1999), 57–104. [27] Eldar Fischer, Eric Lehman, Ilan Newman, Sofya Raskhodnikova, Ronitt Rubinfeld, and Alex Samorodnitsky. 2002. Monotonicity testing over general poset domains. In STOC. 474–483. [28] Jacob Fox, János Pach, and Andrew Suk. 2016. A Polynomial Regularity Lemma for Semialgebraic Hypergraphs and Its Applications in Geometry and Property Testing. SIAM J. Comput. 45, 6 (2016), 2199–2223. [29] Oded Goldreich (Ed.). 2010. Property Testing: Current Research and Surveys. LNCS, Vol. 6390. Springer. [30] Oded Goldreich, Shafi Goldwasser, and Dana Ron. 1998. Property testing and its connection to learning and approximation. J. ACM 45, 4 (1998), 653–750. [31] Oded Goldreich and Dana Ron. 2002. Property Testing in Bounded Degree Graphs. Algorithmica 32, 2 (2002), 302–343. [32] Oded Goldreich and Dana Ron. 2008. Approximating average parameters of graphs. Random Structures & Algorithms 32, 4 (2008), 473–493. [33] Georg Gottlob, Nicola Leone, and Francesco Scarcello. 2001. The complexity of acyclic conjunctive queries. J. ACM 48, 3 (2001), 431– 498. [34] Georg Gottlob, Nicola Leone, and Francesco Scarcello. 2002. Hypertree decompositions and tractable queries. J. Comput. System Sci. 64, 3 (2002), 579–627. [35] Martin Grohe. 2007. The complexity of homomorphism and constraint satisfaction problems seen from the other side. J. ACM 54, 1 (2007). [36] P. Hell and J. Nesetril. 1992. The core of a graph. Discrete Mathematics 109 (1992), 117–126. [37] Kazuo Iwama and Yuichi Yoshida. 2018. Parameterized Testability. ACM Transactions on Computation Theory 9, 4 (2018), 16–16. [38] Felix Joos, Jaehoon Kim, Daniela Kühn, and Deryk Osthus. 2017. A characterization of testable hypergraph properties. In FOCS. 859–867. [39] Tali Kaufman, Michael Krivelevich, and Dana Ron. 2004. Tight Bounds for Testing Bipartiteness in General Graphs. SIAM J. Comput. 33, 6 (2004), 1441–1483.

[40] Dániel Marx. 2010. Tractable hypergraph properties for constraint satisfaction and conjunctive queries. In STOC. 735–744. [41] C. Papadimitriou and M. Yannakakis. 1999. On the Complexity of Database Queries. J. Comput. System Sci. 58, 3 (1999), 407–427. [42] V Rödl and M Schacht. 2007. Property testing in hypergraphs and the removal lemma. In STOC. 488–495. [43] Dana Ron. 2010. Algorithmic and Analysis Techniques in Property Testing. Foundations and Trends in Theoretical Computer Science 5 (2010), 73–205. Issue 2. [44] Ronitt Rubinfeld and Asaf Shapira. 2011. Sublinear Time Algorithms. Electronic Colloquium on Computational Complexity (ECCC) 18 (2011). TR11-013. [45] Ronitt Rubinfeld and Madhu Sudan. 1996. Robust Characterizations of Polynomials with Applications to Program Testing. SIAM J. Comput. 25, 2 (1996), 252–271. [46] Nicole Schweikardt, Thomas Schwentick, and Luc Segoufin. 2009. Database Theory: Query Languages. In Algorithms and Theory of Computation Handbook (second ed.), Mikhail J. Atallah and Marina Blanton (Eds.). Vol. 2: Special Topics and Techniques. CRC Press, Chapter 19. [47] Christian Sohler. 2012. Almost Optimal Canonical Property Testers for Satisfiability. In FOCS. 541–550. [48] Yuichi Yoshida. 2011. Optimal constant-time approximation algorithms and (unconditional) inapproximability results for every bounded-degree CSP. In STOC. 665–674. [49] Yuichi Yoshida. 2014. A Characterization of Locally Testable AffineInvariant Properties via Decomposition Theorems. In STOC. 154–163. [50] Yuichi Yoshida. 2014. Gowers Norm, Function Limits, and Parameter Estimation. In SODA. 1391–1406. [51] Yuichi Yoshida. 2016. Testing list 𝐻 -homomorphisms. Computional Complexity 25, 4 (2016), 737–773. [52] Dmitriy Zhuk. 2017. A Proof of CSP Dichotomy Conjecture. In FOCS. 331–342.

A

PROOF OF THEOREM 4.4

Proof. Let A = (𝐴, {𝑅 A }𝑅 ∈𝜎 ) be a core. We show how to construct a symbol-distinct structure A′ such that testing A′ reduces to testing A. Define 𝜎 ′ as the vocabulary {𝑅t | 𝑅 ∈ 𝜎, t ∈ 𝑅 A }, where the arity of 𝑅t is equal to that of 𝑅 ∈ 𝜎. Define A′ to be the ′ structure (𝐴, {𝑅t }𝑅t ∈𝜎 ′ ) where 𝑅tA = {t}. For any structure B′ with domain 𝐵 ′ and vocabulary 𝜎 ′ , we construct a structure B in the following way. The domain of B is 𝐴 × 𝐵 ′ , and for each 𝑅 ∈ 𝜎, we define 𝑅 B = {{((𝑎 1, 𝑏 1 ), . . . , (𝑎𝑟 , 𝑏𝑟 )) | ′ (𝑎 1, . . . , 𝑎𝑟 ) ∈ 𝑅 A, (𝑏 1, . . . , 𝑏𝑟 ) ∈ 𝑅 B(𝑎1,...,𝑎𝑟 ) }}. We have ∥B∥ = ∥B′ ∥; moreover, there is clearly a natural bijection between the tuples of B′ and the tuples of B: namely, map the tuple ′ (𝑏 1, . . . , 𝑏𝑟 ) ∈ 𝑅 B(𝑎1,...,𝑎𝑟 ) to the tuple ((𝑎 1, 𝑏 1 ), . . . , (𝑎𝑟 , 𝑏𝑟 )) ∈ 𝑅B. Let B− be a structure obtained from B by deleting tuples, and let B′− be the corresponding structure obtained from B′ by deleting the corresponding tuples under the bijection just given. We prove that B− is A-free if and only if B′− is A′ -free, yielding properties (i) and (ii) in the definition of reduction. For any homomorphism ℎ from A to B− , the composition 𝜋1 (ℎ) is readily seen to be an endomorphism of A. (Here, 𝜋1

denotes the first projection.) Since each endomorphism of A is a bijection (as A is a core), when ℎ is a homomorphism from A to B− , by composing ℎ with an appropriate power of 𝜋 1 (ℎ), we obtain a homomorphism 𝑔 from A to B− such that 𝜋 1 (𝑔) is the identity mapping. Hence, if there is any homomorphism from A to B− at all, there is a homomorphism 𝑔 such that 𝜋1 (𝑔) is the identity mapping; moreover, when such a homomorphism exists, the image 𝑔(𝐴) of 𝑔 is straightforwardly verified to be the graph of a homomorphism from A′ to B′− . In the other direction, if there is a homomorphism 𝑓 from A′ to B′− , then the mapping 𝑎 ↦→ (𝑎, 𝑓 (𝑎)) is readily verified to be a homomorphism from A to B− . We verify property (iii) in the definition of reduction, as follows. Consider a query (𝑅, (𝑞 1, . . . , 𝑞𝑟 )) for B. • Let (𝑐 1, . . . , 𝑐𝑟 ) ∈ (𝐴 ∪ {∗})𝑟 be the tuple such that 𝑞𝑖 = ∗ implies 𝑐𝑖 = ∗ and 𝑞𝑖 ≠ ∗ implies 𝑐𝑖 = 𝜋1 (𝑞𝑖 ). • Let (𝑑 1, . . . , 𝑑𝑟 ) ∈ (𝐴 ∪ {∗})𝑟 be the tuple such that 𝑞𝑖 = ∗ implies 𝑑𝑖 = ∗ and 𝑞𝑖 ≠ ∗ implies 𝑑𝑖 = 𝜋2 (𝑞𝑖 ). Let t1, . . . , t𝑘 be the tuples in 𝑅 A that are completions of (𝑐 1, . . . , 𝑐𝑟 ). We may use a size query (𝑅t𝑖 , (𝑑 1, . . . , 𝑑𝑟 )) for B′ to determine the number of completions 𝑚𝑖 of (𝑑 1, . . . , 𝑑𝑟 ) ′ in 𝑅tB𝑖 . If the query (𝑅, (𝑞 1, . . . , 𝑞𝑟 )) was a size query, then the answer straightforwardly verified, from the definition of B, to be 𝑚 1 + · · · + 𝑚𝑘 . If the query (𝑅, (𝑞 1, . . . , 𝑞𝑟 )) was a completion query, then it is answered in the following way. If 𝑚 1 +· · ·+𝑚𝑘 = 0, then return ⊥. Otherwise, randomly pick an index 𝑖 ∈ [𝑘], by selecting the index 𝑖 ∈ [𝑘] with probability 𝑚𝑖 /(𝑚 1 + · · · +𝑚𝑘 ); return the answer to a completion query (𝑅t𝑖 , (𝑑 1, . . . , 𝑑𝑟 )) for B′ . Correctness is verified, again, from the definition of B. Property (iv) is clear: |𝐵| = |𝐴| · |𝐵 ′ |. □

B

PROOF OF THEOREM 4.5

Proof. Let 𝜎 ′ be the vocabulary and let A′ be the symboldistinct structure with domain 𝑆 that are constructed as follows. For each 𝑅 ∈ 𝜎, if the unique tuple (𝑎 1, . . . , 𝑎𝑟 ) ∈ 𝑅 A contains at least one entry in 𝑆, then let 𝑖 1 < · · · < 𝑖𝑝 be the indices from [𝑟 ] such that 𝑎𝑖 1 , . . . , 𝑎𝑖𝑝 are the entries among 𝑎 1, . . . , 𝑎𝑟 that are contained in 𝑆; and, include a symbol 𝑅 ′ ′ in 𝜎 ′ whose arity is 𝑝, where 𝑅 ′A = {(𝑎𝑖 1 , . . . , 𝑎𝑖𝑝 )}. Let B′ ′ be any structure with domain 𝐵 over 𝜎 ′ . From B′ , we define a structure B as follows. The domain of B is 𝐵 = 𝐵 ′ ∪ {+}. For each 𝑅 ′ ∈ 𝜎 ′ , let 𝑖 1 < · · · < 𝑖𝑝 be the indices defined above, and define 𝑅 B as the relation that contains, for each ′ tuple (𝑏 1′ , . . . , 𝑏 𝑝′ ) ∈ 𝑅 B , the tuple (𝑏 1, . . . , 𝑏𝑟 ) where 𝑏𝑖 1 = ′ ′ 𝑏 1, . . . , 𝑏𝑖𝑝 = 𝑏 𝑝 , and where all other entries are equal to +. Clearly, there is a natural bijection between tuples in ′ 𝑅 B and 𝑅 B . For each symbol 𝑅 ∈ 𝜎 that does not have a corresponding symbol 𝑅 ′ ∈ 𝜎 ′ , define 𝑅 B as {{(+, . . . , +)}}, where the multiplicity of (+, . . . , +) is ∥B′ ∥; let 𝑍 denote the

number of such symbols 𝑅 ∈ 𝜎, and call each such symbol trivialized. We have ∥B∥ = (𝑍 + 1) ∥B′ ∥. It is straightforward to establish that a mapping 𝑓 : 𝑆 → 𝐵 ′ is a homomorphism from A′ to B′ if and only if the canonical extension 𝑓 ′ : 𝐴 → 𝐵 of 𝑓 that sends each element in 𝐴 \ 𝑆 to + is a homomorphism from A to B. This establishes property (i) in the definition of reduction. Let us establish property (ii) in the definition of reduction. We claim that if B′ is 𝜖 ′ -far from being A′ -free, then B is 𝜖 ′ /(𝑍 + 1)-far from being A-free. Consider the deletion of (𝜖 ′ /(𝑍 + 1)) ∥B∥ = 𝜖 ′ ∥B′ ∥ tuples from B. Since each trivialized symbol 𝑅 contains ∥B′ ∥ copies of (+, . . . , +), in effect, the deletion amounts to the deletion of at most 𝜖 ′ ∥B′ ∥ tuples from the relations 𝑅 B , over non-trivialized symbols 𝑅. Under the bijection given above, this is equivalent to the deletion of at most 𝜖 ′ ∥B′ ∥ tuples from the relations of B′ . Since B′ is assumed to be 𝜖 ′ -far from being A′ -free, this deletion of tuples from B′ results in a structure that admits a homomorphism from A′ . By taking the canonical extension of this homomorphism, we obtain a homomorphism from A to B under the deletions, establishing our claim. Let us establish property (iii) in the definition of reduction. A size query for B can clearly be resolved using size queries to B′ : for each trivialized symbol 𝑅, the size of 𝑅 B is ∥B′ ∥, and for each other symbol 𝑅, the size of 𝑅 B is equal to that of ′ 𝑅 B . A completion query (𝑅, q) for B can be resolved in the following way. If the query concerns a trivialized symbol 𝑅, then the answer is (+, . . . , +) if this tuple is a completion of q, and ⊥ otherwise. Otherwise, an answer can be obtained from a completion query (𝑅, q′ ) for B′ . Property (iv) is clear: |𝐵| = |𝐵 ′ | + 1. □

C

MISSING PROOFS FOR SECTION 4.2

Proof of Lemma 4.10. We shall show that with high probability over the choice of a hypergraph 𝐺 = (𝑉 , E) according to D𝑛,𝑘 , there are at least 𝛾 |E | edge-disjoint simplices in the hypergraph, for some constant 𝛾. Let the vertices in each set 𝑉𝑏 (𝑏 ∈ [𝑘 + 1]) be denoted by 𝑣𝑏,1, . . . , 𝑣𝑏,𝑛¯ . For a tuple b = (𝑏 1, . . . , 𝑏𝑘 ) ∈ [𝑘 + 1] 𝑘 of ¯ 𝑘 , let 𝛼 ib be distinct indices and a tuple i = (𝑖 1, . . . , 𝑖𝑘 ) ∈ [𝑛] an indicator of the event that there is a hyperedge spanning   𝑑¯ 𝑣𝑏 1,𝑖 1 , . . . , 𝑣𝑏𝑘 ,𝑖𝑘 . Then, Pr[𝛼 ib = 1] = 1 − 1 − 𝑛¯𝑘1−1 and so ¯

Pr[𝛼 ib = 1] ≤ 𝑛¯𝑘𝑑−1 , and  ¯   𝑑¯ 𝑑 1 𝑑¯ 1 b ≥ Pr[𝛼 i = 1] ≥ 𝑘 −1 − 1− 2 𝑛¯2(𝑘 −1) 𝑛¯𝑘 −1 𝑛¯ 2(𝑘 + 1)𝑛¯1/𝑘 ¯ 𝑘+1 . Next, consider any choice of i = (𝑖 1, . . . , 𝑖𝑘+1 ) ∈ [𝑛] Let 𝑋 i denote the indicator of the event that there is a simplex spanning the vertices 𝑣 1,𝑖 1 , . . . , 𝑣𝑘+1,𝑖𝑘+1 . Since the choices of the 𝑘-dimensional matchings on 𝑉𝑏 1 , . . . , 𝑉𝑏𝑘 for 𝑘-sized

subsets {𝑏 1, . . . , 𝑏𝑘 } of [𝑘 + 1] are mutually independent,   ¯ 𝑘+1 Pr[𝑋 i = 1] ≤ 𝑛¯𝑘𝑑−1 holds, and Pr[𝑋 i = 1] ≥

 ¯  𝑘+1   𝑘+1 1 𝑑 1 − . 𝑛¯𝑘 −1 2(𝑘 + 1)𝑛¯1/𝑘

Let 𝛽 i denote the indicator of the event that there is a simplex different from 𝑣 1,𝑖 1 , . . . , 𝑣𝑘+1,𝑖𝑘+1 that includes one of the hyperedges. Since the probability of having a hyperedge (𝑣𝑏 1,𝑖 1′ , . . . , 𝑣𝑏𝑘 ,𝑖𝑘′ ) conditioned on having the hyperedge (𝑣𝑏 1,𝑖 1 , . . . , 𝑣𝑏𝑘 ,𝑖𝑘 ) for any choice of |{𝑖 1′ , . . . , 𝑖𝑘′ } ∩ {𝑖 1, . . . , 𝑖𝑘 }| ≥ 1 is at most 1 − (1 − 𝑛¯𝑘1−1 )

𝑑¯−1

¯

≤ 𝑛𝑑¯𝑘−1 −1 ,

Pr[𝑋 i = 1 ∧ 𝛽 i = 1] = Pr[𝑋 i = 1] · Pr[𝛽 i = 1 | 𝑋 i = 1]  ¯  𝑘+1 ¯ 𝑘 𝑑 𝑑 −1 ≤ 𝑘 −1 · (𝑘 + 1) · (𝑛¯ − 1) · 𝑘 −1 𝑛¯ 𝑛¯  ¯  𝑘+1 𝑘 𝑑 (𝑘 + 1) (𝑑¯ − 1) ≤ 𝑘 −1 𝑛¯ 𝑛¯𝑘 2 −𝑘 −1 Let 𝜂 i be the indicator of the event that there is a simplex spanning the vertices 𝑣 1,𝑖 1 , . . . , 𝑣𝑘+1,𝑖𝑘+1 and there is no other simplex that shares any of its hyperedges. Then, we have Pr[𝜂 i = 1] = Pr[𝑋 i = 1 ∧ 𝛽 i = 0] = Pr[𝑋 i = 1] − Pr[𝑋 i = 1 ∧ 𝛽 i = 0] !  𝑘+1  ¯  𝑘+1  𝑘 (𝑘 + 1) (𝑑¯ − 1) 1 𝑑 − · 1− ≥ 𝑘 −1 𝑛¯ 2(𝑘 + 1)𝑛¯1/𝑘 𝑛¯𝑘 2 −𝑘 −1   𝑘+1 1 𝑑¯ . ≥ 2 𝑛¯𝑘 −1 under our assumption that 𝑛¯ is sufficiently large. Hence, the expected number of tuples (𝑣 1,𝑖 1 , . . . , 𝑣𝑘+1,𝑖𝑘+1 ) that constitute a simplex that does not share a hyperedge with any other simplex is  ¯  𝑘+1 ∑︁ 𝑑 𝑑¯𝑛¯ 𝑑𝑛 𝑘+1 1 𝜂 i ≥ 𝑛¯ · = = . 𝑘 −1 𝑘 2 ¯ 𝑛 2(𝑘 + 1) 2𝑘 (𝑘 + 1)𝑘+1 i Í Note that we have i 𝜂 i ≤ 𝑑𝑛/𝑘 (𝑘 + 1) as we only have 𝑑𝑛/𝑘 hyperedges and each simplex uses 𝑘 + 1 hyperedges. Í 1 Let 𝛼 = 𝑘+1 and 𝑝 = Pr[ i 𝜂 i ≤ 𝛼𝑑𝑛]. Then, we have 4𝑘 (𝑘+1) " # ∑︁ 𝑑𝑛 𝑑𝑛 ≤E 𝜂 i ≤ 𝑝𝛼𝑑𝑛 + (1 − 𝑝) 𝑘+1 𝑘 (𝑘 + 1) 2𝑘 (𝑘 + 1) i 𝑑𝑛 The last quantity is bounded above by 𝛼𝑑𝑛 + (1 − 𝑝) 𝑘 (𝑘+1) , 1 implying 𝑝 ≤ 1 − □ 𝑘. 4(𝑘+1)

We will also use the following, which states that, for every set of 𝑘 − 1 vertices belonging to different blocks, the number of hyperedges containing them is high. Lemma C.1. For any fixed 𝑘, a hypergraph sampled uniformly from D𝑛,𝑘 satisfies the following with probability 1 − 𝑂 (1/𝑛 2𝑘 ): For any set 𝑆 of 𝑘 − 1 vertices belonging to different blocks and block 𝑉𝑏 not containing any vertex in 𝑆, the number 𝑚𝑆,𝑏 of hyperedges of the form 𝑆 ∪ {𝑣 } for 𝑣 ∈ 𝑉𝑏 is Ω(𝑛 1−1/𝑘 ). Proof. Let 𝑆 = {𝑣 1, . . . , 𝑣𝑘 −1 } and let 𝑉𝑏 1 , . . . , 𝑉𝑏𝑘 −1 be blocks to which 𝑣 1, . . . , 𝑣𝑘 −1 belong, respectively. For each ¯ the probability that the 𝑖-th 𝑘-dimensional matching 𝑖 ∈ [𝑑], spanning 𝑉𝑏 and 𝑉𝑏 1 , . . . , 𝑉𝑏𝑘 −1 has a hyperedge containing 𝑆 is 𝑝 := 1/𝑛¯𝑘 −2 . Hence, 𝜇 := E [𝑚𝑆,𝑏 ] = 𝑝𝑑¯ = 𝑛¯1−1/𝑘/(𝑘 + 1). 𝜇 𝜇 By Chernoff’s inequality, Pr 𝑚𝑆,𝑏 < 2 ≤ exp − 8 ≤ 10𝑛1 2𝑘 . Here in the last inequality, we use the fact that 𝑛 is sufficiently large. By union bound over the choice of 𝑆 and 𝑏, we have 𝑚𝑆,𝑏 ≥ 𝑛¯1−1/𝑘 /(2𝑘 + 2) for every 𝑆 and 𝑏 with probability at least 1 − 𝑂 (1/𝑛 2𝑘 ). □ Proof of Lemma 4.11. It will be convenient to view hypergraphs in the support of D𝑛,𝑘 as being represented by 𝑘-dimensional matchings over tables. Namely, there is a table 𝑇𝑏,𝐵 for each 𝑏 ∈ [𝑘 + 1] and a set 𝐵 ∋ 𝑏 of size 𝑘. Each table 𝑇𝑏,𝐵 is of size 𝑛¯ × 𝑑¯ (recall that 𝑛¯ = 𝑛/(𝑘 + 1) and 𝑑¯ = 𝑑/𝑘): there is a row for each vertex 𝑣 in 𝑉𝑏 , and each entry in 𝑣’s row corresponds to one of the 𝑑¯ hyperedges that are incident to 𝑣 and to vertices in 𝑉𝑏 ′ with 𝑏 ′ ∈ 𝐵. For 𝐵 = {𝑏 1, . . . , 𝑏𝑘 }, a hyperedge between 𝑣 1 ∈ 𝑉𝑏 1 , . . . , 𝑣𝑘 ∈ 𝑉𝑏𝑘 is represented by 𝑇𝑏 1,𝐵 [𝑣 1, 𝑖 1 ], . . . ,𝑇𝑏𝑘 ,𝐵 [𝑣𝑘 , 𝑖𝑘 ] for some ¯ Hence, the 𝑑¯ perfect 𝑘-dimensional match𝑖 1, . . . , 𝑖𝑘 ∈ [𝑑]. ings among 𝑉𝑏 1 , . . . , 𝑉𝑏𝑘 correspond to a single perfect 𝑘dimensional matching among the entries of the tables 𝑇𝑏 1,𝐵 , 𝑇𝑏 2,𝐵 , . . . ,𝑇𝑏𝑘 ,𝐵 , where 𝐵 = {𝑏 1, . . . , 𝑏𝑘 }. Let A be a deterministic algorithm that performs 𝑞(𝑛) = 𝑜 (𝑛 1/𝑘 ) queries and whose goal is to detect a simplex with probability at least 𝛿 4.10 (𝑘). The probability is taken over the choice of the hypergraph 𝐺 in the support of D𝑛,𝑘 and internal randomness. Namely A is a (possibly probabilistic) mapping from query-answer histories ⟨(𝑞 1, 𝑎 1 ), . . . , (𝑞𝑡 , 𝑎𝑡 )⟩, to 𝑞𝑡 +1 for every 𝑡 < 𝑞(𝑛). We note that the mapping from query-answer histories to queries needs to be defined only on histories that are consistent with some hypergraph in the support of D𝑛,𝑘 . In what follows we define a process that answers the queries of the algorithm while generating a hypergraph according to D𝑛,𝑘 . At any time 𝑡, the queries of the algorithm and the answers to them determine the knowledge hypergraph 𝐺 𝑡 = (𝑉 𝑡 , E 𝑡 , Ē 𝑡 , 𝐷), where 𝑉 𝑡 are the vertices, E 𝑡 are the hyperedges, Ē 𝑡 are the non-hyperedges, and

𝐷 are degree informations. Namely, 𝑉 𝑡 consists of all vertices that appeared in queries of the algorithm or in answers to them. Similarly E 𝑡 consists of all hyperedges that were returned for completion queries, and Ē 𝑡 consists of all sets that are found to be non-existent, that is, completions of completion queries whose answers were ⊥ or completions of size queries whose answers were 0. Finally, 𝐷 contains the information on the number of completions of sets of size at most 𝑘 that were returned by size queries. For every hyperedge 𝑆 = {𝑣 1, . . . , 𝑣𝑘 } ∈ E 𝑡 , the knowledge hypergraph will include the indices of the entries in the tables by which 𝑣𝑖 ’s are connected (that is, (𝑖 1, . . . , 𝑖𝑘 ) such that 𝑇𝑏𝑘 ,𝐵 [𝑣𝑖 , 𝑖 1 ], . . . ,𝑇𝑏𝑘 ,𝐵 [𝑣𝑘 , 𝑖𝑘 ] are matched, where 𝐵 = {𝑏 1, . . . , 𝑏𝑘 } is a set with 𝑣𝑖 ∈ 𝑉𝑏𝑖 for each 𝑖 ∈ [𝑘]). We note that we cannot detect a simplex using size queries (as long as 𝑞(𝑛) = 𝑜 (𝑛)). Hence, we upper bound the probability that we close a simplex using completion queries. Completion queries of size 𝑘: Let 𝐵 = {𝑏 1, . . . , 𝑏𝑘 }; suppose a completion query 𝑄 = {𝑣 1, . . . , 𝑣𝑘 } with 𝑣𝑖 ∈ 𝑉𝑏 1 for each 𝑖 ∈ [𝑘] is given. Then, the process computes the probability, conditioned on the current knowledge hypergraph, that 𝑄 is a hyperedge. Namely, it considers all hypergraphs in the support of D𝑛,𝑘 that are consistent with 𝐺 𝑡 and answers positively, that is, 𝑄, with probability that is proportional to the number of these hypergraphs that have the hyperedge 𝑄. Let 𝑈𝑡,𝑏𝑖 ,𝐵 denote the number of unmatched entries in 𝑇𝑏𝑖 ,𝐵 at time 𝑡 (before the (𝑡 + 1)-th query). Note that this number equals the number of unmatched entries in 𝑇𝑏 𝑗 ,𝐵 for every 𝑗 ∈ [𝑘] \ {𝑖} at the same time. The probability that there is a hyperedge 𝑄 is bounded above by: 𝑑¯ · 𝑑¯𝑘 −1 (2) Î𝑘



𝑡 ¯ 𝑖=2 𝑈𝑡,𝑏𝑖 ,𝐵 − | Ē |𝑑

To verify this consider an iterative process in which the (at ¯ unmatched entries in 𝑣 1 ’s row in 𝑇𝑏 ,𝐵 are matched most 𝑑) 1 one by one to unmatched entries in 𝑇𝑏𝑖 ,𝐵 ’s for 𝑖 ∈ {2, . . . , 𝑘 }. ¯ After 𝜏 steps, the probability of selecting any of the (at most 𝑑) unmatched entries in 𝑣𝑖 ’s row in 𝑇𝑏𝑖 ,𝐵 for every 𝑖 ∈ {2, . . . , 𝑘 } is the number of combinations of unmatched entries in 𝑣𝑖 ’s Î ¯ row in𝑇𝑏𝑖 ,𝐵 for 𝑖 ∈ {2, . . . , 𝑘 }, divided by 𝑘𝑖=2 (𝑈𝑡,𝑏𝑖 ,𝐵 −| Ē 𝑡 |𝑑). Here, the term | Ē 𝑡 |𝑑¯ is the maximum number of unmatched entries that cannot be matched to entries in 𝑣 1 ’s row because they correspond to a hyperedge in Ē 𝑡 containing 𝑣 1 . Note that 𝑈𝑡,𝑏𝑖 ,𝐵 ≥ 𝑑¯𝑛¯ − 𝑡 for every 𝑖 ∈ {2, . . . , 𝑘 }. We also have | Ē 𝑡 | ≤ 𝑡 with probability at least 1 − 𝑜 (1) (over the choice of the hypergraph), as we get non-hyperedge only when the query is a set of size 𝑘 from Lemma C.1. Recalling ¯ 𝑛¯𝑘 −1 ) = 𝑂 (𝑛 −1/𝑘 ). It that 𝑡 = 𝑜 (𝑛), the probability (2) is 𝑂 (𝑑/ follows that the probability that the algorithm gets a positive answer, that is, 𝑄, for any of the at most 𝑜 (𝑛 1/𝑘 ) queries of

size 𝑘 is 𝑜 (1). But if the algorithm always gets ⊥ or 0 for its completion queries of size 𝑘, it clearly cannot close a simplex with such a query. Completion queries of size at most 𝑘 − 1: Suppose that, for 𝐵 = {𝑏 1, . . . , 𝑏 ℓ } with ℓ ≤ 𝑘 − 1, a completion query 𝑄 = {𝑣 1, . . . , 𝑣 ℓ } with 𝑣𝑖 ∈ 𝑉𝑏𝑖 for each 𝑖 ∈ [ℓ] is given. By Lemma C.1, with probability at least 1 − 𝑜 (1) (over the choice of the hypergraph), the process answers a completion 𝑆 = (𝑣 1, . . . , 𝑣𝑘 ) of 𝑄 according to the conditional probability that the entries 𝑇𝑏 1,𝐵 [𝑣 1, 𝑖 1 ], . . . ,𝑇𝑏𝑘 ,𝐵 [𝑣𝑘 , 𝑖𝑘 ] are matched (where again, the conditioning is on the current knowledge hypergraph 𝐺 𝑡 ). Here, we would like to upper bound the probability that any of the completed vertices, that is, vertices in 𝑆 \ 𝑄, already belongs to the knowledge hypergraph. Observe that the knowledge hypergraph 𝐺 𝑡 contains at most 𝑘𝑡 vertices and at most 𝑡 hyperedges and non-hyperedges. Suppose 𝑄 = ∅. Then, the probability that we hit a vertex in the knowledge hypergraph is upper bounded by  𝑘 𝑘 Ö 𝑘𝑡 𝑘𝑡 ≤ = 𝑜 (1) 𝑡 ¯ 𝑛¯ − 𝑘 (𝑡 + 1) − | Ē 𝑡 | 𝑖=1 𝑛 − (𝑘𝑡 + 𝑖 − 1) − | Ē | as 𝑡 = 𝑜 (𝑛). Suppose 𝑄 ≠ ∅. Without loss of generality, we assume 𝑞 1 ∈ 𝑉𝑏 1 is a vertex and 𝑞 2 = ∗. Then, the conditional probability that 𝑇𝑏 1,𝐵 [𝑣 1, 𝑖 1 ] is matched to 𝑇𝑏 2,𝐵 [𝑣 2, 𝑖 2 ] for some ¯ at time 𝑡 is upper bounded by 𝑣 2 ∈ 𝑉 𝑡 −1 ∩ 𝑉𝑏 2 and 𝑖 2 ∈ [𝑑]  1/𝑘  ¯ ¯ 𝑑𝑡 𝑑𝑡 𝑑𝑛 ≤ =𝑜 = 𝑜 (𝑛 −1+1/𝑘 ). 𝑡 ¯ ¯ ¯ ¯ 𝑑𝑛 𝑑 𝑛¯ − 𝑡 − | Ē |𝑑 𝑑 𝑛¯ − 𝑡 − 𝑡 𝑑 as 𝑡 = 𝑜 (𝑛 1/𝑘 ). To summarize, the probability that we hit a vertex in the knowledge hypergraph for any of the at most 𝑜 (𝑛 1/𝑘 ) completion queries of size at msot 𝑘 − 1 is 𝑜 (1). But if the algorithm always gets a new vertex for its completion queries of size at most 𝑘 − 1, it clearly cannot close a simplex with such a query. □

Related documents

Record · ID 1767934 · SHA-256 5377229c048098c5
Retrieved via Conceptio: every document is proof-bundled with source, license, and retrieval metadata.
Bring this data into your agent: Connect via MCP or API · 20 free credits to start · no card required
Read the Docs → · View CLI source on GitHub · Conceptio Open Knowledge Archive