# Maximum modulus principal for complex valued functions

Sorry for posting two threads, these question are kind of related. i just don't understand something important here:

The definition of the Maximum Principle, as given in Gamelin's "Complex Analysis", p. 88:

Maximum Principle. Let h(z) be a complex-valued harmonic function on a bounded domain D \$ h(z) extends continuously to the boundary ∂D of D. If |h(z)|≤M for all z in ∂D, then |h(z)| ≤ M for all z in D.

OK... so we begin with the assumption that h(z) is a complex valued harmonic function that is continuous on the set D U ∂D. It is my understanding that D U ∂D is a compact set. Now, there is a theorem in section II.1 of the book which states: a continuous real valued function on a compact set attains its maximum. Also we know that a continuous real valued function on closed bounded interval is bounded. My first question is: Do these two properties extend to complex valued functions? The reason I ask is because the proof for the maximum principle begins by saying: "The proof of the maximum principle hinges on the fact that a continuous function on a compact set attains its maximum modulus at some point on the sec. See Section II.1" OK, now that that is out of the way... if those properties do apply to complex valued functions, doesn't that mean that h(z) is bounded on D U ∂D? So doesn't that mean that |h(z)| ≤ M for all z in D and for all z in ∂D? Then why does the theorem require the statement: If |h(z)|≤M for all z in ∂D? Won't it be true regardless?

OK... a second question. If those properties I mentioned extend to the complex valued functions, when I approach this it seems there are two scenarios: since we know h(z) attains its max, we know that it attains it either on a point in D or a point in the boundary ∂D. Now, if h(z) takes on its max value at some point on D, we know that h(z) is constant (by the strict maximum principle, I'll list that below for reference). How do we know where it attains its max (on D or on the boundary of D)? Do we always have to use the information that if it happens on D then its constant? Can harmonic functions be constant? (i know that question sounds stupid)

OK... I feel like I am gravely misunderstanding these kind of simple theorems and I would really love somebody to tell me where I'm going wrong. for some reason,, this max modulus principle is really confusing me.

by the way, here is the Strict maxiumum principle (complex version), p.88 of Gamelins "Complex Analysis": Let h be a bounded complex valued harmonic function on a domain D. If |h(z)| ≤ M for all z in D, and |h(z_{0})| = M for some z_{0} in D, => h(z) is constant on D.