Perjury

Perjury is willfully lying under oath, usually in a court of law, but also under certain other specific circumstances, such as testifying before Congress (in the US).

The favorite way to avoid perjury in modern times, perfected by Ronald Reagan under the sad influences of "plausible deniability" and Alzheimer's Disease, is to claim to "have no memory".

Famously, of course, William Jefferson Clinton was caught covering his own ass in a gentleman's white lie regarding the honor of a young lady wherein he stated "I did not have sexual relations with that woman" while being interrogated about other matters (though this was in a press conference, not under oath). As for the actual legal testimony, we at the site will officially call it perjury, even if not actually the case. Fifty million dollars later, it was proved that he had, indeed, interfered with said woman's honor. So he was impeached Congress initiated impeachment proceedings against him and later he was acquitted of all charges.

Indictments for perjury are often paired with "obstruction of justice", at least in the US, since the process of lying under oath almost by definition obstructs the course of justice in a case.

Historically
In the Middle Ages, oaths were taken on relics. Thus, perjury was both a religious and a secular transgression, which usually carried the double penalty of excommunication and forfeiture of legal rights. This in turn meant that the perjurer would be unable to take oaths in future court trials, being instead forced to defend himself through the ordeal, single combat, or similarly less-optimal means. Unless, of course, a saint descended from the heavens and smote the perjurer dead upon the spot with righteous fury. That happened only rarely, however, and was known as Argumentum e silentium.

In ancient Judaic law (Halakha), it was punished by inflicting upon the perjurer the same punishment as he had meant to cause against someone else through the perjury.

Variations on a theme
In the United States, perjury (18 U.S.C. § 1621) is not the only form of lying that is criminal.
 * Perjury not only requires lying under oath, but it requires that the lie was a material misstatement and that it was willful (that the person knowingly lied when they said the lie). For these reasons, perjury is extremely difficult to prove, and prosecutors will often try to prosecute other charges instead.
 * Making "false statements" (18 U.S.C. § 1001) is "knowingly and willfully… [making] any materially false, fictitious, or fraudulent statement or representation… [regarding] any matter within the jurisdiction of the legislative branch." It is not required that the statement be under oath, and the law has a broad sweep.
 * Other parts of US Code can also involve lies, including obstruction of justice (18 U.S.C. § 1505 and 18 U.S.C. § 1515(b)).

Perjury trap
The obscure legal concept of a perjury trap was brought into public consciousness in 2018 by the Mueller investigation due to Trump's lawyer, Rudolph Giuliani, claiming that Special Prosecutor Mueller was trying to catch Trump with a perjury trap should he be interviewed under oath.

In law, a perjury trap occurs when a prosecutor calls a witness to testify under oath with the intent of coercing the witness to lie and thereby commit perjury. Although claims of a perjury trap are common when the testimony is before a grand jury, "…there are no federal cases granting a motion to dismiss because of a perjury trap. Defense counsel should never raise the perjury-trap defense."

Clearly, Giuliani's real fear was that because Trump is a pathological liar, Trump would not be able to tell the truth under oath.