Preprint
Article

This version is not peer-reviewed.

Algorithms for Preopen Sets, Preclosure, and Candidate p-Bounded Witnesses in Finite Digital Windows

Submitted:

09 October 2026

Posted:

12 October 2026

You are already at the latest version

Abstract
We develop an exact computational framework for studying preopen sets, preclosure, and candidate p-bounded witnesses in finite digital windows. The framework combines finite-topology operations, exhaustive subset enumeration, witness filtering, and comparisons between digital topologies. We prove the correctness of the principal algorithms, describe their computational complexity, and give a worked example. We also explain the distinction between a witness found in a finite window and a counterexample in an infinite digital space. Since the term p-bounded witness can depend on the particular problem under investigation, the witness predicate is treated as an explicit input to the algorithm rather than being assigned an unjustified universal meaning.
Keywords: 
;  ;  ;  ;  ;  ;  ;  

1. Introduction

Finite digital windows provide a natural setting in which to test conjectures in digital topology. Their finiteness makes it possible to enumerate all subsets, compute their topological properties, and search systematically for configurations that satisfy specified hypotheses but violate a proposed conclusion.
The purpose of this section is to develop algorithms for three tasks:
(i)
computing all preopen subsets of a finite digital space;
(ii)
computing the preclosure of any given subset;
(iii)
searching for candidate p-bounded witnesses to a specified property or proposed counterexample.
These computations can support the comparison of different digital topologies and the discovery of explicit finite counterexamples. The general framework of digital topology is discussed in [1,2].
The basic topological computations are independent of the particular digital adjacency convention. Once a finite topology has been constructed, the algorithms apply to it directly. The interpretation of the final witness, however, depends on the exact mathematical definition of p-boundedness used in the problem.

2. Finite Digital Windows

Definition 2.1
(Finite digital window). A finite digital window is a finite set X equipped with a specified topology τ. In a lattice model, one may take
X = [ − m , m ] d ∩ Z d
for positive integers m and d, together with a specified adjacency relation and a rule for constructing the topology.
Remark 2.2.
An adjacency relation alone does not uniquely determine a topology unless a construction rule is specified. In particular, the topology obtained by treating a window as a standalone digital space can differ from the subspace topology inherited from a larger digital space. Every computational experiment must state which convention is being used.
For a finite topological space ( X , τ ) , the interior and closure of A ⊆ X are
Int ( A ) = ⋃ { U ∈ τ : U ⊆ A }
and
Cl ( A ) = X ∖ Int ( X ∖ A ) .
The family of open sets can be stored explicitly. Alternatively, when the topology has a suitable finite-neighborhood representation, interior and closure can be computed from the neighborhood data.
Definition 2.3
(Preopen set). A subset A ⊆ X is called preopen if
A ⊆ Int ( Cl ( A ) ) .
The family of all preopen subsets of X is denoted by PO ( X , τ ) .
Definition 2.4
(Preclosed set). A subset F ⊆ X is preclosed if X ∖ F is preopen. Equivalently,
Cl ( Int ( F ) ) ⊆ F .
The family of all preclosed sets is denoted by PC ( X , τ ) .
Definition 2.5
(Preclosure). The preclosure of A ⊆ X is
pCl ( A ) = ⋂ { F ∈ PC ( X , τ ) : A ⊆ F } .

3. A Formula for Computing Preclosure

Theorem 3.1
(Preclosure formula). For every topological space ( X , τ ) and every A ⊆ X ,
pCl ( A ) = A ∪ Cl ( Int ( A ) ) .
Proof. 
Set
B = A ∪ Cl ( Int ( A ) ) .
Since Int ( A ) ⊆ A ⊆ B , monotonicity of interior and closure gives
Int ( A ) ⊆ Int ( B ) and Cl ( Int ( A ) ) ⊆ Cl ( Int ( B ) ) .
We show that
Int ( B ) ⊆ Cl ( Int ( A ) ) .
Let U be any open subset of B. The set
U ∖ Cl ( Int ( A ) )
is open because U is open and Cl ( Int ( A ) ) is closed. Moreover, it is contained in A, since
B = A ∪ Cl ( Int ( A ) ) .
Consequently,
U ∖ Cl ( Int ( A ) ) ⊆ Int ( A ) ⊆ Cl ( Int ( A ) ) .
But this set is disjoint from Cl ( Int ( A ) ) . Therefore it is empty, and hence
U ⊆ Cl ( Int ( A ) ) .
Taking the union over all open subsets U of B yields
Int ( B ) ⊆ Cl ( Int ( A ) ) .
It follows that
Cl ( Int ( B ) ) ⊆ Cl ( Cl ( Int ( A ) ) ) = Cl ( Int ( A ) ) ⊆ B .
Thus B is preclosed and contains A.
Now let F be any preclosed set with A ⊆ F . Then
Int ( A ) ⊆ Int ( F ) ,
so
Cl ( Int ( A ) ) ⊆ Cl ( Int ( F ) ) ⊆ F .
Since A ⊆ F , we obtain
B = A ∪ Cl ( Int ( A ) ) ⊆ F .
Therefore B is contained in every preclosed superset of A, and B is itself such a superset. It follows that
pCl ( A ) = B = A ∪ Cl ( Int ( A ) ) .
   □
Remark 3.2.
Preclosure should not be confused with ordinary closure. In general,
pCl ( A ) ≠ Cl ( A ) .
The theorem provides a direct method for computing preclosure without enumerating all preclosed supersets.

4. Algorithm for Computing Preopen Sets

4.1. Exhaustive Algorithm

Let n = | X | . There are exactly 2 n subsets of X, so exhaustive enumeration is finite.
Proposition 4.1
(Correctness of Algorithm 1). Algorithm 1 returns exactly the family PO ( X , τ ) .
Preprints 237565 i001
Proof. 
Every subset A ⊆ X is examined. The algorithm records A if and only if
A ⊆ Int ( Cl ( A ) ) .
This condition is precisely the definition of preopenness. Therefore every preopen set is recorded, and no non-preopen set is recorded.    □

4.2. Implementation Using Bit Masks

When X = { x 1 , … , x n } , represent each subset by an n-bit integer. The i-th bit is 1 exactly when x i belongs to the subset. Inclusion, union, intersection, and complement can then be computed by bitwise operations.
For small and moderate n, it is useful to precompute
A ⟼ Int ( A ) , A ⟼ Cl ( A )
for every subset A ⊆ X . This avoids repeated computations when the same subsets are used in multiple tests.
If the topology is given as a list of open sets, the interior can be computed by
Int ( A ) = ⋃ U ∈ τ U ⊆ A U .
Closure then follows from
Cl ( A ) = X ∖ Int ( X ∖ A ) .

5. Algorithm for Computing Preclosure

Proposition 5.1
(Correctness of Algorithm 2). Algorithm 2 computes the preclosure of every subset A ⊆ X .
Preprints 237565 i002
Proof. 
The algorithm returns
A ∪ Cl ( Int ( A ) ) .
By the preclosure formula proved in the preceding section, this set is exactly pCl ( A ) .    □

5.1. Independent Verification

For small finite spaces, one can verify the formula by a second, independent method:
1.
enumerate all subsets F of X;
2.
retain those satisfying Cl ( Int ( F ) ) ⊆ F ;
3.
among those containing A, intersect all retained sets;
4.
compare the result with A ∪ Cl ( Int ( A ) ) .
Agreement between the two methods is a useful correctness test for a software implementation.

6. Developing Algorithms for Candidate p-Bounded Witnesses

6.1. Formalizing the Witness Condition

The term “p-bounded witness” must be defined in the context of the particular theorem under investigation. It may refer to a subset, a family of subsets, a sequence, or a configuration satisfying additional conditions.
Accordingly, we separate the general search procedure from the problem-specific predicate.
Definition 6.1
(Witness predicate). Let ( X , τ ) be a finite topological space and let D denote auxiliary data required by a problem. A witness predicate is a specified Boolean-valued function
W p ( X , τ , A , D ) ∈ { true , false } .
Its meaning must be determined by the precise definition of p-boundedness and the proposed assertion being tested.
Definition 6.2
(Candidate p-bounded witness). A subset A ⊆ X is a candidate p-bounded witness if it satisfies a specified structural filter
F ( X , τ , A )
and the witness predicate
W p ( X , τ , A , D ) .
Thus a candidate is retained exactly when
F ( X , τ , A ) ∧ W p ( X , τ , A , D )
is true.
The structural filter may require, for example,
A ≠ ⌀ , A ≠ X ,
or that A be preopen, preclosed, or satisfy a relation involving pCl ( A ) . Such restrictions must come from the mathematical problem rather than being imposed without justification.

6.2. Generic Witness-Search Algorithm

Proposition 6.3
(Soundness relative to the specification). Every set returned by Algorithm 3 satisfies the structural filter and the witness predicate supplied as input.
Preprints 237565 i003
Proof. 
A set is recorded only after the algorithm has verified both
F ( X , τ , A ) = true
and
W p ( X , τ , A , D ) = true .
Hence every returned set satisfies both conditions. This establishes soundness relative to the supplied specification. The mathematical correctness of the implementation of W p must be verified separately. □

6.3. Searching for Counterexamples

Suppose a proposed assertion has the logical form
H ( A ) ⟹ K ( A ) ,
where H denotes the hypotheses and K the conclusion. A counterexample must satisfy
H ( A ) ∧ ¬ K ( A ) .
Thus, the correct search predicate is
W p ( A ) : = H ( A ) ∧ ¬ K ( A ) ,
possibly together with other conditions imposed by the definition of the problem.
Remark 6.4.
For a claim involving sequences, covers, or families of sets, a witness may not be representable by a single subset A. The search space must then consist of the appropriate finite tuples, families, or encoded sequences. The same filtering principle applies.

7. Illustrative Finite Example

Consider the topological space
X = { a , b , c } , τ = { ⌀ , { a } , { a , b } , X } .
We calculate the preopen sets and the preclosure of a particular subset.
Let
A = { b } .
The only open set contained in A is ⌀. Therefore,
Int ( A ) = ⌀ .
It follows that
pCl ( A ) = A ∪ Cl ( Int ( A ) ) = { b } ∪ Cl ( ⌀ ) = { b } .
To compute ordinary closure, recall that a point belongs to Cl ( A ) if every open neighborhood of that point meets A. The point a has the neighborhood { a } disjoint from A. The only open neighborhood of c is X, which meets A. Consequently,
Cl ( { b } ) = { b , c } .
No nonempty open set is contained in { b , c } , so
Int ( Cl ( A ) ) = Int ( { b , c } ) = ⌀ .
Therefore,
{ b } ∉ PO ( X , τ ) .
This example demonstrates that ordinary closure and preclosure need not agree:
Cl ( { b } ) = { b , c } , pCl ( { b } ) = { b } .
For this three-point space, the algorithms can enumerate all eight subsets and classify each one exactly.

8. Comparing Different Digital Topologies

Let τ 1 and τ 2 be two topologies on the same finite set X. Compute
PO ( X , τ 1 ) , PO ( X , τ 2 )
and compare the resulting families.
Useful comparison quantities include
N i = | PO ( X , τ i ) | , i ∈ { 1 , 2 } ,
and the symmetric difference
PO ( X , τ 1 ) ▵ PO ( X , τ 2 ) .
The latter identifies subsets that are preopen in one topology but not the other.
For every A ⊆ X , one may also compare
pCl τ 1 ( A ) and pCl τ 2 ( A ) .
This identifies subsets whose preclosures depend on the chosen topology.
A computational comparison should record:
1.
the point set and the adjacency convention;
2.
the construction of each topology;
3.
the number of preopen sets;
4.
the subsets whose preopen status changes;
5.
the subsets whose preclosures differ;
6.
the candidate witnesses found under each topology.
If the two digital spaces have different underlying sets, a comparison requires an explicitly specified identification or map between their point sets.

9. Complexity Analysis

Write n = | X | and let T top ( n ) be the cost of computing the interior or closure of a subset.
The exhaustive preopen-set algorithm has time complexity
O 2 n T top ( n ) ,
up to the cost of testing set inclusion. The preclosure algorithm for one subset requires two topological operations and a union, so its complexity is
O T top ( n ) + n
under a standard explicit-set representation.
If the witness predicate has cost T W ( n ) , a direct exhaustive search has complexity
O 2 n T top ( n ) + T W ( n ) .
The exact bound depends on how the topology and witness data are represented.
Several optimizations are possible:
1.
Bit masks: accelerate subset operations.
2.
Caching: store interiors, closures, and preclosures for repeated use.
3.
Symmetry reduction: search one representative from each orbit under a verified group of topology-preserving automorphisms, provided the witness predicate is invariant under that group.
4.
Early filtering: apply inexpensive necessary conditions before evaluating an expensive witness predicate.
5.
Counterexample minimization: attempt to remove points or reduce the window while preserving the witness condition.
A pruning rule is valid only when its necessary-condition or monotonicity argument has been established. In particular, preopenness should not be assumed to be monotone under arbitrary inclusion.

10. From Finite Windows to Infinite Digital Spaces

Suppose an infinite digital space is approximated by finite windows
X 1 ⊆ X 2 ⊆ X 3 ⊆ ⋯ .
A subset that is preopen in one finite window need not remain preopen in another. Both interior and closure depend on the topology in which they are computed.
Three logically different conclusions must be distinguished:
1.
a counterexample exists in a particular finite window;
2.
a witness persists under specified inclusions of windows;
3.
the corresponding assertion fails in the infinite digital space.
The first conclusion follows from exhaustive search on the specified finite space. The second requires a persistence argument, and the third requires an infinite-space proof or a theorem connecting the finite models to the ambient space.
In particular, computations using standalone window topologies cannot automatically be interpreted as computations in the subspace topology inherited from an infinite digital space.
Proposition 10.1
(Scope of a finite exhaustive search). Let ( X , τ ) be a specified finite topological space, and suppose an algorithm examines every subset of X and correctly evaluates the relevant witness predicate. If the algorithm returns no witness, then no witness satisfying that predicate exists in ( X , τ ) .
Proof. 
Every subset of X is examined. If a witness existed, the correct predicate evaluation would retain it. Since no witness is returned, none exists in the enumerated search space. □
This conclusion is restricted to the specified finite space and predicate. It does not imply that a witness is absent from every larger window or from the infinite space.

11. Validation and Reproducibility

A computational study should provide enough information for another researcher to reproduce its results.
For each experiment, record:
1.
the finite point set;
2.
the adjacency and topology conventions;
3.
the representation of open sets or minimal neighborhoods;
4.
the definitions used for preopen and preclosed sets;
5.
the implementation of interior, closure, and preclosure;
6.
the exact witness predicate and all auxiliary data;
7.
any symmetry reductions or pruning rules;
8.
the complete encoding of each reported witness;
9.
an independent verification of each claimed counterexample.
For small windows, useful consistency checks include
Int ( A ) = X ∖ Cl ( X ∖ A ) ,
A ⊆ Cl ( A ) , Int ( A ) ⊆ A ,
and
pCl ( A ) = A ∪ Cl ( Int ( A ) ) .
One should also verify the topology axioms for any topology generated by a digital adjacency rule.
A picture of a digital configuration can be helpful, but it should be accompanied by the precise point set, topology, witness predicate, and diagnostic computations.

12. Conclusion

The algorithms developed here provide a systematic framework for computing preopen sets, preclosure, and candidate p-bounded witnesses in finite digital windows.
The main computational advantages are:
1.
exhaustive and exact classification of preopen subsets;
2.
direct computation of preclosure using pCl ( A ) = A ∪ Cl ( Int ( A ) ) ;
3.
systematic searches for counterexamples under an explicit witness predicate;
4.
reproducible comparisons between different digital topologies;
5.
diagnostic data for investigating whether finite witnesses persist under enlargement of the window.
The essential methodological principle is to separate exact finite-topology calculations from the problem-specific definition of a p-bounded witness. With that separation, computational experiments can provide reliable evidence, expose candidate counterexamples, and guide the development of proofs without mistaking finite verification for a theorem about an infinite digital space.

References

  1. Khalimsky, E.; Kopperman, R.; Meyer, P. R. Computer graphics and connected topologies on finite ordered sets. Topol. Its Appl. 1990, 36, 1–17. [Google Scholar] [CrossRef]
  2. Kong, T. Y.; Roscoe, A. W.; Rosenfeld, A. Concepts of digital topology. Topol. Its Appl. 1992, 46, 219–262. [Google Scholar] [CrossRef]
  3. Mashhour, A. S.; Abd El-Monsef, M. E.; El-Deeb, S. N. On precontinuous and weak precontinuous mappings. Proc. Math. Phys. Soc. Egypt 1982, 53, 47–53. [Google Scholar]
  4. Kuratowski, K. Topology, Vol. I; Academic Press: New York, 1966. [Google Scholar]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.