  In recent years, cosmic shear has emerged as a powerful tool to study the
statistical distribution of matter in our Universe. Apart from the standard
two-point correlation functions, several alternative methods like peak count
statistics offer competitive results. Here we show that persistent homology, a
tool from topological data analysis, can extract more cosmological information
than previous methods from the same dataset. For this, we use persistent Betti
numbers to efficiently summarise the full topological structure of weak lensing
aperture mass maps. This method can be seen as an extension of the peak count
statistics, in which we additionally capture information about the environment
surrounding the maxima. We first demonstrate the performance in a mock analysis
of the KiDS+VIKING-450 data: we extract the Betti functions from a suite of
$w$CDM $N$-body simulations and use these to train a Gaussian process emulator
that provides rapid model predictions; we next run a Markov-Chain Monte Carlo
analysis on independent mock data to infer the cosmological parameters and
their uncertainty. When comparing our results, we recover the input cosmology
and achieve a constraining power on $S_8 \equiv
\sigma_8\sqrt{\Omega_\mathrm{m}/0.3}$ that is 5% tighter than that of peak
count statistics. Performing the same analysis on 100 deg$^2$ of Euclid-like
simulations, we are able to improve the constraints on $S_8$ and
$\Omega_\mathrm{m}$ by 18% and 10%, respectively, while breaking some of the
degeneracy between $S_8$ and the dark energy equation of state. To our
knowledge, the methods presented here are the most powerful topological tools
to constrain cosmological parameters with lensing data.
