Mayor Michael R. Bloomberg said Friday that he intended to eliminate 4,100 teaching jobs through layoffs, and about 2,000 through attrition, the first significant layoffs of teachers since the fiscal crisis of the 1970s.