The P-value as the expectation of an indicator function I am familiar with the notion that $Pr(A) = \mathbb{E}[1_{\omega \in A}(\omega)]$, given some suitable measure theoretic assumptions. I seem to recall a comment on a stats.stackexchange post citing a paper explaining how the P-value can be formally defined as an expectation of an indicator function. Unfortunately I have since forgotten the user, post, and indeed the paper. Neither our site's search engine nor Google Scholar gave useful results in the first few pages.
If someone knows of a paper with this description, please post a link to it as an answer.

This is not the paper I had in mind, but the following does take an resampled average of indicator functions to obtain a p-value.
$$\hat{p}^*(\hat{\tau}) \equiv \sum_{j=1}^{B} I(\hat{\tau}_{j}^{*} > \hat{\tau})$$
@article{Davidson2000,
  doi = {10.1080/07474930008800459},
  url = {https://doi.org/10.1080/07474930008800459},
  year = {2000},
  month = jan,
  publisher = {Informa {UK} Limited},
  volume = {19},
  number = {1},
  pages = {55--68},
  author = {Russell Davidson and James G. MacKinnon},
  title = {Bootstrap tests: how many bootstraps?},
  journal = {Econometric Reviews}
}

https://www.tandfonline.com/doi/abs/10.1080/07474930008800459
