Law consists of the rules established by society or government to regulate behavior and protect people from harm. It provides a framework for peaceful cooperation and it can be enforced through mechanisms such as courts or police. Laws can be written or unwritten, and are a source of scholarly inquiry in fields such as legal history, philosophy, sociology and economic analysis.
Legal systems vary widely, reflecting local culture and history. For example, Chinese law is based on Confucian values while Roman law was heavily influenced by Greek philosophy. Roman law was later adapted by the medieval courts and became a foundation for English common law. The laws of a country can be classified according to whether they are public or private, or whether they address rights, property or justice.
Even in a well-ordered society conflicts arise. When two people claim a piece of land, for example, the law can resolve the dispute by adjudicating who owns it. It can also ensure that people are treated fairly, for example by enforcing equal pay or a ban on discrimination.
The precise nature of law is complex and has been variously described as a science or as the art of justice. One theory is that law is a type of betting system, with its predictions about variables based on experience and observation. This theory is agnostic about the nature of human beings, and thus avoids the fundamental conflict between modern jurisprudence and Western notions of the dichotomy between natural and human/humane realities.