#  pyspeckit: A spectroscopic analysis and plotting package

Adam Ginsburg Department of Astronomy, University of Florida, P.O. Box 112055,
Gainesville, FL, USA  Vlas Sokolov Max-Planck-Institut für extraterrestrische
Physik, Giessenbachstrasse 1, D-85748 Garching, Germany  Miguel de Val-Borro
Planetary Science Institute, 1700 E. Fort Lowell, Suite 106, Tucson, AZ 85719,
USA  Erik Rosolowsky Department of Physics, 4-181 CCIS, University of Alberta,
Edmonton, AB T6G 2E1, Canada  Jaime E. Pineda Max-Planck-Institut für
extraterrestrische Physik, Giessenbachstrasse 1, D-85748 Garching, Germany
Brigitta M. Sipőcz IPAC, MC 100-22, Caltech, 1200E. California Blvd. Pasadena,
CA 91125  Jonathan D. Henshaw Max-Planck-Institut für Astronomie, Königstuhl
17, 69117, Heidelberg, Germany

###### Abstract

pyspeckit is a toolkit and library for spectroscopic analysis in Python. We
describe the pyspeckit package and highlight some of its capabilities, such as
interactively fitting a model to data, akin to the historically widely-used
splot function in IRAF. pyspeckit employs the Levenberg-Marquardt optimization
method via the mpfit and lmfit implementations, and important assumptions
regarding error estimation are described here. Wrappers to use pymc and emcee
as optimizers are provided. A parallelized wrapper to fit lines in spectral
cubes is included. As part of the astropy affiliated package ecosystem,
pyspeckit is open source and open development and welcomes input and
collaboration from the community.

##  1 Introduction and Background

Spectroscopy is an important tool for astronomy. Spectra are represented as
the number of photons, or total energy in photons, arriving over a specified
wavelength (or equivalently, frequency or energy) range. Emission and
absorption lines caused by transitions between states in ions, atoms, and
molecules bear important information in their observed intensity, width, and
velocity centroid. These parameters are typically measured from model fits to
the data, such as Gaussian, Lorentzian, and Voigt profiles. Historically, IRAF
(Tody, 1986) provided the astronomy community with easy-to-use tools for line
fitting, but IRAF development has mostly ceased in the last several years. The
lack of an equivalent available tool in Python prompted the creation of
pyspeckit.

pyspeckit development began in 2009 with a script called ‘showspec’ in the
agpy package hosted on Google Code. It was created and used by a graduate
student to plot and sometimes fit profiles to spectra in python. At the time,
IDL was still more popular than python at most institutes (the first evidence
that python had overtaken IDL in popularity among astronomers was presented in
Momcheva & Tollerud, 2015), and there were no publicly available and
advertised tools for spectral plotting, fitting, and general manipulation
(astropysics, Tollerud 2012, was developed contemporaneously and solved many
of the same problems as pyspeckit). The astropy package (Astropy Collaboration
et al., 2013, 2018) had its first commit in 2011, so even the basic
infrastructure for such analysis was not yet established.

pyspeckit’s graphical user interface (GUI) features were inspired by IRAF’s
splot tool, while the fitting features were inspired in part by xspec
(https://heasarc.gsfc.nasa.gov/xanadu/xspec/). Over subsequent years,
pyspeckit grew by incorporating more sophisticated models and improving its
internal structure. The package was moved out of agpy and into its own
repository in 2011, first spending a few years on Bitbucket in a mercurial
repository, then finally moved to GitHub in 2012, where it currently resides
(https://github.com/pyspeckit/pyspeckit/). Release v1.0 is available on Zenodo
(Ginsburg et al., 2022).

Because pyspeckit’s initial development preceded astropy, some features were
included that later became redundant with astropy. Most notably, pyspeckit
included a limited system for spectroscopic unit conversion. In 2015, this
system was completely replaced with astropy’s unit system. Around the same
time, the Doppler conversion tools (converting from frequency or wavelength to
velocity) that existed in pyspeckit were pushed upstream into astropy,
highlighting the mutually beneficial role of astropy’s affiliated packaged
system (Astropy Collaboration et al., 2018). pyspeckit became an astropy
affiliated package in 2017 (An affiliated package is an astronomy-related
Python package that is not part of the astropy core package, and is not
managed by the project but is a part of the Astropy Project
community111https://www.astropy.org/affiliated/).

In this paper we briefly outline pyspeckit’s architecture and highlight its
key capabilities. In Section 2, we outline the structure of the package. In
Section 3, we describe the GUI system. In Sections 4 and 5, we outline
pyspeckit’s cube handling capabilities and model library. The appendices
describe parameter error estimation for Gaussians (Appendix A) and for the
ammonia model B). Appendix C describes a benchmarking test of the N2H+ model
against the CLASS version. Appendix D describes a framework for local-
thermodynamic-equilibrium-based multi-transition modeling. Finally, Appendix E
describes the integration of pyspeckit into ScousePy.

##  2 Package structure

The central object in pyspeckit is a Spectrum, which has associated data
(e.g., flux), error (assumed to be symmetric, 1$\sigma$, Gaussian
uncertainty), and xarr (e.g., wavelength, frequency, energy), the latter of
which represents the spectroscopic axis. A Spectrum object has several
attributes that are themselves classes that can be called as functions: the
plotter, the fitter specfit, and the continuum fitter baseline.

There are several subclasses of Spectrum: Spectra is a collection of spectra
intended to be stitched together (i.e., with non-overlapping spectral axes,
e.g., for Echelle spectra), ObsBlock is a collection of spectra with identical
spectral axes intended to be operated on as a group, e.g., to take an average
spectrum, and Cube is a 3D spatial-spatial-spectral cube.

###  2.1 Supported data formats

pyspeckit supports a variety of open and proprietary data formats that have
been traditionally used to store spectroscopic data products in astronomy. It
is always possible to create a Spectrum object from numpy (van der Walt et
al., 2011; Harris et al., 2020) arrays representing the wavelength, flux, and
error of the spectrum, but the supported file formats listed below make the
reading process easier.

  * •

ASCII: Text files with wavelength, flux, and optional error columns can be
read using the astropy.io.ascii module.

  * •

FITS: The Flexible Image Transport System (FITS; Wells et al., 1981; Greisen
et al., 2006; Pence et al., 2010) format is supported in pyspeckit with
astropy.io.fits. FITS spectra are expected to have their spectral axis defined
using the WCS keywords in the FITS header. FITS binary tables with the same
wavelength, flux, and optional error column layout as text files can also be
read.

  * •

SDFITS: Data files following the Single Dish FITS (SDFITS; Garwood, 2000)
convention for radio astronomy data as produced by the Green Bank Telescope
are partly supported in pyspeckit.

  * •

HDF5: If the h5py package is installed, pyspeckit will support read access to
files containing spectra in the HDF5 format, where the data columns can be
specified using keyword arguments.

  * •

CLASS: pyspeckit is capable of reading files from some versions of the GILDAS
Continuum and Line Analysis Single-dish Software format (CLASS; Gildas Team,
2013). The CLASS reader has been tested with data files from the Arizona Radio
Observatory telescopes (12-m and 10-m Submillimeter Telescope) and the Atacama
Pathfinder Experiment (APEX) radio telescope.

###  2.2 Plotter

The plotter is a basic plot tool that comprises pyspeckit’s main graphical
user interface. It is described in more detail in the GUI section (§3).

###  2.3 Fitter

The fitting tool in pyspeckit is the Spectrum.specfit object. This object is a
class that is created for every Spectrum object. The fitter can be used with
any of the models included in the model registry, or a custom model can be
created and registered.

To fit a profile to a spectrum, several optimizers are available. Two
implementations of the Levenberg-Marquardt optimization method (Levenberg,
1944; Marquardt, 1963) are provided, mpfit222Originally implemented by Craig
Markwardt Markwardt (2009)
https://pages.physics.wisc.edu/~craigm/idl/fitting.html and ported to python
by Mark Rivers and then Sergei Koposov. The version in pyspeckit has been
updated somewhat from Koposov’s version. and lmfit (Newville et al.,
2014)333https://lmfit.github.io/lmfit-py/,
https://doi.org/10.5281/zenodo.11813. Wrappers of pymc (Salvatier et al.,
2016)444https://pymc-devs.github.io/pymc/ and
emcee555http://dfm.io/emcee/current/, Foreman-Mackey et al. (2013) are also
available, though these tools are better for parameter error analysis than for
optimization.

Once a fit is performed, the results of the fit are accessible through the
parinfo object, which is a dictionary-like structure containing the parameter
values, errors, and other metadata (e.g., information about whether the
parameter is fixed, tied to another parameter, or limited). Other information
about the fit, such as the $\chi^{2}$ value, are available as attributes of
the specfit object.

##### Optimal $\chi^{2}$

Specfit computes the ‘optimal’ $\chi^{2}$, which is the $\chi^{2}$ value
computed only over the range where the model contains statistically
significant signal. This measurement is intended to provide a more accurate
estimate of the $\chi^{2}$ value by excluding pixels that are not described by
the model. By default, the function selects all pixels where the model value
is greater (in absolute value) than the corresponding error. In principle,
this optimal $\chi^{2}$ may be helpful for obtaining correctly scaled errors
(see Section 2.6.1), though this claim has never been rigorously tested.

###  2.4 Data Selection

An important feature of the spectral fitter is the ability to select the
region of the spectrum to be fit. This selection process can either be done
manually, using the selectregion method to set one or more ranges of data to
include in the fit, or interactively using the GUI. The selected regions are
then highlighted in the plot window if one is open.

###  2.5 Continuum Fitting

The fitting process in pyspeckit is capable of treating line and continuum
independently or jointly. If a model includes continuum, e.g., for the case of
a four-parameter Gaussian profile that includes an additive constant, it can
be fitted through the standard specfit fitter.

However, it is common practice to fit the continuum independently prior to
fitting lines. Such practice is necessary when fitting absorption lines (the
equivalent width is defined relative to a normalized continuum) and
practically necessary for heterodyne radio observations where the continuum is
usually poorly measured and corrupted by instrumental effects. Following radio
convention, the pyspeckit continuum fitting tool is called baseline. This
module supports polynomial, spline, and power-law fitting. It is common in
radio astronomy to have wide instrumental residual features in the data that
need to be fitted and removed; this process is called ‘baseline subtraction’.
In other wavelength regimes, this would typically be referred to as continuum
fitting or continuum subtraction. In practical algorithmic terms, fitting a
true astrophysical continuum and a residual instrumental baseline are
indistinguishable.

###  2.6 Error Treatment

The Spectrum objects used by pyspeckit have an attached error array, which is
meant to hold the $1\sigma$ independent Gaussian errors on each pixel. While
this error representation may be a dramatic oversimplification of the true
errors for almost all instruments (since it ignores correlations between
pixels), it is also the most commonly used assumption in astronomical
applications.

The error array is used to determine the best-fit parameters and their
uncertainties (see §2.3). They can be displayed as error bars on individual
pixels or as shaded regions around those pixels using different display modes.

A typical example is given below, where we generate a spectrum and error array
using numpy (Harris et al., 2020) and astropy tools (Astropy Collaboration et
al., 2013, 2018).

⬇

from astropy import units as u

import numpy as np

import pyspeckit

\parxaxis = np.linspace(-25, 25)*u.km/u.s

sigma_width = 3.0*u.km/u.s

data = 5*np.exp(-xaxis**2 /

(2*sigma_width**2))*u.Jy

error = np.ones_like(data) * 0.2

sp = pyspeckit.Spectrum(xarr=xaxis,

data=data,

error=error)

\parsp.plotter(errstyle=’fill’)

\parsp.plotter.savefig(”example_fig_1.pdf”)

Figure 1: An example plotted spectrum showing the automated unit labeling and
errors. The errors are shown with the ‘fill’ style and represent symmetric
$1-\sigma$ Gaussian errors.

####  2.6.1 Automatic Error Estimation

In the case where there are portions of the spectrum that have no signal
peaks, a common approach in spectroscopy is to estimate the errors from the
standard deviation of those signal-free pixels. This approach assumes the
noise is constant across the spectrum.

If all of the peaks present in the spectrum are fitted well by the model, the
standard deviation of the residual spectrum from the model fit will accurately
represent the uniform errors. If a fit is performed with uninitialized errors,
they will initially default to a constant value of unity. pyspeckit will then
automatically replace the errors with the standard deviation of the residuals,
so they remain constant but will have a value that is related to the data.
This means that performing a fit on the same data (without associated errors)
twice will result in the same parameter values both times but different errors
the second time.

####  2.6.2 Parameter error estimation

Parameter errors are adopted from the mpfit or lmfit fit results. The
Levenberg-Marquardt algorithm finds a local minimum in parameter space, and
one of its returns is the parameter covariance matrix. This covariance matrix
is not directly the covariance of the parameters, and must be rescaled to
deliver an approximate error.

The standard rescaling is to multiply the covariance by the sum of the squared
errors divided by the degree of freedom of the fit, usually referred to as
$\chi^{2}/N$. The number of degrees of freedom is assumed to be equal to the
number of free parameters, e.g., for a one-dimensional Gaussian, there would
be three: the amplitude, width, and center. This approach implicitly assumes
that the model describes the data well and is an optimal fit. It also assumes
that the model is linear with all of the parameters, at least in the region
immediately surrounding the optimal fit. These requirements are frequently not
satisfied; see Andrae et al. (2010) and Andrae (2010) for details. We show a
demonstration of this approximation process in Appendix A for the case of a
simple Gaussian line profile.

##  3 Graphical Design

###  3.1 GUI development

Many astronomers are familiar with IRAF’s splot tool, which is useful for
fitting Gaussian profiles to spectral lines. It uses keyboard interaction to
specify the fitting region and guesses for fitting the line profile, but for
most use cases, these parameters could _only_ be accessed through the GUI.

The fitting GUI in pyspeckit was built to match splot’s functionality but with
additional means of interacting with the fitter. In splot, reproducing any
given fit is challenging, since subtle changes in the cursor position (i.e.,
the input guess) can significantly change the fit result. In pyspeckit, it is
possible to record the results of fits programmatically and re-fit using those
same results.

The GUI was built using matplotlib’s canvas interaction tools. These tools are
limited to the GUI capabilities that are compatible with all platforms (e.g.,
Qt, Tk, Gtk) and therefore exclude some of the more sophisticated fitting
tools found in other software (e.g., glue; Beaumont et al., 2014).

An example walking through typical interactive GUI usage is in the online
documentation at https://pyspeckit.readthedocs.io/en/latest/interactive.html.

###  3.2 Plotting

Plotting in pyspeckit is designed to provide a short path to publication-
quality figures. The default plotting mode uses histogram-style line plots and
labels axes with LaTeX-formatted versions of units.

When the plotter is active and a model is fit, the model parameters are
displayed with LaTeX formatting in the plot legend. The errors on the
parameters, if available, are also shown, and these uncertainties are used to
decide on the number of significant figures to display.

##  4 Models

Some of pyspeckit’s internal functions may be replaced by the astropy
specutils package in the future. However, the rich suite modeling in pyspeckit
is likely to remain useful indefinitely. This model library includes some of
the most useful general spectral model functions (e.g., Gaussian, Lorentzian,
and Voigt profiles) and a wide range of specific model types (e.g., ammonia
and formaldehyde hyperfine models, the $\mathrm{H}_{2}$ rotational ladder, and
recombination line models). These models can be easily used within pyspeckit,
but they can also be used completely independent from it (e.g.,
https://nestfit.readthedocs.io/en/latest/quickstart.html, Svoboda 2021).
Several of the models rely on scipy (Virtanen et al., 2020) for either special
functions or multidimensional interpolation.

The base Model class and fitting framework in pyspeckit provide some generally
useful features that do not need to be re-implemented. Any model is
generalized to a multi-component form automatically; e.g., the Gaussian model
only describes a single Gaussian spectral component, but the fitting tools
allow any number of independent Gaussians to be fit.

Models are customizable, and examples of registering a new or modified model
in pyspeckit are included in the online documentation.

A list of the included models, and their parent class when relevant, is given
in Table 1

Table 1: Summary of Models Model | Module Name | Parent class
---|---|---
Hyperfine | hyperfine |  $\cdots$
Gaussian | inherited_gaussfitter |  $\cdots$
Lorentzian | inherited_lorentzian |  $\cdots$
Voigt | inherited_voigtfitter |  $\cdots$
NH3 | ammonia | Hyperfine
NH2D | ammonia | Hyperfine
N2H+ | n2hp | Hyperfine
N2D+ | n2dp | Hyperfine
DCO+ | dcop | Hyperfine
LTE Molecule | lte_molecule |  $\cdots$
H2CO (cm) | formaldehyde | Hyperfine
H2CO (mm) | formaldehyde_mm |  $\cdots$
Hydrogen | hydrogen |  $\cdots$

##### Hyperfine Line Models

In radio and millimeter spectroscopy, there are many molecular line groups
that are well modelled as Gaussian profiles separated by fixed frequency
offsets. These hyperfine line groups are often unique probes of physical
parameters because these features have different, known relative optical
depths. In this case, the measured relative amplitudes of these different
features allow the optical depth (and, in turn, the column density) to be
measured from a single spectrum. pyspeckit provides the hyperfine model class
to handle this class of molecular line transitions, and it includes several
molecular species implementations (e.g., HCN, N2H+, NH3, H2CO). In this
implementation, the excitation temperature of each of the hyperfine components
is assumed to be the same, which is the most commonly used assumption but may
be violated in some cases.

##  5 Cubes

Spectral cubes have become important in radio astronomy, since they are the
natural data products produced by interferometers like ALMA and the JVLA.
Optical and infrared data cubes are growing more common from integral field
units (IFUs) like MUSE on the VLT, OSIRIS on Keck, NIFS on Gemini, and NIRSpec
and MIRI on JWST.

The cube visualization tools built into pyspeckit are limited to spectral and
spatial plots. The mapplot viewer makes a 2D image of a slice of the cube, if
given a slice number, or a projection along the spectral axis if given a
function or function name. Once active, the mapplot viewer can be used
interactively: clicking on a pixel will display that pixel’s spectrum in a
separate window; clicking and dragging will produce a circular region whose
average spectrum will be plotted in that window. The plots shown in the
separate window correspond to a spectrum accessible as the cube’s .spectrum
object. This basic interaction allows for data exploration, but is not
efficient for fitting each spectrum of a cube.

While many cube operations are handled well by numpy-based packages like
spectral-cube (Robitaille et al., 2016; Ginsburg et al.,
2019)666https://spectral-cube.readthedocs.io, it is sometimes desirable to fit
a profile to each spectrum in a cube. The Cube.fiteach method is a tool for
automated line fitting that includes parallelization of the fit. Examples can
be found in the online documentation. This tool has seen significant use in
custom made survey pipelines, where the library of spectral models is
particularly useful (e.g, Friesen et al., 2017,
https://github.com/GBTAmmoniaSurvey/GAS). It has also been incorporated into
other tools, e.g., multicube777https://github.com/vlas-sokolov/multicube,
SCOUSE (Henshaw et al., 2016, 2019, see Appendix E), make_cube (Youngblood et
al., 2016), and pyspecnest888https://github.com/vlas-sokolov/pyspecnest
(Sokolov et al., 2020).

##  6 Summary

pyspeckit is a versatile tool for spectroscopic analysis in python and is one
of the astropy affiliated packages.

JEP acknowledges the support by the Max Planck Society. AG acknowledges
support from the NSF under grant AST 2008101.

## References

  * Andrae (2010) Andrae, R. 2010, arXiv e-prints, arXiv:1009.2755.  https://arxiv.org/abs/1009.2755
  * Andrae et al. (2010) Andrae, R., Schulze-Hartung, T., & Melchior, P. 2010, arXiv e-prints, arXiv:1012.3754.  https://arxiv.org/abs/1012.3754
  * Astropy Collaboration et al. (2013) Astropy Collaboration, Robitaille, T. P., Tollerud, E. J., et al. 2013, A&A, 558, A33, doi: 10.1051/0004-6361/201322068
  * Astropy Collaboration et al. (2018) Astropy Collaboration, Price-Whelan, A. M., Sipőcz, B. M., et al. 2018, AJ, 156, 123, doi: 10.3847/1538-3881/aabc4f
  * Beaumont et al. (2014) Beaumont, C., Robitaille, T., & Borkin, M. 2014, Glue: Linked data visualizations across multiple files, Astrophysics Source Code Library, record ascl:1402.002.  http://ascl.net/1402.002
  * Foreman-Mackey et al. (2013) Foreman-Mackey, D., Hogg, D. W., Lang, D., & Goodman, J. 2013, PASP, 125, 306, doi: 10.1086/670067
  * Friesen et al. (2017) Friesen, R. K., Pineda, J. E., co-PIs, et al. 2017, ApJ, 843, 63, doi: 10.3847/1538-4357/aa6d58
  * Garwood (2000) Garwood, R. W. 2000, in Astronomical Society of the Pacific Conference Series, Vol. 216, Astronomical Data Analysis Software and Systems IX, ed. N. Manset, C. Veillet, & D. Crabtree, 243
  * Gildas Team (2013) Gildas Team. 2013, GILDAS: Grenoble Image and Line Data Analysis Software, Astrophysics Source Code Library, record ascl:1305.010.  http://ascl.net/1305.010
  * Ginsburg et al. (2019) Ginsburg, A., Sipőcz, B. M., Brasseur, C. E., et al. 2019, AJ, 157, 98, doi: 10.3847/1538-3881/aafc33
  * Ginsburg et al. (2022) Ginsburg, A., Mirocha, J., Sokolov, V., et al. 2022, pyspeckit/pyspeckit, v1.0.0, Zenodo, doi: 10.5281/zenodo.6470904.  https://doi.org/10.5281/zenodo.6470904
  * Greisen et al. (2006) Greisen, E. W., Calabretta, M. R., Valdes, F. G., & Allen, S. L. 2006, A&A, 446, 747, doi: 10.1051/0004-6361:20053818
  * Harris et al. (2020) Harris, C. R., Millman, K. J., van der Walt, S. J., et al. 2020, Nature, 585, 357, doi: 10.1038/s41586-020-2649-2
  * Harris et al. (2020) Harris, C. R., Millman, K. J., van der Walt, S. J., et al. 2020, Nature, 585, 357, doi: 10.1038/s41586-020-2649-2
  * Henshaw et al. (2016) Henshaw, J. D., Longmore, S. N., Kruijssen, J. M. D., et al. 2016, MNRAS, 457, 2675, doi: 10.1093/mnras/stw121
  * Henshaw et al. (2019) Henshaw, J. D., Ginsburg, A., Haworth, T. J., et al. 2019, MNRAS, 485, 2457, doi: 10.1093/mnras/stz471
  * Lee (2021) Lee, K. 2021, bmcguir2/molsim: Updated contributor list, v0.1.2a, Zenodo, doi: 10.5281/zenodo.4560750
  * Levenberg (1944) Levenberg, K. 1944, Quarterly of Applied Mathematics, 2, 164, doi: 10.1090/qam/10666
  * Mangum & Shirley (2015) Mangum, J. G., & Shirley, Y. L. 2015, PASP, 127, 266, doi: 10.1086/680323
  * Markwardt (2009) Markwardt, C. B. 2009, in Astronomical Society of the Pacific Conference Series, Vol. 411, Astronomical Data Analysis Software and Systems XVIII, ed. D. A. Bohlender, D. Durand, & P. Dowler, 251
  * Marquardt (1963) Marquardt, D. W. 1963, Journal of the Society for Industrial and Applied Mathematics, 11, 431, doi: 10.1137/0111030
  * Möller et al. (2017) Möller, T., Endres, C., & Schilke, P. 2017, A&A, 598, A7, doi: 10.1051/0004-6361/201527203
  * Momcheva & Tollerud (2015) Momcheva, I., & Tollerud, E. 2015, ArXiv e-prints
  * Müller et al. (2005) Müller, H. S. P., Schlöder, F., Stutzki, J., & Winnewisser, G. 2005, Journal of Molecular Structure, 742, 215, doi: 10.1016/j.molstruc.2005.01.027
  * Newville et al. (2014) Newville, M., Stensitzki, T., Allen, D. B., & Ingargiola, A. 2014, LMFIT: Non-Linear Least-Square Minimization and Curve-Fitting for Python, 0.8.0, Zenodo, doi: 10.5281/zenodo.11813
  * Pence et al. (2010) Pence, W. D., Chiappetti, L., Page, C. G., Shaw, R. A., & Stobie, E. 2010, A&A, 524, A42, doi: 10.1051/0004-6361/201015362
  * Pickett et al. (1998) Pickett, H. M., Poynter, R. L., Cohen, E. A., et al. 1998, J. Quant. Spec. Radiat. Transf., 60, 883, doi: 10.1016/S0022-4073(98)00091-0
  * Robitaille et al. (2016) Robitaille, T., Ginsburg, A., Beaumont, C., Leroy, A., & Rosolowsky, E. 2016, spectral-cube: Read and analyze astrophysical spectral data cubes, Astrophysics Source Code Library, record ascl:1609.017.  http://ascl.net/1609.017
  * Salvatier et al. (2016) Salvatier, J., Wieckiâ, T. V., & Fonnesbeck, C. 2016, PyMC3: Python probabilistic programming framework, doi: 10.7717/peerj-cs.55
  * Sokolov et al. (2020) Sokolov, V., Pineda, J. E., Buchner, J., & Caselli, P. 2020, ApJ, 892, L32, doi: 10.3847/2041-8213/ab8018
  * Svoboda (2021) Svoboda, B. 2021, autocorr/nestfit: Initial public release, v0.2, Zenodo, doi: 10.5281/zenodo.4470028.  https://urldefense.proofpoint.com/v2/url?u=https-3A__doi.org_10.5281_zenodo.4470028&d=DwIGAg&c=sJ6xIWYx-zLMB3EPkvcnVg&r=Z1XKDJQAeQrijyDtjaW9Wgu01lnkYrUgUcy1mQEqN5M&m=GPa5YygYSU5myWqo_ooDDI-f16r16bIMGSpxN_pjT7_YqNng4UTOOsO-DTx27IQk&s=8m9VVLbHI3KlUkzDWW57LfumtvEXB1xWsXCYq_jZAs0&e=
  * Tody (1986) Tody, D. 1986, in Society of Photo-Optical Instrumentation Engineers (SPIE) Conference Series, Vol. 627, Instrumentation in astronomy VI, ed. D. L. Crawford, 733
  * Tollerud (2012) Tollerud, E. 2012, Astropysics: Astrophysics utilities for python, Astrophysics Source Code Library, record ascl:1207.007.  http://ascl.net/1207.007
  * van der Walt et al. (2011) van der Walt, S., Colbert, S. C., & Varoquaux, G. 2011, Computing in Science and Engineering, 13, 22, doi: 10.1109/MCSE.2011.37
  * Virtanen et al. (2020) Virtanen, P., Gommers, R., Oliphant, T. E., et al. 2020, Nature Methods, 17, 261, doi: 10.1038/s41592-019-0686-2
  * Wells et al. (1981) Wells, D. C., Greisen, E. W., & Harten, R. H. 1981, A&AS, 44, 363
  * Youngblood et al. (2016) Youngblood, A., Ginsburg, A., & Bally, J. 2016, AJ, 151, 173, doi: 10.3847/0004-6256/151/6/173

##  Appendix A Parameter Error Estimation for a simple 1D Gaussian profile

As discussed in Section 2.6.2, parameter errors are estimated in pyspeckit by
the underlying lmfit or mpfit tools using the approximation that the reduced
chi-squared is unity, $\chi^{2}/n=1$. We demonstrate here that, for a simple
one-dimensional Gaussian profile, this approximation results in an excellent
recovery of the underlying parameter errors.

In Figure 2, we show a synthetic spectrum with uniform Gaussian random noise
and perfectly-measured uncorrelated data errors. The fitted model is a one-
dimensional Gaussian profile with free parameters amplitude, center, and
width. The fit results are given in the figure.

To produce a good error estimate under the $\chi^{2}/n=1$ approximation, the
error distribution must be Gaussian, the model must be linear in all
parameters, and the model must be the correct underlying model (Andrae, 2010).

Figure 3 shows the $\chi^{2}$ values in parameter space surrounding the best-
fit value. Along the diagonal, we show the $\chi^{2}$ values for the
individual parameters with all others marginalized over by taking the minimum
$\chi^{2}$ value over the explored parameter space. The vertical dashed lines
show the estimated $1\sigma$ errors reported by the mpfit optimizer, while the
horizontal dashed lines show the value $\Delta\chi^{2}=1$, which corresponds
to the 68% confidence interval for that parameter. If the $\chi^{2}/n=1$
approximation is perfect, the dashed lines should intersect with the blue
curves, and in this case, they do for all parameters.

Off of the diagonal of Figure 3, we show the two-dimensional marginal
distributions. Contours are shown at $\Delta\chi^{2}=1,2.3,6.2,11.8$,
corresponding to 39.3%, 68%, 95%, and 99.5% confidence regions (the first
value corresponds to $1\sigma$ uncertainty when marginalized to a single
parameter, while the others correspond to $1\sigma$, $2\sigma$, and $3\sigma$
for two parameters, respectively, assuming a normal distribution) . The
vertical and horizontal dashed lines show the estimates from the
$\chi^{2}/n=1$ approximation for a _single_ parameter; these are expected to
intersect the innermost 1$\sigma$ contour when marginalized to a single
parameter. The shift vs amplitude and shift vs width diagrams are both well-
behaved, with error contours tracing out a symmetric distribution centered on
the true parameters marked with an ‘x’. However, the width vs amplitude plot
indicates that the single-parameter errorbars are partly driven by the
significantly correlated uncertainty between these parameters. This
information is captured in the covariance matrix that is used to compute the
single-parameter errors, as it has significant values in the off-diagonal
parts of the matrix.

The source code for this example can be found in the pyspeckit github
repository in
examples/synthetic_spectrum_example_witherrorestimates.py999https://github.com/pyspeckit/pyspeckit/blob/master/examples/synthetic_spectrum_example_witherrorestimates.py.

Figure 2: One-dimensional Gaussian profile fit to a synthetic spectrum. The
parameter values and errors are shown in the upper right. The number of
significant figures displayed in both the value and the error is automatically
set to one digit more than the last significant digit in the error. Figure 3:
Error estimate figure. In all panels, the vertical dashed lines show the
estimated $1\sigma$ errors from the optimizer, while the horizontal dashed
lines show the value $\Delta\chi^{2}=1$, which corresponds to the 68%
confidence interval for that parameter. In the off-diagonal panels, contours
are shown at $\Delta\chi^{2}=1,2.3,6.2,11.8$ (black dashed, red, blue dotted,
green dash-dot), corresponding to 39.3%, 68%, 95%, and 99.5% confidence
regions ($1\sigma$ for a single parameter, then $1\sigma$, $2\sigma$, and
$3\sigma$ for two parameters). See Appendix A for details and interpretation.

##  Appendix B Parameter Error Estimation for Ammonia

In Appendix A, we showed the parameter estimation results in the case of a
modeled 1-dimensional Gaussian. One of the most commonly used models in
pyspeckit is the ammonia ($\mathrm{NH}_{3}$) hyperfine model, which has
several additional emission lines and several parameters governing those
lines.

The ammonia inversion transitions are notable for having spectrally resolved
hyperfine components under typical Galactic molecular gas conditions, the
relative weights of which are governed by quantum mechanics (Mangum & Shirley,
2015). The existence of these additional components often allows for direct
estimates of the optical depth of the central line, which is optically thicker
than the other components, thereby making column density estimates from a
single spectral band relatively straightforward.

The model for these lines is more complicated than that for a single Gaussian.
The model must include a simplified version of the radiative transfer equation
and must simultaneously produce the predicted emission of several lines.
Additionally, there are several approximations for the relative line strengths
that are convenient to use under different circumstances, so pyspeckit
implements several different variants of the $\mathrm{NH}_{3}$ model.

In this section, we show parameter estimates analogous to those in Section A.
We examine a case where the fitted lines are in local thermodynamic
equilibrium (LTE), such that the ratios of the $(J,K)=(1,1)$ to $(2,2)$ line
is governed by the rotational temperature $T_{\mathrm{R}}$ but the individual
lines both have $T_{\mathrm{ex}}=T_{\mathrm{R}}$.

The free parameters in the ammonia model are the rotational temperature,
$T_{\mathrm{R}}$, which governs the relative populations of the rotational
states, the excitation temperature $T_{\mathrm{ex}}$, which governs the
relative populations of the two levels within a single inversion transition,
the column density, $N(\mathrm{NH}_{3})$, which specifies the total column
density of $\mathrm{NH}_{3}$ integrated over all states (note that this
parameter enters the model as $10^{N}$, i.e., we optimize the log of the
column density), the line-of-sight velocity $v_{\mathrm{LoS}}$, the line width
$\sigma_{v}$, and the ortho-to-para ratio parameterized as the fraction of
ortho-$\mathrm{NH}_{3}$ $F_{ortho}$. In the examples below, we fix
$F_{ortho}=0$ and treat only para-$\mathrm{NH}_{3}$ lines.

The fit results from the first case are shown in Figures 4 and 5. The fit
recovers the input parameters, but reveals one of the important caveats when
using any optimization algorithm: in some models, parameters are degenerate,
and therefore using the diagonal of the covariance matrix to estimate the
variance can result in incorrect error estimates. While the errors on most
parameters appear reasonable, there is a very large error on the excitation
temperature $T_{\mathrm{ex}}$, which is driven by the degeneracy of
$T_{\mathrm{ex}}$ with $N_{\mathrm{tot}}$. The asymmetry of the error on
$T_{\mathrm{ex}}$ is apparent in Figure 5, but it is not captured by the
optimizer’s reported error results; the asymmetry occurs because $T_{ex}$ is
in the exponent in the model equations.

In such situations, it can be beneficial to measure the parameter errors in
different ways. Using the emcee and pymc wrappers can help do this. Examples
of how to use these Monte Carlo samplers to acquire better parameter errors
once an optimization has already been performed are available in the online
documentation: see
http://pyspeckit.readthedocs.io/en/latest/example_pymc.html.

More sophisticated examples, including fitting of a non-LTE ammonia spectrum
in which $T_{\mathrm{ex}}<T_{R}$, are available in the example directory of
pyspeckit (https://github.com/pyspeckit/pyspeckit/tree/master/examples),
specifically
https://github.com/pyspeckit/pyspeckit/tree/master/examples/synthetic_LTE_ammonia_spectrum_example_witherrorestimates.py
and
https://github.com/pyspeckit/pyspeckit/tree/master/examples/synthetic_nLTE_ammonia_spectrum_example_witherrorestimates.py.

These examples also include demonstrations of how to force the optimizer to
ignore nonphysical values while still obtaining useful constraints on the free
parameters. Constrained fitting approaches can be helpful in cases like the
ammonia fit, where high values of $T_{ex}$ where $T_{ex}>T_{rot}$ are
statistically likely given the model, but physically disallowed; constrained
fitting allows the known physical limits to rule out bad portions of parameter
space.

Figure 4: Ammonia model profile fit to a synthetic spectrum. The parameter
values and errors are shown in the upper right. The associated error estimate
triangle diagram is shown in Figure 5. The correct parameters are
$T_{\mathrm{R}}=T_{\mathrm{ex}}=35$, $N=15$, $\sigma_{v}=2$, and $v=0$, all of
which are reasonably recovered. However, note that
$T_{\mathrm{ex}}>T_{\mathrm{R}}$ is generally nonphysical, yet the allowed
parameter space for $T_{\mathrm{ex}}$ includes such values. This two-panel
plot was produced automatically using the pyspeckit.wrappers.fitnh3.plot_nh3
command.  Figure 5: Error estimate figure for the default $\mathrm{NH}_{3}$
model. The panels are labeled as in Figure 3. The centroid velocity panel is
excluded from this plot because it is independent of the other parameters,
exhibiting no degeneracy. The most relevant panel is the ntot0 vs tex0 panel,
which plots the column $N$ against the excitation temperature
$T_{\mathrm{ex}}$: both of these parameters govern the peak amplitude of the
spectrum, so they are degenerate. The vertical and horizontal dashed lines
represent the $\delta\chi^{2}=1$ and $\pm 1\sigma$ computed errors,
respectively. Their intersection points also intersect the blue marginalized
$\delta\chi^{2}$ curve in all of the displayed cases, indicating that the
approximation of the errors using the $\chi^{2}/n=1$ assumption is excellent.
However, the asymmetry seen in the blue $T_{ex}$ curve suggests that the
approximation for that parameter is likely to break down in some cases because
the true errors are asymmetric.

##  Appendix C Comparison of N2H+ (1-0) results with CLASS

One of the most frequently used line transitions for the study of dense gas
kinematics is N2H+ (1-0) at 93.17 GHz. The transition displays several
hyperfine components with well determined relative frequencies and weights.
The standard approach for analyzing this line has been to use the `HFS` mode
within CLASS. Here we show that using the N2H+ hyperfine model in pyspeckit,
we obtain the same results in both optically thin and thick models.

The main difference between the CLASS and pyspeckit parametrization is that
the former does not report excitation temperature ($T_{ex}$), but the area of
the line profile. The reported area is $\tau\times T_{ant}$, where

$T_{ant}=J(T_{ex})-J(T_{background})~{},$ (C1)

where

$J_{\nu}(T)=\frac{h\,\nu}{k_{B}}\frac{1}{(e^{h\,\nu/k_{B}\,T}-1)}~{}.$ (C2)

We derive the equivalent $T_{ex}$ from the reported line fit parameters.
Moreover, in the optically thin case both fits are performed using the common
assumption of $\tau=0.1$ as a fixed parameter.

Tables 2 and 3 show the results of fitting an example spectrum in both CLASS
and pyspeckit. The resulting fits differ by $<1\%$ in most parameters, with a
slightly greater discrepancy in the velocity centroid but consistent within
the reported fit uncertainties.

Table 2: Best fit parameters in optically thin model (3 parameters) Parameter | Input value | pyspeckit fit | CLASS fit
---|---|---|---
Tex | 9.0 | 3.454$\pm$0.014 | 3.451
$V_{c}$ | 0.0 | 0.0016 | 0.0028$\pm$0.0068
$\sigma_{v}$ | 0.3 | 0.2942$\pm$0.0062 | 0.2930$\pm$0.0060
$\tau_{all}$ | 0.01 | 0.1 | 0.1
$Area$ |  |  | 0.0607$\pm$0.0012
Table 3: Best fit parameters in optically thick model (4 parameters) Parameter | Input value | pyspeckit fit | CLASS fit
---|---|---|---
Tex | 9.0 | 9.19$\pm$0.19 | 9.1833
$V_{c}$ | 0.0 | 0.00042 | -0.000$\pm$0.0063
$\sigma_{v}$ | 0.3 | 0.3047$\pm$0.0062 | 0.3041$\pm$0.0063
$\tau_{all}$ | 9.0 | 8.13$\pm$0.59 | 8.10$\pm$0.59
$Area$ |  |  | 49.0$\pm$2.25

##  Appendix D LTE Model

pyspeckit includes tools to model generic local thermodynamic equilibrium
(LTE) emission lines. The modeling tools include wrappers to retrieve the
appropriate molecular line parameters from the JPL (Pickett et al., 1998) or
CDMS101010https://spec.jpl.nasa.gov/ (Müller et al., 2005) spectroscopy
databases via their astroquery interfaces (Ginsburg et al., 2019).

The main modeling function, LTE_molecule.generate_model, operates on the
combination of line parameters (centroid, width), physical parameters
(excitation temperature $T_{ex}$, total column density $N_{tot}$), and
molecular line parameters (rest frequency $\nu_{rest}$, Einstein A value
$A_{ij}$, degeneracy $g_{u}$, upper state energy level $E_{U}$, and the
partition function $Q(T_{ex})$). It implements the equations:

$\tau_{\nu}=\frac{c^{2}}{8\pi\nu^{2}}A_{ij}N_{u}\phi_{\nu}\left[\exp\left(\frac{h\nu}{k_{B}T_{ex}}\right)-1\right]$
(D1)

where $c$ is the speed of light, $k_{B}$ is Boltzmann’s constant, $h$ is
Planck’s constant, $N_{u}$ is given by

$N_{u}=N_{tot}\frac{g_{u}}{Q}\exp\left(\frac{-E_{u}}{k_{B}T_{ex}}\right)$ (D2)

and $\phi_{\nu}$ is assumed to be a Gaussian such that

$\phi_{\nu}=\frac{1}{\sqrt{2\pi}\sigma_{\nu}}\exp\left[-\frac{(\nu-\nu_{0})^{2}}{2\sigma_{\nu}^{2}}\right]$
(D3)

where $\sigma_{\nu}$ is the Gaussian line width (not the FWHM) in frequency
units, $\sigma_{\nu}=\frac{\sigma_{v}}{c}\nu_{rest}$ and $\sigma_{v}$ is the
Gaussian line width in velocity units. The above is based on Equations 11 and
29 of Mangum & Shirley (2015). The returned spectral model is then calculated
as

$\begin{array}[]{lll}I_{\nu}&=&J_{\nu}(T_{ex})\left[1-e^{-\tau}\right]+J_{\nu}(T_{BG})e^{-\tau}-J_{\nu}(T_{BG})\\\
&=&\left[J_{\nu}(T_{ex})-J_{\nu}(T_{BG})\right]\left[1-e^{-\tau}\right]\\\
\end{array}$ (D4)

where $T_{BG}$ is the background temperature (assumed 2.73 for the default CMB
temperature). We have split the equation into two lines to indicate that the
return is explicitly background-subtracted. $J_{\nu}$ is the Rayleigh-Jeans
equivalent brightness temperature

$J_{\nu}=\frac{h\nu}{k_{B}}\left[\exp\left(\frac{-h\nu}{k_{B}T}\right)-1\right]^{-1}$
(D5)

. The partition function can be specified as an array, which enables modeling
lines from different species simultaneously.

To verify the accuracy of these models, we benchmarked the pyspeckit models
against both XCLASS (Möller et al., 2017) and molsim (Lee, 2021). The
benchmark notebook is provided here: https://github.com/pyspeckit/pyspeckit-
tests/blob/master/xclass-benchmark/CO_Benchmark.ipynb. We modeled the lowest
12 transitions of CO. We obtain good agreement ($<1\%$ difference) with XCLASS
at the line peak for all transitions when using option Interf_Flag = False. In
the low-J transitions, we see significant fractional differences in the line
wings, but with very small absolute values (the difference in the integral is
$<10^{-4}$); these appear to come from rounding errors in the evaluation of
the Gaussian function. These small differences are very unlikely to affect any
modeling. We obtain significantly different answers with Interf_Flag = True;
in this case, XCLASS returns a peak that is lower by the CMB temperature.

We additionally benchmarked two more complicated molecules, CH3OH and CH3CN,
and again found excellent agreement.

##  Appendix E ScousePy

ScousePy is a tool for the decomposition of data cubes with multi-component
spectral lines, and makes use of pyspeckit’s fitting functionality (§2.3).
Broadly speaking, spectral decomposition algorithms can be divided into two
classes: bottom-up and top-down. The former treat the decomposition of
individual spectra independently from one another, while the latter approach
uses spatial averaging to estimate initial guesses for the decomposition of
individual spectra. ScousePy follows the latter of these two approaches.
ScousePy

  1. 1.

breaks a data cube into sub-regions of user-defined size. A spatially averaged
spectrum is extracted from each sub-region.

  2. 2.

uses derivative spectroscopy to estimate the number of components and the
properties of those individual components in each spatially-averaged spectrum.
These initial guesses are passed to pyspeckit’s specfit to perform the fit.

  3. 3.

uses the output solution (specfit.fitter.params) from the average spectrum as
new initial guesses for fitting the individual spectra contained within the
averaging region.

  4. 4.

displays the results in an interface that enables quality assessment and re-
fitting if necessary.

ScousePy makes use of pyspeckit’s specfit in two main ways. First, non-
interactively, with initial guesses supplied to specfit via specfit.guesses.
Second, ScousePy also makes use of pyspeckit’s interactive fitting
functionality, which uses keyboard and mouse interaction to provide
specfit.guesses.

An example of the ScousePy.ScouseFitter GUI is shown in Figure 6. This figure
shows the Gaussian decomposition of a two component spectrum. ScousePy
provides initial guesses to pyspeckit’s specfit using derivative spectroscopy,
in which:

  1. 1.

the input spectrum is smoothed using astropy.convolution.Gaussian1DKernel (see
ScousePy.DSpec).

  2. 2.

the first to fourth order derivatives of the smoothed spectrum are computed
and used to determine the number of components and their amplitudes,
centroids, and widths (see lollipops in the top left panel).

These values are then supplied to specfit via specfit.guesses. The fit is
performed using lmfit, and the result is displayed in the information panel.
The buttons on the right hand side of the GUI can be used to enter pyspeckit’s
interactive fitter functionality via “fit (manual)” 111111Note that this
example analysis has been performed using ScousePy.ScouseFitter in its stand-
alone mode, which can be used for the decomposition of an individual spectrum
or lists of spectra. The same procedure is followed during cube fitting.. The
relevant fit information produced by pyspeckit (or further derived from the
quantities output by specfit) are located in a dictionary called
ScousePy.ScouseFitter.modelstore. Further information on the pyspeckit
methodology used by ScousePy can be found in the documentation for
ScousePy.ScouseFitter and ScousePy.Decomposer (see
https://scousepy.readthedocs.io/en/latest/).

Figure 6: Gaussian decomposition of a two-component spectrum performed by
ScousePy using pyspeckit. The top-left panel shows the spectrum (black), the
same spectrum smoothed with a Gaussian 1D kernel (dotted black line) using
astropy.convolution.Gaussian1DKernel, which is used for the derivative
spectroscopy (right panel), the location and amplitude of the initial guesses
determined from derivative spectroscopy (black lollipops) and supplied to
specfit, the best fitting model solution (green and magenta lines indicate
individual components and the total model), the residual spectrum after
subtracting the model (orange line), and the $3\sigma$ noise level determined
from ScousePy.getnoise. The top-right panel shows the first to fourth
derivatives of the smoothed spectrum (dotted black line). These derivatives
are used to estimate the number of components and their amplitudes, widths,
and centroids (ScousePy.DSpec). The information panel at the bottom shows the
output information from pyspeckit. This information includes the model
parameters and their uncertainties and goodness-of-fit statistics. The buttons
on the right can be used to control pyspeckit either non-interactively using
“fit (dspec)” or interactively using “fit (manual)”.


# Sidon sets for linear forms

Melvyn B. Nathanson  Lehman College (CUNY), Bronx, New York 10468
<EMAIL_ADDRESS>
###### Abstract.

Let $\varphi(x_{1},\ldots,x_{h})=c_{1}x_{1}+\cdots+c_{h}x_{h}$ be a linear
form with coefficients in a field $\mathbf{F}$, and let $V$ be a vector space
over $\mathbf{F}$. A nonempty subset $A$ of $V$ is a _$\varphi$ -Sidon set_ if
$\varphi(a_{1},\ldots,a_{h})=\varphi(a^{\prime}_{1},\ldots,a^{\prime}_{h})$
implies $(a_{1},\ldots,a_{h})=(a^{\prime}_{1},\ldots,a^{\prime}_{h})$ for all
$h$-tuples $(a_{1},\ldots,a_{h})\in A^{h}$ and
$(a^{\prime}_{1},\ldots,a^{\prime}_{h})\in A^{h}$. There exist infinite Sidon
sets for the linear form $\varphi$ if and only if the set of coefficients of
$\varphi$ has distinct subset sums. In a normed vector space with
$\varphi$-Sidon sets, every infinite sequence of vectors is asymptotic to a
$\varphi$-Sidon set of vectors. Results on $p$-adic perturbations of
$\varphi$-Sidon sets of integers and bounds on the growth of $\varphi$-Sidon
sets of integers are also obtained.

###### Key words and phrases:

Sidon set, sumset, sum of dilates, distinct subset sums, representation
functions.

###### 2010 Mathematics Subject Classification:

11B13, 11B34, 11B75, 11P99

Supported in part by a grant from the PSC-CUNY Research Award Program.

##  1\. Linear forms with property $N$

Let $\mathbf{F}$ be a field and let $h$ be a positive integer. We consider
linear forms

(1) $\varphi(x_{1},\ldots,x_{h})=c_{1}x_{1}+\cdots+c_{h}x_{h}$

where $c_{i}\in\mathbf{F}$ for all $i\in\\{1,\ldots,h\\}$.

Let $V$ be a vector space over the field $\mathbf{F}$. For every subset
nonempty $A$ of $V$, let

$A^{h}=\left\\{(a_{1},\ldots,a_{h}):a_{i}\in A\text{ for all
}i\in\\{1,\ldots,h\\}\right\\}$

be the set of all $h$-tuples of elements of $A$. For $c\in\mathbf{F}$, the
_$c$ -dilate_ of $A$ is the set

$c\ast A=\\{ca:a\in A\\}.$

The _$\varphi$ -image of $A$_ is the set

$\displaystyle\varphi(A)$
$\displaystyle=\left\\{\varphi(a_{1},\ldots,a_{h}):(a_{1},\ldots,a_{h})\in
A^{h}\right\\}$
$\displaystyle=\left\\{c_{1}a_{1}+\cdots+c_{h}a_{h}:(a_{1},\ldots,a_{h})\in
A^{h}\right\\}$ $\displaystyle=c_{1}\ast A+\cdots+c_{h}\ast A.$

Thus, $\varphi(A)$ is a sum of dilates. We define
$\varphi(\emptyset)=\\{0\\}$.

A nonempty subset $A$ of $V$ is a _Sidon set for the linear form $\varphi$_
or, simply, a _$\varphi$ -Sidon set_ if it satisfies the following property:
For all $h$-tuples $(a_{1},\ldots,a_{h})\in A^{h}$ and
$(a^{\prime}_{1},\ldots,a^{\prime}_{h})\in A^{h}$, if

$\varphi(a_{1},\ldots,a_{h})=\varphi(a^{\prime}_{1},\ldots,a^{\prime}_{h})$

then $(a_{1},\ldots,a_{h})=(a^{\prime}_{1},\ldots,a^{\prime}_{h})$, that is,
$a_{i}=a^{\prime}_{i}$ for all $i\in\\{1,\ldots,h\\}$. Thus, $A$ is a
$\varphi$-Sidon set if the linear form $\varphi$ is one-to-one on $A^{h}$.

Two cases of special interest are $V=\mathbf{F}$ with $\varphi$-Sidon sets
contained in $\mathbf{F}$, and $V=\mathbf{F}=\mathbf{Q}$ with $\varphi$-Sidon
sets of positive integers.

For the linear form $\varphi=\sum_{i=1}^{h}c_{i}x_{i}$, every set with one
element is a $\varphi$-Sidon set. There is a simple obstruction to the
existence of $\varphi$-Sidon sets with more than one element. For every
nonempty subset $I$ of $\\{1,\ldots,h\\}$, define the _subset sum_

(2) $s(I)=\sum_{i\in I}c_{i}.$

Let $s({\emptyset})=0$. Suppose there exist disjoint subsets $I_{1}$ and
$I_{2}$ of $\\{1,\ldots,h\\}$ with $I_{1}$ and $I_{2}$ not both empty such
that

(3) $s({I_{1}})=\sum_{i\in I_{1}}c_{i}=\sum_{i\in I_{2}}c_{i}=s({I_{2}}).$

Let $I_{3}=\\{1,\ldots,h\\}\setminus(I_{1}\cup I_{2})$. Let $A$ be a subset of
$V$ with $|A|\geq 2$. Choose vectors $u,v,w\in A$ with $u\neq v$, and define

$a_{i}=\begin{cases}u&\text{ if $i\in I_{1}$}\\\ v&\text{ if $i\in I_{2}$}\\\
w&\text{ if $i\in I_{3}$}\end{cases}$

and

$a^{\prime}_{i}=\begin{cases}v&\text{ if $i\in I_{1}$ }\\\ u&\text{ if $i\in
I_{2}$}\\\ w&\text{ if $i\in I_{3}$.}\end{cases}$

We have

$(a_{1},\ldots,a_{h})\neq(a^{\prime}_{1},\ldots,a^{\prime}_{h})$

because $I_{1}\cup I_{2}\neq\emptyset$ and $a_{i}\neq a^{\prime}_{i}$ for all
$i\in I_{1}\cup I_{2}$.

The sets $I_{1}$, $I_{2}$, $I_{3}$ are pairwise disjoint. Condition (3)
implies

$\displaystyle\varphi(a_{1},\ldots,a_{h})$ $\displaystyle=\sum_{i\in
I_{1}}c_{i}a_{i}+\sum_{i\in I_{2}}c_{i}a_{i}+\sum_{i\in I_{3}}c_{i}a_{i}$
$\displaystyle=\left(\sum_{i\in I_{1}}c_{i}\right)u+\left(\sum_{i\in
I_{2}}c_{i}\right)v+\left(\sum_{i\in I_{3}}c_{i}\right)w$
$\displaystyle=\left(\sum_{i\in I_{2}}c_{i}\right)u+\left(\sum_{i\in
I_{1}}c_{i}\right)v+\left(\sum_{i\in I_{3}}c_{i}\right)w$
$\displaystyle=\sum_{i\in I_{1}}c_{i}a^{\prime}_{i}+\sum_{i\in
I_{2}}c_{i}a^{\prime}_{i}+\sum_{i\in I_{3}}c_{i}a^{\prime}_{i}$
$\displaystyle=\varphi(a^{\prime}_{1},\ldots,a^{\prime}_{h})$

and so $A$ is not a $\varphi$-Sidon set.

We say that the linear form (1) has _property $N$_ if there do _not_ exist
disjoint subsets $I_{1}$ and $I_{2}$ of $\\{1,\ldots,h\\}$ that satisfy
condition (3) with $I_{1}$ and $I_{2}$ not both empty. If the linear form
$\varphi=\sum_{i=1}^{h}c_{i}x_{i}$ has property $N$, then

$\sum_{i\in I_{1}}c_{i}=s(I_{1})\neq s({\emptyset})=0$

for every nonempty subset $I_{1}$ of $\\{1,\ldots,h\\}$. In particular,
choosing $I_{1}=\\{i\\}$ shows that $c_{i}\neq 0$ for all
$i\in\\{1,\ldots,h\\}$.

For example, if $h\geq 1$ and $c_{i}=2^{i-1}$ for all $i\in\\{1,\ldots,h\\}$,
then the linear form

$\varphi=\sum_{i=1}^{h}c_{i}x_{i}=x_{1}+2x_{2}+4x_{3}+\cdots+2^{h-1}x_{h}$

has property $N$.

If $h\geq 2$ and $c_{i}=1$ for all $i\in\\{1,\ldots,h\\}$, then the linear
form

$\psi=\sum_{i=1}^{h}c_{i}x_{i}=x_{1}+x_{2}+x_{3}+\cdots+x_{h}$

does not have property $N$ because the nonempty disjoint sets $I_{1}=\\{1\\}$
and $I_{2}=\\{2\\}$ satisfy

$\sum_{i\in I_{1}}c_{i}=c_{1}=1=c_{2}=\sum_{i\in I_{2}}c_{i}.$

In Section 3 we prove that, for every infinite vector space $V$, there exist
infinite $\varphi$-Sidon sets for the linear form $\varphi$ if and only if
$\varphi$ has property $N$.

For related work on additive number theory for linear forms, see Bukh[2] and
Nathanson [12, 13, 14, 15, 16, 18].

Let $\varphi(x_{1},\ldots,x_{h})=c_{1}x_{1}+\cdots+c_{h}x_{h}$, where
$c_{i}\in\mathbf{F}$ for $i\in\\{1,2,\ldots,h\\}$. Let $J_{1}$ and $J_{2}$ be
distinct subsets of $\\{1,2,\ldots,h\\}$ such that $\sum_{i\in
J_{1}}c_{i}=\sum_{i\in J_{2}}c_{i}$ and let $J=J_{1}\cap J_{2}$. The sets
$I_{1}=J_{1}\setminus J$ and $I_{2}=J_{2}\setminus J$ are distinct and
disjoint subsets of $\\{1,2,\ldots,h\\}$. Moreover, $\sum_{i\in
I_{1}}c_{i}=\sum_{i\in I_{2}}c_{i}$. It follows that the linear form $\varphi$
has property $N$ if and only if the set $\\{c_{1},\ldots,c_{h}\\}$ has
distinct subset sums.

Let $g(n)$ be the size of the largest subset of $\\{1,2,\ldots,n\\}$ that has
distinct subset sums. A famous unsolved problem of Paul Erdős and Leo Moser
asks if

$g(n)=\frac{\log n}{\log 2}+O(1).$

See Erdős [5, pp. 136–137], Guy [6, Section C8], and Dubroff, Fox, and Xu [4].

##  2\. Classical Sidon sets

The idea of a Sidon set for a linear form derives from the classical
definition of a Sidon set of integers. In additive number theory, a _Sidon
set_ (also called a $B_{2}$-set) is a set $A$ of positive integers such that,
if $a_{1},a_{2},a^{\prime}_{1},a^{\prime}_{2}\in A$ and

$a_{1}+a_{2}=a^{\prime}_{1}+a^{\prime}_{2}$

then $\\{a_{1},a_{2}\\}=\\{a^{\prime}_{1},a^{\prime}_{2}\\}$. More generally,
let $G$ be an additive abelian group or semigroup, and let $A$ be a subset of
$G$. For $h\geq 2$, the _$h$ -fold sumset_ of $A$ is the set $hA$ of all sums
of $h$ not necessarily distinct elements of $A$. A nonempty set $A$ is an _$h$
-Sidon set_ (or a $B_{h}$-set) if every element of the sumset $hA$ has an
essentially unique representation as the sum of $h$ elements of $A$, in the
following sense: If $\\{a_{i}:i\in I\\}$ is a set of pairwise distinct
elements of $A$ and if $\\{u_{i}:i\in I\\}$ and $\\{v_{i}:i\in I\\}$ are sets
of nonnegative integers such that

$h=\sum_{i\in I}u_{i}=\sum_{i\in I}v_{i}$

and

$\sum_{i\in I}u_{i}a_{i}=\sum_{i\in I}v_{i}a_{i}$

then $u_{i}=v_{i}$ for all $i\in I$.

The sumset $hA$ is associated with the linear form

$\psi=\psi(x_{1},\ldots,x_{h})=x_{1}+\cdots+x_{h}$

and

$hA=\psi(A)=\left\\{a_{1}+\cdots+a_{h}:a_{i}\in A\text{ for all
}i\in\\{1,\ldots,h\\}\right\\}.$

The linear form $\psi$ does not satisfy condition $N$, and there exists no
$\psi$-Sidon set $A$ with $\operatorname{\text{card}}(A)\geq 2$.

The literature on classical Sidon sets is huge. Two surveys of results on
classical Sidon sets are Halberstam and Roth [7] and O’Bryant [19]. For recent
work, see [3, 8, 9, 10, 11, 20, 21, 23, 25].

##  3\. Contractions of linear forms

Let $\mathbf{F}$ be a field and let $\varphi=\sum_{i=1}^{h}c_{i}x_{i}$ be a
linear form in $h$ variables with coefficients $c_{i}\in\mathbf{F}$.
Associated to every subset $J$ of $\\{1,\ldots,h\\}$ is the linear form in
$\operatorname{\text{card}}(J)$ variables

$\varphi_{J}=\sum_{j\in J}c_{j}x_{j}.$

We have $\varphi_{\emptyset}=0$ and $\varphi_{J}=\varphi$ if
$J=\\{1,\ldots,h\\}$. The linear form $\varphi_{J}$ is called a _contraction_
of the linear form $\varphi$.

Let $V$ be a vector space over the field $\mathbf{F}$. For every nonempty
subset $A$ of $V$, let

$\varphi_{J}(A)=\left\\{\sum_{j\in J}c_{j}a_{j}:a_{j}\in A\text{ for all }j\in
J\right\\}.$

If $A$ is a $\varphi$-Sidon set, then $A$ is a $\varphi_{J}$-Sidon set for
every nonempty subset $J$ of $\\{1,\ldots,h\\}$.

For every subset $X$ of $V$ and vector $v\in V$, the _translate_ of $X$ by $v$
is the set

$X+v=\\{x+v:x\in X\\}.$

For every subset of $J$ of $\\{1,\ldots,h\\}$, let
$J^{c}=\\{1,\ldots,h\\}\setminus J$ be the complement of $J$ in
$\\{1,\ldots,h\\}$. For every subset $A$ of $V$ and $b\in V\setminus A$, we
define

(4) $\Phi_{J}(A,b)=\varphi_{J}(A)+\left(\sum_{j\in
J^{c}}c_{j}\right)b=\varphi_{J}(A)+s(J^{c})b$

be the translate of the set $\varphi_{J}(A)$ by the subset sum $s(J^{c})b$. We
have $\Phi_{\emptyset}(A,b)=\left(\sum_{j=1}^{h}c_{j}\right)b$ and
$\Phi_{J}(A,b)=\varphi(A)$ if $J=\\{1,\ldots,h\\}$.

######  Lemma 1.

Let $\varphi=\sum_{i=1}^{h}c_{i}x_{i}$ be a linear form with coefficients in
the field $\mathbf{F}$. Let $V$ be a vector space over $\mathbf{F}$. For every
subset $A$ of $V$ and $b\in V\setminus A$,

(5)
$\varphi\left(A\cup\\{b\\}\right)=\bigcup_{J\subseteq\\{1,\ldots,h\\}}\Phi_{J}(A,b).$

If $A\cup\\{b\\}$ is a $\varphi$-Sidon set, then

(6) $\left\\{\Phi_{J}(A,b):J\subseteq\\{1,\ldots,h\\}\right\\}$

is a set of pairwise disjoint sets.

If $A$ is a $\varphi$-Sidon set and (6) is a set of pairwise disjoint sets,
then $A\cup\\{b\\}$ is a $\varphi$-Sidon set.

###### Proof.

If $w\in\varphi\left(A\cup\\{b\\}\right)$, then there exist vectors
$v_{1},\ldots,v_{h}\in A\cup\\{b\\}$ such that

$w=\varphi(v_{1},\ldots,v_{h})=\sum_{i=1}^{h}c_{i}v_{i}.$

Let $J=\\{j\in\\{1,\ldots,h\\}:v_{j}=a_{j}\in A$. We have
$J^{c}=\\{j\in\\{1,\ldots,h\\}:v_{j}=b\\}$ and

$\displaystyle w$ $\displaystyle=\sum_{i=1}^{h}c_{i}v_{i}=\sum_{j\in
J}c_{j}a_{j}+\sum_{j\in
J^{c}}c_{j}b\in\varphi_{J}(A)+s(J^{c})b=\Phi_{J}(A,b).$

Conversely, if $w\in\Phi_{J}(A,b)$ for some $J=\\{j\in\\{1,\ldots,h\\}$, then
there exist $a_{j}\in A$ for all $j\in J$ such that

$w=\sum_{j\in J}c_{j}a_{j}+\sum_{j\in
J^{c}}c_{j}b\in\varphi\left(A\cup\\{b\\}\right).$

This proves (5). It follows that if $A\cup\\{b\\}$ is a $\varphi$-Sidon set,
then (6) is a set of pairwise disjoint sets.

Suppose that $A$ is a Sidon set and that the sets $\Phi_{J}(A,b)$ are pairwise
disjoint for all $J\subseteq\\{1,\ldots,h\\}$. Let
$u_{1},\ldots,u_{h},v_{1},\ldots,v_{h}\in A\cup\\{b\\}$. Consider the sets

$J_{1}=\\{j\in\\{1,\ldots,h\\}:u_{j}\neq
b\\}\operatorname{\qquad\text{and}\qquad}J_{2}=\\{j\in\\{1,\ldots,h\\}:v_{j}\neq
b\\}$

and the complementary sets

$J_{1}^{c}=\\{j\in\\{1,\ldots,h\\}:u_{j}=b\\}\operatorname{\qquad\text{and}\qquad}J_{2}^{c}=\\{j\in\\{1,\ldots,h\\}:v_{j}=b\\}.$

We have

$\varphi(u_{1},\ldots,u_{h})=\sum_{j\in J_{1}}c_{j}u_{j}+\left(\sum_{j\in
J_{1}^{c}}c_{j}\right)b\in\Phi_{J_{1}}(A,b)$

and

$\varphi(v_{1},\ldots,v_{h})=\sum_{j\in J_{2}}c_{j}v_{j}+\left(\sum_{j\in
J_{2}^{c}}c_{j}\right)b\in\Phi_{J_{2}}(A,b).$

If $J_{1}\neq J_{2}$, then $\Phi_{J_{1}}(A,b)\cap\Phi_{J_{2}}(A,b)=\emptyset$
and $\varphi(u_{1},\ldots,u_{h})\neq\varphi(v_{1},\ldots,v_{h})$.

If $J_{1}=J_{2}=\emptyset$, then
$(u_{1},\ldots,u_{h})=(b,\ldots,b)=(v_{1},\ldots,v_{h})$.

If $J_{1}=J_{2}\neq\emptyset$, then $J_{1}^{c}=J_{2}^{c}$ and

$\sum_{j\in J_{1}^{c}}c_{j}=\sum_{j\in J_{2}^{c}}c_{j}.$

It follows that

$\sum_{j\in J_{1}}c_{j}u_{j}=\sum_{j\in J_{1}}c_{j}v_{j}.$

Because $A$ is a $\varphi_{J_{1}}$-Sidon set, we have $u_{j}=v_{j}$ for all
$j\in J_{1}$, hence $u_{i}=v_{i}$ for all $i\in\\{1,\ldots,h\\}$. Thus, if $A$
is a Sidon set and the sets $\Phi_{J}(A,b)$ are pairwise disjoint, then
$A\cup\\{b\\}$ is a $\varphi$-Sidon set. This completes the proof. ∎

######  Lemma 2.

Let $\varphi=\sum_{i=1}^{h}c_{i}x_{i}$ be a linear form with coefficients in
the field $\mathbf{F}$. Let $V$ be a vector space over $\mathbf{F}$, let $X$
be an infinite subset of $V$, and let $B$ be a finite subset of $X$. If the
linear form $\varphi$ has property $N$, then there exists $b\in X$ such that,
for all subsets $J$ of $\\{1,\ldots,h\\}$, the sets $\Phi_{J}(B,b)$ are
pairwise disjoint.

###### Proof.

Let $J_{1}$ and $J_{2}$ be distinct subsets of $\\{1,\ldots,h\\}$. For all
$x\in X$, we have

(7) $\Phi_{J_{1}}(B,x)\cap\Phi_{J_{2}}(B,x)\neq\emptyset$

if and only if there exist elements $b_{1,j}\in B$ for all $j\in J_{1}$ and
$b_{2,j}\in B$ for all $j\in J_{2}$ such that

(8) $\sum_{j\in J_{1}}c_{j}b_{1,j}+\left(\sum_{j\in
J^{c}_{1}}c_{j}\right)x=\sum_{j\in J_{2}}c_{j}b_{2,j}+\left(\sum_{j\in
J^{c}_{2}}c_{j}\right)x.$

Let $K=J^{c}_{1}\cap J^{c}_{2}$. The sets $I_{1}=J^{c}_{1}\setminus K$ and
$I_{2}=J^{c}_{2}\setminus K$ are disjoint. If $I_{1}=I_{2}=\emptyset$, then
$J^{c}_{1}=K=J^{c}_{2}$ and $J_{1}=J_{2}$, which is absurd. Therefore, $I_{1}$
and $I_{2}$ are disjoint sets, not both empty.

Because the linear form $\varphi$ has property $N$, we have

$\sum_{j\in I_{1}}c_{j}\neq\sum_{j\in I_{2}}c_{j}$

and so

$c=\sum_{j\in I_{2}}c_{j}-\sum_{j\in I_{1}}c_{j}\neq 0.$

Thus, $c\in\mathbf{F}\setminus\\{0\\}$ and so $c$ is invertible in
$\mathbf{F}$. From (8) we obtain

$\displaystyle\sum_{j\in J_{1}}c_{j}b_{1,j}-\sum_{j\in J_{2}}c_{j}b_{2,j}$
$\displaystyle=\left(\sum_{j\in J^{c}_{2}}c_{j}\right)x-\left(\sum_{j\in
J^{c}_{1}}c_{j}\right)x$ $\displaystyle=\left(\sum_{j\in
I_{2}}c_{j}-\sum_{j\in I_{1}}c_{j}\right)x$ $\displaystyle=cx$

and so

(9) $x=c^{-1}\left(\sum_{j\in I_{1}}c_{j}b_{1,j}-\sum_{j\in
I_{2}}c_{j}b_{2,j}\right).$

Because the set $B$ is finite, the set $B^{\prime}$ of elements in $X$ of the
form (9) is also finite. Because the set $X$ is infinite, the set
$X\setminus(B\cup B^{\prime})$ is infinite. For all $b\in X\setminus(B\cup
B^{\prime})$, the set $\\{\Phi_{J}(B,b):J\subseteq\\{1,\ldots,h\\}\\}$
consists of pairwise disjoint sets. This completes the proof. ∎

######  Theorem 1.

Let $\mathbf{F}$ be a field, let $V$ be an infinite vector space over the
field $\mathbf{F}$, and let $X$ be an infinite subset of $V$. Let
$\varphi(x_{1},\ldots,x_{h})=\sum_{i=1}^{h}c_{i}x_{i}$ be a linear form with
nonzero coefficients $c_{i}\in\mathbf{F}$. The following are equivalent:

  1. (i)

The set $X$ contains an infinite $\varphi$-Sidon set $A$.

  2. (ii)

The set $X$ contains a $\varphi$-Sidon set $A$ with $|A|\geq 2$.

  3. (iii)

The linear form $\varphi$ has property $N$.

###### Proof.

Condition (i) implies (ii). It was proved in Section 1 that (ii) implies
(iii). We shall prove that (iii) implies (i).

Suppose that the linear form $\varphi$ has property $N$. We construct
inductively an infinite $\varphi$-Sidon set $A$ contained in $X$. For all
$a_{1}\in X$, the set $A_{1}=\\{a_{1}\\}$ is a $\varphi$-Sidon set, because
every set with one element is $\varphi$-Sidon. Let
$A_{n}=\\{a_{1},\ldots,a_{n}\\}$ be a $\varphi$-Sidon set $A$ contained in
$X$. By Lemma 2, there exists $a_{n+1}\in X$ such that

$\Phi_{J_{1}}(A_{n},a_{n+1})\cap\Phi_{J_{2}}(A_{n},a_{n+1})=\emptyset$

if $J_{1}$ and $J_{2}$ are distinct subsets of $\\{1,\ldots,h\\}$. It follows
from Lemma 1 that the set $A_{n+1}=A_{n}\cup\\{a_{n+1}\\}$ is a
$\varphi$-Sidon set. This completes the proof. ∎

##  4\. Perturbations of linear forms

An absolute value on a field $\mathbf{F}$ is a function $|\
|:\mathbf{F}\rightarrow\mathbf{R}$ such that

  1. (i)

$|c|\geq 0$ for all $c\in\mathbf{F}$, and $|c|=0$ if and only if $c=0$,

  2. (ii)

$|c_{1}c_{2}|=|c_{1}|\ |c_{2}|$ for all $c_{1},c_{2}\in\mathbf{F}$,

  3. (ii)

$|c_{1}+c_{2}|\leq|c_{1}|+|c_{2}|$ for all $c_{1},c_{2}\in\mathbf{F}$.

The absolute value $|\ |$ on $\mathbf{F}$ is _trivial_ if $|c|=1$ for all
$c\neq 0$, and _nontrivial_ if $|c|\neq 1$ for some $c\neq 0$. The usual
absolute value and the $p$-adic absolute values are the nontrivial absolute
values on $\mathbf{Q}$.

Let $V$ be a vector space over $\mathbf{F}$. A _norm_ on $V$ with respect to
an absolute value $|\ |$ on $\mathbf{F}$ is a function $\|\
\|:V\rightarrow\mathbf{R}$ such that

  1. (i)

$\|v\|\geq 0$ for all $v\in V$, and $\|v\|=0$ if and only if $v=0$,

  2. (ii)

$\|cv\|=|c|\ \|v\|$ for all $c\in\mathbf{F}$ and $v\in V$,

  3. (iii)

$\|v+w\|\leq\|v\|+\|w\|$ for all $v,w\in V$.

For example, if $|\ |$ is an absolute value on $\mathbf{F}$ and
$V=\mathbf{F}^{n}$, then, for every vector
$\mathbf{x}=\operatorname{\left(\begin{smallmatrix}x_{1}\\\ \vdots\\\
x_{n}\end{smallmatrix}\right)}\in V$, the functions

$\|\mathbf{x}\|_{1}=\sum_{j=1}^{n}|x_{j}|$

and

$\|\mathbf{x}\|_{\infty}=\max\\{|x_{j}|:j=1,\ldots,n\\}$

are norms on $V$ with respect to $|\ |$.

If $|\ |$ is a nontrivial absolute value on $\mathbf{F}$, then there exists
$c\in\mathbf{F}$ with $|c|\neq 0$ and $|c|\neq 1$. If $|c|>1$, then
$0<|1/c|=1/|c|<1$. If $0<|c_{0}|<1$, then

$0<\left|c_{0}^{n+1}\right|=\left|c_{0}\right|^{n+1}<\left|c_{0}\right|^{n}=\left|c_{0}^{n}\right|$

for all $n\in\mathbf{N}$. Thus, the field $\mathbf{F}$ is infinite and

(10)
$\inf\\{|c|:c\in\mathbf{F}\setminus\\{0\\}\\}=\inf\\{|c_{0}^{n}|:n=1,2,3,\ldots\\}=0.$

Let $V$ be a nonzero normed vector space with respect to a nontrivial absolute
value on the field $\mathbf{F}$. Let $v_{0}\in V\setminus\\{0\\}$. Let
$c_{0}\in\mathbf{F}$ with $0<|c_{0}|<1$. For all $n\in\mathbf{N}$ we have
$c_{0}^{n}v_{0}\neq 0$ and

$0<\left\|c_{0}^{n+1}v_{0}\right\|=\left|c_{0}^{n+1}\right|\left\|v_{0}\right\|<\left|c_{0}^{n}\right|\left\|v_{0}\right\|=\left\|c_{0}^{n}v_{0}\right\|$

Thus, the vector space $V$ is infinite and

(11) $\inf\\{|x|:x\in
V\setminus\\{0\\}\\}=\inf\\{|c_{0}^{n}v_{0}|:n=1,2,3,\ldots\\}=0.$

######  Lemma 3.

Let $\mathbf{F}$ be a field with a nontrivial absolute value. Let $V$ be a
nonzero vector space over $\mathbf{F}$ that has a norm with respect to the
absolute value on $\mathbf{F}$. Let $A^{\prime}$ be a finite subset of $V$ and
let $b\in V$.

Let $\varphi=\sum_{i=1}^{h}c_{i}x_{i}$ be a linear form with coefficients
$c_{i}\in\mathbf{F}$. If the linear form $\varphi$ has property $N$, then for
every $\varepsilon>0$ there are infinitely many nonzero vectors $a\in V$ such
that

$\|a-b\|<\varepsilon$

and, for all subsets $J$ of $\\{1,\ldots,h\\}$, the sets

$\Phi_{J}(A^{\prime},a)=\varphi_{J}(A^{\prime})+\left(\sum_{j\in
J^{c}}c_{j}\right)a$

are pairwise disjoint.

###### Proof.

If $A^{\prime}=\emptyset$, then $\varphi_{J}(A^{\prime})=\\{0\\}$ for all
$J\subseteq\\{1,\ldots,h\\}$ and
$\Phi_{J}(A^{\prime},a)=\left\\{\left(\sum_{j\in
J^{c}}c_{j}\right)a\right\\}$. Because $\varphi$ has property $N$, for every
nonzero vector $a\in V$ the vectors $\left(\sum_{j\in
J^{c}}c_{j}\right)a=s(J^{c})a$ are distinct and so the sets
$\Phi_{J}(A^{\prime},a)$ are pairwise disjoint. Choose any of the infinitely
many nonzero vectors $a$ such that $\|a-b\|<\varepsilon$.

Let $A^{\prime}\neq\emptyset$ and $x\in V$. For distinct subsets $J_{1}$ and
$J_{2}$ of $\\{1,\ldots,h\\}$, we have

(12)
$\Phi_{J_{1}}(A^{\prime},b+x)\cap\Phi_{J_{2}}(A^{\prime},b+x)\neq\emptyset$

if and only if there exist vectors $a_{1,j}\in A^{\prime}$ for all $j\in
J_{1}$ and $a_{2,j}\in A^{\prime}$ for all $j\in J_{2}$ such that

(13) $\sum_{j\in J_{1}}c_{j}a_{1,j}+\sum_{j\in J^{c}_{1}}c_{j}(b+x)=\sum_{j\in
J_{2}}c_{j}a_{2,j}+\sum_{j\in J^{c}_{2}}c_{j}(b+x).$

Let $K=J^{c}_{1}\cap J^{c}_{2}$. The sets $I_{1}=J^{c}_{1}\setminus K$ and
$I_{2}=J^{c}_{2}\setminus K$ are disjoint. If $I_{1}=I_{2}=\emptyset$, then
$K=J^{c}_{1}=J^{c}_{2}$ and so $J_{1}=J_{2}$, which is absurd. Therefore, the
sets $I_{1}$ and $I_{2}$ are disjoint sets, not both empty.

Because the linear form $\varphi$ has property $N$, we have

$\sum_{j\in I_{1}}c_{j}=s(I_{1})\neq s(I_{2})=\sum_{j\in I_{2}}c_{j}$

and so

$c=\sum_{j\in I_{2}}c_{j}-\sum_{j\in I_{1}}c_{j}\neq 0.$

Thus, the scalar $c$ is invertible in $\mathbf{F}$. From (13) we obtain

$\displaystyle\sum_{j\in J_{1}}c_{j}a_{1,j}-\sum_{j\in J_{2}}c_{j}a_{2,j}$
$\displaystyle=\sum_{j\in J^{c}_{2}}c_{j}(b+x)-\sum_{j\in
J^{c}_{1}}c_{j}(b+x)$ $\displaystyle=\sum_{j\in I_{2}}c_{j}(b+x)-\sum_{j\in
I_{1}}c_{j}(b+x)$ $\displaystyle=\left(\sum_{j\in I_{2}}c_{j}-\sum_{j\in
I_{1}}c_{j}\right)(b+x)$ $\displaystyle=c(b+x)$

and

(14) $x=c^{-1}\left(\sum_{j\in J_{1}}c_{j}a_{1,j}-\sum_{j\in
J_{2}}c_{j}a_{2,j}\right)-b.$

Because the set $A^{\prime}$ is nonempty and finite, the set $X$ of vectors
$x$ in $V$ of the form (14) is also nonempty and finite. If $X=\\{0\\}$, let
$\delta=1$. If $X\neq\\{0\\}$, let

(15) $\delta=\min\\{\|x\|:x\in X\setminus\\{0\\}\\}>0$

and let

(16) $\varepsilon^{\prime}=\min(\delta,\varepsilon)>0.$

By (11), there are infinitely many vectors $x_{0}$ in $V$ such that

(17) $0<\|x_{0}\|<\varepsilon^{\prime}.$

It follows from (15) and (16) that each such vector satisfies $x_{0}\notin X$,
and so

$\Phi_{J_{1}}(A^{\prime},b+x_{0})\cap\Phi_{J_{2}}(A^{\prime},b+x_{0})=\emptyset$

for all distinct subsets $J_{1}$ and $J_{2}$ of $\\{1,\ldots,h\\}$. Choosing
$a=b+x_{0}$ completes the proof. ∎

Let $\mathbf{F}$ be a field with a nontrivial absolute value, and let $V$ be a
vector space over $\mathbf{F}$ that has a norm with respect to the absolute
value on $\mathbf{F}$. Let $\mathbf{N}=\\{1,2,3,\ldots\\}$ be the set of
positive integers. Let $A=\\{a_{k}:k\in\mathbf{N}\\}$ and
$B=\\{b_{k}:k\in\mathbf{N}\\}$ be sets of not necessarily distinct vectors in
$V$. Let $\varepsilon=\\{\varepsilon_{k}:k\in\mathbf{N}\\}$ be a set of
positive real numbers. The set $B$ is an _$\varepsilon$ -perturbation_ of the
set $A$ if

$\|a_{k}-b_{k}\|<\varepsilon_{k}$

for all $k\in\mathbf{N}$.

######  Theorem 2.

Let $\mathbf{F}$ be a field with a nontrivial absolute value and let $V$ be a
vector space over $\mathbf{F}$ that has a norm with respect to the absolute
value on $\mathbf{F}$. Let $\varepsilon=\\{\varepsilon_{k}:k=1,2,3,\ldots\\}$
be a set of positive real numbers. Let $\varphi$ be a linear form with
coefficients in $\mathbf{F}$ that has property $N$. For every set
$B=\\{b_{k}:k=1,2,3,\ldots\\}$ of vectors in $V$, there is a $\varphi$-Sidon
set $A=\\{a_{k}:k=1,2,3,\ldots\\}$ of vectors in $V$ such that

(18) $\|a_{k}-b_{k}\|<\varepsilon_{k}$

for all $k=1,2,3,\ldots$.

###### Proof.

We construct the set $A$ inductively. Begin by choosing $a_{1}=b_{1}$. Every
set with one element is a $\varphi$-Sidon set, and so $A_{1}=\\{a_{1}\\}$ is a
$\varphi$-Sidon set such that $\|a_{1}-b_{1}\|=0<\varepsilon_{1}$.

Let $n\geq 1$, and let $A_{n}=\\{a_{1},\ldots,a_{n}\\}$ be a $\varphi$-Sidon
set that satisfies inequality (18) for all $k\in\\{1,\ldots,n\\}$. Applying
Lemma 3 to the finite set $A^{\prime}=A_{n}$ and the vector $b=b_{n+1}$, we
obtain a vector $a_{n+1}\in V$ such that
$\|a_{n+1}-b_{n+1}\|<\varepsilon_{n+1}$ and the sets $\Phi_{J}(A_{n},a_{n+1})$
are pairwise disjoint for all $J\subseteq\\{1,\ldots,h\\}$. The set $A_{n}$ is
$\varphi$-Sidon, and so, by Lemma 1, the set $A_{n+1}=A_{n}\cup\\{a_{n+1}\\}$
is a $\varphi$-Sidon set. This completes the proof. ∎

######  Theorem 3.

Let $\mathbf{F}$ be a field with a nontrivial absolute value, and let
$\varphi$ be a linear form with coefficients in $\mathbf{F}$ that has property
$N$. Let $V$ be a vector space over $\mathbf{F}$ that has a norm with respect
to absolute value on $\mathbf{F}$. For every set
$B=\\{b_{k}:k=1,2,3,\ldots\\}$ of vectors in $V$, there exists a
$\varphi$-Sidon set $A=\\{a_{k}:k=1,2,3,\ldots\\}$ in $V$ such that

$\lim_{k\rightarrow\infty}\|a_{k}-b_{k}\|=0.$

###### Proof.

This follows fromTheorem 2 applied to any sequence
$\varepsilon=\\{\varepsilon_{k}:k=1,2,3,\ldots\\}$ of positive numbers such
that $\lim_{k\rightarrow\infty}\varepsilon_{k}=0$. ∎

##  5\. $p$-adic $\varphi$-Sidon sets

Let $\mathbf{P}=\\{2,3,5,\ldots\\}$ be the set of prime numbers. For every
prime number $p$, let $|\ |_{p}$ be the usual $p$-adic absolute value with
$|p|_{p}=1/p$. Every integer $r$ satisfies $|r|_{p}\leq 1$.

######  Lemma 4.

Let $\varphi=\sum_{i=1}^{h}c_{i}x_{i}$ be a linear form with rational
coefficients $c_{i}$ that satisfies property $N$. Let $\mathbf{P}_{0}$ be a
nonempty finite set of prime numbers. Let $A^{\prime}$ be a finite set of
integers and let $b$ be an integer. For every $\varepsilon>0$ there are
infinitely many positive integers $a$ such that

$|a-b|_{p}<\varepsilon$

for all $p\in\mathbf{P}_{0}$ and the sets

$\Phi_{J}(A^{\prime},a)=\varphi_{J}(A^{\prime})+\left(\sum_{j\in
J^{c}}c_{j}\right)a$

are pairwise disjoint for all subsets $J$ of $\\{1,\ldots,h\\}$.

###### Proof.

Let $\varepsilon^{\prime}>0$. Choose a positive integer $k$ such that

$\frac{1}{2^{k}}<\varepsilon^{\prime}.$

The integer $b$ is not necessarily positive, but for all sufficiently large
positive integers $r$ we have

(19) $a=b+r\prod_{p\in\mathbf{P}_{0}}p^{k}>0.$

Let $p\in\mathbf{P}_{0}$. For all integers $r$ satisfying (19) we have

$|a-b|_{p}=|r|_{p}\prod_{p\in\mathbf{P}_{0}}|p^{k}|_{p}\leq|p^{k}|_{p}=\frac{1}{p^{k}}\leq\frac{1}{2^{k}}<\varepsilon^{\prime}.$

The proof of Lemma 4 is the same as the proof of Lemma 3 until the choice of
$x_{0}$, at which point we choose a positive integer
$x_{0}=r\prod_{p\in\mathbf{P}_{0}}p^{k}$ that satisfies inequality (19). This
completes the proof. ∎

######  Theorem 4.

Let $\varphi$ be a linear form with rational coefficients that satisfies
property $N$. Let $\\{\varepsilon_{k}:k=1,2,3,\ldots\\}$ be a sequence of
positive real numbers and let $\\{p_{k}:k=1,2,3,\ldots\\}$ be a sequence of
prime numbers. For every sequence of integers $B=\\{b_{k}:k=1,2,3,\ldots\\}$,
there exists a strictly increasing sequence of positive integers
$A=\\{a_{k}:k=1,2,3,\ldots\\}$ such that $A$ is a $\varphi$-Sidon set and

$|a_{k}-b_{k}|_{p_{j}}<\varepsilon_{k}$

for all $k\in\mathbf{N}$ and $j\in\\{1,\ldots,k\\}$.

###### Proof.

The proof of Theorem 4 is an inductive construction based on Lemma 4. Choose a
positive integer $k_{1}$ such that $1/p_{1}^{k_{1}}<\varepsilon_{1}$ and
$b_{1}+p_{1}^{k_{1}}>0$. Let $a_{1}=b_{1}+p_{1}^{k_{1}}$. The set
$A_{1}=\\{a_{1}\\}$ is a $\varphi$-Sidon set and
$|a_{1}-b_{1}|_{p_{1}}<\varepsilon_{1}$.

For $n\geq 1$, let $A_{n}=\\{a_{1},\ldots,a_{n}\\}$ be a set of positive
integers with $a_{1}<\cdots<a_{n}$ such that $A_{n}$ is a $\varphi$-Sidon set
and

$|a_{k}-b_{k}|_{p_{j}}<\varepsilon_{k}$

for all $k\in\\{1,\ldots,n\\}$ and $j\in\\{1,\ldots,k\\}$. We apply Lemma 4 to
the set $A^{\prime}=A_{n}$, the integer $b=b_{n+1}$, the finite set of primes
$\mathbf{P}_{0}=\\{p_{1},\ldots,p_{n},p_{n+1}\\}$, and
$\varepsilon^{\prime}=\varepsilon_{n+1}>0$ to obtain an integer
$a_{n+1}>a_{n}$ such that

$|a_{n+1}-b_{n+1}|_{p_{j}}<\varepsilon_{n+1}$

for all $j\in\\{1,\ldots,n,n+1\\}$ and the sets $\Phi_{J}(A_{n+1},a_{n+1})$
are pairwise disjoint for all $J\subseteq\\{1,\ldots,h\\}$. It follows from
Lemma 1 that $A_{n+1}$ is a $\varphi$-Sidon set. This completes the proof. ∎

######  Theorem 5.

Let $\varphi$ be a linear form with rational coefficients that satisfies
property $N$. Let $B=\\{b_{k}:k=1,2,3,\ldots\\}$ be a sequence of integers.
There exists a strictly increasing $\varphi$-Sidon set of positive integers
$A=\\{a_{k}:k=1,2,3,\ldots\\}$ such that, for every prime number $p$, the set
$A$ is $p$-adically asymptotic to $B$ in the sense that

$\lim_{k\rightarrow\infty}|a_{k}-b_{k}|_{p}=0.$

###### Proof.

This follows from Theorem 4 applied to the set of all prime numbers and any
sequence $\varepsilon=\\{\varepsilon_{k}:k=1,2,3,\ldots\\}$ of positive
numbers such that $\lim_{k\rightarrow\infty}\varepsilon_{k}=0$. ∎

##  6\. Growth of $\varphi$-Sidon sets

Let $f(t)$ be a real-valued or complex-valued function defined for $t\geq
t_{0}$. Let $g(t)$ be positive function defined for $t\geq t_{0}$. We write

$f(t)\ll g(t)$

if there exist constants $C_{1}>0$ and $t_{1}\geq t_{0}$ such that $|f(t)|\leq
C_{1}g(t)$ for all $t\geq t_{1}$. We write

$f(t)\gg g(t)$

if there exist constants $C_{2}>0$ and $t_{2}\geq t_{0}$ such that $|f(t)|\geq
C_{2}g(t)$ for all $t\geq t_{2}$.

Let $A$ be a set of positive integers. The _growth function_ or _counting
function_ of $A$ is the function $A(n)$ that counts the number of positive
integers in the set $A\cap\\{1,\ldots,n\\}$. The number of $h$-fold sums of
integers taken from the set $A\cap\\{1,\ldots,n\\}$ is

$\binom{A(n)+h-1}{h}$

and each of these sums is at most $hn$. If $A$ is a classical $h$-Sidon set,
then these sums are distinct and

$\frac{A(n)^{h}}{h!}\leq\binom{A(n)+h-1}{h}\leq hn$

This simple counting argument proves that

$A(n)\ll n^{1/h}.$

The upper bound is tight. Bose and Chowla [1] proved that for every positive
integer $n$ there exist finite Sidon sets $A$ with

$A\subseteq\\{1,\ldots,n\\}\operatorname{\qquad\text{and}\qquad}\operatorname{\text{card}}(A)\gg
n^{1/h}.$

We do not have best possible upper bounds for infinite Sidon sets. Erdős (in
Stöhr [24]) constructed an infinite Sidon set $A$ of order 2 with

$\limsup_{n\rightarrow\infty}\frac{A(n)}{\sqrt{n}}\geq\frac{1}{2}$

and so $A(n)\gg\sqrt{n}$ for infinitely many $n$, but he also proved that
every classical Sidon set of order 2 satisfies

$\liminf_{n\rightarrow\infty}A(n)\sqrt{\frac{\log n}{n}}\ll 1$

and so $A(n)\ll\sqrt{n/\log n}$ for infinitely many $n$.

It is of interest to obtain upper bounds for the size of $\varphi$-Sidon sets.
Let $\mathbf{F}$ be a field with an absolute value. The _counting function_ of
a subset $X$ of $\mathbf{F}$ is

$X(t)=\operatorname{\text{card}}\left(x\in X:|x|\leq t\right).$

######  Theorem 6.

Let $\mathbf{F}$ be a field with an absolute value. Let
$\varphi=\sum_{i=1}^{h}c_{i}x_{i}$ be a linear form with coefficients in
$\mathbf{F}$, and let $C=\sum_{i=1}^{h}|c_{i}|$. Let $X$ be a subset of
$\mathbf{F}$ such that $\varphi(X)\subseteq X$. If $A$ is a $\varphi$-Sidon
subset of $X$, then

$A(t)\leq X(Ct)^{1/h}$

for all $t\geq 0$.

###### Proof.

Let $A^{\prime}=\\{a\in A:|a|\leq t\\}$. We have
$A(t)=\operatorname{\text{card}}(A^{\prime})$ and, because $A$ is a
$\varphi$-Sidon set,

$A(t)^{h}=\operatorname{\text{card}}(\varphi(A^{\prime})).$

If $a_{1},\ldots,a_{h}\in A^{\prime}$, then
$b=\varphi(a_{1},\ldots,a_{h})\in\varphi(A^{\prime})\subseteq X$ and

$\displaystyle|b|$
$\displaystyle=\left|\varphi(a_{1},\ldots,a_{h})\right|=\left|\sum_{i=1}^{h}c_{i}a_{i}\right|$
$\displaystyle\leq\sum_{i=1}^{h}\left|c_{i}a_{i}\right|\leq\sum_{i=1}^{h}\left|c_{i}\right|\max(|a_{i}|:i=1,\ldots
h)$ $\displaystyle\leq Ct.$

Therefore,

$A(t)^{h}=\operatorname{\text{card}}(\varphi(A^{\prime}))\leq\operatorname{\text{card}}\\{x\in
X:|x|\leq Ct\\}=X(Ct)$

and

$A(t)\leq X(Ct)^{1/h}.$

This completes the proof. ∎

Let $\varphi=\sum_{i=1}^{h}c_{i}x_{i}$ be a linear form with nonzero rational
coefficients. Let $m$ be a common multiple of the the denominators of the
coefficients $c_{1},\ldots,c_{h}$, and let $d$ be the greatest common divisor
of the integers $mc_{1},\ldots,mc_{h}$. Let $c^{\prime}_{i}=mc_{i}/d$ for
$i\in\\{1,\ldots,h\\}$. The integers $c^{\prime}_{i}=mc_{i}/d$ are nonzero and
relatively prime. Consider the linear form
$\varphi^{\prime}=\sum_{i=1}^{h}c^{\prime}_{i}x_{i}$. We have

$\varphi=\frac{d}{m}\sum_{i=1}^{h}\frac{mc_{i}}{d}x_{i}=\frac{d}{m}\sum_{i=1}^{h}c^{\prime}_{i}x_{i}=\frac{d}{m}\varphi^{\prime}.$

It follows that a set is a $\varphi$-Sidon set if and only if it is a
$\varphi^{\prime}$-Sidon set. Thus, in the study of $\varphi$-Sidon sets, a
linear form with nonzero rational coefficients can be replaced with a linear
form with nonzero relatively prime integer coefficients.

######  Theorem 7.

Let $\varphi=\sum_{i=1}^{h}c_{i}x_{i}$ be a linear form with integer
coefficients. If $A$ is a $\varphi$-Sidon set of integers, then

$A(t)=\\{a\in A:|a|\leq t\\}\ll t^{1/h}.$

###### Proof.

We have $\varphi(\mathbf{Z})\subseteq\mathbf{Z}$. Let $[t]$ denote the integer
part of the real number $t$. With the usual absolute value, the counting
function of $\mathbf{Z}$ is $\mathbf{Z}(t)=2[t]+1\leq 2t+1$. Applying Theorem
6 with $X=\mathbf{Z}$, we obtain

$A(t)\leq\mathbf{Z}(Ct)^{1/h}\leq(2Ct+1)^{1/h}\ll t^{1/h}.$

This completes the proof. ∎

######  Theorem 8.

Let $\varphi=\sum_{i=1}^{h}c_{i}x_{i}$ be a linear form with integer
coefficients that satisfies condition $N$. There exists an infinite
$\varphi$-Sidon set $A=\\{a_{k}:k\in\mathbf{N}\\}$ of distinct positive
integers such that

(20) $a_{k+1}\leq 4^{h}k^{2h-1}+k$

for all $k\in\mathbf{N}$.

###### Proof.

We construct the $\varphi$-Sidon set $A=\\{a_{k}:k\in\mathbf{N}\\}$
inductively. The set $A_{1}=\\{a_{1}\\}$ is a $\varphi$-Sidon set for every
integer $a_{1}$. Let $a_{1}=1$.

Let $k\geq 1$ and let $A_{k}=\\{a_{1},\ldots,a_{k}\\}$ be a $\varphi$-Sidon
set of positive integers. Let $b$ be a positive integer. By Lemma 1, the set
$A_{k}\cup\\{b\\}$ is a $\varphi$-Sidon set if and only if the sets

$\Phi_{J}(A_{k},b)=\varphi_{J}(A_{k})+\left(\sum_{j\in J^{c}}c_{j}\right)b$

are pairwise disjoint for all $J\subseteq\\{1,\ldots,h\\}$.

Let $J_{1}$ and $J_{2}$ be distinct subsets of $\\{1,\ldots,h\\}$. The sets
$J_{1}\setminus(J_{1}\cap J_{2})$ and $J_{2}\setminus(J_{1}\cap J_{2})$ are
distinct and disjoint. We have

$\Phi_{J_{1}}(A_{k},b)\cap\Phi_{J_{2}}(A_{k},b)\neq\emptyset$

if and only if there exist integers $a_{1,j}\in A_{k}$ for all $j\in J_{1}$
and $a_{2,j}\in A_{k}$ for all $j\in J_{2}$ such that

(21) $\sum_{j\in J_{1}}c_{j}a_{1,j}+\left(\sum_{j\in
J^{c}_{1}}c_{j}\right)b=\sum_{j\in J_{2}}c_{j}a_{2,j}+\left(\sum_{j\in
J^{c}_{2}}c_{j}\right)b.$

The integer

$\displaystyle c$ $\displaystyle=\sum_{j\in J^{c}_{2}}c_{j}-\sum_{j\in
J^{c}_{1}}c_{j}=s(J_{2}^{c})-s(J_{1}^{c})$
$\displaystyle=s\left(J_{1}\setminus(J_{1}\cap
J_{2})\right)-s\left(J_{2}\setminus(J_{1}\cap J_{2})\right)$

is nonzero because the linear form $\varphi$ satisfies condition $N$. The
integer $b$ satisfies equation (21) if and only if

(22) $cb=\sum_{j\in J_{1}}c_{j}a_{1,j}-\sum_{j\in J_{2}}c_{j}a_{2,j}.$

Thus, there is at most one integer $b$ that satisfies equation (22).

Let $\operatorname{\text{card}}(J_{1})=j_{1}$ and
$\operatorname{\text{card}}(J_{2})=j_{2}$. The sets $J_{1}$ and $J_{2}$ are
distinct subsets of $\\{1,\ldots,h\\}$ and so

$j_{1}+j_{2}\leq 2h-1.$

The number of integers of the form

$\sum_{j\in J_{1}}c_{j}a_{1,j}-\sum_{j\in J_{2}}c_{j}a_{2,j}$

with $a_{1,j}\in A_{k}$ and $a_{2,j}\in A_{k}$ is at most ${k}^{j_{1}+j_{2}}$.
The number of ordered pairs $(J_{1},J_{2})$ of subsets of $\\{1,\ldots,h\\}$
of cardinalities $j_{1}$ and $j_{2}$, respectively, is

$\binom{h}{j_{1}}\binom{h}{j_{2}}.$

Thus, the number of equations of the form (22) is at most

$\displaystyle\underbrace{\sum_{j_{1}=0}^{h}\sum_{j_{2}=0}^{h}}_{j_{1}+j_{2}\leq
2h-1}\binom{h}{j_{1}}\binom{h}{j_{2}}{k}^{j_{1}+j_{2}}$
$\displaystyle\leq\sum_{j_{1}=0}^{h}\binom{h}{j_{1}}\sum_{j_{2}=0}^{h}\binom{h}{j_{2}}{k}^{2h-1}$
$\displaystyle=4^{h}k^{2h-1}$

and so there are at most $4^{h}k^{2h-1}+k$ positive integers $b$ such that
$b\notin A_{k}$ and $A_{k}\cup\\{b\\}$ is not a $\varphi$-Sidon set. It
follows that there exists a positive integer $a_{k+1}$ such that

  1. (i)

$a_{k+1}\notin A_{k}$,

  2. (ii)

$A_{k+1}=A_{k}\cup\\{a_{k+1}\\}$ is a $\varphi$-Sidon set,

  3. (iii)

$a_{k+1}\leq 4^{h}k^{2h-1}+k$.

This completes the proof. ∎

######  Theorem 9.

Let $\varphi=\sum_{i=1}^{h}c_{i}x_{i}$ be a linear form with integer
coefficients that satisfies condition $N$. There exists an infinite
$\varphi$-Sidon set $A$ of positive integers such that

$A(t)\gg t^{1/(2h-1)}.$

###### Proof.

This follows from inequality (20). ∎

##  7\. Open problems

  1. (1)

Let $\varphi=\sum_{i=1}^{h}c_{i}x_{i}$ be a linear form with integer
coefficients. Let $\mathbf{P}$ be the set of prime numbers and let $A=\\{\log
p:p\in\mathbf{P}\\}$. Consider the $h$-tuple
$(p_{1},\ldots,p_{h})\in\mathbf{P}^{h}$ of not necessarily distinct prime
numbers, and let $\mathbf{P}_{0}=\\{p\in\mathbf{P}:p=p_{i}\text{ for some
}i\in\\{1,\ldots,h\\}\\}$. For each $p\in\mathbf{P}_{0}$, let

$I_{p}=\\{i\in\\{1,\ldots,h\\}:p_{i}=p\\}\operatorname{\qquad\text{and}\qquad}s(I_{p})=\sum_{i\in
I_{p}}c_{i}.$

We have

$\varphi(p_{1},\ldots,p_{h})=\sum_{i=1}^{h}c_{i}\log
p_{i}=\sum_{p\in\mathbf{P}_{0}}s(I_{p})\log
p=\log\prod_{p\in\mathbf{P}_{0}}p^{S(I_{p})}.$

If the linear form $\varphi$ satisfies property $N$, then, by the fundamental
theorem of arithmetic, the set $A=\\{\log p:p\in\mathbf{P}\\}$ is a
$\varphi$-Sidon se.

For the linear form $\psi=x_{1}+\cdots+x_{h}$, Ruzsa [22] used the set $A$ to
construct large classical Sidon sets of positive integers . Are such
constructions also possible for $\varphi$-Sidon sets of positive integers?

  2. (2)

Let $A=\\{a_{k}:k=1,2,3,\ldots\\}$ and $B=\\{b_{k}:k=1,2,3,\ldots\\}$ be
sequences of integers. The set $A$ is a _polynomial perturbation_ of $B$ if

$|a_{k}-b_{k}|<k^{r}$

for some $r>0$ and all $k\geq k_{0}$. The set $A$ is a _bounded perturbation_
of $B$ if

$|a_{k}-b_{k}|<m_{0}$

for some $r>0$ and all $k\geq k_{0}$.

Let $\varphi$ be a linear form with integer coefficients that satisfies
condition $N$. Let $B$ be a set of integers. Does there exist a
$\varphi$-Sidon set of integers that is a polynomial perturbation of $B$?

Does there exist a $\varphi$-Sidon set of integers that is a bounded
perturbation of $B$?

  3. (3)

Let $\varphi$ be a linear form with integer coefficients that satisfies
condition $N$. For every positive integer $n$, determine the cardinality of
the largest $\varphi$-Sidon subset of $\\{1,2,\ldots,n\\}$.

  4. (4)

There exists $c>0$ such that, for every positive integer $n$, there is a
classical Sidon set $A\subseteq\\{1,\ldots,n\\}$ with $A(n)\geq c\sqrt{n}$.
However, there is no infinite classical Sidon set $A$ of positive integers
such that $A(n)\geq c\sqrt{n}$ for some $c>0$ and all $n\geq n_{0}$. Indeed,
Erdős (in Stöhr [24]) proved that every infinite classical Sidon set satisfies

$\liminf_{n\rightarrow\infty}A(n)\sqrt{\frac{\log n}{n}}\ll 1.$

Are there analogous lower bounds for infinite $\varphi$-Sidon sets of positive
integers associated with binary linear forms $\varphi=c_{1}x_{1}+c_{2}x_{2}$
or with linear forms $\varphi=\sum_{i=1}^{h}c_{i}x_{i}$ for $h\geq 3$?

  5. (5)

Consider sets of integers. One might expect that the elements of a set $A$ of
integers that is “sufficiently random” or “in general position” will be a
classical Sidon set, that is, will not contain a nontrivial solution of the
equation $x_{1}+x_{2}=x_{3}+x_{4}$. Equivalently, the set $A$ will be one-to-
one (up to transposition) on the function $f(x_{1},x_{2})=x_{1}+x_{2}$. There
is nothing special about the function $x_{1}+x_{2}$. One could ask if $A$ is
one-to-one (up to permutation) on some symmetric function, or one-to-one on a
function that is not symmetric. The functions considered in this paper are
linear forms in $h$ variables.

Conversely, given the set $A$ of integers, we can ask what are the functions
(in some particular set $\mathcal{F}$ of functions) with respect to which the
set $A$ is one-to-one. This inverse problem is considered in Nathanson [17].

## References

  * [1] R. C. Bose and S. Chowla, _Theorems in the additive theory of numbers_ , Comment. Math. Helv. 37 (1962/63), 141–147.
  * [2] B. Bukh, _Sums of dilates_ , Combin. Probab. Comput. 17 (2008), no. 5, 627–639.
  * [3] J. Cilleruelo, O. Serra, and M. Wötzel, _Sidon set systems_ , Rev. Mat. Iberoam. 36 (2020), no. 5, 1527–1548.
  * [4] Q. Dubroff, J. Fox, and M. Q. Xu, _A note on the Erdős distinct subset sums problem_ , SIAM J. Discrete Math. 35 (2021), 322–324.
  * [5] P. Erdős, Problems and results in additive number theory, _Colloque sur la Théorie des Nombres, Bruxelles, 1955_ , Georges Thone, Liège; Masson & Cie, Paris, 1956, 127–137.
  * [6] R. K. Guy, R. K., _Unsolved Problems in Number Theory_ , Springer-Verlag, New York, 2004.
  * [7] H. Halberstam and K. F. Roth, _Sequences, Vol. 1_ , Oxford University Press, Oxford, 1966, Reprinted by Springer-Verlag, Heidelberg, in 1983.
  * [8] S. Z. Kiss and C. Sándor, _Generalized asymptotic Sidon basis_ , Discrete Math. 344 (2021), no. 2, 112208, 5.
  * [9] Y. Kohayakawa, S. J. Lee, C. G. Moreira, and V. Rödl, _Infinite Sidon sets contained in sparse random sets of integers_ , SIAM J. Discrete Math. 32 (2018), no. 1, 410–449.
  * [10] M. Kovačević and V. Y. F. Tan, _Improved bounds on Sidon sets via lattice packings of simplices_ , SIAM J. Discrete Math. 31 (2017), no. 3, 2269–2278.
  * [11] H. Liu and P. P. Pach, _The number of multiplicative Sidon sets of integers_ , J. Combin. Theory Ser. A 165 (2019), 152–175.
  * [12] M. B. Nathanson, _Problems in additive number theory. I_ , Additive Combinatorics, CRM Proc. Lecture Notes, vol. 43, Amer. Math. Soc., Providence, RI, 2007, pp. 263–270.
  * [13] by same author, _Representation functions of bases for binary linear forms_ , Funct. Approx. Comment. Math. 37 (2007), no. part 2, 341–350.
  * [14] by same author, _Inverse problems for linear forms over finite sets of integers_ , J. Ramanujan Math. Soc. 23 (2008), no. 2, 151–165.
  * [15] by same author, _Problems in additive number theory. II. Linear forms and complementing sets_ , J. Théor. Nombres Bordeaux 21 (2009), no. 2, 343–355.
  * [16] by same author, _Comparison estimates for linear forms in additive number theory_ , J. Number Theory 184 (2018), 1–26.
  * [17] by same author, _An inverse problem for Sidon sets_ , arXiv:2104.06501, 2021.
  * [18] M. B. Nathanson, K. O’Bryant, B. Orosz, I. Ruzsa, and M. Silva, _Binary linear forms over finite sets of integers_ , Acta Arith. 129 (2007), no. 4, 341–361.
  * [19] K. O’Bryant, _A complete annotated bibliography of work related to Sidon sequences_ , Electronic J. Combinatorics (2004), Dynamic Surveys DS 11\.
  * [20] P. P. Pach, _An improved upper bound for the size of the multiplicative 3-Sidon sets_ , Int. J. Number Theory 15 (2019), no. 8, 1721–1729.
  * [21] P. P. Pach and C. Sándor, _On infinite multiplicative Sidon sets_ , European J. Combin. 76 (2019), 37–52.
  * [22] I. Z. Ruzsa, _An infinite Sidon sequence_ , J. Number Theory 68 (1998), no. 1, 63–71.
  * [23] T. Schoen and I. D. Shkredov, _An upper bound for weak $B_{k}$-sets_, SIAM J. Discrete Math. 33 (2019), no. 2, 837–844.
  * [24] A. Stöhr, _Gelöste und ungelöste Fragen über Basen der natürlichen Zahlenreihe. I, II_ , J. Reine Angew. Math. 194 (1955), 40–65, 111–140.
  * [25] W. Xu, _Popular differences and generalized Sidon sets_ , J. Number Theory 186 (2018), 103–120.