
674 P.2d 96 (1983)
STATE of Utah, Plaintiff and Respondent,
v.
Wendell Irving HILL, Defendant and Appellant.
No. 18180.
Supreme Court of Utah.
November 1, 1983.
Brooke C. Wells of Salt Lake Legal Defender Ass'n, Salt Lake City, for defendant and appellant.
David L. Wilkinson, Atty. Gen., Robert N. Parrish, Asst. Atty. Gen., Salt Lake City, for plaintiff and respondent.
OAKS, Justice:
This case turns on whether theft is a lesser included offense of aggravated robbery on the facts of this case.
The relationship of lesser included offenses is significant for two purposes. "A defendant [1] may be convicted of an offense included in the offense charged [2] but may not be convicted of both the offense charged and the included offense." U.C.A., 1953, § 76-1-402(3). In other words, conviction of a lesser included offense (1) is permitted as an alternate to the charged offense, but (2) is not permitted as an addition to it. This case involves the second issue  conviction and sentence for theft in addition to aggravated robbery.
The prosecution's evidence showed that defendant and a companion forced their way into the manager's apartment at the Stratford Hotel in downtown Salt Lake City. Defendant held a pistol. After threatening to kill the manager and a guest, the intruders bound and gagged the two occupants. They took a tape recorder, a TV, several items of radio equipment, and about $70 in cash from a desk. A few minutes later, defendant and his companion were arrested several blocks away in an automobile containing some currency, all *97 the items taken from the apartment, and the pistol used in the crime. As a result of this episode, defendant was charged with and convicted of four crimes, including aggravated robbery of the manager and theft from the manager. The court sentenced defendant to 5 years to life on aggravated robbery and to a concurrent lesser sentence on theft. On appeal, defendant challenges Only the conviction and sentence for theft, contending that it is improper in addition to the conviction for aggravated robbery because theft is a lesser included offense of aggravated robbery.
We conclude that for purposes of the prohibition against conviction "of both the offense charged and the included offense," § 76-1-402(3), the greater-lesser relationship must be determined by comparing the statutory elements of the two crimes as a theoretical matter and, where necessary, by reference to the facts proved at trial.
The principal test involves a comparison of the statutory elements of each crime. Subsection 76-1-402(3)(a) provides the definition of lesser included offenses that is applied for this purpose: an offense is lesser included when "[i]t is established by proof of the same or less than all the facts required to establish the commission of the offense charged... ." Thus, where the two crimes are "such that the greater cannot be committed without necessarily having committed the lesser," State v. Baker, Utah, 671 P.2d 152, 156 (1983), then as a matter of law they stand in the relationship of greater and lesser offenses, and the defendant cannot be convicted or punished for both. So it is with robbery and theft, which are generally acknowledged to occupy the greater-lesser relationship. State v. Elliott, Utah, 641 P.2d 122, 123 (1982); People v. Cole, 31 Cal.3d 568, 582, 645 P.2d 1182, 1191, 183 Cal. Rptr. 350, 359 (1982).[1]
The secondary test is required by the circumstance that some crimes have multiple variations, so that a greater-lesser relationship exists between some variations of these crimes, but not between others. E.g., State in Interest of L.G.W., Utah, 641 P.2d 127, 130-31 (1982) (forcible sexual abuse and lewdness). A theoretical comparison of the statutory elements of two crimes having multiple variations will be insufficient. In order to determine whether a defendant can be convicted and punished for two different crimes committed in connection with a single criminal episode, the court must consider the evidence to determine whether the greater-lesser relationship exists between the specific variations of the crimes actually proved at trial. The multiple variations of the crime of aggravated robbery involved in this case show why this is necessary.
Aggravated robbery is committed by using a firearm in one of three circumstances: "[1] in an attempt to commit, [2] during the commission of, or [3] in the immediate flight after the attempt or commission of a robbery." § 76-6-302(1) and (3). As the district court concluded, according to a theoretical comparison of the statutory elements of each crime, theft is not a lesser included offense of aggravated robbery because theft is not "established by proof of the same or less than all the facts required to establish the commission of [one variation of] the offense charged." § 76-1-402(3)(a). This is because the obtaining or exercising of unauthorized control over the property of another (an element of theft) is not an element of the first variation of aggravated robbery (use of a gun in an attempt to commit a robbery). In contrast, the greater-lesser relationship does exist between theft and the second variation of aggravated robbery (use of a gun during the commission of a robbery).
In this case, the only evidence before the jury showed a completed robbery, with *98 property taken from the person of the manager by use of a firearm, and the crime of theft as part of that same criminal episode. As to this variation of aggravated robbery, the crime of theft is a lesser included offense. Consequently, on the facts of this case § 76-1-402(3) clearly bars this defendant's being convicted and punished for theft in addition to aggravated robbery.
When a defendant has been improperly convicted of both a greater and a lesser offense, it is appropriate to regard the conviction on the lesser offense as mere surplusage, which does not invalidate the conviction and sentence on the greater offense. United States v. Howard, 507 F.2d 559 (8th Cir.1974).
The conviction for theft is reversed, and the sentence thereon is vacated. In all other respects, the judgments of conviction and the related sentences are affirmed.
HALL, C.J., STEWART and HOWE, JJ., and ERNEST F. BALDWIN, Jr., District Judge, concur.
DURHAM, J., having disqualified herself, does not participate herein; ERNEST F. BALDWIN, Jr., District Judge, sat.
NOTES
[1]  We have considered the State's argument that theft is not a lesser included offense of robbery because theft, as defined in § 76-6-404, requires a "purpose to deprive" (as defined in § 76-6-401(3)) the victim of the property, which is not an element of robbery as defined in § 76-6-301. We reject this argument because "purpose to deprive" is inherent in the act of robbery in view of the manner of taking specified in § 76-6-301.
