Lucky Alexander cautiously pushed open the door to the basement of a small apartment building in upper Manhattan. A large rat sprang from the darkness and rushed past. Alexander jumped backward. "The two of us were just trying to get out of each other's way," he said later with a laugh.

As a member of New York City's rat patrol, Alexander is accustomed to such encounter, but even he is surprised at the increase in the number of rats that run around fearlessly in daylight. After a recent bakery fire on Manhattan's Upper West Side, he recalled, so many rats gethered to feast on leftovers that panicked residents flagged down his pest-control truck for help.

The city Health Department's Bureau of Pest Control gets between 10,000 and 12,000 rat complaints in a normal year. But it received nearly 25 percent more in the last year.

New York's long-standing war with its rats usually is fought over the supply lines - the 25,000 tons of garbage discarded daily by city residents. Disposing of that much refuse is no small problem, and therein lies a tale of mind over matter.

Randy Dupree, director of environmental health programs, attributes the dramatic increase to the hard winter of 1977-78. While sanitation trucks were busy plowing snow, garbage often sat uncollected for days. That gave the rats a plentiful supply of food. When the traditional spring breeding period arrived, they already were in abundance, and their numbers grew alarmingly.

Anthony Vaccarello, sanitation commissioner, argues that both the garbage and the rat problem got much worse after the city passed laws limiting on-site incineration to help reduce air pollution. "It was a negative trade-off that created a lot more problems for the city," he said.

On-site incineration is "low-level burning." Because the garbage thronw down incinerator chuts consists of many different components - and often is wet, too - it tends to burn with a lot of unhealthy smoke.

In 1968 the city council prohibited installation of new, on-site incinerators and required conversion of existing units to compactors or upgrading to most higher air-quality standards.

Given the choice, most landlords opted for compactors. Robert Rickles, air resources commissioner, said that converting is cheaper than upgrading incinerators and many landlords were afraid more rigid and costly buring laws would follow, even if they complied with the new requirements.

Since the law went into effect, more than half of the city's 17,000 incinerators have been converted to compactors. Instead of garbage cans filled mainly with incerator ashes, giant plastic garbage bags now are propped up against building walls throughout the city. Torn and overflowing bags often block sidewalks right out to the gutter, attracting roaches and rats.

"The compactor program was not designed to minimize vermin problems," Rickies acknowledges.

Garbage is supposed to be compressed to one-quarter of its original volume before it is packed in plastic bags or containers - although it may start expanding again once the pressure is removed. Insecticide is supposed to be sprayed automatically in the machine, and property owner are expected to spary surrounding areas several times a week.

One compactor manufacturer estimates that of about 10,000 New York City building required to have compactors, more than half have cheaper machines that simply push raw garbage from collection bins into plastic bags without compacting it. In addition, landlords sometimes diluate inssecticide concentrates and fail to spray compactor rooms as often as required.

"The biggest problem is maintenance>" Dupree said. "The supers asre not doing their job."

The resulting vermin-infested compactor rooms and trash-filled streets create an even greater problem whenever garbage collections are delayed. And collections repeatedly have been delayed since 1975 for a very big reason - New York's fiscal problems.

The Sanitation Department has 4,000 fewer full-time employes than the 14,500 it had in 1974. This means less-fequent collections. Four years ago, 38 percent of the city had six collections a week and 42 percent of the city had two a week. Today no area gets six collections a week and 58 percent get only two weekly pickups.

On the bright side, the air over New York holds less incinerator soot than 10 years ago.

New York's Department of Environmental Protection reports a "noticeable reduction" in the level of particulates - sulfates, nitrates and trace metals - in the air.