A narrative foil that is a duplicate of one's self: a clone, person from another universe, a digital copy, a robot, or any other concept. Usually starts identical, then diverges, in a contrast of nature vs. nurture, i.e. inherent character vs. choices and ideology.
In a "mirror universe" everyone has a counterpart that is distinctively evil. The first officer of Enterprise, Mr. Spock, is cruel and has a goatee.
Data, a logical and caring android, has his counterpart in his brother Lore, a sociopathic and emotional android.
CLU is a copy of his programmer, Kevin Flynn, whose obsession with perfection causes CLU to become authoritarian. Meanwhile, Kevin himself learns to embrace chaos and beauty in emergent programs called "Isos".