Seven years ago, when John O’Reilly arrived at Brooklyn’s Academy of Arts & Letters, nearly three quarters of the middle school’s students came from low-income families — mirroring the demographics of District 13, where the school is located.

Now, O’Reilly estimates those students make up less than 40 percent of the school’s population, and their numbers are declining annually as Arts & Letters’ growing popularity and new elementary school have made it a desirable destination for middle-class families in the gentrifying district.

O’Reilly, promoted to principal at the popular Fort Greene school in 2012, wants to make sure that the school doesn’t completely “flip,” or stop serving poor children.

“I need to find a way to hold on to that,” he said. “We are better all together than when we are apart, and we need more schools to look like that.”

The challenge of gentrification, and a potential solution

O’Reilly’s sentiment is something on the mind of many educators working in pockets of the city school system that are rapidly gentrifying.

While some neighborhood schools have attracted more affluent families, other nearby schools continue to serve mostly poor students. Advocates of integrated schools say that mixing these students more evenly is a crucial strategy to combat inequity. They cite research that shows low-income students learn more when they attend class with more affluent students — and, contrary to some parents’ fears, affluent students do not see their performance decline.

“This goes to the heart of what de Blasio is talking about,” said Richard Kahlenberg, a senior fellow at the Century Foundation who has studied the issue for nearly two decades. “The ‘two cities’ he talks about is directly correlated to segregation in the school system.”

O’Reilly believes he’s found his own way to address the issue at Arts & Letters, which admits students through an admissions lottery. He wants to reserve a portion of seats — up to 40 percent — for low-income students.

The idea has support from his parents and a district-wide task force on diversity, plus “verbal confirmation” from the Department of Education to begin in the 2015-2016 school year, O’Reilly wrote in a weekly dispatch posted online in December, though a spokesman for the department said no decision had yet been made.

Setting lottery “set-asides”  that favor certain types of students is common in the charter school world, but it’s unusual for schools run by the city. In fact, a similar practice was eliminated in a lower Manhattan district under the Bloomberg administration, which standardized enrollment policies to favor a pure choice model for families.

Engineering socioeconomic diversity is a delicate and often controversial pursuit. Most elementary schools admit students based on where they live, making diverse student bodies unlikely. In many parts of the city that have few middle-class residents, achieving a class balance within schools is unrealistic.

And setting aside seats for low-income applicants inevitably means keeping out more affluent families who are pining for a seat in O’Reilly’s school, which last year received more than six applications for every available slot. It’s a tension that O’Reilly knows he will face as the plan gets closer to becoming a reality.

In early, theoretical conversations with parents about diversity, “I only got positive feedback,” O’Reilly said.  “It’s only been since I said I believe this is going to happen that people have expressed concern.”

A unique opportunity, and recent history, in District 13

Still, advocates see the not-fully-gentrified District 13 as being particularly ripe for establishing socioeconomically integrated schools.

A few blocks away from Arts & Letters are two sprawling low-income housing projects and the shelter that until recently housed Dasani, the girl whose life the New York Times chronicled late last year. Her zoned elementary school, P.S. 67, 96 percent of student receive a lunch subsidy and more than 10 percent are homeless, according to InsideSchools.

At the same time, the median family income in Fort Greene jumped by $10,000 from 2009 to 2012, according to recent census estimates. In nearby Clinton Hill and Bedford-Stuyvesant, it increased at roughly the same rate.

The gentrification has had an impact on District 13 schools, with mixed results.

A decade ago, P.S. 8 in Brooklyn Heights was under-enrolled, and most students were poor and came from outside its attendance zone. David Goldsmith, whose daughter attended the school at the time, recalled that he used to beg other middle-class parents to take a chance on the school.

“They were fearful of class and race issues,” said Goldsmith, whose daughter attended middle school at Arts & Letters during its early years.

Parents were eventually won over by new administrators who joined the school in 2003. The school flipped shortly afterward. Now, the school is bursting at the seams, and only 18 percent of students qualify for free or reduced price lunch.

But at P.S. 11 in Clinton Hill, parents have struggled to make the same case to their new neighbors, especially after Community Roots Charter School opened in 2006 and again in 2011, when Arts & Letters started an elementary school. The expansion caused friction at P.S. 11 and P.S. 20, which shares a building as Arts & Letters, because it was seen as siphoning off middle-class families.

The district-wide task force on diversity wants to manage the demographic changes in District 13 so that the effect on schools isn’t determined by competition. Led by parents, including Goldsmith; a handful of principals, including O’Reilly; and Superintendent Barbara Freeman, the task force has been studying districts where integration policies have been implemented, such as Wake County, N.C., and Cambridge, Mass., and are developing a plan to establish more diverse schools in District 13.

The group wants to build on the momentum established by a handful of recent enrollment initiatives in the district. In one case, Freeman and the superintendent of District 15, which includes much of middle-class Brownstone Brooklyn, together applied last year for funds from the U.S. Department of Education that would let four schools with high concentrations of poor and nonwhite students open new programs in an effort to woo more affluent and white students from both districts.

At the same time, P.S. 133, another District 13 school, was reopening with an innovative admissions model. This year, P.S. 133 began enrolling students from both District 13 and District 13, while also setting quotas for low-income students and students who are learning English.

Goldsmith said it’s still too early to know what policies the task force will end up proposing. But he said he’d like to eventually develop a districtwide version of the weighted lottery model at P.S. 133.

Known nationally as “controlled choice,” the model’s aim is to offer an integrated education to all students in the district. No student is mandated to attend a school based on where they live. Instead, students are sorted based on a combination family preference, proximity, and prioritized demographic or achievement factors. Admission is often determined by set-aside lotteries at oversubscribed schools and then tweaked so that each school reflected the overall district’s student population.

Goldsmith acknowledged that in order for such a system to work, it needs broad support.

“These plans have to come from the community,” he said. “They have to come from the ground up.”

An uncertain future for controlled choice

How quickly the task force could build public support and turn controlled choice into reality remains unclear. Even at Arts & Letters, O’Reilly said he knows that there are plenty of unanswered questions.

One question is technical: How will students be identified as middle-class or poor before they are admitted, since that information is generally collected once students are already enrolled?

Others are political: Will the new administration at the Department of Education keep the informal promise that O’Reilly said he received last year to move forward with his plans for a weighted lottery?

De Blasio has said little about what he’d do to change enrollment policies under the Bloomberg administration. For him, the primary engines to address the socioeconomic and racial achievement gap are through expanding early education and lengthening the middle school day. Chancellor Carmen Fariña signaled support for creating more schools like P.S. 133 during a recent meeting with District 15 parents, but said, “These things take a long time.”

And then there’s the crucial question of public support: Will middle-class families, whose chances of admission to one of District 13’s most desirable schools would fall under the proposal, lobby against the plan? And will they choose to attend often lower-performing schools with many poor students, or will they curb the experiment by leaving the district?

Roberta Davenport, principal of P.S. 307 and another task force member, is optimistic that local residents will come to appreciate all of the options in the district.

P.S. 307 is one of three schools in the district, along with P.S. 15 in Red Hook, to have won the federal grant to create magnet programs aimed at attracting diverse families. The school, which is wedged among the Farragut Public Houses in Vinegar Hill and serves subsidized lunch 90 percent of students, received $1.8 million to develop its science and technology offerings.

Davenport said she hopes the new program — along with a program for autistic students — would attract more families from outside P.S. 307’s zone. In the future, she said, she anticipates her school’s high proportion of low-income students to drop.

“Each school will hopefully have something unique to offer,” said Davenport, who grew up in the same Farragut houses where many of her students live today. “It’s part of the vision for District 13. We are a district of choice.”