Mammal

Mammals (formally Mammalia) are a class of vertebrate animals whose name is derived from their distinctive feature, mammary glands, with which they feed their young. They are also characterized by the possession of sweat glands, hair, three middle ear bones used in hearing, and a neocortex region in the brain.

Phylogenetically, Mammalia is defined as all descendants of the most recent common ancestor of monotremes (e.g., echidnas and platypuses) and therian mammals (marsupials and placentals). This means that some extinct groups of "mammals" are not members of the crown group Mammalia, even though most of them have all the characteristics that traditionally would have classified them as mammals. These "mammals" are now usually placed in the unranked clade Mammaliaformes.

The mammalian line of descent diverged from the reptile line at the end of the Carboniferous period. The majority of reptiles would evolve into modern-day reptiles and birds, while the synapsid branch led to mammals. The first true mammals appeared in the Jurassic period. Modern mammalian orders appeared in the Palaeocene and Eocene epochs of the Paleogene period.

Distinguishing features
Living mammal species can be identified by the presence of sweat glands, including those that are specialized to produce milk.

However, other features are required when classifying fossils, since soft tissue glands and some other features are not visible in fossils. Paleontologists use a distinguishing feature that is shared by all living mammals (including monotremes), but is not present in any of the early Triassic synapsids: mammals use two bones for hearing that were used for eating by their ancestors. The earliest synapsids had a jaw joint composed of the articular (a small bone at the back of the lower jaw) and the quadrate (a small bone at the back of the upper jaw). Most reptiles and non-mammalian synapsids use this system including lizards, crocodilians, dinosaurs (and their descendants the birds), and therapsids (mammal-like "reptiles"). Mammals have a different jaw joint, however, composed only of the dentary (the lower jaw bone which carries the teeth) and the squamosal (another small skull bone). In mammals the quadrate and articular bones have become the incus and malleus bones in the middle ear. Note: "non-mammalian synapsids" above implies that mammals are a sub-group of synapsids, and that is exactly what cladistics says they are.

Mammals also have a double occipital condyle: they have two knobs at the base of the skull which fit into the topmost neck vertebra, and other vertebrates have a single occipital condyle. Paleontologists use only the jaw joint and middle ear as criteria for identifying fossil mammals, since it would be confusing if they found a fossil that had one feature, but not the other.

Evolutionary history
Synapsida, the group which contains mammals and their extinct relatives, originated during the Pennsylvanian epoch, when they split from the lineage that led to reptiles and birds. Non-mammalian synapsids were once called "mammal-like reptiles", although they are usually no longer considered reptiles. Mammals evolved from non-mammalian synapsids during the Early Jurassic.

Evolution
The first fully terrestrial vertebrates were amniotes. Like the amphibians they evolved from, they had legs and lungs. Amniotes' eggs, however, had internal membranes which allowed the developing embryo to breathe but kept water in. This allowed amniotes to lay eggs on dry land, while amphibians generally need to lay their eggs in water.

The first amniotes apparently arose in the Late Carboniferous. They descended from earlier tetrapods, which lived on land already inhabited by insects, other invertebrates, ferns, mosses, and other plants. Within a few million years two important amniote lineages became distinct: the synapsids, which include mammals; and the sauropsids, which include lizards, snakes, crocodilians, dinosaurs and birds. Synapsids have a single hole (temporal fenestra) low on each side of the skull.

One synapsid group, the pelycosaurs, were the most common land vertebrates of the early Permian and included the largest land animals of the time.

Therapsids descended from pelycosaurs in the Middle Permian, about 260 Mya, and took over their position as the dominant land vertebrates. They differ from pelycosaurs in several features of the skull and jaws, including: larger temporal fenestrae; incisors which are equal in size. The therapsids went through a series of stages, beginning with animals which were very like their pelycosaur ancestors and ending with the Triassic cynodonts, some of which could easily be mistaken for mammals. Those stages were characterized by:
 * gradual development of a bony secondary palate.
 * the dentary gradually becomes the main bone of the lower jaw.
 * progress towards an erect limb posture, which would increase the animals' stamina by avoiding Carrier's constraint. But this process was slow and erratic - for example: all herbivorous therapsids retained sprawling limbs (some late forms may have had semi-erect hind limbs); Permian carnivorous therapsids had sprawling forelimbs, and some late Permian ones also had semi-sprawling hindlimbs. In fact modern monotremes still have semi-sprawling limbs.
 * in the Triassic, progress towards the mammalian jaw and middle ear.
 * there is possible evidence of hair in Triassic therapsids, but none for Permian therapsids.
 * some scientists have argued that some Triassic therapTrilophosaurussids show signs of lactation.

The Permian–Triassic extinction event ended the dominance of the therapsids, and in the Early Triassic all the medium to large land animal niches were taken over by early archosaurs, which were the ancestors of crocodilians, pterosaurs, dinosaurs and birds. After this "Triassic Takeover" the cynodonts and their descendants could only survive as small, mainly nocturnal insectivores. This may actually have accelerated the evolution of mammals - for example the surviving cynodonts and their descendants had to evolve towards warm-bloodedness because their small bodies would otherwise have lost heat quickly, especially as they were active mainly at night.

The first true mammals appeared in the Early Jurassic, over 70 million years after the first therapsids and approximately 30 million years after the first mammaliaformes. Hadrocodium appears to be in the middle of the transition to true mammal status — it had a mammalian jaw joint (formed by the dentary and squamosal bones), but there is some debate about whether its middle ear was fully mammalian.

The earliest known monotreme is Teinolophos, which lived about 123 Mya in Australia. Monotremes have some features which may be inherited from the original amniotes: Unlike other mammals, female monotremes do not have nipples and feed their young by "sweating" milk from patches on their bellies.
 * they use the same orifice to urinate, defecate and reproduce ("monotreme" means "one hole") - as lizards and birds also do.
 * they lay eggs which are leathery and uncalcified, like those of lizards, turtles and crocodilians.

The oldest known marsupial is Sinodelphys, found in 125 Mya Early Cretaceous shale in China's northeastern Liaoning Province. The fossil is nearly complete and includes tufts of fur and imprints of soft tissues. The living Eutheria ("true beasts") are all placentals. But the earliest known eutherian, Eomaia, found in China and dated to 125M years ago, has some features which are more like those of marsupials (the surviving metatherians): It is not certain when placental mammals evolved - the earliest undisputed fossils of placentals come from the early Paleocene, after the extinction of the dinosaurs.
 * Epipubic bones extending forwards from the pelvis, which are not found in any modern placental, but are found in marsupials, monotremes and mammaliformes such as multituberculates. In other words, they appear to be an ancestral feature which subsequently disappeared in the placental lineage.
 * A narrow pelvic outlet, which indicates that the young were very small at birth and therefore pregnancy was short, as in modern marsupials. This suggests that the placenta was a later development.

Mammals and near-mammals expanded out of their nocturnal insectivore niche from the mid Jurassic onwards - for example Castorocauda had adaptations for swimming, digging and catching fish.

The traditional view is that: mammals only took over the medium- to large-sized ecological niches in the Cenozoic, after the extinction of the dinosaurs; but then they diversified very quickly; for example the earliest known bat dates from about 50M years ago, only 15M years after the extinction of the dinosaurs.

On the other hand recent molecular phylogenetic studies suggest that most placental orders diverged about 100M to 85M years ago, but that modern families first appeared in the late Eocene and early Miocene But paleontologists object that no placental fossils have been found from before the end of the Cretaceous

During the Cenozoic several groups of mammals appeared which were much larger than their nearest modern equivalents - but none was even close to the size of the largest dinosaurs with similar feeding habits.

Earliest appearances of features
Hadrocodium, whose fossils date from the early Jurassic, provides the first clear evidence of fully mammalian jaw joints.

It has been suggested that the original function of lactation (milk production) was to keep eggs moist. Much of the argument is based on monotremes (egg-laying mammals):

The earliest clear evidence of hair or fur is in fossils of Castorocauda, from 164M years ago in the mid Jurassic. From 1955 onwards some scientists have interpreted the foramina (passages) in the maxillae (upper jaws) and premaxillae (small bones in front of the maxillae) of cynodonts as channels which supplied blood vessels and nerves to vibrissae (whiskers), and suggested that this was evidence of hair or fur. But foramina do not necessarily show that an animal had vibrissae - for example the modern lizard Tupinambis has foramina which are almost identical to those found in the non-mammalian cynodont Thrinaxodon. The evolution of erect limbs in mammals is incomplete — living and fossil monotremes have sprawling limbs. In fact some scientists think that the parasagittal (non-sprawling) limb posture is a synapomorphy (distinguishing characteristic) of the Boreosphenida, a group which contains the Theria and therefore includes the last common ancestor of modern marsupial and placentals - and therefore that all earlier mammals had sprawling limbs. Sinodelphys (the earliest known marsupial) and Eomaia (the earliest known eutherian) lived about 125M years ago, so erect limbs must have evolved before then.

It is currently very difficult to be confident when endothermy first appeared in the evolution of mammals. Modern monotremes have a lower body temperature and more variable metabolic rate than marsupials and placentals. So the main question is when a monotreme-like metabolism evolved in mammals. The evidence found so far suggests Triassic cynodonts may have had fairly high metabolic rates, but is not conclusive. In particular it is difficult to see how small animals can maintain a high and stable body temperature without fur.