TITLE: Is formal truth in mathematical logic a generalization of everyday, intuitive truth?
QUESTION [31 upvotes]: I'm trying to wrap my head around the relationship between truth in formal logic, as the value a formal expression can take on, as opposed to commonplace notions of truth.
Personal background: When I was taking a class in formal logic last semester, I found that the most efficient way to do my homework was to forget my typical notions of truth and falsehood, and simply treat truth and falsehood as formal, abstract values that formal expressions may be assigned. In other words, I treated everything formally, which from the name of the course is presumably what I was supposed to do while solving problems.
On the other hand, I came out of the course more confused than enlightened about what truth refers to in mathematics. For example, on what levels are each of the following two statements "true"?


There are infinitely many prime numbers.
The empty function $f\colon \emptyset \to \mathbb R $ is injective.


For the first one, I can obviously see that there would be a contradiction if there were only finitely many prime numbers. To me, the classic proof by contradiction is not a "formal proof" or anything; it is merely a natural language argument that proves (in the everyday sense of the word "proves") why the statement must be true (in the everyday sense of the word "true").
On the other hand, I run into trouble when I try to think about the second one. The very concept of the "empty function" doesn't even feel like it makes sense, but if I think about it as the relation between $\emptyset$ and $\mathbb R$ containing no elements, and then try to write out the statement formally, I get (if I did it correctly)

$
\forall x \forall y ( ((x\in \emptyset) \land (y\in \emptyset) \land (f (x) = f (y))) \implies (x=y))
$

which I think has to be true in a formal sense (since the antecedent is always false?). But to be honest, I don't really know how to think about "truth" here; the situation feels much more confusing than with the first statement.
So, in conclusion, my questions are:

In what sense is each of the above statements "true"? And, more generally,
Is the notion of truth in (mathematical) logic just a formal value assigned to expressions? Or should I think of it as encompassing, but also generalizing, the intuitive notion of a true statement?

(Any insightful comments or answers are appreciated, even if they don't address all of my questions directly.)

REPLY [7 votes]: From a philosophical point of view this is really a big question to ask! Actually one would need a good notion of all day truth as well as of mathematical truth, to answer this question. What truth in an all-day sense could possibly mean is discussed virtually all the time throughout the history of philosophy, and I will skip this here.
The question what truth in mathematics could mean was one of the main subjects in the Foundational crisis in the early 20th century and is widly discussed ever since. The second (and highly related) question was (and is): what are the objects of mathematics? Back then there were mainly three points of view: The platonist, who thinks there are some kind of blueprints of mathematical objects and all one does, is discovering some truth (in a rather all day sense of truth) about their properties. The formalist, who does not think, mathematical objects exist at all, they are rather implicitly defined by some axioms and then truth is nothing else then consistency with these axioms. And last the intuitionist, who thinks mathematical objects are creatures of human mind. The starting point for the intuitionist is the ability to count, which amounts into the natural numbers.  Everey other object and every true statement then has to be constructed out of these first objects and some basic logic, wich does not include the law of excluded middle, i.e. no proof by contradiction. Astonishingly enough it is possible to reconstruct a quite rich part of mathematics even in a pure intuinitionist flavour.
Throughout the 20th century there were a lot of mathematical and philosohical writings around these question (see Hilbert, Brower, Whitehead, Putnam, Günther, Turing, Gödel and many others). Luckily this philosophical uncertainity didn't keep mathematicians from doing mathematics. What I think is really interesting is the capability of switching between the different states: Attacking a problem requires often (at least in my field of interest which is differntial geometry) first to get a good intuition about the objects (this is the platonist part), some strong constructive work inside the mind (this is the intuitionist part) and finally putting everything down into a rigorous proof (that is the formalist part). And most often this is not a linear process, rather a continous going forth and back... 
As Reuben Hersh put it: "“The working mathematician is a Platonist on weekdays, a formalist on weekends. On weekdays, when doing mathematics, he’s a Platonist, convinced he’s dealing with an objective reality whose properties he’s trying to determine. On weekends, if challenged to give a philosophical account of this reality, it’s easiest to pretend he doesn’t believe in it. He plays formalist, and pretends mathematics is a meaningless game.... Does it matter? Yes. Truth and meaning aren’t recondite technical terms. They concern anyone who use or teaches mathematics."
If by chance you understand german: There is a really nice book of a sociologist, who did some research on how the mathematical community works and what are the main characteristics of mathematics compared to other scientific fields. It gives a good bases on some philosophical background and quiet interesting insights into the mechanics of mathematical research. Bettina Heintz: Die Innenwelt der Mathematik.
Another good question enters the game: What is the connection between mathematics and "reality"? More precicly: How does mathematics and it's applications to science, social science, engineering and so forth interact? If mathematics was just a technical game, or some construct in human mind, how is it possible, that it has such a rich field of applications? On the other hand: Do all this applications imply, that mathematical objects really live in the physical world, and if so, what does this imply for beeing able to make true statement? See for example papers of Putnam, which include deep thoughts in this direction.
Not much of an answer, more of a loos collection of some thought. Hope it gives some input though!