As the United States of America commemorates 237 years of independence and 150 years since the bloody Battle of Gettysburg, the people of Egypt are engaged in their own tumultuous revolution. While remembering our own first principles as immortalized in the Declaration of Independence, what can we learn from Egypt's troubled relationship with democracy?

On June 30, 2012, Mohamed Morsi was sworn in as the first democratically elected president in Egyptian history. A leading member of the Muslim Brotherhood, Morsi defeated Ahmed Shafik, the former prime minister under deposed dictator Hosni Mubarak. Many Egyptians were uneasy with their choice in 2012 — an Islamist versus a holdover from the old regime. With 51.7% of the vote, however, the people spoke and Morsi became president, pledging to respect the limits of his office and the rights of the Egyptian people.

As the last year progressed, however, Morsi revealed himself to be a wolf in sheep's clothing. He pushed for a constitution that enshrined Islamic law in political life. In November he granted himself unlimited power to create laws without judicial review, prompting mass protests. His regime oversaw a crackdown on civil rights, persecution of Christians, women, and other minorities, and attempts to silence dissenters like comedian Bassem Youssef. On the year anniversary of his swearing in, the people of Egypt gathered once more in Tahrir Square and demanded his ouster. A few days later, the Egyptian military obliged and overthrew Morsi's government in a coup d'etat. The constitution has been suspended, Morsi is under house arrest, senior leaders of the Muslim Brotherhood are being detained, and Islamist media venues are being shuttered. An interim civilian government has been installed, led by former supreme court justice Adly Mansour.

The turn of events in Egypt is understandably causing many in the West, particularly in the United States, to wring their hands. With our devotion to the triumph of the ballot box, Americans are uncomfortable with a democratically elected government being overthrown by the military. After Morsi was elected, I posed this question at a dinner table one night: Do the people have the right to elect an Islamist — a tyrant — over themselves? The response received: "Of course!" If the people willed it, it was just.

Once upon a time, the belief in the supremacy of the majority was referred to as popular sovereignty. The debate over the limits of popular sovereignty was most famously fought by Abraham Lincoln and Stephen Douglas, circling the question of slavery. As the United States expanded west and invited more states into the Union, there was a question of whether they would be free states or slave states. Douglas, and the bulk of his Democratic Party, argued that the people in each territory should be able to decide, via the ballot box, if they wanted to live in a slave state or a free state. Lincoln, and his Republican Party, vehemently disagreed with the notion that people can justly vote on enslaving other people.

Abraham Lincoln argued, in opposing Douglas, that popular sovereignty was but another name for the tyranny of the majority. He said that the majority could not enslave a minority, as slavery violated the first principle of our republic that "All men are created equal." To Lincoln, popular sovereignty was "a living, creeping lie" masquerading as self-government. While the people ought to rule, and while the government ought to be, as Lincoln famously said, of the people, by the people, and for the people, there are limits to the power of the people, and a majority democracy can just as well as a military leader become a tyranny.

"It is the same principle in whatever shape it develops itself. It is the same spirit that says, 'You work and toil and earn bread, and I'll eat it.' No matter in what shape it comes, whether from the mouth of a king who seeks to bestride the people of his own nation and live by the fruit of their labor, or from one race of men as an apology for enslaving another race, it is the same tyrannical principle," said Lincoln.

Democracy is not the end of government, it is a tool. The end of government is the safeguard of liberty and equality in justice, neither of which can exist without the other. When government is divorced from these ends, it becomes tyrannical no matter what form it takes. Mohamed Morsi won an election and was granted power by the sovereign authority of the Egyptian people. In opposing liberty, equality, and justice, however, Mohamed Morsi violated the sovereignty of his countrymen, and they were justified in reclaiming the authority they had entrusted to him. While this was a coup, it was also a revolution.

Not every revolution ends well, though, and more often than not almost every coup results in more tyranny. Creating a just government that respects the rights of its citizens is difficult to do, and self-government is even more difficult to maintain. As the Supreme Council of the Armed Forces plots a transition to a democratic regime, the Egyptian people would do well to reflect on their rights as human beings and debate what form of government would work best for Egypt to maintain these rights. For its part, the United States should continue to encourage a focus on rights and, for the time being, avoid a hard push for the principle of democratic rule. Until rights are the focus of the Egyptian regime, democracy simply will not work.