Logic (from the Greek "logos", which has a variety of meanings including word, thought, idea, argument, account, reason or principle) is the study of reasoning, or the study of the principles and criteria of valid inference and demonstration. It attempts to distinguish good reasoning from bad reasoning.

Aristotle defined logic as "new and necessary reasoning", "new" because it allows us to learn what we do not know, and "necessary" because its conclusions are inescapable. It asks questions like "What is correct reasoning?", "What distinguishes a good argument from a bad one?", "How can we detect a fallacy in reasoning?"

Logic investigates and classifies the structure of statements and arguments, both through the study of formal systems of inference and through the study of arguments in natural language. It deals only with propositions (declarative sentences, used to make an assertion, as opposed to questions, commands or sentences expressing wishes) that are capable of being true and false. It is not concerned with the psychological processes connected with thought, or with emotions, images and the like. It covers core topics such as the study of fallacies and paradoxes, as well as specialized analysis of reasoning using probability and arguments involving causality and argumentation theory.

Logical systems should have three things: consistency (which means that none of the theorems of the system contradict one another); soundness (which means that the system's rules of proof will never allow a false inference from a true premise); and completeness (which means that there are no true sentences in the system that cannot, at least in principle, be proved in the system).

In Ancient India, the "Nasadiya Sukta" of the Rig Veda contains various logical divisions that were later recast formally as the four circles of catuskoti: "A", "not A", "A and not A" and "not A and not not A". The Nyaya school of Indian philosophical speculation is based on texts known as the "Nyaya Sutras" of Aksapada Gautama from around the 2nd Century B.C., and its methodology of inference is based on a system of logic (involving a combination of induction and deduction by moving from particular to particular via generality) that subsequently has been adopted by the majority of the other Indian schools.

But modern logic descends mainly from the Ancient Greek tradition. Both Plato and Aristotle conceived of logic as the study of argument and from a concern with correctness of argumentation. Aristotle produced six works on logic, known collectively as the "Organon", the first of these, the "Prior Analytics", being the first explicit work in formal logic.

Aristotle espoused two principles of great importance in logic, the Law of Excluded Middle (that every statement is either true or false) and the Law of Non-Contradiction (confusingly, also known as the Law of Contradiction, that no statement is both true and false). He is perhaps most famous for introducing the syllogism (or term logic) (see the section on Deductive Logic below). His followers, known as the Peripatetics, further refined his work on logic.

In medieval times, Aristotelian logic (or dialectics) was studied, along with grammar and rhetoric, as one of the three main strands of the trivium, the foundation of a medieval liberal arts education.

Logic in Islamic philosophy also contributed to the development of modern logic, especially the development of Avicennian logic (which was responsible for the introduction of the hypothetical syllogism, temporal logic, modal logic and inductive logic) as an alternative to Aristotelian logic.

In the 18th Century, Immanuel Kant argued that logic should be conceived as the science of judgment, so that the valid inferences of logic follow from the structural features of judgments, although he still maintained that Aristotle had essentially said everything there was to say about logic as a discipline.

In the 20th Century, however, the work of Gottlob Frege, Alfred North Whitehead and Bertrand Russell on Symbolic Logic, turned Kant's assertion on its head. This new logic, expounded in their joint work "Principia Mathematica", is much broader in scope than Aristotelian logic, and even contains classical logic within it, albeit as a minor part. It resembles a mathematical calculus and deals with the relations of symbols to each other.

Logic in general can be divided into Formal Logic, Informal Logic and Symbolic Logic and Mathematical Logic:

Formal Logic:
Formal Logic is what we think of as traditional logic or philosophical logic, namely the study of inference with purely formal and explicit content (i.e. it can be expressed as a particular application of a wholly abstract rule), such as the rules of formal logic that have come down to us from Aristotle. (See the section on Deductive Logic below).
A formal system (also called a logical calculus) is used to derive one expression (conclusion) from one or more other expressions (premises). These premises may be axioms (a self-evident proposition, taken for granted) or theorems (derived using a fixed set of inference rules and axioms, without any additional assumptions).Formalism is the philosophical theory that formal statements (logical or mathematical) have no intrinsic meaning but that its symbols (which are regarded as physical entities) exhibit a form that has useful applications.

Informal Logic:
Informal Logic is a recent discipline which studies natural language arguments, and attempts to develop a logic to assess, analyse and improve ordinary language (or "everyday") reasoning. Natural language here means a language that is spoken, written or signed by humans for general-purpose communication, as distinguished from formal languages (such as computer-programming languages) or constructed languages (such as Esperanto).
It focuses on the reasoning and argument one finds in personal exchange, advertising, political debate, legal argument, and the social commentary that characterizes newspapers, television, the Internet and other forms of mass media.

Symbolic Logic:
Symbolic Logic is the study of symbolic abstractions that capture the formal features of logical inference. It deals with the relations of symbols to each other, often using complex mathematical calculus, in an attempt to solve intractable problems traditional formal logic is not able to address.
It is often divided into two sub-branches:

Predicate Logic: a system in which formulae contain quantifiable variables. (See the section on Predicate Logic below).

Propositional Logic (or Sentential Logic): a system in which formulae representing propositions can be formed by combining atomic propositions using logical connectives, and a system of formal proof rules allows certain formulae to be established as theorems. (See the section on Propositional Logic below).

Mathematical Logic:
Both the application of the techniques of formal logic to mathematics and mathematical reasoning, and, conversely, the application of mathematical techniques to the representation and analysis of formal logic.
The earliest use of mathematics and geometry in relation to logic and philosophy goes back to the Ancient Greeks such as Euclid, Plato and Aristotle.Computer science emerged as a discipline in the 1940's with the work of Alan Turing (1912 - 1954) on the Entscheidungsproblem, which followed from the theories of Kurt Gödel (1906 - 1978), particularly his incompleteness theorems. In the 1950s and 1960s, researchers predicted that when human knowledge could be expressed using logic with mathematical notation, it would be possible to create a machine that reasons (or artificial intelligence), although this turned out to be more difficult than expected because of the complexity of human reasoning.
Mathematics-related doctrines include:

Logicism: perhaps the boldest attempt to apply logic to mathematics, pioneered by philosopher-logicians such as Gottlob Frege and Bertrand Russell, especially the application of mathematics to logic in the form of proof theory, model theory, set theory and recursion theory.

Intuitionism: the doctrine which holds that logic and mathematics does not consist of analytic activities wherein deep properties of existence are revealed and applied, but merely the application of internally consistent methods to realize more complex mental constructs.

Deductive reasoning concerns what follows necessarily from given premises (i.e. from a general premise to a particular one). An inference is deductively valid if (and only if) there is no possible situation in which all the premises are true and the conclusion false. However, it should be remembered that a false premise can possibly lead to a false conclusion.

Deductive reasoning was developed by Aristotle, Thales, Pythagoras and other Greek philosophers of the Classical Period. At the core of deductive reasoning is the syllogism (also known as term logic),usually attributed to Aristotle), where one proposition (the conclusion) is inferred from two others (the premises), each of which has one term in common with the conclusion. For example:

Major premise: All humans are mortal.Minor premise: Socrates is human. Conclusion: Socrates is mortal

An example of deduction is:

All apples are fruit.
All fruits grow on trees.
Therefore all apples grow on trees.

One might deny the initial premises, and therefore deny the conclusion. But anyone who accepts the premises must accept the conclusion. Today, some academics claim that Aristotle's system has little more than historical value, being made obsolete by the advent of Predicate Logic and Propositional Logic (see the sections below).

Inductive reasoning is the process of deriving a reliable generalization from observations (i.e. from the particular to the general), so that the premises of an argument are believed to support the conclusion, but do not necessarily ensure it. Inductive logic is not concerned with validity or conclusiveness, but with the soundness of those inferences for which the evidence is not conclusive.

Many philosophers, including David Hume, Karl Popper and David Miller, have disputed or denied the logical admissibility of inductive reasoning. In particular, Hume argued that it requires inductive reasoning to arrive at the premises for the principle of inductive reasoning, and therefore the justification for inductive reasoning is a circular argument.

An example of strong induction (an argument in which the truth of the premise would make the truth of the conclusion probable but not definite) is:

All observed crows are black.
Therefore:
All crows are black.

An example of weak induction (an argument in which the link between the premise and the conclusion is weak, and the conclusion is not even necessarily probable) is:

I always hang pictures on nails.
Therefore:
All pictures hang from nails.

Modal Logic is any system of formal logic that attempts to deal with modalities (expressions associated with notions of possibility, probability and necessity). Modal Logic, therefore, deals with terms such as "eventually", "formerly", "possibly", "can", "could", "might", "may", "must", etc.

Modalities are ways in which propositions can be true or false. Types of modality include:

Alethic Modalities: Includes possibility and necessity, as well as impossibility and contingency. Some propositions are impossible (necessarily false), whereas others are contingent (both possibly true and possibly false).

Temporal Modalities: Historical and future truth or falsity. Some propositions were true/false in the past and others will be true/false in the future.

Deontic Modalities: Obligation and permissibility. Some propositions ought to be true/false, while others are permissible.

Epistemic Modalities: Knowledge and belief. Some propositions are known to be true/false, and others are believed to be true/false.

Although Aristotle's logic is almost entirely concerned with categorical syllogisms, he did anticipate modal logic to some extent, and its connection with potentiality and time. Modern modal logic was founded by Gottlob Frege, although he initially doubted its viability, and it was only later developed by Rudolph Carnap (1891 - 1970), Kurt Gödel (1906 - 1978), C.I. Lewis (1883 - 1964) and then Saul Kripke (1940 - ) who established System K, the form of Modal Logic that most scholars use today).

Propositional Logic (or Sentential Logic) is concerned only with sentential connectives and logical operators (such as "and", "or", "not", "if ... then ...", "because" and "necessarily"), as opposed to Predicate Logic (see below), which also concerns itself with the internal structure of atomic propositions.

Propositional Logic, then, studies ways of joining and/or modifying entire propositions, statements or sentences to form more complex propositions, statements or sentences, as well as the logical relationships and properties that are derived from these methods of combining or altering statements. In propositional logic, the simplest statements are considered as indivisible units.

The Stoic philosophers in the late 3rd century B.C. attempted to study such statement operators as "and", "or" and "if ... then ...", and Chrysippus (c. 280-205 B.C.) advanced a kind of propositional logic, by marking out a number of different ways of forming complex premises for arguments. This system was also studied by Medieval logicians, although propositional logic did not really come to fruition until the mid-19th Century, with the advent of Symbolic Logic in the work of logicians such as Augustus DeMorgan (1806-1871), George Boole (1815-1864) and Gottlob Frege.

Predicate Logic allows sentences to be analysed into subject and argument in several different ways, unlike Aristotelian syllogistic logic, where the forms that the relevant part of the involved judgments took must be specified and limited (see the section on Deductive Logic above). Predicate Logic is also able to give an account of quantifiers general enough to express all arguments occurring in natural language, thus allowing the solution of the problem of multiple generality that had perplexed medieval logicians.

For instance, it is intuitively clear that if:

Some cat is feared by every mouse

then it follows logically that:

All mice are afraid of at least one cat

but because the sentences above each contain two quantifiers ('some' and 'every' in the first sentence and 'all' and 'at least one' in the second sentence), they cannot be adequately represented in traditional logic.

Predicate logic was designed as a form of mathematics, and as such is capable of all sorts of mathematical reasoning beyond the powers of term or syllogistic logic. In first-order logic (also known as first-order predicate calculus), a predicate can only refer to a single subject, but predicate logic can also deal with second-order logic, higher-order logic, many-sorted logic or infinitary logic. It is also capable of many commonsense inferences that elude term logic, and (along with Propositional Logic - see below) has all but supplanted traditional term logic in most philosophical circles.

A logical fallacy is any sort of mistake in reasoning or inference, or, essentially, anything that causes an argument to go wrong. There are two main categories of fallacy, Fallacies of Ambiguity and Contextual Fallacies:

Fallacies of Ambiguity: a term is ambiguous if it has more than one meaning. There are two main types:

equivocation: where a single word can be used in two different senses.

amphiboly: where the ambiguity arises due to sentence structure (often due to dangling participles or the inexact use of negatives), rather than the meaning of individual words.

Contextual Fallacies: which depend on the context or circumstances in which sentences are used. There are many different types, among the more common of which are:

Fallacies of Significance: where it is unclear whether an assertion is significant or not.

Fallacies of Emphasis: the incorrect emphasis of words in a sentence.

Fallacies of Quoting Out of Context: the manipulation of the context of a quotation.

Fallacies of Argumentum ad Hominem: a statement cannot be shown to be false merely because the individual who makes it can be shown to be of defective character.

Fallacies of Arguing from Authority: truth or falsity cannot be proven merely because the person saying it is considered an "authority" on the subject.

Fallacies of Arguments which Appeal to Sentiments: reporting how people feel about something in order to persuade rather than prove.

Fallacies of Argument from Ignorance: a statement cannot be proved true just because there is no evidence to disprove it.

Fallacies of Begging the Question: a circular argument, where effectively the same statement is used both as a premise and as a conclusion.

Fallacies of Composition: the assumption that what is true of a part is also true of the whole.

Fallacies of Division: the converse assumption that what is true of a whole must be also true of all of its parts.

Fallacies of Irrelevant Conclusion: where the conclusion concerns something other than what the argument was initially trying to prove.

Fallacies of Non-Sequitur: an argumentative leap, where the conclusion does not necessarily follow from the premises.

Fallacies of Statistics: statistics can be manipulated and biased to "prove" many different hypotheses.

A paradox is a statement or sentiment that is seemingly contradictory or opposed to common sense and yet is perhaps true in fact. Conversely, a paradox may be a statement that is actually self-contradictory (and therefore false) even though it appears true. Typically, either the statements in question do not really imply the contradiction, the puzzling result is not really a contradiction, or the premises themselves are not all really true or cannot all be true together.

The recognition of ambiguities, equivocations and unstated assumptions underlying known paradoxes has led to significant advances in science, philosophy and mathematics. But many paradoxes (e.g. Curry's Paradox) do not yet have universally accepted resolutions.

It can be argued that there are four classes of paradoxes:

Veridical Paradoxes: which produce a result that appears absurd but can be demonstrated to be nevertheless true.

Falsidical Paradoxes: which produce a result that not only appears false but actually is false.

Antinomies: which are neither veridical nor falsidical, but produce a self-contradictory result by properly applying accepted ways of reasoning.

Dialetheias: which produce a result which is both true and false at the same time and in the same sense.

Paradoxes often result from self-reference (where a sentence or formula refers to itself directly), infinity (an argument which generates an infinite regress, or infinite series of supporting references), circular definitions (in which a proposition to be proved is assumed implicitly or explicitly in one of the premises), vagueness (where there is no clear fact of the matter whether a concept applies or not), false or misleading statements (assertions that are either willfully or unknowingly untrue or misleading), and half-truths (deceptive statements that include some element of truth).

Some famous paradoxes include:

Epimenides' Liar Paradox: Epimenides was a Cretan who said "All Cretans are liars." Should we believe him?

Liar Paradox (2): "This sentence is false."

Liar Paradox (3): "The next sentence is false. The previous sentence is true."

Curry's Paradox: "If this sentence is true, then Santa Claus exists."

Quine's Paradox: "yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.

Russell's Barber Paradox: If a barber shaves all and only those men in the village who do not shave themselves, does he shave himself?

Grandfather Paradox: Suppose a time traveller goes back in time and kills his grandfather when the latter was only a child. If his grandfather dies in childhood, then the time traveller cannot be born. But if the time traveller is never born, how can he have travelled back in time in the first place?

Zeno's Dichotomy Paradox: Before a moving object can travel a certain distance (e.g. a person crossing a room), it must get halfway there. Before it can get halfway there, it must get a quarter of the way there. Before travelling a quarter, it must travel one-eighth; before an eighth, one-sixteenth; and so on. As this sequence goes on forever, an infinite number of points must be crossed, which is logically impossible in a finite period of time, so the distance will never be covered (the room crossed, etc).

Zeno's Paradox of Achilles and the Tortoise: If Achilles allows the tortoise a head start in a race, then by the time Achilles has arrived at the tortoise's starting point, the tortoise has already run on a shorter distance. By the time Achilles reaches that second point, the tortoise has moved on again, etc, etc. So Achilles can never catch the tortoise.

Zeno's Arrow Paradox: If an arrow is fired from a bow, then at any moment in time, the arrow either is where it is, or it is where it is not. If it moves where it is, then it must be standing still, and if it moves where it is not, then it can't be there. Thus, it cannot move at all.

Theseus' Ship Paradox: After Theseus died, his ship was put up for public display. Over time, all of the planks had rotted at one time or another, and had been replaced with new matching planks. If nothing remained of the actual "original" ship, was this still Theseus' ship?

Sorites (Heap of Sand) Paradox: If you take away one grain of sand from a heap, it is still a heap. If grains are individually removed, is it still a heap when only one grain remains? If not, when did it change from a heap to a non-heap?

Hempel's Raven Paradox: If all ravens are black, then in strict terms of logical equivalence, everything that is not black is not a raven. So every sighting of a blue sweater or a red cup confirms the hypothesis that all ravens are black.

Petronius' Paradox" "Moderation in all things, including moderation."

Paradoxical Notice: "Please ignore this notice."

Dull Numbers Paradox: If there is such a thing as an dull number, then we can divide all numbers into two sets - interesting and dull. In the set of dull numbers there will be only one number that is the smallest. Since it is the smallest dull number it becomes, ipso facto, an interesting number. We must therefore remove it from the dull set and place it in the other. But now there will be another smallest uninteresting number. Repeating this process will make any dull number interesting.

Protagoras' Pupil Paradox: A lawyer made an arrangement with one of his pupils whereby the pupil was to pay for his instruction after he had won his first case. After a while, the lawyer grew impatient with the pupil's lack of clients, and decided to sue him for the amount owed. The lawyer's logic was that if he, the lawyer, won, the pupil would pay him according to the judgment of the court; if the pupil won, then he would have to honour the agreement and pay anyway. The pupil, however, argued that if he, the pupil, won, then by the judgment of the court he need not pay the lawyer; and if the lawyer won, then the agreement did not come into force and the pupil need not pay the lawyer.

Moore's paradox: "It will rain but I don't believe that it will."

Schrödinger's Cat: There is a cat in a sealed box, and the cat's life or death is dependent on the state of a particular subatomic particle. According to quantum mechanics, the particle only has a definite state at the exact moment of quantum measurement, so that the cat remains both alive and dead until the moment the box is opened.

"Turtles all the way down": A story about an infinite regress, often attributed to Bertrand Russell but probably dating from centuries earlier, based on an old (possibly Indian) cosmological myth that the earth is a flat disk supported by a giant elephant that is in turn supported by a giant turtle. In the story, when asked what then supported the turtle, the response was "it's turtles all the way down".