Showing posts with label gemini. Show all posts
Showing posts with label gemini. Show all posts

Friday, October 23, 2026

Math Self-Study Progress Report 4 (Gemini Pro No More)

I guess I'm officially halfway.  I just finished chapter 4 and there are 4 more chapters to go.

Chapter 4 focuses on continuity.  Compared to the first 3 chapters, I felt like I was able to finish the exercises more quickly.  I don't know if it's because I'm getting better as I am gaining more knowledge, or because of the materials.  So far, I generally found that I have been struggling with materials related to set theory and topology.  I think the hardest chapter so far was chapter 3, the chapter before this one, where the concepts of open set, closed set, limit point, compactness, connected-ness, open cover etc. were introduced.  I still found them non-intuitive.  On the contrary, I already studied continuity (uniform continuity was new though), albeit not with the $\epsilon-\delta$ definition, when I was in secondary school.  Since we're still in the realm of real numbers and single-variable functions, I can draw graphs and pictures to help myself understand a lot of the concepts.

The chapter started with the Dirichlet's function, which I've seen when I was in secondary school.  So no surprise.  I always wonder what US students would feel if they were only learning this for the first time.  Pretty shocking, I would imagine.  But the Tomae's function was new.  It was one of the most impressive things in this chapter (the other one was the classification of the set of discontinuities) because the function is discontinuous on rational numbers only.  The author then posed a question of whether we can construct a function that is discontinuous at every irrational and only irrationals.  It was extremely satisfying to arrive at the proof in the last chapter (no, it's impossible).

One thing I really love about this book is that the author would from time to time throw in bits of mathematical history.  For example, the Intermediate Value Theorem was not rigorously proven until the early 19th century.  It reminds me again that huge progress in math was actually made quite recently.  I still consider Newton and Leibniz's invention of calculus as the biggest turning point after Euclid.

Back to the question of whether there's a function discontinuous at only the irrationals.  The book did not give the proof but instead presented it as a guided exercise.  The most important idea is $\alpha$-continuity, which is a slight relaxation of the continuity definition.  It is very interesting that by relaxing a requirement, or creating a slightly weaker version of a definition can lead to some powerful results.  If I only have the strict continuity definition, I could imagine that it'd be hard to classify the set of discontinuities for all functions.  But through a weaker definition of continuity, $\alpha$-continuity, it's actually quite straightforward to show that the set of discontinuities must be an $F_{\sigma}$ set.  

(Click to enlarge)

This is an amazing result.  Think about it: it's not just for a specific discontinuous function but ANY real-value function that is discontinuous must obey!  Again, so much talk about AI conquering the math landscape but I wonder if AI can come up with such an idea.  Maybe it can because in this case it feels natural to go from strict continuity to $\alpha$-continuity.  But maybe not.  I don't know.

Speaking about AI, I got an email from Google recently that Gemini Pro will be restricted to Google Pro tier customers starting mid-November.  Unless I pay double the amount I'm paying now (I'm on Google Plus tier) I'll soon lose access to Gemini Pro.  I know I said it earlier that I would be willing to pay because Gemini Pro has been so good, but because I've recently decided to pay for YouTube Premium, I'm very hesitant to commit to another subscription.  And so I tried out Gemini Flash with their High Thinking mode for the last 2 sections of chapter 4 to test out how it compares to Pro.  My initial impression has been very good.  I feel like it's powerful enough for my self-study.  The experience is actually quite similar to the time when I was using DeepSeek, though Gemini Flash is more polished in my opinion.  But it's only slightly better.  Will be interesting to see how it goes for the next few chapters.

Next chapter is about derivatives.  I know how to apply L'Hospital's Rule but I've never seen a proof all these years.  I'm really looking forward to it.

Wednesday, September 23, 2026

Math Self-Study Progress Report 3 (and Gemini's Betrayal, Sort Of)

I just finished Chapter 3 of Stephen Abbott's Understanding Analysis.  It's only around 25 pages, but I feel that some of the concepts are going to be important in later chapters that I took time to digest them.  Another reason that I went slow was because I tend to struggle with set theory.  I still remember when I first got the taste of it back in Form 7.  It was unlike any other material I've studied before.  I was told that that was real math, and what I had been studying before was merely computation (not that computation is easy).  Anyway, to me, definitions and theorems in set theory always read like legal documents where every word matters.

Oh! I finally got the physical book from Amazon.  It makes my study so much better.  I still prefer physical books, especially for studying, because I usually jump back and forth for reference.

Chapter 3 started by introducing the Cantor set, one of the most non-intuitive weird mathematical objects I've ever encountered.  It then went through open and closed sets, compact sets, open covers, perfect and connected sets, and finally concluded with Baire's Theorem.

There are certain things in math that I still remember from secondary school, like how to derive the quadratic formula, or how to expand $\sin{(\alpha+\beta)}$, or integration by parts etc.  I think Cantor set will likely be added to that list.  It's uncountable, yet nowhere-dense, and free of any isolated points.  How can this happen?  In my opinion, Cantor sits right next to Newton, Euler and Gauss as the greatest mathematicians of all times.

I've been using Gemini Pro throughout, with occasional use of DeepSeek when I needed a "second opinion."  This time, I didn't prompt Gemini with things like "Be my TA", but just asked him to check my answers and clarify concepts.  It certainly toned down the unnecessary praise and I felt much more comfortable.  Again, Gemini has become indispensable in my self-study because it corrected a lot of mistakes I made in exercises that I would otherwise miss.  And of course, there are exercises that I would not be able to complete without Gemini's hints.

Speaking about hints, there was one exercise where I was asked to come up with a way to construct a perfect set of irrational numbers.  It gave me two hints, each of which pointed to a slightly different direction.  Here's the screenshot.  Click to enlarge.

So, I thought about #1 for around a day and asked for help again.  Here's Gemini's response.

So, I explored the closure of $F$, thinking that I would get what I desired.  But then when I tried to prove it, I got stuck.  So, I asked Gemini again.  This time, the response felt like betrayal.  I was quite disappointed when I read it.

Did Gemini intentionally lead me through a dead end path or what?  I don't know.  Anyway, I didn't feel too bad because I don't think it's wasted time.  My brain burned through some cycles, useful cycles, to think through the problem.

I'm quite surprised that I've gotten this far.  Next would be Chapter 4 about continuity.

============================================================

There's been a lot of controversy and discussion around math and AI ever since OpenAI announced a solution to the Naiver-Stokes equation.  Terrance Tao, along with 25 Fields medalists, signed an open letter titled "A Severe Misalignment of AI in Mathematics."  I actually wanted to sign, but I don't want to create my own ORCID.  Just too many accounts already.  I agree with the general sentiment of the open letter.  I also have a number of things I want to say, as an enthusiast.

First, I believe the most important things in math are not problems and proofs, but mathematical ideas.  Like what I've just studied regarding Cantor set, it raises questions about the size of sets, and thus the ideas of cardinality, measure, and density were born.   They all describe a set's size but are independent concepts.  Calculus is a mathematical idea, so are complex numbers, and irrational numbers.  The proof that $\sqrt{2}$ is irrational is important, but not as important as the idea of irrational numbers themselves, that there are things beyond fractions waiting to be explored.

Second, the Millennium Problems should not be treated as Math Olympiad.  These problems raised questions that invite further exploration.  They're not meant to be homework sets, which I feel is what OpenAI has been treating them.  In Chinese, "數學不是刷題".

Lastly, I'm optimistic though that AI will not replace mathematicians anytime soon because of the exact same reason.  New mathematical ideas need time to develop.  When Cantor first published his proof that the real numbers are uncountable, it was met with enormous opposition, including from his teacher.  It took the mathematical community 25-30 years to accept Cantor's ideas, which have become the cornerstone of what we're all studying today.  Or take calculus as another example.  Newton and Leibniz started in the 17th century and it took around 300 years to lay a solid foundation, which became what I'm self studying today - real analysis.  AI may be very good at solving problems but I have yet to see any new mathematical ideas developed.  

One last analogy or food for thoughts.  Let's equip AI with all the knowledge up to the 1500s, and ask it to find a solution to the equation $x^2 + 1= 0$.  I bet AI would come back to say there's no solution.  It takes a human to invent complex numbers. 


Wednesday, September 2, 2026

Math Self-Study Progress Report 2 (DeepSeek Expert vs Gemini Pro)

Chapter 2 Report

I've just finished studying Chapter 2 of Stephen Abbott's Understanding Analysis.  It covers sequences and series, convergence, limits, Bolzano-Weierstrass Theorem, Cauchy Criterion and some more.  For me, the most satisfying result is how absolute convergence guarantees that you'll arrive at the same limit no matter how you perform your summation.  I don't remember any of my secondary school teacher ever mentioning that order of summation sometimes matters.  And I only knew about this for the first time when I was watching a math related YouTube video, may be 10-20 years ago.  The Bolzano-Weierstrass Theorem was quite shocking.  I guess subsequence was never in the A-Level syllabus so I never gave any thoughts about it.

What's most interesting in this chapter, in my opinion, is when Abbott talks about the relationship between Axiom of Completeness (AoC), Archimedean Property (AP), Nested Interval Property (NIP), Monotone Convergence Theorem (MCT), Bolzano-Weierstrass (BW), and Cauchy Criterion (CC).  If you assume AP, all the others are equivalent and you can assume one and derive all others.  I have to admit that I didn't give much thoughts when I first read it.  But as I read it again and again, its deepness started to sink in.  My math teacher in Form 6-7 once told me that being a math major in college, one of the hardest things is to be able to immediately appreciate the theorems proved in class.  This is because you'll get indigestion easily when you go to multiple math classes during the day.  I think I now understand what he was saying.

There's an unexpected bonus while I was studying Chapter 2 - I picked up LaTeX.  I have updated the theme of this blog so that I can embed LaTeX in my blog posts. 😁

DeepSeek vs Gemini

For the first few sections (2.1-2.5) in Chapter 2, I used both DeepSeek Expert and Gemini Pro.  I was curious how each responds to the same question.  I've reached the conclusion that I'll be using Gemini Pro from now on.  In fact, I have been using Gemini exclusively starting from Section 2.6.  I didn't pay for Gemini Pro but I got higher usage limits because I pay for Google Drive.  But for $20 a month, I would be willing to pay if I were to use it for my self study.  Yes, it's that good.

First of all, DeepSeek gives answers quicker than Gemini.  But it also made more mistakes.  Gemini Pro is very deliberate.  It would think for 10-15 seconds before answering but it's rarely wrong.  I also like Gemini Pro's writing better.  It feels more like human writing, whereas DeepSeek's writing feels a little bit "stiff" and a bit "cold."  The only problem I have with Gemini is that it's praising me too much whenever I have the correct answer.  It's okay to do it occasionally but there's no need to do it every time.

I have yet to catch a mistake from Gemini.  One time, I was asking whether my algorithm works and it said no.  But when I pointed out that it misunderstood what I was saying, it was able to recover.  I believe there was another time when I thought a bound can be relaxed (e.g. from < to <=) and Gemini only agreed when I pointed it out explicitly.  On the other hand, DeepSeek feels a little bit rough on the edges.

To illustrate the difference between DeepSeek and Gemini, here's an exercise I was doing.  Click on the images to enlarge since they're hard to see within the web page.  Basically, it's about proving Bolzano-Weierstrass (BW) directly by defining a set based on the bounded sequence $(a_{n})$.  Solving this amounts to coming up with an algorithm that picks out a subsequence that converges to the least upper bound of this newly defined set, thus proving BW.

I was naively thinking that if $(a_{n})$ is bounded, i.e. $|a_{n}| < M$ for all $n$, then there's always infinitely many terms to choose from in the interval $[-M, s)$, where $s$ is the least upper bound of the set we define.  And I thought (again naively) I can then repeatedly halve the interval and still end up with infinitely many terms each time. Thus, at each step, I can pick out a term within that interval to form the desired subsequence.

Here's the answer I gave to Gemini.



As you can see, it immediately pointed out my error, and was able to give me a counterexample right away.

Here's the same answer given to DeepSeek.

DeepSeek got it wrong.  It made the same mistake I did, that the sequence is always approaching $s$ from below, and therefore concluded that the interval $[-M, s)$ contains infinitely many terms!

Afterwards, it recovered after I challenged him.  It actually gave the same counterexample as Gemini did.

Conclusion

I did the whole Chapter 1 with DeepSeek and it was good.  As I said before, I wouldn't have survived this self-study without it.  But after going through Chapter 2 with both DeepSeek and Gemini, I prefer the latter.  Gemini Pro is simply better.

Next is Chapter 3, which talks about compact sets.