# Prove that a function is a total function (as opposed to a partial function)

I've got as part of an assignment to determine whether a given function is total, and if so, to say whether it's injective, surjective, or bijective. I can tell the answer by looking at it, but I feel that I need to make some kind of concrete proof that the function is total.

$$f:\mathbb{N}\to \mathbb{N},f(x)=x^2+4$$

I can tell by looking at it that it's a one-to-one total function. But is there a satisfactory way I can prove that this is a total function? I'm extremely new to this whole idea of functions outside of algebraic functions (such as total and partial functions)...

-
What is your definition of "partial function"? – wj32 Nov 7 '12 at 2:32
– agent154 Nov 7 '12 at 2:34

1
If your definition of partial function is the usual one ($f\subseteq X\times Y$ is a partial function from $X$ to $Y$ if $f$ is a function from some subset of $X$ to some subset of $Y$), then this $f$ is clearly total: it’s defined on all of $\Bbb N$. – Brian M. Scott Nov 7 '12 at 2:35
@agent154: I don't think I made my point very well :). What I was suggesting was for you to go back to the definition and see why it is so easy to "tell the answer by looking at it". – wj32 Nov 7 '12 at 2:39
Or in other words: is it true that $f(n)$ is defined for every $n\in\Bbb N$? – Brian M. Scott Nov 7 '12 at 2:41
show 4 more comments

## 2 Answers

To formally prove that it's a total function, you need to look up the definitions/basic theorems about $\mathbb{N}$ and multiplication (or squaring) and addition, and check that

1. $x^2+4$ has a fixed value for each $x\in\mathbb{N}$.
2. That value is actually in $\mathbb{N}$. (This is something to check if your definitions only ensure it's in $\mathbb{Z}$, or something like that.)

Since I don't have your definitions, and you may not even have definitions for some of this stuff, I can't help you further except to say "if you don't have definitions for something, just argue intuitively for that part".

-

That does seem a little beyond me at this point... But then again, this whole question was beyond what I should have been doing at this point in the class. This professor likes to ask questions on assignments for which he hasn't even covered the material. I ended up passing in the assignment last week and forgot to mark this question as answered. Thanks anyhow though. – agent154 Nov 13 '12 at 1:56
Well, you're probably not expected to worry about formally proving it completely rigorously at this level. But you seemed worried about rigor, so I described what more rigor would be like. If you feel this question is answered you can either accept my answer or add an answer of your own and accept that (since you had an answer first), or I think you can vote to delete your question if you really want. – Mark S. Nov 13 '12 at 1:59

I went with Brian's suggestion from above comments:

You have the idea. How about: Let $n\in \mathbb{N}$. $\mathbb{N}$ is closed under multiplication and addition, so $f(n)=n^2+4\in \mathbb{N}$. Therefore f is total.

-
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 18, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9712137579917908, "perplexity_flag": "head"}