The subject in a simple English sentence such as John runs, John is a teacher, or John was ran over by a car is the person or thing about whom the statement is made, in this case 'John'. Traditionally the subject is the word or phrase which controls the verb in the clause, that is to say with which the verb agrees (John is but John and Mary are). If there is no verb, as in John - what an idiot!, or if the verb has a different subject, as in John - I can't stand him!, then 'John' is not considered to be the grammatical subject, but can be described as the 'topic' of the sentence.
These definitions seem clear enough for simple sentences such as the above, problems in defining the subject arise when an attempt is made to extend the definitions to more complex sentences. For example, in the sentence It is difficult to learn French, the grammatical subject seems to be the word 'it', and yet arguably the 'real' subject (the thing that is difficult) is 'to learn French'. (A sentence such as It was John who broke the window is more complex still.) Sentences beginning with a locative phrase, such as There is a problem, isn't there?, in which the tag question 'isn't there?' seems to imply that the subject is the 'there', also create difficulties for the definition of subject.