Logic (Greek λογίζω I reckon, I count, from λόγος a word) is a branch of philosophy that deals with and attempts to guide the faculty of human reason.
Aristotle was the first to formalize the practice of reasoning. In particular, Aristotle developed a formalization of the syllogism and the Square of Opposition. While Modus ponens and its complement Modus tollens were known to the Medievals, it is not clear when these central laws of deduction were first formalized.
The next easily identifiable major development in logic comes from Boole in 1847 with the creation of Boolean algebra. In the 1870s, Peirce introduces a logic of quantifiers, followed by Gottlob Frege's 1879 Begriffsschrift, which contains the first complete formalization of the propositional calculus. Frege's work was developed in service of his logicist project, which was shown to be inconsistent by Bertrand Russell in 1903 with what is famously called Russell's paradox.
By the 1950s, with the work of many logicians including Hilbert, Emile Post, Alfred Tarski and Kurt Goedel, most of the major results in first-order logic had been proved, and in the 1960s Saul Kripke added a completeness proof for modal logic.
Most logical systems are bivalent; that is, they admit only two truth-values. However, there is a fair amount of work done on non-bivalent systems of logic, especially intuitionist logic and relevance logic. In intuitionist logic, "true" and "false" are replaced with "proven true", "proven contradictory", and "not proven". In relevance logic, "neither true nor false" and "both true and false" are added to the standard two truth values. There is some debate about the value of these systems in philosophical circles, and Timothy Williamson claims to have a proof that any non-bivalent logic can be converted into a bivalent logic.
Formal logic requires, since Frege, a distinction between the object language and the metalanguage. The metalanguage is ordinarily a natural language like English or German, while the object language is a symbolic language with a limited alphabet and syntax.
The art of rhetoric is sometimes called "informal logic", and the classic fallacies are often described as "logical fallacies", though, strictly speaking, most of them are simply emotionally effective ways to build an invalid argument. Generally speaking, "informal logic" consists of "common sense" and a collection of other rather loose rules that people employ while making most decisions and even in debate. It is unstructured, and depends largely on one's view of "the reasonable". The thresholds of what is "reasonable" and what is not, are inexact and subject to change with the receipt of sufficient contrary evidence--and again, what constitutes "sufficiency" in this context might vary from person to person.
Deduction and induction
Deductive logic is characterized by certainty: in a valid argument, when the premises are true, the conclusion must be true. The certainty, however, comes at a price. Take a classic argument of deductive logic:
Premises: All men are mortal, Socrates is a man Conclusion: Socrates is mortal
The conclusion is "contained" in the premises. In a sense the conclusion is "known" before it is elucidated. The conclusion, "Socrates is mortal" is also less informative than the premises which imply not just that Socrates is mortal but that a lot of other beings (anyone for whom the term "is a man" applies) are also mortal. As a result, deductive logic is not thought to add to knowledge, merely to clarify it.
Inductive logic is ampliative, but is famously less certain. In a good inductive argument, even when the premises are true, it is still possible for the conclusion to be false. A classic example of an inductive argument is:
Premise: All the many swans obversed have been white Conclusion: All swans are white
Before the discovery of Australia the premise was true someone following inductive logic would have reached the conclusion. Given the existence of black swans in Australia, however, that conclusion is false. David Hume's 18th-century critique of induction remains a very pressing problem for disciplines like science which are commonly held to rely on inductive reasoning.
Another example of faulty logic would be when it comes to atheism. Atheists typically use many logical fallacies in an effort to convert people to their religion.
Premise: There is no empirical evidence for something. Conclusion: The object does not exist.
This logical fallacy acts as if absence of evidence is evidence of absence. This can be proven to be a faulty supposition because before America was discovered by Europeans, one could say there are only four continents based upon the evidence. This would be treated as a fact despite it being proven false later on. Also, this premise ignores the fact that there are multiple types of knowledge. There is empirical knowledge and then there is knowledge one has through faith. An example would be the knowledge that a mother loves her son. This cannot be proven to be a lie, but people have faith that is it true.
Uses of logic in other disciplines
Logic is a necessary discipline in philosophy, because it deals with how we study and interact with the world and with other people in it. Logic and mathematics are also closely connected, and much of mathematics can be reduced to first-order logic, though Goedel's Incompleteness theorem shows that not all of mathematics can be so reduced.
In computer science, logic dictates how a machine will follow a set of instructions, including how to test its "world," evaluate it, and act according to that evaluation. Every computer language includes its own version of the language of symbolic logic, except that instead of establishing propositions, a computer following a program is usually choosing between and among different commands to execute.
Logic, and especially formal logic, inform the discipline of critical thinking—which, by no coincidence, takes its name from the Greek word for a judge. Indeed, judges and juries in courts of law must apply logic, both formal and informal, to arrive at their decisions. Formal logic will usually serve to state what obedience to a given body of law requires; informal logic must usually serve a trier of fact charged with deciding whether a given person was in obedience or in violation. The latter principle holds primarily because plaintiff and defendant in a court of law quite often do not agree on matters of fact. Logic, and especially formal logic, inform the discipline of critical thinking--which, by no coincidence, takes its name from the Greek word for a judge. Indeed, judges and juries in courts of law must apply logic, both formal and informal, to arrive at their decisions. Formal logic will usually serve to state what obedience to a given body of law requires; informal logic must usually serve a trier of fact charged with deciding whether a given person was in obedience or in violation. The latter principle holds primarily because plaintiff and defendant in a court of law quite often do not agree on matters of fact.