Fixed images, latex and first real blog.

This commit is contained in:
zaimon 2024-12-06 16:36:42 +05:30
parent 8caab7b2be
commit 79efd70089
8 changed files with 240 additions and 32 deletions

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
/public/ /public/
/.packages/ /.packages/
/.org-cache/ /.org-cache/
/content/ltximg/

View file

@ -106,7 +106,7 @@ body {
font-size: 1.3rem; font-size: 1.3rem;
line-height: 1.5; line-height: 1.5;
color: #eeffff; color: #eeffff;
background-color: #000000; background-color: #857470;
} }
p { p {
@ -154,7 +154,7 @@ h1 {
} }
h2 { h2 {
color: #c11146; color: #fc9600;
} }
h3 { h3 {
@ -339,7 +339,7 @@ strong {
margin-top: 1rem; margin-top: 1rem;
color: #93309f; color: #93309f;
font-size: 1rem; font-size: 1rem;
background-color: #38033a; background-color: #000000;
border-top: 0.05rem solid #c3e88d; border-top: 0.05rem solid #c3e88d;
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View file

@ -15,7 +15,8 @@
* A list of All Blogs * A list of All Blogs
|-----------+------------------+------------------| |--------------------------------------------------+------------------+------------------|
| Title | Last Modified | Created | | Title | Last Modified | Created |
|-----------+------------------+------------------| |--------------------------------------------------+------------------+------------------|
| [[/test_blog][Test Blog]] | [2024-08-17 Sat] | [2024-08-17 Sat] | | [[/countable_union_of_countable_sets_is_countable][A Countable Union of Countable Sets is Countable]] | [2024-12-06 Fri] | [2024-12-05 Thu] |
| [[/test_blog][Test Blog]] | [2024-08-17 Sat] | [2024-08-17 Sat] |

View file

@ -0,0 +1,178 @@
#+title: A Countable Union of Countable Sets is Countable
#+created: [2024-12-05 Thu]
#+last_modified: [2024-12-06 Fri]
#+author: Dibyashanu Pati
#+OPTIONS: tex:dvipng
#+OPTIONS: \n:t
#+OPTIONS: toc:2
* Union of Finite Countable Sets
It is straight forward to show that the union of two countable set is countable.
Let $S_0$ and $S_1$ be two countable infinite sets(in case when either is finite the proof trivial), that is,
\[\exists f_0 : S_0 \rightarrow \mathbb{N}\] and
\[\exists f_1 : S_1 \rightarrow \mathbb{N}\]
such that $f_0$ and $f_1$ are bijections,
then the set $S = S_0 \cup S_1$ is also countable meaning that
\[\exists f: S \rightarrow \mathbb{N}\] so that $f$ is a bijection.
To construct such a map $f$ all the elements in $S_0$ to all the all the even naturals and all the elements in $S_1$ to the even naturals, so
\[S_0 = \{a_0, a_1 , a_2 , \hdots\}\]
\[S_1 = \{b_0, b_1 , b_2 , \hdots\}\]
let \[f(a_n) = 2n\] and \[f(b_n) = 2n + 1\]
Such a map is surjective because we cover all cases modulo $2$ and hence all the integers, and this map is injective because $f$ is injective on all $a$'s and $b$'s separately.
Either using induction or using a similar argument with the naturals modulo $k$ for any finite $k$ we can show that the union of any $k$ countable sets is also countable
$S = S_0 \cup S_1 \cup S_2 \hdots \cup S_k$.
* Larger Unions?
We know that an arbitrary union of countable sets is not necessarily countable.
Consider as a counterexample the union of all singletons $\{r\}, r \in \mathbb{R}$, this is $\mathbb{R}$ itself which we know not to be countable.
It turns out that a countable union of countable sets is countable, to show this we *cannot* use a induction or a modulo $k$ argument.
The key idea in the modulo k argument is that there are $k$ equivalence classes and hence we can break the Naturals into $k$ infinite countable sequences(countable infinite sets), but can we break the naturals into infinitely many infinite sub-sequences? - Yes.
The first time I encountered this it was supposed to be justified was by observing that the Naturals can be arranged into the following two dimensional array,
\begin{matrix}
\, \\
0 & 1 & 3 & 6 & \dots \\
2 & 4 & 7 & \dots \\
5 & 8 & \dots \\
9 & \dots \\
\vdots
\end{matrix}
Although this is convincing, a thought process that would lead me to come up with this eluded me until now, I explain this thought process below.
* The Argument
In the modulo $k$ argument we have a constant gap between each consecutive element of a sequence, because of this we are limited by the gap size($k$). So the key idea is constructing such a partitioning of the Naturals is to keep increasing the gap size, but since the gap size is finite at any point we can only have elements from a finite number of the countably infinite sub-sequences at any particular, so we are forced to start subsequent sub-sequences at larger and larger points.
The most simple way to increase the gap size in this way is to keep increasing it by one after each gap.
[[pics/Countable_union_of_Countable_sets.jpg][image]]
Look at the $0^{th}$ sequence we just get the [[https://en.wikipedia.org/wiki/Triangular_number][Triangular numbers]] and zero.
For elements of the first sequence we get the fill all places immediately after all Triangular numbers starting from the first Triangular number.
For elements of the second sequence we get the fill all places one place after all Triangular numbers starting from the second triangular number.
So we come up with the function $S$ that maps the $n^{th}$ element of the $m^{th}$ sub-sequence.
$S(m,n) = m + \frac{(m+n)(m + n + 1)}{2}$
This is equivalent to the 2D array I mentioned earlier.
#+begin_src python :results output
for m in range(0,5):
row = f" S_{m} = "
for n in range(0,5):
s = m + n
row += (str(m + int(s*(s+1)/2)) + ' , ')
print(row + ' ... \n')
print('.\n.\n.\n')
#+end_src
#+RESULTS:
#+begin_example
S_0 = 0 , 1 , 3 , 6 , 10 , ...
S_1 = 2 , 4 , 7 , 11 , 16 , ...
S_2 = 5 , 8 , 12 , 17 , 23 , ...
S_3 = 9 , 13 , 18 , 24 , 31 , ...
S_4 = 14 , 19 , 25 , 32 , 40 , ...
.
.
.
#+end_example
Now we just have to show that $S: \mathbb{N} \times \mathbb{N} \rightarrow \mathbb{N}$ is bijective.
------
/Claim 1/: If $S(m_0, n_0) = S(m_1, n_1)$ then $m_0 + n_0 = m_1 + n_1$
This equivalent to showing that if $m_0 + n_0 \ne m_1 + n_1$ then $S(m_0, n_0) \ne S(m_1, n_1)$.
Without loss of generality let us assume $m_0 + n_0 < m_1 + n_1$.
Let $s_0 = m_0 + n_0$ and $s_1 = m_1 + n_1$ since $s_1>s_0$ the difference of there triangular numbers $T(s_1)$ and $T(s_0)$ is atleast $s_1$ because $s_0 \le s_1 - 1$.
Then
\[
S(m_1, n_1) - S(m_0, n_0) &= \frac{s_1(s_1 + 1)}{2} - \frac{s_0(s_0 - 1)}{2} + m_1 - m_0
\]
\[
\ge s_1 + m_1 - m_0
\]
\[ \ge s_1 - m_0
\]
\[ = m_1 + n_1 - m_0
\]
\[ > n_0
\]
\[ \ge 0
\]
So \[S(m_1, n_1) > S(m_0, n_0)\]
Similarly we can show that if $m_0 + n_0 > m_1 + n_1$ then $S(m_0, n_0) > S(m_1, n_1)$
------
Now we show injectivity using /Claim 1/
If $S(m_0, n_0) = S(m_1, n_1)$ then by /Claim 1/ $m_0 + n_0 = m_1 + n_1$
Let $s_0 = m_0 + n_0$ and $s_1 = m_1 + n_1$ in this case Let $s = s_0 = s_1$
So,
\[
\implies S(m_1, n_1) - S(m_0, n_0) &= \frac{s_1(s_1 + 1)}{2} - \frac{s_0(s_0 - 1)}{2} + m_1 - m_0 = 0 \]
\[\implies 0 = 0 + m_1 - m_0 \]
\[\implies m_1 = m_0 \]
\[\implies s - m_1 = s - m_0 \]
\[\implies n_1 = n_0 \
\]
Now we show surjectivity
Let $N \in \mathbb{N}$
let $T(s)$ be the largest triangular number less than $N$.
Let $m = N - T(n)$
Let $n = s - m$
Then
$S(m,n) = N$
Since $S: \mathbb{N} \times \mathbb{N} \rightarrow \mathbb{N}$ is both injective and surjective, it is a bijection, we are done.
* An Interesting Applications
*The set of finite subsets of $\mathbb{N}$ is countable.*
Let $A_i$ be set of all subsets of $\mathbb{N}$ containing $i$ elements, that is with cardinality $i$.
$A_1$ is just the set of all singletons of $\mathbb{N}$, there is an obvious bijection of this with $\mathbb{N}$, the identity map - hence it is countable.
Now we just use induction,
Let $A_k$ be countable, then $A_{k + 1} = \bigcup\limits_{i \in \mathbb{N}} \{S \cup i : i \notin S \land S \in A_k \}$ is a countable union of countable sets.
Since all all $A_i$'s are countable the set of all finite subsets $A = \bigcup A_i$ being a countable union of countables is also countable.

View file

@ -6,5 +6,11 @@ Cosmicflow is a site devoted to the interests of Dibyashanu Pati.
I'm currently a student, I love Physics, Mathematics, Astronomy and Computers. I'm currently a student, I love Physics, Mathematics, Astronomy and Computers.
* Recent Blogs
|--------------------------------------------------+------------------+------------------|
| Title | Last Modified | Created |
|--------------------------------------------------+------------------+------------------|
| [[/countable_union_of_countable_sets_is_countable][A Countable Union of Countable Sets is Countable]] | [2024-12-06 Fri] | [2024-12-05 Thu] |

View file

@ -198,18 +198,37 @@
(file-name-sans-extension (file-name-sans-extension
(org-element-property :path link))))) (org-element-property :path link)))))
(let ((exported-link (org-export-custom-protocol-maybe link contents 'html info))) ;; (let ((exported-link (org-export-custom-protocol-maybe link contents 'html info)))
(cond ;; (cond
(exported-link exported-link) ;; (exported-link exported-link)
((equal contents nil) ;; ((equal contents nil)
(format "<a href=\"%s\">%s</a>" ;; (format "<a href=\"%s\">%s</a>"
(org-element-property :raw-link link) ;; (org-element-property :raw-link link)
(org-element-property :raw-link link))) ;; (org-element-property :raw-link link)))
((string-prefix-p "/" (org-element-property :raw-link link)) ;; ((string-prefix-p "/" (org-element-property :raw-link link))
(format "<a href=\"%s\">%s</a>" ;; (format "<a href=\"%s\">%s</a>"
(org-element-property :raw-link link) ;; (org-element-property :raw-link link)
contents)) ;; contents))
(t (org-export-with-backend 'html link contents info))))) ;; (t (org-export-with-backend 'html link contents info))))
(let ((exported-link (org-export-custom-protocol-maybe link contents 'html info)))
(cond
(exported-link exported-link)
((equal contents nil)
(format "<a href=\"%s\">%s</a>"
(org-element-property :raw-link link)
(org-element-property :raw-link link)))
((string-prefix-p "/" (org-element-property :raw-link link))
(format "<a href=\"%s\">%s</a>"
(org-element-property :raw-link link)
contents))
((and (string-match-p (concat "\\." (regexp-opt '("jpg" "jpeg" "png" "gif")))
(org-element-property :raw-link link))
(not (equal contents nil)))
(format "<img src=\"%s\" alt=\"%s\" style=\"max-width: 100%%; height: auto;\">"
(org-element-property :raw-link link)
contents))
(t (org-export-with-backend 'html link contents info))))
)
(defun my/make-heading-anchor-name (headline-text) (defun my/make-heading-anchor-name (headline-text)
@ -256,25 +275,25 @@
(code (org-html-format-code src-block info))) (code (org-html-format-code src-block info)))
(format "<pre>%s</pre>" (string-trim code)))) (format "<pre>%s</pre>" (string-trim code))))
(defun my/org-html-special-block (special-block contents info) ;; (defun my/org-html-special-block (special-block contents info)
"Transcode a SPECIAL-BLOCK element from Org to HTML. ;; "Transcode a SPECIAL-BLOCK element from Org to HTML.
CONTENTS holds the contents of the block. INFO is a plist ;; CONTENTS holds the contents of the block. INFO is a plist
holding contextual information." ;; holding contextual information."
(let* ((block-type (org-element-property :type special-block)) ;; (let* ((block-type (org-element-property :type special-block))
(attributes (org-export-read-attribute :attr_html special-block))) ;; (attributes (org-export-read-attribute :attr_html special-block)))
(format "<div class=\"%s center\">\n%s\n</div>" ;; (format "<div class=\"%s center\">\n%s\n</div>"
block-type ;; block-type
(or contents ;; (or contents
(if (string= block-type "cta") ;; (if (string= block-type "cta")
"If you find this guide helpful, please consider supporting System Crafters via the links on the <a href=\"/how-to-help/#support-my-work\">How to Help</a> page!" ;; "If you find this guide helpful, please consider supporting System Crafters via the links on the <a href=\"/how-to-help/#support-my-work\">How to Help</a> page!"
""))))) ;; "")))))
(org-export-define-derived-backend 'site-html 'html (org-export-define-derived-backend 'site-html 'html
:translate-alist :translate-alist
'((template . my/org-html-template) '((template . my/org-html-template)
(link . my/org-html-link) (link . my/org-html-link)
(src-block . my/org-html-src-block) (src-block . my/org-html-src-block)
(special-block . my/org-html-special-block) ;; (special-block . my/org-html-special-block)
(headline . my/org-html-headline)) (headline . my/org-html-headline))
:options-alist :options-alist
'((:video "VIDEO" nil nil))) '((:video "VIDEO" nil nil)))

View file

@ -2,3 +2,6 @@
# generate the html and gemini versions of the site using org-publish # generate the html and gemini versions of the site using org-publish
emacs -Q --batch -l create-site.el emacs -Q --batch -l create-site.el
rsync -avi ./content/ltximg ./public/cosmicflow-html/
# rm -rf ./content/ltximg/