How to translate "any open interval" and "any closed interval" from English to math symbols. In my intro to real analysis book, I came up with the following lemma (which is easy to prove) to help with an exercise.

For any open interval $K$, if any closed interval $S$ that is a subset of $K$ has the property that for any $x \in S$:$\varphi(x)$, then for any $x\in K$, we must have $\varphi(x) \quad(\dagger)$

For the proof, consider any $x \in K$. Now, consider the set $\{x\}$. This set is a closed set. Therefore, by assumption $\varphi(x)$.
Question: Could someone help me translate the English of $(\dagger)$ into the appropriate math notation?
How does one encode "$K$ is any open interval" and "$S$ is any closed interval"? Are these strictly topological notions that require new notation? Or is there a clever way that uses basic quantifiers and inequalities?
For example, does the following syntax work?

$\forall K \Bigg[\bigg(\Big[\exists a,b \in \mathbb R: \forall x (a \lt x \lt b \rightarrow x \in K) \Big] \text { and } \Big[\forall S\color{blue}{\big(}\color{red}{(}\exists a,b \in K: \forall x (a \leq x \leq b \rightarrow x \in S)\color{red}{)}\rightarrow \forall x \in S: \varphi (x)\color{blue}{\big)}\Big]\bigg) \rightarrow \forall x \in K: \varphi (x) \Bigg] $

Edit:
I think it may be necessary to add a further specification to each of the conjuncts in the overarching antecedent.
For example, in the statement $\exists a,b \in \mathbb R: \forall x (a \lt x \lt b \rightarrow x \in K)$, I have not ensured that $K=\{x \in \mathbb R : a \lt x \lt b\}$. Rather, I have only ensured that $\{x \in \mathbb R : a \lt x \lt b\} \subseteq K$. To guarantee equality, I would have to add the condition that $\forall x ( x \leq a \text{ or } x \geq b \rightarrow x \notin K)$.
A similar extra condition would have to be stipulated for $S$.
 A: I want to make a few notes:

*

*Bear in mind that stuff like $K, S$ are just names. You don't need to give coordinates/bounds for your intervals necessarily, unless you want to specifically reference those bounds. It's the same with any set: unless you need to reference particular features or elements, don't overcomplicate details.


*You can assume, as needed, any definitions in statements like these. Your translation need not somehow include a definition of what it means to be an open interval. If need be, you can literally just say what $K,S,$ etc. are, if doing so is cumbersome symbolically. There generally isn't issue with this. Mathematical language is in part about communication, after all.

*

*(After all, going to an extreme, we shouldn't have to define basic notions like set inclusion, set membership, or even basic notations like "what is a real number" for stuff like this to be meaningful. Those are handled elsewhere; make sufficient assumptions on what the reader knows so that we can concisely yet precisely communicate what we need to.)




So, to translate

For any open interval $K$, if any closed interval $S$ that is a subset of $K$ has the property that for any $x \in S$:$\varphi(x)$, then for any $x\in K$, we must have $\varphi(x) \quad(\dagger)$

I would simply go with
$$\begin{align*}
&(\forall K \subseteq \Bbb R \text{ an open interval})(\forall S \subseteq K \text{ a closed interval})(\forall x \in S)(\varphi(x)) \\
&\implies (\forall x \in K)(\varphi(x))
\end{align*}$$
Broken down a bit:

*

*Let $K \subseteq \Bbb R$ be some open interval...

*...where for any subset $S \subseteq K$ where $S$ is a closed interval...

*...and each $x \in S$ has property $\varphi(x)$.

*Then we say that property $\varphi(x)$ holds for all $x \in K$.

If you want to avoid the writing things as text, you could then introduce notation representing $K,S$ as intervals formally: $K = (k,\ell)$ and $S = [s,t]$ below:
$$(\forall (k,\ell) \subseteq \Bbb R)(\forall [s,t] \subseteq (k,\ell) )(\forall x \in [s,t])(\varphi(x)) \implies (\forall x \in (k,\ell))(\varphi(x))$$

(Or something to this effect anyhow, it's hard for me to parse through what you wish to translate, but I think I'm somewhere close at least.)
A: 
$\forall K \Bigg[\bigg(\Big[\exists a,b \in \mathbb R: \forall x (a \lt x \lt b \rightarrow x \in K) \Big] \text { and } \Big[\forall S\color{blue}{\big(}\color{red}{(}\exists a,b \in K: \forall x (a \leq x \leq b \rightarrow x \in S)\color{red}{)}\rightarrow \forall x \in S: \varphi (x)\color{blue}{\big)}\Big]\bigg) \rightarrow \forall x \in K: \varphi (x) \Bigg]$

Slight reformat, altering merely punctuation and spacing:
\begin{gather}\forall K\, \Bigg[\quad\quad\quad
\bigg(\quad\exists a{,}b {\in} \mathbb R\;\forall x\;\big(a \lt x \lt b \rightarrow x \in K\big) \text { and }\\
\forall S\;\Big(\exists a{,}b {\in} K \;\forall x \;\big(a \leq x \leq b \rightarrow x \in S\big)\rightarrow \forall x {\in} S \;\varphi (x)\Big)\quad\bigg)\\
\rightarrow \forall x {\in}K\; \varphi (x) \quad\quad\Bigg]\tag0\end{gather}

For any open interval $K$, if any closed interval $S$ that is a subset of $K$ has the property that for any $x \in S$:$\varphi(x)$, then for any $x\in K$, we must have $\varphi(x). \quad(\dagger)$

The second “any” in your lemma $(†)$ is ambiguous; your formalisation $(0)$ indicates that you mean it as “every” rather than “some”. Thus $(†)$ can be formalised as follows:
Let $P$ and $L$ be the set of open intervals and the set of closed intervals, respectively. Then
$$∀K{\in}P\;\bigg[∀S{\in}L\,\bigg(S\subseteq K→∀y{\in}S\,φ(y)\bigg)→∀x{\in}K\,φ(x)\bigg];\tag{1}$$ equivalently,
$$∀K{\in}P\;∀x{\in}K\;∃S{\in}L\;∃y\;\bigg[\bigg(S\subseteq K→\Big(y{\in}S→φ(y)\Big)\bigg)→φ(x)\bigg];\tag{2}$$ equivalently,
$$∀K{\in}P\;∀x{\in}K\;∃y\;∃S{\in}L\;\bigg[\bigg(y{\in}S ∧ S\subseteq K ∧ ¬φ(y)\bigg) ∨ φ(x)\bigg],\tag3$$ i.e., “For each $x$ in each open interval $K,$ there is some $y$ and some closed interval $S$ such that either $y$ in $S$ in $K$ fails to satisfy $\varphi,$ or $\varphi(x)$ holds.”

Reply to the OP's comments

Hmmm. I may be wrong, but something seems a little fishy. Suppose $S$ is not a subset of $K.$ Your statement then suggests that $φ(x),$ where $x$ is a member of $K,$ would need to be true. But I do not believe that is appropriate.

Remember, $S$ is a variable set, and my suggestions $(1),(2),(3)$ all require that you consider only those that are subsets of $K,$ checking whether their elements satisfy $φ.$ Non-subsets of $K$ aren't relevant.

I just dont see how your interpretation can be reconciled with what the accepted answer (by Eevee Trainer) has provided, which as far as I can tell, echoes my syntax.

There are two unequivalent (semantically distinct) ways to read Eevee's suggestion $$ (\forall K{\subseteq}\Bbb R \text{ an open interval})(\forall S{\subseteq}K \text{ a closed interval})\forall x{\in}S\,\varphi(x) \implies \forall x{\in}K\,\varphi(x):$$ either as $$ (\forall K{\subseteq}\Bbb R \text{ an open interval})\bigg[(\forall S{\subseteq}K \text{ a closed interval})\forall y{\in}S\,\varphi(y) \implies \forall x{\in}K\,\varphi(x)\bigg],$$ which is equivalent to my suggestion $$∀K{\in}P\;\bigg[∀S{\in}L\,\bigg(S\subseteq K→∀y{\in}S\,φ(y)\bigg)→∀x{\in}K\,φ(x)\bigg],\tag{1}$$ or as $$ (\forall K{\subseteq}\Bbb R \text{ an open interval})(\forall S{\subseteq}K \text{ a closed interval})\bigg[\forall y{\in}S\,\varphi(y) \implies \forall x{\in}K\,\varphi(x)\bigg],$$ which is based on interpreting the ambiguous “any” in your lemma $(†)$ as “some” instead of “every” (refer to the second paragraph above).
P.S. Since quantifiers are conventionally understood to apply to as small a scope as possible, technically, Eevee's suggestion is read as
$$ \bigg[(\forall J{\subseteq}\Bbb R \text{ an open interval})(\forall S{\subseteq}J \text{ a closed interval})\forall y{\in}S\,\varphi(y)\bigg] \implies \bigg[\forall x{\in}K\,\varphi(x)\bigg];$$ since this is conceivably not the intention, we insert the parentheses elsewhere.
P.P.S. Each link above contains a proof of the asserted logical equivalence.
