Media playback is unsupported on your device Media caption Trump constantly worries about the trade deficit - should we?

President Donald Trump has lashed out at his partners in the G7 group of leading rich economies following a summit in Canada.

He wrote some highly critical tweets which appear to be a response to comments from the host, the Canadian Prime Minister Justin Trudeau, who said that Canada would respond to new tariffs - taxes on imports - imposed by the US on steel and aluminium.

President Trump's tweets complained about the defence spending of US allies (too low in his view) and the trade barriers they impose (too high).

He also reminded the world that he is considering extra tariffs on imports of cars.

So does he have a point?

On trade he mentioned the possibility of further tariffs on "automobiles flooding the US market ".

It is certainly true that the US imports more cars than it exports. Last year, the US exported 52 billion dollars' worth of passenger cars but imported more than three times that amount.

It's also true that the US tariff on imported cars is relatively low - 2.5% compared to the EU's 10%, although Japan's are zero.

But it's often possible to pick particular products to make a point about how unfair a particular country is.

In the case of the US, you could take its tariffs of 25% on light vans.

To get a better indication of how much a country protects its own industry it makes more sense to look at average tariffs. There are several ways of calculating an average but the general picture that emerges is that the US has tariffs that are among the lowest. Other rich countries do tend to have slightly higher averages, though not by very much.

If we pick out agriculture, then the developed countries, including the US, do generally have higher tariffs than for industrial goods.

For farm trade the US averages are lower than other rich countries by a more significant margin.

President Trump in one of his latest tweets complained about Canada's 270% tariff on dairy imports. Canada does indeed have a highly regulated and protected dairy sector and one of the tariffs (on a specific type of dairy product) listed in the World Trade Organization database is indeed precisely that. There are others that are in the same very high range.

Media playback is unsupported on your device Media caption Dairy wars: Why is Trump threatening Canada over milk?

But the levels of tariffs that countries impose are to a large extent the outcome of negotiated agreements - globally within the World Trade Organisation (WTO) or between smaller groups of countries with trade deals such as the US, Canada and Mexico in the North American Trade Agreement (Nafta).

That is why President Trump often criticises previous administrations over the trade deals they have done.

He also often uses trade imbalances as evidence to demonstrate his view that the US is treated unfairly.

It is indeed true that the US has a deficit with the rest of the world - it imports more than it exports, to the tune of about half a trillion dollars. President Trump gave a larger figure of $800 billion, which is the deficit for goods only. It's partly offset by a surplus in services.

In any event most economists take the view that the trade balance is driven by savings and investment rather than trade policies. If a country saves less than it invests, it will have a trade deficit.

In another tweet, President Trump complained about the EU and Canada imposing what he called "non-monetary trade barriers against the US".

All countries have them, usually known as non-tariff barriers, or NTBs. There is a wide range. They include regulatory restrictions for safety or environmental reasons, labelling rules and restrictions on who can provide certain services.

Compared with tariffs, NTBs are much harder to quantify and compare.

There is often a perfectly good reason for the rules, but they can also make it more difficult for suppliers in other countries and it is possible that in some cases that is the aim.

To take some examples of NTBs in agriculture and food - and there are examples in many other areas too - US farm groups often complain that their products are excluded from the EU market by rules limiting the use of genetically modified crops, hormones in cattle and the now famous issue of chicken washed with chlorine.

The US also has its own regulatory barriers, including for example restrictions on some offal and on cheese made from unpasteurized milk. Haggis and many European cheeses are excluded by these rules.

On defence, President Trump wrote "....the U.S. pays close to the entire cost of NATO".

The US accounts for more than two thirds of all defence spending by Nato members. In terms of total defence spending, Nato has a guideline for its members - 2% of national income or GDP. The US is one of only six countries that meet the target (the UK is another).

Image copyright AFP

Calling that "close to the entire cost" is perhaps a bit of an exaggeration, but there is no question that the US does carry far more than its share of the financial burden.

He gave specific figures for the US (4% of GDP) and Germany (1%). The figures are correct but rounded to the nearest whole number. According to Nato the figures for 2017 are 3.58% for the US and 1.22% for Germany. That's a large gap, although rounding the numbers makes it look even bigger.

These figures refer to all defence spending. Spending on Nato's own costs is allocated in line with national GDP. The US pays 22.1% and Germany 14.8%.

But this is a very small share of defence spending. It makes more sense to focus on total budgets in this area. A Nato official put it like this:

"These national figures can be considered indirect contributions to NATO, because Allied armed forces contribute to our collective security."

Read more from Reality Check

Send us your questions

Follow us on Twitter