TITLE: On the definition of weakly compact cardinals
QUESTION [7 upvotes]: I am reading in Jech's Set Theory the chapter about large cardinals. After discussing measurable cardinals he moves on to weakly-compact cardinals, which have been discussed far earlier in the book.
I went back to the chapter dealing with weakly-compact cardinals and began retracing the definition.
Eventually, it came into this:
We denote $[k]^n = \{X \subseteq \kappa\mid |X| = n\}$. If $\lambda$ is a cardinal, we denote $\kappa \to (\lambda)^2$ when for every partition of $[\kappa]^2$ into $2$ we have $H \subseteq \kappa$ that is of cardinality $\lambda$, and for which $[H]^2$ is strictly in one part.
And we say that $\kappa$ is weakly-compact if it satisfies the property $\kappa \to (\kappa)^2$.
The problem is that I'm a bit lost in all those definitions, and not even sure about the $\kappa \to (\lambda)^2$ notation. 
My questions are, if so, can someone help me make some sense into those definitions, and is there an equivalent definition for weakly-compact cardinals which can help me understand their properties better?

REPLY [7 votes]: Let me add to Ivan's answer another equivalent
characterization of weak compactness, which might appeal to
you, as it makes them resemble miniature measurable
cardinals.
Namely, if $\kappa$ is a cardinal and
$\kappa^{<\kappa}=\kappa$, then $\kappa$ is weakly compact
if and only if for every transitive set $M$ of size
$\kappa$ with $\kappa\in M$, there is another transitive
set $N$ and an elementary embedding $j:M\to N$ having
critical point $\kappa$.
This embedding characterization admits myriad forms. For
example, one can insist that $M\models ZF^-$ or even
$M\models ZFC$, and that $M^{<\kappa}\subset M$, or that
every $A\subset \kappa$ can be placed into such an $M$, and so
on. One can even insist that $j\in N$, a property known as
the Hauser property.
These various embedding formulations of weak compactness
allow one to borrow many of the methods and techniques from
much larger large cardinals, which are most often described
in terms of embeddings, and apply them with weakly compact
cardinals. For example, using Easton support forcing
iterations, one can control the value of $2^\kappa$ while
preserving the weak compactness of $\kappa$.