America’s companies and universities innovate like no other places on earth. We are garage start-ups, risk-taking entrepreneurs and intrepid scholars exploring new advances in science and technology. But that is only part of the story.

Many of Silicon Valley’s leaders got their start with grants from the federal government — including me. My graduate work in computer science in the 1970s and ’80s was funded in part by the National Science Foundation and the Defense Advanced Research Projects Agency.

But in recent years, Americans — Silicon Valley leaders included — have put too much faith in the private sector to ensure U.S. global leadership in new technology. Now we are in a technology competition with China that has profound ramifications for our economy and defense — a reality I have come to appreciate as chairman of two government panels on innovation and national security. The government needs to get back in the game in a serious way.

Important trends are not in our favor. America’s lead in artificial intelligence, for example, is precarious. A.I. will open new frontiers in everything from biotechnology to banking, and it is also a Defense Department priority. Leading the world in A.I. is essential to growing our economy and protecting our security. A recent study considering more than 100 metrics finds that the United States is well ahead of China today but will fall behind in five to 10 years. China also has almost twice as many supercomputers and about 15 times as many deployed 5G base stations as the United States. If current trends continue, China’s overall investments in research and development are expected to surpass those of the United States within 10 years, around the same time its economy is projected to become larger than ours.