A question about the contractibility of the Sierpinski space

The two-point Sierpinski space is usually defined as follows:

Let $X =\{x,y\}$ be the two-point space where the only open sets are $X, \varnothing, \{x\}$. I think from this it can be inferred that $X, \varnothing, \{y\}$ are closed, correct? Then this information can be used to show that $X$ is in fact connected. I believe you can also show that it is path connected; a path from $0$ to $1$ in $X$ is given by the function: $f(0) = 0$ and $f(t) = 1$ for $t > 0$. The function $f : I → X$ is continuous since $f^{−1}(1) = (0,1]$, which is open in $I$. Now I know that a space $Y$ is contractible provided that we have id$_Y \simeq e_{y_0}$, i.e. the identity map of $Y$ is homotopic to the constant map $e_{y_0}$ (definition of being nulhomotopic). My question is how can you show that the two-point Sierpinski space is contractible? Doesn't that just require "tweaking" the function $f$ that was used to show that $X$ is path connected? Also, recall that a space is contractible provided that it is both path connected and simply connected. How would this approach go?


The easiest way is probably to find a working homotopy between the identity map and a constant function.

Consider the map $H:X\times [0,1]\to X$ defined by $$H:X\times [0,1]\ni(z,t)\longmapsto\begin{cases}z &\text{ if }t=0,\\ x&\text{ if }t>0.\end{cases}$$ Now, $H^{-1}(\{x\})=\{(x,0)\}\cup X\times (0,1]=\big(\{x\}\times [0,1]\big)\cup \big(\{y\}\times (0,1]\big)$, which is an open subset of $X\times [0,1]$, as it's complement in $X\times [0,1]$ is $\{y\}\times \{0\}\subseteq_\text{closed} X\times [0,1]$.

This shows that $H$ is continuous. Also, since $H(z,0)=\mathrm{id}_{X}(z)$ and $H(z,1)=e_{x}(z)$ for all $z\in X$, then this shows that $H:\mathrm{id}_{X}\cong e_{x}$.